@mcpjam/inspector 3.27.0 → 3.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/client/assets/{CaniuseCapabilityPage-CXmikV_v.js → CaniuseCapabilityPage-CrC-cTZL.js} +4 -4
  2. package/dist/client/assets/{CaniuseLoadingScreen-CISUL_K4.js → CaniuseLoadingScreen-DFga82Px.js} +2 -2
  3. package/dist/client/assets/{PosthogUtils-DE_PkwDN.js → PosthogUtils-BAwbC5iX.js} +2 -2
  4. package/dist/client/assets/{PosthogUtils-E_cG1Twh.js → PosthogUtils-C6QzDx66.js} +1 -1
  5. package/dist/client/assets/{access-link-C0MWhbv8.js → access-link-BJMsYDmK.js} +2 -2
  6. package/dist/client/assets/{app-bootstrap-DfSpCiag.js → app-bootstrap-DzzSTL6f.js} +328 -328
  7. package/dist/client/assets/{app-navigation-BQGUR9cb.js → app-navigation-CTBnrg26.js} +2 -2
  8. package/dist/client/assets/{bundle-mjs-DKP7sq7T.js → bundle-mjs-BGe1waGK.js} +2 -2
  9. package/dist/client/assets/{caniuse-bootstrap-D6d1Susz.js → caniuse-bootstrap-C-sKeXoq.js} +3 -3
  10. package/dist/client/assets/{chunk-D32TOXHM-D2CUPCH8.js → chunk-D32TOXHM-C-gMffNp.js} +5 -5
  11. package/dist/client/assets/{dead-clicks-autocapture-DvbdThCp.js → dead-clicks-autocapture-Bf2yz9Zr.js} +2 -2
  12. package/dist/client/assets/{error-reporting-CJClTLWK.js → error-reporting-C7685g3J.js} +2 -2
  13. package/dist/client/assets/{error-reporting-B_hxqtsN.js → error-reporting-DmYc69Ih.js} +1 -1
  14. package/dist/client/assets/{exception-autocapture-CkcPU7XW.js → exception-autocapture-C6yGegF5.js} +2 -2
  15. package/dist/client/assets/{feature-flags-BUIQpHKT.js → feature-flags-Cbn8gAeC.js} +3 -3
  16. package/dist/client/assets/{first-run-oauth-return-l9GCZrqg.js → first-run-oauth-return-CFW2tqzu.js} +2 -2
  17. package/dist/client/assets/{highlighted-body-KQOG7T2V-uT92T9zL.js → highlighted-body-KQOG7T2V-BufAIVu0.js} +2 -2
  18. package/dist/client/assets/{index-ByP2kceG.js → index-CCQWRMU8.js} +3 -3
  19. package/dist/client/assets/{jszip.min-C5LLiUXa.js → jszip.min-C6ASC0Lj.js} +2 -2
  20. package/dist/client/assets/{mcp-init-BIoRq6yl.js → mcp-init-BWmQoGiF.js} +3 -3
  21. package/dist/client/assets/{mermaid-MCJ5UELQ-BCP5Oj92.js → mermaid-MCJ5UELQ-84PBltPS.js} +1 -1
  22. package/dist/client/assets/{module-Wq_OenZL.js → module-BA6blRdw.js} +2 -2
  23. package/dist/client/assets/{module-D3s7YCoh.js → module-DovF9UUB.js} +1 -1
  24. package/dist/client/assets/posthog-bundled-extensions-Cs4q3GVP.js +3 -0
  25. package/dist/client/assets/{posthog-bundled-extensions-BIjySVP-.js → posthog-bundled-extensions-_dhL7VQK.js} +1 -1
  26. package/dist/client/assets/{posthog-recorder-DTh3r-Ko.js → posthog-recorder-BIqCIRJB.js} +2 -2
  27. package/dist/client/assets/{preload-helper-BN6vHXe1.js → preload-helper-CQSqs-Ur.js} +1 -1
  28. package/dist/client/assets/{project-route-CjZmQY5n.js → project-route-B8ycjI6Q.js} +2 -2
  29. package/dist/client/assets/{react-dom-DtL8G3gn.js → react-dom-DXowvrFG.js} +2 -2
  30. package/dist/client/assets/{rolldown-runtime-KtSMB9jY.js → rolldown-runtime-BlpueFg6.js} +1 -1
  31. package/dist/client/assets/{server-feature-flags-wgvQSqd5.js → server-feature-flags-CFqtsG2I.js} +2 -2
  32. package/dist/client/assets/{server-feature-flags-BBH-SYjw.js → server-feature-flags-yy8cq8x7.js} +1 -1
  33. package/dist/client/assets/{session-revoked-HpzxsCkX.js → session-revoked-BJat-_na.js} +2 -2
  34. package/dist/client/assets/{surveys-BYfLymeD.js → surveys-DSRAF-TV.js} +2 -2
  35. package/dist/client/assets/telemetry-files-58cade72c6da8102.js +1 -0
  36. package/dist/client/assets/{trace-timeline-BFtz0cI8.js → trace-timeline-BdQMiVa6.js} +1 -1
  37. package/dist/client/assets/{trace-timeline-CRxEZYCU.js → trace-timeline-CLTmhMpA.js} +2 -2
  38. package/dist/client/assets/{web-vitals-C1IvwuFq.js → web-vitals-BGMXZEXu.js} +2 -2
  39. package/dist/client/index.html +12 -12
  40. package/dist/server/harness-install-cli.js +3 -3
  41. package/dist/server/index.js +2 -2
  42. package/package.json +2 -2
  43. package/dist/client/assets/posthog-bundled-extensions-CQjB_Dfr.js +0 -3
  44. package/dist/client/assets/telemetry-files-5758eea65e761de9.js +0 -1
@@ -1,4 +1,4 @@
1
- import{o as Qh}from"./rolldown-runtime-KtSMB9jY.js";import{A as JS,O as Zh,S as em,c as KS,g as XS,h as QS,m as ZS,w as e0}from"./project-route-CjZmQY5n.js";import{C as tm,Dt as t0,E as r0,H as n0,M as o0,N as s0,P as rm,St as a0,T as Oc,U as i0,V as l0,_ as nm,g as om,h as sm,j as c0}from"./PosthogUtils-DE_PkwDN.js";import{n as u0,t as d0}from"./react-dom-DtL8G3gn.js";import{r as p0}from"./bundle-mjs-DKP7sq7T.js";import{$ as f0,$n as h0,$t as jc,Ar as dn,At as Dd,Cr as Ke,D as m0,Dr as am,Dt as g0,En as v0,Gt as Fd,Ht as im,It as y0,Jt as b0,Kt as S0,M as _0,Mt as x0,Ot as E0,P as w0,Qn as k0,Sr as Et,Tt as pn,Ut as I0,V as _a,Vt as C0,Wt as R0,Xt as T0,_r as A0,_t as lm,ar as N0,bn as P0,br as Ka,bt as cm,cr as Hd,ct as um,dr as M0,dt as O0,er as j0,et as L0,fn as Lc,fr as Ud,ft as Dc,gr as $d,gt as Sr,hr as D0,ht as F0,ir as H0,jr as q,jt as U0,kr as Uo,kt as $0,lr as dm,lt as Fc,mr as B0,mt as Ct,nn as z0,nr as pm,or as W0,ot as Bd,pr as fm,pt as Xa,qt as q0,rn as V0,rr as G0,sr as Y0,st as us,tr as J0,tt as K0,u as X0,ur as Q0,ut as hm,vr as zd,vt as Hc,xn as Z0,yn as e_,yr as Wd,yt as mm}from"./app-navigation-BQGUR9cb.js";import{At as t_,B as gm,Ct as xa,D as vm,Dt as ym,E as en,F as Qe,Ft as bm,Gt as Sm,Ht as Xt,I as eo,It as _m,Jt as Uc,Kt as $t,Lt as xm,Mt as r_,N as Fi,Nt as Em,O as n_,Ot as o_,Pt as wm,R as s_,Rt as km,St as $c,T as a_,Ut as ds,Wt as Bc,Xt as it,_ as i_,bt as l_,c as to,ct as Nr,d as ro,g as c_,jt as Im,kt as u_,l as no,m as d_,n as vr,vt as Cm,xt as p_,yt as f_,zt as h_}from"./feature-flags-BUIQpHKT.js";import{R as Hi,U as qd,g as Vd,v as m_,y as g_}from"./mcp-init-BIoRq6yl.js";import{$ as v_,$t as zc,An as y_,At as Gd,B as Yd,Bn as Pr,Bt as Ze,C as b_,Cn as Wc,Ct as S_,Dn as Mr,Dt as __,En as x_,Et as Ui,F as Jd,Fn as qc,Ft as Kd,G as Xd,Gn as Qd,Gt as me,H as Rm,Hn as E_,Ht as w_,I as $i,In as Dn,It as Ea,J as k_,Jn as Tm,Jt as I_,K as Am,Kn as Nm,Kt as je,L as C_,Ln as R_,Lt as ps,M as T_,Mn as Pm,Mt as A_,N as Mm,Nn as wa,Nt as fn,On as Om,Ot as zn,P as Vc,Pn as Wn,Pt as jm,Q as sa,Qt as N_,R as Lm,Rn as P_,Rr as Zd,Rt as fs,S as M_,Sn as _t,St as oo,Tn as ep,Tt as O_,U as j_,Un as hs,Ut as hr,V as tp,Vn as L_,Vt as D_,W as Gc,Wn as z,Wt as F_,X as $o,Xn as He,Xt as Qa,Y as nn,Yn as rp,Yt as H_,Z as er,Zn as te,Zt as Dm,_ as U_,_n as Fm,_t as $_,an as Za,at as B_,b as z_,bn as qn,bt as W_,cn as Tl,ct as Al,dn as Io,dt as Ae,en as Nl,et as q_,f as Bi,fn as aa,ft as Hm,gn as V_,gt as G_,hn as Yc,ht as Y_,in as ot,io as Lt,it as ia,jn as so,jt as Um,kn as Jc,kt as np,ln as op,lt as ei,mn as Qt,mt as J_,nn as K_,no as $m,nt as mt,on as dt,ot as X_,pn as sp,pt as Q_,q as hn,qn as Kc,qt as Hr,rn as ap,rt as Z_,sn as Fn,st as ex,tn as Bm,to as tx,tt as pt,un as Jr,ut as Co,v as rx,vn as ao,vt as nx,w as ox,wn as sx,wt as ax,xn as ix,xt as Bo,y as ip,yn as lx,yt as cx,z as Pl,zn as lp,zt as yr}from"./error-reporting-CJClTLWK.js";import{t as ux}from"./preload-helper-BN6vHXe1.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.27.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5f30689e-465c-407b-a9bc-ea6121bc0d4c",e._sentryDebugIdIdentifier="sentry-dbid-5f30689e-465c-407b-a9bc-ea6121bc0d4c")}catch{}})();var dx=Qh(d0(),1),f=Qh(u0(),1),u=p0(),px=Object.defineProperty,Rt=(e,t)=>px(e,"name",{value:t,configurable:!0}),Xc="Dialog",[zm,b$]=Uc(Xc),[fx,Wt]=zm(Xc),Wm=Rt(e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,i=f.useRef(null),l=f.useRef(null),[c,p]=Bc({prop:n,defaultProp:o??!1,onChange:s,caller:Xc}),[d,h]=f.useState(0),[m,g]=f.useState(0);return(0,u.jsx)(fx,{scope:t,triggerRef:i,contentRef:l,contentId:Xt(),titleId:Xt(),descriptionId:Xt(),titlePresent:d>0,descriptionPresent:m>0,setTitleCount:h,setDescriptionCount:g,open:c,onOpenChange:p,onOpenToggle:f.useCallback(()=>p(S=>!S),[p]),modal:a,children:r})},"Dialog"),hx="DialogTrigger",mx=f.forwardRef(Rt(function(t,r){const{__scopeDialog:n,...o}=t,s=Wt(hx,n),a=dn(r,s.triggerRef);return(0,u.jsx)(it.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":ti(s.open),...o,ref:a,onClick:$t(t.onClick,s.onOpenToggle)})},"DialogTrigger")),qm="DialogPortal",[gx,Vm]=zm(qm,{forceMount:void 0}),Gm=Rt(e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,s=Wt(qm,t);return(0,u.jsx)(gx,{scope:t,forceMount:r,children:f.Children.map(n,a=>(0,u.jsx)(ds,{present:r||s.open,children:(0,u.jsx)(_m,{asChild:!0,container:o,children:a})}))})},"DialogPortal"),Ml="DialogOverlay",Ym=f.forwardRef(Rt(function(t,r){const n=Vm(Ml,t.__scopeDialog),{forceMount:o=n.forceMount,...s}=t,a=Wt(Ml,t.__scopeDialog);return a.modal?(0,u.jsx)(ds,{present:o||a.open,children:(0,u.jsx)(yx,{...s,ref:r})}):null},"DialogOverlay")),vx=am("DialogOverlay.RemoveScroll"),yx=f.forwardRef(Rt(function(t,r){const{__scopeDialog:n,...o}=t,s=Wt(Ml,n),a=h_(),i=dn(r,a);return(0,u.jsx)(wm,{as:vx,allowPinchZoom:!0,shards:[s.contentRef],children:(0,u.jsx)(it.div,{"data-state":ti(s.open),...o,ref:i,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),zo="DialogContent",Jm=f.forwardRef(Rt(function(t,r){const n=Vm(zo,t.__scopeDialog),{forceMount:o=n.forceMount,...s}=t,a=Wt(zo,t.__scopeDialog);return(0,u.jsx)(ds,{present:o||a.open,children:a.modal?(0,u.jsx)(bx,{...s,ref:r}):(0,u.jsx)(Sx,{...s,ref:r})})},"DialogContent")),bx=f.forwardRef(Rt(function(t,r){const n=Wt(zo,t.__scopeDialog),o=f.useRef(null),s=dn(r,n.contentRef,o);return f.useEffect(()=>{const a=o.current;if(a)return Em(a)},[]),(0,u.jsx)(Km,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:$t(t.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:$t(t.onPointerDownOutside,a=>{const i=a.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&a.preventDefault()}),onFocusOutside:$t(t.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),Sx=f.forwardRef(Rt(function(t,r){const n=Wt(zo,t.__scopeDialog),o=f.useRef(!1),s=f.useRef(!1);return(0,u.jsx)(Km,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||n.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})},"DialogContentNonModal")),Km=f.forwardRef(Rt(function(t,r){const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,...i}=t,l=Wt(zo,n);return bm(),(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(xm,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:(0,u.jsx)(km,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":ti(l.open),...i,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),_x="DialogTitle",xx=f.forwardRef(Rt(function(t,r){const{__scopeDialog:n,...o}=t,s=Wt(_x,n),{setTitleCount:a}=s;return Sm(()=>(a(i=>i+1),()=>a(i=>i-1)),[a]),(0,u.jsx)(it.h2,{id:s.titleId,...o,ref:r})},"DialogTitle")),Ex="DialogDescription",wx=f.forwardRef(Rt(function(t,r){const{__scopeDialog:n,...o}=t,s=Wt(Ex,n),{setDescriptionCount:a}=s;return Sm(()=>(a(i=>i+1),()=>a(i=>i-1)),[a]),(0,u.jsx)(it.p,{id:s.descriptionId,...o,ref:r})},"DialogDescription")),kx="DialogClose",Xm=f.forwardRef(Rt(function(t,r){const{__scopeDialog:n,...o}=t,s=Wt(kx,n);return(0,u.jsx)(it.button,{type:"button",...o,ref:r,onClick:$t(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function ti(e){return e?"open":"closed"}Rt(ti,"getState");var Ix=Object.defineProperty,tr=(e,t)=>Ix(e,"name",{value:t,configurable:!0}),Qc="Popover",[Qm,S$]=Uc(Qc,[Im]),ms=Im(),[Cx,mn]=Qm(Qc),Rx=tr(e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:a=!1}=e,i=ms(t),l=f.useRef(null),[c,p]=f.useState(!1),[d,h]=Bc({prop:n,defaultProp:o??!1,onChange:s,caller:Qc});return(0,u.jsx)(t_,{...i,children:(0,u.jsx)(Cx,{scope:t,contentId:Xt(),triggerRef:l,open:d,onOpenChange:h,onOpenToggle:f.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:c,onCustomAnchorAdd:f.useCallback(()=>p(!0),[]),onCustomAnchorRemove:f.useCallback(()=>p(!1),[]),modal:a,children:r})})},"Popover"),Tx="PopoverAnchor",Ax=f.forwardRef(tr(function(t,r){const{__scopePopover:n,...o}=t,s=mn(Tx,n),a=ms(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=s;return f.useEffect(()=>(i(),()=>l()),[i,l]),(0,u.jsx)(ym,{...a,...o,ref:r})},"PopoverAnchor")),Nx="PopoverTrigger",Px=f.forwardRef(tr(function(t,r){const{__scopePopover:n,...o}=t,s=mn(Nx,n),a=ms(n),i=dn(r,s.triggerRef),l=(0,u.jsx)(it.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Zc(s.open),...o,ref:i,onClick:$t(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:(0,u.jsx)(ym,{asChild:!0,...a,children:l})},"PopoverTrigger")),Zm="PopoverPortal",[Mx,Ox]=Qm(Zm,{forceMount:void 0}),jx=tr(e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,s=mn(Zm,t);return(0,u.jsx)(Mx,{scope:t,forceMount:r,children:(0,u.jsx)(ds,{present:r||s.open,children:(0,u.jsx)(_m,{asChild:!0,container:o,children:n})})})},"PopoverPortal"),Wo="PopoverContent",Lx=f.forwardRef(tr(function(t,r){const n=Ox(Wo,t.__scopePopover),{forceMount:o=n.forceMount,...s}=t,a=mn(Wo,t.__scopePopover);return(0,u.jsx)(ds,{present:o||a.open,children:a.modal?(0,u.jsx)(Fx,{...s,ref:r}):(0,u.jsx)(Hx,{...s,ref:r})})},"PopoverContent")),Dx=am("PopoverContent.RemoveScroll"),Fx=f.forwardRef(tr(function(t,r){const n=mn(Wo,t.__scopePopover),o=f.useRef(null),s=dn(r,o),a=f.useRef(!1);return f.useEffect(()=>{const i=o.current;if(i)return Em(i)},[]),(0,u.jsx)(wm,{as:Dx,allowPinchZoom:!0,children:(0,u.jsx)(eg,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$t(t.onCloseAutoFocus,i=>{i.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:$t(t.onPointerDownOutside,i=>{const l=i.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,p=l.button===2||c;a.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:$t(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Hx=f.forwardRef(tr(function(t,r){const n=mn(Wo,t.__scopePopover),o=f.useRef(!1),s=f.useRef(!1);return(0,u.jsx)(eg,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||n.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})},"PopoverContentNonModal")),eg=f.forwardRef(tr(function(t,r){const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:p,onInteractOutside:d,...h}=t,m=mn(Wo,n),g=ms(n);return bm(),(0,u.jsx)(xm,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:(0,u.jsx)(km,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:p,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,u.jsx)(u_,{"data-state":Zc(m.open),role:"dialog",id:m.contentId,...g,...h,ref:r,style:{...h.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)"}})})})},"PopoverContentImpl")),Ux=f.forwardRef(tr(function(t,r){const{__scopePopover:n,...o}=t,s=ms(n);return(0,u.jsx)(o_,{...s,...o,ref:r})},"PopoverArrow"));function Zc(e){return e?"open":"closed"}tr(Zc,"getState");var $x=Rx,Bx=Ax,zx=Px,Wx=jx,qx=Lx,_$=Ux,Vx=Object.defineProperty,Or=(e,t)=>Vx(e,"name",{value:t,configurable:!0}),eu="Switch",[Gx,x$]=Uc(eu),[Yx,tu]=Gx(eu);function tg(e){const{__scopeSwitch:t,checked:r,children:n,defaultChecked:o,disabled:s,form:a,name:i,onCheckedChange:l,required:c,value:p="on",internal_do_not_use_render:d}=e,[h,m]=Bc({prop:r,defaultProp:o??!1,onChange:l,caller:eu}),[g,S]=f.useState(null),[b,_]=f.useState(null),v=f.useRef(!1),[w,E]=f.useReducer(I=>I+1,0),T={checked:h,setChecked:m,disabled:s,control:g,setControl:S,name:i,form:a,value:p,hasConsumerStoppedPropagationRef:v,userInteractionCount:w,onUserInteraction:E,required:c,defaultChecked:o,isFormControl:g?!!a||!!g.closest("form"):!0,bubbleInput:b,setBubbleInput:_};return(0,u.jsx)(Yx,{scope:t,...T,children:rg(d)?d(T):n})}Or(tg,"SwitchProvider");var Jx="SwitchTrigger",Kx=f.forwardRef(Or(function({__scopeSwitch:t,onClick:r,...n},o){const{control:s,form:a,value:i,disabled:l,checked:c,required:p,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:S,bubbleInput:b}=tu(Jx,t),_=dn(o,d),v=f.useRef(c);return f.useEffect(()=>{const w=a?s?.ownerDocument.getElementById(a):s?.form;if(w instanceof HTMLFormElement){const E=Or(()=>h(v.current),"reset");return w.addEventListener("reset",E),()=>w.removeEventListener("reset",E)}},[s,a,h]),(0,u.jsx)(it.button,{type:"button",role:"switch","aria-checked":c,"aria-required":p,"data-state":ru(c),"data-disabled":l?"":void 0,disabled:l,value:i,...n,ref:_,onClick:$t(r,w=>{g(),h(E=>!E),b&&S&&(m.current=w.isPropagationStopped(),m.current||w.stopPropagation())})})},"SwitchTrigger")),Xx=f.forwardRef(Or(function(t,r){const{__scopeSwitch:n,name:o,checked:s,defaultChecked:a,required:i,disabled:l,value:c,onCheckedChange:p,form:d,...h}=t;return(0,u.jsx)(tg,{__scopeSwitch:n,checked:s,defaultChecked:a,disabled:l,required:i,onCheckedChange:p,name:o,form:d,value:c,internal_do_not_use_render:({isFormControl:m})=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Kx,{...h,ref:r,__scopeSwitch:n}),m&&(0,u.jsx)(tE,{__scopeSwitch:n})]})})},"Switch")),Qx="SwitchThumb",Zx=f.forwardRef(Or(function(t,r){const{__scopeSwitch:n,...o}=t,s=tu(Qx,n);return(0,u.jsx)(it.span,{"data-state":ru(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:r})},"SwitchThumb")),eE="SwitchBubbleInput",tE=f.forwardRef(Or(function({__scopeSwitch:t,onClick:r,...n},o){const{control:s,hasConsumerStoppedPropagationRef:a,userInteractionCount:i,checked:l,defaultChecked:c,required:p,disabled:d,name:h,value:m,form:g,bubbleInput:S,setBubbleInput:b}=tu(eE,t),_=dn(o,b),v=r_(s),w=f.useRef(!1),E=f.useRef(l),T=f.useRef(i);f.useEffect(()=>{const C=S;if(!C)return;const L=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(L,"checked").set,A=i!==T.current;T.current=i;const N=E.current!==l;E.current=l;const W=!(A&&a.current);if(N&&y){w.current=!A;const O=new Event("click",{bubbles:W});y.call(C,l),C.dispatchEvent(O),w.current=!1}},[S,l,a,i]);const I=f.useRef(l);return(0,u.jsx)(it.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??I.current,required:p,disabled:d,name:h,value:m,form:g,...n,tabIndex:-1,ref:_,onClick:$t(r,C=>{w.current&&C.stopPropagation()}),style:{...n.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function rg(e){return typeof e=="function"}Or(rg,"isFunction");function ru(e){return e?"checked":"unchecked"}Or(ru,"getState");var ng={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};ng.node;var og=Et(ng),sg={name:"bell",size:24,node:[["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"}]]};sg.node;var rE=Et(sg),ag={name:"download",size:24,node:[["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"}]]};ag.node;var nE=Et(ag),ig={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};ig.node;var oE=Et(ig),lg={name:"flask-conical",size:24,node:[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]};lg.node;var sE=Et(lg),cg={name:"funnel",size:24,node:[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],aliases:["filter"]};cg.node;var aE=Et(cg),ug={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};ug.node;var dg=Et(ug),pg={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};pg.node;var fg=Et(pg),hg={name:"moon",size:24,node:[["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"}]]};hg.node;var iE=Et(hg),mg={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};mg.node;var nu=Et(mg),gg={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};gg.node;var vg=Et(gg),yg={name:"sun",size:24,node:[["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"}]]};yg.node;var lE=Et(yg),bg={name:"trending-up",size:24,node:[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]};bg.node;var cE=Et(bg),Sg={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};Sg.node;var ri=Et(Sg),tn="com.mcpjam/tasks";function Rr(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function _g(e){const t=e?.mcpProfile;if(t!==void 0&&!Rr(t))return"invalid";const r=e?.mcpProfile?.extensions;if(r===void 0)return"unset";if(!Rr(r))return"invalid";if(!Object.prototype.hasOwnProperty.call(r,"com.mcpjam/tasks"))return"unset";const n=r[tn];if(!Rr(n)||!Object.prototype.hasOwnProperty.call(n,"enabled"))return"invalid";const o=n.enabled;return o===!0?"on":o===!1?"off":"invalid"}function E$(e){if(_g(e)!=="invalid")return;if(e?.mcpProfile!==void 0&&!Rr(e.mcpProfile))return'"mcpProfile" must be a plain JSON object.';const t=e?.mcpProfile?.extensions?.[tn];return Rr(e?.mcpProfile?.extensions)?Rr(t)?`"${tn}.enabled" must be true or false.`:`"${tn}" must be an object of the form { "enabled": true | false }.`:'"mcpProfile.extensions" must be a plain JSON object.'}function w$(e,t){const r=e??{};return{...r,mcpProfile:{...r.mcpProfile??{},extensions:{...Rr(r.mcpProfile?.extensions)?r.mcpProfile.extensions:{},[tn]:{enabled:t}}}}}function k$(e){const t=e??{},r=t.mcpProfile?.extensions;if(!Rr(r)||!Object.prototype.hasOwnProperty.call(r,"com.mcpjam/tasks"))return t;const{[tn]:n,...o}=r,{extensions:s,...a}=t.mcpProfile??{};if(Object.keys(o).length>0)return{...t,mcpProfile:{...a,extensions:o}};if(Object.keys(a).length>0)return{...t,mcpProfile:a};const{mcpProfile:i,...l}=t;return l}function I$(e,t){return t==="replay"?"off":t==="conformance"||t==="api"?e==="off"||e==="invalid"?"off":"expose":e==="off"||e==="invalid"?"off":e==="unset"?t==="tools"?"expose":"off":t==="eval"?"await":"expose"}var ni=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,oi=/^[\\/]{2}/;function xg(e,t){return t+e.replace(/\\/g,"/")}var C$=(function(e){return e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE",e})({}),cp="popstate";function up(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function uE(e={}){function t(n,o){let s=o.state?.masked,{pathname:a,search:i,hash:l}=s||n.location;return qo("",{pathname:a,search:i,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default",s?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function r(n,o){return typeof o=="string"?o:gt(o)}return pE(t,r,null,e)}function pe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function et(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function dE(){return Math.random().toString(36).substring(2,10)}function dp(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function qo(e,t,r=null,n,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?qt(t):t,state:r,key:t&&t.key||n||dE(),mask:o}}function gt({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function qt(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function pE(e,t,r,n={}){let{window:o=document.defaultView,v5Compat:s=!1}=n,a=o.history,i="POP",l=null,c=p();c==null&&(c=0,a.replaceState({...a.state,idx:c},""));function p(){return(a.state||{idx:null}).idx}function d(){i="POP";let b=p(),_=b==null?null:b-c;c=b,l&&l({action:i,location:S.location,delta:_})}function h(b,_){i="PUSH";let v=up(b)?b:qo(S.location,b,_);r&&r(v,b),c=p()+1;let w=dp(v,c),E=S.createHref(v.mask||v);try{a.pushState(w,"",E)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;o.location.assign(E)}s&&l&&l({action:i,location:S.location,delta:1})}function m(b,_){i="REPLACE";let v=up(b)?b:qo(S.location,b,_);r&&r(v,b),c=p();let w=dp(v,c),E=S.createHref(v.mask||v);a.replaceState(w,"",E),s&&l&&l({action:i,location:S.location,delta:0})}function g(b){return Eg(o,b)}let S={get action(){return i},get location(){return e(o,a)},listen(b){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(cp,d),l=b,()=>{o.removeEventListener(cp,d),l=null}},createHref(b){return t(o,b)},createURL:g,encodeLocation(b){let _=g(b);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:h,replace:m,go(b){return a.go(b)}};return S}function Eg(e,t,r=!1){let n="http://localhost";e&&(n=e.location.origin!=="null"?e.location.origin:e.location.href),pe(n,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:gt(t);return o=o.replace(/ $/,"%20"),!r&&oi.test(o)&&(o=n+o),new URL(o,n)}function fE(e){return{defaultValue:e}}var pp=class{#e=new Map;constructor(e){if(e)for(let[t,r]of e)this.set(t,r)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){this.#e.set(e,t)}},hE=new Set(["lazy","caseSensitive","path","id","index","children","unstable_validateParams"]);function mE(e){return hE.has(e)}var gE=new Set(["lazy","caseSensitive","path","id","index","middleware","children","unstable_validateParams"]);function vE(e){return gE.has(e)}function yE(e){return e.index===!0}function wg(e){let t={};return e.Component&&Object.assign(t,{element:f.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:f.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:f.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Vo(e,t=wg,r=[],n={},o=!1){return e.map((s,a)=>{let i=[...r,String(a)],l=typeof s.id=="string"?s.id:i.join("-");if(pe(s.index!==!0||!s.children,"Cannot specify children on an index route"),pe(o||!n[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),yE(s)){let c={...s,id:l};return n[l]=fp(c,t(c)),c}else{let c={...s,id:l,children:void 0};return n[l]=fp(c,t(c)),s.children&&(c.children=Vo(s.children,t,i,n,o)),c}})}function fp(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function bE(e,t,r="/"){return kg(e,t,r,!1)}function kg(e,t,r,n,o){let s=xt((typeof t=="string"?qt(t):t).pathname||"/",r);if(s==null)return null;let a=o??Cg(e),i=null,l=PE(s);for(let c=0;i==null&&c<a.length;++c)i=NE(a[c],l,n);return i}function Ig(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,loaderData:t[r.id],handle:r.handle}}function Cg(e){let t=Rg(e);return SE(t),t}function Rg(e,t=[],r=[],n="",o=!1){let s=(a,i,l=o,c)=>{let p={relativePath:c===void 0?a.path||"":c,caseSensitive:a.caseSensitive===!0,childrenIndex:i,route:a};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(n)&&l)return;pe(p.relativePath.startsWith(n),`Absolute route path "${p.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(n.length)}let d=Mt([n,p.relativePath]),h=r.concat(p);a.children&&a.children.length>0&&(pe(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Rg(a.children,t,h,d,l)),!(a.path==null&&!a.index)&&t.push({path:d,score:TE(d,a.index),routesMeta:h.map((m,g)=>{let[S,b]=Ng(m.relativePath,m.caseSensitive,g===h.length-1);return{...m,matcher:S,compiledParams:b}})})};return e.forEach((a,i)=>{if(a.path===""||!a.path?.includes("?"))s(a,i);else for(let l of Tg(a.path))s(a,i,!0,l)}),t}function Tg(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return o?[s,""]:[s];let a=Tg(n.join("/")),i=[];return i.push(...a.map(l=>l===""?s:[s,l].join("/"))),o&&i.push(...a),i.map(l=>e.startsWith("/")&&l===""?"/":l)}function SE(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:AE(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var _E=/^:[\w-]+$/,xE=/^:[\w-]+/,EE=3.5,wE=3,kE=2,IE=1,CE=10,RE=-2,hp=e=>e==="*";function TE(e,t){let r=e.split("/"),n=r.length;return r.some(hp)&&(n+=RE),t&&(n+=kE),r.filter(o=>!hp(o)).reduce((o,s)=>o+(_E.test(s)?wE:xE.test(s)?EE:s===""?IE:CE),n)}function AE(e,t){return e.length===t.length&&e.slice(0,-1).every((r,n)=>r===t[n])?e[e.length-1]-t[t.length-1]:0}function NE(e,t,r=!1){let{routesMeta:n}=e,o={},s="/",a=[];for(let i=0;i<n.length;++i){let l=n[i],c=i===n.length-1,p=s==="/"?t:t.slice(s.length)||"/",d={path:l.relativePath,caseSensitive:l.caseSensitive,end:c},h=l.matcher&&l.compiledParams?Ag(d,p,l.matcher,l.compiledParams):ka(d,p),m=l.route;if(!h&&c&&r&&!n[n.length-1].route.index&&(h=ka({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},p)),!h)return null;Object.assign(o,h.params),a.push({params:o,pathname:Mt([s,h.pathname]),pathnameBase:jE(Mt([s,h.pathnameBase])),route:m}),h.pathnameBase!=="/"&&(s=Mt([s,h.pathnameBase]))}return a}function ka(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Ng(e.path,e.caseSensitive,e.end);return Ag(e,t,r,n)}function Ag(e,t,r,n){let o=t.match(r);if(!o)return null;let s=o[0],a=Ia(s,1),i=o.slice(1);return{params:n.reduce((l,{paramName:c,isOptional:p},d)=>{if(c==="*"){let m=i[d]||"";a=Ia(s.slice(0,s.length-m.length),1)}const h=i[d];return p&&!h?l[c]=void 0:l[c]=(h||"").replace(/%2F/g,"/"),l},{}),pathname:s,pathnameBase:a,pattern:e}}function Ng(e,t=!1,r=!0){et(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,i,l,c)=>{if(n.push({paramName:a,isOptional:i!=null}),i){let p=c.charAt(l+s.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,"(?:/$1)?");return e.endsWith("*")?(n.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function PE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return et(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function xt(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function ME({basename:e,pathname:t}){return t==="/"?e:Mt([e,t])}var ou=e=>ni.test(e);function OE(e,t="/"){let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?qt(e):e,s;return r?(r=su(r),r.startsWith("/")||r.startsWith("\\")?s=mp(r.substring(1),"/"):s=mp(r,t)):s=t,{pathname:s,search:LE(n),hash:DE(o)}}function mp(e,t){let r=Ia(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function zi(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Pg(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function si(e){let t=Pg(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function gs(e,t,r,n=!1){let o;typeof e=="string"?o=qt(e):(o={...e},pe(!o.pathname||!o.pathname.includes("?"),zi("?","pathname","search",o)),pe(!o.pathname||!o.pathname.includes("#"),zi("#","pathname","hash",o)),pe(!o.search||!o.search.includes("#"),zi("#","search","hash",o)));let s=e===""||o.pathname==="",a=s?"/":o.pathname,i;if(a==null)i=r;else{let d=t.length-1;if(!n&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),d-=1;o.pathname=h.join("/")}i=d>=0?t[d]:"/"}let l=OE(o,i),c=a&&a!=="/"&&a.endsWith("/"),p=(s||a===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||p)&&(l.pathname+="/"),l}var su=e=>e.replace(/[\\/]{2,}/g,"/"),Mt=e=>su(e.join("/"));function Ia(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var jE=e=>Ia(e).replace(/^\/*/,"/"),LE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,DE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,R$=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,{...r,headers:n})},FE=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],vs=class{status;statusText;data;error;internal;constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Go(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function io(e){return Mt(e.map(t=>t.route.path).filter(Boolean))||"/"}function au(e,t){let r=new URL(typeof e=="string"||e instanceof URL?e:e.url),n=typeof t=="string"?qt(t):t;if(r.pathname=n.pathname||"/",n.search){let o=new URLSearchParams(n.search),s=o.getAll("index");o.delete("index");for(let i of s.filter(Boolean))o.append("index",i);let a=o.toString();r.search=a?`?${a}`:""}else r.search="";return r.hash=n.hash||"",r}var Mg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Og(e,t){let r=e;if(typeof r!="string"||!ni.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,o=!1;if(Mg)try{let s=new URL(window.location.href),a=oi.test(r)?new URL(xg(r,s.protocol)):new URL(r),i=xt(a.pathname,t);a.origin===s.origin&&i!=null?r=i+a.search+a.hash:o=!0}catch{et(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:o,to:r}}var jg=Symbol("Uninstrumented"),T$=fE(),Ro=new WeakMap;function HE(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(s){s.lazy!=null&&r.lazy.push(s.lazy),s["lazy.loader"]!=null&&r["lazy.loader"].push(s["lazy.loader"]),s["lazy.action"]!=null&&r["lazy.action"].push(s["lazy.action"]),s["lazy.middleware"]!=null&&r["lazy.middleware"].push(s["lazy.middleware"]),s.middleware!=null&&r.middleware.push(s.middleware),s.loader!=null&&r.loader.push(s.loader),s.action!=null&&r.action.push(s.action)}}));let n={};if(typeof t.lazy=="function"&&r.lazy.length>0){let o=t.lazy;n.lazy=async(...s)=>ur(await Gt(r.lazy,void 0,()=>o(...s),dr))}if(typeof t.lazy=="object"){let o=t.lazy;if(typeof o.middleware=="function"&&r["lazy.middleware"].length>0){let s=o.middleware;n.lazy=Object.assign(n.lazy||{},{middleware:async(...a)=>ur(await Gt(r["lazy.middleware"],void 0,()=>s(...a),dr))})}if(typeof o.loader=="function"&&r["lazy.loader"].length>0){let s=o.loader;n.lazy=Object.assign(n.lazy||{},{loader:async(...a)=>ur(await Gt(r["lazy.loader"],void 0,()=>s(...a),dr))})}if(typeof o.action=="function"&&r["lazy.action"].length>0){let s=o.action;n.lazy=Object.assign(n.lazy||{},{action:async(...a)=>ur(await Gt(r["lazy.action"],void 0,()=>s(...a),dr))})}}if(typeof t.loader=="function"&&r.loader.length>0){let o=To(t.loader),s=async(...a)=>ur(await Gt(r.loader,Wi(a[0]),()=>o(...a),dr));o.hydrate===!0&&(s.hydrate=!0),Ao(s,o),n.loader=s}if(typeof t.action=="function"&&r.action.length>0){let o=To(t.action),s=async(...a)=>ur(await Gt(r.action,Wi(a[0]),()=>o(...a),dr));Ao(s,o),n.action=s}return t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(o=>{let s=To(o),a=async(...i)=>ur(await Gt(r.middleware,Wi(i[0]),()=>s(...i),dr));return Ao(a,s),a})),n}function UE(e,t){let r={navigate:[],fetch:[]};if(t.forEach(n=>n({instrument(o){o.navigate!=null&&r.navigate.push(o.navigate),o.fetch!=null&&r.fetch.push(o.fetch)}})),r.navigate.length>0){let n=To(e.navigate),o=async(...s)=>{let[a,i]=s,l,c={to:typeof a=="number"||typeof a=="string"?a:a?gt(a):".",...yp(e,i??{})};return ur(await Gt(r.navigate,c,async()=>{if(typeof a=="number")return await n(...s);let p=gp(e,d=>{l=d});try{return await n(...s)}finally{p()}},p=>({...dr(p),meta:l})))};Ao(o,n),e.navigate=o}if(r.fetch.length>0){let n=To(e.fetch),o=async(...s)=>{let[a,i,l,c]=s,p;return ur(await Gt(r.fetch,{href:l??".",fetcherKey:a,...yp(e,c??{})},async()=>{let d=gp(e,h=>{p=h});try{return await n(...s)}finally{d()}},d=>({...dr(d),meta:p})))};Ao(o,n),e.fetch=o}return e}function To(e){return e[jg]??e}function Ao(e,t){e[jg]=t}function gp(e,t){return Ro.set(e,t),()=>{Ro.get(e)===t&&Ro.delete(e)}}function vp(e){let t=Ro.get(e);return Ro.delete(e),t}function ur(e){if(e.type==="error")throw e.value;return e.value}async function Gt(e,t,r,n,o={result:null,innerResult:null},s=e.length-1){let a=e[s];if(a){let i,l=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=Gt(e,t,r,n,o,s-1),await i,pe(o.innerResult,"Expected an inner result"),o.innerResult);try{await a(l,t)}catch(c){console.error("An instrumentation function threw an error:",c)}i||await l(),await i}else{try{o.result={type:"success",value:await r()}}catch(i){o.result={type:"error",value:i}}o.innerResult=n(o.result,t)}return o.result||(o.result={type:"error",value:new Error("No result assigned in instrumentation chain.")},o.innerResult=n(o.result,t)),o.result}function dr(e){return e.type==="error"&&e.value instanceof Error?{status:"error",error:e.value}:{status:"success",error:void 0}}function Wi(e){let{request:t,context:r,params:n}=e;return{...e,request:$E(t),params:{...n},context:BE(r)}}function yp(e,t){return{currentUrl:gt(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function $E(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function BE(e){return{get:t=>e.get(t)}}var zE=class{#e=[];#t=[];#r;constructor(e){this.#r=e}update(e){this.#e=e,this.#t=Cg(e)}match(e,t=!1){return kg(this.#e,e,this.#r,t,this.#t)}},WE;function qE(){return WE}var bp=new URL("http://localhost");function iu(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),bp)}catch{return bp}}function qi(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function VE(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function Hn(e,t,r,n){let o=null;try{o=e==null?null:new URL(e,r)}catch{}let s=new URL(t,r),a=o!=null&&!qi(o,r),i=!qi(s,r);if(n==="reject"){if(a||i)throw new Error("External navigation is not allowed")}else if(i&&(o==null||!VE(e,o)||!qi(o,s)))throw new Error("External navigation is not allowed")}var Lg=["POST","PUT","PATCH","DELETE"],GE=new Set(Lg),YE=["GET",...Lg],JE=new Set(YE),Dg=new Set([301,302,303,307,308]),KE=new Set([307,308]),Vi={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},XE={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},kn={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Fg="remix-router-transitions",Hg=Symbol("ResetLoaderData");function QE(e,t){if(e.unstable_routePatternMatching){let r=qE();return pe(r,'You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.'),new r(t)}return new zE(t)}var ZE=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#r=t,this.#r.update(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#t??this.#e}get hasHMRRoutes(){return this.#t!=null}setRoutes(e){this.#e=e,this.#t||this.#r.update(e)}setHmrRoutes(e){this.#t=e,this.#r.update(e)}commitHmrRoutes(){this.#t&&(this.#e=this.#t,this.#t=void 0,this.#r.update(this.#e))}};function ew(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";pe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],o=e.mapRouteProperties,s=o||(()=>({}));if(e.instrumentations){let x=e.instrumentations;s=k=>({...o?.(k),...HE(x.map(R=>R.route).filter(Boolean),k)})}let a={...e.future},i=e.basename||"/";i.startsWith("/")||(i=`/${i}`);let l=QE(a,i),c={},p=new ZE(Vo(e.routes,s,void 0,c),l),d=e.dataStrategy||sw,h=null,m=new Set,g=null,S=null,b=null,_=null,v=e.hydrationData!=null,w=l.match(e.history.location),E=!1,T=null,I,C;if(w==null&&!e.patchRoutesOnNavigation){let x=Pt(404,{pathname:e.history.location.pathname}),{matches:k,route:R}=Us(p.activeRoutes);I=!0,C=!I,w=k,T={[R.id]:x}}else if(w&&!e.hydrationData&&Os(w,e.history.location.pathname).active&&(w=null),w)if(w.some(x=>x.route.lazy))I=!1,C=!I;else if(!w.some(x=>lu(x.route)))I=!0,C=!I;else{let x=e.hydrationData?e.hydrationData.loaderData:null,k=e.hydrationData?e.hydrationData.errors:null,R=w;if(k){let M=w.findIndex(D=>k[D.route.id]!==void 0);R=R.slice(0,M+1)}C=!1,I=!0,R.forEach(M=>{let D=Ug(M.route,x,k);C=C||D.renderFallback,I=I&&!D.shouldLoad})}else{I=!1,C=!I,w=[];let x=Os(null,e.history.location.pathname);x.active&&x.matches&&(E=!0,w=x.matches)}let L,y={historyAction:e.history.action,location:e.history.location,matches:w,initialized:I,renderFallback:C,navigation:Vi,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||T,fetchers:new Map,blockers:new Map},A="POP",N=null,W=!1,O,G=!1,H=new Map,X=null,j=!1,U=!1,ee=new Set,V=new Map,ue=0,P=-1,$=new Map,Y=new Set,J=new Map,ae=new Map,ie=new Set,Se=new Map,Oe,Xe=null;function Tt(){if(h=e.history.listen(({action:x,location:k,delta:R})=>{if(Oe){Oe(),Oe=void 0;return}et(Se.size===0||R!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let M=Pd({currentLocation:y.location,nextLocation:k,historyAction:x});if(M&&R!=null){let D=new Promise(Q=>{Oe=Q});e.history.go(R*-1),Ms(M,{state:"blocked",location:k,proceed(){Ms(M,{state:"proceeding",proceed:void 0,reset:void 0,location:k}),D.then(()=>e.history.go(R))},reset(){let Q=new Map(y.blockers);Q.set(M,kn),Le({blockers:Q})}}),N?.resolve(),N=null;return}return st(x,k)}),r){ww(t,H);let x=()=>kw(t,H);t.addEventListener("pagehide",x),X=()=>t.removeEventListener("pagehide",x)}return y.initialized||st("POP",y.location,{initialHydration:!0}),L}function ho(){h&&h(),X&&X(),m.clear(),O&&O.abort(),y.fetchers.forEach((x,k)=>ji(y.fetchers,k)),y.blockers.forEach((x,k)=>Nd(k))}function mo(x){if(m.add(x),g){let{newErrors:k}=g;g=null,x(y,{deletedFetchers:[],newErrors:k,viewTransitionOpts:void 0,flushSync:!1})}return()=>m.delete(x)}function Le(x,k={}){x.matches&&(x.matches=x.matches.map(D=>{let Q=c[D.route.id],Z=D.route;return Z.element!==Q.element||Z.errorElement!==Q.errorElement||Z.hydrateFallbackElement!==Q.hydrateFallbackElement?{...D,route:Q}:D})),y={...y,...x};let R=[],M=[];y.fetchers.forEach((D,Q)=>{D.state==="idle"&&(ie.has(Q)?R.push(Q):M.push(Q))}),ie.forEach(D=>{!y.fetchers.has(D)&&!V.has(D)&&R.push(D)}),m.size===0&&(g={newErrors:x.errors??null}),[...m].forEach(D=>D(y,{deletedFetchers:R,newErrors:x.errors??null,viewTransitionOpts:k.viewTransitionOpts,flushSync:k.flushSync===!0})),R.forEach(D=>ji(y.fetchers,D)),M.forEach(D=>y.fetchers.delete(D))}function rt(x,k,{flushSync:R}={}){let M=y.actionData!=null&&y.navigation.formMethod!=null&&ut(y.navigation.formMethod)&&y.navigation.state==="loading"&&x.state?._isRedirect!==!0,D;k.actionData?Object.keys(k.actionData).length>0?D=k.actionData:D=null:M?D=y.actionData:D=null;let Q=k.loaderData?Tp(y.loaderData,k.loaderData,k.matches||[],k.errors):y.loaderData,Z=y.blockers;Z.size>0&&!j&&(Z=new Map(Z),Z.forEach((re,ne)=>Z.set(ne,kn)));let B=j?!1:Od(x,k.matches||y.matches),K=W===!0||y.navigation.formMethod!=null&&ut(y.navigation.formMethod)&&x.state?._isRedirect!==!0;p.commitHmrRoutes(),j||A==="POP"||(A==="PUSH"?e.history.push(x,x.state):A==="REPLACE"&&e.history.replace(x,x.state));let he;if(A==="POP"&&!j&&x!==y.location){let re=H.get(y.location.pathname);re&&re.has(x.pathname)?he={currentLocation:y.location,nextLocation:x}:H.has(x.pathname)&&(he={currentLocation:x,nextLocation:y.location})}else if(G){let re=H.get(y.location.pathname);re?re.add(x.pathname):(re=new Set([x.pathname]),H.set(y.location.pathname,re)),he={currentLocation:y.location,nextLocation:x}}Le({...k,actionData:D,loaderData:Q,historyAction:A,location:x,initialized:!0,renderFallback:!1,navigation:Vi,revalidation:"idle",restoreScrollPosition:B,preventScrollReset:K,blockers:Z},{viewTransitionOpts:he,flushSync:R===!0}),A="POP",W=!1,G=!1,j=!1,U=!1,N?.resolve(),N=null,Xe?.resolve(),Xe=null}async function Dt(x,k){if(N?.resolve(),N=null,typeof x=="number"){N||(N=Op());let Te=N.promise;return e.history.go(x),Te}let R=vp(L),{path:M,submission:D,error:Q}=Sp(!1,Ol(y.location,y.matches,i,x,k?.fromRouteId,k?.relative),k),Z;if(k?.mask){let Te=typeof k.mask=="string"?qt(k.mask):{...y.location.mask,...k.mask};if(Z={pathname:Te.pathname??"",search:Te.search??"",hash:Te.hash??""},oi.test(Z.pathname))throw new Error("External navigation is not allowed");Z.pathname.startsWith("\\")&&(Z.pathname=Z.pathname.replace(/^\\+/,"/")),Hn(typeof k.mask=="string"?k.mask:gt(k.mask),gt(Z),e.history.createURL("/"),"reject")}let B=y.location,K=qo(B,M,k&&k.state,void 0,Z);K={...K,...e.history.encodeLocation(K)},Hn(x==null?e.history.createHref(y.location):typeof x=="string"?x:gt(x),e.history.createHref(K.mask||K),e.history.createURL("/"),"reject");let he=k&&k.replace!=null?k.replace:void 0,re="PUSH";he===!0?re="REPLACE":he===!1||D!=null&&ut(D.formMethod)&&D.formAction===y.location.pathname+y.location.search&&(re="REPLACE");let ne=k&&"preventScrollReset"in k?k.preventScrollReset===!0:void 0,xe=(k&&k.flushSync)===!0,Ge=Pd({currentLocation:B,nextLocation:K,historyAction:re});if(Ge){Ms(Ge,{state:"blocked",location:K,proceed(){Ms(Ge,{state:"proceeding",proceed:void 0,reset:void 0,location:K}),Dt(x,k)},reset(){let Te=new Map(y.blockers);Te.set(Ge,kn),Le({blockers:Te})}});return}await st(re,K,{submission:D,pendingError:Q,preventScrollReset:ne,replace:k&&k.replace,enableViewTransition:k&&k.viewTransition,flushSync:xe,callSiteDefaultShouldRevalidate:k&&k.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:R})}function nr(){Xe||(Xe=Op()),vo(),Le({revalidation:"loading"});let x=Xe.promise;return y.navigation.state==="submitting"?x:y.navigation.state==="idle"?(st(y.historyAction,y.location,{startUninterruptedRevalidation:!0}),x):(st(A||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:G===!0}),x)}async function st(x,k,R){O&&O.abort(),O=null,A=x,j=(R&&R.startUninterruptedRevalidation)===!0,qS(y.location,y.matches),W=(R&&R.preventScrollReset)===!0,G=(R&&R.enableViewTransition)===!0;let M=R?.initialHydration&&y.matches&&y.matches.length>0&&!E?y.matches:l.match(k),D=(R&&R.flushSync)===!0;if(M&&y.initialized&&!U&&hw(y.location,k)&&!(R&&R.submission&&ut(R.submission.formMethod))){rt(k,{matches:M},{flushSync:D});return}let Q=Os(M,k.pathname);if(Q.active&&Q.matches&&(M=Q.matches),R?.instrumentationNavigateMetaReceiver){let Me=Pp(e.history,k,M);R.instrumentationNavigateMetaReceiver(Me)}if(!M){let{error:Me,notFoundMatches:Ie,route:at}=Li(k.pathname);rt(k,{matches:Ie,loaderData:{},errors:{[at.id]:Me}},{flushSync:D});return}let Z=R&&R.overrideNavigation?{...R.overrideNavigation,matches:M,historyAction:x}:void 0;O=new AbortController;let B=In(e.history,k,O.signal,R&&R.submission),K=e.getContext?await e.getContext():new pp,he;if(R&&R.pendingError)he=[kr(M).route.id,{type:"error",error:R.pendingError}];else if(R&&R.submission&&ut(R.submission.formMethod)){let Me=await Wr(B,k,R.submission,M,x,K,Q.active,R&&R.initialHydration===!0,{replace:R.replace,flushSync:D});if(Me.shortCircuited)return;if(Me.pendingActionResult){let[Ie,at]=Me.pendingActionResult;if(wt(at)&&Go(at.error)&&at.error.status===404){O=null,rt(k,{matches:Me.matches,loaderData:{},errors:{[Ie]:at.error}});return}}M=Me.matches||M,he=Me.pendingActionResult,Z=Gi(k,M,x,R.submission),D=!1,Q.active=!1,B=In(e.history,B.url,B.signal)}let{shortCircuited:re,matches:ne,loaderData:xe,errors:Ge,workingFetchers:Te}=await be(B,k,M,x,K,Q.active,Z,R&&R.submission,R&&R.fetcherSubmission,R&&R.replace,R&&R.initialHydration===!0,D,he,R&&R.callSiteDefaultShouldRevalidate);re||(O=null,rt(k,{matches:ne||M,...Ap(he),loaderData:xe,errors:Ge,...Te?{fetchers:Te}:{}}))}async function Wr(x,k,R,M,D,Q,Z,B,K={}){if(vo(),Le({navigation:xw(k,M,D,R)},{flushSync:K.flushSync===!0}),Z){let ne=await js(M,k.pathname,x.signal);if(ne.type==="aborted")return{shortCircuited:!0};if(ne.type==="error"){if(ne.partialMatches.length===0){let{matches:Ge,route:Te}=Us(p.activeRoutes);return{matches:Ge,pendingActionResult:[Te.id,{type:"error",error:ne.error}]}}let xe=kr(ne.partialMatches).route.id;return{matches:ne.partialMatches,pendingActionResult:[xe,{type:"error",error:ne.error}]}}else if(ne.matches)M=ne.matches;else{let{notFoundMatches:xe,error:Ge,route:Te}=Li(k.pathname);return{matches:xe,pendingActionResult:[Te.id,{type:"error",error:Ge}]}}}let he,re=la(M,k);if(!re.route.action&&!re.route.lazy)he={type:"error",error:Pt(405,{method:x.method,pathname:k.pathname,routeId:re.route.id})};else{let ne=await $e(x,k,Un(s,c,x,k,M,re,B?[]:n,Q),Q,null);if(he=ne[re.route.id],!he){for(let xe of M)if(ne[xe.route.id]){he=ne[xe.route.id];break}}if(x.signal.aborted)return{shortCircuited:!0}}if(Kr(he)){let ne;return K&&K.replace!=null?ne=K.replace:ne=Ip(he.response.headers.get("Location"),new URL(x.url),i,e.history)===y.location.pathname+y.location.search,await ke(x,he,!0,{submission:R,replace:ne}),{shortCircuited:!0}}if(wt(he)){let ne=kr(M,re.route.id);return(K&&K.replace)!==!0&&(A="PUSH"),{matches:M,pendingActionResult:[ne.route.id,he,re.route.id]}}return{matches:M,pendingActionResult:[re.route.id,he]}}async function be(x,k,R,M,D,Q,Z,B,K,he,re,ne,xe,Ge){let Te=Z||Gi(k,R,M,B),Me=B||K||Mp(Te),Ie=!j&&!re;if(Q){if(Ie){let nt=lt(xe);Le({navigation:Te,...nt!==void 0?{actionData:nt}:{}},{flushSync:ne})}let Ee=await js(R,k.pathname,x.signal);if(Ee.type==="aborted")return{shortCircuited:!0};if(Ee.type==="error"){if(Ee.partialMatches.length===0){let{matches:ir,route:_n}=Us(p.activeRoutes);return{matches:ir,loaderData:{},errors:{[_n.id]:Ee.error}}}let nt=kr(Ee.partialMatches).route.id;return{matches:Ee.partialMatches,loaderData:{},errors:{[nt]:Ee.error}}}else if(Ee.matches)R=Ee.matches;else{let{error:nt,notFoundMatches:ir,route:_n}=Li(k.pathname);return{matches:ir,loaderData:{},errors:{[_n.id]:nt}}}}let{dsMatches:at,revalidatingFetchers:yt}=_p(x,D,s,c,e.history,y,R,Me,k,re?[]:n,re===!0,U,ee,ie,J,Y,l,xe,Ge);if(P=++ue,!e.dataStrategy&&!at.some(Ee=>Ee.shouldLoad)&&!at.some(Ee=>Ee.route.middleware&&Ee.route.middleware.length>0)&&yt.length===0){let Ee=new Map(y.fetchers),nt=Td(Ee);return rt(k,{matches:R,loaderData:{},errors:xe&&wt(xe[1])?{[xe[0]]:xe[1].error}:null,...Ap(xe),...nt?{fetchers:Ee}:{}},{flushSync:ne}),{shortCircuited:!0}}if(Ie){let Ee={};if(!Q){Ee.navigation=Te;let nt=lt(xe);nt!==void 0&&(Ee.actionData=nt)}yt.length>0&&(Ee.fetchers=ye(yt)),Le(Ee,{flushSync:ne})}yt.forEach(Ee=>{ar(Ee.key),Ee.controller&&V.set(Ee.key,Ee.controller)});let _r=()=>yt.forEach(Ee=>ar(Ee.key));O&&O.signal.addEventListener("abort",_r);let{loaderResults:qr,fetcherResults:Ls}=await go(at,yt,x,k,D);if(x.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener("abort",_r),yt.forEach(Ee=>V.delete(Ee.key));let At=$s(qr);if(At)return await ke(x,At.result,!0,{replace:he}),{shortCircuited:!0};if(At=$s(Ls),At)return Y.add(At.key),await ke(x,At.result,!0,{replace:he}),{shortCircuited:!0};let yn=new Map(y.fetchers),{loaderData:bn,errors:Sn}=Rp(y,R,qr,xe,yt,Ls,yn);re&&y.errors&&(Sn={...y.errors,...Sn});let Ds=Td(yn),Fs=Ad(P,yn),Hs=Ds||Fs||yt.length>0;return{matches:R,loaderData:bn,errors:Sn,...Hs?{workingFetchers:yn}:{}}}function lt(x){if(x&&!wt(x[1]))return{[x[0]]:x[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function ye(x){let k=new Map(y.fetchers);return x.forEach(R=>{let M=k.get(R.key),D=yo(void 0,M?M.data:void 0);k.set(R.key,D)}),k}async function Ve(x,k,R,M){ar(x);let D=(M&&M.flushSync)===!0,Q=vp(L),Z=Ol(y.location,y.matches,i,R,k,M?.relative),B=l.match(Z),K=Os(B,Z);if(K.active&&K.matches&&(B=K.matches),Q&&Q(Pp(e.history,Z,B)),!B){sr(x,k,Pt(404,{pathname:Z}),{flushSync:D});return}let{path:he,submission:re,error:ne}=Sp(!0,Z,M);if(ne){sr(x,k,ne,{flushSync:D});return}let xe=e.getContext?await e.getContext():new pp,Ge=(M&&M.preventScrollReset)===!0;if(re&&ut(re.formMethod)){await F(x,k,he,B,xe,K.active,D,Ge,re,M&&M.defaultShouldRevalidate);return}let Te={routeId:k,path:he,isDiscovering:K.active};J.set(x,Te),await fe(x,Te,B,xe,D,Ge,re)}async function F(x,k,R,M,D,Q,Z,B,K,he){vo(),J.delete(x),or(x,Ew(K,y.fetchers.get(x)),{flushSync:Z});let re=new AbortController,ne=In(e.history,R,re.signal,K);if(Q){let We=await js(M,new URL(ne.url).pathname,ne.signal,x);if(We.type==="aborted")return;if(We.type==="error"){sr(x,k,We.error,{flushSync:Z});return}else if(We.matches)M=We.matches;else{sr(x,k,Pt(404,{pathname:R}),{flushSync:Z});return}}let xe=la(M,R);if(!xe.route.action&&!xe.route.lazy){sr(x,k,Pt(405,{method:K.formMethod,pathname:R,routeId:k}),{flushSync:Z});return}V.set(x,re);let Ge=ue,Te=Un(s,c,ne,R,M,xe,n,D),Me=await $e(ne,R,Te,D,x),Ie=Me[xe.route.id];if(!Ie){for(let We of Te)if(Me[We.route.id]){Ie=Me[We.route.id];break}}if(ne.signal.aborted){V.get(x)===re&&V.delete(x);return}if(ie.has(x)){if(Kr(Ie)||wt(Ie)){or(x,Vt(void 0));return}}else{if(Kr(Ie))if(V.delete(x),P>Ge){or(x,Vt(void 0));return}else return Y.add(x),or(x,yo(K)),ke(ne,Ie,!1,{fetcherSubmission:K,preventScrollReset:B});if(wt(Ie)){sr(x,k,Ie.error);return}}let at=y.navigation.location||y.location,yt=In(e.history,at,re.signal),_r=y.navigation.state!=="idle"?l.match(y.navigation.location):y.matches;pe(_r,"Didn't find any matches after fetcher action");let qr=++ue;$.set(x,qr);let{dsMatches:Ls,revalidatingFetchers:At}=_p(yt,D,s,c,e.history,y,_r,K,at,n,!1,U,ee,ie,J,Y,l,[xe.route.id,Ie],he),yn=yo(K,Ie.data),bn=new Map(y.fetchers);bn.set(x,yn),At.filter(We=>We.key!==x).forEach(We=>{let Vr=We.key,Ld=bn.get(Vr),YS=yo(void 0,Ld?Ld.data:void 0);bn.set(Vr,YS),ar(Vr),We.controller&&V.set(Vr,We.controller)}),Le({fetchers:bn});let Sn=()=>At.forEach(We=>ar(We.key));re.signal.addEventListener("abort",Sn);let{loaderResults:Ds,fetcherResults:Fs}=await go(Ls,At,yt,at,D);if(re.signal.aborted){$.get(x)===qr&&$.delete(x);return}re.signal.removeEventListener("abort",Sn),$.delete(x),V.delete(x),At.forEach(We=>V.delete(We.key));let Hs=y.fetchers.has(x),Ee=We=>{if(!Hs)return We;let Vr=new Map(We.fetchers);return Vr.set(x,Vt(Ie.data)),{...We,fetchers:Vr}},nt=$s(Ds);if(nt)return y=Ee(y),ke(yt,nt.result,!1,{preventScrollReset:B});if(nt=$s(Fs),nt)return Y.add(nt.key),y=Ee(y),ke(yt,nt.result,!1,{preventScrollReset:B});let ir=new Map(y.fetchers);Hs&&ir.set(x,Vt(Ie.data));let{loaderData:_n,errors:Di}=Rp(y,_r,Ds,void 0,At,Fs,ir);Ad(qr,ir),y.navigation.state==="loading"&&qr>P?(pe(A,"Expected pending action"),O&&O.abort(),rt(y.navigation.location,{matches:_r,loaderData:_n,errors:Di,fetchers:ir})):(Le({errors:Di,loaderData:Tp(y.loaderData,_n,_r,Di),fetchers:ir}),U=!1)}async function fe(x,k,R,M,D,Q,Z){let{routeId:B,path:K}=k,he=y.fetchers.get(x);or(x,yo(Z,he?he.data:void 0),{flushSync:D});let re=new AbortController,ne=In(e.history,K,re.signal);if(k.isDiscovering){let Ie=await js(R,new URL(ne.url).pathname,ne.signal,x);if(Ie.type==="aborted")return;if(Ie.type==="error"){sr(x,B,Ie.error,{flushSync:D});return}else if(Ie.matches)R=Ie.matches,k.isDiscovering=!1;else{sr(x,B,Pt(404,{pathname:K}),{flushSync:D});return}}let xe=la(R,K);V.set(x,re);let Ge=ue,Te=await $e(ne,K,Un(s,c,ne,K,R,xe,n,M),M,x),Me=Te[xe.route.id];if(!Me){for(let Ie of R)if(Te[Ie.route.id]){Me=Te[Ie.route.id];break}}if(V.get(x)===re&&V.delete(x),!ne.signal.aborted){if(ie.has(x)){or(x,Vt(void 0));return}if(Kr(Me))if(P>Ge){or(x,Vt(void 0));return}else{Y.add(x),await ke(ne,Me,!1,{preventScrollReset:Q});return}if(wt(Me)){sr(x,B,Me.error);return}or(x,Vt(Me.data))}}async function ke(x,k,R,{submission:M,fetcherSubmission:D,preventScrollReset:Q,replace:Z}={}){R||(N?.resolve(),N=null),k.response.headers.has("X-Remix-Revalidate")&&(U=!0);let B=k.response.headers.get("Location");pe(B,"Expected a Location header on the redirect Response");let K=B,he=new URL(x.url);B=Ip(B,he,i,e.history),Hn(K,B,he,"allow-explicit");let re=qo(y.location,B,{_isRedirect:!0});if(r){let Ie=!1;if(k.response.headers.has("X-Remix-Reload-Document"))Ie=!0;else if(ou(B)){const at=Eg(t,B,!0);Ie=at.origin!==t.location.origin||xt(at.pathname,i)==null}if(Ie){Z?t.location.replace(B):t.location.assign(B);return}}O=null;let ne=Z===!0||k.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:xe,formAction:Ge,formEncType:Te}=y.navigation;!M&&!D&&xe&&Ge&&Te&&(M=Mp(y.navigation));let Me=M||D;KE.has(k.response.status)&&Me&&ut(Me.formMethod)?await st(ne,re,{submission:{...Me,formAction:B},preventScrollReset:Q||W,enableViewTransition:R?G:void 0}):await st(ne,re,{overrideNavigation:Gi(re,[],ne,M),fetcherSubmission:D,preventScrollReset:Q||W,enableViewTransition:R?G:void 0})}async function $e(x,k,R,M,D){let Q,Z={};try{Q=await iw(d,x,k,R,D,M,!1)}catch(B){return R.filter(K=>K.shouldLoad).forEach(K=>{Z[K.route.id]={type:"error",error:B}}),Z}if(x.signal.aborted)return Z;if(!ut(x.method))for(let B of R){if(Q[B.route.id]?.type==="error")break;!Q.hasOwnProperty(B.route.id)&&!y.loaderData.hasOwnProperty(B.route.id)&&(!y.errors||!y.errors.hasOwnProperty(B.route.id))&&B.shouldCallHandler()&&(Q[B.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${B.route.id}`)})}for(let[B,K]of Object.entries(Q))if(yw(K)){let he=K.result;Z[B]={type:"redirect",response:dw(he,x,B,R,i)}}else Z[B]=await uw(K);return Z}async function go(x,k,R,M,D){let Q=$e(R,M,x,D,null),Z=Promise.all(k.map(async B=>{if(B.matches&&B.match&&B.request&&B.controller){let K=(await $e(B.request,B.path,B.matches,D,B.key))[B.match.route.id];return{[B.key]:K}}else return Promise.resolve({[B.key]:{type:"error",error:Pt(404,{pathname:B.path})}})}));return{loaderResults:await Q,fetcherResults:(await Z).reduce((B,K)=>Object.assign(B,K),{})}}function vo(){U=!0,J.forEach((x,k)=>{V.has(k)&&ee.add(k),ar(k)})}function or(x,k,R={}){let M=new Map(y.fetchers);M.set(x,k),Le({fetchers:M},{flushSync:(R&&R.flushSync)===!0})}function sr(x,k,R,M={}){let D=kr(y.matches,k),Q=new Map(y.fetchers);ji(Q,x),Le({errors:{[D.route.id]:R},fetchers:Q},{flushSync:(M&&M.flushSync)===!0})}function US(x){return ae.set(x,(ae.get(x)||0)+1),ie.has(x)&&ie.delete(x),y.fetchers.get(x)||XE}function $S(x,k){ar(x,k?.reason),or(x,Vt(null))}function ji(x,k){let R=y.fetchers.get(k);V.has(k)&&!(R&&R.state==="loading"&&$.has(k))&&ar(k),J.delete(k),$.delete(k),Y.delete(k),ie.delete(k),ee.delete(k),x.delete(k)}function BS(x){let k=(ae.get(x)||0)-1;k<=0?(ae.delete(x),ie.add(x)):ae.set(x,k),Le({fetchers:new Map(y.fetchers)})}function ar(x,k){let R=V.get(x);R&&(R.abort(k),V.delete(x))}function Rd(x,k){for(let R of x){let M=k.get(R);pe(M,`Expected fetcher: ${R}`);let D=Vt(M.data);k.set(R,D)}}function Td(x){let k=[],R=!1;for(let M of Y){let D=x.get(M);pe(D,`Expected fetcher: ${M}`),D.state==="loading"&&(Y.delete(M),k.push(M),R=!0)}return Rd(k,x),R}function Ad(x,k){let R=[];for(let[M,D]of $)if(D<x){let Q=k.get(M);pe(Q,`Expected fetcher: ${M}`),Q.state==="loading"&&(ar(M),$.delete(M),R.push(M))}return Rd(R,k),R.length>0}function zS(x,k){let R=y.blockers.get(x)||kn;return Se.get(x)!==k&&Se.set(x,k),R}function Nd(x){y.blockers.delete(x),Se.delete(x)}function Ms(x,k){let R=y.blockers.get(x)||kn;pe(R.state==="unblocked"&&k.state==="blocked"||R.state==="blocked"&&k.state==="blocked"||R.state==="blocked"&&k.state==="proceeding"||R.state==="blocked"&&k.state==="unblocked"||R.state==="proceeding"&&k.state==="unblocked",`Invalid blocker state transition: ${R.state} -> ${k.state}`);let M=new Map(y.blockers);M.set(x,k),Le({blockers:M})}function Pd({currentLocation:x,nextLocation:k,historyAction:R}){if(Se.size===0)return;Se.size>1&&et(!1,"A router only supports one blocker at a time");let M=Array.from(Se.entries()),[D,Q]=M[M.length-1],Z=y.blockers.get(D);if(!(Z&&Z.state==="proceeding")&&Q({currentLocation:x,nextLocation:k,historyAction:R}))return D}function Li(x){let k=Pt(404,{pathname:x}),R=p.activeRoutes,{matches:M,route:D}=Us(R);return{notFoundMatches:M,route:D,error:k}}function WS(x,k,R){if(S=x,_=k,b=R||null,!v&&y.navigation===Vi){v=!0;let M=Od(y.location,y.matches);M!=null&&Le({restoreScrollPosition:M})}return()=>{S=null,_=null,b=null}}function Md(x,k){return b&&b(x,k.map(R=>Ig(R,y.loaderData)))||x.key}function qS(x,k){if(S&&_){let R=Md(x,k);S[R]=_()}}function Od(x,k){if(S){let R=Md(x,k),M=S[R];if(typeof M=="number")return M}return null}function Os(x,k){if(e.patchRoutesOnNavigation)if(x){if(Object.keys(x[0].params).length>0)return{active:!0,matches:l.match(k,!0)}}else return{active:!0,matches:l.match(k,!0)||[]};return{active:!1,matches:null}}async function js(x,k,R,M){if(!e.patchRoutesOnNavigation)return{type:"success",matches:x};let D=x;for(;;){let Q=c;try{await e.patchRoutesOnNavigation({signal:R,path:k,matches:D,fetcherKey:M,patch:(K,he)=>{R.aborted||xp(K,he,p,Q,s,!1)}})}catch(K){return{type:"error",error:K,partialMatches:D}}if(R.aborted)return{type:"aborted"};let Z=l.match(k),B=null;if(Z){if(Object.keys(Z[0].params).length===0)return{type:"success",matches:Z};if(B=l.match(k,!0),!(B&&D.length<B.length&&jd(D,B.slice(0,D.length))))return{type:"success",matches:Z}}if(B||(B=l.match(k,!0)),!B||jd(D,B))return{type:"success",matches:null};D=B}}function jd(x,k){return x.length===k.length&&x.every((R,M)=>R.route.id===k[M].route.id)}function VS(x){c={},p.setHmrRoutes(Vo(x,s,void 0,c))}function GS(x,k,R=!1){xp(x,k,p,c,s,R),p.hasHMRRoutes||Le({})}return L={get basename(){return i},get future(){return a},get state(){return y},get routes(){return p.stableRoutes},match(x){return l.match(x)},get manifest(){return c},get window(){return t},initialize:Tt,subscribe:mo,enableScrollRestoration:WS,navigate:Dt,fetch:Ve,revalidate:nr,createHref:x=>e.history.createHref(x),createURL:x=>e.history.createURL(x),encodeLocation:x=>e.history.encodeLocation(x),getFetcher:US,resetFetcher:$S,deleteFetcher:BS,dispose:ho,getBlocker:zS,deleteBlocker:Nd,patchRoutes:GS,_internalFetchControllers:V,_internalSetRoutes:VS,_internalSetStateDoNotUseOrYouWillBreakYourApp(x){Le(x)}},e.instrumentations&&(L=UE(L,e.instrumentations.map(x=>x.router).filter(Boolean))),L}function tw(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ol(e,t,r,n,o,s){let a,i;if(o){a=[];for(let c of t)if(a.push(c),c.route.id===o){i=c;break}}else a=t,i=t[t.length-1];let l=gs(n||".",si(a),xt(e.pathname,r)||e.pathname,s==="path");if(n==null&&(l.search=e.search,l.hash=e.hash),(n==null||n===""||n===".")&&i){let c=uu(l.search);if(i.route.index&&!c)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!i.route.index&&c){let p=new URLSearchParams(l.search),d=p.getAll("index");p.delete("index"),d.filter(m=>m).forEach(m=>p.append("index",m));let h=p.toString();l.search=h?`?${h}`:""}}return r!=="/"&&(l.pathname=ME({basename:r,pathname:l.pathname})),gt(l)}function Sp(e,t,r){if(!r||!tw(r))return{path:t};if(r.formMethod&&!_w(r.formMethod))return{path:t,error:Pt(405,{method:r.formMethod})};let n=()=>({path:t,error:Pt(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),s=Vg(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ut(o))return n();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((d,[h,m])=>`${d}${h}=${m}
1
+ import{o as Qh}from"./rolldown-runtime-BlpueFg6.js";import{A as JS,O as Zh,S as em,c as KS,g as XS,h as QS,m as ZS,w as e0}from"./project-route-B8ycjI6Q.js";import{C as tm,Dt as t0,E as r0,H as n0,M as o0,N as s0,P as rm,St as a0,T as Oc,U as i0,V as l0,_ as nm,g as om,h as sm,j as c0}from"./PosthogUtils-BAwbC5iX.js";import{n as u0,t as d0}from"./react-dom-DXowvrFG.js";import{r as p0}from"./bundle-mjs-BGe1waGK.js";import{$ as f0,$n as h0,$t as jc,Ar as dn,At as Dd,Cr as Ke,D as m0,Dr as am,Dt as g0,En as v0,Gt as Fd,Ht as im,It as y0,Jt as b0,Kt as S0,M as _0,Mt as x0,Ot as E0,P as w0,Qn as k0,Sr as Et,Tt as pn,Ut as I0,V as _a,Vt as C0,Wt as R0,Xt as T0,_r as A0,_t as lm,ar as N0,bn as P0,br as Ka,bt as cm,cr as Hd,ct as um,dr as M0,dt as O0,er as j0,et as L0,fn as Lc,fr as Ud,ft as Dc,gr as $d,gt as Sr,hr as D0,ht as F0,ir as H0,jr as q,jt as U0,kr as Uo,kt as $0,lr as dm,lt as Fc,mr as B0,mt as Ct,nn as z0,nr as pm,or as W0,ot as Bd,pr as fm,pt as Xa,qt as q0,rn as V0,rr as G0,sr as Y0,st as us,tr as J0,tt as K0,u as X0,ur as Q0,ut as hm,vr as zd,vt as Hc,xn as Z0,yn as e_,yr as Wd,yt as mm}from"./app-navigation-CTBnrg26.js";import{At as t_,B as gm,Ct as xa,D as vm,Dt as ym,E as en,F as Qe,Ft as bm,Gt as Sm,Ht as Xt,I as eo,It as _m,Jt as Uc,Kt as $t,Lt as xm,Mt as r_,N as Fi,Nt as Em,O as n_,Ot as o_,Pt as wm,R as s_,Rt as km,St as $c,T as a_,Ut as ds,Wt as Bc,Xt as it,_ as i_,bt as l_,c as to,ct as Nr,d as ro,g as c_,jt as Im,kt as u_,l as no,m as d_,n as vr,vt as Cm,xt as p_,yt as f_,zt as h_}from"./feature-flags-Cbn8gAeC.js";import{R as Hi,U as qd,g as Vd,v as m_,y as g_}from"./mcp-init-BWmQoGiF.js";import{$ as v_,$t as zc,An as y_,At as Gd,B as Yd,Bn as Pr,Bt as Ze,C as b_,Cn as Wc,Ct as S_,Dn as Mr,Dt as __,En as x_,Et as Ui,F as Jd,Fn as qc,Ft as Kd,G as Xd,Gn as Qd,Gt as me,H as Rm,Hn as E_,Ht as w_,I as $i,In as Dn,It as Ea,J as k_,Jn as Tm,Jt as I_,K as Am,Kn as Nm,Kt as je,L as C_,Ln as R_,Lt as ps,M as T_,Mn as Pm,Mt as A_,N as Mm,Nn as wa,Nt as fn,On as Om,Ot as zn,P as Vc,Pn as Wn,Pt as jm,Q as sa,Qt as N_,R as Lm,Rn as P_,Rr as Zd,Rt as fs,S as M_,Sn as _t,St as oo,Tn as ep,Tt as O_,U as j_,Un as hs,Ut as hr,V as tp,Vn as L_,Vt as D_,W as Gc,Wn as z,Wt as F_,X as $o,Xn as He,Xt as Qa,Y as nn,Yn as rp,Yt as H_,Z as er,Zn as te,Zt as Dm,_ as U_,_n as Fm,_t as $_,an as Za,at as B_,b as z_,bn as qn,bt as W_,cn as Tl,ct as Al,dn as Io,dt as Ae,en as Nl,et as q_,f as Bi,fn as aa,ft as Hm,gn as V_,gt as G_,hn as Yc,ht as Y_,in as ot,io as Lt,it as ia,jn as so,jt as Um,kn as Jc,kt as np,ln as op,lt as ei,mn as Qt,mt as J_,nn as K_,no as $m,nt as mt,on as dt,ot as X_,pn as sp,pt as Q_,q as hn,qn as Kc,qt as Hr,rn as ap,rt as Z_,sn as Fn,st as ex,tn as Bm,to as tx,tt as pt,un as Jr,ut as Co,v as rx,vn as ao,vt as nx,w as ox,wn as sx,wt as ax,xn as ix,xt as Bo,y as ip,yn as lx,yt as cx,z as Pl,zn as lp,zt as yr}from"./error-reporting-C7685g3J.js";import{t as ux}from"./preload-helper-CQSqs-Ur.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.27.1"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bb1fff81-e12c-40c7-b004-7d28c8b24040",e._sentryDebugIdIdentifier="sentry-dbid-bb1fff81-e12c-40c7-b004-7d28c8b24040")}catch{}})();var dx=Qh(d0(),1),f=Qh(u0(),1),u=p0(),px=Object.defineProperty,Rt=(e,t)=>px(e,"name",{value:t,configurable:!0}),Xc="Dialog",[zm,b$]=Uc(Xc),[fx,Wt]=zm(Xc),Wm=Rt(e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,i=f.useRef(null),l=f.useRef(null),[c,p]=Bc({prop:n,defaultProp:o??!1,onChange:s,caller:Xc}),[d,h]=f.useState(0),[m,g]=f.useState(0);return(0,u.jsx)(fx,{scope:t,triggerRef:i,contentRef:l,contentId:Xt(),titleId:Xt(),descriptionId:Xt(),titlePresent:d>0,descriptionPresent:m>0,setTitleCount:h,setDescriptionCount:g,open:c,onOpenChange:p,onOpenToggle:f.useCallback(()=>p(S=>!S),[p]),modal:a,children:r})},"Dialog"),hx="DialogTrigger",mx=f.forwardRef(Rt(function(t,r){const{__scopeDialog:n,...o}=t,s=Wt(hx,n),a=dn(r,s.triggerRef);return(0,u.jsx)(it.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":ti(s.open),...o,ref:a,onClick:$t(t.onClick,s.onOpenToggle)})},"DialogTrigger")),qm="DialogPortal",[gx,Vm]=zm(qm,{forceMount:void 0}),Gm=Rt(e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,s=Wt(qm,t);return(0,u.jsx)(gx,{scope:t,forceMount:r,children:f.Children.map(n,a=>(0,u.jsx)(ds,{present:r||s.open,children:(0,u.jsx)(_m,{asChild:!0,container:o,children:a})}))})},"DialogPortal"),Ml="DialogOverlay",Ym=f.forwardRef(Rt(function(t,r){const n=Vm(Ml,t.__scopeDialog),{forceMount:o=n.forceMount,...s}=t,a=Wt(Ml,t.__scopeDialog);return a.modal?(0,u.jsx)(ds,{present:o||a.open,children:(0,u.jsx)(yx,{...s,ref:r})}):null},"DialogOverlay")),vx=am("DialogOverlay.RemoveScroll"),yx=f.forwardRef(Rt(function(t,r){const{__scopeDialog:n,...o}=t,s=Wt(Ml,n),a=h_(),i=dn(r,a);return(0,u.jsx)(wm,{as:vx,allowPinchZoom:!0,shards:[s.contentRef],children:(0,u.jsx)(it.div,{"data-state":ti(s.open),...o,ref:i,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),zo="DialogContent",Jm=f.forwardRef(Rt(function(t,r){const n=Vm(zo,t.__scopeDialog),{forceMount:o=n.forceMount,...s}=t,a=Wt(zo,t.__scopeDialog);return(0,u.jsx)(ds,{present:o||a.open,children:a.modal?(0,u.jsx)(bx,{...s,ref:r}):(0,u.jsx)(Sx,{...s,ref:r})})},"DialogContent")),bx=f.forwardRef(Rt(function(t,r){const n=Wt(zo,t.__scopeDialog),o=f.useRef(null),s=dn(r,n.contentRef,o);return f.useEffect(()=>{const a=o.current;if(a)return Em(a)},[]),(0,u.jsx)(Km,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:$t(t.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:$t(t.onPointerDownOutside,a=>{const i=a.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&a.preventDefault()}),onFocusOutside:$t(t.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),Sx=f.forwardRef(Rt(function(t,r){const n=Wt(zo,t.__scopeDialog),o=f.useRef(!1),s=f.useRef(!1);return(0,u.jsx)(Km,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||n.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})},"DialogContentNonModal")),Km=f.forwardRef(Rt(function(t,r){const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,...i}=t,l=Wt(zo,n);return bm(),(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(xm,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:(0,u.jsx)(km,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":ti(l.open),...i,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),_x="DialogTitle",xx=f.forwardRef(Rt(function(t,r){const{__scopeDialog:n,...o}=t,s=Wt(_x,n),{setTitleCount:a}=s;return Sm(()=>(a(i=>i+1),()=>a(i=>i-1)),[a]),(0,u.jsx)(it.h2,{id:s.titleId,...o,ref:r})},"DialogTitle")),Ex="DialogDescription",wx=f.forwardRef(Rt(function(t,r){const{__scopeDialog:n,...o}=t,s=Wt(Ex,n),{setDescriptionCount:a}=s;return Sm(()=>(a(i=>i+1),()=>a(i=>i-1)),[a]),(0,u.jsx)(it.p,{id:s.descriptionId,...o,ref:r})},"DialogDescription")),kx="DialogClose",Xm=f.forwardRef(Rt(function(t,r){const{__scopeDialog:n,...o}=t,s=Wt(kx,n);return(0,u.jsx)(it.button,{type:"button",...o,ref:r,onClick:$t(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function ti(e){return e?"open":"closed"}Rt(ti,"getState");var Ix=Object.defineProperty,tr=(e,t)=>Ix(e,"name",{value:t,configurable:!0}),Qc="Popover",[Qm,S$]=Uc(Qc,[Im]),ms=Im(),[Cx,mn]=Qm(Qc),Rx=tr(e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:a=!1}=e,i=ms(t),l=f.useRef(null),[c,p]=f.useState(!1),[d,h]=Bc({prop:n,defaultProp:o??!1,onChange:s,caller:Qc});return(0,u.jsx)(t_,{...i,children:(0,u.jsx)(Cx,{scope:t,contentId:Xt(),triggerRef:l,open:d,onOpenChange:h,onOpenToggle:f.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:c,onCustomAnchorAdd:f.useCallback(()=>p(!0),[]),onCustomAnchorRemove:f.useCallback(()=>p(!1),[]),modal:a,children:r})})},"Popover"),Tx="PopoverAnchor",Ax=f.forwardRef(tr(function(t,r){const{__scopePopover:n,...o}=t,s=mn(Tx,n),a=ms(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=s;return f.useEffect(()=>(i(),()=>l()),[i,l]),(0,u.jsx)(ym,{...a,...o,ref:r})},"PopoverAnchor")),Nx="PopoverTrigger",Px=f.forwardRef(tr(function(t,r){const{__scopePopover:n,...o}=t,s=mn(Nx,n),a=ms(n),i=dn(r,s.triggerRef),l=(0,u.jsx)(it.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Zc(s.open),...o,ref:i,onClick:$t(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:(0,u.jsx)(ym,{asChild:!0,...a,children:l})},"PopoverTrigger")),Zm="PopoverPortal",[Mx,Ox]=Qm(Zm,{forceMount:void 0}),jx=tr(e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,s=mn(Zm,t);return(0,u.jsx)(Mx,{scope:t,forceMount:r,children:(0,u.jsx)(ds,{present:r||s.open,children:(0,u.jsx)(_m,{asChild:!0,container:o,children:n})})})},"PopoverPortal"),Wo="PopoverContent",Lx=f.forwardRef(tr(function(t,r){const n=Ox(Wo,t.__scopePopover),{forceMount:o=n.forceMount,...s}=t,a=mn(Wo,t.__scopePopover);return(0,u.jsx)(ds,{present:o||a.open,children:a.modal?(0,u.jsx)(Fx,{...s,ref:r}):(0,u.jsx)(Hx,{...s,ref:r})})},"PopoverContent")),Dx=am("PopoverContent.RemoveScroll"),Fx=f.forwardRef(tr(function(t,r){const n=mn(Wo,t.__scopePopover),o=f.useRef(null),s=dn(r,o),a=f.useRef(!1);return f.useEffect(()=>{const i=o.current;if(i)return Em(i)},[]),(0,u.jsx)(wm,{as:Dx,allowPinchZoom:!0,children:(0,u.jsx)(eg,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$t(t.onCloseAutoFocus,i=>{i.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:$t(t.onPointerDownOutside,i=>{const l=i.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,p=l.button===2||c;a.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:$t(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Hx=f.forwardRef(tr(function(t,r){const n=mn(Wo,t.__scopePopover),o=f.useRef(!1),s=f.useRef(!1);return(0,u.jsx)(eg,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||n.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})},"PopoverContentNonModal")),eg=f.forwardRef(tr(function(t,r){const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:p,onInteractOutside:d,...h}=t,m=mn(Wo,n),g=ms(n);return bm(),(0,u.jsx)(xm,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:(0,u.jsx)(km,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:p,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,u.jsx)(u_,{"data-state":Zc(m.open),role:"dialog",id:m.contentId,...g,...h,ref:r,style:{...h.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)"}})})})},"PopoverContentImpl")),Ux=f.forwardRef(tr(function(t,r){const{__scopePopover:n,...o}=t,s=ms(n);return(0,u.jsx)(o_,{...s,...o,ref:r})},"PopoverArrow"));function Zc(e){return e?"open":"closed"}tr(Zc,"getState");var $x=Rx,Bx=Ax,zx=Px,Wx=jx,qx=Lx,_$=Ux,Vx=Object.defineProperty,Or=(e,t)=>Vx(e,"name",{value:t,configurable:!0}),eu="Switch",[Gx,x$]=Uc(eu),[Yx,tu]=Gx(eu);function tg(e){const{__scopeSwitch:t,checked:r,children:n,defaultChecked:o,disabled:s,form:a,name:i,onCheckedChange:l,required:c,value:p="on",internal_do_not_use_render:d}=e,[h,m]=Bc({prop:r,defaultProp:o??!1,onChange:l,caller:eu}),[g,S]=f.useState(null),[b,_]=f.useState(null),v=f.useRef(!1),[w,E]=f.useReducer(I=>I+1,0),T={checked:h,setChecked:m,disabled:s,control:g,setControl:S,name:i,form:a,value:p,hasConsumerStoppedPropagationRef:v,userInteractionCount:w,onUserInteraction:E,required:c,defaultChecked:o,isFormControl:g?!!a||!!g.closest("form"):!0,bubbleInput:b,setBubbleInput:_};return(0,u.jsx)(Yx,{scope:t,...T,children:rg(d)?d(T):n})}Or(tg,"SwitchProvider");var Jx="SwitchTrigger",Kx=f.forwardRef(Or(function({__scopeSwitch:t,onClick:r,...n},o){const{control:s,form:a,value:i,disabled:l,checked:c,required:p,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:S,bubbleInput:b}=tu(Jx,t),_=dn(o,d),v=f.useRef(c);return f.useEffect(()=>{const w=a?s?.ownerDocument.getElementById(a):s?.form;if(w instanceof HTMLFormElement){const E=Or(()=>h(v.current),"reset");return w.addEventListener("reset",E),()=>w.removeEventListener("reset",E)}},[s,a,h]),(0,u.jsx)(it.button,{type:"button",role:"switch","aria-checked":c,"aria-required":p,"data-state":ru(c),"data-disabled":l?"":void 0,disabled:l,value:i,...n,ref:_,onClick:$t(r,w=>{g(),h(E=>!E),b&&S&&(m.current=w.isPropagationStopped(),m.current||w.stopPropagation())})})},"SwitchTrigger")),Xx=f.forwardRef(Or(function(t,r){const{__scopeSwitch:n,name:o,checked:s,defaultChecked:a,required:i,disabled:l,value:c,onCheckedChange:p,form:d,...h}=t;return(0,u.jsx)(tg,{__scopeSwitch:n,checked:s,defaultChecked:a,disabled:l,required:i,onCheckedChange:p,name:o,form:d,value:c,internal_do_not_use_render:({isFormControl:m})=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Kx,{...h,ref:r,__scopeSwitch:n}),m&&(0,u.jsx)(tE,{__scopeSwitch:n})]})})},"Switch")),Qx="SwitchThumb",Zx=f.forwardRef(Or(function(t,r){const{__scopeSwitch:n,...o}=t,s=tu(Qx,n);return(0,u.jsx)(it.span,{"data-state":ru(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:r})},"SwitchThumb")),eE="SwitchBubbleInput",tE=f.forwardRef(Or(function({__scopeSwitch:t,onClick:r,...n},o){const{control:s,hasConsumerStoppedPropagationRef:a,userInteractionCount:i,checked:l,defaultChecked:c,required:p,disabled:d,name:h,value:m,form:g,bubbleInput:S,setBubbleInput:b}=tu(eE,t),_=dn(o,b),v=r_(s),w=f.useRef(!1),E=f.useRef(l),T=f.useRef(i);f.useEffect(()=>{const C=S;if(!C)return;const L=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(L,"checked").set,A=i!==T.current;T.current=i;const N=E.current!==l;E.current=l;const W=!(A&&a.current);if(N&&y){w.current=!A;const O=new Event("click",{bubbles:W});y.call(C,l),C.dispatchEvent(O),w.current=!1}},[S,l,a,i]);const I=f.useRef(l);return(0,u.jsx)(it.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??I.current,required:p,disabled:d,name:h,value:m,form:g,...n,tabIndex:-1,ref:_,onClick:$t(r,C=>{w.current&&C.stopPropagation()}),style:{...n.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function rg(e){return typeof e=="function"}Or(rg,"isFunction");function ru(e){return e?"checked":"unchecked"}Or(ru,"getState");var ng={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};ng.node;var og=Et(ng),sg={name:"bell",size:24,node:[["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"}]]};sg.node;var rE=Et(sg),ag={name:"download",size:24,node:[["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"}]]};ag.node;var nE=Et(ag),ig={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};ig.node;var oE=Et(ig),lg={name:"flask-conical",size:24,node:[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]};lg.node;var sE=Et(lg),cg={name:"funnel",size:24,node:[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],aliases:["filter"]};cg.node;var aE=Et(cg),ug={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};ug.node;var dg=Et(ug),pg={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};pg.node;var fg=Et(pg),hg={name:"moon",size:24,node:[["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"}]]};hg.node;var iE=Et(hg),mg={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};mg.node;var nu=Et(mg),gg={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};gg.node;var vg=Et(gg),yg={name:"sun",size:24,node:[["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"}]]};yg.node;var lE=Et(yg),bg={name:"trending-up",size:24,node:[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]};bg.node;var cE=Et(bg),Sg={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};Sg.node;var ri=Et(Sg),tn="com.mcpjam/tasks";function Rr(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function _g(e){const t=e?.mcpProfile;if(t!==void 0&&!Rr(t))return"invalid";const r=e?.mcpProfile?.extensions;if(r===void 0)return"unset";if(!Rr(r))return"invalid";if(!Object.prototype.hasOwnProperty.call(r,"com.mcpjam/tasks"))return"unset";const n=r[tn];if(!Rr(n)||!Object.prototype.hasOwnProperty.call(n,"enabled"))return"invalid";const o=n.enabled;return o===!0?"on":o===!1?"off":"invalid"}function E$(e){if(_g(e)!=="invalid")return;if(e?.mcpProfile!==void 0&&!Rr(e.mcpProfile))return'"mcpProfile" must be a plain JSON object.';const t=e?.mcpProfile?.extensions?.[tn];return Rr(e?.mcpProfile?.extensions)?Rr(t)?`"${tn}.enabled" must be true or false.`:`"${tn}" must be an object of the form { "enabled": true | false }.`:'"mcpProfile.extensions" must be a plain JSON object.'}function w$(e,t){const r=e??{};return{...r,mcpProfile:{...r.mcpProfile??{},extensions:{...Rr(r.mcpProfile?.extensions)?r.mcpProfile.extensions:{},[tn]:{enabled:t}}}}}function k$(e){const t=e??{},r=t.mcpProfile?.extensions;if(!Rr(r)||!Object.prototype.hasOwnProperty.call(r,"com.mcpjam/tasks"))return t;const{[tn]:n,...o}=r,{extensions:s,...a}=t.mcpProfile??{};if(Object.keys(o).length>0)return{...t,mcpProfile:{...a,extensions:o}};if(Object.keys(a).length>0)return{...t,mcpProfile:a};const{mcpProfile:i,...l}=t;return l}function I$(e,t){return t==="replay"?"off":t==="conformance"||t==="api"?e==="off"||e==="invalid"?"off":"expose":e==="off"||e==="invalid"?"off":e==="unset"?t==="tools"?"expose":"off":t==="eval"?"await":"expose"}var ni=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,oi=/^[\\/]{2}/;function xg(e,t){return t+e.replace(/\\/g,"/")}var C$=(function(e){return e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE",e})({}),cp="popstate";function up(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function uE(e={}){function t(n,o){let s=o.state?.masked,{pathname:a,search:i,hash:l}=s||n.location;return qo("",{pathname:a,search:i,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default",s?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function r(n,o){return typeof o=="string"?o:gt(o)}return pE(t,r,null,e)}function pe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function et(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function dE(){return Math.random().toString(36).substring(2,10)}function dp(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function qo(e,t,r=null,n,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?qt(t):t,state:r,key:t&&t.key||n||dE(),mask:o}}function gt({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function qt(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function pE(e,t,r,n={}){let{window:o=document.defaultView,v5Compat:s=!1}=n,a=o.history,i="POP",l=null,c=p();c==null&&(c=0,a.replaceState({...a.state,idx:c},""));function p(){return(a.state||{idx:null}).idx}function d(){i="POP";let b=p(),_=b==null?null:b-c;c=b,l&&l({action:i,location:S.location,delta:_})}function h(b,_){i="PUSH";let v=up(b)?b:qo(S.location,b,_);r&&r(v,b),c=p()+1;let w=dp(v,c),E=S.createHref(v.mask||v);try{a.pushState(w,"",E)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;o.location.assign(E)}s&&l&&l({action:i,location:S.location,delta:1})}function m(b,_){i="REPLACE";let v=up(b)?b:qo(S.location,b,_);r&&r(v,b),c=p();let w=dp(v,c),E=S.createHref(v.mask||v);a.replaceState(w,"",E),s&&l&&l({action:i,location:S.location,delta:0})}function g(b){return Eg(o,b)}let S={get action(){return i},get location(){return e(o,a)},listen(b){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(cp,d),l=b,()=>{o.removeEventListener(cp,d),l=null}},createHref(b){return t(o,b)},createURL:g,encodeLocation(b){let _=g(b);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:h,replace:m,go(b){return a.go(b)}};return S}function Eg(e,t,r=!1){let n="http://localhost";e&&(n=e.location.origin!=="null"?e.location.origin:e.location.href),pe(n,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:gt(t);return o=o.replace(/ $/,"%20"),!r&&oi.test(o)&&(o=n+o),new URL(o,n)}function fE(e){return{defaultValue:e}}var pp=class{#e=new Map;constructor(e){if(e)for(let[t,r]of e)this.set(t,r)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){this.#e.set(e,t)}},hE=new Set(["lazy","caseSensitive","path","id","index","children","unstable_validateParams"]);function mE(e){return hE.has(e)}var gE=new Set(["lazy","caseSensitive","path","id","index","middleware","children","unstable_validateParams"]);function vE(e){return gE.has(e)}function yE(e){return e.index===!0}function wg(e){let t={};return e.Component&&Object.assign(t,{element:f.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:f.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:f.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Vo(e,t=wg,r=[],n={},o=!1){return e.map((s,a)=>{let i=[...r,String(a)],l=typeof s.id=="string"?s.id:i.join("-");if(pe(s.index!==!0||!s.children,"Cannot specify children on an index route"),pe(o||!n[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),yE(s)){let c={...s,id:l};return n[l]=fp(c,t(c)),c}else{let c={...s,id:l,children:void 0};return n[l]=fp(c,t(c)),s.children&&(c.children=Vo(s.children,t,i,n,o)),c}})}function fp(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function bE(e,t,r="/"){return kg(e,t,r,!1)}function kg(e,t,r,n,o){let s=xt((typeof t=="string"?qt(t):t).pathname||"/",r);if(s==null)return null;let a=o??Cg(e),i=null,l=PE(s);for(let c=0;i==null&&c<a.length;++c)i=NE(a[c],l,n);return i}function Ig(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,loaderData:t[r.id],handle:r.handle}}function Cg(e){let t=Rg(e);return SE(t),t}function Rg(e,t=[],r=[],n="",o=!1){let s=(a,i,l=o,c)=>{let p={relativePath:c===void 0?a.path||"":c,caseSensitive:a.caseSensitive===!0,childrenIndex:i,route:a};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(n)&&l)return;pe(p.relativePath.startsWith(n),`Absolute route path "${p.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(n.length)}let d=Mt([n,p.relativePath]),h=r.concat(p);a.children&&a.children.length>0&&(pe(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Rg(a.children,t,h,d,l)),!(a.path==null&&!a.index)&&t.push({path:d,score:TE(d,a.index),routesMeta:h.map((m,g)=>{let[S,b]=Ng(m.relativePath,m.caseSensitive,g===h.length-1);return{...m,matcher:S,compiledParams:b}})})};return e.forEach((a,i)=>{if(a.path===""||!a.path?.includes("?"))s(a,i);else for(let l of Tg(a.path))s(a,i,!0,l)}),t}function Tg(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return o?[s,""]:[s];let a=Tg(n.join("/")),i=[];return i.push(...a.map(l=>l===""?s:[s,l].join("/"))),o&&i.push(...a),i.map(l=>e.startsWith("/")&&l===""?"/":l)}function SE(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:AE(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var _E=/^:[\w-]+$/,xE=/^:[\w-]+/,EE=3.5,wE=3,kE=2,IE=1,CE=10,RE=-2,hp=e=>e==="*";function TE(e,t){let r=e.split("/"),n=r.length;return r.some(hp)&&(n+=RE),t&&(n+=kE),r.filter(o=>!hp(o)).reduce((o,s)=>o+(_E.test(s)?wE:xE.test(s)?EE:s===""?IE:CE),n)}function AE(e,t){return e.length===t.length&&e.slice(0,-1).every((r,n)=>r===t[n])?e[e.length-1]-t[t.length-1]:0}function NE(e,t,r=!1){let{routesMeta:n}=e,o={},s="/",a=[];for(let i=0;i<n.length;++i){let l=n[i],c=i===n.length-1,p=s==="/"?t:t.slice(s.length)||"/",d={path:l.relativePath,caseSensitive:l.caseSensitive,end:c},h=l.matcher&&l.compiledParams?Ag(d,p,l.matcher,l.compiledParams):ka(d,p),m=l.route;if(!h&&c&&r&&!n[n.length-1].route.index&&(h=ka({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},p)),!h)return null;Object.assign(o,h.params),a.push({params:o,pathname:Mt([s,h.pathname]),pathnameBase:jE(Mt([s,h.pathnameBase])),route:m}),h.pathnameBase!=="/"&&(s=Mt([s,h.pathnameBase]))}return a}function ka(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Ng(e.path,e.caseSensitive,e.end);return Ag(e,t,r,n)}function Ag(e,t,r,n){let o=t.match(r);if(!o)return null;let s=o[0],a=Ia(s,1),i=o.slice(1);return{params:n.reduce((l,{paramName:c,isOptional:p},d)=>{if(c==="*"){let m=i[d]||"";a=Ia(s.slice(0,s.length-m.length),1)}const h=i[d];return p&&!h?l[c]=void 0:l[c]=(h||"").replace(/%2F/g,"/"),l},{}),pathname:s,pathnameBase:a,pattern:e}}function Ng(e,t=!1,r=!0){et(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,i,l,c)=>{if(n.push({paramName:a,isOptional:i!=null}),i){let p=c.charAt(l+s.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,"(?:/$1)?");return e.endsWith("*")?(n.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function PE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return et(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function xt(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function ME({basename:e,pathname:t}){return t==="/"?e:Mt([e,t])}var ou=e=>ni.test(e);function OE(e,t="/"){let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?qt(e):e,s;return r?(r=su(r),r.startsWith("/")||r.startsWith("\\")?s=mp(r.substring(1),"/"):s=mp(r,t)):s=t,{pathname:s,search:LE(n),hash:DE(o)}}function mp(e,t){let r=Ia(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function zi(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Pg(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function si(e){let t=Pg(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function gs(e,t,r,n=!1){let o;typeof e=="string"?o=qt(e):(o={...e},pe(!o.pathname||!o.pathname.includes("?"),zi("?","pathname","search",o)),pe(!o.pathname||!o.pathname.includes("#"),zi("#","pathname","hash",o)),pe(!o.search||!o.search.includes("#"),zi("#","search","hash",o)));let s=e===""||o.pathname==="",a=s?"/":o.pathname,i;if(a==null)i=r;else{let d=t.length-1;if(!n&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),d-=1;o.pathname=h.join("/")}i=d>=0?t[d]:"/"}let l=OE(o,i),c=a&&a!=="/"&&a.endsWith("/"),p=(s||a===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||p)&&(l.pathname+="/"),l}var su=e=>e.replace(/[\\/]{2,}/g,"/"),Mt=e=>su(e.join("/"));function Ia(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var jE=e=>Ia(e).replace(/^\/*/,"/"),LE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,DE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,R$=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,{...r,headers:n})},FE=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],vs=class{status;statusText;data;error;internal;constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Go(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function io(e){return Mt(e.map(t=>t.route.path).filter(Boolean))||"/"}function au(e,t){let r=new URL(typeof e=="string"||e instanceof URL?e:e.url),n=typeof t=="string"?qt(t):t;if(r.pathname=n.pathname||"/",n.search){let o=new URLSearchParams(n.search),s=o.getAll("index");o.delete("index");for(let i of s.filter(Boolean))o.append("index",i);let a=o.toString();r.search=a?`?${a}`:""}else r.search="";return r.hash=n.hash||"",r}var Mg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Og(e,t){let r=e;if(typeof r!="string"||!ni.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,o=!1;if(Mg)try{let s=new URL(window.location.href),a=oi.test(r)?new URL(xg(r,s.protocol)):new URL(r),i=xt(a.pathname,t);a.origin===s.origin&&i!=null?r=i+a.search+a.hash:o=!0}catch{et(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:o,to:r}}var jg=Symbol("Uninstrumented"),T$=fE(),Ro=new WeakMap;function HE(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(s){s.lazy!=null&&r.lazy.push(s.lazy),s["lazy.loader"]!=null&&r["lazy.loader"].push(s["lazy.loader"]),s["lazy.action"]!=null&&r["lazy.action"].push(s["lazy.action"]),s["lazy.middleware"]!=null&&r["lazy.middleware"].push(s["lazy.middleware"]),s.middleware!=null&&r.middleware.push(s.middleware),s.loader!=null&&r.loader.push(s.loader),s.action!=null&&r.action.push(s.action)}}));let n={};if(typeof t.lazy=="function"&&r.lazy.length>0){let o=t.lazy;n.lazy=async(...s)=>ur(await Gt(r.lazy,void 0,()=>o(...s),dr))}if(typeof t.lazy=="object"){let o=t.lazy;if(typeof o.middleware=="function"&&r["lazy.middleware"].length>0){let s=o.middleware;n.lazy=Object.assign(n.lazy||{},{middleware:async(...a)=>ur(await Gt(r["lazy.middleware"],void 0,()=>s(...a),dr))})}if(typeof o.loader=="function"&&r["lazy.loader"].length>0){let s=o.loader;n.lazy=Object.assign(n.lazy||{},{loader:async(...a)=>ur(await Gt(r["lazy.loader"],void 0,()=>s(...a),dr))})}if(typeof o.action=="function"&&r["lazy.action"].length>0){let s=o.action;n.lazy=Object.assign(n.lazy||{},{action:async(...a)=>ur(await Gt(r["lazy.action"],void 0,()=>s(...a),dr))})}}if(typeof t.loader=="function"&&r.loader.length>0){let o=To(t.loader),s=async(...a)=>ur(await Gt(r.loader,Wi(a[0]),()=>o(...a),dr));o.hydrate===!0&&(s.hydrate=!0),Ao(s,o),n.loader=s}if(typeof t.action=="function"&&r.action.length>0){let o=To(t.action),s=async(...a)=>ur(await Gt(r.action,Wi(a[0]),()=>o(...a),dr));Ao(s,o),n.action=s}return t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(o=>{let s=To(o),a=async(...i)=>ur(await Gt(r.middleware,Wi(i[0]),()=>s(...i),dr));return Ao(a,s),a})),n}function UE(e,t){let r={navigate:[],fetch:[]};if(t.forEach(n=>n({instrument(o){o.navigate!=null&&r.navigate.push(o.navigate),o.fetch!=null&&r.fetch.push(o.fetch)}})),r.navigate.length>0){let n=To(e.navigate),o=async(...s)=>{let[a,i]=s,l,c={to:typeof a=="number"||typeof a=="string"?a:a?gt(a):".",...yp(e,i??{})};return ur(await Gt(r.navigate,c,async()=>{if(typeof a=="number")return await n(...s);let p=gp(e,d=>{l=d});try{return await n(...s)}finally{p()}},p=>({...dr(p),meta:l})))};Ao(o,n),e.navigate=o}if(r.fetch.length>0){let n=To(e.fetch),o=async(...s)=>{let[a,i,l,c]=s,p;return ur(await Gt(r.fetch,{href:l??".",fetcherKey:a,...yp(e,c??{})},async()=>{let d=gp(e,h=>{p=h});try{return await n(...s)}finally{d()}},d=>({...dr(d),meta:p})))};Ao(o,n),e.fetch=o}return e}function To(e){return e[jg]??e}function Ao(e,t){e[jg]=t}function gp(e,t){return Ro.set(e,t),()=>{Ro.get(e)===t&&Ro.delete(e)}}function vp(e){let t=Ro.get(e);return Ro.delete(e),t}function ur(e){if(e.type==="error")throw e.value;return e.value}async function Gt(e,t,r,n,o={result:null,innerResult:null},s=e.length-1){let a=e[s];if(a){let i,l=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=Gt(e,t,r,n,o,s-1),await i,pe(o.innerResult,"Expected an inner result"),o.innerResult);try{await a(l,t)}catch(c){console.error("An instrumentation function threw an error:",c)}i||await l(),await i}else{try{o.result={type:"success",value:await r()}}catch(i){o.result={type:"error",value:i}}o.innerResult=n(o.result,t)}return o.result||(o.result={type:"error",value:new Error("No result assigned in instrumentation chain.")},o.innerResult=n(o.result,t)),o.result}function dr(e){return e.type==="error"&&e.value instanceof Error?{status:"error",error:e.value}:{status:"success",error:void 0}}function Wi(e){let{request:t,context:r,params:n}=e;return{...e,request:$E(t),params:{...n},context:BE(r)}}function yp(e,t){return{currentUrl:gt(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function $E(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function BE(e){return{get:t=>e.get(t)}}var zE=class{#e=[];#t=[];#r;constructor(e){this.#r=e}update(e){this.#e=e,this.#t=Cg(e)}match(e,t=!1){return kg(this.#e,e,this.#r,t,this.#t)}},WE;function qE(){return WE}var bp=new URL("http://localhost");function iu(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),bp)}catch{return bp}}function qi(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function VE(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function Hn(e,t,r,n){let o=null;try{o=e==null?null:new URL(e,r)}catch{}let s=new URL(t,r),a=o!=null&&!qi(o,r),i=!qi(s,r);if(n==="reject"){if(a||i)throw new Error("External navigation is not allowed")}else if(i&&(o==null||!VE(e,o)||!qi(o,s)))throw new Error("External navigation is not allowed")}var Lg=["POST","PUT","PATCH","DELETE"],GE=new Set(Lg),YE=["GET",...Lg],JE=new Set(YE),Dg=new Set([301,302,303,307,308]),KE=new Set([307,308]),Vi={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},XE={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},kn={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Fg="remix-router-transitions",Hg=Symbol("ResetLoaderData");function QE(e,t){if(e.unstable_routePatternMatching){let r=qE();return pe(r,'You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.'),new r(t)}return new zE(t)}var ZE=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#r=t,this.#r.update(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#t??this.#e}get hasHMRRoutes(){return this.#t!=null}setRoutes(e){this.#e=e,this.#t||this.#r.update(e)}setHmrRoutes(e){this.#t=e,this.#r.update(e)}commitHmrRoutes(){this.#t&&(this.#e=this.#t,this.#t=void 0,this.#r.update(this.#e))}};function ew(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";pe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],o=e.mapRouteProperties,s=o||(()=>({}));if(e.instrumentations){let x=e.instrumentations;s=k=>({...o?.(k),...HE(x.map(R=>R.route).filter(Boolean),k)})}let a={...e.future},i=e.basename||"/";i.startsWith("/")||(i=`/${i}`);let l=QE(a,i),c={},p=new ZE(Vo(e.routes,s,void 0,c),l),d=e.dataStrategy||sw,h=null,m=new Set,g=null,S=null,b=null,_=null,v=e.hydrationData!=null,w=l.match(e.history.location),E=!1,T=null,I,C;if(w==null&&!e.patchRoutesOnNavigation){let x=Pt(404,{pathname:e.history.location.pathname}),{matches:k,route:R}=Us(p.activeRoutes);I=!0,C=!I,w=k,T={[R.id]:x}}else if(w&&!e.hydrationData&&Os(w,e.history.location.pathname).active&&(w=null),w)if(w.some(x=>x.route.lazy))I=!1,C=!I;else if(!w.some(x=>lu(x.route)))I=!0,C=!I;else{let x=e.hydrationData?e.hydrationData.loaderData:null,k=e.hydrationData?e.hydrationData.errors:null,R=w;if(k){let M=w.findIndex(D=>k[D.route.id]!==void 0);R=R.slice(0,M+1)}C=!1,I=!0,R.forEach(M=>{let D=Ug(M.route,x,k);C=C||D.renderFallback,I=I&&!D.shouldLoad})}else{I=!1,C=!I,w=[];let x=Os(null,e.history.location.pathname);x.active&&x.matches&&(E=!0,w=x.matches)}let L,y={historyAction:e.history.action,location:e.history.location,matches:w,initialized:I,renderFallback:C,navigation:Vi,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||T,fetchers:new Map,blockers:new Map},A="POP",N=null,W=!1,O,G=!1,H=new Map,X=null,j=!1,U=!1,ee=new Set,V=new Map,ue=0,P=-1,$=new Map,Y=new Set,J=new Map,ae=new Map,ie=new Set,Se=new Map,Oe,Xe=null;function Tt(){if(h=e.history.listen(({action:x,location:k,delta:R})=>{if(Oe){Oe(),Oe=void 0;return}et(Se.size===0||R!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let M=Pd({currentLocation:y.location,nextLocation:k,historyAction:x});if(M&&R!=null){let D=new Promise(Q=>{Oe=Q});e.history.go(R*-1),Ms(M,{state:"blocked",location:k,proceed(){Ms(M,{state:"proceeding",proceed:void 0,reset:void 0,location:k}),D.then(()=>e.history.go(R))},reset(){let Q=new Map(y.blockers);Q.set(M,kn),Le({blockers:Q})}}),N?.resolve(),N=null;return}return st(x,k)}),r){ww(t,H);let x=()=>kw(t,H);t.addEventListener("pagehide",x),X=()=>t.removeEventListener("pagehide",x)}return y.initialized||st("POP",y.location,{initialHydration:!0}),L}function ho(){h&&h(),X&&X(),m.clear(),O&&O.abort(),y.fetchers.forEach((x,k)=>ji(y.fetchers,k)),y.blockers.forEach((x,k)=>Nd(k))}function mo(x){if(m.add(x),g){let{newErrors:k}=g;g=null,x(y,{deletedFetchers:[],newErrors:k,viewTransitionOpts:void 0,flushSync:!1})}return()=>m.delete(x)}function Le(x,k={}){x.matches&&(x.matches=x.matches.map(D=>{let Q=c[D.route.id],Z=D.route;return Z.element!==Q.element||Z.errorElement!==Q.errorElement||Z.hydrateFallbackElement!==Q.hydrateFallbackElement?{...D,route:Q}:D})),y={...y,...x};let R=[],M=[];y.fetchers.forEach((D,Q)=>{D.state==="idle"&&(ie.has(Q)?R.push(Q):M.push(Q))}),ie.forEach(D=>{!y.fetchers.has(D)&&!V.has(D)&&R.push(D)}),m.size===0&&(g={newErrors:x.errors??null}),[...m].forEach(D=>D(y,{deletedFetchers:R,newErrors:x.errors??null,viewTransitionOpts:k.viewTransitionOpts,flushSync:k.flushSync===!0})),R.forEach(D=>ji(y.fetchers,D)),M.forEach(D=>y.fetchers.delete(D))}function rt(x,k,{flushSync:R}={}){let M=y.actionData!=null&&y.navigation.formMethod!=null&&ut(y.navigation.formMethod)&&y.navigation.state==="loading"&&x.state?._isRedirect!==!0,D;k.actionData?Object.keys(k.actionData).length>0?D=k.actionData:D=null:M?D=y.actionData:D=null;let Q=k.loaderData?Tp(y.loaderData,k.loaderData,k.matches||[],k.errors):y.loaderData,Z=y.blockers;Z.size>0&&!j&&(Z=new Map(Z),Z.forEach((re,ne)=>Z.set(ne,kn)));let B=j?!1:Od(x,k.matches||y.matches),K=W===!0||y.navigation.formMethod!=null&&ut(y.navigation.formMethod)&&x.state?._isRedirect!==!0;p.commitHmrRoutes(),j||A==="POP"||(A==="PUSH"?e.history.push(x,x.state):A==="REPLACE"&&e.history.replace(x,x.state));let he;if(A==="POP"&&!j&&x!==y.location){let re=H.get(y.location.pathname);re&&re.has(x.pathname)?he={currentLocation:y.location,nextLocation:x}:H.has(x.pathname)&&(he={currentLocation:x,nextLocation:y.location})}else if(G){let re=H.get(y.location.pathname);re?re.add(x.pathname):(re=new Set([x.pathname]),H.set(y.location.pathname,re)),he={currentLocation:y.location,nextLocation:x}}Le({...k,actionData:D,loaderData:Q,historyAction:A,location:x,initialized:!0,renderFallback:!1,navigation:Vi,revalidation:"idle",restoreScrollPosition:B,preventScrollReset:K,blockers:Z},{viewTransitionOpts:he,flushSync:R===!0}),A="POP",W=!1,G=!1,j=!1,U=!1,N?.resolve(),N=null,Xe?.resolve(),Xe=null}async function Dt(x,k){if(N?.resolve(),N=null,typeof x=="number"){N||(N=Op());let Te=N.promise;return e.history.go(x),Te}let R=vp(L),{path:M,submission:D,error:Q}=Sp(!1,Ol(y.location,y.matches,i,x,k?.fromRouteId,k?.relative),k),Z;if(k?.mask){let Te=typeof k.mask=="string"?qt(k.mask):{...y.location.mask,...k.mask};if(Z={pathname:Te.pathname??"",search:Te.search??"",hash:Te.hash??""},oi.test(Z.pathname))throw new Error("External navigation is not allowed");Z.pathname.startsWith("\\")&&(Z.pathname=Z.pathname.replace(/^\\+/,"/")),Hn(typeof k.mask=="string"?k.mask:gt(k.mask),gt(Z),e.history.createURL("/"),"reject")}let B=y.location,K=qo(B,M,k&&k.state,void 0,Z);K={...K,...e.history.encodeLocation(K)},Hn(x==null?e.history.createHref(y.location):typeof x=="string"?x:gt(x),e.history.createHref(K.mask||K),e.history.createURL("/"),"reject");let he=k&&k.replace!=null?k.replace:void 0,re="PUSH";he===!0?re="REPLACE":he===!1||D!=null&&ut(D.formMethod)&&D.formAction===y.location.pathname+y.location.search&&(re="REPLACE");let ne=k&&"preventScrollReset"in k?k.preventScrollReset===!0:void 0,xe=(k&&k.flushSync)===!0,Ge=Pd({currentLocation:B,nextLocation:K,historyAction:re});if(Ge){Ms(Ge,{state:"blocked",location:K,proceed(){Ms(Ge,{state:"proceeding",proceed:void 0,reset:void 0,location:K}),Dt(x,k)},reset(){let Te=new Map(y.blockers);Te.set(Ge,kn),Le({blockers:Te})}});return}await st(re,K,{submission:D,pendingError:Q,preventScrollReset:ne,replace:k&&k.replace,enableViewTransition:k&&k.viewTransition,flushSync:xe,callSiteDefaultShouldRevalidate:k&&k.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:R})}function nr(){Xe||(Xe=Op()),vo(),Le({revalidation:"loading"});let x=Xe.promise;return y.navigation.state==="submitting"?x:y.navigation.state==="idle"?(st(y.historyAction,y.location,{startUninterruptedRevalidation:!0}),x):(st(A||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:G===!0}),x)}async function st(x,k,R){O&&O.abort(),O=null,A=x,j=(R&&R.startUninterruptedRevalidation)===!0,qS(y.location,y.matches),W=(R&&R.preventScrollReset)===!0,G=(R&&R.enableViewTransition)===!0;let M=R?.initialHydration&&y.matches&&y.matches.length>0&&!E?y.matches:l.match(k),D=(R&&R.flushSync)===!0;if(M&&y.initialized&&!U&&hw(y.location,k)&&!(R&&R.submission&&ut(R.submission.formMethod))){rt(k,{matches:M},{flushSync:D});return}let Q=Os(M,k.pathname);if(Q.active&&Q.matches&&(M=Q.matches),R?.instrumentationNavigateMetaReceiver){let Me=Pp(e.history,k,M);R.instrumentationNavigateMetaReceiver(Me)}if(!M){let{error:Me,notFoundMatches:Ie,route:at}=Li(k.pathname);rt(k,{matches:Ie,loaderData:{},errors:{[at.id]:Me}},{flushSync:D});return}let Z=R&&R.overrideNavigation?{...R.overrideNavigation,matches:M,historyAction:x}:void 0;O=new AbortController;let B=In(e.history,k,O.signal,R&&R.submission),K=e.getContext?await e.getContext():new pp,he;if(R&&R.pendingError)he=[kr(M).route.id,{type:"error",error:R.pendingError}];else if(R&&R.submission&&ut(R.submission.formMethod)){let Me=await Wr(B,k,R.submission,M,x,K,Q.active,R&&R.initialHydration===!0,{replace:R.replace,flushSync:D});if(Me.shortCircuited)return;if(Me.pendingActionResult){let[Ie,at]=Me.pendingActionResult;if(wt(at)&&Go(at.error)&&at.error.status===404){O=null,rt(k,{matches:Me.matches,loaderData:{},errors:{[Ie]:at.error}});return}}M=Me.matches||M,he=Me.pendingActionResult,Z=Gi(k,M,x,R.submission),D=!1,Q.active=!1,B=In(e.history,B.url,B.signal)}let{shortCircuited:re,matches:ne,loaderData:xe,errors:Ge,workingFetchers:Te}=await be(B,k,M,x,K,Q.active,Z,R&&R.submission,R&&R.fetcherSubmission,R&&R.replace,R&&R.initialHydration===!0,D,he,R&&R.callSiteDefaultShouldRevalidate);re||(O=null,rt(k,{matches:ne||M,...Ap(he),loaderData:xe,errors:Ge,...Te?{fetchers:Te}:{}}))}async function Wr(x,k,R,M,D,Q,Z,B,K={}){if(vo(),Le({navigation:xw(k,M,D,R)},{flushSync:K.flushSync===!0}),Z){let ne=await js(M,k.pathname,x.signal);if(ne.type==="aborted")return{shortCircuited:!0};if(ne.type==="error"){if(ne.partialMatches.length===0){let{matches:Ge,route:Te}=Us(p.activeRoutes);return{matches:Ge,pendingActionResult:[Te.id,{type:"error",error:ne.error}]}}let xe=kr(ne.partialMatches).route.id;return{matches:ne.partialMatches,pendingActionResult:[xe,{type:"error",error:ne.error}]}}else if(ne.matches)M=ne.matches;else{let{notFoundMatches:xe,error:Ge,route:Te}=Li(k.pathname);return{matches:xe,pendingActionResult:[Te.id,{type:"error",error:Ge}]}}}let he,re=la(M,k);if(!re.route.action&&!re.route.lazy)he={type:"error",error:Pt(405,{method:x.method,pathname:k.pathname,routeId:re.route.id})};else{let ne=await $e(x,k,Un(s,c,x,k,M,re,B?[]:n,Q),Q,null);if(he=ne[re.route.id],!he){for(let xe of M)if(ne[xe.route.id]){he=ne[xe.route.id];break}}if(x.signal.aborted)return{shortCircuited:!0}}if(Kr(he)){let ne;return K&&K.replace!=null?ne=K.replace:ne=Ip(he.response.headers.get("Location"),new URL(x.url),i,e.history)===y.location.pathname+y.location.search,await ke(x,he,!0,{submission:R,replace:ne}),{shortCircuited:!0}}if(wt(he)){let ne=kr(M,re.route.id);return(K&&K.replace)!==!0&&(A="PUSH"),{matches:M,pendingActionResult:[ne.route.id,he,re.route.id]}}return{matches:M,pendingActionResult:[re.route.id,he]}}async function be(x,k,R,M,D,Q,Z,B,K,he,re,ne,xe,Ge){let Te=Z||Gi(k,R,M,B),Me=B||K||Mp(Te),Ie=!j&&!re;if(Q){if(Ie){let nt=lt(xe);Le({navigation:Te,...nt!==void 0?{actionData:nt}:{}},{flushSync:ne})}let Ee=await js(R,k.pathname,x.signal);if(Ee.type==="aborted")return{shortCircuited:!0};if(Ee.type==="error"){if(Ee.partialMatches.length===0){let{matches:ir,route:_n}=Us(p.activeRoutes);return{matches:ir,loaderData:{},errors:{[_n.id]:Ee.error}}}let nt=kr(Ee.partialMatches).route.id;return{matches:Ee.partialMatches,loaderData:{},errors:{[nt]:Ee.error}}}else if(Ee.matches)R=Ee.matches;else{let{error:nt,notFoundMatches:ir,route:_n}=Li(k.pathname);return{matches:ir,loaderData:{},errors:{[_n.id]:nt}}}}let{dsMatches:at,revalidatingFetchers:yt}=_p(x,D,s,c,e.history,y,R,Me,k,re?[]:n,re===!0,U,ee,ie,J,Y,l,xe,Ge);if(P=++ue,!e.dataStrategy&&!at.some(Ee=>Ee.shouldLoad)&&!at.some(Ee=>Ee.route.middleware&&Ee.route.middleware.length>0)&&yt.length===0){let Ee=new Map(y.fetchers),nt=Td(Ee);return rt(k,{matches:R,loaderData:{},errors:xe&&wt(xe[1])?{[xe[0]]:xe[1].error}:null,...Ap(xe),...nt?{fetchers:Ee}:{}},{flushSync:ne}),{shortCircuited:!0}}if(Ie){let Ee={};if(!Q){Ee.navigation=Te;let nt=lt(xe);nt!==void 0&&(Ee.actionData=nt)}yt.length>0&&(Ee.fetchers=ye(yt)),Le(Ee,{flushSync:ne})}yt.forEach(Ee=>{ar(Ee.key),Ee.controller&&V.set(Ee.key,Ee.controller)});let _r=()=>yt.forEach(Ee=>ar(Ee.key));O&&O.signal.addEventListener("abort",_r);let{loaderResults:qr,fetcherResults:Ls}=await go(at,yt,x,k,D);if(x.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener("abort",_r),yt.forEach(Ee=>V.delete(Ee.key));let At=$s(qr);if(At)return await ke(x,At.result,!0,{replace:he}),{shortCircuited:!0};if(At=$s(Ls),At)return Y.add(At.key),await ke(x,At.result,!0,{replace:he}),{shortCircuited:!0};let yn=new Map(y.fetchers),{loaderData:bn,errors:Sn}=Rp(y,R,qr,xe,yt,Ls,yn);re&&y.errors&&(Sn={...y.errors,...Sn});let Ds=Td(yn),Fs=Ad(P,yn),Hs=Ds||Fs||yt.length>0;return{matches:R,loaderData:bn,errors:Sn,...Hs?{workingFetchers:yn}:{}}}function lt(x){if(x&&!wt(x[1]))return{[x[0]]:x[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function ye(x){let k=new Map(y.fetchers);return x.forEach(R=>{let M=k.get(R.key),D=yo(void 0,M?M.data:void 0);k.set(R.key,D)}),k}async function Ve(x,k,R,M){ar(x);let D=(M&&M.flushSync)===!0,Q=vp(L),Z=Ol(y.location,y.matches,i,R,k,M?.relative),B=l.match(Z),K=Os(B,Z);if(K.active&&K.matches&&(B=K.matches),Q&&Q(Pp(e.history,Z,B)),!B){sr(x,k,Pt(404,{pathname:Z}),{flushSync:D});return}let{path:he,submission:re,error:ne}=Sp(!0,Z,M);if(ne){sr(x,k,ne,{flushSync:D});return}let xe=e.getContext?await e.getContext():new pp,Ge=(M&&M.preventScrollReset)===!0;if(re&&ut(re.formMethod)){await F(x,k,he,B,xe,K.active,D,Ge,re,M&&M.defaultShouldRevalidate);return}let Te={routeId:k,path:he,isDiscovering:K.active};J.set(x,Te),await fe(x,Te,B,xe,D,Ge,re)}async function F(x,k,R,M,D,Q,Z,B,K,he){vo(),J.delete(x),or(x,Ew(K,y.fetchers.get(x)),{flushSync:Z});let re=new AbortController,ne=In(e.history,R,re.signal,K);if(Q){let We=await js(M,new URL(ne.url).pathname,ne.signal,x);if(We.type==="aborted")return;if(We.type==="error"){sr(x,k,We.error,{flushSync:Z});return}else if(We.matches)M=We.matches;else{sr(x,k,Pt(404,{pathname:R}),{flushSync:Z});return}}let xe=la(M,R);if(!xe.route.action&&!xe.route.lazy){sr(x,k,Pt(405,{method:K.formMethod,pathname:R,routeId:k}),{flushSync:Z});return}V.set(x,re);let Ge=ue,Te=Un(s,c,ne,R,M,xe,n,D),Me=await $e(ne,R,Te,D,x),Ie=Me[xe.route.id];if(!Ie){for(let We of Te)if(Me[We.route.id]){Ie=Me[We.route.id];break}}if(ne.signal.aborted){V.get(x)===re&&V.delete(x);return}if(ie.has(x)){if(Kr(Ie)||wt(Ie)){or(x,Vt(void 0));return}}else{if(Kr(Ie))if(V.delete(x),P>Ge){or(x,Vt(void 0));return}else return Y.add(x),or(x,yo(K)),ke(ne,Ie,!1,{fetcherSubmission:K,preventScrollReset:B});if(wt(Ie)){sr(x,k,Ie.error);return}}let at=y.navigation.location||y.location,yt=In(e.history,at,re.signal),_r=y.navigation.state!=="idle"?l.match(y.navigation.location):y.matches;pe(_r,"Didn't find any matches after fetcher action");let qr=++ue;$.set(x,qr);let{dsMatches:Ls,revalidatingFetchers:At}=_p(yt,D,s,c,e.history,y,_r,K,at,n,!1,U,ee,ie,J,Y,l,[xe.route.id,Ie],he),yn=yo(K,Ie.data),bn=new Map(y.fetchers);bn.set(x,yn),At.filter(We=>We.key!==x).forEach(We=>{let Vr=We.key,Ld=bn.get(Vr),YS=yo(void 0,Ld?Ld.data:void 0);bn.set(Vr,YS),ar(Vr),We.controller&&V.set(Vr,We.controller)}),Le({fetchers:bn});let Sn=()=>At.forEach(We=>ar(We.key));re.signal.addEventListener("abort",Sn);let{loaderResults:Ds,fetcherResults:Fs}=await go(Ls,At,yt,at,D);if(re.signal.aborted){$.get(x)===qr&&$.delete(x);return}re.signal.removeEventListener("abort",Sn),$.delete(x),V.delete(x),At.forEach(We=>V.delete(We.key));let Hs=y.fetchers.has(x),Ee=We=>{if(!Hs)return We;let Vr=new Map(We.fetchers);return Vr.set(x,Vt(Ie.data)),{...We,fetchers:Vr}},nt=$s(Ds);if(nt)return y=Ee(y),ke(yt,nt.result,!1,{preventScrollReset:B});if(nt=$s(Fs),nt)return Y.add(nt.key),y=Ee(y),ke(yt,nt.result,!1,{preventScrollReset:B});let ir=new Map(y.fetchers);Hs&&ir.set(x,Vt(Ie.data));let{loaderData:_n,errors:Di}=Rp(y,_r,Ds,void 0,At,Fs,ir);Ad(qr,ir),y.navigation.state==="loading"&&qr>P?(pe(A,"Expected pending action"),O&&O.abort(),rt(y.navigation.location,{matches:_r,loaderData:_n,errors:Di,fetchers:ir})):(Le({errors:Di,loaderData:Tp(y.loaderData,_n,_r,Di),fetchers:ir}),U=!1)}async function fe(x,k,R,M,D,Q,Z){let{routeId:B,path:K}=k,he=y.fetchers.get(x);or(x,yo(Z,he?he.data:void 0),{flushSync:D});let re=new AbortController,ne=In(e.history,K,re.signal);if(k.isDiscovering){let Ie=await js(R,new URL(ne.url).pathname,ne.signal,x);if(Ie.type==="aborted")return;if(Ie.type==="error"){sr(x,B,Ie.error,{flushSync:D});return}else if(Ie.matches)R=Ie.matches,k.isDiscovering=!1;else{sr(x,B,Pt(404,{pathname:K}),{flushSync:D});return}}let xe=la(R,K);V.set(x,re);let Ge=ue,Te=await $e(ne,K,Un(s,c,ne,K,R,xe,n,M),M,x),Me=Te[xe.route.id];if(!Me){for(let Ie of R)if(Te[Ie.route.id]){Me=Te[Ie.route.id];break}}if(V.get(x)===re&&V.delete(x),!ne.signal.aborted){if(ie.has(x)){or(x,Vt(void 0));return}if(Kr(Me))if(P>Ge){or(x,Vt(void 0));return}else{Y.add(x),await ke(ne,Me,!1,{preventScrollReset:Q});return}if(wt(Me)){sr(x,B,Me.error);return}or(x,Vt(Me.data))}}async function ke(x,k,R,{submission:M,fetcherSubmission:D,preventScrollReset:Q,replace:Z}={}){R||(N?.resolve(),N=null),k.response.headers.has("X-Remix-Revalidate")&&(U=!0);let B=k.response.headers.get("Location");pe(B,"Expected a Location header on the redirect Response");let K=B,he=new URL(x.url);B=Ip(B,he,i,e.history),Hn(K,B,he,"allow-explicit");let re=qo(y.location,B,{_isRedirect:!0});if(r){let Ie=!1;if(k.response.headers.has("X-Remix-Reload-Document"))Ie=!0;else if(ou(B)){const at=Eg(t,B,!0);Ie=at.origin!==t.location.origin||xt(at.pathname,i)==null}if(Ie){Z?t.location.replace(B):t.location.assign(B);return}}O=null;let ne=Z===!0||k.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:xe,formAction:Ge,formEncType:Te}=y.navigation;!M&&!D&&xe&&Ge&&Te&&(M=Mp(y.navigation));let Me=M||D;KE.has(k.response.status)&&Me&&ut(Me.formMethod)?await st(ne,re,{submission:{...Me,formAction:B},preventScrollReset:Q||W,enableViewTransition:R?G:void 0}):await st(ne,re,{overrideNavigation:Gi(re,[],ne,M),fetcherSubmission:D,preventScrollReset:Q||W,enableViewTransition:R?G:void 0})}async function $e(x,k,R,M,D){let Q,Z={};try{Q=await iw(d,x,k,R,D,M,!1)}catch(B){return R.filter(K=>K.shouldLoad).forEach(K=>{Z[K.route.id]={type:"error",error:B}}),Z}if(x.signal.aborted)return Z;if(!ut(x.method))for(let B of R){if(Q[B.route.id]?.type==="error")break;!Q.hasOwnProperty(B.route.id)&&!y.loaderData.hasOwnProperty(B.route.id)&&(!y.errors||!y.errors.hasOwnProperty(B.route.id))&&B.shouldCallHandler()&&(Q[B.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${B.route.id}`)})}for(let[B,K]of Object.entries(Q))if(yw(K)){let he=K.result;Z[B]={type:"redirect",response:dw(he,x,B,R,i)}}else Z[B]=await uw(K);return Z}async function go(x,k,R,M,D){let Q=$e(R,M,x,D,null),Z=Promise.all(k.map(async B=>{if(B.matches&&B.match&&B.request&&B.controller){let K=(await $e(B.request,B.path,B.matches,D,B.key))[B.match.route.id];return{[B.key]:K}}else return Promise.resolve({[B.key]:{type:"error",error:Pt(404,{pathname:B.path})}})}));return{loaderResults:await Q,fetcherResults:(await Z).reduce((B,K)=>Object.assign(B,K),{})}}function vo(){U=!0,J.forEach((x,k)=>{V.has(k)&&ee.add(k),ar(k)})}function or(x,k,R={}){let M=new Map(y.fetchers);M.set(x,k),Le({fetchers:M},{flushSync:(R&&R.flushSync)===!0})}function sr(x,k,R,M={}){let D=kr(y.matches,k),Q=new Map(y.fetchers);ji(Q,x),Le({errors:{[D.route.id]:R},fetchers:Q},{flushSync:(M&&M.flushSync)===!0})}function US(x){return ae.set(x,(ae.get(x)||0)+1),ie.has(x)&&ie.delete(x),y.fetchers.get(x)||XE}function $S(x,k){ar(x,k?.reason),or(x,Vt(null))}function ji(x,k){let R=y.fetchers.get(k);V.has(k)&&!(R&&R.state==="loading"&&$.has(k))&&ar(k),J.delete(k),$.delete(k),Y.delete(k),ie.delete(k),ee.delete(k),x.delete(k)}function BS(x){let k=(ae.get(x)||0)-1;k<=0?(ae.delete(x),ie.add(x)):ae.set(x,k),Le({fetchers:new Map(y.fetchers)})}function ar(x,k){let R=V.get(x);R&&(R.abort(k),V.delete(x))}function Rd(x,k){for(let R of x){let M=k.get(R);pe(M,`Expected fetcher: ${R}`);let D=Vt(M.data);k.set(R,D)}}function Td(x){let k=[],R=!1;for(let M of Y){let D=x.get(M);pe(D,`Expected fetcher: ${M}`),D.state==="loading"&&(Y.delete(M),k.push(M),R=!0)}return Rd(k,x),R}function Ad(x,k){let R=[];for(let[M,D]of $)if(D<x){let Q=k.get(M);pe(Q,`Expected fetcher: ${M}`),Q.state==="loading"&&(ar(M),$.delete(M),R.push(M))}return Rd(R,k),R.length>0}function zS(x,k){let R=y.blockers.get(x)||kn;return Se.get(x)!==k&&Se.set(x,k),R}function Nd(x){y.blockers.delete(x),Se.delete(x)}function Ms(x,k){let R=y.blockers.get(x)||kn;pe(R.state==="unblocked"&&k.state==="blocked"||R.state==="blocked"&&k.state==="blocked"||R.state==="blocked"&&k.state==="proceeding"||R.state==="blocked"&&k.state==="unblocked"||R.state==="proceeding"&&k.state==="unblocked",`Invalid blocker state transition: ${R.state} -> ${k.state}`);let M=new Map(y.blockers);M.set(x,k),Le({blockers:M})}function Pd({currentLocation:x,nextLocation:k,historyAction:R}){if(Se.size===0)return;Se.size>1&&et(!1,"A router only supports one blocker at a time");let M=Array.from(Se.entries()),[D,Q]=M[M.length-1],Z=y.blockers.get(D);if(!(Z&&Z.state==="proceeding")&&Q({currentLocation:x,nextLocation:k,historyAction:R}))return D}function Li(x){let k=Pt(404,{pathname:x}),R=p.activeRoutes,{matches:M,route:D}=Us(R);return{notFoundMatches:M,route:D,error:k}}function WS(x,k,R){if(S=x,_=k,b=R||null,!v&&y.navigation===Vi){v=!0;let M=Od(y.location,y.matches);M!=null&&Le({restoreScrollPosition:M})}return()=>{S=null,_=null,b=null}}function Md(x,k){return b&&b(x,k.map(R=>Ig(R,y.loaderData)))||x.key}function qS(x,k){if(S&&_){let R=Md(x,k);S[R]=_()}}function Od(x,k){if(S){let R=Md(x,k),M=S[R];if(typeof M=="number")return M}return null}function Os(x,k){if(e.patchRoutesOnNavigation)if(x){if(Object.keys(x[0].params).length>0)return{active:!0,matches:l.match(k,!0)}}else return{active:!0,matches:l.match(k,!0)||[]};return{active:!1,matches:null}}async function js(x,k,R,M){if(!e.patchRoutesOnNavigation)return{type:"success",matches:x};let D=x;for(;;){let Q=c;try{await e.patchRoutesOnNavigation({signal:R,path:k,matches:D,fetcherKey:M,patch:(K,he)=>{R.aborted||xp(K,he,p,Q,s,!1)}})}catch(K){return{type:"error",error:K,partialMatches:D}}if(R.aborted)return{type:"aborted"};let Z=l.match(k),B=null;if(Z){if(Object.keys(Z[0].params).length===0)return{type:"success",matches:Z};if(B=l.match(k,!0),!(B&&D.length<B.length&&jd(D,B.slice(0,D.length))))return{type:"success",matches:Z}}if(B||(B=l.match(k,!0)),!B||jd(D,B))return{type:"success",matches:null};D=B}}function jd(x,k){return x.length===k.length&&x.every((R,M)=>R.route.id===k[M].route.id)}function VS(x){c={},p.setHmrRoutes(Vo(x,s,void 0,c))}function GS(x,k,R=!1){xp(x,k,p,c,s,R),p.hasHMRRoutes||Le({})}return L={get basename(){return i},get future(){return a},get state(){return y},get routes(){return p.stableRoutes},match(x){return l.match(x)},get manifest(){return c},get window(){return t},initialize:Tt,subscribe:mo,enableScrollRestoration:WS,navigate:Dt,fetch:Ve,revalidate:nr,createHref:x=>e.history.createHref(x),createURL:x=>e.history.createURL(x),encodeLocation:x=>e.history.encodeLocation(x),getFetcher:US,resetFetcher:$S,deleteFetcher:BS,dispose:ho,getBlocker:zS,deleteBlocker:Nd,patchRoutes:GS,_internalFetchControllers:V,_internalSetRoutes:VS,_internalSetStateDoNotUseOrYouWillBreakYourApp(x){Le(x)}},e.instrumentations&&(L=UE(L,e.instrumentations.map(x=>x.router).filter(Boolean))),L}function tw(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ol(e,t,r,n,o,s){let a,i;if(o){a=[];for(let c of t)if(a.push(c),c.route.id===o){i=c;break}}else a=t,i=t[t.length-1];let l=gs(n||".",si(a),xt(e.pathname,r)||e.pathname,s==="path");if(n==null&&(l.search=e.search,l.hash=e.hash),(n==null||n===""||n===".")&&i){let c=uu(l.search);if(i.route.index&&!c)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!i.route.index&&c){let p=new URLSearchParams(l.search),d=p.getAll("index");p.delete("index"),d.filter(m=>m).forEach(m=>p.append("index",m));let h=p.toString();l.search=h?`?${h}`:""}}return r!=="/"&&(l.pathname=ME({basename:r,pathname:l.pathname})),gt(l)}function Sp(e,t,r){if(!r||!tw(r))return{path:t};if(r.formMethod&&!_w(r.formMethod))return{path:t,error:Pt(405,{method:r.formMethod})};let n=()=>({path:t,error:Pt(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),s=Vg(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ut(o))return n();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((d,[h,m])=>`${d}${h}=${m}
2
2
  `,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!ut(o))return n();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return n()}}}pe(typeof FormData=="function","FormData is not available in this environment");let a,i;if(r.formData)a=Dl(r.formData),i=r.formData;else if(r.body instanceof FormData)a=Dl(r.body),i=r.body;else if(r.body instanceof URLSearchParams)a=r.body,i=Cp(a);else if(r.body==null)a=new URLSearchParams,i=new FormData;else try{a=new URLSearchParams(r.body),i=Cp(a)}catch{return n()}let l={formMethod:o,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(ut(l.formMethod))return{path:t,submission:l};let c=qt(t);return e&&c.search&&uu(c.search)&&a.append("index",""),c.search=`?${a}`,{path:gt(c),submission:l}}function _p(e,t,r,n,o,s,a,i,l,c,p,d,h,m,g,S,b,_,v){let w=_?wt(_[1])?_[1].error:_[1].data:void 0,E=o.createURL(s.location),T=o.createURL(l),I;if(p&&s.errors){let O=Object.keys(s.errors)[0];I=a.findIndex(G=>G.route.id===O)}else if(_&&wt(_[1])){let O=_[0];I=a.findIndex(G=>G.route.id===O)-1}let C=_?_[1].statusCode:void 0,L=C&&C>=400,y={currentUrl:E,currentParams:s.matches[0]?.params||{},nextUrl:T,nextParams:a[0].params,...i,actionResult:w,actionStatus:C},A=io(a),N=a.map((O,G)=>{let{route:H}=O,X=null;if(I!=null&&G>I)X=!1;else if(H.lazy)X=!0;else if(!lu(H))X=!1;else if(p){let{shouldLoad:ee}=Ug(H,s.loaderData,s.errors);X=ee}else rw(s.loaderData,s.matches[G],O)&&(X=!0);if(X!==null)return jl(r,n,e,l,A,O,c,t,X);let j=!1;typeof v=="boolean"?j=v:L?j=!1:(d||E.pathname+E.search===T.pathname+T.search||E.search!==T.search||nw(s.matches[G],O))&&(j=!0);let U={...y,defaultShouldRevalidate:j};return jl(r,n,e,l,A,O,c,t,No(O,U),U,v)}),W=[];return g.forEach((O,G)=>{if(p||!a.some(P=>P.route.id===O.routeId)||m.has(G)||O.isDiscovering)return;let H=s.fetchers.get(G),X=H&&H.state!=="idle"&&H.data===void 0,j=b.match(O.path);if(!j){W.push({key:G,routeId:O.routeId,path:O.path,matches:null,match:null,request:null,controller:null});return}if(S.has(G))return;let U=la(j,O.path),ee=new AbortController,V=In(o,O.path,ee.signal),ue=null;if(h.has(G))h.delete(G),ue=Un(r,n,V,O.path,j,U,c,t);else if(X)d&&(ue=Un(r,n,V,O.path,j,U,c,t));else{let P;typeof v=="boolean"?P=v:L?P=!1:P=d;let $={...y,defaultShouldRevalidate:P};No(U,$)&&(ue=Un(r,n,V,O.path,j,U,c,t,$))}ue&&W.push({key:G,routeId:O.routeId,path:O.path,matches:ue,match:U,request:V,controller:ee})}),{dsMatches:N,revalidatingFetchers:W}}function lu(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Ug(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!lu(e))return{shouldLoad:!1,renderFallback:!1};let n=t!=null&&e.id in t,o=r!=null&&r[e.id]!==void 0;if(!n&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!n};let s=!n&&!o;return{shouldLoad:s,renderFallback:s}}function rw(e,t,r){let n=!t||r.route.id!==t.route.id,o=!e.hasOwnProperty(r.route.id);return n||o}function nw(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function No(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function xp(e,t,r,n,o,s){let a;if(e){let c=n[e];pe(c,`No route found to patch children into: routeId = ${e}`),c.children||(c.children=[]),a=c.children}else a=r.activeRoutes;let i=[],l=[];if(t.forEach(c=>{let p=a.find(d=>$g(c,d));p?l.push({existingRoute:p,newRoute:c}):i.push(c)}),i.length>0){let c=Vo(i,o,[e||"_","patch",String(a?.length||"0")],n);a.push(...c)}if(s&&l.length>0)for(let c=0;c<l.length;c++){let{existingRoute:p,newRoute:d}=l[c],h=p,[m]=Vo([d],o,[],{},!0);Object.assign(h,{element:m.element?m.element:h.element,errorElement:m.errorElement?m.errorElement:h.errorElement,hydrateFallbackElement:m.hydrateFallbackElement?m.hydrateFallbackElement:h.hydrateFallbackElement})}r.hasHMRRoutes||r.setRoutes([...r.activeRoutes])}function $g(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((r,n)=>t.children?.some(o=>$g(r,o)))??!1:!1}var Ep=new WeakMap,Bg=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let o=r[t.id];if(pe(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let s=o.lazy[e];if(!s)return;let a=Ep.get(o);a||(a={},Ep.set(o,a));let i=a[e];if(i)return i;let l=(async()=>{let c=mE(e),p=o[e]!==void 0;if(c)et(!c,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),a[e]=Promise.resolve();else if(p)et(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let d=await s();d!=null&&(Object.assign(o,{[e]:d}),Object.assign(o,n(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(d=>d===void 0)&&(o.lazy=void 0))})();return a[e]=l,l},wp=new WeakMap;function ow(e,t,r,n,o){let s=r[e.id];if(pe(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let p=wp.get(s);if(p)return{lazyRoutePromise:p,lazyHandlerPromise:p};let d=(async()=>{pe(typeof e.lazy=="function","No lazy route function found");let h=await e.lazy(),m={};for(let g in h){let S=h[g];if(S===void 0)continue;let b=vE(g),_=s[g]!==void 0;b?et(!b,"Route property "+g+" is not a supported property to be returned from a lazy route function. This property will be ignored."):_?et(!_,`Route "${s.id}" has a static property "${g}" defined but its lazy function is also returning a value for this property. The lazy route property "${g}" will be ignored.`):m[g]=S}Object.assign(s,m),Object.assign(s,{...n(s),lazy:void 0})})();return wp.set(s,d),d.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:d}}let a=Object.keys(e.lazy),i=[],l;for(let p of a){if(o&&o.includes(p))continue;let d=Bg({key:p,route:e,manifest:r,mapRouteProperties:n});d&&(i.push(d),p===t&&(l=d))}let c=i.length>0?Promise.all(i).then(()=>{}):void 0;return c?.catch(()=>{}),l?.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:l}}async function kp(e){let t=e.matches.filter(n=>n.shouldLoad),r={};return(await Promise.all(t.map(n=>n.resolve()))).forEach((n,o)=>{r[t[o].route.id]=n}),r}async function sw(e){return e.matches.some(t=>t.route.middleware)?zg(e,()=>kp(e)):kp(e)}function zg(e,t){return aw(e,t,n=>{if(Sw(n))throw n;return n},gw,r);async function r(n,o,s){if(s)return Object.assign(s.value,{[o]:{type:"error",result:n}});{let{matches:a}=e,i=Math.min(Math.max(a.findIndex(c=>c.route.id===o),0),Math.max(a.findIndex(c=>c.shouldCallHandler()),0)),l=a[i].route.id;for(let c of a.slice(0,i+1))try{await c._lazyPromises?.route}catch{l=c.route.id;break}return{[kr(a,l).route.id]:{type:"error",result:n}}}}}async function aw(e,t,r,n,o){let{matches:s,...a}=e;return await Wg(a,s.flatMap(i=>i.route.middleware?i.route.middleware.map(l=>[i.route.id,l]):[]),t,r,n,o)}async function Wg(e,t,r,n,o,s,a=0){let{request:i}=e;if(i.signal.aborted)throw i.signal.reason??new Error(`Request aborted: ${i.method} ${i.url}`);let l=t[a];if(!l)return await r();let[c,p]=l,d,h=async()=>{if(d)throw new Error("You may only call `next()` once per middleware");try{return d={value:await Wg(e,t,r,n,o,s,a+1)},d.value}catch(m){return d={value:await s(m,c,d)},d.value}};try{let m=await p(e,h),g=m!=null?n(m):void 0;return o(g)?g:d?g??d.value:(d={value:await h()},d.value)}catch(m){return await s(m,c,d)}}function qg(e,t,r,n,o){let s=Bg({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),a=ow(n.route,ut(r.method)?"action":"loader",t,e,o);return{middleware:s,route:a.lazyRoutePromise,handler:a.lazyHandlerPromise}}function jl(e,t,r,n,o,s,a,i,l,c=null,p){let d=!1,h=qg(e,t,r,s,a);return{...s,_lazyPromises:h,shouldLoad:l,shouldRevalidateArgs:c,shouldCallHandler(m){return d=!0,c?typeof p=="boolean"?No(s,{...c,defaultShouldRevalidate:p}):typeof m=="boolean"?No(s,{...c,defaultShouldRevalidate:m}):No(s,c):l},resolve(m){let{lazy:g,loader:S,middleware:b}=s.route,_=d||l||m&&!ut(r.method)&&(g||S),v=b&&b.length>0&&!S&&!g;return _&&(ut(r.method)||!v)?lw({request:r,path:n,pattern:o,match:s,lazyHandlerPromise:h?.handler,lazyRoutePromise:h?.route,handlerOverride:m,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function Un(e,t,r,n,o,s,a,i,l=null){return o.map(c=>c.route.id!==s.route.id?{...c,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:qg(e,t,r,c,a),resolve:()=>Promise.resolve({type:"data",result:void 0})}:jl(e,t,r,n,io(o),c,a,i,!0,l))}async function iw(e,t,r,n,o,s,a){n.some(p=>p._lazyPromises?.middleware)&&await Promise.all(n.map(p=>p._lazyPromises?.middleware));let i={request:t,url:au(t,r),pattern:io(n),params:n[0].params,context:s,matches:n},c=await e({...i,fetcherKey:o,runClientMiddleware:a?()=>{throw new Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:p=>{let d=i;return zg(d,()=>p({...d,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(p=>[p._lazyPromises?.handler,p._lazyPromises?.route]))}catch{}return c}async function lw({request:e,path:t,pattern:r,match:n,lazyHandlerPromise:o,lazyRoutePromise:s,handlerOverride:a,scopedContext:i}){let l,c,p=ut(e.method),d=p?"action":"loader",h=m=>{let g,S=new Promise((v,w)=>g=w);c=()=>g(),e.signal.addEventListener("abort",c);let b=v=>typeof m!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${n.route.id}]`)):m({request:e,url:au(e,t),pattern:r,params:n.params,context:i},...v!==void 0?[v]:[]),_=(async()=>{try{return{type:"data",result:await(a?a(v=>b(v)):b())}}catch(v){return{type:"error",result:v}}})();return Promise.race([_,S])};try{let m=p?n.route.action:n.route.loader;if(o||s)if(m){let g,[S]=await Promise.all([h(m).catch(b=>{g=b}),o,s]);if(g!==void 0)throw g;l=S}else{await o;let g=p?n.route.action:n.route.loader;if(g)[l]=await Promise.all([h(g),s]);else if(d==="action"){let S=new URL(e.url),b=S.pathname+S.search;throw Pt(405,{method:e.method,pathname:b,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(m)l=await h(m);else{let g=new URL(e.url);throw Pt(404,{pathname:g.pathname+g.search})}}catch(m){return{type:"error",result:m}}finally{c&&e.signal.removeEventListener("abort",c)}return l}async function cw(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function uw(e){let{result:t,type:r}=e;if(cu(t)){let n;try{n=await cw(t)}catch(o){return{type:"error",error:o}}return r==="error"?{type:"error",error:new vs(t.status,t.statusText,n),statusCode:t.status,headers:t.headers}:{type:"data",data:n,statusCode:t.status,headers:t.headers}}return r==="error"?Np(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:mw(t),statusCode:Go(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Go(t)?t.status:void 0}:Np(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function dw(e,t,r,n,o){let s=e.headers.get("Location");if(pe(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!ou(s)){let a=n.slice(0,n.findIndex(i=>i.route.id===r)+1);s=Ol(new URL(t.url),a,o,s),e.headers.set("Location",s)}return e}var pw=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Ll(e){try{return pw.includes(new URL(e).protocol)}catch{return!1}}function Ip(e,t,r,n){if(ou(e)){let o=e,s=oi.test(o)?new URL(xg(o,t.protocol)):new URL(o);if(Ll(s.toString()))throw new Error("Invalid redirect location");let a=xt(s.pathname,r)!=null;if(s.origin===t.origin&&a)return su(s.pathname)+s.search+s.hash}try{if(Ll(n.createURL(e).toString()))throw new Error("Invalid redirect location")}catch{}return e}function In(e,t,r,n){let o=e.createURL(Vg(t)).toString(),s={signal:r};if(n&&ut(n.formMethod)){let{formMethod:a,formEncType:i}=n;s.method=a.toUpperCase(),i==="application/json"?(s.headers=new Headers({"Content-Type":i}),s.body=JSON.stringify(n.json)):i==="text/plain"?s.body=n.text:i==="application/x-www-form-urlencoded"&&n.formData?s.body=Dl(n.formData):s.body=n.formData}return new Request(o,s)}function Dl(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Cp(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function fw(e,t,r,n=!1,o=!1){let s={},a=null,i,l=!1,c={},p=r&&wt(r[1])?r[1].error:void 0;return e.forEach(d=>{if(!(d.route.id in t))return;let h=d.route.id,m=t[h];if(pe(!Kr(m),"Cannot handle redirect results in processLoaderData"),wt(m)){let g=m.error;if(p!==void 0&&(g=p,p=void 0),a=a||{},o)a[h]=g;else{let S=kr(e,h);a[S.route.id]==null&&(a[S.route.id]=g)}n||(s[h]=Hg),l||(l=!0,i=Go(m.error)?m.error.status:500),m.headers&&(c[h]=m.headers)}else s[h]=m.data,m.statusCode&&m.statusCode!==200&&!l&&(i=m.statusCode),m.headers&&(c[h]=m.headers)}),p!==void 0&&r&&(a={[r[0]]:p},r[2]&&(s[r[2]]=void 0)),{loaderData:s,errors:a,statusCode:i||200,loaderHeaders:c}}function Rp(e,t,r,n,o,s,a){let{loaderData:i,errors:l}=fw(t,r,n);return o.filter(c=>!c.matches||c.matches.some(p=>p.shouldLoad)).forEach(c=>{let{key:p,match:d,controller:h}=c;if(h&&h.signal.aborted)return;let m=s[p];if(pe(m,"Did not find corresponding fetcher result"),wt(m)){let g=kr(e.matches,d?.route.id);l&&l[g.route.id]||(l={...l,[g.route.id]:m.error}),a.delete(p)}else if(Kr(m))pe(!1,"Unhandled fetcher revalidation redirect");else{let g=Vt(m.data);a.set(p,g)}}),{loaderData:i,errors:l}}function Tp(e,t,r,n){let o=Object.entries(t).filter(([,a])=>a!==Hg).reduce((a,[i,l])=>(a[i]=l,a),{}),s=0;for(let a of r){let i=a.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&a.route.loader&&(o[i]=e[i],s++),n&&n.hasOwnProperty(i))break}return Object.keys(t).length===0&&s===Object.keys(e).length?e:o}function Ap(e){return e?wt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function kr(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.ErrorBoundary!=null||r.route.errorElement!=null)||e[0]}function Us(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Pt(e,{pathname:t,routeId:r,method:n,type:o,message:s}={}){let a="Unknown Server Error",i="Unknown @remix-run/router error";return e===400?(a="Bad Request",n&&t&&r?i=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:o==="invalid-body"&&(i="Unable to encode submission body")):e===403?(a="Forbidden",i=`Route "${r}" does not match URL "${t}"`):e===404?(a="Not Found",i=`No route matches URL "${t}"`):e===405&&(a="Method Not Allowed",n&&t&&r?i=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(i=`Invalid request method "${n.toUpperCase()}"`)),new vs(e||500,a,new Error(i),!0)}function $s(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,o]=t[r];if(Kr(o))return{key:n,result:o}}}function Vg(e){return gt({...typeof e=="string"?qt(e):e,hash:""})}function hw(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function mw(e){return new vs(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function gw(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&vw(r))}function vw(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function yw(e){return cu(e.result)&&Dg.has(e.result.status)}function wt(e){return e.type==="error"}function Kr(e){return(e&&e.type)==="redirect"}function Np(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function cu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function bw(e){return Dg.has(e)}function Sw(e){return cu(e)&&bw(e.status)&&e.headers.has("Location")}function _w(e){return JE.has(e.toUpperCase())}function ut(e){return GE.has(e.toUpperCase())}function uu(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function la(e,t){let r=typeof t=="string"?qt(t).search:t.search;if(e[e.length-1].route.index&&uu(r||""))return e[e.length-1];let n=Pg(e);return n[n.length-1]}function Pp(e,t,r){return{url:au(e.createURL(t),t),pattern:r?io(r):"",params:r?.[0]?.params?{...r[0].params}:{}}}function Mp(e){let{formMethod:t,formAction:r,formEncType:n,text:o,formData:s,json:a}=e;if(!(!t||!r||!n)){if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o};if(s!=null)return{formMethod:t,formAction:r,formEncType:n,formData:s,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:a,text:void 0}}}function Gi(e,t,r,n){return n?{state:"loading",location:e,matches:t,historyAction:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:e,matches:t,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function xw(e,t,r,n){return{state:"submitting",location:e,matches:t,historyAction:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}}function yo(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Ew(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Vt(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function ww(e,t){try{let r=e.sessionStorage.getItem(Fg);if(r){let n=JSON.parse(r);for(let[o,s]of Object.entries(n||{}))s&&Array.isArray(s)&&t.set(o,new Set(s||[]))}}catch{}}function kw(e,t){if(t.size>0){let r={};for(let[n,o]of t)r[n]=[...o];try{e.sessionStorage.setItem(Fg,JSON.stringify(r))}catch(n){et(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function Op(){let e,t,r=new Promise((n,o)=>{e=async s=>{n(s);try{await r}catch{}},t=async s=>{o(s);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Gg="REACT_ROUTER_ERROR",Iw="REDIRECT",Cw="ROUTE_ERROR_RESPONSE";function Rw(e){if(e.startsWith(`${Gg}:${Iw}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Tw(e){if(e.startsWith(`${Gg}:${Cw}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new vs(t.status,t.statusText,t.data)}catch{}}function Aw(e,{relative:t}={}){pe(lo(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=f.useContext(Ct),{hash:o,pathname:s,search:a}=ys(e,{relative:t}),i=s;return r!=="/"&&(i=s==="/"?r:Mt([r,s])),n.createHref({pathname:i,search:a,hash:o})}function lo(){return f.useContext(Xa)!=null}function vt(){return pe(lo(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(Xa).location}var Yg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ai(){return f.useContext(Dc)?Ww():Nw()}function Nw(){pe(lo(),"useNavigate() may be used only in the context of a <Router> component.");let e=f.useContext(us),{basename:t,navigator:r}=f.useContext(Ct),{matches:n}=f.useContext(Sr),{pathname:o}=vt(),s=JSON.stringify(si(n)),a=f.useRef(!1);return f.useLayoutEffect(()=>{a.current=!0}),f.useCallback((i,l={})=>{if(et(a.current,Yg),!a.current)return;if(typeof i=="number"){r.go(i);return}let c=gs(i,JSON.parse(s),o,l.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Mt([t,c.pathname])),Hn(typeof i=="string"?i:gt(i),r.createHref(c),iu(r),"reject"),(l.replace?r.replace:r.push)(c,l.state,l)},[t,r,s,o,e])}var Jg=f.createContext(null);function A$(){return f.useContext(Jg)}function Pw(e){let t=f.useContext(Sr).outlet;return f.useMemo(()=>t&&f.createElement(Jg.Provider,{value:e},t),[t,e])}function N$(){let{matches:e}=f.useContext(Sr);return e[e.length-1]?.params??{}}function ys(e,{relative:t}={}){let{matches:r}=f.useContext(Sr),{pathname:n}=vt(),o=JSON.stringify(si(r));return f.useMemo(()=>gs(e,JSON.parse(o),n,t==="path"),[e,o,n,t])}function Mw(e,t,r){pe(lo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=f.useContext(Ct),{matches:o}=f.useContext(Sr),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let i=s?s.pathnameBase:"/";s&&s.route;let l=vt(),c;if(t){let g=typeof t=="string"?qt(t):t;pe(i==="/"||g.pathname?.startsWith(i),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${i}" but pathname "${g.pathname}" was given in the \`location\` prop.`),c=g}else c=l;let p=c.pathname||"/",d=p;if(i!=="/"){let g=i.replace(/^\//,"").split("/");d="/"+p.replace(/^\//,"").split("/").slice(g.length).join("/")}let h;r?r.state.matches.length?h=r.state.matches.map(g=>Object.assign(g,{route:r.manifest[g.route.id]||g.route})):h=r.router.match(r.state.location):h=bE(e,{pathname:d});let m=Hw(h&&h.map(g=>Object.assign({},g,{params:Object.assign({},a,g.params),pathname:Mt([i,n.encodeLocation?n.encodeLocation(g.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?i:Mt([i,n.encodeLocation?n.encodeLocation(g.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),o,r);return t&&m?f.createElement(Xa.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...c},navigationType:"POP"}},m):m}function Ow(){let e=Bw(),t=Go(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null;return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"}},r):null,null)}var jw=f.createElement(Ow,null),Lw=class extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=F0;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=Tw(e.digest);r&&(e=r)}let t=e!==void 0?f.createElement(Sr.Provider,{value:this.props.routeContext},f.createElement(Dc.Provider,{value:this.props.routeContext.isDataRoute},f.createElement(Hc.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},f.createElement(lm.Provider,{value:e,children:this.props.component})))):this.props.children;return this.context?f.createElement(Dw,{error:e},t):t}},Yi=new WeakMap;function Dw({children:e,error:t}){let{basename:r,navigator:n}=f.useContext(Ct);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=Rw(t.digest);if(o){let s=Yi.get(t);if(s)throw s;let a=Og(o.location,r),i=a.absoluteURL||a.to;if(Hn(o.location,i,iu(n),"allow-explicit"),Ll(i))throw new Error("Invalid redirect location");if(Mg&&!Yi.get(t))if(a.isExternal||o.reloadDocument)window.location.href=i;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:o.replace}));throw Yi.set(t,l),l}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i}`})}}return e}function Fw({routeContext:e,match:t,children:r}){let n=f.useContext(us);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(Sr.Provider,{value:e},f.createElement(Dc.Provider,{value:e.isDataRoute},f.createElement(Hc.Provider,{value:t.route.id},r)))}function Hw(e,t=[],r){let n=r?.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,s=n?.errors;if(s!=null){let p=o.findIndex(d=>d.route.id&&s?.[d.route.id]!==void 0);pe(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,p+1))}let a=!1,i=-1;if(r&&n){a=n.renderFallback;for(let p=0;p<o.length;p++){let d=o[p];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(i=p),d.route.id){let{loaderData:h,errors:m}=n,g=d.route.loader&&!h.hasOwnProperty(d.route.id)&&(!m||m[d.route.id]===void 0);if(d.route.lazy||g){r.isStatic&&(a=!0),i>=0?o=o.slice(0,i+1):o=[o[0]];break}}}}let l=r?.onError,c=n&&l?(p,d)=>{l(p,{location:n.location,params:n.matches?.[0]?.params??{},pattern:io(n.matches),errorInfo:d})}:void 0;return o.reduceRight((p,d,h)=>{let m,g=!1,S=null,b=null;n&&(m=s&&d.route.id?s[d.route.id]:void 0,S=d.route.errorElement||jw,a&&(i<0&&h===0?(qw("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,b=null):i===h&&(g=!0,b=d.route.hydrateFallbackElement||null)));let _=t.concat(o.slice(0,h+1)),v=()=>{let w;return m?w=S:g?w=b:d.route.Component?w=f.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=p,f.createElement(Fw,{match:d,routeContext:{outlet:p,matches:_,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?f.createElement(Lw,{location:n.location,revalidation:n.revalidation,component:S,error:m,children:v(),routeContext:{outlet:null,matches:_,isDataRoute:!0},onError:c}):v()},null)}function ii(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function co(e){let t=f.useContext(us);return pe(t,ii(e)),t}function li(e){let t=f.useContext(hm);return pe(t,ii(e)),t}function du(e){let t=f.useContext(um);return pe(t,ii(e)),t}function Uw(e){let t=f.useContext(Fc);return pe(t,ii(e)),t}function pu(e){let t=f.useContext(Hc);return pe(t,`${e} can only be used on routes that contain a unique "id"`),t}function $w(){let{navigation:e}=Uw("useNavigation");return f.useMemo(()=>{let{matches:t,historyAction:r,...n}=e;return n},[e])}function Kg(){let{matches:e}=li("useMatches"),{loaderData:t}=du("useMatches");return f.useMemo(()=>e.map(r=>Ig(r,t)),[e,t])}function Bw(){let e=f.useContext(lm),t=du("useRouteError"),r=pu("useRouteError");return e!==void 0?e:t.errors?.[r]}var zw=0;function P$(e){let{router:t,basename:r}=co("useBlocker"),n=li("useBlocker"),[o,s]=f.useState(""),a=f.useCallback(i=>{if(typeof e!="function")return!!e;if(r==="/")return e(i);let{currentLocation:l,nextLocation:c,historyAction:p}=i;return e({currentLocation:{...l,pathname:xt(l.pathname,r)||l.pathname},nextLocation:{...c,pathname:xt(c.pathname,r)||c.pathname},historyAction:p})},[r,e]);return f.useEffect(()=>{let i=String(++zw);return s(i),()=>t.deleteBlocker(i)},[t]),f.useEffect(()=>{o!==""&&t.getBlocker(o,a)},[t,o,a]),o&&n.blockers.has(o)?n.blockers.get(o):kn}function Ww(){let{router:e}=co("useNavigate"),t=pu("useNavigate"),r=f.useRef(!1);return f.useLayoutEffect(()=>{r.current=!0}),f.useCallback(async(n,o={})=>{et(r.current,Yg),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var jp={};function qw(e,t,r){!t&&!jp[e]&&(jp[e]=!0,et(!1,r))}var Lp={};function Dp(e,t){!e&&!Lp[t]&&(Lp[t]=!0,console.warn(t))}var Vw=["HydrateFallback","hydrateFallbackElement"],Gw=class{status="pending";promise;resolve;reject;constructor(){this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function Yw({router:e,flushSync:t,onError:r,useTransitions:n}){n=cm()||n;let[o,s]=f.useState(e.state),[a,i]=(0,f.useOptimistic)(o),[l,c]=f.useState(),[p,d]=f.useState({isTransitioning:!1}),[h,m]=f.useState(),[g,S]=f.useState(),[b,_]=f.useState(),v=f.useRef(new Map),w=f.useCallback((N,{deletedFetchers:W,newErrors:O,flushSync:G,viewTransitionOpts:H})=>{O&&r&&Object.values(O).forEach(j=>r(j,{location:N.location,params:N.matches[0]?.params??{},pattern:io(N.matches)})),N.fetchers.forEach((j,U)=>{j.data!==void 0&&v.current.set(U,j.data)}),W.forEach(j=>v.current.delete(j)),Dp(G===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let X=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Dp(H==null||X,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!H||!X){t&&G?t(()=>s(N)):n===!1?s(N):f.startTransition(()=>{n===!0&&i(j=>Fp(j,N)),s(N)});return}if(t&&G){t(()=>{g&&(h?.resolve(),g.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:H.currentLocation,nextLocation:H.nextLocation})});let j=e.window.document.startViewTransition(()=>{t(()=>s(N))});j.finished.finally(()=>{t(()=>{m(void 0),S(void 0),c(void 0),d({isTransitioning:!1})})}),t(()=>S(j));return}g?(h?.resolve(),g.skipTransition(),_({state:N,currentLocation:H.currentLocation,nextLocation:H.nextLocation})):(c(N),d({isTransitioning:!0,flushSync:!1,currentLocation:H.currentLocation,nextLocation:H.nextLocation}))},[e.window,t,g,h,n,i,r]);f.useLayoutEffect(()=>e.subscribe(w),[e,w]),f.useEffect(()=>{p.isTransitioning&&!p.flushSync&&m(new Gw)},[p]),f.useEffect(()=>{if(h&&l&&e.window){let N=l,W=h.promise,O=e.window.document.startViewTransition(async()=>{n===!1?s(N):f.startTransition(()=>{n===!0&&i(G=>Fp(G,N)),s(N)}),await W});O.finished.finally(()=>{m(void 0),S(void 0),c(void 0),d({isTransitioning:!1})}),S(O)}},[l,h,e.window,n,i]),f.useEffect(()=>{h&&l&&a.location.key===l.location.key&&h.resolve()},[h,g,a.location,l]),f.useEffect(()=>{!p.isTransitioning&&b&&(c(b.state),d({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),_(void 0))},[p.isTransitioning,b]);let E=f.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:N=>e.navigate(N),push:(N,W,O)=>e.navigate(N,{state:W,preventScrollReset:O?.preventScrollReset}),replace:(N,W,O)=>e.navigate(N,{replace:!0,state:W,preventScrollReset:O?.preventScrollReset})}),[e]),T=e.basename||"/",I=f.useMemo(()=>({router:e,navigator:E,static:!1,basename:T,onError:r}),[e,E,T,r]),C=f.useMemo(()=>({historyAction:a.historyAction,location:a.location,matches:a.matches,initialized:a.initialized,renderFallback:a.renderFallback,restoreScrollPosition:a.restoreScrollPosition,preventScrollReset:a.preventScrollReset,blockers:a.blockers}),[a.historyAction,a.location,a.matches,a.initialized,a.renderFallback,a.restoreScrollPosition,a.preventScrollReset,a.blockers]),L=f.useMemo(()=>({navigation:a.navigation,revalidation:a.revalidation}),[a.navigation,a.revalidation]),y=f.useMemo(()=>({loaderData:a.loaderData,actionData:a.actionData,errors:a.errors}),[a.loaderData,a.actionData,a.errors]),A=f.useMemo(()=>({fetchers:a.fetchers,fetcherData:v.current}),[a.fetchers]);return f.createElement(f.Fragment,null,f.createElement(us.Provider,{value:I},f.createElement(hm.Provider,{value:C},f.createElement(Fc.Provider,{value:L},f.createElement(um.Provider,{value:y},f.createElement(O0.Provider,{value:A},f.createElement(mm.Provider,{value:p},f.createElement(Xg,{basename:T,location:a.location,navigationType:a.historyAction,navigator:E,useTransitions:n},f.createElement(Jw,{routes:e.routes,manifest:e.manifest,state:a,isStatic:!1,onError:r})))))))),null)}function Fp(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var Jw=f.memo(Kw);function Kw({routes:e,manifest:t,state:r,isStatic:n,onError:o}){let s=f.useContext(us);return pe(s,"You must render this element inside a <DataRouterContext.Provider> element"),Mw(e,void 0,{router:s.router,manifest:t,state:r,isStatic:n,onError:o})}function M$({to:e,replace:t,state:r,relative:n}){pe(lo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:s}=f.useContext(Ct);et(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=f.useContext(Sr),{pathname:i}=vt(),l=ai(),c=gs(e,si(a),i,n==="path");Hn(typeof e=="string"?e:gt(e),s.createHref(c),iu(s),"reject");let p=JSON.stringify(c);return f.useEffect(()=>{l(JSON.parse(p),{replace:t,state:r,relative:n})},[l,p,n,t,r]),null}function O$(e){return Pw(e.context)}function Xg({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:o,static:s=!1,useTransitions:a}){pe(!lo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),l=f.useMemo(()=>({basename:i,navigator:o,static:s,useTransitions:a,future:{}}),[i,o,s,a]);typeof r=="string"&&(r=qt(r));let{pathname:c="/",search:p="",hash:d="",state:h=null,key:m="default",mask:g}=r,S=f.useMemo(()=>{let b=xt(c,i);return b==null?null:{location:{pathname:b,search:p,hash:d,state:h,key:m,mask:g},navigationType:n}},[i,c,p,d,h,m,n,g]);return et(S!=null,`<Router basename="${i}"> is not able to match the URL "${c}${p}${d}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:f.createElement(Ct.Provider,{value:l},f.createElement(Xa.Provider,{children:t,value:S}))}var j$=class extends f.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:r}=this.props,n=null,o=0;if(!(r instanceof Promise))o=1,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});else if(this.state.error){o=2;let s=this.state.error;n=Promise.reject().catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>s})}else r._tracked?(n=r,o="_error"in n?2:"_data"in n?1:0):(o=0,Object.defineProperty(r,"_tracked",{get:()=>!0}),n=r.then(s=>Object.defineProperty(r,"_data",{get:()=>s}),s=>{this.props.onError?.(s),Object.defineProperty(r,"_error",{get:()=>s})}));if(o===2&&!t)throw n._error;if(o===2)return f.createElement(Bd.Provider,{value:n,children:t});if(o===1)return f.createElement(Bd.Provider,{value:n,children:e});throw n}},ca="application/x-www-form-urlencoded";function ci(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Xw(e){return ci(e)&&e.tagName.toLowerCase()==="button"}function Qw(e){return ci(e)&&e.tagName.toLowerCase()==="form"}function Zw(e){return ci(e)&&e.tagName.toLowerCase()==="input"}function ek(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tk(e,t){return e.button===0&&(!t||t==="_self")&&!ek(e)}function Fl(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function rk(e,t){let r=Fl(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(s=>{r.append(o,s)})}),r}var Bs=null;function nk(){if(Bs===null)try{new FormData(document.createElement("form"),0),Bs=!1}catch{Bs=!0}return Bs}var ok=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ji(e){return e!=null&&!ok.has(e)?(et(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ca}"`),null):e}function sk(e,t){let r,n,o,s,a;if(Qw(e)){let i=e.getAttribute("action");n=i?xt(i,t):null,r=e.getAttribute("method")||"get",o=Ji(e.getAttribute("enctype"))||ca,s=new FormData(e)}else if(Xw(e)||Zw(e)&&(e.type==="submit"||e.type==="image")){let i=e.form;if(i==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?xt(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||"get",o=Ji(e.getAttribute("formenctype"))||Ji(i.getAttribute("enctype"))||ca,s=new FormData(i,e),!nk()){let{name:c,type:p,value:d}=e;if(p==="image"){let h=c?`${c}.`:"";s.append(`${h}x`,"0"),s.append(`${h}y`,"0")}else c&&s.append(c,d)}}else{if(ci(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r="get",n=null,o=ca,a=e}return s&&o==="text/plain"&&(a=s,s=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:s,body:a}}function ak(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var ik={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},lk=/[&><\u2028\u2029]/g;function Hp(e){return e.replace(lk,t=>ik[t])}function Qg(e,t){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${t}`:r.pathname=`${r.pathname}.${t}`,r}async function ck(e,t){if(e.id in t)return t[e.id];try{let r=await ux(()=>import(e.module),[]);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function uk(e){return e!=null&&typeof e.page=="string"}function dk(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function pk(e,t,r){return gk((await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let s=await ck(o,r);return s.links?s.links():[]}return[]}))).flat(1).filter(dk).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function Up(e,t,r,n,o,s){let a=(l,c)=>r[c]?l.route.id!==r[c].route.id:!0,i=(l,c)=>r[c].pathname!==l.pathname||r[c].route.path?.endsWith("*")&&r[c].params["*"]!==l.params["*"];return s==="assets"?t.filter((l,c)=>a(l,c)||i(l,c)):s==="data"?t.filter((l,c)=>{let p=n.routes[l.route.id];if(!p||!p.hasLoader)return!1;if(a(l,c)||i(l,c))return!0;if(l.route.shouldRevalidate){let d=l.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function fk(e,t,{includeHydrateFallback:r}={}){return hk(e.map(n=>{let o=t.routes[n.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}function hk(e){return[...new Set(e)]}function mk(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function gk(e,t){let r=new Set,n=new Set(t);return e.reduce((o,s)=>{if(t&&!uk(s)&&s.as==="script"&&s.href&&n.has(s.href))return o;let a=JSON.stringify(mk(s));return r.has(a)||(r.add(a),o.push({key:a,link:s})),o},[])}var ui=f.createContext(void 0);ui.displayName="FrameworkContext";function fu(){let e=f.useContext(ui);return ak(e,"You must render this element inside a <HydratedRouter> element"),e}function vk(e,t){let r=f.useContext(ui),[n,o]=f.useState(!1),[s,a]=f.useState(!1),{onFocus:i,onBlur:l,onMouseEnter:c,onMouseLeave:p,onTouchStart:d}=t,h=f.useRef(null);f.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let S=_=>{_.forEach(v=>{a(v.isIntersecting)})},b=new IntersectionObserver(S,{threshold:.5});return h.current&&b.observe(h.current),()=>{b.disconnect()}}},[e]),f.useEffect(()=>{if(n){let S=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(S)}}},[n]);let m=()=>{o(!0)},g=()=>{o(!1),a(!1)};return r?e!=="intent"?[s,h,{}]:[s,h,{onFocus:bo(i,m),onBlur:bo(l,g),onMouseEnter:bo(c,m),onMouseLeave:bo(p,g),onTouchStart:bo(d,m)}]:[!1,h,{}]}function bo(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function yk({page:e,...t}){let r=cm(),{nonce:n}=fu(),{router:o}=co("PrefetchPageLinks"),s=f.useMemo(()=>o.match(e),[o,o.routes,e]);return s?(t.nonce==null&&n&&(t={...t,nonce:n}),r?f.createElement(Sk,{page:e,matches:s,...t}):f.createElement(_k,{page:e,matches:s,...t})):null}function bk(e){let{manifest:t,routeModules:r}=fu(),[n,o]=f.useState([]);return f.useEffect(()=>{let s=!1;return pk(e,t,r).then(a=>{s||o(a)}),()=>{s=!0}},[e,t,r]),n}function Sk({page:e,matches:t,...r}){let n=vt(),o=f.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let s=Qg(e,"rsc"),a=!1,i=[];for(let l of t)typeof l.route.shouldRevalidate=="function"?a=!0:i.push(l.route.id);return a&&i.length>0&&s.searchParams.set("_routes",i.join(",")),[s.pathname+s.search]},[e,n,t]);return f.createElement(f.Fragment,null,o.map(s=>f.createElement("link",{key:s,rel:"prefetch",as:"fetch",href:s,...r})))}function _k({page:e,matches:t,...r}){let n=vt(),{manifest:o,routeModules:s}=fu(),{matches:a}=li("PrefetchPageLinks"),{loaderData:i}=du("PrefetchPageLinks"),l=f.useMemo(()=>Up(e,t,a,o,n,"data"),[e,t,a,o,n]),c=f.useMemo(()=>Up(e,t,a,o,n,"assets"),[e,t,a,o,n]),p=f.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let m=new Set,g=!1;if(t.forEach(b=>{let _=o.routes[b.route.id];!_||!_.hasLoader||(!l.some(v=>v.route.id===b.route.id)&&b.route.id in i&&s[b.route.id]?.shouldRevalidate||_.hasClientLoader?g=!0:m.add(b.route.id))}),m.size===0)return[];let S=Qg(e,"data");return g&&m.size>0&&S.searchParams.set("_routes",t.filter(b=>m.has(b.route.id)).map(b=>b.route.id).join(",")),[S.pathname+S.search]},[i,n,o,l,t,e,s]),d=f.useMemo(()=>fk(c,o),[c,o]),h=bk(c);return f.createElement(f.Fragment,null,p.map(m=>f.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...r})),d.map(m=>f.createElement("link",{key:m,rel:"modulepreload",href:m,...r})),h.map(({key:m,link:g})=>f.createElement("link",{key:m,nonce:r.nonce,...g,crossOrigin:g.crossOrigin??r.crossOrigin})))}function xk(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Ek=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ek&&(window.__reactRouterVersion="8")}catch{}function L$(e,t){return ew({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:uE({window:t?.window}),hydrationData:t?.hydrationData||wk(),routes:e,mapRouteProperties:wg,hydrationRouteProperties:Vw,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function wk(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:kk(e.errors)}),e}function kk(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,o]of t)if(o&&o.__type==="RouteErrorResponse")r[n]=new vs(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(typeof o.__subType=="string"&&FE.includes(o.__subType)){let s=window[o.__subType];if(typeof s=="function")try{let a=new s(o.message);a.stack="",r[n]=a}catch{}}if(r[n]==null){let s=new Error(o.message);s.stack="",r[n]=s}}else r[n]=o;return r}function Ik({basename:e,children:t,history:r,useTransitions:n}){let[o,s]=f.useState({action:r.action,location:r.location}),a=f.useCallback(i=>{n===!1?s(i):f.startTransition(()=>s(i))},[n]);return f.useLayoutEffect(()=>r.listen(a),[r,a]),f.createElement(Xg,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:r,useTransitions:n})}Ik.displayName="unstable_HistoryRouter";var on=f.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:o,reloadDocument:s,replace:a,mask:i,state:l,target:c,to:p,preventScrollReset:d,viewTransition:h,defaultShouldRevalidate:m,...g},S){let{basename:b,navigator:_,useTransitions:v}=f.useContext(Ct),w=typeof p=="string"&&ni.test(p),E=Og(p,b);p=E.to;let T=Aw(p,{relative:o}),I=vt(),C=null;if(i){let H=gs(i,[],I.mask?I.mask.pathname:"/",!0);b!=="/"&&(H.pathname=H.pathname==="/"?b:Mt([b,H.pathname])),C=_.createHref(H)}let[L,y,A]=vk(n,g),N=Ak(p,{replace:a,mask:i,state:l,target:c,preventScrollReset:d,relative:o,viewTransition:h,defaultShouldRevalidate:m,useTransitions:v});function W(H){t&&t(H),H.defaultPrevented||N(H)}let O=!(E.isExternal||s),G=f.createElement("a",{...g,...A,href:(O?C:void 0)||E.absoluteURL||T,onClick:O?W:t,ref:xk(S,y),target:c,"data-discover":!w&&r==="render"?"true":void 0});return L&&!w?f.createElement(f.Fragment,null,G,f.createElement(yk,{page:T})):G});on.displayName="Link";var Ck=f.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:o=!1,style:s,to:a,viewTransition:i,children:l,...c},p){let d=ys(a,{relative:c.relative}),h=vt(),m=f.useContext(Fc),{navigator:g,basename:S}=f.useContext(Ct),b=m!=null&&Fk(d)&&i===!0,_=g.encodeLocation?g.encodeLocation(d).pathname:d.pathname,v=h.pathname,w=m?.navigation.location?m.navigation.location.pathname:null;r||(v=v.toLowerCase(),w=w?w.toLowerCase():null,_=_.toLowerCase()),w&&S&&(w=xt(w,S)||w);const E=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let T=v===_||!o&&v.startsWith(_)&&v.charAt(E)==="/",I=w!=null&&(w===_||!o&&w.startsWith(_)&&w.charAt(E)==="/"),C={isActive:T,isPending:I,isTransitioning:b},L=T?t:void 0,y;typeof n=="function"?y=n(C):y=[n,T?"active":null,I?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let A=typeof s=="function"?s(C):s;return f.createElement(on,{...c,"aria-current":L,className:y,ref:p,style:A,to:a,viewTransition:i},typeof l=="function"?l(C):l)});Ck.displayName="NavLink";var Rk=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:o,state:s,method:a="get",action:i,onSubmit:l,relative:c,preventScrollReset:p,viewTransition:d,defaultShouldRevalidate:h,...m},g)=>{let{useTransitions:S}=f.useContext(Ct),b=Mk(),_=Ok(i,{relative:c}),v=a.toLowerCase()==="get"?"get":"post",w=typeof i=="string"&&ni.test(i),E=T=>{if(l&&l(T),T.defaultPrevented)return;T.preventDefault();let I=T.nativeEvent.submitter,C=I?.getAttribute("formmethod")||a,L=()=>b(I||T.currentTarget,{fetcherKey:t,method:C,navigate:r,replace:o,state:s,relative:c,preventScrollReset:p,viewTransition:d,defaultShouldRevalidate:h});S&&r!==!1?f.startTransition(()=>L()):L()};return f.createElement("form",{ref:g,method:v,action:_,onSubmit:n?l:E,...m,"data-discover":!w&&e==="render"?"true":void 0})});Rk.displayName="Form";function Tk({getKey:e,storageKey:t,...r}){let n=f.useContext(ui),{basename:o}=f.useContext(Ct),s=vt(),a=Kg();jk({getKey:e,storageKey:t});let i=f.useMemo(()=>{if(!n||!e)return null;let c=Ul(s,a,o,e);return c!==s.key?c:null},[]);if(!n||n.isSpaMode)return null;let l=((c,p)=>{if(!window.history.state||!window.history.state.key){let d=Math.random().toString(32).slice(2);window.history.replaceState({key:d},"")}try{let d=JSON.parse(sessionStorage.getItem(c)||"{}")[p||window.history.state.key];typeof d=="number"&&window.scrollTo(0,d)}catch(d){console.error(d),sessionStorage.removeItem(c)}}).toString();return r.nonce==null&&n?.nonce&&(r.nonce=n.nonce),f.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${Hp(JSON.stringify(t||Hl))}, ${Hp(JSON.stringify(i))})`}})}Tk.displayName="ScrollRestoration";function Ak(e,{target:t,replace:r,mask:n,state:o,preventScrollReset:s,relative:a,viewTransition:i,defaultShouldRevalidate:l,useTransitions:c}={}){let p=ai(),d=vt(),h=ys(e,{relative:a});return f.useCallback(m=>{if(tk(m,t)){m.preventDefault();let g=r!==void 0?r:gt(d)===gt(h),S=()=>p(e,{replace:g,mask:n,state:o,preventScrollReset:s,relative:a,viewTransition:i,defaultShouldRevalidate:l});c?f.startTransition(()=>S()):S()}},[d,p,h,r,n,o,t,e,s,a,i,l,c])}function hu(e){et(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=f.useRef(Fl(e)),r=f.useRef(!1),n=vt(),o=f.useMemo(()=>rk(n.search,r.current?null:t.current),[n.search]),s=ai();return[o,f.useCallback((a,i)=>{const l=Fl(typeof a=="function"?a(new URLSearchParams(o)):a);r.current=!0,s("?"+l,i)},[s,o])]}var Nk=0,Pk=()=>`__${String(++Nk)}__`;function Mk(){let{router:e}=co("useSubmit"),{basename:t}=f.useContext(Ct),r=pu("useSubmit"),n=e.fetch,o=e.navigate;return f.useCallback(async(s,a={})=>{let{action:i,method:l,encType:c,formData:p,body:d}=sk(s,t);a.navigate===!1?await n(a.fetcherKey||Pk(),r,a.action||i,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:p,body:d,formMethod:a.method||l,formEncType:a.encType||c,flushSync:a.flushSync}):await o(a.action||i,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:p,body:d,formMethod:a.method||l,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[n,o,t,r])}function Ok(e,{relative:t}={}){let{basename:r}=f.useContext(Ct),n=f.useContext(Sr);pe(n,"useFormAction must be used inside a RouteContext");let[o]=n.matches.slice(-1),s={...ys(e||".",{relative:t})},a=vt();if(e==null){s.search=a.search;let i=new URLSearchParams(s.search),l=i.getAll("index");if(l.some(c=>c==="")){i.delete("index"),l.filter(p=>p).forEach(p=>i.append("index",p));let c=i.toString();s.search=c?`?${c}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:Mt([r,s.pathname])),gt(s)}var Hl="react-router-scroll-positions",zs={};function Ul(e,t,r,n){let o=null;return n&&(r!=="/"?o=n({...e,pathname:xt(e.pathname,r)||e.pathname},t):o=n(e,t)),o==null&&(o=e.key),o}function jk({getKey:e,storageKey:t}={}){let{router:r}=co("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:o}=li("useScrollRestoration"),{basename:s}=f.useContext(Ct),a=vt(),i=Kg(),l=$w();f.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Dk(f.useCallback(c=>{c.persisted&&(window.history.scrollRestoration="manual")},[])),Lk(f.useCallback(()=>{if(l.state==="idle"){let c=Ul(a,i,s,e);zs[c]=window.scrollY}try{sessionStorage.setItem(t||Hl,JSON.stringify(zs))}catch(c){et(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${c}).`)}window.history.scrollRestoration="auto"},[l.state,e,s,a,i,t])),typeof document<"u"&&(f.useLayoutEffect(()=>{try{let c=sessionStorage.getItem(t||Hl);c&&(zs=JSON.parse(c))}catch{}},[t]),f.useLayoutEffect(()=>{let c=r?.enableScrollRestoration(zs,()=>window.scrollY,e?(p,d)=>Ul(p,d,s,e):void 0);return()=>c&&c()},[r,s,e]),f.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(a.hash){let c=document.getElementById(decodeURIComponent(a.hash.slice(1)));if(c){c.scrollIntoView();return}}}catch{et(!1,`"${a.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}o!==!0&&window.scrollTo(0,0)}},[a,n,o]))}function D$(e,t){let{capture:r}=t||{};f.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("beforeunload",e,n),()=>{window.removeEventListener("beforeunload",e,n)}},[e,r])}function Lk(e,t){let{capture:r}=t||{};f.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function Dk(e,t){let{capture:r}=t||{};f.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pageshow",e,n),()=>{window.removeEventListener("pageshow",e,n)}},[e,r])}function Fk(e,{relative:t}={}){let r=f.useContext(mm);pe(r!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=co("useViewTransitionState"),o=ys(e,{relative:t});if(!r.isTransitioning)return!1;let s=xt(r.currentLocation.pathname,n)||r.currentLocation.pathname,a=xt(r.nextLocation.pathname,n)||r.nextLocation.pathname;return ka(o.pathname,a)!=null||ka(o.pathname,s)!=null}var wo={},$p={};function Ur(e,t){return wo[e]=wo[e]||[],wo[e].push(t),()=>{const r=wo[e];if(r){const n=r.indexOf(t);n!==-1&&r.splice(n,1)}}}function $r(e,t){if(!$p[e]){$p[e]=!0;try{t()}catch(r){te&&z.error(`Error while instrumenting ${e}`,r)}}}function Ot(e,t){const r=e&&wo[e];if(r)for(const n of r)try{n(t)}catch(o){te&&z.error(`Error while triggering instrumentation handler.
3
3
  Type: ${e}
4
4
  Name: ${Pr(n)}
@@ -21,12 +21,12 @@ Error:`,o)}}function zR(){return TR(e=>{Es("cls",{metric:e}),Hv=e},{reportAllCha
21
21
  `).reduce((r,n)=>{const[o,s]=n.split(": ");return s&&(r[o.toLowerCase()]=s),r},{}):{}}function YT(e){if(typeof Element>"u")return!1;try{return e instanceof Element}catch{return!1}}var JT=40;function Zv(e,t=Gv("fetch")){let r=0,n=0;async function o(s){const a=s.body.length;r+=a,n++;const i={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:r<=6e4&&n<15,...e.fetchOptions};try{const l=await t(e.url,i);return{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}}catch(l){throw WT("fetch"),l}finally{r-=a,n--}}return VI(e,o,bu(e.bufferSize||JT))}var It=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,KT=30,XT=50;function Ql(e,t,r,n){const o={filename:e,function:t==="<anonymous>"?"?":t,in_app:!0};return r!==void 0&&(o.lineno=r),n!==void 0&&(o.colno=n),o}var QT=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ZT=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,eA=/\((\S*)(?::(\d+))(?::(\d+))\)/,tA=/at (.+?) ?\(data:(.+?),/,rA=e=>{const t=e.match(tA);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const r=QT.exec(e);if(r){const[,o,s,a]=r;return Ql(o,"?",+s,+a)}const n=ZT.exec(e);if(n){if(n[2]?.indexOf("eval")===0){const a=eA.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}const[o,s]=ey(n[1]||"?",n[2]);return Ql(s,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},nA=[KT,rA],oA=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,sA=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,aA=e=>{const t=oA.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const o=sA.exec(t[3]);o&&(t[1]=t[1]||"eval",t[3]=o[1],t[4]=o[2],t[5]="")}let r=t[3],n=t[1]||"?";return[n,r]=ey(n,r),Ql(r,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},iA=[XT,aA],lA=[nA,iA],cA=P_(...lA),ey=(e,t)=>{const r=e.indexOf("safari-extension")!==-1,n=e.indexOf("safari-web-extension")!==-1;return r||n?[e.indexOf("@")!==-1?e.split("@")[0]:"?",r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Js=1024,uA="Breadcrumbs",dA=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:uA,setup(r){t.console&&jC(mA(r)),t.dom&&Vv(hA(r,t.dom)),t.xhr&&Yv(gA(r)),t.fetch&&Su(vA(r)),t.history&&_i(yA(r)),t.sentry&&r.on("beforeSendEvent",fA(r))}}}),pA=dA;function fA(e){return function(r){me()===e&&jr({category:`sentry.${r.type==="transaction"?"transaction":"event"}`,event_id:r.event_id,level:r.level,message:Jr(r)},{event:r})}}function hA(e,t){return function(n){if(me()!==e)return;let o,s,a=typeof t=="object"?t.serializeAttribute:void 0,i=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;i&&i>Js&&(It&&z.warn(`\`dom.maxStringLength\` cannot exceed ${Js}, but a value of ${i} was configured. Sentry will use ${Js} instead.`),i=Js),typeof a=="string"&&(a=[a]);try{const c=n.event,p=bA(c)?c.target:c;o=tt(p,{keyAttrs:a,maxStringLength:i}),s=Pv(p)}catch{o="<unknown>"}if(o.length===0)return;const l={category:`ui.${n.name}`,message:o};s&&(l.data={"ui.component_name":s}),jr(l,{event:n.event,name:n.name,global:n.global})}}function mA(e){return function(r){if(me()!==e)return;const n={category:"console",data:{arguments:r.args,logger:"console"},level:Iv(r.level),message:sp(r.args," ")};if(r.level==="assert")if(r.args[0]===!1)n.message=`Assertion failed: ${sp(r.args.slice(1)," ")||"console.assert"}`,n.data.arguments=r.args.slice(1);else return;jr(n,{input:r.args,level:r.level})}}function gA(e){return function(r){if(me()!==e)return;const{startTimestamp:n,endTimestamp:o}=r,s=r.xhr[Xr];if(!n||!o||!s)return;const{method:a,url:i,status_code:l,body:c}=s,p={method:a,url:i,status_code:l},d={xhr:r.xhr,input:c,startTimestamp:n,endTimestamp:o},h={category:"xhr",data:p,type:"http",level:Tv(l)};e.emit("beforeOutgoingRequestBreadcrumb",h,d),jr(h,d)}}function vA(e){return function(r){if(me()!==e)return;const{startTimestamp:n,endTimestamp:o}=r;if(o&&!(r.fetchData.url.match(/sentry_key/)&&r.fetchData.method==="POST"))if(r.error){const s={data:r.error,input:r.args,startTimestamp:n,endTimestamp:o},a={category:"fetch",data:r.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",a,s),jr(a,s)}else{const s=r.response,a={...r.fetchData,status_code:s?.status},i={input:r.args,response:s,startTimestamp:n,endTimestamp:o},l={category:"fetch",data:a,type:"http",level:Tv(a.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,i),jr(l,i)}}}function yA(e){return function(r){if(me()!==e)return;let n=r.from,o=r.to;const s=rn(ve.location.href);let a=n?rn(n):void 0;const i=rn(o);a?.path||(a=s),s.protocol===i.protocol&&s.host===i.host&&(o=i.relative),s.protocol===a.protocol&&s.host===a.host&&(n=a.relative),jr({category:"navigation",data:{from:n,to:o}})}}function bA(e){return!!e&&!!e.target}var SA="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),_A="BrowserApiErrors",xA=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:_A,setupOnce(){t.setTimeout&&_t(ve,"setTimeout",Ef),t.setInterval&&_t(ve,"setInterval",Ef),t.requestAnimationFrame&&_t(ve,"requestAnimationFrame",wA),t.XMLHttpRequest&&"XMLHttpRequest"in ve&&_t(XMLHttpRequest.prototype,"send",kA);const r=t.eventTarget;r&&(Array.isArray(r)?r:SA).forEach(n=>IA(n,t))}}}),EA=xA;function Ef(e){return function(...t){const r=t[0];return t[0]=Gn(r,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Pr(e)}`}}),e.apply(this,t)}}function wA(e){return function(t){return e.apply(this,[Gn(t,{mechanism:{data:{handler:Pr(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function kA(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&_t(r,n,function(o){const s={mechanism:{data:{handler:Pr(o)},handled:!1,type:`auto.browser.browserapierrors.xhr.${n}`}},a=Wc(o);return a&&(s.mechanism.data.handler=Pr(a)),Gn(o,s)})}),e.apply(this,t)}}function IA(e,t){const r=ve[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(_t(r,"addEventListener",function(n){return function(o,s,a){try{CA(s)&&(s.handleEvent=Gn(s.handleEvent,{mechanism:{data:{handler:Pr(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&RA(this,o,s),n.apply(this,[o,Gn(s,{mechanism:{data:{handler:Pr(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),_t(r,"removeEventListener",function(n){return function(o,s,a){try{if(Object.prototype.hasOwnProperty.call(s,"__sentry_wrapped__")){const i=s.__sentry_wrapped__;i&&n.call(this,o,i,a)}}catch{}return n.call(this,o,s,a)}}))}function CA(e){return typeof e.handleEvent=="function"}function RA(e,t,r){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,r)}var TA=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof ve.document>"u"){It&&z.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}tp({ignoreDuration:!0});let r=!1;ku(()=>{r||($i(),r=!0)});const n=Hr();let o=n.getUser();n.addScopeListener(s=>{const a=s.getUser();(o?.id!==a?.id||o?.ip_address!==a?.ip_address)&&(o=a,r&&$i())}),t==="route"&&_i(({from:s,to:a})=>{s!==a&&(tp({ignoreDuration:!0}),$i(),r=!0)})}}},AA="CultureContext",NA=(()=>({name:AA,preprocessEvent(e){const t=wf();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=wf();t&&Ca(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})),PA=NA;function wf(){try{const e=ve.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var MA="GlobalHandlers",OA=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:MA,setupOnce(){Error.stackTraceLimit=50},setup(r){t.onerror&&(LA(r),kf("onerror")),t.onunhandledrejection&&(DA(r),kf("onunhandledrejection"))}}}),jA=OA;function LA(e){Zg(t=>{const{stackParser:r,attachStacktrace:n}=ty();if(me()!==e||Mv())return;const{msg:o,url:s,line:a,column:i,error:l}=t,c=UA(xu(r,l||o,void 0,n,!1),s,a,i);c.level="error",Mm(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function DA(e){ev(t=>{const{stackParser:r,attachStacktrace:n}=ty();if(me()!==e||Mv())return;const o=FA(t),s=Wn(o)?HA(o):xu(r,o,void 0,n,!0);s.level="error",Mm(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function FA(e){if(Wn(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function HA(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function UA(e,t,r,n){const o=e.exception=e.exception||{},s=o.values=o.values||[],a=s[0]=s[0]||{},i=a.stacktrace=a.stacktrace||{},l=i.frames=i.frames||[];return l.length===0&&l.push({colno:n,lineno:r,filename:$A(t)??sn(),function:"?",in_app:!0}),e}function kf(e){It&&z.log(`Global Handler attached: ${e}`)}function ty(){return me()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function $A(e){if(!(!Dn(e)||e.length===0))return e.startsWith("data:")?`<${Bt(e,!1)}>`:e}var BA=()=>({name:"HttpContext",preprocessEvent(e){if(!ve.navigator&&!ve.location&&!ve.document)return;const t=Ta(),r={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:r}},processSpan(e){if(!ve.navigator&&!ve.location&&!ve.document)return;const t=Ta();Ca(e,{[SI]:t.headers["User-Agent"],...e.is_segment&&{"url.full":e.attributes?.["sentry.op"]!=="http.client"?t.url:void 0,"http.request.header.referer":t.headers.Referer}})}}),zA="cause",WA=5,qA="LinkedErrors",VA=((e={})=>{const t=e.limit||WA,r=e.key||zA;return{name:qA,preprocessEvent(n,o,s){const a=s.getOptions();MC(_u,a.stackParser,r,t,n,o)}}}),GA=VA,YA=/^HTML(\w*)Element$/;function ry(e){if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(YT(e)){const t=JA(e);if(YA.test(t))return`[HTMLElement: ${tt(e)}]`}}function JA(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function KA(){return XA()?(It&&hs(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function XA(){if(typeof ve.window>"u")return!1;const e=ve;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const t=sn();return!(ve===ve.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}function QA(e){return[kC(),_C(),qC(),EA(),pA(),jA(),GA(),HC(),BA(),PA(),TA()]}function ZA(e={}){const t=!e.skipBrowserExtensionCheck&&KA();let r=e.defaultIntegrations==null?QA():e.defaultIntegrations;const n={...e,enabled:t?!1:e.enabled,stackParser:L_(e.stackParser||cA),integrations:II({integrations:e.integrations,defaultIntegrations:r}),transport:e.transport||Zv};return Fm(ry),iC(bR,n)}var Fe=He,Tu="sentryReplaySession",eN="replay_event",Au="Unable to send Replay",tN=3e5,rN=9e5,nN=5e3,oN=5500,sN=6e4,aN=5e3,iN=3,If=15e4,Ks=5e3,lN=3e3,cN=300,Nu=2e7,uN=4999,dN=5e4,Cf=36e5,pN=Object.defineProperty,fN=(e,t,r)=>t in e?pN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Rf=(e,t,r)=>fN(e,typeof t!="symbol"?t+"":t,r),Ye=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Ye||{});function hN(e){return e.nodeType===e.ELEMENT_NODE}function Oo(e){return e?.host?.shadowRoot===e}function jo(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function mN(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function gN(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function Ma(e){try{const t=e.rules||e.cssRules;return t?mN(Array.from(t,ny).join("")):null}catch{return null}}function vN(e){let t="";for(let r=0;r<e.style.length;r++){const n=e.style,o=n[r],s=n.getPropertyPriority(o);t+=`${o}:${n.getPropertyValue(o)}${s?" !important":""};`}return`${e.selectorText} { ${t} }`}function ny(e){let t;if(bN(e))try{t=Ma(e.styleSheet)||gN(e)}catch{}else if(SN(e)){let r=e.cssText;const n=e.selectorText.includes(":"),o=typeof e.style.all=="string"&&e.style.all;if(o&&(r=vN(e)),n&&(r=yN(r)),n||o)return r}return t||e.cssText}function yN(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function bN(e){return"styleSheet"in e}function SN(e){return"selectorText"in e}var oy=class{constructor(){Rf(this,"idNodeMap",new Map),Rf(this,"nodeMetaMap",new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function _N(){return new oy}function xi({maskInputOptions:e,tagName:t,type:r}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||r&&e[r]||r==="password"||t==="INPUT"&&!r&&e.text)}function Qo({isMasked:e,element:t,value:r,maskInputFn:n}){let o=r||"";return e?(n&&(o=n(o,t)),"*".repeat(o.length)):o}function Yn(e){return e.toLowerCase()}function Zl(e){return e.toUpperCase()}var Tf="__rrweb_original__";function xN(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let n=0;n<e.width;n+=r)for(let o=0;o<e.height;o+=r){const s=t.getImageData,a=Tf in s?s[Tf]:s;if(new Uint32Array(a.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer).some(i=>i!==0))return!1}return!0}function Pu(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Yn(t):null}function Oa(e,t,r){return t==="INPUT"&&(r==="radio"||r==="checkbox")?e.getAttribute("value")||"":e.value}function sy(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}return r.pathname.match(/\.([0-9a-z]+)(?:$)/i)?.[1]??null}var Af={};function ay(e){const t=Af[e];if(t)return t;const r=window.document;let n=window[e];if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(n=s[e]),r.head.removeChild(o)}catch{}return Af[e]=n.bind(window)}function ec(...e){return ay("setTimeout")(...e)}function iy(...e){return ay("clearTimeout")(...e)}function ly(e){try{return e.contentDocument}catch{}}function EN(e){try{return e.contentWindow}catch{}}var wN=1,kN=new RegExp("[^a-z0-9-_:]"),Zo=-2;function Mu(){return wN++}function IN(e){if(e instanceof HTMLFormElement)return"form";const t=Yn(e.tagName);return kN.test(t)?"div":t}function CN(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var En,Nf,RN=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,TN=/^(?:[a-z+]+:)?\/\//i,AN=/^www\..*/i,NN=/^(data:)([^,]*),(.*)/i;function PN(e,t){if(!e||t.size===0)return e;try{const r=e.split(";"),n=[];for(let o of r){if(o=o.trim(),!o)continue;const s=o.indexOf(":");if(s===-1){n.push(o);continue}const a=o.slice(0,s).trim();t.has(a)||n.push(o)}return n.join("; ")+(n.length>0&&e.endsWith(";")?";":"")}catch(r){return console.warn("Error filtering CSS properties:",r),e}}function ja(e,t){return(e||"").replace(RN,(r,n,o,s,a,i)=>{const l=o||a||i,c=n||s||"";if(!l)return r;if(TN.test(l)||AN.test(l))return`url(${c}${l}${c})`;if(NN.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${CN(t)+l}${c})`;const p=t.split("/"),d=l.split("/");p.pop();for(const h of d)h!=="."&&(h===".."?p.pop():p.push(h));return`url(${c}${p.join("/")}${c})`})}var MN=/^[^ \t\n\r\u000c]+/,ON=/^[, \t\n\r\u000c]+/;function jN(e,t){if(t.trim()==="")return t;let r=0;function n(s){let a;const i=s.exec(t.substring(r));return i?(a=i[0],r+=a.length,a):""}const o=[];for(;n(ON),!(r>=t.length);){let s=n(MN);if(s.slice(-1)===",")s=Pn(e,s.substring(0,s.length-1)),o.push(s);else{let a="";s=Pn(e,s);let i=!1;for(;;){const l=t.charAt(r);if(l===""){o.push((s+a).trim());break}else if(i)l===")"&&(i=!1);else if(l===","){r+=1,o.push((s+a).trim());break}else l==="("&&(i=!0);a+=l,r+=1}}}return o.join(", ")}var Pf=new WeakMap;function Pn(e,t){return!t||t.trim()===""?t:Ei(e,t)}function LN(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Ei(e,t){let r=Pf.get(e);if(r||(r=e.createElement("a"),Pf.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function cy(e,t,r,n,o,s,a){if(!n)return n;if(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#"))return Pn(e,n);if(r==="xlink:href"&&n[0]!=="#")return Pn(e,n);if(r==="background"&&(t==="table"||t==="td"||t==="th"))return Pn(e,n);if(r==="srcset")return jN(e,n);if(r==="style"){let i=ja(n,Ei(e));return a&&a.size>0&&(i=PN(i,a)),i}else if(t==="object"&&r==="data")return Pn(e,n);return typeof s=="function"?s(r,n,o):n}function uy(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function DN(e,t,r,n){try{if(n&&e.matches(n))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let o=e.classList.length;o--;){const s=e.classList[o];if(t.test(s))return!0}if(r)return e.matches(r)}catch{}return!1}function FN(e,t){for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!1}function Qr(e,t,r=1/0,n=0){return!e||e.nodeType!==e.ELEMENT_NODE||n>r?-1:t(e)?n:Qr(e.parentNode,t,r,n+1)}function Mn(e,t){return r=>{const n=r;if(n===null)return!1;try{if(e){if(typeof e=="string"){if(n.matches(`.${e}`))return!0}else if(FN(n,e))return!0}return!!(t&&n.matches(t))}catch{return!1}}}function Jn(e,t,r,n,o,s){try{const a=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(a===null)return!1;if(a.tagName==="INPUT"){const c=a.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(c))return!0}let i=-1,l=-1;if(s){if(l=Qr(a,Mn(n,o)),l<0)return!0;i=Qr(a,Mn(t,r),l>=0?l:1/0)}else{if(i=Qr(a,Mn(t,r)),i<0)return!1;l=Qr(a,Mn(n,o),i>=0?i:1/0)}return i>=0?l>=0?i<=l:!0:l>=0?!1:!!s}catch{}return!!s}function HN(e,t,r){const n=EN(e);if(!n)return;let o=!1,s;try{s=n.document.readyState}catch{return}if(s!=="complete"){const i=ec(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{iy(i),o=!0,t()});return}const a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return ec(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function UN(e,t,r){let n=!1,o;try{o=e.sheet}catch{o=null}if(o)return;const s=ec(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{iy(s),n=!0,t()})}function $N(e,t){const{doc:r,mirror:n,blockClass:o,blockSelector:s,unblockSelector:a,maskAllText:i,maskAttributeFn:l,maskTextClass:c,unmaskTextClass:p,maskTextSelector:d,unmaskTextSelector:h,inlineStylesheet:m,maskInputOptions:g={},maskTextFn:S,maskInputFn:b,dataURLOptions:_={},inlineImages:v,recordCanvas:w,keepIframeSrcFn:E,newlyAddedElement:T=!1,ignoreCSSAttributes:I}=t,C=BN(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Ye.Document,childNodes:[],compatMode:e.compatMode}:{type:Ye.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ye.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return WN(e,{doc:r,blockClass:o,blockSelector:s,unblockSelector:a,inlineStylesheet:m,maskAttributeFn:l,maskInputOptions:g,maskInputFn:b,dataURLOptions:_,inlineImages:v,recordCanvas:w,keepIframeSrcFn:E,newlyAddedElement:T,rootId:C,maskTextClass:c,unmaskTextClass:p,maskTextSelector:d,unmaskTextSelector:h,ignoreCSSAttributes:I});case e.TEXT_NODE:return zN(e,{doc:r,maskAllText:i,maskTextClass:c,unmaskTextClass:p,maskTextSelector:d,unmaskTextSelector:h,maskTextFn:S,maskInputOptions:g,maskInputFn:b,rootId:C});case e.CDATA_SECTION_NODE:return{type:Ye.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:Ye.Comment,textContent:e.textContent||"",rootId:C};default:return!1}}function BN(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function zN(e,t){const{maskAllText:r,maskTextClass:n,unmaskTextClass:o,maskTextSelector:s,unmaskTextSelector:a,maskTextFn:i,maskInputOptions:l,maskInputFn:c,rootId:p}=t,d=e.parentNode&&e.parentNode.tagName;let h=e.textContent;const m=d==="STYLE"?!0:void 0,g=d==="SCRIPT"?!0:void 0,S=d==="TEXTAREA"?!0:void 0;if(m&&h){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(h=Ma(e.parentNode.sheet))}catch(_){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${_}`,e)}h=ja(h,Ei(t.doc))}g&&(h="SCRIPT_PLACEHOLDER");const b=Jn(e,n,s,o,a,r);return!m&&!g&&!S&&h&&b&&(h=i?i(h,e.parentElement):h.replace(/[\S]/g,"*")),S&&h&&(l.textarea||b)&&(h=c?c(h,e.parentNode):h.replace(/[\S]/g,"*")),d==="OPTION"&&h&&(h=Qo({isMasked:Jn(e,n,s,o,a,xi({type:null,tagName:d,maskInputOptions:l})),element:e,value:h,maskInputFn:c})),{type:Ye.Text,textContent:h||"",isStyle:m,rootId:p}}function WN(e,t){const{doc:r,blockClass:n,blockSelector:o,unblockSelector:s,inlineStylesheet:a,maskInputOptions:i={},maskAttributeFn:l,maskInputFn:c,dataURLOptions:p={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:g=!1,rootId:S,maskTextClass:b,unmaskTextClass:_,maskTextSelector:v,unmaskTextSelector:w,ignoreCSSAttributes:E}=t,T=DN(e,n,o,s),I=IN(e);let C={};const L=e.attributes.length;for(let A=0;A<L;A++){const N=e.attributes[A];N.name&&!uy(I,N.name,N.value)&&(C[N.name]=cy(r,I,Yn(N.name),N.value,e,l,E))}if(I==="link"&&a){const A=Array.from(r.styleSheets).find(W=>W.href===e.href);let N=null;A&&(N=Ma(A)),N&&(C.rel=null,C.href=null,C.crossorigin=null,C._cssText=ja(N,A.href))}if(I==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const A=Ma(e.sheet);A&&(C._cssText=ja(A,Ei(r)))}if(I==="input"||I==="textarea"||I==="select"||I==="option"){const A=e,N=Pu(A),W=Oa(A,Zl(I),N),O=A.checked;if(N!=="submit"&&N!=="button"&&W){const G=Jn(A,b,v,_,w,xi({type:N,tagName:Zl(I),maskInputOptions:i}));C.value=Qo({isMasked:G,element:A,value:W,maskInputFn:c})}O&&(C.checked=O)}if(I==="option"&&(e.selected&&!i.select?C.selected=!0:delete C.selected),I==="canvas"&&h){if(e.__context==="2d")xN(e)||(C.rr_dataURL=e.toDataURL(p.type,p.quality));else if(!("__context"in e)){const A=e.toDataURL(p.type,p.quality),N=r.createElement("canvas");N.width=e.width,N.height=e.height,A!==N.toDataURL(p.type,p.quality)&&(C.rr_dataURL=A)}}if(I==="img"&&d){En||(En=r.createElement("canvas"),Nf=En.getContext("2d"));const A=e,N=A.currentSrc||A.getAttribute("src")||"<unknown-src>",W=A.crossOrigin,O=()=>{A.removeEventListener("load",O);try{En.width=A.naturalWidth,En.height=A.naturalHeight,Nf.drawImage(A,0,0),C.rr_dataURL=En.toDataURL(p.type,p.quality)}catch(G){if(A.crossOrigin!=="anonymous"){A.crossOrigin="anonymous",A.complete&&A.naturalWidth!==0?O():A.addEventListener("load",O);return}else console.warn(`Cannot inline img src=${N}! Error: ${G}`)}A.crossOrigin==="anonymous"&&(W?C.crossOrigin=W:A.removeAttribute("crossorigin"))};A.complete&&A.naturalWidth!==0?O():A.addEventListener("load",O)}if((I==="audio"||I==="video")&&(C.rr_mediaState=e.paused?"paused":"played",C.rr_mediaCurrentTime=e.currentTime),g||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop)),T){const{width:A,height:N}=e.getBoundingClientRect();C={class:C.class,rr_width:`${A}px`,rr_height:`${N}px`}}I==="iframe"&&!m(C.src)&&(!T&&!ly(e)&&(C.rr_src=C.src),delete C.src);let y;try{customElements.get(I)&&(y=!0)}catch{}return{type:Ye.Element,tagName:I,attributes:C,childNodes:[],isSVG:LN(e)||void 0,needBlock:T,rootId:S,isCustom:y}}function De(e){return e==null?"":e.toLowerCase()}function qN(e,t){if(t.comment&&e.type===Ye.Comment)return!0;if(e.type===Ye.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&sy(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(De(e.attributes.name).match(/^msapplication-tile(image|color)$/)||De(e.attributes.name)==="application-name"||De(e.attributes.rel)==="icon"||De(e.attributes.rel)==="apple-touch-icon"||De(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&De(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(De(e.attributes.property).match(/^(og|twitter|fb):/)||De(e.attributes.name).match(/^(og|twitter):/)||De(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(De(e.attributes.name)==="robots"||De(e.attributes.name)==="googlebot"||De(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(De(e.attributes.name)==="author"||De(e.attributes.name)==="generator"||De(e.attributes.name)==="framework"||De(e.attributes.name)==="publisher"||De(e.attributes.name)==="progid"||De(e.attributes.property).match(/^article:/)||De(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(De(e.attributes.name)==="google-site-verification"||De(e.attributes.name)==="yandex-verification"||De(e.attributes.name)==="csrf-token"||De(e.attributes.name)==="p:domain_verify"||De(e.attributes.name)==="verify-v1"||De(e.attributes.name)==="verification"||De(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function On(e,t){const{doc:r,mirror:n,blockClass:o,blockSelector:s,unblockSelector:a,maskAllText:i,maskTextClass:l,unmaskTextClass:c,maskTextSelector:p,unmaskTextSelector:d,skipChild:h=!1,inlineStylesheet:m=!0,maskInputOptions:g={},maskAttributeFn:S,maskTextFn:b,maskInputFn:_,slimDOMOptions:v,dataURLOptions:w={},inlineImages:E=!1,recordCanvas:T=!1,onSerialize:I,onIframeLoad:C,iframeLoadTimeout:L=5e3,onBlockedImageLoad:y,onStylesheetLoad:A,stylesheetLoadTimeout:N=5e3,keepIframeSrcFn:W=()=>!1,newlyAddedElement:O=!1,ignoreCSSAttributes:G}=t;let{preserveWhiteSpace:H=!0}=t;const X=$N(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskAllText:i,unblockSelector:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:p,unmaskTextSelector:d,inlineStylesheet:m,maskInputOptions:g,maskAttributeFn:S,maskTextFn:b,maskInputFn:_,dataURLOptions:w,inlineImages:E,recordCanvas:T,keepIframeSrcFn:W,newlyAddedElement:O,ignoreCSSAttributes:G});if(!X)return console.warn(e,"not serialized"),null;let j;n.hasNode(e)?j=n.getId(e):qN(X,v)||!H&&X.type===Ye.Text&&!X.isStyle&&!X.textContent.trim().length?j=Zo:j=Mu();const U=Object.assign(X,{id:j});if(n.add(e,U),j===Zo)return null;I&&I(e);let ee=!h;if(U.type===Ye.Element){ee=ee&&!U.needBlock;const V=e.shadowRoot;V&&jo(V)&&(U.isShadowHost=!0)}if((U.type===Ye.Document||U.type===Ye.Element)&&ee){v.headWhitespace&&U.type===Ye.Element&&U.tagName==="head"&&(H=!1);const V={doc:r,mirror:n,blockClass:o,blockSelector:s,maskAllText:i,unblockSelector:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:p,unmaskTextSelector:d,skipChild:h,inlineStylesheet:m,maskInputOptions:g,maskAttributeFn:S,maskTextFn:b,maskInputFn:_,slimDOMOptions:v,dataURLOptions:w,inlineImages:E,recordCanvas:T,preserveWhiteSpace:H,onSerialize:I,onIframeLoad:C,iframeLoadTimeout:L,onBlockedImageLoad:y,onStylesheetLoad:A,stylesheetLoadTimeout:N,keepIframeSrcFn:W,ignoreCSSAttributes:G},ue=e.childNodes?Array.from(e.childNodes):[];for(const P of ue){const $=On(P,V);$&&U.childNodes.push($)}if(hN(e)&&e.shadowRoot)for(const P of Array.from(e.shadowRoot.childNodes)){const $=On(P,V);$&&(jo(e.shadowRoot)&&($.isShadow=!0),U.childNodes.push($))}}if(e.parentNode&&Oo(e.parentNode)&&jo(e.parentNode)&&(U.isShadow=!0),U.type===Ye.Element&&U.tagName==="iframe"&&!U.needBlock&&HN(e,()=>{const V=ly(e);if(V&&C){const ue=On(V,{doc:V,mirror:n,blockClass:o,blockSelector:s,unblockSelector:a,maskAllText:i,maskTextClass:l,unmaskTextClass:c,maskTextSelector:p,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:m,maskInputOptions:g,maskAttributeFn:S,maskTextFn:b,maskInputFn:_,slimDOMOptions:v,dataURLOptions:w,inlineImages:E,recordCanvas:T,preserveWhiteSpace:H,onSerialize:I,onIframeLoad:C,iframeLoadTimeout:L,onStylesheetLoad:A,stylesheetLoadTimeout:N,keepIframeSrcFn:W,ignoreCSSAttributes:G});ue&&C(e,ue)}},L),U.type===Ye.Element&&U.tagName==="img"&&!e.complete&&U.needBlock){const V=e,ue=()=>{if(V.isConnected&&!V.complete&&y)try{const P=V.getBoundingClientRect();P.width>0&&P.height>0&&y(V,U,P)}catch{}V.removeEventListener("load",ue)};V.isConnected&&V.addEventListener("load",ue)}return U.type===Ye.Element&&U.tagName==="link"&&typeof U.attributes.rel=="string"&&(U.attributes.rel==="stylesheet"||U.attributes.rel==="preload"&&typeof U.attributes.href=="string"&&sy(U.attributes.href)==="css")&&UN(e,()=>{if(A){const V=On(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,unblockSelector:a,maskAllText:i,maskTextClass:l,unmaskTextClass:c,maskTextSelector:p,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:m,maskInputOptions:g,maskAttributeFn:S,maskTextFn:b,maskInputFn:_,slimDOMOptions:v,dataURLOptions:w,inlineImages:E,recordCanvas:T,preserveWhiteSpace:H,onSerialize:I,onIframeLoad:C,iframeLoadTimeout:L,onStylesheetLoad:A,stylesheetLoadTimeout:N,keepIframeSrcFn:W,ignoreCSSAttributes:G});V&&A(e,V)}},N),U.type===Ye.Element&&delete U.needBlock,U}function VN(e,t){const{mirror:r=new oy,blockClass:n="rr-block",blockSelector:o=null,unblockSelector:s=null,maskAllText:a=!1,maskTextClass:i="rr-mask",unmaskTextClass:l=null,maskTextSelector:c=null,unmaskTextSelector:p=null,inlineStylesheet:d=!0,inlineImages:h=!1,recordCanvas:m=!1,maskAllInputs:g=!1,maskAttributeFn:S,maskTextFn:b,maskInputFn:_,slimDOM:v=!1,dataURLOptions:w,preserveWhiteSpace:E,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:C,onBlockedImageLoad:L,onStylesheetLoad:y,stylesheetLoadTimeout:A,keepIframeSrcFn:N=()=>!1,ignoreCSSAttributes:W=new Set([])}=t||{};return On(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,unblockSelector:s,maskAllText:a,maskTextClass:i,unmaskTextClass:l,maskTextSelector:c,unmaskTextSelector:p,skipChild:!1,inlineStylesheet:d,maskInputOptions:g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:g===!1?{}:g,maskAttributeFn:S,maskTextFn:b,maskInputFn:_,slimDOMOptions:v===!0||v==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:v==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:v===!1?{}:v,dataURLOptions:w,inlineImages:h,recordCanvas:m,preserveWhiteSpace:E,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:C,onBlockedImageLoad:L,onStylesheetLoad:y,stylesheetLoadTimeout:A,keepIframeSrcFn:N,newlyAddedElement:!1,ignoreCSSAttributes:W})}function ht(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var Cn=`Please stop import mirror directly. Instead of that,\r
22
22
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
23
23
  or you can use record.mirror to access the mirror instance during recording.`,Mf={map:{},getId(){return console.error(Cn),-1},getNode(){return console.error(Cn),null},removeNodeFromMap(){console.error(Cn)},has(){return console.error(Cn),!1},reset(){console.error(Cn)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Mf=new Proxy(Mf,{get(e,t,r){return t==="map"&&console.error(Cn),Reflect.get(e,t,r)}}));function es(e,t,r={}){let n=null,o=0;return function(...s){const a=Date.now();!o&&r.leading===!1&&(o=a);const i=t-(a-o),l=this;i<=0||i>t?(n&&(ZN(n),n=null),o=a,e.apply(l,s)):!n&&r.trailing!==!1&&(n=wi(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(l,s)},i))}}function dy(e,t,r,n,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(a){wi(()=>{r.set.call(this,a)},0),s&&s.set&&s.set.call(this,a)}}),()=>dy(e,t,s||{},!0)}function Ou(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}var La=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(La=()=>new Date().getTime());function py(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function fy(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function hy(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function my(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function kt(e,t,r,n,o){if(!e)return!1;const s=my(e);if(!s)return!1;const a=Mn(t,r);if(!o){const c=n&&s.matches(n);return a(s)&&!c}const i=Qr(s,a);let l=-1;return i<0?!1:(n&&(l=Qr(s,Mn(null,n))),i>-1&&l<0?!0:i<l)}function GN(e,t){return t.getId(e)!==-1}function sl(e,t){return t.getId(e)===Zo}function gy(e,t){if(Oo(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?gy(e.parentNode,t):!0:!0}function tc(e){return!!e.changedTouches}function YN(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function vy(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function yy(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function rc(e){return!!e?.shadowRoot}var JN=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function by(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function KN(e){let t=e,r;for(;r=by(t);)t=r;return t}function XN(e){const t=e.ownerDocument;if(!t)return!1;const r=KN(e);return t.contains(r)}function Sy(e){const t=e.ownerDocument;return t?t.contains(e)||XN(e):!1}var Of={};function ju(e){const t=Of[e];if(t)return t;const r=window.document;let n=window[e];if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(n=s[e]),r.head.removeChild(o)}catch{}return Of[e]=n.bind(window)}function QN(...e){return ju("requestAnimationFrame")(...e)}function wi(...e){return ju("setTimeout")(...e)}function ZN(...e){return ju("clearTimeout")(...e)}var ge=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(ge||{}),le=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(le||{}),ft=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(ft||{}),lr=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(lr||{}),Rn=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Rn||{}),Lo;function eP(e){Lo=e}function tP(){Lo=void 0}var we=e=>Lo?((...r)=>{try{return e(...r)}catch(n){if(Lo&&Lo(n)===!0)return()=>{};throw n}}):e,jf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rP=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Xs=0;Xs<jf.length;Xs++)rP[jf.charCodeAt(Xs)]=Xs;var Lf=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function Lu(e){try{return e.contentDocument}catch{}}function ts(e){try{return e.contentWindow}catch{}}var nP=class{constructor(e){this.doc=e,this.unattachedDoc=null}parse(e){return this.parseWithConstructableStylesheet(e)||this.parseWithDetachedElement(e)}parseWithConstructableStylesheet(e){if(typeof CSSStyleSheet>"u"||typeof CSSStyleSheet.prototype.replaceSync!="function")return null;try{const t=new CSSStyleSheet;t.replaceSync(`x { ${e} }`);const r=t.cssRules[0];return!r||r.type!==CSSRule.STYLE_RULE?null:r.style}catch{return null}}parseWithDetachedElement(e){const t=this.getUnattachedDoc().createElement("span");return t.setAttribute("style",e),t.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}};function Df(e){return"__ln"in e}var oP=class{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=t?.next||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Df(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Df(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},Ff=(e,t)=>`${e}@${t}`,sP=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new oP,n=i=>{let l=i,c=Zo;for(;c===Zo;)l=l&&l.nextSibling,c=l&&this.mirror.getId(l);return c},o=i=>{if(!i.parentNode||!Sy(i))return;const l=Oo(i.parentNode)?this.mirror.getId(by(i)):this.mirror.getId(i.parentNode),c=n(i);if(l===-1||c===-1)return r.addNode(i);const p=On(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:d=>{vy(d,this.mirror)&&!kt(d,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(d),yy(d,this.mirror)&&this.stylesheetManager.trackLinkElement(d),rc(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(d,h)=>{if(kt(d,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(d,h);const m=ts(d);m&&this.canvasManager.addWindow(m),this.shadowDomManager.observeAttachShadow(d)},onStylesheetLoad:(d,h)=>{this.stylesheetManager.attachLinkElement(d,h)},onBlockedImageLoad:(d,h,{width:m,height:g})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:h.id,attributes:{style:{width:`${m}px`,height:`${g}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});p&&(e.push({parentId:l,nextId:c,node:p}),t.add(p.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const i of this.movedSet)Hf(this.removes,i,this.mirror)&&!this.movedSet.has(i.parentNode)||o(i);for(const i of this.addedSet)!Uf(this.droppedSet,i)&&!Hf(this.removes,i,this.mirror)||Uf(this.movedSet,i)?o(i):this.droppedSet.add(i);let s=null;for(;r.length;){let i=null;if(s){const l=this.mirror.getId(s.value.parentNode),c=n(s.value);l!==-1&&c!==-1&&(i=s)}if(!i){let l=r.tail;for(;l;){const c=l;if(l=l.previous,c){const p=this.mirror.getId(c.value.parentNode);if(n(c.value)===-1)continue;if(p!==-1){i=c;break}else{const d=c.value;if(d.parentNode&&d.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=d.parentNode.host;if(this.mirror.getId(h)!==-1){i=c;break}}}}}}if(!i){for(;r.head;)r.removeNode(r.head.value);break}s=i.previous,r.removeNode(i.value),o(i.value)}const a={texts:this.texts.map(i=>({id:this.mirror.getId(i.node),value:i.value})).filter(i=>!t.has(i.id)).filter(i=>this.mirror.has(i.id)),attributes:this.attributes.map(i=>{const{attributes:l}=i;if(typeof l.style=="string"){const c=JSON.stringify(i.styleDiff),p=JSON.stringify(i._unchangedStyles);c.length<l.style.length&&(c+p).split("var(").length===l.style.split("var(").length&&(l.style=i.styleDiff)}return{id:this.mirror.getId(i.node),attributes:l}}).filter(i=>!t.has(i.id)).filter(i=>this.mirror.has(i.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=e=>{if(!sl(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;!kt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Jn(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t,my(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,n=e.target.getAttribute(r);if(r==="value"){const s=Pu(t),a=t.tagName;n=Oa(t,a,s);const i=xi({maskInputOptions:this.maskInputOptions,tagName:a,type:s});n=Qo({isMasked:Jn(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,i),element:t,value:n,maskInputFn:this.maskInputFn})}if(kt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||n===e.oldValue)return;let o=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(n))if(!Lu(t))r="rr_src";else return;if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!uy(t.tagName,r)&&(o.attributes[r]=cy(this.doc,Yn(t.tagName),Yn(r),n,t,this.maskAttributeFn),r==="style")){const s=e.oldValue?this.styleDeclarationParser.parse(e.oldValue):null;for(const a of Array.from(t.style)){const i=t.style.getPropertyValue(a),l=t.style.getPropertyPriority(a);i!==(s?.getPropertyValue(a)||"")||l!==(s?.getPropertyPriority(a)||"")?l===""?o.styleDiff[a]=i:o.styleDiff[a]=[i,l]:o._unchangedStyles[a]=[i,l]}if(s)for(const a of Array.from(s))t.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}break}case"childList":if(kt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),n=Oo(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);kt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||sl(t,this.mirror)||!GN(t,this.mirror)||(this.addedSet.has(t)?(nc(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||gy(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ff(r,n)]?nc(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:Oo(e.target)&&jo(e.target)?!0:void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(sl(e,this.mirror))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[Ff(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);kt(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEach(r=>this.genAdds(r)),rc(e)&&e.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","ignoreCSSAttributes"].forEach(t=>{this[t]=e[t]}),this.styleDeclarationParser=new nP(this.doc)}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function nc(e,t){e.delete(t),t.childNodes?.forEach(r=>nc(e,r))}function Hf(e,t,r){return e.length===0?!1:aP(e,t,r)}function aP(e,t,r){let n=t.parentNode;for(;n;){const o=r.getId(n);if(e.some(s=>s.id===o))return!0;n=n.parentNode}return!1}function Uf(e,t){return e.size===0?!1:_y(e,t)}function _y(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:_y(e,r):!1}var jn=[];function Is(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function xy(e,t){const r=new sP;jn.push(r),r.init(e);let n=window.MutationObserver||window.__rrMutationObserver;const o=window?.Zone?.__symbol__?.("MutationObserver");o&&window[o]&&(n=window[o]);const s=new n(we(a=>{e.onMutation&&e.onMutation(a)===!1||r.processMutations.bind(r)(a)}));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function iP({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],i;const l=es(we(d=>{const h=Date.now()-i;e(a.map(m=>(m.timeOffset-=h,m)),d),a=[],i=null}),s),c=we(es(we(d=>{const h=Is(d),{clientX:m,clientY:g}=tc(d)?d.changedTouches[0]:d;i||(i=La()),a.push({x:m,y:g,id:n.getId(h),timeOffset:La()-i}),l(typeof DragEvent<"u"&&d instanceof DragEvent?le.Drag:d instanceof MouseEvent?le.MouseMove:le.TouchMove)}),o,{trailing:!1})),p=[ht("mousemove",c,r),ht("touchmove",c,r),ht("drag",c,r)];return we(()=>{p.forEach(d=>d())})}function lP({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,unblockSelector:s,sampling:a}){if(a.mouseInteraction===!1)return()=>{};const i=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,l=[];let c=null;const p=d=>h=>{const m=Is(h);if(kt(m,n,o,s,!0))return;let g=null,S=d;if("pointerType"in h){switch(h.pointerType){case"mouse":g=lr.Mouse;break;case"touch":g=lr.Touch;break;case"pen":g=lr.Pen}g===lr.Touch?ft[d]===ft.MouseDown?S="TouchStart":ft[d]===ft.MouseUp&&(S="TouchEnd"):lr.Pen}else tc(h)&&(g=lr.Touch);g!==null?(c=g,(S.startsWith("Touch")&&g===lr.Touch||S.startsWith("Mouse")&&g===lr.Mouse)&&(g=null)):ft[d]===ft.Click&&(g=c,c=null);const b=tc(h)?h.changedTouches[0]:h;if(!b)return;const _=r.getId(m),{clientX:v,clientY:w}=b;we(e)({type:ft[S],id:_,x:v,y:w,...g!==null&&{pointerType:g}})};return Object.keys(ft).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&i[d]!==!1).forEach(d=>{let h=Yn(d);const m=p(d);if(window.PointerEvent)switch(ft[d]){case ft.MouseDown:case ft.MouseUp:h=h.replace("mouse","pointer");break;case ft.TouchStart:case ft.TouchEnd:return}l.push(ht(h,m,t))}),we(()=>{l.forEach(d=>d())})}function Ey({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,unblockSelector:s,sampling:a}){return ht("scroll",we(es(we(i=>{const l=Is(i);if(!l||kt(l,n,o,s,!0))return;const c=r.getId(l);if(l===t&&t.defaultView){const p=py(t.defaultView);e({id:c,x:p.left,y:p.top})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})}),a.scroll||100)),t)}function cP({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return ht("resize",we(es(we(()=>{const o=fy(),s=hy();(r!==o||n!==s)&&(e({width:Number(s),height:Number(o)}),r=o,n=s)}),200)),t)}var uP=["INPUT","TEXTAREA","SELECT"],$f=new WeakMap;function dP({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,unblockSelector:s,ignoreClass:a,ignoreSelector:i,maskInputOptions:l,maskInputFn:c,sampling:p,userTriggeredOnInput:d,maskTextClass:h,unmaskTextClass:m,maskTextSelector:g,unmaskTextSelector:S}){function b(I){let C=Is(I);const L=I.isTrusted,y=C&&Zl(C.tagName);if(y==="OPTION"&&(C=C.parentElement),!C||!y||uP.indexOf(y)<0||kt(C,n,o,s,!0))return;const A=C;if(A.classList.contains(a)||i&&A.matches(i))return;const N=Pu(C);let W=Oa(A,y,N),O=!1;const G=xi({maskInputOptions:l,tagName:y,type:N}),H=Jn(C,h,g,m,S,G);(N==="radio"||N==="checkbox")&&(O=C.checked),W=Qo({isMasked:H,element:C,value:W,maskInputFn:c}),_(C,d?{text:W,isChecked:O,userTriggered:L}:{text:W,isChecked:O});const X=C.name;N==="radio"&&X&&O&&t.querySelectorAll(`input[type="radio"][name="${X}"]`).forEach(j=>{if(j!==C){const U=Qo({isMasked:H,element:j,value:Oa(j,y,N),maskInputFn:c});_(j,d?{text:U,isChecked:!O,userTriggered:!1}:{text:U,isChecked:!O})}})}function _(I,C){const L=$f.get(I);if(!L||L.text!==C.text||L.isChecked!==C.isChecked){$f.set(I,C);const y=r.getId(I);we(e)({...C,id:y})}}const v=(p.input==="last"?["change"]:["input","change"]).map(I=>ht(I,we(b),t)),w=t.defaultView;if(!w)return()=>{v.forEach(I=>I())};const E=w.Object.getOwnPropertyDescriptor(w.HTMLInputElement.prototype,"value"),T=[[w.HTMLInputElement.prototype,"value"],[w.HTMLInputElement.prototype,"checked"],[w.HTMLSelectElement.prototype,"value"],[w.HTMLTextAreaElement.prototype,"value"],[w.HTMLSelectElement.prototype,"selectedIndex"],[w.HTMLOptionElement.prototype,"selected"]];return E&&E.set&&v.push(...T.map(I=>dy(I[0],I[1],{set(){we(b)({target:this,isTrusted:!1})}},!1,w))),we(()=>{v.forEach(I=>I())})}function Da(e){const t=[];function r(n,o){if(Qs("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Qs("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Qs("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Qs("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){const s=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(s)}else if(n.parentStyleSheet){const s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(s)}return o}return r(e,t)}function Er(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function pP({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:we((p,d,h)=>{const[m,g]=h,{id:S,styleId:b}=Er(d,t,r.styleMirror);return(S&&S!==-1||b&&b!==-1)&&e({id:S,styleId:b,adds:[{rule:m,index:g}]}),p.apply(d,h)})});const s=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:we((p,d,h)=>{const[m]=h,{id:g,styleId:S}=Er(d,t,r.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,removes:[{index:m}]}),p.apply(d,h)})});let a;n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:we((p,d,h)=>{const[m]=h,{id:g,styleId:S}=Er(d,t,r.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,replace:m}),p.apply(d,h)})}));let i;n.CSSStyleSheet.prototype.replaceSync&&(i=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(i,{apply:we((p,d,h)=>{const[m]=h,{id:g,styleId:S}=Er(d,t,r.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,replaceSync:m}),p.apply(d,h)})}));const l={};Zs("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Zs("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Zs("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Zs("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(l).forEach(([p,d])=>{c[p]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(c[p].insertRule,{apply:we((h,m,g)=>{const[S,b]=g,{id:_,styleId:v}=Er(m.parentStyleSheet,t,r.styleMirror);return(_&&_!==-1||v&&v!==-1)&&e({id:_,styleId:v,adds:[{rule:S,index:[...Da(m),b||0]}]}),h.apply(m,g)})}),d.prototype.deleteRule=new Proxy(c[p].deleteRule,{apply:we((h,m,g)=>{const[S]=g,{id:b,styleId:_}=Er(m.parentStyleSheet,t,r.styleMirror);return(b&&b!==-1||_&&_!==-1)&&e({id:b,styleId:_,removes:[{index:[...Da(m),S]}]}),h.apply(m,g)})})}),we(()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=s,a&&(n.CSSStyleSheet.prototype.replace=a),i&&(n.CSSStyleSheet.prototype.replaceSync=i),Object.entries(l).forEach(([p,d])=>{d.prototype.insertRule=c[p].insertRule,d.prototype.deleteRule=c[p].deleteRule})})}function wy({mirror:e,stylesheetManager:t},r){let n=null;r.nodeName==="#document"?n=e.getId(r):n=e.getId(r.host);const o=r.nodeName==="#document"?r.defaultView?.Document:r.ownerDocument?.defaultView?.ShadowRoot,s=o?.prototype?Object.getOwnPropertyDescriptor(o?.prototype,"adoptedStyleSheets"):void 0;return n===null||n===-1||!o||!s?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){return s.get?.call(this)},set(a){const i=s.set?.call(this,a);if(n!==null&&n!==-1)try{t.adoptStyleSheets(a,n)}catch{}return i}}),we(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function fP({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:we((i,l,c)=>{const[p,d,h]=c;if(r.has(p))return s.apply(l,[p,d,h]);const{id:m,styleId:g}=Er(l.parentRule?.parentStyleSheet,t,n.styleMirror);return(m&&m!==-1||g&&g!==-1)&&e({id:m,styleId:g,set:{property:p,value:d,priority:h},index:Da(l.parentRule)}),i.apply(l,c)})});const a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:we((i,l,c)=>{const[p]=c;if(r.has(p))return a.apply(l,[p]);const{id:d,styleId:h}=Er(l.parentRule?.parentStyleSheet,t,n.styleMirror);return(d&&d!==-1||h&&h!==-1)&&e({id:d,styleId:h,remove:{property:p},index:Da(l.parentRule)}),i.apply(l,c)})}),we(()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=a})}function hP({mediaInteractionCb:e,blockClass:t,blockSelector:r,unblockSelector:n,mirror:o,sampling:s,doc:a}){const i=we(c=>es(we(p=>{const d=Is(p);if(!d||kt(d,t,r,n,!0))return;const{currentTime:h,volume:m,muted:g,playbackRate:S}=d;e({type:c,id:o.getId(d),currentTime:h,volume:m,muted:g,playbackRate:S})}),s.media||500)),l=[ht("play",i(Rn.Play),a),ht("pause",i(Rn.Pause),a),ht("seeked",i(Rn.Seeked),a),ht("volumechange",i(Rn.VolumeChange),a),ht("ratechange",i(Rn.RateChange),a)];return we(()=>{l.forEach(c=>c())})}function mP({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(l,c,p){const d=new s(l,c,p);return o.set(d,{family:l,buffer:typeof c!="string",descriptors:p,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),d};const a=Ou(t.fonts,"add",function(i){return function(l){return wi(we(()=>{const c=o.get(l);c&&(e(c),o.delete(l))}),0),i.apply(this,[l])}});return n.push(()=>{r.FontFace=s}),n.push(a),we(()=>{n.forEach(i=>i())})}function gP(e){const{doc:t,mirror:r,blockClass:n,blockSelector:o,unblockSelector:s,selectionCb:a}=e;let i=!0;const l=we(()=>{const c=t.getSelection();if(!c||i&&c?.isCollapsed)return;i=c.isCollapsed||!1;const p=[],d=c.rangeCount||0;for(let h=0;h<d;h++){const{startContainer:m,startOffset:g,endContainer:S,endOffset:b}=c.getRangeAt(h);kt(m,n,o,s,!0)||kt(S,n,o,s,!0)||p.push({start:r.getId(m),startOffset:g,end:r.getId(S),endOffset:b})}a({ranges:p})});return l(),ht("selectionchange",l)}function vP({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:Ou(r.customElements,"define",function(n){return function(o,s,a){try{t({define:{name:o}})}catch{}return n.apply(this,[o,s,a])}})}function yP(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;e.recordDOM&&(n=xy(e,e.doc));const o=iP(e),s=lP(e),a=Ey(e),i=cP(e,{win:r}),l=dP(e),c=hP(e);let p=()=>{},d=()=>{},h=()=>{},m=()=>{};e.recordDOM&&(p=pP(e,{win:r}),d=wy(e,e.doc),h=fP(e,{win:r}),e.collectFonts&&(m=mP(e)));const g=gP(e),S=vP(e),b=[];for(const _ of e.plugins)b.push(_.observer(_.callback,r,_.options));return we(()=>{jn.forEach(_=>_.reset()),n?.disconnect(),o(),s(),a(),i(),l(),c(),p(),d(),h(),m(),g(),S(),b.forEach(_=>_())})}function Qs(e){return typeof window[e]<"u"}function Zs(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var oc=class{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,r,n){const o=r||this.getIdToRemoteIdMap(e),s=n||this.getRemoteIdToIdMap(e);let a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),s.set(a,t)),a}getIds(e,t){const r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,r,n))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const o=n.get(t);return o||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(n=>this.getRemoteId(e,n,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},bP=class{constructor(){this.crossOriginIframeMirror=new oc(Mu),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},SP=class{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new oc(Mu),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new oc(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0);const t=ts(e);t&&this.crossOriginIframeMap.set(t,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&ts(e)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(e);const r=Lu(e);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){switch(t.type){case ge.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:ge.IncrementalSnapshot,data:{source:le.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ge.Meta:case ge.Load:case ge.DomContentLoaded:return!1;case ge.Plugin:return t;case ge.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ge.IncrementalSnapshot:switch(t.data.source){case le.Mutation:return t.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(r.node,n)}),t.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),t.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),t.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),t;case le.Drag:case le.TouchMove:case le.MouseMove:return t.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),t;case le.ViewportResize:return!1;case le.MediaInteraction:case le.MouseInteraction:case le.Scroll:case le.CanvasMutation:case le.Input:return this.replaceIds(t.data,e,["id"]),t;case le.StyleSheetRule:case le.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case le.Font:return t;case le.Selection:return t.data.ranges.forEach(r=>{this.replaceIds(r,e,["start","end"])}),t;case le.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),t.data.styles?.forEach(r=>{this.replaceStyleIds(r,e,["styleId"])}),t}}return!1}replace(e,t,r,n){for(const o of n)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==Ye.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},_P=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},xP=class{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!jo(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);const r=xy({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Ey({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),wi(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(wy({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){const t=Lu(e),r=ts(e);!t||!r||this.patchAttachShadow(r.Element,t)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(Ou(e.prototype,"attachShadow",function(n){return function(o){const s=n.call(this,o);return this.shadowRoot&&Sy(this)&&r.addShadowRoot(this.shadowRoot,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}},EP=class{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new JN,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const r={id:t,styleIds:[]},n=[];for(const o of e){let s;this.styleMirror.has(o)?s=this.styleMirror.getId(o):(s=this.styleMirror.add(o),n.push({styleId:s,rules:Array.from(o.rules||CSSRule,(a,i)=>({rule:ny(a),index:i}))})),r.styleIds.push(s)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},wP=class{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(n=>n!==t)}add(e,t){this.active||(this.active=!0,QN(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},qe,Fa;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Ft=_N();function jt(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:s=null,unblockSelector:a=null,ignoreClass:i="rr-ignore",ignoreSelector:l=null,maskAllText:c=!1,maskTextClass:p="rr-mask",unmaskTextClass:d=null,maskTextSelector:h=null,unmaskTextSelector:m=null,inlineStylesheet:g=!0,maskAllInputs:S,maskInputOptions:b,slimDOMOptions:_,maskAttributeFn:v,maskInputFn:w,maskTextFn:E,maxCanvasSize:T=null,packFn:I,sampling:C={},dataURLOptions:L={},mousemoveWait:y,recordDOM:A=!0,recordCanvas:N=!1,recordCrossOriginIframes:W=!1,recordAfter:O=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:G=!1,collectFonts:H=!1,inlineImages:X=!1,plugins:j,keepIframeSrcFn:U=()=>!1,ignoreCSSAttributes:ee=new Set([]),errorHandler:V,onMutation:ue,getCanvasManager:P}=e;eP(V);const $=W?window.parent===window:!0;let Y=!1;if(!$)try{window.parent.document&&(Y=!1)}catch{Y=!0}if($&&!t)throw new Error("emit function is required");if(!$&&!Y)return()=>{};y!==void 0&&C.mousemove===void 0&&(C.mousemove=y),Ft.reset();const J=S===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:b!==void 0?b:{},ae=_===!0||_==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:_==="all",headMetaDescKeywords:_==="all"}:_||{};YN();let ie,Se=0;const Oe=be=>{for(const lt of j||[])lt.eventProcessor&&(be=lt.eventProcessor(be));return I&&!Y&&(be=I(be)),be};qe=(be,lt)=>{const ye=be;if(ye.timestamp=La(),jn[0]?.isFrozen()&&ye.type!==ge.FullSnapshot&&!(ye.type===ge.IncrementalSnapshot&&ye.data.source===le.Mutation)&&jn.forEach(Ve=>Ve.unfreeze()),$)t?.(Oe(ye),lt);else if(Y){const Ve={type:"rrweb",event:Oe(ye),origin:window.location.origin,isCheckout:lt};window.parent.postMessage(Ve,"*")}if(ye.type===ge.FullSnapshot)ie=ye,Se=0;else if(ye.type===ge.IncrementalSnapshot){if(ye.data.source===le.Mutation&&ye.data.isAttachIframe)return;Se++;const Ve=n&&Se>=n,F=r&&ie&&ye.timestamp-ie.timestamp>r;(Ve||F)&&Wr(!0)}};const Xe=be=>{qe({type:ge.IncrementalSnapshot,data:{source:le.Mutation,...be}})},Tt=be=>qe({type:ge.IncrementalSnapshot,data:{source:le.Scroll,...be}}),ho=be=>qe({type:ge.IncrementalSnapshot,data:{source:le.CanvasMutation,...be}}),mo=be=>qe({type:ge.IncrementalSnapshot,data:{source:le.AdoptedStyleSheet,...be}}),Le=new EP({mutationCb:Xe,adoptedStyleSheetCb:mo}),rt=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new bP:new SP({mirror:Ft,mutationCb:Xe,stylesheetManager:Le,recordCrossOriginIframes:W,wrappedEmit:qe});for(const be of j||[])be.getMirror&&be.getMirror({nodeMirror:Ft,crossOriginIframeMirror:rt.crossOriginIframeMirror,crossOriginIframeStyleMirror:rt.crossOriginIframeStyleMirror});const Dt=new wP,nr=IP(P,{mirror:Ft,win:window,mutationCb:be=>qe({type:ge.IncrementalSnapshot,data:{source:le.CanvasMutation,...be}}),recordCanvas:N,blockClass:o,blockSelector:s,unblockSelector:a,maxCanvasSize:T,sampling:C.canvas,dataURLOptions:L,errorHandler:V}),st=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new _P:new xP({mutationCb:Xe,scrollCb:Tt,bypassOptions:{onMutation:ue,blockClass:o,blockSelector:s,unblockSelector:a,maskAllText:c,maskTextClass:p,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:m,inlineStylesheet:g,maskInputOptions:J,dataURLOptions:L,maskAttributeFn:v,maskTextFn:E,maskInputFn:w,recordCanvas:N,inlineImages:X,sampling:C,slimDOMOptions:ae,iframeManager:rt,stylesheetManager:Le,canvasManager:nr,keepIframeSrcFn:U,processedNodeManager:Dt,ignoreCSSAttributes:ee},mirror:Ft}),Wr=(be=!1)=>{if(!A)return;qe({type:ge.Meta,data:{href:window.location.href,width:hy(),height:fy()}},be),Le.reset(),st.init(),jn.forEach(ye=>ye.lock());const lt=VN(document,{mirror:Ft,blockClass:o,blockSelector:s,unblockSelector:a,maskAllText:c,maskTextClass:p,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:m,inlineStylesheet:g,maskAllInputs:J,maskAttributeFn:v,maskInputFn:w,maskTextFn:E,slimDOM:ae,dataURLOptions:L,recordCanvas:N,inlineImages:X,onSerialize:ye=>{vy(ye,Ft)&&rt.addIframe(ye),yy(ye,Ft)&&Le.trackLinkElement(ye),rc(ye)&&st.addShadowRoot(ye.shadowRoot,document)},onIframeLoad:(ye,Ve)=>{rt.attachIframe(ye,Ve);const F=ts(ye);F&&nr.addWindow(F),st.observeAttachShadow(ye)},onStylesheetLoad:(ye,Ve)=>{Le.attachLinkElement(ye,Ve)},onBlockedImageLoad:(ye,Ve,{width:F,height:fe})=>{Xe({adds:[],removes:[],texts:[],attributes:[{id:Ve.id,attributes:{style:{width:`${F}px`,height:`${fe}px`}}}]})},keepIframeSrcFn:U,ignoreCSSAttributes:ee});if(!lt)return console.warn("Failed to snapshot the document");qe({type:ge.FullSnapshot,data:{node:lt,initialOffset:py(window)}}),jn.forEach(ye=>ye.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Le.adoptStyleSheets(document.adoptedStyleSheets,Ft.getId(document))};Fa=Wr;try{const be=[],lt=Ve=>we(yP)({onMutation:ue,mutationCb:Xe,mousemoveCb:(F,fe)=>qe({type:ge.IncrementalSnapshot,data:{source:fe,positions:F}}),mouseInteractionCb:F=>qe({type:ge.IncrementalSnapshot,data:{source:le.MouseInteraction,...F}}),scrollCb:Tt,viewportResizeCb:F=>qe({type:ge.IncrementalSnapshot,data:{source:le.ViewportResize,...F}}),inputCb:F=>qe({type:ge.IncrementalSnapshot,data:{source:le.Input,...F}}),mediaInteractionCb:F=>qe({type:ge.IncrementalSnapshot,data:{source:le.MediaInteraction,...F}}),styleSheetRuleCb:F=>qe({type:ge.IncrementalSnapshot,data:{source:le.StyleSheetRule,...F}}),styleDeclarationCb:F=>qe({type:ge.IncrementalSnapshot,data:{source:le.StyleDeclaration,...F}}),canvasMutationCb:ho,fontCb:F=>qe({type:ge.IncrementalSnapshot,data:{source:le.Font,...F}}),selectionCb:F=>{qe({type:ge.IncrementalSnapshot,data:{source:le.Selection,...F}})},customElementCb:F=>{qe({type:ge.IncrementalSnapshot,data:{source:le.CustomElement,...F}})},blockClass:o,ignoreClass:i,ignoreSelector:l,maskAllText:c,maskTextClass:p,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:m,maskInputOptions:J,inlineStylesheet:g,sampling:C,recordDOM:A,recordCanvas:N,inlineImages:X,userTriggeredOnInput:G,collectFonts:H,doc:Ve,maskAttributeFn:v,maskInputFn:w,maskTextFn:E,keepIframeSrcFn:U,blockSelector:s,unblockSelector:a,slimDOMOptions:ae,dataURLOptions:L,mirror:Ft,iframeManager:rt,stylesheetManager:Le,shadowDomManager:st,processedNodeManager:Dt,canvasManager:nr,ignoreCSSAttributes:ee,plugins:j?.filter(F=>F.observer)?.map(F=>({observer:F.observer,options:F.options,callback:fe=>qe({type:ge.Plugin,data:{plugin:F.name,payload:fe}})}))||[]},{});rt.addLoadListener(Ve=>{try{be.push(lt(Ve.contentDocument))}catch(F){console.warn(F)}});const ye=()=>{Wr(),be.push(lt(document))};return document.readyState==="interactive"||document.readyState==="complete"?ye():(be.push(ht("DOMContentLoaded",()=>{qe({type:ge.DomContentLoaded,data:{}}),O==="DOMContentLoaded"&&ye()})),be.push(ht("load",()=>{qe({type:ge.Load,data:{}}),O==="load"&&ye()},window))),()=>{be.forEach(Ve=>Ve()),Dt.destroy(),Fa=void 0,tP()}}catch(be){console.warn(be)}}function kP(e){if(!Fa)throw new Error("please take full snapshot after start recording");Fa(e)}jt.mirror=Ft;jt.takeFullSnapshot=kP;function IP(e,t){try{return e?e(t):new Lf}catch{return console.warn("Unable to initialize CanvasManager"),new Lf}}var Bf;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Bf||(Bf={}));var CP=3,RP=5;function Du(e){return e>9999999999?e:e*1e3}function al(e){return e>9999999999?e/1e3:e}function Cs(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:ge.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Yc(t,10,1e3)}}),t.category==="console")))}var TP="button,a";function ky(e){return e.closest(TP)||e}function Iy(e){const t=Cy(e);return!t||!(t instanceof Element)?t:ky(t)}function Cy(e){return AP(e)?e.target:e}function AP(e){return so(e)&&"target"in e}var wr;function NP(e){return wr||(wr=[],PP()),wr.push(e),()=>{const t=wr?wr.indexOf(e):-1;t>-1&&wr.splice(t,1)}}function PP(){_t(Fe,"open",function(e){return function(...t){if(wr)try{wr.forEach(r=>r())}catch{}return e.apply(Fe,t)}})}var MP=new Set([le.Mutation,le.StyleSheetRule,le.StyleDeclaration,le.AdoptedStyleSheet,le.CanvasMutation,le.Selection,le.MediaInteraction]);function OP(e,t,r){e.handleClick(t,r)}var jP=class{constructor(e,t,r=Cs){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scrollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const e=NP(()=>{this._lastMutation=zf()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){if(DP(t,this._ignoreSelector)||!FP(e))return;const r={timestamp:al(e.timestamp),clickBreadcrumb:e,clickCount:0,node:t};this._clicks.some(n=>n.node===r.node&&Math.abs(n.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=al(e)}registerScroll(e=Date.now()){this._lastScroll=al(e)}registerClick(e){const t=ky(e);this._handleMultiClick(t)}_handleMultiClick(e){this._getClicks(e).forEach(t=>{t.clickCount++})}_getClicks(e){return this._clicks.filter(t=>t.node===e)}_checkClicks(){const e=[],t=zf();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=t&&e.push(r)});for(const r of e){const n=this._clicks.indexOf(r);n>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(n,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const t=this._replay,r=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,n=e.mutationAfter&&e.mutationAfter<=this._threshold,o=!r&&!n,{clickCount:s,clickBreadcrumb:a}=e;if(o){const i=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,l=i<this._timeout*1e3?"mutation":"timeout",c={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.slowClickDetected",data:{...a.data,url:Fe.location.href,route:t.getCurrentRoute(),timeAfterClickMs:i,endReason:l,clickCount:s||1}};this._addBreadcrumbEvent(t,c);return}if(s>1){const i={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:{...a.data,url:Fe.location.href,route:t.getCurrentRoute(),clickCount:s,metric:!0}};this._addBreadcrumbEvent(t,i)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=ks(()=>this._checkClicks(),1e3)}},LP=["A","BUTTON","INPUT"];function DP(e,t){return!!(!LP.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function FP(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function zf(){return Date.now()/1e3}function HP(e,t){try{if(!UP(t))return;const{source:r}=t.data;if(MP.has(r)&&e.registerMutation(t.timestamp),r===le.Scroll&&e.registerScroll(t.timestamp),$P(t)){const{type:n,id:o}=t.data,s=jt.mirror.getNode(o);s instanceof HTMLElement&&n===ft.Click&&e.registerClick(s)}}catch{}}function UP(e){return e.type===CP}function $P(e){return e.data.source===le.MouseInteraction}function Kt(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var ki=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(ki||{}),Ry=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]),BP=new Set([...Ry,"data-sentry-element"]);function zP(e){const t={};for(const r in e)if(Ry.has(r)){let n=r;(r==="data-testid"||r==="data-test-id")&&(n="testId"),t[n]=e[r]}return!t["data-sentry-component"]&&e["data-sentry-element"]&&(t["data-sentry-component"]=e["data-sentry-element"]),t}var WP=e=>t=>{if(!e.isEnabled())return;const r=qP(t);if(!r)return;const n=t.name==="click",o=n?t.event:void 0;n&&e.clickDetector&&o?.target&&!o.altKey&&!o.metaKey&&!o.ctrlKey&&!o.shiftKey&&OP(e.clickDetector,r,Iy(t.event)),Cs(e,r)};function Ty(e,t){const r=jt.mirror.getId(e),n=r&&jt.mirror.getNode(r),o=n&&jt.mirror.getMeta(n),s=o&&GP(o)?o:null;return{message:t,data:s?{nodeId:r,node:{id:r,tagName:s.tagName,textContent:Array.from(s.childNodes).map(a=>a.type===ki.Text&&a.textContent).filter(Boolean).map(a=>a.trim()).join(""),attributes:zP(s.attributes)}}:{}}}function qP(e){const{target:t,message:r}=VP(e);return Kt({category:`ui.${e.name}`,...Ty(t,r)})}function VP(e){const t=e.name==="click";let r,n=null;try{n=t?Iy(e.event):Cy(e.event),r=tt(n,{maxStringLength:200})||"<unknown>"}catch{r="<unknown>"}return{target:n,message:r}}function GP(e){return e.type===ki.Element}function YP(e,t){if(!e.isEnabled())return;e.updateUserActivity();const r=JP(t);r&&Cs(e,r)}function JP(e){const{metaKey:t,shiftKey:r,ctrlKey:n,altKey:o,key:s,target:a}=e;if(!a||KP(a)||!s)return null;const i=t||n||o,l=s.length===1;if(!i&&l)return null;const c=tt(a,{maxStringLength:200})||"<unknown>";return Kt({category:"ui.keyDown",message:c,data:{...Ty(a,c).data,metaKey:t,shiftKey:r,ctrlKey:n,altKey:o,key:s}})}function KP(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}var XP={resource:rM,paint:eM,navigation:tM};function il(e,t){return({metric:r})=>{t.replayPerformanceEntries.push(e(r))}}function QP(e){return e.map(ZP).filter(Boolean)}function ZP(e){const t=XP[e.entryType];return t?t(e):null}function Kn(e){return((ot()||Fe.performance.timeOrigin)+e)/1e3}function eM(e){const{duration:t,entryType:r,name:n,startTime:o}=e,s=Kn(o);return{type:r,name:n,start:s,end:s+t,data:void 0}}function tM(e){const{entryType:t,name:r,decodedBodySize:n,duration:o,domComplete:s,encodedBodySize:a,domContentLoadedEventStart:i,domContentLoadedEventEnd:l,domInteractive:c,loadEventStart:p,loadEventEnd:d,redirectCount:h,startTime:m,transferSize:g,type:S}=e;return o===0?null:{type:`${t}.${S}`,start:Kn(m),end:Kn(s),name:r,data:{size:g,decodedBodySize:n,encodedBodySize:a,duration:o,domInteractive:c,domContentLoadedEventStart:i,domContentLoadedEventEnd:l,loadEventStart:p,loadEventEnd:d,domComplete:s,redirectCount:h}}}function rM(e){const{entryType:t,initiatorType:r,name:n,responseEnd:o,startTime:s,decodedBodySize:a,encodedBodySize:i,responseStatus:l,transferSize:c}=e;return["fetch","xmlhttprequest"].includes(r)?null:{type:`${t}.${r}`,start:Kn(s),end:Kn(o),name:n,data:{size:c,statusCode:l,decodedBodySize:a,encodedBodySize:i}}}function nM(e){const t=e.entries[e.entries.length-1];return Fu(e,"largest-contentful-paint",t?.element?[t.element]:void 0)}function oM(e){return e.sources!==void 0}function sM(e){const t=[],r=[];for(const n of e.entries)if(oM(n)){const o=[];for(const s of n.sources)if(s.node){r.push(s.node);const a=jt.mirror.getId(s.node);a&&o.push(a)}t.push({value:n.value,nodeIds:o.length?o:void 0})}return Fu(e,"cumulative-layout-shift",r,t)}function aM(e){const t=e.entries[e.entries.length-1];return Fu(e,"interaction-to-next-paint",t?.target?[t.target]:void 0)}function Fu(e,t,r,n){const o=e.value,s=e.rating,a=Kn(o);return{type:"web-vital",name:t,start:a,end:a,data:{value:o,size:o,rating:s,nodeIds:r?r.map(i=>jt.mirror.getId(i)):void 0,attributions:n}}}function iM(e){function t(o){e.performanceEntries.includes(o)||e.performanceEntries.push(o)}function r({entries:o}){o.forEach(t)}const n=[];return["navigation","paint","resource"].forEach(o=>{n.push(an(o,r))}),n.push(vi(il(nM,e)),gi(il(sM,e)),Iu(il(aM,e))),()=>{n.forEach(o=>o())}}var oe=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,lM='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function cM(){const e=new Blob([lM],{type:"text/javascript"});return URL.createObjectURL(e)}var Wf=["log","warn","error"],ma="[Replay] ";function ll(e,t="info"){jr({category:"console",data:{logger:"replay"},level:t,message:`${ma}${e}`},{level:t})}function uM(){let e=!1,t=!1;const r={exception:()=>{},infoTick:()=>{},setConfig:n=>{e=!!n.captureExceptions,t=!!n.traceInternals}};return oe?(Wf.forEach(n=>{r[n]=(...o)=>{z[n](ma,...o),t&&ll(o.join(""),Iv(n))}}),r.exception=(n,...o)=>{o.length&&r.error&&r.error(...o),z.error(ma,n),e?Vc(n,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&ll(n,"error")},r.infoTick=(...n)=>{z.log(ma,...n),t&&setTimeout(()=>ll(n[0]),0)}):Wf.forEach(n=>{r[n]=()=>{}}),r}var se=uM(),Hu=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Nu}.`)}},Ay=class extends Error{constructor(){super("Worker destroyed")}},Ny=class{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){const t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>Nu)throw new Hu;this.events.push(e)}finish(){return new Promise(e=>{const t=this.events;this.clear(),e(JSON.stringify(t))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=null;for(const{timestamp:t}of this.events)(e===null||t<e)&&(e=t);return e===null?e:Du(e)}},dM=class{constructor(e){this._onMessage=({data:t})=>{const r=t;if(typeof r.id!="number")return;const n=this._pending.get(r.id);if(!(!n||n.method!==r.method)){if(this._pending.delete(r.id),!r.success){oe&&se.error("Error in compression worker: ",r.response),n.reject(new Error("Error in compression worker"));return}n.resolve(r.response)}},this._worker=e,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((e,t)=>{this._worker.addEventListener("message",({data:r})=>{r.success?e():(oe&&se.warn("Received worker message with unsuccessful status",r),t(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{oe&&se.warn("Failed to load Replay compression worker",r),t(new Error(`Failed to load Replay compression worker: ${r instanceof ErrorEvent&&r.message?r.message:"Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load."}`))},{once:!0})}),this._ensureReadyPromise)}destroy(){oe&&se.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(e=>e.reject(new Ay)),this._pending.clear(),this._worker.terminate()}postMessage(e,t){const r=this._getAndIncrementId();return new Promise((n,o)=>{this._pending.set(r,{method:e,resolve:n,reject:o});try{this._worker.postMessage({id:r,method:e,arg:t})}catch(s){this._pending.delete(r),o(s)}})}_getAndIncrementId(){return this._id++}},pM=class{constructor(e){this._worker=new dM(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){const t=Du(e.timestamp);(!this._earliestTimestamp||t<this._earliestTimestamp)&&(this._earliestTimestamp=t);const r=JSON.stringify(e);return this._totalSize+=r.length,this._totalSize>Nu?Promise.reject(new Hu):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{oe&&se.exception(e,'Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}},fM=class{constructor(e){this._fallback=new Ny,this._compression=new pM(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){oe&&se.exception(e,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:t,waitForCheckout:r}=this._fallback,n=[];for(const o of e)n.push(this._compression.addEvent(o));this._compression.hasCheckout=t,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(n),this._fallback.clear()}catch(o){if(o instanceof Ay)return;oe&&se.exception(o,"Failed to add events when switching buffers.")}}};function hM({useCompression:e,workerUrl:t}){if(e&&window.Worker){const r=mM(t);if(r)return r}return oe&&se.log("Using simple buffer"),new Ny}function mM(e){try{const t=e||gM();if(!t)return;oe&&se.log(`Using compression worker${e?` from ${e}`:""}`);const r=new Worker(t);return new fM(r)}catch(t){oe&&se.exception(t,"Failed to create compression worker")}}function gM(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?cM():""}function Uu(){try{return"sessionStorage"in Fe&&!!Fe.sessionStorage}catch{return!1}}function vM(e){yM(),e.session=void 0}function yM(){if(Uu())try{Fe.sessionStorage.removeItem(Tu)}catch{}}function Py(e){return e===void 0?!1:Math.random()<e}function Ii(e){if(Uu())try{Fe.sessionStorage.setItem(Tu,JSON.stringify(e))}catch{}}function My(e){const t=Date.now();return{id:e.id||Io(),started:e.started||t,lastActivity:e.lastActivity||t,segmentId:e.segmentId||0,sampled:e.sampled,previousSessionId:e.previousSessionId,dirty:e.dirty||!1}}function bM(e,t){return Py(e)?"session":t?"buffer":!1}function qf({sessionSampleRate:e,allowBuffering:t,stickySession:r=!1},{previousSessionId:n}={}){const o=My({sampled:bM(e,t),previousSessionId:n});return r&&Ii(o),o}function SM(){if(!Uu())return null;try{const e=Fe.sessionStorage.getItem(Tu);if(!e)return null;const t=JSON.parse(e);return oe&&se.infoTick("Loading existing session"),My(t)}catch{return null}}function sc(e,t,r=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=r}function _M(e,{maxReplayDuration:t,sessionIdleExpire:r,targetTime:n=Date.now()}){return sc(e.started,t,n)||sc(e.lastActivity,r,n)}function Ha(e,{sessionIdleExpire:t,maxReplayDuration:r}){return!(!_M(e,{sessionIdleExpire:t,maxReplayDuration:r})||e.sampled==="buffer"&&e.segmentId===0)}function cl({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:r},n){const o=n.stickySession&&SM();return o?Ha(o,{sessionIdleExpire:e,maxReplayDuration:t})?(oe&&se.infoTick("Session in sessionStorage is expired, creating new one..."),qf(n,{previousSessionId:o.id})):o:(oe&&se.infoTick("Creating new session"),qf(n,{previousSessionId:r}))}function xM(e){return e.type===ge.Custom}function $u(e,t,r){return jy(e,t)?(Oy(e,t,r),!0):!1}function EM(e,t,r){return jy(e,t)?Oy(e,t,r):Promise.resolve(null)}async function Oy(e,t,r){const{eventBuffer:n}=e;if(!n||n.waitForCheckout&&!r)return null;const o=e.recordingMode==="buffer";try{r&&o&&n.clear(),r&&(n.hasCheckout=!0,n.waitForCheckout=!1);const s=wM(t,e.getOptions().beforeAddRecordingEvent);return s?await n.addEvent(s):void 0}catch(s){if(!e.isEnabled())return e.handleException(s),null;const a=s&&s instanceof Hu,i=a?"eventBufferOverflow":"eventBufferError",l=me();if(l){const c=a?"buffer_overflow":"internal_sdk_error";l.recordDroppedEvent(c,"replay")}if(a&&o)return n.clear(),n.waitForCheckout=!0,null;e.handleException(s),await e.stop({reason:i})}}function jy(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const r=Du(t.timestamp);return r+e.timeouts.sessionIdlePause<Date.now()?!1:r>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(oe&&se.infoTick(`Skipping event with timestamp ${r} because it is after maxReplayDuration`),!1):!0}function wM(e,t){try{if(typeof t=="function"&&xM(e))return t(e)}catch(r){return oe&&se.exception(r,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}var Vf=100;function Ly(e,t,r){const n=e.getContext();t&&n.traceIds.size<Vf&&n.traceIds.add(t),r&&n.segmentNames.size<Vf&&n.segmentNames.add(r)}function kM(e){return t=>{e.isEnabled()&&Ly(e,t.trace_id,t.name||void 0)}}function Bu(e){return!e.type}function ac(e){return e.type==="transaction"}function IM(e){return e.type==="replay_event"}function Gf(e){return e.type==="feedback"}function CM(e){return(t,r)=>{if(!e.isEnabled()||!Bu(t)&&!ac(t))return;const n=r.statusCode;if(!(!n||n<200||n>=300)){if(ac(t)){RM(e,t);return}TM(e,t)}}}function RM(e,t){Ly(e,t.contexts?.trace?.trace_id,t.transaction)}function TM(e,t){const r=e.getContext();if(t.event_id&&r.errorIds.size<100&&r.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags?.replayId)return;const{beforeErrorSampling:n}=e.getOptions();typeof n=="function"&&!n(t)||ks(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(o){e.handleException(o)}})}function AM(e){return t=>{!e.isEnabled()||!Bu(t)||NM(e,t)}}function NM(e,t){const r=t.exception?.values?.[0]?.value;typeof r=="string"&&(r.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||r.match(/(does not match server-rendered HTML|Hydration failed because)/i))&&Cs(e,Kt({category:"replay.hydrate-error",data:{url:sn()}}))}function PM(e){const t=me();t&&t.on("beforeAddBreadcrumb",r=>MM(e,r))}function MM(e,t){if(!e.isEnabled()||!Dy(t))return;const r=OM(t);r&&Cs(e,r)}function OM(e){return!Dy(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?jM(e):Kt(e)}function jM(e){const t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return Kt(e);let r=!1;const n=t.map(o=>{if(!o)return o;if(typeof o=="string")return o.length>Ks?(r=!0,`${o.slice(0,Ks)}…`):o;if(typeof o=="object")try{const s=Yc(o,7);return JSON.stringify(s).length>Ks?(r=!0,`${JSON.stringify(s,null,2).slice(0,Ks)}…`):s}catch{}return o});return Kt({...e,data:{...e.data,arguments:n,...r?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function Dy(e){return!!e.category}function LM(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function Ua(){const e=je().getPropagationContext().dsc;e&&delete e.replay_id;const t=pt();if(t){const r=hn(t);delete r.replay_id}}function Yf(e){const t=je().getPropagationContext().dsc;t&&(t.replay_id=e);const r=pt();if(r){const n=hn(r);n.replay_id=e}}function DM(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:ge.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function FM(e,t){return e.recordingMode!=="buffer"||t.message===Au||!t.exception||t.type?!1:Py(e.getOptions().errorSampleRate)}function HM(e){return Object.assign((t,r)=>{if(e.session&&Ha(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&Ua(),!e.isEnabled()||e.isPaused())return t;if(IM(t))return delete t.breadcrumbs,t;if(!Bu(t)&&!ac(t)&&!Gf(t))return t;if(!e.checkAndHandleExpiredSession())return Ua(),t;if(Gf(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),DM(e,t),t;if(LM(t,r)&&!e.getOptions()._experiments.captureExceptions)return oe&&se.log("Ignoring error from rrweb internals",t),null;const n=FM(e,t);if((n||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),n&&e.recordingMode==="buffer"&&e.session?.sampled==="buffer"){const o=e.session;o.dirty=!0,e.getOptions().stickySession&&Ii(o)}return t},{id:"Replay"})}function Ci(e,t){return t.map(({type:r,start:n,end:o,name:s,data:a})=>{const i=e.throttledAddEvent({type:ge.Custom,timestamp:n,data:{tag:"performanceSpan",payload:{op:r,description:s,startTimestamp:n,endTimestamp:o,data:a}}});return typeof i=="string"?Promise.resolve(null):i})}function UM(e){const{from:t,to:r}=e,n=Date.now()/1e3;return{type:"navigation.push",start:n,end:n,name:r,data:{previous:t}}}function $M(e){return t=>{if(!e.isEnabled())return;const r=UM(t);r!==null&&(e.getContext().urls.push(r.name),e.triggerUserActivity(),e.addUpdate(()=>(Ci(e,[r]),!1)))}}function BM(e,t){return oe&&e.getOptions()._experiments.traceInternals?!1:dC(t,me())}function Fy(e,t){e.isEnabled()&&t!==null&&(BM(e,t.name)||e.addUpdate(()=>(Ci(e,[t]),!0)))}function Ri(e){if(!e)return;const t=new TextEncoder;try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const r=Jv(e);return t.encode(r).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function Hy(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function $a(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const r={...e._meta};return r.warnings=[...r.warnings||[],t],e._meta=r,e}function Uy(e,t){if(!t)return null;const{startTimestamp:r,endTimestamp:n,url:o,method:s,statusCode:a,request:i,response:l}=t;return{type:e,start:r/1e3,end:n/1e3,name:o,data:{method:s,statusCode:a,request:i,response:l}}}function rs(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function Ar(e,t,r){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!r)return{headers:e,size:t};const n={headers:e,size:t},{body:o,warnings:s}=zM(r);return n.body=o,s?.length&&(n._meta={warnings:s}),n}function ic(e,t){return Object.entries(e).reduce((r,[n,o])=>{const s=n.toLowerCase();return t.includes(s)&&e[n]&&(r[s]=o),r},{})}function zM(e){if(!e||typeof e!="string")return{body:e};const t=e.length>If,r=WM(e);if(t){const n=e.slice(0,If);return r?{body:n,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${n}…`,warnings:["TEXT_TRUNCATED"]}}if(r)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function WM(e){const t=e[0],r=e[e.length-1];return t==="["&&r==="]"||t==="{"&&r==="}"}function Ba(e,t){const r=qM(e);return Qt(r,t)}function qM(e,t=Fe.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(Fe.location.origin))return e;const r=new URL(e,t);if(r.origin!==new URL(t).origin)return e;const n=r.href;return!e.endsWith("/")&&n.endsWith("/")?n.slice(0,-1):n}async function VM(e,t,r){try{const n=Uy("resource.fetch",await YM(e,t,r));Fy(r.replay,n)}catch(n){oe&&se.exception(n,"Failed to capture fetch breadcrumb")}}function GM(e,t){const{input:r,response:n}=t,o=Ri(r?Xv(r):void 0),s=n?Hy(n.headers.get("content-length")):void 0;o!==void 0&&(e.data.request_body_size=o),s!==void 0&&(e.data.response_body_size=s)}async function YM(e,t,r){const n=Date.now(),{startTimestamp:o=n,endTimestamp:s=n}=t,{url:a,method:i,status_code:l=0,request_body_size:c,response_body_size:p}=e.data,d=Ba(a,r.networkDetailAllowUrls)&&!Ba(a,r.networkDetailDenyUrls);return{startTimestamp:o,endTimestamp:s,url:a,method:i,statusCode:l,request:d?JM(r,t.input,c):rs(c),response:await KM(d,r,t.response,p)}}function JM({networkCaptureBodies:e,networkRequestHeaders:t},r,n){const o=r?ZM(r,t):{};if(!e)return Ar(o,n,void 0);const s=Xv(r),[a,i]=Kv(s,se),l=Ar(o,n,a);return i?$a(l,i):l}async function KM(e,{networkCaptureBodies:t,networkResponseHeaders:r},n,o){if(!e&&o!==void 0)return rs(o);const s=n?$y(n.headers,r):{};if(!n||!t&&o!==void 0)return Ar(s,o,void 0);const[a,i]=await QM(n),l=XM(a,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:s});return i?$a(l,i):l}function XM(e,{networkCaptureBodies:t,responseBodySize:r,captureDetails:n,headers:o}){try{const s=e?.length&&r===void 0?Ri(e):r;return n?t?Ar(o,s,e):Ar(o,s,void 0):rs(s)}catch(s){return oe&&se.exception(s,"Failed to serialize response body"),Ar(o,r,void 0)}}async function QM(e){const t=eO(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await tO(t)]}catch(r){return r instanceof Error&&r.message.indexOf("Timeout")>-1?(oe&&se.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(oe&&se.exception(r,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function $y(e,t){const r={};return t.forEach(n=>{e.get(n)&&(r[n]=e.get(n))}),r}function ZM(e,t){return e.length===1&&typeof e[0]!="string"?Jf(e[0],t):e.length===2?Jf(e[1],t):{}}function Jf(e,t){if(!e)return{};const r=e.headers;return r?r instanceof Headers?$y(r,t):Array.isArray(r)?{}:ic(r,t):{}}function eO(e){try{return e.clone()}catch(t){oe&&se.exception(t,"Failed to clone response body")}}function tO(e){return new Promise((t,r)=>{const n=ks(()=>r(new Error("Timeout while trying to read response body")),500);rO(e).then(o=>t(o),o=>r(o)).finally(()=>clearTimeout(n))})}async function rO(e){return await e.text()}async function nO(e,t,r){try{const n=Uy("resource.xhr",sO(e,t,r));Fy(r.replay,n)}catch(n){oe&&se.exception(n,"Failed to capture xhr breadcrumb")}}function oO(e,t){const{xhr:r,input:n}=t;if(!r)return;const o=Ri(n),s=r.getResponseHeader("content-length")?Hy(r.getResponseHeader("content-length")):lO(r.response,r.responseType);o!==void 0&&(e.data.request_body_size=o),s!==void 0&&(e.data.response_body_size=s)}function sO(e,t,r){const n=Date.now(),{startTimestamp:o=n,endTimestamp:s=n,input:a,xhr:i}=t,{url:l,method:c,status_code:p=0,request_body_size:d,response_body_size:h}=e.data;if(!l)return null;if(!i||!Ba(l,r.networkDetailAllowUrls)||Ba(l,r.networkDetailDenyUrls))return{startTimestamp:o,endTimestamp:s,url:l,method:c,statusCode:p,request:rs(d),response:rs(h)};const m=i[Xr],g=m?ic(m.request_headers,r.networkRequestHeaders):{},S=ic(Qv(i),r.networkResponseHeaders),[b,_]=r.networkCaptureBodies?Kv(a,se):[void 0],[v,w]=r.networkCaptureBodies?aO(i):[void 0],E=Ar(g,d,b),T=Ar(S,h,v);return{startTimestamp:o,endTimestamp:s,url:l,method:c,statusCode:p,request:_?$a(E,_):E,response:w?$a(T,w):T}}function aO(e){const t=[];try{return[e.responseText]}catch(r){t.push(r)}try{return iO(e.response,e.responseType)}catch(r){t.push(r)}return oe&&se.warn("Failed to get xhr response body",...t),[void 0]}function iO(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&so(e))return[JSON.stringify(e)];if(!e)return[void 0]}catch(r){return oe&&se.exception(r,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return oe&&se.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function lO(e,t){try{return Ri(t==="json"&&so(e)?JSON.stringify(e):e)}catch{return}}function cO(e){const t=me();try{const{networkDetailAllowUrls:r,networkDetailDenyUrls:n,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:a}=e.getOptions(),i={replay:e,networkDetailAllowUrls:r,networkDetailDenyUrls:n,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:a};t&&t.on("beforeAddBreadcrumb",(l,c)=>uO(i,l,c))}catch{}}function uO(e,t,r){if(t.data)try{dO(t)&&fO(r)&&(oO(t,r),nO(t,r,e)),pO(t)&&hO(r)&&(GM(t,r),VM(t,r,e))}catch(n){oe&&se.exception(n,"Error when enriching network breadcrumb")}}function dO(e){return e.category==="xhr"}function pO(e){return e.category==="fetch"}function fO(e){return e?.xhr}function hO(e){return e?.input!==void 0}function mO(e){const t=me();Vv(WP(e)),_i($M(e)),PM(e),cO(e);const r=HM(e);T_(r),t&&(t.on("beforeSendEvent",AM(e)),t.on("afterSendEvent",CM(e)),t.on("createDsc",n=>{const o=e.getSessionId();o&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(n.replay_id=o)}),t.on("processSegmentSpan",kM(e)),t.on("spanStart",n=>{e.lastActiveSpan=n}),t.on("spanEnd",n=>{e.lastActiveSpan=n}),t.on("beforeSendFeedback",async(n,o)=>{const s=e.getSessionId();o?.includeReplay&&e.isEnabled()&&s&&n.contexts?.feedback&&(n.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),n.contexts.feedback.replay_id=s)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function gO(e){try{return Promise.all(Ci(e,[vO(Fe.performance.memory)]))}catch{return[]}}function vO(e){const{jsHeapSizeLimit:t,totalJSHeapSize:r,usedJSHeapSize:n}=e,o=Date.now()/1e3;return{type:"memory",name:"memory",start:o,end:o,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:r,usedJSHeapSize:n}}}}function yO(e,t,r){return bI(e,t,{...r,setTimeoutImpl:ks})}var ea=He.navigator;function bO(){return/iPhone|iPad|iPod/i.test(ea?.userAgent??"")||/Macintosh/i.test(ea?.userAgent??"")&&ea?.maxTouchPoints&&ea?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function SO(e){let t=!1;return(r,n)=>{try{if(!e.checkAndHandleExpiredSession()){oe&&se.warn("Received replay event after session expired.");return}const o=n||!t;t=!0,_O(r),e.clickDetector&&HP(e.clickDetector,r),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!$u(e,r,o))return!0;if(!o)return!1;const s=e.session;if(EO(e,o),e.recordingMode==="buffer"&&s&&e.eventBuffer&&!s.dirty){const a=e.eventBuffer.getEarliestTimestamp();a&&(oe&&se.log(`Updating session start time to earliest event in buffer to ${new Date(a)}`),s.started=a,e.getOptions().stickySession&&Ii(s))}return s?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}catch(o){e.handleException(o)}}}function _O(e){const t=e.data;if(!(e.type!==ge.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==le.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(const r of t.attributes){const n=jt.mirror.getNode(r.id),o=n&&jt.mirror.getMeta(n);if(!n||o?.type!==ki.Element)continue;const s={...o.attributes};let a=!1;for(const[i,l]of Object.entries(r.attributes))BP.has(i)&&(l===null?delete s[i]:s[i]=l,a=!0);a&&jt.mirror.add(n,{...o,attributes:s})}}function xO(e){const t=e.getOptions();return{type:ge.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function EO(e,t){!t||e.session?.segmentId!==0||$u(e,xO(e),!1)}function wO(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function kO(e,t,r,n){return Br(nv(e,mu(e),n,r),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function IO({recordingData:e,headers:t}){let r;const n=`${JSON.stringify(t)}
24
- `;if(typeof e=="string")r=`${n}${e}`;else{const o=new TextEncoder().encode(n);r=new Uint8Array(o.length+e.length),r.set(o),r.set(e,o.length)}return r}async function CO({client:e,scope:t,replayId:r,event:n}){const o={event_id:r,integrations:typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0};e.emit("preprocessEvent",n,o);const s=await Rm(e.getOptions(),n,o,t,e,Hr());if(!s)return null;e.emit("postprocessEvent",s,o),s.platform=s.platform||"javascript";const{name:a,version:i,settings:l}=e.getSdkMetadata()?.sdk||{};return s.sdk={...s.sdk,name:a||"sentry.javascript.unknown",version:i||"0.0.0",settings:l},s}async function RO({recordingData:e,replayId:t,segmentId:r,eventContext:n,timestamp:o,session:s}){const a=IO({recordingData:e,headers:{segment_id:r}}),{urls:i,errorIds:l,traceIds:c,segmentNames:p,initialTimestamp:d}=n,h=me(),m=je(),g=h?.getTransport(),S=h?.getDsn();if(!h||!g||!S||!s.sampled)return Promise.resolve({});const b=await CO({scope:m,client:h,replayId:t,event:{type:eN,replay_start_timestamp:d/1e3,timestamp:o/1e3,error_ids:l,trace_ids:c,segment_names:p,urls:i,replay_id:t,segment_id:r,replay_type:s.sampled}});if(!b)return h.recordDroppedEvent("event_processor","replay"),oe&&se.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete b.sdkProcessingMetadata;const _=kO(b,a,S,h.getOptions().tunnel);let v;try{v=await g.send(_)}catch(E){const T=new Error(Au);try{T.cause=E}catch{}throw T}const w=gv({},v);if(mv(w,"replay"))throw new zu(w);if(typeof v.statusCode=="number"&&(v.statusCode<200||v.statusCode>=300))throw new By(v.statusCode);return v}var By=class extends Error{constructor(e){super(`Transport returned status code ${e}`)}},zu=class extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}},Kf=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function zy(e,t={count:0,interval:aN}){const{recordingData:r,onError:n}=e;if(r.length)try{return await RO(e),!0}catch(o){if(o instanceof By||o instanceof zu)throw o;if(Lm("Replays",{_retryCount:t.count}),n&&n(o),t.count>=iN){const s=new Error(`${Au} - max retries exceeded`);try{s.cause=o}catch{}throw s}return t.interval*=++t.count,new Promise((s,a)=>{ks(async()=>{try{await zy(e,t),s(!0)}catch(i){a(i)}},t.interval)})}}var Wy="__THROTTLED",TO="__SKIPPED";function AO(e,t,r){const n=new Map,o=i=>{const l=i-r;n.forEach((c,p)=>{p<l&&n.delete(p)})},s=()=>[...n.values()].reduce((i,l)=>i+l,0);let a=!1;return(...i)=>{const l=Math.floor(Date.now()/1e3);if(o(l),s()>=t){const p=a;return a=!0,p?TO:Wy}a=!1;const c=n.get(l)||0;return n.set(l,c+1),e(...i)}}var NO=class{constructor({options:e,recordingOptions:t}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:tN,sessionIdleExpire:rN},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,segmentNames:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=t,this._options=e,this._debouncedFlush=yO(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=AO((s,a)=>EM(this,s,a),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:n}=this.getOptions(),o=r?{threshold:Math.min(lN,r),timeout:r,scrollTimeout:cN,ignoreSelector:n?n.join(","):""}:void 0;if(o&&(this.clickDetector=new jP(this,o)),oe){const s=e._experiments;se.setConfig({captureExceptions:!!s.captureExceptions,traceInternals:!!s.traceInternals})}this._handleVisibilityChange=()=>{Fe.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const s=Kt({category:"ui.blur"});this._doChangeToBackgroundTasks(s)},this._handleWindowFocus=()=>{const s=Kt({category:"ui.focus"});this._doChangeToForegroundTasks(s)},this._handleKeyboardEvent=s=>{YP(this,s)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){oe&&se.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){const{errorSampleRate:t,sessionSampleRate:r}=this._options,n=t<=0&&r<=0;if(this._requiresManualStart=n,!n){if(this._initializeSessionForSampling(e),!this.session){oe&&se.exception(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",oe&&se.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){oe&&se.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){oe&&se.log("Buffering is in progress, call `flush()` to save the replay");return}oe&&se.infoTick("Starting replay in session mode"),this._updateUserActivity();const e=cl({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){oe&&se.log("Buffering is in progress, call `flush()` to save the replay");return}oe&&se.infoTick("Starting replay in buffer mode");const e=cl({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const e=this._canvas;this._stopRecording=jt({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:sN}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:SO(this),...bO(),onMutation:this._onMutationHandler.bind(this),...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:t}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";const r=t??"manual";me()?.emit("replayEnd",{sessionId:this.session?.id,reason:r});try{oe&&se.log(`Stopping Replay triggered by ${r}`),Ua(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,vM(this)}catch(n){this.handleException(n)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),oe&&se.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),oe&&se.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const t=Date.now();oe&&se.log("Converting buffer to session"),await this.flushImmediate();const r=this.stopRecording();!e||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession(),Yf(this.session.id)),this.startRecording())}addUpdate(e){const t=e();this.recordingMode==="buffer"||!this._isEnabled||t!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(e){if(!(e&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&sc(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const e=`${Fe.location.pathname}${Fe.location.hash}${Fe.location.search}`,t=`${Fe.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){const r=this._throttledAddEvent(e,t);if(r===Wy){const n=Kt({category:"replay.throttled"});this.addUpdate(()=>!$u(this,{type:RP,timestamp:n.timestamp||0,data:{tag:"breadcrumb",payload:n,metric:!0}}))}return r}getCurrentRoute(){const e=this.lastActiveSpan||pt(),t=e&&mt(e),r=(t&&Ae(t).data||{})[hr];if(!(!t||!r||!["route","custom"].includes(r)))return Ae(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=hM({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&me()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode==="session"&&this.session&&Yf(this.session.id)}_initializeSessionForSampling(e){const t=this._options.errorSampleRate>0,r=cl({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=r}_checkSession(){if(!this.session)return!1;const e=this.session;return Ha(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(e),!1):!0}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(e.id))}_addListeners(){try{Fe.document.addEventListener("visibilitychange",this._handleVisibilityChange),Fe.addEventListener("blur",this._handleWindowBlur),Fe.addEventListener("focus",this._handleWindowFocus),Fe.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(mO(this),this._hasInitializedCoreListeners=!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=iM(this)}_removeListeners(){try{Fe.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Fe.removeEventListener("blur",this._handleWindowBlur),Fe.removeEventListener("focus",this._handleWindowFocus),Fe.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}_doChangeToBackgroundTasks(e){if(this.session){if(Ha(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){Ua();return}e&&this._createCustomBreadcrumb(e),this.conditionalFlush()}}_doChangeToForegroundTasks(e){if(this.session){if(!this.checkAndHandleExpiredSession()){oe&&se.log("Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:ge.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){let e=QP(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const t=this._context.initialTimestamp/1e3;e=e.filter(r=>r.start>=t)}return Promise.all(Ci(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.segmentNames.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:t}=this;if(!e||!t||this._requiresManualStart||e.segmentId)return;const r=t.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),segmentNames:Array.from(this._context.segmentNames),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){const e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){oe&&se.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await gO(this),!!this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Kf;const r=this._popEventContext(),n=this.session.segmentId++;this._maybeSaveSession(),await zy({replayId:e,recordingData:await this.eventBuffer.finish(),segmentId:n,eventContext:r,session:this.session,timestamp:t,onError:o=>this.handleException(o)})}catch(t){this.handleException(t),this.stop({reason:"sendError"});const r=me();if(r){let n;t instanceof zu?n="ratelimit_backoff":t instanceof Kf?n="invalid":n="send_error",r.recordDroppedEvent(n,"replay")}}}async _flush({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){oe&&se.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const t=this.session.started,r=Date.now()-t;this._debouncedFlush.cancel();const n=r<this._options.minReplayDuration,o=r>this._options.maxReplayDuration+5e3;if(n||o){oe&&se.log(`Session duration (${Math.floor(r/1e3)}s) is too ${n?"short":"long"}, not sending replay.`),n&&this._debouncedFlush();return}const s=this.eventBuffer;s&&this.session.segmentId===0&&!s.hasCheckout&&oe&&se.log("Flushing initial segment without checkout.");const a=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(i){this.handleException(i)}finally{this._flushLock=void 0,a&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Ii(this.session)}_onMutationHandler(e){const{ignoreMutations:t}=this._options._experiments;if(t?.length&&e.some(a=>{const i=wO(a.target),l=t.join(",");return i?.matches(l)}))return!1;const r=e.length,n=this._options.mutationLimit,o=this._options.mutationBreadcrumbLimit,s=n&&r>n;if(r>o||s){const a=Kt({category:"replay.mutations",data:{count:r,limit:s}});this._createCustomBreadcrumb(a)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}};function So(e,t){return[...e,...t].join(",")}function PO({mask:e,unmask:t,block:r,unblock:n,ignore:o}){return{maskTextSelector:So(e,[".sentry-mask","[data-sentry-mask]"]),unmaskTextSelector:So(t,[]),blockSelector:So(r,[".sentry-block","[data-sentry-block]","base","iframe[srcdoc]:not([src])"]),unblockSelector:So(n,[]),ignoreSelector:So(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function MO({el:e,key:t,maskAttributes:r,maskAllText:n,privacyOptions:o,value:s}){if(o.unmaskTextSelector&&e.matches(o.unmaskTextSelector))return s;const a=r.includes(t),i=n&&t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"");return a||i?s.replace(/[\S]/g,"*"):s}var Xf='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',OO=["content-length","content-type","accept"],jO=Symbol.for("sentry__originalRequestBody"),Qf=!1,Zf=!1;function LO(){if(typeof Request>"u"||Zf)return;const e=Request;try{const t=function(r,n){const o=new e(r,n);return n?.body!=null&&(o[jO]=n.body),o};t.prototype=e.prototype,He.Request=t,Zf=!0}catch{}}var DO=(e=>new FO(e)),FO=class{constructor({flushMinDelay:e=nN,flushMaxDelay:t=oN,minReplayDuration:r=uN,maxReplayDuration:n=Cf,stickySession:o=!0,useCompression:s=!0,workerUrl:a,_experiments:i={},maskAllText:l=!0,maskAllInputs:c=!0,blockAllMedia:p=!0,mutationBreadcrumbLimit:d=750,mutationLimit:h=1e4,slowClickTimeout:m=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:S=[],networkDetailDenyUrls:b=[],networkCaptureBodies:_=!0,networkRequestHeaders:v=[],networkResponseHeaders:w=[],mask:E=[],maskAttributes:T=["title","placeholder","aria-label"],unmask:I=[],block:C=[],unblock:L=[],ignore:y=[],maskFn:A,beforeAddRecordingEvent:N,beforeErrorSampling:W,onError:O,attachRawBodyFromRequest:G=!1}={}){this.name="Replay";const H=PO({mask:E,unmask:I,block:C,unblock:L,ignore:y});if(this._recordingOptions={maskAllInputs:c,maskAllText:l,maskInputOptions:{password:!0},maskTextFn:A,maskInputFn:A,maskAttributeFn:(X,j,U)=>MO({maskAttributes:T,maskAllText:l,privacyOptions:H,key:X,value:j,el:U}),...H,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:X=>{try{X.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!i.recordCrossOriginIframes},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(r,dN),maxReplayDuration:Math.min(n,Cf),stickySession:o,useCompression:s,workerUrl:a,blockAllMedia:p,maskAllInputs:c,maskAllText:l,mutationBreadcrumbLimit:d,mutationLimit:h,slowClickTimeout:m,slowClickIgnoreSelectors:g,networkDetailAllowUrls:S,networkDetailDenyUrls:b,networkCaptureBodies:_,networkRequestHeaders:eh(v),networkResponseHeaders:eh(w),beforeAddRecordingEvent:N,beforeErrorSampling:W,onError:O,attachRawBodyFromRequest:G,_experiments:i},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Xf}`:Xf,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Vn())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Qf}set _isInitialized(e){Qf=e}afterAllSetup(e){!Vn()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&LO(),this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(e){return this._replay?this._replay.stop({forceFlush:e?.flush??this._replay.recordingMode==="session",reason:"manual"}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(e){if(this._replay?.isEnabled())return this._replay.getSessionId(e)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(e){const t=this.getReplayId(!0);t&&(Ca(e,{"sentry.replay_id":t}),this.getRecordingMode()==="buffer"&&Ca(e,{"sentry._internal.replay_is_buffering":!0}))}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){const t=HO(this._initialOptions,e);this._replay=new NO({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{const t=e.getIntegrationByName("ReplayCanvas");if(!t)return;this._replay._canvas=t.getOptions()}catch{}}};function HO(e,t){const r=t.getOptions(),n={sessionSampleRate:0,errorSampleRate:0,...e},o=Bo(r.replaysSessionSampleRate),s=Bo(r.replaysOnErrorSampleRate);return o==null&&s==null&&hs(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(n.sessionSampleRate=o),s!=null&&(n.errorSampleRate=s),n}function eh(e){return[...OO,...e.map(t=>t.toLowerCase())]}function UO(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function qy(e){try{return new URL(e,ve.location.origin).href}catch{return}}function $O(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Vy(e){try{return new Headers(e)}catch{return}}var Gy={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function BO(e,t){const{traceFetch:r,traceXHR:n,shouldCreateSpanForRequest:o,enableHTTPTimings:s,tracePropagationTargets:a,onRequestSpanStart:i,onRequestSpanEnd:l}={...Gy,...t},c=typeof o=="function"?o:m=>!0,p=m=>WO(m,a),d={},h=e.getOptions().propagateTraceparent;r&&Su(m=>{const g=VC(m,c,p,d,{propagateTraceparent:h,onRequestSpanEnd:l});if(g){const S=qy(m.fetchData.url),b=S?rn(S).host:void 0,_=S?Bt(S):void 0;g.setAttributes({[lv]:_,[pi]:_,"server.address":b}),s&&th(g,e),i?.(g,{headers:m.headers})}}),n&&Yv(m=>{const g=qO(m,c,p,d,h,l);g&&(s&&th(g,e),i?.(g,{headers:Vy(m.xhr.__sentry_xhr_v3__?.request_headers)}))})}var zO=300;function th(e,t){const{url:r}=Ae(e).data;if(!r||typeof r!="string")return;let n=()=>{setTimeout(o)};if(rr(t)){const s=e.end.bind(e);e.end=a=>{const i=a??dt();let l=!1;const c=()=>{l||(l=!0,setTimeout(o),s(i),clearTimeout(p))};n=c;const p=setTimeout(c,zO)}}const o=an("resource",({entries:s})=>{s.forEach(a=>{$O(a)&&a.name.endsWith(r)&&(e.setAttributes(qv(a)),n())})})}function WO(e,t){const r=sn();if(r){let n,o;try{n=new URL(e,r),o=new URL(r).origin}catch{return!1}const s=n.origin===o;return t?Qt(n.toString(),t)||s&&Qt(n.pathname,t):s}else{const n=!!e.match(/^\/(?!\/)/);return t?Qt(e,t):n}}function qO(e,t,r,n,o,s){const a=e.xhr,i=a?.[Xr];if(!a||a.__sentry_own_request__||!i)return;const{url:l,method:c}=i,p=er()&&t(l);if(e.endTimestamp){const E=a.__sentry_xhr_span_id__;if(!E)return;const T=n[E];T&&(p&&i.status_code!==void 0&&(Um(T,i.status_code),T.end(),s?.(T,{headers:Vy(Qv(a)),error:e.error})),delete n[E]);return}const d=qy(l),h=rn(d||l),m=d?Bt(d):void 0,g=Bt(uC(l)),S=me(),b=!!pt(),_=b||!!S&&rr(S),v=p&&_?zr({name:`${c} ${g}`,attributes:{url:Bt(l),type:"xhr","http.method":c,"http.url":m,[pi]:m,"server.address":h?.host,[Ze]:"auto.http.browser",[yr]:"http.client",...h?.search&&{"http.query":h?.search},...h?.hash&&{"http.fragment":h?.hash}}}):new nn,w=av(v)&&b?void 0:v;return p&&!_&&S?.recordDroppedEvent("no_parent_span","span"),a.__sentry_xhr_span_id__=v.spanContext().spanId,n[a.__sentry_xhr_span_id__]=v,r(l)&&VO(a,er()&&_?w:void 0,o),S&&S.emit("beforeOutgoingRequestSpan",v,e),v}function VO(e,t,r){const{"sentry-trace":n,baggage:o,traceparent:s}=wv({span:t,propagateTraceparent:r});n&&GO(e,n,o,s)}function GO(e,t,r,n){const o=e.__sentry_xhr_v3__?.request_headers;if(!(o?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),n&&!o?.traceparent&&e.setRequestHeader("traceparent",n),r){const s=o?.baggage;(!s||!UO(s))&&e.setRequestHeader("baggage",r)}}catch{}}var rh=new WeakMap,nh=new WeakMap,YO=9e4,JO=["text/event-stream","application/x-ndjson","application/stream+json"],KO=()=>({name:"FetchStreamPerformance",setup(){rR(e=>{if(e.response){const t=rh.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);const r=nh.get(e.response);r&&clearTimeout(r)}}}),Su(e=>{if(e.endTimestamp&&e.response){const t=e.response.headers?.get("content-type")||"";if(e.response.headers?.get("content-length")||!JO.some(l=>t.startsWith(l)))return;const r=e.fetchData?.url||"",n=e.fetchData?.method||"GET",o=Jo(r),s=r.startsWith("data:")?Bt(r):o?xv(o):r,a=zr({name:`${n} ${s}`,startTime:e.endTimestamp,attributes:{url:Bt(r),"http.method":n,type:"fetch",[yr]:"http.client.stream",[Ze]:"auto.http.browser.stream"}});rh.set(e.response,a);const i=setTimeout(()=>{a.isRecording()&&a.end()},YO);nh.set(e.response,i)}})}}),XO="WebVitals",QO=(e={})=>{const t=new Set(e.ignore??[]);return{name:XO,setup(r){const n=rr(r),{enableStandaloneClsSpans:o,enableStandaloneLcpSpans:s}=e._experiments??{},a=n||t.has("cls")?void 0:o||!1,i=n||t.has("lcp")?void 0:s||!1,l=sT({recordClsStandaloneSpans:a,recordLcpStandaloneSpans:i,client:r}),c=new WeakSet;r.on("afterStartPageLoadSpan",p=>{c.add(p)}),r.on("spanEnd",p=>{c.delete(p)&&(l(),hT(p,{recordClsOnPageloadSpan:a===!1,recordLcpOnPageloadSpan:i===!1,spanStreamingEnabled:n}))}),n?(t.has("lcp")||NT(r),t.has("cls")||MT(r),t.has("inp")||jT()):t.has("inp")||IT()},afterAllSetup(){t.has("inp")||AT()}}};function ZO(){ve.document?ve.document.addEventListener("visibilitychange",()=>{const e=pt();if(!e)return;const t=mt(e);if(ve.document.hidden&&t){const r="cancelled",{op:n,status:o}=Ae(t);It&&z.log(`[Tracing] Transaction: ${r} -> since tab moved to the background, op: ${n}`),o||t.setStatus({code:2,message:r}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):It&&z.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var Yy="sentry_previous_trace",e1="sentry.previous_trace";function t1(e,{linkPreviousTrace:t,consistentTraceSampling:r}){const n=t==="session-storage";let o=n?o1():void 0;e.on("spanStart",a=>{if(mt(a)!==a)return;const i=je().getPropagationContext();o=r1(o,a,i),n&&n1(o)});let s=!0;r&&e.on("beforeSampling",a=>{if(!o)return;const i=je(),l=i.getPropagationContext();if(s&&l.parentSpanId){s=!1;return}i.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(lc(o.spanContext))},sampleRand:o.sampleRand}),a.parentSampled=lc(o.spanContext),a.parentSampleRate=o.sampleRate,a.spanAttributes={...a.spanAttributes,[D_]:o.sampleRate}})}function r1(e,t,r){const n=Ae(t);function o(){try{const i=Number(n.data?.["sentry.sample_rate"]??r.dsc?.sample_rate);return Number.isNaN(i)?0:i}catch{return 0}}const s={spanContext:t.spanContext(),startTimestamp:n.start_timestamp,sampleRate:o(),sampleRand:r.sampleRand};if(!e)return s;const a=e.spanContext;return a.traceId===n.trace_id?e:(Date.now()/1e3-e.startTimestamp<=3600&&(It&&z.log(`Adding previous_trace \`${JSON.stringify(a)}\` link to span \`${JSON.stringify({op:n.op,...t.spanContext()})}\``),t.addLink({context:a,attributes:{[F_]:"previous_trace"}}),t.setAttribute(e1,`${a.traceId}-${a.spanId}-${lc(a)?1:0}`)),s)}function n1(e){try{ve.sessionStorage.setItem(Yy,JSON.stringify(e))}catch(t){It&&z.warn("Could not store previous trace in sessionStorage",t)}}function o1(){try{const e=ve.sessionStorage?.getItem(Yy);return JSON.parse(e)}catch{return}}function lc(e){return e.traceFlags===1}var s1="BrowserTracing",a1=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function i1(){const e=ve.navigator;return e?.userAgent?a1.test(e.userAgent):!1}var l1={...ua,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Gy},c1=((e={})=>{"enableElementTiming"in e&&hs(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},r=ve.document,{enableInp:n,enableLongTask:o,enableLongAnimationFrame:s,_experiments:{enableInteractions:a,enableStandaloneClsSpans:i,enableStandaloneLcpSpans:l},beforeStartSpan:c,idleTimeout:p,finalTimeout:d,childSpanTimeout:h,markBackgroundSpan:m,traceFetch:g,traceXHR:S,trackFetchStreamPerformance:b,shouldCreateSpanForRequest:_,enableHTTPTimings:v,ignoreResourceSpans:w,ignorePerformanceApiSpans:E,instrumentPageLoad:T,instrumentNavigation:I,detectRedirects:C,linkPreviousTrace:L,consistentTraceSampling:y,enableReportPageLoaded:A,onRequestSpanStart:N,onRequestSpanEnd:W}={...l1,...e},O=i1();let G,H;function X(j,U,ee=!0,V){const ue=U.op==="pageload",P=U.name,$=c?c(U):U,Y=Jo(V||sn()),J={...Y?.pathname&&{"url.path":Y.pathname},...Y&&!fi(Y)&&{"url.full":Y.href},...$.attributes};if(P!==$.name&&(J[hr]="custom"),$.attributes=J,!ee){const Se=Za();zr({...$,startTime:Se}).end(Se);return}t.name=$.name,t.source=J[hr];const ae=iv($,{idleTimeout:p,finalTimeout:d,childSpanTimeout:h,disableAutoFinish:ue,beforeSpanEnd:Se=>{fT(Se,{ignoreResourceSpans:w,ignorePerformanceApiSpans:E,spanStreamingEnabled:rr(j)}),ah(j,void 0);const Oe=je(),Xe=Oe.getPropagationContext();Oe.setPropagationContext({...Xe,traceId:ae.spanContext().traceId,sampled:ei(ae),dsc:hn(Se)}),ue&&(H=void 0)},trimIdleSpanEndTimestamp:!A});ue&&A&&(H=ae),ah(j,ae);function ie(){r&&["interactive","complete"].includes(r.readyState)&&(j.emit("idleSpanEnableAutoFinish",ae),r.removeEventListener("readystatechange",ie))}ue&&!A&&r&&(r.addEventListener("readystatechange",ie),ie())}return{name:s1,setup(j){if(O){It&&z.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if($k(),s&&He.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?iT():o&&aT(),a&&lT(),C&&r){const ee=()=>{G=dt()};addEventListener("click",ee,{capture:!0}),addEventListener("keydown",ee,{capture:!0,passive:!0})}function U(){const ee=ns(j);ee&&!Ae(ee).timestamp&&(It&&z.log(`[Tracing] Finishing current active span with op: ${Ae(ee).op}`),ee.setAttribute(Ea,"cancelled"),ee.end())}j.on("startNavigationSpan",(ee,V)=>{if(me()!==j)return;if(V?.isRedirect){It&&z.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),X(j,{op:"navigation.redirect",...ee},!1,V.url);return}G=void 0,U();const ue=je();ue.setPropagationContext({traceId:Bm(),sampleRand:Math.random(),propagationSpanId:er()?void 0:Nl()}),ue.setSDKProcessingMetadata({normalizedRequest:void 0}),X(j,{op:"navigation",...ee,parentSpan:null,forceTransaction:!0},!0,V?.url)}),j.on("startPageLoadSpan",(ee,V={})=>{if(me()!==j)return;U();const ue=V.sentryTrace||oh("sentry-trace")||sh("sentry-trace"),P=V.baggage||oh("baggage")||sh("baggage"),$=W_(ue,P),Y=je();Y.setPropagationContext($),er()||(Y.getPropagationContext().propagationSpanId=Nl()),Y.setSDKProcessingMetadata({normalizedRequest:Ta()}),X(j,{op:"pageload",...ee})}),j.on("endPageloadSpan",()=>{A&&H&&(H.setAttribute(Ea,"reportPageLoaded"),H.end())})},afterAllSetup(j){if(O)return;j.addIntegration&&!j.getIntegrationByName?.("WebVitals")&&j.addIntegration(QO({ignore:n?[]:["inp"],_experiments:{enableStandaloneClsSpans:i,enableStandaloneLcpSpans:l}}));let U=sn();if(L!=="off"&&t1(j,{linkPreviousTrace:L,consistentTraceSampling:y}),ve.location){if(T){const ee=ot();u1(j,{name:ve.location.pathname,startTime:ee?ee/1e3:void 0,attributes:{[hr]:"url",[Ze]:"auto.pageload.browser"}})}I&&_i(({to:ee,from:V})=>{if(V===void 0&&U?.indexOf(ee)!==-1){U=void 0;return}U=void 0;const ue=Jo(ee),P=ns(j),$=P&&C&&f1(P,G);d1(j,{name:ue?.pathname||ve.location.pathname,attributes:{[hr]:"url",[Ze]:"auto.navigation.browser"}},{url:ee,isRedirect:$})})}m&&ZO(),a&&p1(j,p,d,h,t),BO(j,{traceFetch:g,traceXHR:S,tracePropagationTargets:j.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:_,enableHTTPTimings:v,onRequestSpanStart:N,onRequestSpanEnd:W}),b&&j.addIntegration(KO())}}});function u1(e,t,r){e.emit("startPageLoadSpan",t,r),je().setTransactionName(t.name);const n=ns(e);return n&&e.emit("afterStartPageLoadSpan",n),n}function d1(e,t,r){const{url:n,isRedirect:o}=r||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o,url:n}),e.emit("startNavigationSpan",t,{isRedirect:o,url:n});const s=je();return s.setTransactionName(t.name),n&&!o&&s.setSDKProcessingMetadata({normalizedRequest:{...Ta(),url:n}}),ns(e)}function oh(e){return ve.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function sh(e){return ve.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(t=>t.name===e)?.description}function p1(e,t,r,n,o){const s=ve.document;let a;const i=()=>{const l="ui.action.click",c=ns(e);if(c){const p=Ae(c).op;if(["navigation","pageload"].includes(p)){It&&z.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(a&&(a.setAttribute(Ea,"interactionInterrupted"),a.end(),a=void 0),!o.name){It&&z.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}a=iv({name:o.name,op:l,attributes:{[hr]:o.source||"url"}},{idleTimeout:t,finalTimeout:r,childSpanTimeout:n})};s&&addEventListener("click",i,{capture:!0})}var Jy="_sentry_idleSpan";function ns(e){return e[Jy]}function ah(e,t){qn(e,Jy,t)}var ih=1.5;function f1(e,t){const r=Ae(e),n=Za();return!(n-r.start_timestamp>ih||t&&n-t<=ih)}function h1(e){return wa(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function m1(e){const t={...e};Ev(t,"react"),Lm("react",{version:f.version});const r=ZA(t);return Fm(g1),r}function g1(e){return h1(e)?"[SyntheticEvent]":ry(e)}function Ky({className:e,type:t,...r}){return(0,u.jsx)("input",{type:t,"data-slot":"input",className:q("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/30 focus-visible:ring-2","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}function Wu(e){return e!=="system"?e:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}var cc="themeMode",Xy="themePreset",Qy="mcpjam-ui-playground-host-style",uc="mcpjam-ui-playground-host-capabilities-override",dc="mcpjam-ui-playground-chat-ui-override",Zy="mcpjam-auto-connect-servers",eb="mcpjam-auto-collapse-sidebar";function v1(){if(typeof window>"u")return Dd.id;try{const e=localStorage.getItem(Qy),t=g0(e);if(t)return t}catch(e){console.warn("Failed to read persisted host style:",e)}return Dd.id}function y1(){if(typeof window>"u")return!1;try{return localStorage.getItem(Zy)==="true"}catch(e){return console.warn("Failed to read persisted auto-connect setting:",e),!1}}function b1(){if(typeof window>"u")return!1;try{return localStorage.getItem(eb)==="true"}catch(e){return console.warn("Failed to read persisted sidebar auto-collapse:",e),!1}}function S1(){if(typeof window>"u")return;let e;try{e=localStorage.getItem(dc)}catch(t){console.warn("Failed to read persisted chat UI override:",t);return}if(e)try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}catch(t){console.warn("Failed to parse persisted chat UI override:",t);return}}function _1(){if(typeof window>"u")return;let e;try{e=localStorage.getItem(uc)}catch(t){console.warn("Failed to read persisted host capabilities override:",t);return}if(e)try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}catch(t){console.warn("Failed to parse persisted host capabilities override:",t);return}}var tb=e=>t0()(t=>({themeMode:e?.themeMode??"light",themePreference:e?.themePreference??e?.themeMode??"light",themePreset:e?.themePreset??"default",hostStyle:e?.hostStyle??v1(),hostCapabilitiesOverride:e?.hostCapabilitiesOverride!==void 0?e.hostCapabilitiesOverride:_1(),chatUiOverride:e?.chatUiOverride!==void 0?e.chatUiOverride:S1(),autoConnectServersEnabled:e?.autoConnectServersEnabled??y1(),autoCollapseSidebarEnabled:e?.autoCollapseSidebarEnabled??b1(),setThemeMode:r=>{try{localStorage.setItem(cc,r)}catch(n){console.warn("Failed to persist theme mode:",n)}t({themeMode:r,themePreference:r})},setThemePreference:r=>{try{localStorage.setItem(cc,r)}catch(n){console.warn("Failed to persist theme preference:",n)}t({themePreference:r,themeMode:Wu(r)})},setThemePreset:r=>{try{localStorage.setItem(Xy,r)}catch(n){console.warn("Failed to persist theme preset:",n)}t({themePreset:r})},setHostStyle:r=>{try{localStorage.setItem(Qy,r)}catch(n){console.warn("Failed to persist host style:",n)}t({hostStyle:r})},setHostCapabilitiesOverride:r=>{try{r===void 0?localStorage.removeItem(uc):localStorage.setItem(uc,JSON.stringify(r))}catch(n){console.warn("Failed to persist host capabilities override:",n)}t({hostCapabilitiesOverride:r})},setChatUiOverride:r=>{try{r===void 0?localStorage.removeItem(dc):localStorage.setItem(dc,JSON.stringify(r))}catch(n){console.warn("Failed to persist chat UI override:",n)}t({chatUiOverride:r})},setAutoConnectServersEnabled:r=>{try{localStorage.setItem(Zy,r?"true":"false")}catch(n){console.warn("Failed to persist auto-connect setting:",n)}t({autoConnectServersEnabled:r})},setAutoCollapseSidebarEnabled:r=>{try{localStorage.setItem(eb,r?"true":"false")}catch(n){console.warn("Failed to persist sidebar auto-collapse:",n)}t({autoCollapseSidebarEnabled:r})}})),x1=[{label:"Light",value:"light"},{label:"Dark",value:"dark"}],F$=x1.map(e=>e.value),rb=[{label:"Default",value:"default",primary:{light:"oklch(0.205 0 0)",dark:"oklch(0.922 0 0)"}},{label:"Brutalist",value:"brutalist",primary:{light:"oklch(0.6489 0.2370 26.9728)",dark:"oklch(0.7044 0.1872 23.1858)"}},{label:"Soft Pop",value:"soft-pop",primary:{light:"oklch(0.5106 0.2301 276.9656)",dark:"oklch(0.6801 0.1583 276.9349)"}},{label:"Tangerine",value:"tangerine",primary:{light:"oklch(0.64 0.17 36.44)",dark:"oklch(0.64 0.17 36.44)"}}],H$=rb.map(e=>e.value);function nb(){try{const e=localStorage.getItem(cc);if(e==="dark"||e==="light"||e==="system")return e}catch(e){console.warn("Cannot access localStorage for theme mode:",e)}return null}function U$(){return nb()!==null}function ob(){return nb()??"dark"}function $$(){return Wu(ob())}function lh(){return document.documentElement.classList.contains("dark")?"dark":"light"}function sb(e){const t=document.documentElement;t.classList.add("disable-transitions"),t.classList.toggle("dark",e==="dark"),requestAnimationFrame(()=>{t.classList.remove("disable-transitions")})}function B$(){try{const e=localStorage.getItem(Xy),t=rb.map(r=>r.value);if(e&&t.includes(e))return e}catch(e){console.warn("Cannot access localStorage for theme preset:",e)}return"default"}function z$(e){document.documentElement.setAttribute("data-theme-preset",e)}function Rs({...e}){return(0,u.jsx)(Wm,{"data-slot":"dialog",...e})}function ab({...e}){return(0,u.jsx)(mx,{"data-slot":"dialog-trigger",...e})}function E1({...e}){return(0,u.jsx)(Gm,{"data-slot":"dialog-portal",...e})}function W$({...e}){return(0,u.jsx)(Xm,{"data-slot":"dialog-close",...e})}function w1({className:e,...t}){return(0,u.jsx)(Ym,{"data-slot":"dialog-overlay",className:q("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-overlay",e),...t})}function Ts({className:e,children:t,showCloseButton:r=!0,...n}){return(0,u.jsxs)(E1,{"data-slot":"dialog-portal",children:[(0,u.jsx)(w1,{}),(0,u.jsxs)(Jm,{"data-slot":"dialog-content",className:q("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...n,children:[t,r&&(0,u.jsxs)(Xm,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,u.jsx)(ri,{}),(0,u.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function os({className:e,...t}){return(0,u.jsx)("div",{"data-slot":"dialog-header",className:q("flex flex-col gap-2 text-center sm:text-left",e),...t})}function ch({className:e,...t}){return(0,u.jsx)("div",{"data-slot":"dialog-footer",className:q("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function ln({className:e,...t}){return(0,u.jsx)(xx,{"data-slot":"dialog-title",className:q("text-lg leading-none font-semibold pb-1",e),...t})}function ss({className:e,...t}){return(0,u.jsx)(wx,{"data-slot":"dialog-description",className:q("text-muted-foreground text-sm",e),...t})}var qu=(0,f.createContext)({isEnsuringUser:!1,isUserReady:!1});function q$({children:e,isEnsuringUser:t=!1,isUserReady:r}){const n=Bi(s=>s.queriesPaused),o=Bi(s=>s.authConfirmed);return(0,f.useEffect)(()=>{r&&o&&Bi.getState().resumeQueries()},[r,o]),(0,u.jsx)(qu.Provider,{value:{isEnsuringUser:t,isUserReady:r&&!n},children:e})}function Ti(){return(0,f.useContext)(qu).isUserReady}function V$(){return(0,f.useContext)(qu)}function G$(e){return f.createElement(Yw,{flushSync:dx.flushSync,...e})}function pc({className:e,...t}){return(0,u.jsx)(Xx,{"data-slot":"switch",className:q("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,u.jsx)(Zx,{"data-slot":"switch-thumb",className:q("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}var ib=(0,f.createContext)(null),Y$=ib.Provider,k1={status:"loading",catalog:null,version:null,source:null};function uh(e){console.warn("[host-catalog] client catalog degraded",e);try{gm("host_catalog_degraded",{location:"host_catalog",...e})}catch{}}var ta=null,ul=null,dl=0;async function I1(){const e=await T0({baseUrl:"/api/v1",timeoutMs:8e3}).catch(()=>({ok:!1,reason:"network"}));return e.ok?(e.source==="bundled"&&uh({status:"fallback",source:e.source,version:e.version}),{status:e.source==="bundled"?"fallback":"live",catalog:e.catalog,version:e.version,source:e.source}):(uh({status:"error",reason:e.reason}),{status:"error",catalog:null,version:null,source:null})}function Vu(){const e=(0,f.useContext)(ib),[t,r]=(0,f.useState)(ta??k1);return(0,f.useEffect)(()=>{if(e)return;if(ta){r(ta);return}let n=!0;const o=dl;return ul||(ul=I1().then(s=>(o===dl&&(ta=s.status==="loading"?{status:"error",catalog:null,version:null,source:null}:s),s))),ul.then(s=>{n&&o===dl&&r(s)}),()=>{n=!1}},[e]),e??t}var fc=768;function C1(){return typeof window>"u"?!1:window.innerWidth<fc}function R1(){const[e,t]=f.useState(C1);return f.useEffect(()=>{const r=window.matchMedia("(max-width: 767px)"),n=()=>{t(window.innerWidth<fc)};return r.addEventListener("change",n),t(window.innerWidth<fc),()=>r.removeEventListener("change",n)},[]),e}var T1="web-clients-enabled",A1=["claude","chatgpt"],N1={claude:"claude-web",chatgpt:"chatgpt-web"},dh={claude:"web-claude",chatgpt:"web-chatgpt"},J$={claude:"Claude web",chatgpt:"ChatGPT web"},K$={claude:["https://claude.ai"],chatgpt:["https://chatgpt.com","https://auth.openai.com"]};function P1(e){return A1.find(t=>N1[t]===e)}function X$(e){return P1(e)!==void 0}var Q$={claude:"page-2026-11-20",chatgpt:"page-2026-11-20"},Gu={"claude-code":"claudeCode",codex:"codex","codex-cli":"codex","copilot-cli":"copilotCli","cursor-cli":"cursorCli",opencode:"openCode",[dh.claude]:"webClients",[dh.chatgpt]:"webClients"},lb=new Set(Object.keys(Gu));function M1(e,t){const r=Gu[e];return r===void 0?!0:t[r]}function Ai(e,t){return M1(e,t)===!0}function O1(e){const t=new Set;for(const r of Object.keys(Gu))Ai(r,e)||t.add(r);return t}function Z$(e,t){return e.filter(r=>Ai(r.hostId,t))}function e2(e,t){return e.filter(r=>Ai(r.id,t))}function t2(e,t){return e.filter(r=>Ai(r.id,t))}function ko(e,t,r){return{code:e,message:t,...r===void 0?{}:{details:r}}}var cb=class extends Error{code;details;constructor(e,t,r){super(t),this.name="InspectorCommandClientError",this.code=e,this.details=r}};function j1(e,t,r){return new cb(e,t,r)}var Ir=new Map,Do=new Map,L1=2e3;function D1(e){const t=Do.get(e);if(!(!t||t.size===0)){Do.delete(e);for(const r of t)r()}}function F1(e,t){return new Promise(r=>{const n=Do.get(e)??new Set;Do.set(e,n);const o=setTimeout(()=>{n.delete(s),n.size===0&&Do.delete(e),r(!1)},t),s=()=>{clearTimeout(o),r(!0)};n.add(s)})}function H1(e,t){const r=Ir.get(e)??[];return Ir.set(e,[...r,t]),D1(e),()=>{const n=Ir.get(e)?.filter(o=>o!==t)??[];if(n.length===0){Ir.delete(e);return}Ir.set(e,n)}}function U1(e){return(Ir.get(e)?.length??0)>0}async function $1(e){let t=Ir.get(e.type)??[];if(t.length===0&&await F1(e.type,L1)&&(t=Ir.get(e.type)??[]),t.length===0)return{id:e.id,status:"error",error:ko("unsupported_in_mode",`No Inspector handler is registered for "${e.type}".`)};let r=null;for(const n of[...t].reverse())try{const o=await n(e);return{id:e.id,status:"success",...o===void 0?{}:{result:o}}}catch(o){if(o instanceof cb){if(o.code==="unsupported_in_mode"){r=o;continue}return{id:e.id,status:"error",error:ko(o.code,o.message,o.details)}}return{id:e.id,status:"error",error:ko("execution_failed",o instanceof Error?o.message:"Unknown Inspector command error.")}}return{id:e.id,status:"error",error:ko(r?.code??"unsupported_in_mode",r?.message??`No Inspector handler is registered for "${e.type}".`,r?.details)}}function Yu(e,t){switch(e){case"never":return!1;case"always":return!0;case"setting":return t===!0}}var B1={chat:{applySwitch:!0,answer:"person"},eval:{applySwitch:!1,answer:"deny"},synthetic:{applySwitch:!0,answer:"deny"},api:{applySwitch:!1,answer:"deny"},event:{applySwitch:!1,answer:"deny"}};function r2(e){return B1[e]}var pr={listEventTypes:"mcpjam_list_event_types",subscribe:"mcpjam_subscribe_to_events",update:"mcpjam_update_event_subscription",listSubscriptions:"mcpjam_list_event_subscriptions",delete:"mcpjam_delete_event_subscription"},z1=new Set(Object.values(pr));function W1(e){return z1.has(e)}var q1=new Set([pr.subscribe,pr.update,pr.delete]);function n2(e,t){return q1.has(e)&&Yu("setting",t)}function hc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function cr(e,t,r,n=!1){const o=e[t];if(!(n&&o===void 0)){if(typeof o!="string"||o.trim().length===0){r.push(`\`${t}\` must be a non-empty string`);return}return o.trim()}}function ph(e,t,r=!1){const n=e.triggers;if(r&&n===void 0)return;if(!Array.isArray(n)||n.length===0){t.push("`triggers` must be an array with one {event, params} trigger");return}if(n.length>1){t.push("`triggers` takes one trigger per subscription; create another subscription for a second event");return}const[o]=n;if(!hc(o)){t.push("`triggers[0]` must be an object with `event` and `params`");return}const s=cr(o,"event",t),a=o.params===void 0?{}:o.params;if(!hc(a)){t.push("`triggers[0].params` must be a JSON object");return}return s===void 0?void 0:{event:s,params:a}}function o2(e,t){const r=hc(t)?t:t===void 0?{}:null;if(!r)return{ok:!1,error:"The tool input must be a JSON object."};const n=[];let o;switch(e){case pr.listEventTypes:{const s=cr(r,"server",n,!0);o={tool:"list_event_types",...s?{server:s}:{}};break}case pr.subscribe:{const s=cr(r,"server",n),a=cr(r,"title",n),i=cr(r,"prompt",n),l=ph(r,n);s&&a&&i&&l&&(o={tool:"subscribe",server:s,title:a.slice(0,120),prompt:i,trigger:l});break}case pr.update:{const s=cr(r,"subscription_id",n),a=cr(r,"title",n,!0),i=cr(r,"prompt",n,!0),l=ph(r,n,!0),c=r.is_enabled;c!==void 0&&typeof c!="boolean"&&n.push("`is_enabled` must be true or false"),c===void 0&&r.title===void 0&&r.prompt===void 0&&r.triggers===void 0&&n.push("send at least one of `is_enabled`, `title`, `prompt` or `triggers`"),s&&(o={tool:"update",subscriptionId:s,...typeof c=="boolean"?{isEnabled:c}:{},...a?{title:a.slice(0,120)}:{},...i?{prompt:i}:{},...l?{trigger:l}:{}});break}case pr.listSubscriptions:o={tool:"list_subscriptions"};break;case pr.delete:{const s=cr(r,"subscription_id",n);s&&(o={tool:"delete",subscriptionId:s});break}}return n.length>0||!o?{ok:!1,error:`Fix the input and call ${e} again: ${n.join("; ")}.`}:{ok:!0,call:o}}var V1=/^app_[a-z0-9]{8}$/i,G1=/^page_[a-z0-9]{8}$/i,Y1=/^ui_[a-z0-9][a-z0-9_]{0,60}$/;function J1(e){return V1.test(e)}function ub(e){return Y1.test(e)}function K1(e){return G1.test(e)}var X1="setting";function s2(e){return Yu(X1,e)}function a2(e){return J1(e)||ub(e)||K1(e)||W1(e)}function i2(e){return Yu(Q1(e),e.requireToolApproval===!0)}function Q1(e){const{annotations:t}=e;return t?t.destructiveHint===!0?"setting":e.readOnly||t.readOnlyHint===!0?"never":"setting":e.readOnly?"never":"setting"}var l2="browser",Z1=new Set(["browser_observe","browser_webmcp_tools"]),ej=new Set(["browser_navigate","browser_act","browser_tabs","browser_webmcp_invoke"]),c2=[...ej,...Z1],fh=64,tj=512,rj=8192,nj=tx((e,t)=>({tools:new Map,globalNames:new Set,ownerTokens:new Map,shippedNames:new Set,registerUiTool:(r,n)=>{if(!ub(r.name))throw new Error(`[webmcp] UI tool name "${r.name}" must match ui_[a-z0-9][a-z0-9_]* (max 64 chars).`);if(r.annotations?.readOnlyHint!==void 0&&r.annotations.readOnlyHint!==r.readOnly)throw new Error(`[webmcp] UI tool "${r.name}" has readOnly=${r.readOnly} but annotations.readOnlyHint=${r.annotations.readOnlyHint}; they must agree.`);if(n?.signal?.aborted)return()=>{};t().tools.get(r.name)&&console.warn(`[webmcp] UI tool "${r.name}" re-registered; replacing.`);const o=Symbol(r.name);e(a=>{const i=new Map(a.tools);i.set(r.name,r);const l=new Set(a.globalNames);n?.scope==="global"?l.add(r.name):l.delete(r.name);const c=new Map(a.ownerTokens);return c.set(r.name,o),{tools:i,globalNames:l,ownerTokens:c}});const s=()=>{t().ownerTokens.get(r.name)===o&&t().unregisterUiTool(r.name)};return n?.signal?.addEventListener("abort",s,{once:!0}),s},unregisterUiTool:r=>{t().tools.has(r)&&e(n=>{const o=new Map(n.tools);o.delete(r);const s=new Set(n.globalNames);s.delete(r);const a=new Map(n.ownerTokens);return a.delete(r),{tools:o,globalNames:s,ownerTokens:a}})},resolve:r=>t().tools.get(r)??null,snapshotForChatBody:()=>{const r=[];let n=0;const{tools:o,globalNames:s}=t(),a=[...o.values()],i=[...a.filter(l=>s.has(l.name)),...a.filter(l=>!s.has(l.name))];for(const l of i){if(r.length>=fh){n+=1;continue}let c=l.inputSchema;if(c){let p=0;try{p=new TextEncoder().encode(JSON.stringify(c)).length}catch{continue}if(p>rj)continue}r.push({name:l.name,description:l.description.slice(0,tj),inputSchema:c,readOnly:l.readOnly,...l.annotations?{annotations:l.annotations}:{}})}return n>0&&console.warn(`[webmcp] UI tools snapshot capped at ${fh} entries; dropped ${n}.`),r.length>0&&e(l=>{const c=new Set(l.shippedNames);for(const p of r)c.add(p.name);return{shippedNames:c}}),r},wasShipped:r=>t().shippedNames.has(r)}));function u2(e){return e.nativePublication?.kind==="publish"}var Fo=new Map,ga=8192,hh=2e3;function oj(e,t){return Fo.set(e,t),()=>{Fo.get(e)===t&&Fo.delete(e)}}function sj(){return[...Fo.keys()].sort()}var db=Symbol("snapshot-too-large"),aj=ga*2;function ij(e){let t=0;return JSON.stringify(e,(r,n)=>{if(typeof n=="string"?t+=n.length:(typeof n=="number"||typeof n=="boolean")&&(t+=8),t>aj)throw db;return n})}function lj(e){let t;try{t=ij(e)}catch(r){return r===db?{truncated:!0,note:`Snapshot exceeded the ${ga}-char budget and was dropped to protect the main thread.`}:{error:"snapshot is not JSON-serializable"}}return t===void 0?{empty:!0}:t.length<=8192?e:{truncated:!0,note:`Snapshot exceeded ${ga} chars and was truncated.`,preview:t.slice(0,ga)}}async function cj(e){const t=Fo.get(e);if(!t)return{ok:!1,reason:"no_provider",error:`No snapshot provider for "${e}".`};let r;try{return{ok:!0,data:lj(await Promise.race([Promise.resolve().then(()=>t()),new Promise((n,o)=>{r=setTimeout(()=>o(new Error(`Snapshot for "${e}" timed out after ${hh}ms.`)),hh)})]))}}catch(n){return{ok:!1,reason:"failed",error:n instanceof Error?n.message:String(n)}}finally{r&&clearTimeout(r)}}async function d2(){const e=sj(),t=await Promise.all(e.map(async n=>{const o=await cj(n);return[n,o.ok?o.data:{error:o.error}]})),r={};for(const[n,o]of t)r[n]=o;return r}function uj(e,t){try{gm("ui_navigation_rejected",{location:"webmcp",segment:t==="unknown"?"unrecognized":e,reason:t})}catch{}}function dj(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`ui_${Date.now()}_${Math.random().toString(36).slice(2,10)}`}async function Ce(e){const t={...e,id:e.id??dj()},r=t.timeoutMs??3e4;let n;try{return await Promise.race([$1(t),new Promise(o=>{n=setTimeout(()=>{o({id:t.id,status:"error",error:ko("timeout",`Inspector command "${t.type}" timed out after ${r}ms. The action may still complete in the UI — observe state (e.g. ui_snapshot_app) before retrying instead of re-running it blindly.`)})},r)})])}finally{clearTimeout(n)}}function Re(e){return e.status==="success"?{ok:!0,data:e.result}:{ok:!1,error:`${e.error.code}: ${e.error.message}`}}function pj(){const e=_0();return e.sort()}function fj(e){const t=e?.trim()??"";if(!t)return{ok:!1,reason:"Navigation target is empty."};const r=t.replace(/^#/,"").replace(/^\/+/,"").split(/[/?]/)[0]||"servers",n=K0(r);return m0(n)?{ok:!0,path:w0(t),tab:n}:(uj(n,"unknown"),{ok:!1,reason:`Unknown navigation target "${e}". Valid targets: ${pj().join(", ")}.`})}async function p2(e){const t=fj(e);return t.ok?Re(await Ce({type:"navigate",payload:{target:t.path}})):{ok:!1,error:t.reason}}async function f2(e){return Re(await Ce({type:"selectServer",payload:{serverName:e}}))}async function hj(e){return Re(await Ce({type:"openPlayground",payload:e?{serverName:e}:{}}))}var pb=2e5;function h2(e,t=65536,r=pb){let n=0,o=0;const s=Symbol("over-cap");try{return JSON.stringify(e,(a,i)=>{if(o+=1,o>r)throw s;if(typeof i=="string"){if(n+=i.length,n>t)throw s}else if((typeof i=="number"||typeof i=="boolean")&&(n+=8,n>t))throw s;return i}),{bytes:n,truncated:!1}}catch(a){return a===s?{bytes:Math.min(n,t)||t,truncated:!0}:{bytes:0,truncated:!1}}}var Ju=16384;function fb(e){return e.length<=16384?e:`${e.slice(0,Ju)}… [truncated]`}function m2(e,t=Ju,r=pb){let n=0,o=0;const s=Symbol("over-budget");try{const a=JSON.stringify(e,function(i,l){if(o+=1,o>r)throw s;if(n+=Array.isArray(this)?1:i.length+4,typeof l=="string"){const c=t-n-2;if(c<=0)throw s;return n+=Math.min(l.length,c)+2,l.length>c?`${l.slice(0,c)}…`:l}if(l===null?n+=4:typeof l=="object"?n+=2:(typeof l=="number"||typeof l=="boolean")&&(n+=String(l).length),n>t)throw s;return l});return a===void 0||a.length>t?null:a}catch{return null}}var ze={kind:"publish",untrustedContent:!1},as={kind:"publish",untrustedContent:!0};function mj(e){return{kind:"publish",untrustedContent:e.untrustedContent,consequential:!0}}function g2(e){return{kind:"internal",reason:e}}var pl=Ju*2;function gj(e){let t=0;const r=Symbol("over-budget");try{return JSON.stringify(e,function(n,o){if(typeof o=="string"){if(t+=o.length,t>pl)throw r;return o}if((typeof o=="number"||typeof o=="boolean")&&(t+=8,t>pl))throw r;return o})}catch(n){if(n===r)return JSON.stringify(e)?.slice(0,pl)??"";throw n}}function vj(e){let t;try{t=gj(e===void 0?{ok:!0}:{ok:!0,data:e})}catch{t=JSON.stringify({ok:!0,note:"Result was not serializable."})}return{content:[{type:"text",text:fb(t)}]}}function ce(e){return{content:[{type:"text",text:fb(e)}],isError:!0}}function Pe(e){return e.ok?vj(e.data):ce(e.error)}function _e(e){if(typeof e!="string")return;const t=e.trim();return t.length>0?t:void 0}function hb(e){if(e===void 0)return{ok:!0};if(typeof e!="object"||e===null||Array.isArray(e))return{ok:!1};const t={};for(const[r,n]of Object.entries(e)){if(typeof n!="string")return{ok:!1};t[r]=n}return{ok:!0,record:t}}async function v2(e,t){if(U1(e))return null;const r=await hj(t);return r.ok?null:ce(`Could not open the playground first: ${r.error}`)}var fl={type:"string",description:"Server as shown on its card: display name (e.g. 'Asana') or a directory entry's catalog name."},mh={type:"string",enum:["text","app"],description:"Which entry of a dual-type card (Text and App) to target. Required when the card offers both."};function gh(e){return e===void 0?{ok:!0}:e==="text"||e==="app"?{ok:!0,variant:e}:{ok:!1}}function yj(){return[{name:"ui_connect_registry_server",description:"Install a server from a connector directory on this screen into the current project and start connecting it. Catalog entries only: for a server ALREADY in the project use ui_connect_server. It finishes in the background; watch ui_snapshot_app. Some entries are reported, not started: 'authorization_required' (it would redirect the browser) and 'endpoint_choice_required' (the URL is the user's to pick). Relay those; the user clicks Connect on the card.",inputSchema:{type:"object",properties:{serverName:fl,variant:mh},required:["serverName"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},nativePublication:as,mayNavigate:!0,execute:async e=>{const t=_e(e.serverName);if(!t)return ce("Missing required 'serverName' string.");const r=gh(e.variant);if(!r.ok)return ce(`'variant' must be "text" or "app" when provided.`);const n=await Ce({type:"connectRegistryServer",payload:{serverName:t,...r.variant?{variant:r.variant}:{}}});return Pe(Re(n))}},{name:"ui_disconnect_registry_server",description:"Disconnect a server that was installed from the registry and remove it from the current project. The catalog entry stays in the registry, so it can be reinstalled any time with ui_connect_registry_server. For a project server that did not come from the registry, use ui_disconnect_server.",inputSchema:{type:"object",properties:{serverName:fl,variant:mh},required:["serverName"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},nativePublication:ze,execute:async e=>{const t=_e(e.serverName);if(!t)return ce("Missing required 'serverName' string.");const r=gh(e.variant);if(!r.ok)return ce(`'variant' must be "text" or "app" when provided.`);const n=await Ce({type:"disconnectRegistryServer",payload:{serverName:t,...r.variant?{variant:r.variant}:{}}});return Pe(Re(n))}},{name:"ui_toggle_registry_star",description:"Star or unstar a registry server for the user. 'starred' is the explicit target state — true stars the card, false unstars it, and a card already in that state is left unchanged.",inputSchema:{type:"object",properties:{serverName:fl,starred:{type:"boolean",description:"Target state: true to star, false to unstar."}},required:["serverName","starred"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.serverName);if(!t)return ce("Missing required 'serverName' string.");if(typeof e.starred!="boolean")return ce("Missing required 'starred' boolean.");const r=await Ce({type:"toggleRegistryStar",payload:{serverName:t,starred:e.starred}});return Pe(Re(r))}},{name:"ui_search_registry_directory",description:"Search the Claude connector directory. Thousands of entries, far more than the page lists. Matches names, descriptions and tool/skill names, so 'invoice' and 'create_issue' work as well as 'Linear'. Omit 'query' to browse. Drives the screen's own controls, so results are what the user sees. Read them from ui_snapshot_app's `directory` block, then install with ui_connect_registry_server.",inputSchema:{type:"object",properties:{query:{type:"string",description:"What to search for. Omit or leave empty to browse the directory."},source:{type:"string",enum:["anthropic-directory"],description:"The Claude directory. Omit to keep the view on screen."},tier:{type:"string",enum:["all","anthropic","partner","community"],description:"Verification tier. Claude directory only; 'all' clears it."}},required:[],additionalProperties:!1},readOnly:!0,annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:as,execute:async e=>{const t=_e(e.query),r=_e(e.tier),n=_e(e.source);if(e.tier!==void 0&&!r)return ce("'tier' must be a non-empty string when provided.");if(e.source!==void 0&&!n)return ce("'source' must be a non-empty string when provided.");const o=await Ce({type:"searchRegistryDirectory",payload:{...t?{query:t}:{},...n?{source:n}:{},...r?{tier:r}:{}}});return Pe(Re(o))}}]}var hl={type:"string",description:"Eval suite as the Evaluate screen shows it: its name (e.g. 'Asana smoke tests') or its suite id."};function ml(e){return _e(e)??null}function bj(){return[{name:"ui_open_eval_suite_form",description:"Open the create-suite dialog on the Evaluate screen for the user to fill in and submit. Optionally prefills the suite name — nothing else. This only prepares the form; it never creates the suite (the user picks servers/hosts and submits). To act on an existing suite, use the run/generate/delete eval tools instead.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Optional suite name to prefill in the dialog."}},additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,mayNavigate:!0,execute:async e=>{const t=_e(e.name);if(e.name!==void 0&&t===void 0)return ce("'name' must be a non-empty string when provided.");const r=await Ce({type:"openEvalSuiteForm",payload:{...t?{name:t}:{}}});return Pe(Re(r))}},{name:"ui_run_eval_suite",description:"Start a run of an existing eval suite — real model and MCP tool calls that SPEND the organization's eval iteration quota (same gate as the Run button; an exhausted quota is reported as an error, and the run is refused). Each case runs `iterations` times; when omitted, the run uses the count the Set up run screen would start at, never the per-case saved defaults. The result reports the count used. The run continues in the background; observe progress with ui_snapshot_app.",inputSchema:{type:"object",properties:{suite:hl,iterations:{type:"integer",minimum:1,maximum:10,description:"Optional runs per case (1-10). Raised to the suite's minimum when lower. Omit to use the Set up run default."}},required:["suite"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},nativePublication:ze,mayNavigate:!0,execute:async e=>{const t=ml(e.suite);if(!t)return ce("Missing required 'suite' string.");const r=e.iterations;if(r!==void 0&&typeof r!="number")return ce("'iterations' must be a whole number from 1 to 10.");const n=await Ce({type:"runEvalSuite",payload:{suite:t,...r!==void 0?{iterations:r}:{}}});return Pe(Re(n))}},{name:"ui_cancel_eval_run",description:"Cancel an in-progress eval run by its run id (full id, or the shortened id the runs list displays). Cancelling stops work and spends nothing; a run that already finished is reported as such.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"The run to cancel: its id, full or as shown in the runs list."}},required:["runId"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.runId);if(!t)return ce("Missing required 'runId' string.");const r=await Ce({type:"cancelEvalRun",payload:{runId:t}});return Pe(Re(r))}},{name:"ui_generate_eval_tests",description:"Generate suggested test cases for an existing eval suite using an LLM over the suite's connected servers. SPENDS MONEY and adds the generated cases to the suite. Generation runs in the background; new cases appear in the suite's case list (check with ui_snapshot_app). A suite that runs several environments with different servers generates for one of them: pass 'environment'.",inputSchema:{type:"object",properties:{suite:hl,environment:{type:"string",description:"For a suite whose environments connect different servers: the environment to generate for, by id or by name as ui_snapshot_app lists it under selectedSuite.environments. Omit otherwise."}},required:["suite"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},nativePublication:ze,execute:async e=>{const t=ml(e.suite);if(!t)return ce("Missing required 'suite' string.");const r=_e(e.environment),n=await Ce({type:"generateEvalTests",payload:{suite:t,...r?{environment:r}:{}}});return Pe(Re(n))}},{name:"ui_edit_eval_case_draft",description:"Edit the test case CURRENTLY OPEN in the case editor (e.g. the 'Describe a case' workspace) — there is no suite/case id to pass, it always targets whatever case is on screen. Set 'prompt' to (re)write the case's user-turn prompt, 'addToolAssertion' to add a check that a specific tool was called with given arguments, or 'noTool' to mark the case as expecting no tool call. Fails with an error if no case is currently open for editing.",inputSchema:{type:"object",properties:{prompt:{type:"string",description:"The user prompt this case's first turn should send. Replaces whatever prompt the case already had."},addToolAssertion:{type:"object",description:"Add a check that the given tool was called with these arguments.",properties:{toolName:{type:"string"},arguments:{type:"object",description:"Expected arguments, as a plain object."}},required:["toolName"],additionalProperties:!1},noTool:{type:"boolean",description:"Mark the case as expecting no tool call at all."}},additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.prompt);if(e.prompt!==void 0&&t===void 0)return ce("'prompt' must be a non-empty string when provided.");let r;if(e.addToolAssertion!==void 0){const o=e.addToolAssertion;if(typeof o!="object"||o===null||Array.isArray(o))return ce("'addToolAssertion' must be an object.");const s=_e(o.toolName);if(!s)return ce("'addToolAssertion.toolName' is required and must be a non-empty string.");const a=o.arguments;if(a!==void 0&&(typeof a!="object"||a===null||Array.isArray(a)))return ce("'addToolAssertion.arguments' must be an object when provided.");r={toolName:s,...a?{arguments:a}:{}}}if(e.noTool!==void 0&&typeof e.noTool!="boolean")return ce("'noTool' must be a boolean when provided.");if(t===void 0&&r===void 0&&e.noTool===void 0)return ce("Provide at least one of 'prompt', 'addToolAssertion', or 'noTool'.");const n=await Ce({type:"editEvalCaseDraft",payload:{...t!==void 0?{prompt:t}:{},...r?{addToolAssertion:r}:{},...e.noTool!==void 0?{noTool:e.noTool}:{}}});return Pe(Re(n))}},{name:"ui_delete_eval_suite",description:"Permanently delete an existing eval suite, including its test cases and run history. Irreversible — be sure the user wants this exact suite gone. The suite is addressed by name or id, exactly as shown on the Evaluate screen.",inputSchema:{type:"object",properties:{suite:hl},required:["suite"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=ml(e.suite);if(!t)return ce("Missing required 'suite' string.");const r=await Ce({type:"deleteEvalSuite",payload:{suite:t}});return Pe(Re(r))}}]}var Sj={type:"string",description:"Persona as the Personas list shows it: its name (e.g. 'Impatient buyer') or its id."},_j={type:"string",description:"Goal as its card shows it: the goal text (e.g. 'Book a flight to Tokyo') or the goal id. Must belong to the currently selected persona."},vh="Launch a run of one existing goal: its sessions per host run on each of its hosts, making REAL model and MCP tool calls that SPEND the organization's quota (the same gate as the Run goal button: a quota or billing refusal comes back as an error and nothing runs). The goal must belong to the currently selected persona. The run continues in the background; ui_snapshot_app shows its progress.";function yh(e,t){return{name:e,description:t,inputSchema:{type:"object",properties:{journey:_j},required:["journey"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},nativePublication:ze,execute:async r=>{const n=_e(r.journey);if(!n)return ce("Missing required 'journey' string.");const o=await Ce({type:"launchSwarmRun",payload:{journey:n}});return Pe(Re(o))}}}function xj(){return[{name:"ui_create_persona",description:"Create a persona on the Swarms screen — a simulated user a goal runs as. Takes a short name and a role (e.g. 'QA tester', 'first-time customer'), plus optional free-text notes describing personality. Low-entropy, so this creates the persona directly and selects it. Goals and runs for the persona are added afterward.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Short display name for the persona."},role:{type:"string",description:"The persona's role (e.g. 'QA tester')."},notes:{type:"string",description:"Optional personality / behavior notes."}},required:["name","role"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.name),r=_e(e.role);if(!t)return ce("Missing required 'name' string.");if(!r)return ce("Missing required 'role' string.");const n=_e(e.notes);if(e.notes!==void 0&&typeof e.notes!="string")return ce("'notes' must be a string when provided.");const o=await Ce({type:"createPersona",payload:{name:t,role:r,...n?{notes:n}:{}}});return Pe(Re(o))}},{name:"ui_open_journey_form",description:"Open the new-goal form on the Swarms screen for the user to fill in and submit. A goal picks which HOSTS it runs against and how many sessions per host — high-entropy choices, so this only prepares the form; it never creates the goal. Optionally selects a persona and prefills the goal text. To START a goal that already exists, use ui_launch_goal_run instead.",inputSchema:{type:"object",properties:{persona:Sj,goal:{type:"string",description:"Optional goal text to prefill (what the persona is trying to accomplish)."}},additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.persona);if(e.persona!==void 0&&t===void 0)return ce("'persona' must be a non-empty string when provided.");const r=_e(e.goal);if(e.goal!==void 0&&r===void 0)return ce("'goal' must be a non-empty string when provided.");const n=await Ce({type:"openJourneyForm",payload:{...t?{persona:t}:{},...r?{goal:r}:{}}});return Pe(Re(n))}},yh("ui_launch_goal_run",vh),yh("ui_launch_swarm_run",`Old name for ui_launch_goal_run, kept for agents that still call it. ${vh}`)]}var ra={type:"string",description:"Host as the Hosts list shows it: its name (e.g. 'Claude') or its host id."};function Ej(e){if(!Array.isArray(e))return{ok:!1};const t=[];for(const r of e){const n=_e(r);if(!n)return{ok:!1};t.push(n)}return{ok:!0,names:t}}function wj(){return[{name:"ui_create_host",description:"Create a new host on the Hosts screen from a client TEMPLATE. Takes a display name and, optionally, the template's catalog id (e.g. 'claude', 'cursor', 'mcpjam'); omit it for the default template. Low-entropy — the config is seeded from the template exactly as the New Client dialog does — so this creates the host directly, selects it, and opens its editor. To change the host's model, system prompt, or behavior afterward, use ui_open_host_editor.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Display name for the new host."},template:{type:"string",description:"Optional catalog template id to seed from (e.g. 'claude', 'cursor'). Defaults to the standard template."}},required:["name"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},nativePublication:ze,mayNavigate:!0,execute:async e=>{const t=_e(e.name);if(!t)return ce("Missing required 'name' string.");const r=_e(e.template);if(e.template!==void 0&&r===void 0)return ce("'template' must be a non-empty string when provided.");const n=await Ce({type:"createHost",payload:{name:t,...r?{template:r}:{}}});return Pe(Re(n))}},{name:"ui_open_host_editor",description:"Open a host's editor on the Hosts screen for the user. This is the way to change host CONFIG — its model, system prompt, tool-approval and tool-discovery behavior, protocol, and appearance are high-entropy and edited in the editor's focus tabs, not committed from here. Selects the host and navigates to its canvas; it changes nothing on its own.",inputSchema:{type:"object",properties:{host:ra},required:["host"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,mayNavigate:!0,execute:async e=>{const t=_e(e.host);if(!t)return ce("Missing required 'host' string.");const r=await Ce({type:"openHostEditor",payload:{host:t}});return Pe(Re(r))}},{name:"ui_set_host_servers",description:"Set which of the project's MCP servers a host has attached, by name. 'servers' is the COMPLETE list of existing project server names the host should have — servers not listed are detached, and unknown names are rejected without changing anything. Reversible (reattach any time). To add a server to the project first, use the Connect-screen server tools.",inputSchema:{type:"object",properties:{host:ra,servers:{type:"array",items:{type:"string"},description:"Complete set of existing project server names to attach (empty array detaches all)."}},required:["host","servers"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.host);if(!t)return ce("Missing required 'host' string.");const r=Ej(e.servers);if(!r.ok)return ce("'servers' must be an array of non-empty project server names.");const n=await Ce({type:"setHostServers",payload:{host:t,servers:r.names}});return Pe(Re(n))}},{name:"ui_delete_host",description:"Permanently delete a host, including its configuration and sessions. Irreversible — be sure the user wants this exact host gone. The host is addressed by name or id, exactly as shown on the Hosts screen.",inputSchema:{type:"object",properties:{host:ra},required:["host"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.host);if(!t)return ce("Missing required 'host' string.");const r=await Ce({type:"deleteHost",payload:{host:t}});return Pe(Re(r))}},{name:"ui_duplicate_host",description:"Duplicate an existing host into a new one with the same configuration. Optionally names the copy; otherwise the backend derives a name. The new host is selected and opened. Low-entropy, so this commits directly.",inputSchema:{type:"object",properties:{host:ra,name:{type:"string",description:"Optional name for the duplicate."}},required:["host"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},nativePublication:ze,mayNavigate:!0,execute:async e=>{const t=_e(e.host);if(!t)return ce("Missing required 'host' string.");const r=_e(e.name);if(e.name!==void 0&&r===void 0)return ce("'name' must be a non-empty string when provided.");const n=await Ce({type:"duplicateHost",payload:{host:t,...r?{name:r}:{}}});return Pe(Re(n))}}]}var na={type:"object",properties:{},additionalProperties:!1};function kj(){return[{name:"ui_start_computer",description:"Start the project's cloud computer — provision it on first use, or wake it if it's asleep. This spins up REAL infrastructure and counts against the daily start cap (same gate as the Open-terminal button; a cap rejection is reported as an error and the start is refused). It does NOT open the interactive terminal (that's a human action). The computer comes up in the background; watch ui_snapshot_app for it to reach 'ready'.",inputSchema:na,readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},nativePublication:ze,execute:async()=>{const e=await Ce({type:"startComputer"});return Pe(Re(e))}},{name:"ui_hibernate_computer",description:"Hibernate the project's computer now — put it to sleep immediately. Non-destructive: files and state are preserved and it wakes on next use. Hibernating an already-asleep computer reports that there was nothing to pause.",inputSchema:na,readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async()=>{const e=await Ce({type:"hibernateComputer"});return Pe(Re(e))}},{name:"ui_reset_computer",description:"Reset the project's computer to its image — WIPES all files and mutable state on it. Irreversible; be sure the user wants a clean box. Reports if there was nothing to reset.",inputSchema:na,readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async()=>{const e=await Ce({type:"resetComputer"});return Pe(Re(e))}},{name:"ui_delete_computer",description:"Delete the project's computer entirely, removing all files on it. Irreversible — be sure the user wants this. A new computer can be started later with ui_start_computer.",inputSchema:na,readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async()=>{const e=await Ce({type:"deleteComputer"});return Pe(Re(e))}}]}var gl=["invited_only","link_guests","project"];function Ij(){return[{name:"ui_publish_scenario",description:"Publish one of this project's environments as a User Testing scenario — a share link real testers can open, whose sessions come back as insights — and open that scenario. Use it when someone wants to hand their setup to real people and read what happened. Idempotent: an environment that is already published is opened as-is, keeping the access it already has. Copying the share link is a human action — check ui_snapshot_app for whether a link exists.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment to publish, as the Environments screen names it (e.g. 'Checkout flow'), or its environment id."},access:{type:"string",enum:[...gl],description:"Who may open the link: 'invited_only' (people invited by email), 'link_guests' (anyone with the link, including signed-out visitors, funded by this organization), or 'project' (signed-in team members). Applied when the scenario is created; defaults to 'invited_only'."},name:{type:"string",description:"What to call the scenario. Defaults to the environment's own name. Applied when the scenario is created."}},required:["environment"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:mj({untrustedContent:!1}),execute:async e=>{const t=_e(e.environment);if(!t)return ce("Missing required 'environment' string (an environment name or id — list them with ui_snapshot_app).");const r=_e(e.access);if(r&&!gl.includes(r))return ce(`Unknown access "${r}". Use one of: ${gl.join(", ")}.`);const n=_e(e.name),o=await Ce({type:"publishScenario",payload:{environment:t,...r?{access:r}:{},...n?{name:n}:{}}});return Pe(Re(o))}},{name:"ui_delete_scenario",description:"Permanently delete a User Testing scenario — its share link stops working and its saved tester-session history is cleared. Irreversible; be sure the user wants this exact scenario gone. Addressed by scenario name or id, exactly as the scenario list shows it. What happens to the setup behind it varies by scenario: report what the result's note says rather than assuming.",inputSchema:{type:"object",properties:{scenario:{type:"string",description:"Scenario to delete, as the User Testing list names it, or its scenario id."}},required:["scenario"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.scenario);if(!t)return ce("Missing required 'scenario' string (a scenario name or id — list them with ui_snapshot_app).");const r=await Ce({type:"deleteScenario",payload:{scenario:t}});return Pe(Re(r))}}]}function Cj(){return[{name:"ui_read_resource",description:"Read a resource from the server selected on the Resources screen, exactly as the Read button does. 'resource' is a concrete resource's uri or name as the list shows it, OR a resource template's name/uriTemplate — pass 'templateArguments' to fill a template's parameters. The read reflects on screen and its content is returned TRUNCATED (large or binary bodies are capped/omitted for the transcript). Unknown resource → error; ambiguous → pass the exact uri. List what's available with ui_snapshot_app.",inputSchema:{type:"object",properties:{resource:{type:"string",description:"A resource's uri or name, or a resource template's name/uriTemplate, as shown on the Resources screen."},templateArguments:{type:"object",description:"Values for a resource template's parameters (string→string). Ignored for a concrete resource.",additionalProperties:{type:"string"}}},required:["resource"],additionalProperties:!1},readOnly:!0,annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},nativePublication:as,execute:async e=>{const t=_e(e.resource);if(!t)return ce("Missing required 'resource' string (a resource uri/name or a template name/uriTemplate).");const r=hb(e.templateArguments);if(!r.ok)return ce("'templateArguments' must be an object of string values when provided.");const n=await Ce({type:"readResource",payload:{resource:t,...r.record?{templateArguments:r.record}:{}}});return Pe(Re(n))}}]}function Rj(){return[{name:"ui_get_prompt",description:"Render a prompt from the server selected on the Prompts screen, exactly as the Run button does. 'prompt' is a prompt's name (or title) as the list shows it; 'arguments' supplies its argument values (all string-typed). The render reflects on screen and its content is returned TRUNCATED (large bodies are capped for the transcript). Unknown prompt → error; ambiguous → pass the exact name. List what's available with ui_snapshot_app.",inputSchema:{type:"object",properties:{prompt:{type:"string",description:"A prompt's name or title, as shown on the Prompts screen."},arguments:{type:"object",description:"Values for the prompt's arguments (string→string). Omit for a prompt that takes none.",additionalProperties:{type:"string"}}},required:["prompt"],additionalProperties:!1},readOnly:!0,annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},nativePublication:as,execute:async e=>{const t=_e(e.prompt);if(!t)return ce("Missing required 'prompt' string (a prompt name).");const r=hb(e.arguments);if(!r.ok)return ce("'arguments' must be an object of string values when provided.");const n=await Ce({type:"getPrompt",payload:{prompt:t,...r.record?{arguments:r.record}:{}}});return Pe(Re(n))}}]}var vl=["preregistered","dcr","cimd"];function Tj(){return[{name:"ui_open_oauth_server_config",description:"Open the OAuth debugger's Configure-Server modal for the user to review and save. Optionally prefills the server name, MCP server URL, and registration mode. Credentials (client ID/secret) are always typed by the human — they cannot be passed here. Omit serverName to edit the currently selected server; pass a new name to create a new test target. Never commits anything itself.",inputSchema:{type:"object",properties:{serverName:{type:"string",description:"Server to configure, as the server tabs show it. Omitted → the selected server (or a blank form when none is selected). A name matching a different existing server is rejected."},serverUrl:{type:"string",description:"MCP base URL to prefill (e.g. https://example.com/mcp)."},registrationMode:{type:"string",enum:[...vl],description:"Client registration mode to prefill: 'preregistered' (human enters a client ID), 'dcr' (Dynamic Client Registration), or 'cimd' (URL-based client metadata; 2025-11-25 only)."}},additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.serverName);if(e.serverName!==void 0&&t===void 0)return ce("'serverName' must be a non-empty string when provided.");const r=_e(e.serverUrl);if(e.serverUrl!==void 0&&r===void 0)return ce("'serverUrl' must be a non-empty string when provided.");const n=_e(e.registrationMode);if(e.registrationMode!==void 0&&(!n||!vl.includes(n)))return ce(`'registrationMode' must be one of: ${vl.join(", ")}.`);const o=await Ce({type:"openOauthServerConfig",payload:{...t?{serverName:t}:{},...r?{serverUrl:r}:{},...n?{registrationMode:n}:{}}});return Pe(Re(o))}},{name:"ui_advance_oauth_flow",description:"Advance the OAuth debugger exactly ONE protocol step — the same as clicking Continue. Steps make REAL requests to the target and its authorization server; the registration step can create a PERSISTENT client registration there. At the authorization step this opens a sign-in popup a HUMAN must complete (if none appeared, ask the user to check their popup blocker) — observe with ui_snapshot_app instead of re-calling. Errors if unconfigured, mid-step, or already complete.",inputSchema:{type:"object",properties:{},additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},nativePublication:as,execute:async()=>{const e=await Ce({type:"advanceOauthFlow",payload:{}});return Pe(Re(e))}},{name:"ui_reset_oauth_flow",description:"Reset the OAuth debugger's flow back to the start for the configured target. Clears the local step-by-step state (tokens, codes, logged requests) so the flow can be run again. Nothing is sent to any server.",inputSchema:{type:"object",properties:{},additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async()=>{const e=await Ce({type:"resetOauthFlow",payload:{}});return Pe(Re(e))}}]}var mb={registry:{surfaceId:"registry",buildTools:yj},evals:{surfaceId:"evals",buildTools:bj},swarms:{surfaceId:"swarms",buildTools:xj},hosts:{surfaceId:"hosts",buildTools:wj},computer:{surfaceId:"computer",buildTools:kj},scenarios:{surfaceId:"scenarios",buildTools:Ij},resources:{surfaceId:"resources",buildTools:Cj},prompts:{surfaceId:"prompts",buildTools:Rj},"oauth-flow":{surfaceId:"oauth-flow",buildTools:Tj}};function y2(e){const t=mb[e];return t?t.buildTools().map(r=>r.name):[]}function Ku(e){const{surfaceId:t}=e,r=e.enabled??!0,n=(0,f.useRef)(e.handlers),o=(0,f.useRef)(e.snapshot);(0,f.useLayoutEffect)(()=>{n.current=e.handlers,o.current=e.snapshot}),(0,f.useLayoutEffect)(()=>{if(!r)return;const s=new AbortController,a=[],i=mb[t];if(i){const c=nj.getState().registerUiTool;for(const p of i.buildTools())c(p,{signal:s.signal,scope:"surface"})}const l=Object.keys(n.current??{});for(const c of l){const p=d=>{const h=n.current?.[c];if(!h)throw j1("unsupported_in_mode",`Surface "${t}" no longer handles "${c}".`);return h(d)};a.push(H1(c,p))}return o.current&&a.push(oj(t,()=>o.current?.())),()=>{s.abort();for(const c of a)c()}},[t,r])}function b2(e){const t=[...e.serverItems,...e.appItems],r={mcpServer:0,mcpApps:0,oauth:0,http:0,other:0};for(const s of t)s.source==="mcp-server"?r.mcpServer+=1:s.source==="mcp-apps"?r.mcpApps+=1:s.source==="oauth"?r.oauth+=1:s.source==="http"?r.http+=1:r.other+=1;const n=s=>{const a=Date.parse(s);return Number.isNaN(a)?0:a},o=[...t].sort((s,a)=>n(a.timestamp)-n(s.timestamp));return{totalItems:t.length,counts:r,recent:o.slice(0,30).map(s=>({source:s.source,method:s.method,direction:s.direction,server:s.serverName??s.serverId,timestamp:s.timestamp}))}}function S2(e){return{connectedServerCount:e.servers.length,servers:e.servers.slice(0,30).map(t=>t.name),selectedServer:e.selectedServerName,showMatrix:e.showMatrix}}function gb(e){return{totalSelectableHosts:e.totalSelectableHosts,comparedHostCount:e.totalSelectedCount,comparedHosts:e.selectedHosts.slice(0,30).map(t=>t.hostName),capabilityRowCount:e.capabilityFields.length,capabilityRows:e.capabilityFields.slice(0,30).map(t=>t.label),viewMode:e.viewMode,hasSearchQuery:!!(e.searchQuery&&e.searchQuery.trim()),supportFilter:e.supportFilter,divergingOnly:e.divergingOnly,loadedSelectedCount:e.loadedSelectedCount}}function Aj(e){return{view:"capability-permalink",capabilitySlug:e.capabilitySlug??null,capability:e.capabilityLabel,slice:e.slice,hostCount:e.rows.length,hosts:e.rows.slice(0,30).map(t=>({host:t.hostName,support:t.supportLevel,label:t.supportLabel}))}}function _2(e){return{selectedServer:e.selectedServer,taskCount:e.tasks.length,hasActiveTasks:e.hasActiveTasks,autoRefresh:e.autoRefresh,tasks:e.tasks.slice(0,30).map(t=>({taskId:t.taskId,status:t.status,createdAt:t.createdAt})),selectedTaskId:e.selectedTaskId}}var x2="mcpjam",E2="/mcp.svg",vb={mcpjam:h0,claude:Wd,"claude-desktop":zd,"claude-code":A0,"claude-code-desktop":zd,"claude-code-web":Wd,chatgpt:$d,"chatgpt-desktop":Fd,"chatgpt-work":$d,"chatgpt-work-desktop":Fd,mistral:D0,goose:fm,slack:j0,cursor:Ud,"cursor-cli":Ud,codex:Hd,"codex-cli":Hd,opencode:im,"copilot-cli":dm,copilot:M0,vscode:Y0,agentcore:W0,n8n:N0,gemini:k0,perplexity:H0,cline:pm,notion:J0,grokbot:I0,muse:R0},yb={opencode:{light:im,dark:C0},goose:{light:fm,dark:B0},cline:{light:pm,dark:G0},"copilot-cli":{light:dm,dark:Q0}};function mc(e,t){return(t?yb[e]?.[t]:void 0)??vb[e]??"/mcp.svg"}var w2=Object.entries(vb).map(([e,t])=>({id:e,logoSrc:t,logoSrcByTheme:yb[e]})),ct="#6E6E80",Nj={mcpjam:"#E07856",claude:"#D97757","claude-desktop":"#D97757","claude-code":"#D97757","claude-code-desktop":"#D97757","claude-code-web":"#D97757",chatgpt:ct,"chatgpt-desktop":ct,"chatgpt-work":ct,"chatgpt-work-desktop":ct,codex:ct,"codex-cli":ct,mistral:"#FA520F",goose:ct,slack:"#611F69",cursor:ct,"cursor-cli":ct,"copilot-cli":ct,copilot:ct,vscode:"#0098FF",agentcore:"#FF9900",n8n:"#EA4B71",perplexity:"#20808D",cline:ct,notion:ct,grokbot:ct,muse:ct};function k2(e){return`color-mix(in oklch, ${Nj[e]??ct} 12%, var(--card))`}var bb=[[/mcpjam/i,"mcpjam"],[/claude[ -]?code[ -]?desktop/i,"claude-code-desktop"],[/claude[ -]?code[ -]?web/i,"claude-code-web"],[/claude[ -]?code/i,"claude-code"],[/claude[ -]?desktop/i,"claude-desktop"],[/claude/i,"claude"],[/chatgpt[ -]?work[ -]?desktop/i,"chatgpt-work-desktop"],[/chatgpt[ -]?work/i,"chatgpt-work"],[/chatgpt[ -]?desktop/i,"chatgpt-desktop"],[/chatgpt|openai/i,"chatgpt"],[/codex[ -]?cli/i,"codex-cli"],[/codex/i,"codex"],[/agent[ -]?core/i,"agentcore"],[/n8n/i,"n8n"],[/opencode/i,"opencode"],[/copilot[ -]cli/i,"copilot-cli"],[/copilot/i,"copilot"],[/cursor[ -]?cli/i,"cursor-cli"],[/cursor/i,"cursor"],[/vs ?code/i,"vscode"],[/goose/i,"goose"],[/cline/i,"cline"],[/gemini|google[ -]?adk/i,"gemini"],[/perplexity/i,"perplexity"],[/notion/i,"notion"],[/grok/i,"grokbot"],[/\bmuse\b/i,"muse"],[/slack/i,"slack"],[/mistral/i,"mistral"]];function Pj(e){for(const[t,r]of bb)if(t.test(e))return r;return $0(e)}function Sb(e,t){for(const[r,n]of bb)if(r.test(e))return mc(n,t);return E0(e,t)??"/mcp.svg"}function _b(e,t){return y0(e.hostStyle)?pn(e.hostStyle,void 0,t):Sb(e.name,t)}var Mj=1796202728078,Oj=new Intl.DateTimeFormat("en-CA",{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),jj=2592e6,xb="Last checked over 30 days ago";function za(e){return e===void 0||!Number.isFinite(e)?"—":Oj.format(new Date(e))}function Eb(e){return e===void 0||!Number.isFinite(e)?!1:Date.now()-e>jj}function Lj(e,t,r){return e!=="mcpjam"||r===null||!Number.isFinite(r)||r<=0?t:r}var cn="preset:";function Xu(e){return e.startsWith(cn)}function Qu(e,t={}){const r=[],n={},o=t.mcpjamWebDeployedAt===void 0?Mj:t.mcpjamWebDeployedAt;for(const s of z0(e)){if(t.excludedTemplateIds?.has(s.id))continue;const a=`${cn}${s.id}`,i=V0(e,s.id);if(!i)continue;const l={...i,id:a,schemaVersion:2,supportedProtocolVersions:s.supportedProtocolVersions,provenance:s.provenance,rendersMcpApps:s.rendersMcpApps,styleVariablesByTheme:s.styleVariablesByTheme};r.push({hostId:a,name:s.label,displayName:s.label,hostConfigId:a,modelId:l.modelId,serverCount:0,createdAt:0,updatedAt:0}),n[a]={hostId:a,hostName:s.label,hostStyle:l.hostStyle,configHashShort:s.id,verifiedAt:Lj(s.id,s.verifiedAt,o),config:l}}return{hosts:r,subjects:n}}function bh(e,t={}){const r=o=>o.hostId==="preset:mcpjam"||t[o.hostId]?.hostStyle==="mcpjam"||o.name!==void 0&&/mcpjam/i.test(o.name),n=e.filter(o=>!r(o));return n.length===e.length?[...e]:[...n,...e.filter(r)]}function gc(e,t={}){if(Xu(e.hostId))return e.hostId.slice(7);if(e.hostStyle)return e.hostStyle;const r=t[e.hostId]?.hostStyle;return r||(e.name?Pj(e.name):null)}function Dj(e,t,r={}){const n=new Set(e.map(o=>gc(o,r)).filter(o=>o!==null));return n.size===0?[...t]:t.filter(o=>!n.has(gc(o,r)))}function Fj(e,t,r={}){const n=[...t].sort((i,l)=>n_({hostId:i.hostId,createdAt:i.createdAt??0},{hostId:l.hostId,createdAt:l.createdAt??0})),o=new Map;for(const i of n){const l=gc(i,r);l&&!o.has(l)&&o.set(l,i.hostId)}if(o.size===0)return[...e];const s=new Set,a=[];for(const i of e){const l=Xu(i)?i.slice(7):null,c=l&&o.get(l)||i;s.has(c)||(s.add(c),a.push(c))}return a}var wb="host-compare-selected:",Hj={slackbot:"slack","slack-bot":"slack"},vc=[`${cn}chatgpt`,`${cn}claude`];function Uj(e){if(typeof window>"u")return null;try{const t=sessionStorage.getItem(`${wb}${e}`);if(!t)return null;const r=JSON.parse(t);return Array.isArray(r)?r.filter(n=>typeof n=="string"):null}catch{return null}}function $j(e,t){if(!(typeof window>"u"))try{sessionStorage.setItem(`${wb}${e}`,JSON.stringify([...t]))}catch{}}function Ln(e,t){const r=new Set;return e.filter(n=>!t.has(n)||r.has(n)?!1:(r.add(n),!0))}function Bj(e,t,r=1){return e.includes(t)?e.length<=r?[...e]:e.filter(n=>n!==t):[...e,t]}function kb(e){if(!e)return null;const t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0).map(zj),r=[...new Set(t)];return r.length>0?r:null}function zj(e){if(!e.startsWith("preset:"))return e;const t=e.slice(cn.length),r=Hj[t];return r?`${cn}${r}`:e}function Wj(e){const t=new Set(e.knownHostIds??e.liveHostIds),r=e.remapSelection??(a=>[...a]);if(e.urlSelection&&e.urlSelection.length>0){const a=Ln(r(e.urlSelection),t);if(a.length>0)return a}const n=Uj(e.projectId);if(n){const a=Ln(r(n),t);if(a.length>0)return a}const o=Ln(r(e.previousSelection),t);if(o.length>0)return o;const s=Ln(r(vc),t);return s.length>0?s:[...e.liveHostIds]}function qj(e){return e!==void 0&&e.kind!=="personal"}var I2="mcpjam",C2=e_;function Vj(e){if(!qj(e.computer))return e;const{computer:t,...r}=e;return r}function R2(e,t={}){const r=Dr(e);return t.themeMode!==void 0&&(r.hostContext={...r.hostContext,theme:t.themeMode}),Vj(r)}function T2(e){return{hostStyle:e.hostStyle,modelId:e.modelId,...e.modelSelection?.modelId===e.modelId?{modelSelection:e.modelSelection}:{},systemPrompt:e.systemPrompt,systemPromptDefault:e.systemPromptDefault,temperature:e.temperature,requireToolApproval:e.requireToolApproval,respectToolVisibility:e.respectToolVisibility??!0,runUnloadedToolCalls:e.runUnloadedToolCalls,progressiveToolDiscovery:e.progressiveToolDiscovery,requireNativeToolDiscovery:e.requireNativeToolDiscovery,modelVisibleMcpToolResults:e.modelVisibleMcpToolResults?Zj(e.modelVisibleMcpToolResults):void 0,mcpToolResultImageRendering:e.mcpToolResultImageRendering?eL(e.mcpToolResultImageRendering):void 0,serverIds:[...e.serverIds],optionalServerIds:[...e.optionalServerIds],builtInToolIds:e.builtInToolIds?[...e.builtInToolIds]:[],computer:e.computer?{kind:e.computer.kind,...e.computer.workdir?{workdir:e.computer.workdir}:{}}:void 0,browserProfileId:e.browserProfileId,harness:e.harness,agentLoop:e.agentLoop,connectionDefaults:{headers:{...e.connectionDefaults.headers},requestTimeout:e.connectionDefaults.requestTimeout},clientCapabilities:yl(e.clientCapabilities),hostContext:yl(e.hostContext),hostCapabilitiesOverride:e.hostCapabilitiesOverride?yl(e.hostCapabilitiesOverride):void 0,chatUiOverride:e.chatUiOverride?Qj(e.chatUiOverride):void 0,mcpProfile:e.mcpProfile?Xj(e.mcpProfile):void 0,serverConnectionOverrides:e.serverConnectionOverrides?Object.fromEntries(Object.entries(e.serverConnectionOverrides).map(([t,r])=>[t,{...r.headersOverride!==void 0?{headersOverride:{...r.headersOverride}}:{},...r.requestTimeoutOverride!==void 0?{requestTimeoutOverride:r.requestTimeoutOverride}:{},...r.mcpProtocolVersionOverride!==void 0?{mcpProtocolVersionOverride:r.mcpProtocolVersionOverride}:{}}])):void 0}}function A2(e){return q0(e,Ib)}function N2(e){return e?.initialize?.clientInfo}function P2(e){return e?.initialize?.supportedProtocolVersions}function M2(e){return e?.apps?.uiInitialize?.hostInfo}function Gj(e){const t=x0(e.hostStyle),r=e.profile?.apps?.compatRuntime,n=r?.openaiApps;return n===!1?{injected:!1}:(typeof n=="boolean"?n:t.injected)?{injected:!0,capabilities:Yj(t.injected?t.capabilities:S0,r?.openaiAppsOverrides)}:{injected:!1}}function Yj(e,t){return t?{callTool:t.callTool??e.callTool,sendFollowUpMessage:t.sendFollowUpMessage??e.sendFollowUpMessage,setWidgetState:t.setWidgetState??e.setWidgetState,requestDisplayMode:t.requestDisplayMode??e.requestDisplayMode,notifyIntrinsicHeight:t.notifyIntrinsicHeight??e.notifyIntrinsicHeight,openExternal:t.openExternal??e.openExternal,setOpenInAppUrl:t.setOpenInAppUrl??e.setOpenInAppUrl,requestModal:t.requestModal??e.requestModal,uploadFile:t.uploadFile??e.uploadFile,selectFiles:t.selectFiles??e.selectFiles,getFileDownloadUrl:t.getFileDownloadUrl??e.getFileDownloadUrl,requestCheckout:t.requestCheckout??e.requestCheckout,requestClose:t.requestClose??e.requestClose}:e}function Jj(e){return b0(e,Ib)}function Ib(e){return U0(e)?.mcp}function O2(e){if(e!==void 0)return{openLinks:e.openLinks!==void 0,serverTools:e.serverTools!==void 0,serverResources:e.serverResources!==void 0,logging:e.logging!==void 0,updateModelContext:e.updateModelContext!==void 0,message:e.message!==void 0,downloadFile:e.downloadFile!==void 0}}function Kj(e){return!(e.initialize!==void 0&&(e.initialize.clientInfo!==void 0||e.initialize.supportedProtocolVersions!==void 0&&e.initialize.supportedProtocolVersions.length>0))&&e.mcpProtocolVersion===void 0&&e.toolParamHeaderMirroring===void 0&&e.paginationTraversal===void 0&&e.mrtrSupport===void 0&&e.unauthorizedChallenge===void 0&&e.unauthorizedChallengeTrigger===void 0&&e.toolResultAuthChallenge===void 0&&e.toolResultAuthChallengeTrigger===void 0&&(e.toolListChanged===void 0||Object.values(e.toolListChanged).every(t=>t===void 0))&&(e.toolCallCancellation===void 0||Object.values(e.toolCallCancellation).every(t=>t===void 0))&&!e.apps&&!e.extensions}function j2(e,t){const r=t!==void 0&&Object.keys(t).length>0,n=e.mcpProfile,o=n?.apps??{},s={};for(const[l,c]of Object.entries(o))l!=="mcpAppsOverrides"&&c!==void 0&&(s[l]=c);r&&(s.mcpAppsOverrides=t);const a=Object.keys(s).length===0;if(n===void 0&&a)return e;const i={...n??{profileVersion:1},apps:a?void 0:s};return{...e,mcpProfile:Kj(i)?void 0:i}}function Xj(e){return Dr(e)}function Qj(e){return Dr(e)}function yl(e){return Dr(e)}function Dr(e){if(Array.isArray(e))return e.map(Dr);if(e&&typeof e=="object"){const t={};for(const[r,n]of Object.entries(e))t[r]=Dr(n);return t}return e}function Zj(e){return Dr(e)}function eL(e){return Dr(e)}function Cb(e){return e?.directContent?.image??!0}function Rb(e){return(e?.embeddedResources?.blob?.enabled??!0)&&(e?.embeddedResources?.blob?.image??!0)}function Tb(e){return(e?.linkedResources?.blob?.enabled??!0)&&(e?.linkedResources?.blob?.image??!0)}function L2(e,t){return{...e,directContent:{...e?.directContent,image:t}}}function D2(e,t){return{...e,embeddedResources:{...e?.embeddedResources,blob:{...e?.embeddedResources?.blob,image:t}}}}function F2(e,t){return{...e,linkedResources:{...e?.linkedResources,blob:{...e?.linkedResources?.blob,image:t}}}}function tL(e){return e?.placement??"inline"}function rL(e){return e?.directContent?.image??!0}function nL(e){return e?.embeddedResources?.blob?.image??!0}function oL(e){return e?.linkedResources?.blob?.image??!0}function H2(e,t){return{...e,placement:t}}function sL(e,t){return{...e,directContent:{...e?.directContent,image:t}}}function aL(e,t){return{...e,embeddedResources:{...e?.embeddedResources,blob:{...e?.embeddedResources?.blob,image:t}}}}function iL(e,t){return{...e,linkedResources:{...e?.linkedResources,blob:{...e?.linkedResources?.blob,image:t}}}}function U2(e,t){const r=Cb(t),n=Rb(t),o=Tb(t);if(r&&n&&o)return e;let s=e;return r||(s=sL(s,!1)),n||(s=aL(s,!1)),o||(s=iL(s,!1)),s}function $2(e,t){return!(e.hostStyle!==t.hostStyle||e.modelId!==t.modelId||(e.modelSelection?Zd(e.modelSelection):"")!==(t.modelSelection?Zd(t.modelSelection):"")||e.systemPrompt!==t.systemPrompt||e.temperature!==t.temperature||e.requireToolApproval!==t.requireToolApproval||e.respectToolVisibility!==t.respectToolVisibility||e.runUnloadedToolCalls!==t.runUnloadedToolCalls||e.progressiveToolDiscovery!==t.progressiveToolDiscovery||e.requireNativeToolDiscovery!==t.requireNativeToolDiscovery||!uL(e.modelVisibleMcpToolResults,t.modelVisibleMcpToolResults)||!dL(e.mcpToolResultImageRendering,t.mcpToolResultImageRendering)||!bl(e.serverIds,t.serverIds)||!bl(e.optionalServerIds,t.optionalServerIds)||!bl(e.builtInToolIds,t.builtInToolIds)||e.localBrowserEnabled!==t.localBrowserEnabled||e.computer===void 0!=(t.computer===void 0)||e.computer&&t.computer&&(e.computer.kind!==t.computer.kind||e.computer.workdir!==t.computer.workdir)||e.browserProfileId!==t.browserProfileId||e.harness!==t.harness||e.agentLoop!==t.agentLoop||e.connectionDefaults.requestTimeout!==t.connectionDefaults.requestTimeout||!va(e.connectionDefaults.headers,t.connectionDefaults.headers)||!va(e.clientCapabilities,t.clientCapabilities)||!va(e.hostContext,t.hostContext)||!pL(e.hostCapabilitiesOverride,t.hostCapabilitiesOverride)||!fL(e.chatUiOverride,t.chatUiOverride)||!cL(e.mcpProfile,t.mcpProfile)||!lL(e.serverConnectionOverrides,t.serverConnectionOverrides))}function lL(e,t){const r=n=>{if(!n)return{};const o={};for(const[s,a]of Object.entries(n)){if(!a)continue;const i=a.headersOverride!==void 0&&Object.keys(a.headersOverride).length>0,l=a.requestTimeoutOverride!==void 0,c=a.mcpProtocolVersionOverride!==void 0;(i||l||c)&&(o[s]={...i?{headersOverride:a.headersOverride}:{},...l?{requestTimeoutOverride:a.requestTimeoutOverride}:{},...c?{mcpProtocolVersionOverride:a.mcpProtocolVersionOverride}:{}})}return o};return Lt(r(e))===Lt(r(t))}function cL(e,t){return e===void 0&&t===void 0?!0:e===void 0||t===void 0?!1:Lt(e)===Lt(t)}function uL(e,t){return e===void 0&&t===void 0?!0:e===void 0||t===void 0?!1:Lt(e)===Lt(t)}function dL(e,t){return e===void 0&&t===void 0?!0:e===void 0||t===void 0?!1:Lt(e)===Lt(t)}function pL(e,t){return e===void 0&&t===void 0?!0:e===void 0||t===void 0?!1:va(e,t)}function fL(e,t){return e===void 0&&t===void 0?!0:e===void 0||t===void 0?!1:Lt(e)===Lt(t)}function bl(e,t){if(e.length!==t.length)return!1;const r=[...e].sort(),n=[...t].sort();for(let o=0;o<r.length;o++)if(r[o]!==n[o])return!1;return!0}function va(e,t){return Lt(e)===Lt(t)}function hL(e){return e.rendersMcpApps!==void 0}function Sl(e,t){if(e.rendersMcpApps!==!0)return!1;let r=e.mcpProfile?.apps?.mcpAppsOverrides;for(const n of t)r=r!==null&&typeof r=="object"?r[n]:void 0;return r===void 0}function Gr(e,t){return hL(e)&&(t===void 0||Object.keys(t).length===0)}var mL=[{key:"toolInputPartial",description:"Send ui/notifications/tool-input-partial while the agent streams arguments"},{key:"toolCancelled",description:"Notify the app when tool execution is cancelled (ui/notifications/tool-cancelled)"},{key:"hostContextChanged",description:"Notify the app when theme, display mode, or other host context changes"},{key:"resourceTeardown",description:"Send ui/resource-teardown before destroying the app view"},{key:"serverResources",description:"Advertise resources/read proxy capability in ui/initialize"},{key:"logging",description:"Accept notifications/message log calls from the app"},{key:"toolInfo",description:"Include calling-tool metadata in HostContext.toolInfo"},{key:"openLinks",description:"Advertise ui/open-link capability"},{key:"serverTools",description:"Advertise tools/call proxy capability"},{key:"updateModelContext",description:"Accept ui/update-model-context requests from the app"},{key:"message",description:"Accept ui/message requests that add content to the conversation"},{key:"downloadFile",description:"Accept ui/download-file requests from the app"},{key:"requestTeardown",description:"Honor ui/notifications/request-teardown by unmounting the app"},{key:"sandboxPermissions",description:"Honor _meta.ui.permissions when configuring the iframe"},{key:"cspFrameDomains",description:"Honor _meta.ui.csp.frameDomains for nested iframes"},{key:"cspBaseUriDomains",description:"Honor _meta.ui.csp.baseUriDomains in CSP"},{key:"resourcePrefersBorder",description:"Honor _meta.ui.prefersBorder when rendering app chrome"},{key:"safeAreaInsets",description:"Send hostContext.safeAreaInsets so an app can keep content clear of host chrome"}],gL=[{key:"callTool",label:"callTool"},{key:"sendFollowUpMessage",label:"sendFollowUpMessage"},{key:"setWidgetState",label:"setWidgetState"},{key:"requestDisplayMode",label:"requestDisplayMode"},{key:"notifyIntrinsicHeight",label:"notifyIntrinsicHeight"},{key:"openExternal",label:"openExternal"},{key:"setOpenInAppUrl",label:"setOpenInAppUrl"},{key:"requestModal",label:"requestModal"},{key:"uploadFile",label:"uploadFile"},{key:"selectFiles",label:"selectFiles"},{key:"getFileDownloadUrl",label:"getFileDownloadUrl"},{key:"requestCheckout",label:"requestCheckout"},{key:"requestClose",label:"requestClose"}],vL=["inline","fullscreen","pip"],yL=[{id:"protocol",label:"MCP Protocol",subtitle:"version · clientInfo · capabilities · connection"},{id:"agent",label:"Agent",subtitle:"model · sampling · system prompt"},{id:"apps",label:"Apps",subtitle:"SEP-1865 advertise · compat shim · sandbox"}],Je=e=>e.mcpProfile,Sh=new WeakMap,_o=e=>{let t=Sh.get(e);return t||(t=Jj({profile:e.mcpProfile,hostStyle:e.hostStyle}),Sh.set(e,t)),t},_h=new WeakMap,_l=e=>{let t=_h.get(e);return t||(t=Gj({profile:e.mcpProfile,hostStyle:e.hostStyle}),_h.set(e,t)),t},bL={accept:"supported","user-initiated-only":"partial",decline:"neutral"},SL={all:"supported","fullscreen-only":"partial",none:"neutral"},_L={on:"supported",off:"neutral",invalid:"unsupported"},xL=["--color-background-primary","--color-background-secondary","--color-background-tertiary","--color-background-inverse","--color-background-ghost","--color-background-info","--color-background-danger","--color-background-success","--color-background-warning","--color-background-disabled","--color-text-primary","--color-text-secondary","--color-text-tertiary","--color-text-inverse","--color-text-ghost","--color-text-info","--color-text-danger","--color-text-success","--color-text-warning","--color-text-disabled","--color-border-primary","--color-border-secondary","--color-border-tertiary","--color-border-inverse","--color-border-ghost","--color-border-info","--color-border-danger","--color-border-success","--color-border-warning","--color-border-disabled","--color-ring-primary","--color-ring-secondary","--color-ring-inverse","--color-ring-info","--color-ring-danger","--color-ring-success","--color-ring-warning","--font-sans","--font-mono","--font-weight-normal","--font-weight-medium","--font-weight-semibold","--font-weight-bold","--font-text-xs-size","--font-text-sm-size","--font-text-md-size","--font-text-lg-size","--font-heading-xs-size","--font-heading-sm-size","--font-heading-md-size","--font-heading-lg-size","--font-heading-xl-size","--font-heading-2xl-size","--font-heading-3xl-size","--font-text-xs-line-height","--font-text-sm-line-height","--font-text-md-line-height","--font-text-lg-line-height","--font-heading-xs-line-height","--font-heading-sm-line-height","--font-heading-md-line-height","--font-heading-lg-line-height","--font-heading-xl-line-height","--font-heading-2xl-line-height","--font-heading-3xl-line-height","--border-radius-xs","--border-radius-sm","--border-radius-md","--border-radius-lg","--border-radius-xl","--border-radius-full","--border-width-regular","--shadow-hairline","--shadow-sm","--shadow-md","--shadow-lg"],br=Symbol("not-supported");function EL(e){let t=0;for(const r of e)if(r==="(")t+=1;else if(r===")")t-=1;else if(r===","&&t===0)return!0;return!1}function wL(e){let t=0;for(const r of e)if(r==="(")t+=1;else if(r===")"&&(t-=1,t<0))return!1;return t===0}function kL(e){const t=e.trim();if(!t.toLowerCase().startsWith("light-dark(")||!t.endsWith(")"))return null;const r=t.slice(11,-1);if(!wL(r))return null;let n=0;for(let o=0;o<r.length;o+=1){const s=r[o];if(s==="(")n+=1;else if(s===")")n-=1;else if(s===","&&n===0){const a=r.slice(0,o).trim(),i=r.slice(o+1).trim();return!a||!i||EL(i)?null:{light:a,dark:i}}}return null}function IL(e,t){const r=e,n=r.styleVariablesByTheme,o=n?.light?.[t],s=n?.dark?.[t];if(typeof o=="string"||typeof s=="string")return o===s&&typeof o=="string"?{same:o}:{light:o,dark:s};const a=e.hostContext?.styles?.variables,i=a!==null&&typeof a=="object"?a[t]:void 0;if(typeof i=="string"){const l=kL(i);return l?l.light===l.dark?{same:l.light}:{...l,raw:i}:{same:i}}return r.provenance==="probe"?br:void 0}var CL=xL.map(e=>({id:`styles.${e}`,section:"apps",subsection:"Styles",label:e,path:`hostContext.styles.variables.${e}`,description:`Value the host sends widgets for ${e}.`,kind:{kind:"style-variable"},read:t=>IL(t,e)}));function xh(e){return e.rendersMcpApps===!1}var RL=[{id:"capabilities.uiExtension",section:"apps",subsection:"MCP Apps capabilities",label:Hi,path:`clientCapabilities.extensions.${Hi}`,description:"Shows MCP Apps widgets.",kind:{kind:"capability"},read:e=>e.clientCapabilities?.extensions?.[Hi]},{id:"appsCap.availableDisplayModes",section:"apps",subsection:"MCP Apps capabilities",label:"availableDisplayModes",path:"mcpProfile.apps.mcpAppsOverrides.availableDisplayModes (effective)",description:"Display modes the client offers widgets (inline / fullscreen / pip).",kind:{kind:"mode-set",modes:vL},read:e=>xh(e)?br:Sl(e,["availableDisplayModes"])?void 0:_o(e).availableDisplayModes},{id:"appsCap.widgetDisplayModeRequests",section:"apps",subsection:"MCP Apps capabilities",label:"widgetDisplayModeRequests",path:"mcpProfile.apps.mcpAppsOverrides.widgetDisplayModeRequests (effective)",description:"Policy for honoring widget display-mode change requests.",kind:{kind:"enum",support:bL},read:e=>xh(e)?br:Sl(e,["widgetDisplayModeRequests"])?void 0:_o(e).widgetDisplayModeRequests},...mL.map(({key:e,description:t})=>({id:`appsCap.${e}`,section:"apps",subsection:"MCP Apps capabilities",label:e,path:`mcpProfile.apps.mcpAppsOverrides.${e} (effective)`,description:t,kind:{kind:"boolean"},read:r=>Sl(r,[e])?void 0:_o(r)[e]})),...["fetch","xhr","websocket"].map(e=>({id:`appsCap.cspConnectDomains.${e}`,section:"apps",subsection:"MCP Apps capabilities",label:`cspConnectDomains.${e}`,path:`mcpProfile.apps.mcpAppsOverrides.cspConnectDomains.${e} (effective)`,description:`Allow widget ${e} connections to declared CSP connect domains.`,kind:{kind:"boolean"},read:t=>_o(t).cspConnectDomains?.[e]})),...["script","stylesheet","image","font","media"].map(e=>({id:`appsCap.cspResourceDomains.${e}`,section:"apps",subsection:"MCP Apps capabilities",label:`cspResourceDomains.${e}`,path:`mcpProfile.apps.mcpAppsOverrides.cspResourceDomains.${e} (effective)`,description:`Allow widget ${e} resources from declared CSP resource domains.`,kind:{kind:"boolean"},read:t=>_o(t).cspResourceDomains?.[e]}))],TL=[{id:"compatRuntime.openaiApps",section:"apps",subsection:"OpenAI compat shim",label:"Inject window.openai",path:"mcpProfile.apps.compatRuntime.openaiApps",description:"Inject the `window.openai` Apps-SDK shim. Undefined = use hostStyle preset.",kind:{kind:"boolean"},read:e=>_l(e).injected},...gL.filter(({key:e})=>e!=="requestDisplayMode").map(({key:e,label:t})=>({id:`openaiShim.${e}`,section:"apps",subsection:"OpenAI compat shim",label:t,path:`mcpProfile.apps.compatRuntime.openaiAppsOverrides.${e} (effective)`,description:`window.openai.${e}() available to widgets (shim must be injected).`,kind:{kind:"boolean"},read:r=>{const n=_l(r);return n.injected?!!n.capabilities[e]:!1}})),{id:"openaiShim.requestDisplayMode",section:"apps",subsection:"OpenAI compat shim",label:"requestDisplayMode",path:"mcpProfile.apps.compatRuntime.openaiAppsOverrides.requestDisplayMode (effective)",description:"Which display-mode requests the shim honors.",kind:{kind:"enum",support:SL},read:e=>{const t=_l(e);return t.injected?t.capabilities.requestDisplayMode:"none"}}],AL=["camera","microphone","geolocation","clipboardWrite"].map(e=>({id:`sandboxPerm.${e}`,section:"apps",subsection:"Sandbox permissions",label:e,path:`mcpProfile.apps.sandbox.permissions.allow.${e}`,description:`Grant the app iframe ${e} access.`,kind:{kind:"boolean"},read:t=>!!Je(t)?.apps?.sandbox?.permissions?.allow?.[e]})),NL=[{id:"toolResult.structuredContent",section:"apps",subsection:"Widget tool results",label:"Structured content",path:"mcpProfile.apps.mcpAppsOverrides.toolResult.structuredContent",description:"Whether the structuredContent half of a tool result reaches a widget that called the tool.",kind:{kind:"boolean"},read:e=>Je(e)?.apps?.mcpAppsOverrides?.toolResult?.structuredContent},...[["text","Text"],["image","Image"],["audio","Audio"],["resource","Embedded resource"],["resourceLink","Resource link"]].map(([e,t])=>({id:`toolResult.content.${e}`,section:"apps",subsection:"Widget tool results",label:t,path:`mcpProfile.apps.mcpAppsOverrides.toolResult.content.${e}`,description:`Whether ${t.toLowerCase()} blocks in a tool result reach a widget that called the tool.`,kind:{kind:"boolean"},read:r=>r.mcpProfile?.apps?.mcpAppsOverrides?.toolResult?.content?.[e]}))],PL=["localStorage","sessionStorage","indexedDB"].map(e=>({id:`sandbox.browserStorage.${e}`,section:"apps",subsection:"Sandbox",label:e==="indexedDB"?"IndexedDB":e,path:`mcpProfile.apps.sandbox.browserStorage.${e}`,description:`${e} works inside the sandboxed app iframe (probe-measured browser behavior, not MCP).`,kind:{kind:"boolean"},read:t=>Je(t)?.apps?.sandbox?.browserStorage?.[e]})),ML={id:"sandbox.sameOriginAppIframe",section:"apps",subsection:"Sandbox",label:"Same-origin app iframe",path:"mcpProfile.apps.sandbox.sameOriginAppIframe",description:"The app iframe shares the sandbox page's origin, so storage, cookies and same-origin fetches work. When not, the app runs in an opaque origin (probe-measured browser behavior, not MCP).",kind:{kind:"boolean"},read:e=>Je(e)?.apps?.sandbox?.sameOriginAppIframe},OL=[["listens","Opens notification channel","Client opens the server-to-client notification channel (legacy: standalone GET SSE stream; 2026-07-28: subscriptions/listen)."],["refetches","Re-fetches after list_changed","Client acts on notifications/tools/list_changed instead of keeping its cached tool list. Independent of the channel: a server can publish the notification on an open tools/call response stream, which reaches a client that never opened one."]].map(([e,t,r])=>({id:`toolListChanged.${e}`,section:"protocol",subsection:"Tool list changed",label:t,path:`mcpProfile.toolListChanged.${e}`,description:r,kind:{kind:"boolean"},read:n=>Je(n)?.toolListChanged?.[e]})),jL={id:"paginationTraversal",section:"protocol",subsection:"Pagination",label:"Follows nextCursor",path:"mcpProfile.paginationTraversal",description:"Client requests further pages of a paginated list instead of treating page one as the whole result.",kind:{kind:"enum",options:["full","firstPageOnly"],support:{full:"supported",firstPageOnly:"unsupported"}},read:e=>Je(e)?.paginationTraversal},LL=[["legacy","Tool cancellation (2025)","Client tells the server when the user stops an in-flight tool call on a 2025 connection, by sending notifications/cancelled."],["modern","Tool cancellation (2026)","Client tells the server when the user stops an in-flight tool call on a 2026-07-28 connection, by closing that request's response stream."]].map(([e,t,r])=>({id:`toolCallCancellation.${e}`,section:"protocol",subsection:"Cancellation",label:t,path:`mcpProfile.toolCallCancellation.${e}`,description:r,kind:{kind:"boolean"},read:n=>Je(n)?.toolCallCancellation?.[e]})),Eh={prompt:"supported",notify:"partial",passthrough:"unsupported"},DL=[{id:"unauthorizedChallenge",section:"protocol",subsection:"Mid-session sign-in",label:"When the server asks for sign-in",path:"mcpProfile.unauthorizedChallenge",description:"What the client does when a server asks the user to sign in: prompt to sign in and run the call again, tell the user to sign in, or show an ordinary error. If unset, the client prompts.",kind:{kind:"enum",options:Vd,support:Eh},read:e=>Je(e)?.unauthorizedChallenge},{id:"unauthorizedChallengeTrigger",section:"protocol",subsection:"Mid-session sign-in",label:"Server sign-in trigger",path:"mcpProfile.unauthorizedChallengeTrigger",description:"Accept any server sign-in request, only requests that name Bearer authentication, or only those that also provide a resource metadata link. If unset, any request counts.",kind:{kind:"enum",options:g_},read:e=>Je(e)?.unauthorizedChallengeTrigger},{id:"toolResultAuthChallenge",section:"protocol",subsection:"Mid-session sign-in",label:"When a tool result asks for sign-in",path:"mcpProfile.toolResultAuthChallenge",description:"What the client does when a tool result asks the user to sign in. If unset, the client treats the result as an ordinary tool error.",kind:{kind:"enum",options:Vd,support:Eh},read:e=>Je(e)?.toolResultAuthChallenge},{id:"toolResultAuthChallengeTrigger",section:"protocol",subsection:"Mid-session sign-in",label:"Tool result sign-in trigger",path:"mcpProfile.toolResultAuthChallengeTrigger",description:"What a tool result's sign-in request needs before it counts: nothing more, a tool that supports OAuth sign-in, or that plus an error code and description. If unset, it needs the tool to support OAuth sign-in and the result to carry both the error code and its description.",kind:{kind:"enum",options:m_},read:e=>Je(e)?.toolResultAuthChallengeTrigger}],gn=[{id:"modelId",section:"agent",subsection:"Agent tooling",label:"Model",path:"modelId",description:"LLM the client runs the agent on.",kind:{kind:"string"},read:e=>e.modelId},{id:"temperature",section:"agent",subsection:"Agent tooling",label:"Temperature",path:"temperature",description:"0–1 sampling temperature.",kind:{kind:"number"},read:e=>e.temperature},{id:"requireToolApproval",section:"agent",subsection:"Agent tooling",label:"Require tool approval",path:"requireToolApproval",description:"Asks for approval before MCP tool calls, commands and file edits. Loading a skill never asks.",kind:{kind:"boolean"},read:e=>e.requireToolApproval},{id:"runUnloadedToolCalls",section:"agent",subsection:"Agent tooling",label:"Run calls to unloaded tools",path:"runUnloadedToolCalls",description:"When the model calls a tool it has not loaded, run the call if its inputs are valid. Off refuses the call until the tool is loaded.",kind:{kind:"boolean"},read:e=>e.runUnloadedToolCalls??!0},{id:"respectToolVisibility",section:"agent",subsection:"Agent tooling",label:"Respect tool visibility",path:"respectToolVisibility",description:"SEP-1865 `_meta.ui.visibility` filter.",kind:{kind:"boolean"},read:e=>e.respectToolVisibility??!0},{id:"modelVisibleMcpToolResults.directContent.image",section:"agent",subsection:"Agent tooling",label:"Make tool image content visible to model",path:"modelVisibleMcpToolResults.directContent.image",description:"Pass MCP image content from tool results to the model.",kind:{kind:"boolean"},read:e=>Gr(e,e.modelVisibleMcpToolResults)?void 0:Cb(e.modelVisibleMcpToolResults)},{id:"modelVisibleMcpToolResults.embeddedResources.blob.image",section:"agent",subsection:"Agent tooling",label:"Make embedded resource images visible to model",path:"modelVisibleMcpToolResults.embeddedResources.blob.image",description:"Pass MCP embedded resource images from tool results to the model.",kind:{kind:"boolean"},read:e=>Gr(e,e.modelVisibleMcpToolResults)?void 0:Rb(e.modelVisibleMcpToolResults)},{id:"modelVisibleMcpToolResults.linkedResources.blob.image",section:"agent",subsection:"Agent tooling",label:"Make resource link images visible to model",path:"modelVisibleMcpToolResults.linkedResources.blob.image",description:"Resolve MCP resource link images and pass them to the model.",kind:{kind:"boolean"},read:e=>Gr(e,e.modelVisibleMcpToolResults)?void 0:Tb(e.modelVisibleMcpToolResults)},{id:"mcpToolResultImageRendering",section:"agent",subsection:"Agent tooling",label:"Render tool images",path:"mcpToolResultImageRendering.placement",description:"Human-facing display mode for MCP tool-returned images.",kind:{kind:"enum",options:["none","collapsed","inline"]},read:e=>Gr(e,e.mcpToolResultImageRendering)?void 0:tL(e.mcpToolResultImageRendering)},{id:"mcpToolResultImageRendering.directContent.image",section:"agent",subsection:"Agent tooling",label:"Render tool image content",path:"mcpToolResultImageRendering.directContent.image",description:"Render direct MCP image content from tool results in the UI.",kind:{kind:"boolean"},read:e=>Gr(e,e.mcpToolResultImageRendering)?void 0:rL(e.mcpToolResultImageRendering)},{id:"mcpToolResultImageRendering.embeddedResources.blob.image",section:"agent",subsection:"Agent tooling",label:"Render embedded resource images",path:"mcpToolResultImageRendering.embeddedResources.blob.image",description:"Render MCP embedded resource images from tool results in the UI.",kind:{kind:"boolean"},read:e=>Gr(e,e.mcpToolResultImageRendering)?void 0:nL(e.mcpToolResultImageRendering)},{id:"mcpToolResultImageRendering.linkedResources.blob.image",section:"agent",subsection:"Agent tooling",label:"Render resource link images",path:"mcpToolResultImageRendering.linkedResources.blob.image",description:"Resolve MCP resource link images and render them in the UI.",kind:{kind:"boolean"},read:e=>Gr(e,e.mcpToolResultImageRendering)?void 0:oL(e.mcpToolResultImageRendering)},{id:"progressiveToolDiscovery",section:"agent",subsection:"Agent tooling",label:"Progressive tools",path:"progressiveToolDiscovery",description:"search_mcp_tools / load_mcp_tools meta-tools above context thresholds. Undefined = client decides.",kind:{kind:"tri-state"},read:e=>e.progressiveToolDiscovery},{id:"systemPrompt",section:"agent",subsection:"System prompt",label:"System prompt",path:"systemPrompt",description:"Verbatim system prompt sent on every turn.",kind:{kind:"string-long"},read:e=>e.systemPrompt},{id:"clientInfo.version",section:"protocol",subsection:"clientInfo",label:"Client version",path:"mcpProfile.initialize.clientInfo.version",description:"Client name and version sent to the server.",kind:{kind:"string"},read:e=>{const t=Je(e)?.initialize?.clientInfo;return[typeof t?.name=="string"?t.name.trim():"",typeof t?.version=="string"?t.version.trim():""].filter(Boolean).join(" ")||void 0}},{id:"clientInfo.name",section:"protocol",subsection:"clientInfo",label:"Client name",path:"mcpProfile.initialize.clientInfo.name",description:"`initialize.clientInfo.name` sent to the server.",kind:{kind:"string"},read:e=>{const t=Je(e)?.initialize?.clientInfo;return typeof t?.name=="string"?t.name:void 0}},{id:"mcpProtocolVersion",section:"protocol",subsection:"Version",label:"Protocol version",path:"mcpProfile.mcpProtocolVersion",description:'Host default selection. "auto" negotiates at connect time; concrete versions pin that exact era. Per-server overrides win.',kind:{kind:"enum",options:["auto","2025-03-26","2025-06-18","2025-11-25","2026-07-28"]},read:e=>Je(e)?.mcpProtocolVersion},{id:"supportedProtocolVersions",section:"protocol",subsection:"Version",label:"Supported protocol versions",path:"mcpProfile.initialize.supportedProtocolVersions",description:"Accept-list supported in the initialize handshake.",kind:{kind:"string-array"},read:e=>e.supportedProtocolVersions??Je(e)?.initialize?.supportedProtocolVersions},{id:"capabilities.roots",section:"protocol",subsection:"Client capabilities supported",label:"Roots",path:"clientCapabilities.roots",description:"Filesystem roots exposed to the server.",kind:{kind:"capability"},read:e=>e.clientCapabilities?.roots},{id:"capabilities.sampling",section:"protocol",subsection:"Client capabilities supported",label:"Sampling",path:"clientCapabilities.sampling",description:"Server-initiated LLM calls.",kind:{kind:"capability"},read:e=>e.clientCapabilities?.sampling},{id:"capabilities.elicitation",section:"protocol",subsection:"Client capabilities supported",label:"Elicitation",path:"clientCapabilities.elicitation",description:"Mid-call structured prompts back to the user.",kind:{kind:"capability"},read:e=>e.clientCapabilities?.elicitation},{id:"capabilities.experimental",section:"protocol",subsection:"Client capabilities supported",label:"Experimental",path:"clientCapabilities.experimental",description:"Vendor-extension capabilities.",kind:{kind:"capability"},read:e=>e.clientCapabilities?.experimental},{id:"capabilities.skillsExtension",section:"protocol",subsection:"Client capabilities supported",label:"Skills over MCP",path:`clientCapabilities.extensions.${qd}`,description:"Server-served Agent Skills (skills/list, skills/get) with mandatory digest verification.",kind:{kind:"capability"},read:e=>e.clientCapabilities?.extensions?.[qd]},{id:"tasksPolicy",section:"protocol",subsection:"Client policy",label:"Task execution",path:`mcpProfile.extensions.${tn}.enabled`,description:"Whether surfaces beyond the Tools tab may run tools as MCP tasks.",kind:{kind:"enum",support:_L},read:e=>{const t=_g(e);return t==="unset"?void 0:t}},{id:"eventsDeliveryModes",section:"protocol",subsection:"Client policy",label:"Event delivery",path:`mcpProfile.extensions.${Z0}`,description:"The MCP Events delivery modes this client accepts.",kind:{kind:"mode-set",modes:P0,baseline:0},read:e=>{const t=v0(e);if(t.kind!=="unset")return t.kind==="valid"?t.modes:[]}},{id:"connectionDefaults.requestTimeout",section:"protocol",subsection:"Connection defaults",label:"Request timeout",path:"connectionDefaults.requestTimeout",description:"Outbound MCP request timeout.",kind:{kind:"duration-ms"},read:e=>e.connectionDefaults?.requestTimeout},{id:"connectionDefaults.headers",section:"protocol",subsection:"Connection defaults",label:"Default headers",path:"connectionDefaults.headers",description:"Default outbound headers (Authorization, etc.).",kind:{kind:"object",itemNoun:"header"},read:e=>e.connectionDefaults?.headers},...RL,...TL,...CL,{id:"uiInitialize.hostInfo",section:"apps",subsection:"MCP Apps spec bridge",label:"ui/initialize hostInfo",path:"mcpProfile.apps.uiInitialize.hostInfo",description:"Override the `hostInfo` sent in `ui/initialize`.",kind:{kind:"object",itemNoun:"field"},read:e=>Je(e)?.apps?.uiInitialize?.hostInfo},{id:"sandbox.csp.mode",section:"apps",subsection:"Sandbox",label:"CSP mode",path:"mcpProfile.apps.sandbox.csp.mode",description:"Starting CSP baseline for app iframes.",kind:{kind:"enum",options:["host-default","declared","relaxed"]},read:e=>Je(e)?.apps?.sandbox?.csp?.mode},{id:"sandbox.permissions.mode",section:"apps",subsection:"Sandbox",label:"Permissions mode",path:"mcpProfile.apps.sandbox.permissions.mode",description:"How spec permissions resolve in the iframe sandbox.",kind:{kind:"enum",options:["resource-declared","deny-all","custom"]},read:e=>Je(e)?.apps?.sandbox?.permissions?.mode},...AL,...PL,ML,...NL,...OL,jL,...LL,...DL,{id:"sandbox.sandboxAttrs",section:"apps",subsection:"Sandbox",label:"Sandbox attrs",path:"mcpProfile.apps.sandbox.sandboxAttrs",description:"Extra iframe `sandbox=` tokens unioned with `allow-scripts allow-same-origin`.",kind:{kind:"string-array"},read:e=>Je(e)?.apps?.sandbox?.sandboxAttrs},{id:"sandbox.allowFeatures",section:"apps",subsection:"Sandbox",label:"Permissions Policy features",path:"mcpProfile.apps.sandbox.allowFeatures",description:"Permissions Policy entries appended to the outer iframe.",kind:{kind:"object",itemNoun:"feature"},read:e=>Je(e)?.apps?.sandbox?.allowFeatures}],FL=new Map(gn.map(e=>[e.id,e]));function B2(e){const t=FL.get(e);if(!t)throw new Error(`hostConfigField: unknown field id "${e}". Did you rename it in host-config-field-schema.ts without updating callers?`);return t}function yc(e){return e===void 0?"__undef__":e===null?"null":typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(yc).join(",")}]`:`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${yc(e[t])}`).join(",")}}`}function Ab(e,t){if(t.length<2)return!1;const r=o=>yc(HL(e.read(o))),n=r(t[0]);for(let o=1;o<t.length;o+=1)if(r(t[o])!==n)return!0;return!1}function HL(e){if(e===null||typeof e!="object"||!("raw"in e))return e;const{raw:t,...r}=e;return r}function Nb(e=gn){return yL.map(t=>{const r=e.filter(s=>s.section===t.id),n=[],o=new Map;for(const s of r)o.has(s.subsection)||(n.push(s.subsection),o.set(s.subsection,[])),o.get(s.subsection).push(s);return{section:t,subsections:n.map(s=>({label:s,fields:o.get(s)}))}})}function As(e){const t=e.kind;return t.kind==="boolean"||t.kind==="tri-state"||t.kind==="capability"||t.kind==="mode-set"||t.kind==="enum"&&!!t.support}function Xn(e,t){const r=e.read(t);if(r===br)return"unsupported";switch(e.kind.kind){case"boolean":return r===void 0?null:r===!0?"supported":"neutral";case"tri-state":return r===!0?"supported":r===!1?"neutral":"partial";case"capability":return r==null?"neutral":typeof r=="object"?r.listChanged===!1?"partial":"supported":"neutral";case"enum":{const n=e.kind.support;return n?typeof r!="string"?"neutral":n[r]??"neutral":null}case"mode-set":{const n=e.kind.modes,o=new Set(Array.isArray(r)?r:[]),s=n.filter(a=>o.has(a)).length;return s>=n.length?"supported":s<=(e.kind.baseline??1)?"neutral":"partial"}default:return null}}function Pb(e,t){return t.map(r=>Xn(e,r)).filter(r=>r!==null)}function UL(e,t){if(!As(e))return null;const r=Pb(e,t);return r.length===0?null:{supported:r.filter(n=>n==="supported").length,total:r.length}}function $L(e,t,r){if(r==="all")return!0;if(!As(e))return!1;const n=Pb(e,t);if(n.length===0)return!1;switch(r){case"missing":return n.some(o=>o==="neutral"||o==="unsupported");case"partial":return n.some(o=>o==="partial");case"supported":return n.every(o=>o==="supported")}}function BL(e,t,r){if(r==="all")return!0;const n=Xn(e,t);if(n===null)return!1;switch(r){case"missing":return n==="neutral"||n==="unsupported";case"partial":return n==="partial";case"supported":return n==="supported"}}function wh(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}function Zu(e,t){const r=wh(t).split(/\s+/).filter(Boolean);if(r.length===0)return!0;const n=wh([e.id,e.label,e.subsection,e.path,e.description??""].join(" ")).split(/\s+/).filter(Boolean);return r.every(o=>n.some(s=>s.startsWith(o)))}function Mb(e){const t=e.searchQuery.trim().toLowerCase(),r=new Set;for(const n of e.fields??gn)e.divergingOnly&&!Ab(n,e.configs)||$L(n,e.configs,e.supportFilter)&&Zu(n,t)&&r.add(n.id);return r}function zL(e,t){const r=[];if(e.kind.kind!=="capability")return r;const n=e.read(t);if(!n||typeof n!="object")return r;const o=n;if(o.listChanged===!1&&r.push("Supported without list-changed notifications."),e.id==="capabilities.sampling"&&"tools"in o&&r.push("Supports tool use in sampling (SEP-1577)."),e.id==="capabilities.elicitation"){const s=["form","url"].filter(a=>a in o);s.length>0&&r.push(`Advertises ${s.map(a=>a==="url"?"URL":a).join(" and ")} elicitation.`)}return e.id==="capabilities.experimental"&&Object.keys(o).length>0&&r.push("Vendor / experimental — outside the core capability set."),r}var Ob=["preset:claude","preset:claude-desktop","preset:claude-code","preset:chatgpt","preset:codex","preset:codex-cli","preset:copilot","preset:copilot-cli","preset:cursor","preset:vscode","preset:slack"],WL=new Set(["modelId","temperature","systemPrompt","requireToolApproval","mcpProtocolVersion","clientInfo.name","connectionDefaults.requestTimeout","connectionDefaults.headers","uiInitialize.hostInfo","sandbox.csp.mode","sandbox.permissions.mode","sandbox.sandboxAttrs","sandbox.allowFeatures","unauthorizedChallenge","unauthorizedChallengeTrigger","toolResultAuthChallenge","toolResultAuthChallengeTrigger"]);function wn(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function qL(e){return e.id.startsWith("capabilities.")?wn(e.id.replace(/^capabilities\./,"")):e.id.startsWith("appsCap.")?`mcp-apps-${wn(e.label)}`:e.id.startsWith("openaiShim.")?`openai-shim-${wn(e.label)}`:e.id.startsWith("sandboxPerm.")?`sandbox-permission-${wn(e.label)}`:e.id.startsWith("styles.")?`style-${wn(e.label)}`:wn(e.label)}var VL=new Set(["supportedProtocolVersions","clientInfo.version"]),GL=["styles."];function jb(e){return WL.has(e.id)?!1:As(e)||VL.has(e.id)?!0:GL.some(t=>e.id.startsWith(t))}var Lb=gn.filter(jb),YL=gn.filter(e=>e.id==="mcpProtocolVersion"||jb(e));function Db(e,t){return Object.values(t).some(r=>e.read(r.config)!==void 0)}function Ni(e){return Lb.filter(t=>Db(t,e))}function JL(e){const t=new Set(Ni(e));return YL.filter(r=>r.id==="mcpProtocolVersion"||t.has(r))}var Wa={slug:"mcp-tasks",field:{id:"mcpTasks",section:"protocol",subsection:"Extensions",label:"MCP Tasks",path:"clientCapabilities.tasks",description:"Run long-lived MCP operations and check their progress.",kind:{kind:"string"},read:()=>{}}},KL=[...Lb.map(e=>({slug:qL(e),field:e})),Wa],bc=new Map,Fb=new Map;for(const e of KL){const t=bc.get(e.slug);if(t)throw new Error(`Duplicate caniuse capability slug "${e.slug}" for ${t.field.id} and ${e.field.id}`);bc.set(e.slug,e),Fb.set(e.field.id,e)}function Hb(e){return e?bc.get(e)??null:null}function ed(e){return Fb.get(e.id)??null}function is(e){return`/capabilities/${encodeURIComponent(e)}`}function td(e){const t=new Map(Ob.map((r,n)=>[r,n]));return[...e].sort((r,n)=>(t.get(r.hostId)??Number.POSITIVE_INFINITY)-(t.get(n.hostId)??Number.POSITIVE_INFINITY))}function XL(e,t){if((e.id.startsWith("toolResult.")||e.id.startsWith("sandbox.browserStorage.")||e.id==="sandbox.sameOriginAppIframe"||e.id.startsWith("toolListChanged.")||e.id==="paginationTraversal"||e.id.startsWith("toolCallCancellation.")||e.id==="unauthorizedChallenge"||e.id==="toolResultAuthChallenge"||e.id==="eventsDeliveryModes"||e.id.startsWith("appsCap.")||e.id.startsWith("modelVisibleMcpToolResults.")||e.id.startsWith("mcpToolResultImageRendering"))&&e.read(t)===void 0)return"unknown";const r=Xn(e,t);return r!==null?r:e.kind.kind==="boolean"&&e.read(t)===void 0?"neutral":"unknown"}var QL=new Set(["sandbox.sameOriginAppIframe"]);function rd(e,t){if(t!==void 0&&QL.has(t)){if(e==="supported")return"Yes";if(e==="neutral"||e==="unsupported")return"No"}switch(e){case"supported":return"Supported";case"partial":return"Partial";case"neutral":case"unsupported":return"Not supported";case"unknown":return"Not yet tested"}}var Ub=(0,f.createContext)(null);function z2({enabled:e=!0,children:t}){const[r,n]=(0,f.useState)([]),o=(0,f.useCallback)(s=>(n(a=>[...a,s]),()=>n(a=>a.filter(i=>i!==s))),[]);return(0,u.jsx)(Ub.Provider,{value:{active:r[0],enabled:e,enqueue:o},children:t})}function ZL(e){const t=(0,f.useContext)(Ub),r=(0,f.useId)(),[n,o]=(0,f.useState)(!1),s=(0,f.useCallback)(c=>{o(c!==null)},[]),a=t?.enabled??!0,i=a&&e||n,l=t?.enqueue;return(0,f.useLayoutEffect)(()=>{if(i)return l?.(r)},[l,r,i]),{enabled:a,open:a&&e&&(!t||t.active===r),contentRef:s}}var kh=null;function eD(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.hostedServices=="boolean"&&Array.isArray(t.hostedOnly)}function tD(){return kh??=Promise.resolve().then(()=>fetch("/api/web/capabilities",{cache:"no-store"})).then(async e=>{if(!e?.ok)return null;const t=await e.json().catch(()=>null);return eD(t)?t:null}).catch(()=>null),kh}function $b(e){const[t,r]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let n=!0;return tD().then(o=>{!n||!o||r(!o.hostedOnly.includes(e))}),()=>{n=!1}},[e]),t}function nd({...e}){return(0,u.jsx)($x,{"data-slot":"popover",...e})}function Bb({...e}){return(0,u.jsx)(zx,{"data-slot":"popover-trigger",...e})}function od({className:e,align:t="center",sideOffset:r=4,portalled:n=!0,...o}){const s=(0,u.jsx)(qx,{"data-slot":"popover-content",align:t,sideOffset:r,className:q("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o});return n?(0,u.jsx)(Wx,{children:s}):s}function rD({...e}){return(0,u.jsx)(Bx,{"data-slot":"popover-anchor",...e})}function nD({className:e,...t}){return(0,u.jsx)("textarea",{"data-slot":"textarea",className:q("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/30 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 min-w-0 rounded-md border bg-transparent px-3 py-2 text-base wrap-anywhere shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}var Ih=1,oD=.9,sD=.8,aD=.17,xl=.1,El=.999,iD=.9999,lD=.99,cD=/[\\\/_+.#"@\[\(\{&]/,uD=/[\\\/_+.#"@\[\(\{&]/g,dD=/[\s-]/,zb=/[\s-]/g;function Sc(e,t,r,n,o,s,a){if(s===t.length)return o===e.length?Ih:lD;var i=`${o},${s}`;if(a[i]!==void 0)return a[i];for(var l=n.charAt(s),c=r.indexOf(l,o),p=0,d,h,m,g;c>=0;)d=Sc(e,t,r,n,c+1,s+1,a),d>p&&(c===o?d*=Ih:cD.test(e.charAt(c-1))?(d*=sD,m=e.slice(o,c-1).match(uD),m&&o>0&&(d*=Math.pow(El,m.length))):dD.test(e.charAt(c-1))?(d*=oD,g=e.slice(o,c-1).match(zb),g&&o>0&&(d*=Math.pow(El,g.length))):(d*=aD,o>0&&(d*=Math.pow(El,c-o))),e.charAt(c)!==t.charAt(s)&&(d*=iD)),(d<xl&&r.charAt(c-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&r.charAt(c-1)!==n.charAt(s))&&(h=Sc(e,t,r,n,c+1,s+2,a),h*xl>d&&(d=h*xl)),d>p&&(p=d),c=r.indexOf(l,c+1);return a[i]=p,p}function Ch(e){return e.toLowerCase().replace(zb," ")}function pD(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Sc(e,t,Ch(e),Ch(t),0,0,{})}var xo='[cmdk-group=""]',wl='[cmdk-group-items=""]',fD='[cmdk-group-heading=""]',Wb='[cmdk-item=""]',Rh=`${Wb}:not([aria-disabled="true"])`,_c="cmdk-item-select",Tn="data-value",hD=(e,t,r)=>pD(e,t,r),qb=f.createContext(void 0),Ns=()=>f.useContext(qb),Vb=f.createContext(void 0),sd=()=>f.useContext(Vb),Gb=f.createContext(void 0),Yb=f.forwardRef((e,t)=>{let r=An(()=>{var P,$;return{search:"",value:($=(P=e.value)!=null?P:e.defaultValue)!=null?$:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=An(()=>new Set),o=An(()=>new Map),s=An(()=>new Map),a=An(()=>new Set),i=Jb(e),{label:l,children:c,value:p,onValueChange:d,filter:h,shouldFilter:m,loop:g,disablePointerSelection:S=!1,vimBindings:b=!0,..._}=e,v=Xt(),w=Xt(),E=Xt(),T=f.useRef(null),I=kD();un(()=>{if(p!==void 0){let P=p.trim();r.current.value=P,C.emit()}},[p]),un(()=>{I(6,O)},[]);let C=f.useMemo(()=>({subscribe:P=>(a.current.add(P),()=>a.current.delete(P)),snapshot:()=>r.current,setState:(P,$,Y)=>{var J,ae,ie,Se;if(!Object.is(r.current[P],$)){if(r.current[P]=$,P==="search")W(),A(),I(1,N);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Oe=document.getElementById(E);Oe?Oe.focus():(J=document.getElementById(v))==null||J.focus()}if(I(7,()=>{var Oe;r.current.selectedItemId=(Oe=G())==null?void 0:Oe.id,C.emit()}),Y||I(5,O),((ae=i.current)==null?void 0:ae.value)!==void 0){let Oe=$??"";(Se=(ie=i.current).onValueChange)==null||Se.call(ie,Oe);return}}C.emit()}},emit:()=>{a.current.forEach(P=>P())}}),[]),L=f.useMemo(()=>({value:(P,$,Y)=>{var J;$!==((J=s.current.get(P))==null?void 0:J.value)&&(s.current.set(P,{value:$,keywords:Y}),r.current.filtered.items.set(P,y($,Y)),I(2,()=>{A(),C.emit()}))},item:(P,$)=>(n.current.add(P),$&&(o.current.has($)?o.current.get($).add(P):o.current.set($,new Set([P]))),I(3,()=>{W(),A(),r.current.value||N(),C.emit()}),()=>{s.current.delete(P),n.current.delete(P),r.current.filtered.items.delete(P);let Y=G();I(4,()=>{W(),Y?.getAttribute("id")===P&&N(),C.emit()})}),group:P=>(o.current.has(P)||o.current.set(P,new Set),()=>{s.current.delete(P),o.current.delete(P)}),filter:()=>i.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:v,inputId:E,labelId:w,listInnerRef:T}),[]);function y(P,$){var Y,J;let ae=(J=(Y=i.current)==null?void 0:Y.filter)!=null?J:hD;return P?ae(P,r.current.search,$):0}function A(){if(!r.current.search||i.current.shouldFilter===!1)return;let P=r.current.filtered.items,$=[];r.current.filtered.groups.forEach(J=>{let ae=o.current.get(J),ie=0;ae.forEach(Se=>{let Oe=P.get(Se);ie=Math.max(Oe,ie)}),$.push([J,ie])});let Y=T.current;H().sort((J,ae)=>{var ie,Se;let Oe=J.getAttribute("id"),Xe=ae.getAttribute("id");return((ie=P.get(Xe))!=null?ie:0)-((Se=P.get(Oe))!=null?Se:0)}).forEach(J=>{let ae=J.closest(wl);ae?ae.appendChild(J.parentElement===ae?J:J.closest(`${wl} > *`)):Y.appendChild(J.parentElement===Y?J:J.closest(`${wl} > *`))}),$.sort((J,ae)=>ae[1]-J[1]).forEach(J=>{var ae;let ie=(ae=T.current)==null?void 0:ae.querySelector(`${xo}[${Tn}="${encodeURIComponent(J[0])}"]`);ie?.parentElement.appendChild(ie)})}function N(){let P=H().find(Y=>Y.getAttribute("aria-disabled")!=="true"),$=P?.getAttribute(Tn);C.setState("value",$||void 0)}function W(){var P,$,Y,J;if(!r.current.search||i.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let ae=0;for(let ie of n.current){let Se=y(($=(P=s.current.get(ie))==null?void 0:P.value)!=null?$:"",(J=(Y=s.current.get(ie))==null?void 0:Y.keywords)!=null?J:[]);r.current.filtered.items.set(ie,Se),Se>0&&ae++}for(let[ie,Se]of o.current)for(let Oe of Se)if(r.current.filtered.items.get(Oe)>0){r.current.filtered.groups.add(ie);break}r.current.filtered.count=ae}function O(){var P,$,Y;let J=G();J&&(((P=J.parentElement)==null?void 0:P.firstChild)===J&&((Y=($=J.closest(xo))==null?void 0:$.querySelector(fD))==null||Y.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function G(){var P;return(P=T.current)==null?void 0:P.querySelector(`${Wb}[aria-selected="true"]`)}function H(){var P;return Array.from(((P=T.current)==null?void 0:P.querySelectorAll(Rh))||[])}function X(P){let $=H()[P];$&&C.setState("value",$.getAttribute(Tn))}function j(P){var $;let Y=G(),J=H(),ae=J.findIndex(Se=>Se===Y),ie=J[ae+P];($=i.current)!=null&&$.loop&&(ie=ae+P<0?J[J.length-1]:ae+P===J.length?J[0]:J[ae+P]),ie&&C.setState("value",ie.getAttribute(Tn))}function U(P){let $=G(),Y=$?.closest(xo),J;for(;Y&&!J;)Y=P>0?ED(Y,xo):wD(Y,xo),J=Y?.querySelector(Rh);J?C.setState("value",J.getAttribute(Tn)):j(P)}let ee=()=>X(H().length-1),V=P=>{P.preventDefault(),P.metaKey?ee():P.altKey?U(1):j(1)},ue=P=>{P.preventDefault(),P.metaKey?X(0):P.altKey?U(-1):j(-1)};return f.createElement(it.div,{ref:t,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:P=>{var $;($=_.onKeyDown)==null||$.call(_,P);let Y=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||Y))switch(P.key){case"n":case"j":b&&P.ctrlKey&&V(P);break;case"ArrowDown":V(P);break;case"p":case"k":b&&P.ctrlKey&&ue(P);break;case"ArrowUp":ue(P);break;case"Home":P.preventDefault(),X(0);break;case"End":P.preventDefault(),ee();break;case"Enter":{P.preventDefault();let J=G();if(J){let ae=new Event(_c);J.dispatchEvent(ae)}}}}},f.createElement("label",{"cmdk-label":"",htmlFor:L.inputId,id:L.labelId,style:CD},l),Pi(e,P=>f.createElement(Vb.Provider,{value:C},f.createElement(qb.Provider,{value:L},P))))}),mD=f.forwardRef((e,t)=>{var r,n;let o=Xt(),s=f.useRef(null),a=f.useContext(Gb),i=Ns(),l=Jb(e),c=(n=(r=l.current)==null?void 0:r.forceMount)!=null?n:a?.forceMount;un(()=>{if(!c)return i.item(o,a?.id)},[c]);let p=Kb(o,s,[e.value,e.children,s],e.keywords),d=sd(),h=Fr(I=>I.value&&I.value===p.current),m=Fr(I=>c||i.filter()===!1?!0:I.search?I.filtered.items.get(o)>0:!0);f.useEffect(()=>{let I=s.current;if(!(!I||e.disabled))return I.addEventListener(_c,g),()=>I.removeEventListener(_c,g)},[m,e.onSelect,e.disabled]);function g(){var I,C;S(),(C=(I=l.current).onSelect)==null||C.call(I,p.current)}function S(){d.setState("value",p.current,!0)}if(!m)return null;let{disabled:b,value:_,onSelect:v,forceMount:w,keywords:E,...T}=e;return f.createElement(it.div,{ref:Uo(s,t),...T,id:o,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!h,"data-disabled":!!b,"data-selected":!!h,onPointerMove:b||i.getDisablePointerSelection()?void 0:S,onClick:b?void 0:g},e.children)}),gD=f.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...s}=e,a=Xt(),i=f.useRef(null),l=f.useRef(null),c=Xt(),p=Ns(),d=Fr(m=>o||p.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);un(()=>p.group(a),[]),Kb(a,i,[e.value,e.heading,l]);let h=f.useMemo(()=>({id:a,forceMount:o}),[o]);return f.createElement(it.div,{ref:Uo(i,t),...s,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},r&&f.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},r),Pi(e,m=>f.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},f.createElement(Gb.Provider,{value:h},m))))}),vD=f.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=f.useRef(null),s=Fr(a=>!a.search);return!r&&!s?null:f.createElement(it.div,{ref:Uo(o,t),...n,"cmdk-separator":"",role:"separator"})}),yD=f.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=e.value!=null,s=sd(),a=Fr(c=>c.search),i=Fr(c=>c.selectedItemId),l=Ns();return f.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),f.createElement(it.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":i,id:l.inputId,type:"text",value:o?e.value:a,onChange:c=>{o||s.setState("search",c.target.value),r?.(c.target.value)}})}),bD=f.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,s=f.useRef(null),a=f.useRef(null),i=Fr(c=>c.selectedItemId),l=Ns();return f.useEffect(()=>{if(a.current&&s.current){let c=a.current,p=s.current,d,h=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let m=c.offsetHeight;p.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(c),()=>{cancelAnimationFrame(d),h.unobserve(c)}}},[]),f.createElement(it.div,{ref:Uo(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":n,id:l.listId},Pi(e,c=>f.createElement("div",{ref:Uo(a,l.listInnerRef),"cmdk-list-sizer":""},c)))}),SD=f.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:s,container:a,...i}=e;return f.createElement(Wm,{open:r,onOpenChange:n},f.createElement(Gm,{container:a},f.createElement(Ym,{"cmdk-overlay":"",className:o}),f.createElement(Jm,{"aria-label":e.label,"cmdk-dialog":"",className:s},f.createElement(Yb,{ref:t,...i}))))}),_D=f.forwardRef((e,t)=>Fr(r=>r.filtered.count===0)?f.createElement(it.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),xD=f.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...s}=e;return f.createElement(it.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Pi(e,a=>f.createElement("div",{"aria-hidden":!0},a)))}),vn=Object.assign(Yb,{List:bD,Item:mD,Input:yD,Group:gD,Separator:vD,Dialog:SD,Empty:_D,Loading:xD});function ED(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function wD(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Jb(e){let t=f.useRef(e);return un(()=>{t.current=e}),t}var un=typeof window>"u"?f.useEffect:f.useLayoutEffect;function An(e){let t=f.useRef();return t.current===void 0&&(t.current=e()),t}function Fr(e){let t=sd(),r=()=>e(t.snapshot());return f.useSyncExternalStore(t.subscribe,r,r)}function Kb(e,t,r,n=[]){let o=f.useRef(),s=Ns();return un(()=>{var a;let i=(()=>{var c;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(c=p.current.textContent)==null?void 0:c.trim():o.current}})(),l=n.map(c=>c.trim());s.value(e,i,l),(a=t.current)==null||a.setAttribute(Tn,i),o.current=i}),o}var kD=()=>{let[e,t]=f.useState(),r=An(()=>new Map);return un(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,o)=>{r.current.set(n,o),t({})}};function ID(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Pi({asChild:e,children:t},r){return e&&f.isValidElement(t)?f.cloneElement(ID(t),{ref:t.ref},r(t.props.children)):r(t)}var CD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function ad({className:e,...t}){return(0,u.jsx)(vn,{"data-slot":"command",className:q("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function Xb({className:e,...t}){return(0,u.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,u.jsx)(nu,{className:"size-4 shrink-0 opacity-50"}),(0,u.jsx)(vn.Input,{"data-slot":"command-input",className:q("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function id({className:e,...t}){return(0,u.jsx)(vn.List,{"data-slot":"command-list",className:q("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function ld({...e}){return(0,u.jsx)(vn.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Qb({className:e,...t}){return(0,u.jsx)(vn.Group,{"data-slot":"command-group",className:q("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function W2({className:e,...t}){return(0,u.jsx)(vn.Separator,{"data-slot":"command-separator",className:q("bg-border -mx-1 h-px",e),...t})}function cd({className:e,...t}){return(0,u.jsx)(vn.Item,{"data-slot":"command-item",className:q("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function RD(e,t){const r=new Map;for(const n of e)r.get(n.name)?.projectId===t&&n.projectId!==t||r.set(n.name,n);return r}var TD=new Set(["none","null","undefined"]),AD=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,ND=["local_","project_"];function ud(e){const t=e?.trim();if(!t)return!1;const r=t.toLowerCase();return!TD.has(r)&&!AD.test(t)&&!ND.some(n=>r.startsWith(n))}function PD(e){return typeof e=="object"&&e!==null&&Array.isArray(e.members)}function MD(e){return Array.isArray(e)?{members:e,canManageMembers:!1}:PD(e)?{members:e.members,canManageMembers:e.canManageMembers}:{members:[],canManageMembers:!1}}function OD(e,t){return!e||!t?e:e.filter(r=>r.organizationId===t)}function jD({isAuthenticated:e,organizationId:t}){const r=Ti(),n=eo("projects:getMyProjects",e&&r?{}:"skip"),o=e&&(!r||n===void 0),s=(0,f.useMemo)(()=>OD(n,t),[n,t]);return{allProjects:n,projects:s,sortedProjects:(0,f.useMemo)(()=>s?[...s].sort((a,i)=>i.updatedAt-a.updatedAt):[],[s]),isLoading:o,hasProjects:(s?.length??0)>0,hasAnyProjects:(n?.length??0)>0}}var q2="Only project admins can create clients.";function V2({isAuthenticated:e,projectId:t}){const{allProjects:r,isLoading:n}=jD({isAuthenticated:e});return{canManage:(t?r?.find(o=>o._id===t):void 0)?.canDeleteProject===!0,isLoading:n}}function LD({isAuthenticated:e,projectId:t}){const r=e&&!!t,n=eo("projects:getProjectMembers",r?{projectId:t}:"skip"),o=r&&n===void 0,{members:s,canManageMembers:a}=(0,f.useMemo)(()=>MD(n),[n]),i=(0,f.useMemo)(()=>s?s.filter(c=>!c.isPending):[],[s]),l=(0,f.useMemo)(()=>s?s.filter(c=>c.isPending):[],[s]);return{members:s,activeMembers:i,pendingMembers:l,canManageMembers:a,isLoading:o,hasPendingMembers:l.length>0}}function G2(e){return e==="owner"||e==="admin"||e==="member"}function Y2(e){return e==="owner"||e==="admin"||e==="member"}function DD(e){return e==="owner"||e==="admin"}function J2(e){return e.isWorkOsSignedIn?DD(e.role):e.isAuthenticated&&e.hasProject&&!e.identityLoading}function K2({isAuthenticated:e,projectId:t,viewerEmail:r,identityLoading:n=!1}){const{activeMembers:o,isLoading:s}=LD({isAuthenticated:e,projectId:t}),a=r?.trim().toLowerCase()??null,i=(0,f.useMemo)(()=>{if(a)return o.find(h=>h.email.toLowerCase()===a)?.role},[o,a]),l=(0,f.useRef)(null),c=`${t??""}|${a??""}`,p=FD(s,n,r);p||(l.current={key:c,role:i});const d=l.current;return p&&d?.key===c?{role:d.role,isLoading:!1}:{role:i,isLoading:p}}function FD(e,t,r){return t?!0:r?.trim()?e:!1}function X2(){const e=Qe("projects:createProject"),t=Qe("projects:ensureDefaultProject");return{createProject:(0,f.useCallback)(r=>e({...r,themeMode:lh()}),[e]),ensureDefaultProject:(0,f.useCallback)((r={})=>t({...r,themeMode:lh()}),[t]),updateProject:Qe("projects:updateProject"),patchProjectDefaultConnection:Qe("hostConfigsV2:patchProjectDefaultConnection"),deleteProject:Qe("projects:deleteProject"),inviteProjectMember:Qe("projects:inviteProjectMember"),removeProjectMember:Qe("projects:removeProjectMember"),updateProjectMemberRole:Qe("projects:updateProjectMemberRole"),updateProjectInviteRole:Qe("projects:updateProjectInviteRole")}}function Q2(){const e=Qe("servers:createServer"),t=Qe("servers:createServerIfMissing"),r=Qe("servers:updateServer"),n=Qe("servers:deleteServer");return{createServer:e,createServerIfMissing:t,updateServer:r,createServerWithClientSecret:Fi("servers:createServerWithClientSecret"),moveServerToProject:Fi("servers:moveServerToProject"),updateServerWithClientSecret:Fi("servers:updateServerWithClientSecret"),deleteServer:n}}function Z2({projectId:e,isAuthenticated:t}){const r=Ti(),n=t&&r&&ud(e),o=e?.trim()??"",s=eo("servers:getProjectServers",n?{projectId:o}:"skip"),a=n&&s===void 0;return{servers:s,serversRecord:(0,f.useMemo)(()=>s?Object.fromEntries(RD(s,o)):{},[s,o]),isLoading:a,hasServers:(s?.length??0)>0}}function eB({projectIds:e,isAuthenticated:t}){const r=e.join("|"),n=(0,f.useMemo)(()=>e.length===0?[]:Array.from(new Set(e)).slice(0,500),[r]),o=eo("servers:listForProjects",t&&n.length>0?{projectIds:n}:"skip"),s=t&&n.length>0&&o===void 0;return{serversByProject:(0,f.useMemo)(()=>o??{},[o]),isLoading:s}}function HD(e){return e?.type==="user_testing"}function Th(e){return e.filter(t=>!HD(t.ownerScope))}var UD=s_("projectClients:ensureProjectClient");function $D({isAuthenticated:e,projectId:t,includePrivateBacking:r=!1}){const n=Ti(),o=t?.trim()??"",s=ud(o),a=eo("hosts:listHosts",e&&n&&s?{projectId:o}:"skip");return{hosts:(0,f.useMemo)(()=>{const i=a??[],l=Th(i),c=vm(l),p=i.map(d=>({...d,displayName:c.get(d.hostId)??d.name}));return r?p:Th(p)},[a,r]),isLoading:a===void 0}}var BD=/^[a-z0-9]{20,}$/i;function zD(e){const t=e?.trim();return!!(t&&BD.test(t))}function WD({isAuthenticated:e,hostId:t}){const r=Ti(),n=zD(t),o=e&&r&&n,s=t?.trim()??"",a=eo("hosts:getHost",o?{hostId:s}:"skip");return{host:a??null,isLoading:e&&n&&a===void 0}}function tB(){return{createHost:Qe("hosts:createHost"),updateHost:Qe("hosts:updateHost"),updateHostServers:Qe("hosts:updateHostServers"),deleteHost:Qe("hosts:deleteHost"),duplicateHost:Qe("hosts:duplicateHost"),ensureProjectClient:Qe(UD)}}var qD="claude-code-host-enabled";function VD(){const e=vr(qD),t=vr("local-harness-enabled");return e===!0||t===!0?!0:e===void 0||t===void 0?void 0:!1}function GD(){return VD()===!0}var YD="codex-host-enabled",JD="local-codex-enabled";function KD(){const e=vr(YD),t=vr(JD);return e===!0||t===!0?!0:e===void 0||t===void 0?void 0:!1}function XD(){return KD()===!0}function QD(){const e=vr("copilot-cli-harness");return vr("local-copilot-cli-enabled")}var ZD="cursor-host-enabled";function eF(){return vr(ZD)}function tF(){return eF()===!0}var rF="opencode-host-enabled";function nF(){return vr(rF)}function oF(){return nF()===!0}function sF(){return vr(T1)}function aF(){return sF()===!0}var dd=(0,f.createContext)(null),rB=({children:e,themeMode:t,themePreset:r,hostStyle:n})=>{const o=(0,f.useRef)(null);return o.current??=tb({themeMode:t,themePreference:ob()==="system"?"system":t,themePreset:r,hostStyle:n}),(0,f.useEffect)(()=>{const s=o.current,a=window.matchMedia?.("(prefers-color-scheme: dark)"),i=()=>{const p=s.getState().themePreference,d=Wu(p);s.getState().themeMode!==d&&s.setState({themeMode:d}),sb(d)};i();const l=s.subscribe((p,d)=>{p.themePreference!==d.themePreference&&i()}),c=()=>{s.getState().themePreference==="system"&&i()};return a?.addEventListener("change",c),()=>{l(),a?.removeEventListener("change",c)}},[]),(0,u.jsx)(dd.Provider,{value:o.current,children:e})},qa=e=>{const t=(0,f.useContext)(dd);if(!t)throw new Error("Missing PreferencesStoreProvider");return $m(t,e)},Ah=null,nB=e=>{Ah??=tb();const t=(0,f.useContext)(dd)??Ah;return $m(t,e)},Nh={xs:"size-3",default:"size-3.5",sm:"size-3.5",md:"size-4",stack:"size-5"};function Va({logoSrc:e,name:t,size:r,className:n}){if(e){const o=e===mc("opencode","light")||e===mc("opencode","dark");return(0,u.jsx)("img",{src:e,alt:"",className:q("shrink-0 object-contain",o?"h-5 w-4":Nh[r],n)})}return(0,u.jsx)("span",{"aria-hidden":!0,className:q("flex shrink-0 items-center justify-center rounded-md bg-muted font-semibold uppercase text-muted-foreground",r==="stack"||r==="md"?"text-[9px]":r==="xs"?"text-[7px]":"text-[8px]",Nh[r],n),children:t.slice(0,2)})}function oB({name:e,hostId:t,logoSrc:r,size:n="default",layout:o="inline",className:s}){const a=r??Sb(e),i=t??e,l=o==="stack"?"stack":n;return o==="stack"?(0,u.jsxs)("span",{className:q("inline-flex max-w-[11rem] flex-col items-center gap-1 text-foreground",s),title:i,children:[(0,u.jsx)(Va,{logoSrc:a,name:e,size:l}),(0,u.jsx)("span",{className:q("max-w-full truncate text-center font-medium leading-tight",n==="sm"?"text-[11px]":"text-xs"),children:e})]}):(0,u.jsxs)("span",{className:q("inline-flex max-w-[180px] items-center gap-1.5 rounded-full border text-foreground","border-primary/35 bg-primary/8 shadow-xs",n==="sm"?"px-2 py-0.5 text-[11px]":"px-2.5 py-1 text-[12px]",s),title:i,children:[(0,u.jsx)(Va,{logoSrc:a,name:e,size:l}),(0,u.jsx)("span",{className:"min-w-0 truncate font-medium leading-tight",children:e})]})}var iF=Math.max(6,Ob.length);function lF({hosts:e,selectedHostIds:t,subjectsByHost:r,onToggleHost:n,viewMode:o,onViewModeChange:s,filters:a,divergingOnly:i,onDivergingOnlyChange:l,showDescriptions:c,onShowDescriptionsChange:p,descriptionsDisabled:d=!1,disabled:h=!1,themeMode:m="light",mobileOptimized:g=!1}){const S=new Set(t),b=cF(e,S),_=new Set(b.map(w=>w.hostId)),v=e.filter(w=>!_.has(w.hostId));return(0,u.jsxs)("div",{className:q("mb-4 flex flex-wrap items-start gap-2",g&&"min-w-0"),children:[(0,u.jsxs)("div",{className:q("flex min-w-0 flex-1 flex-wrap items-center gap-2",g&&"basis-full"),children:[b.map(w=>(0,u.jsx)(dF,{host:w,subject:r[w.hostId],selected:S.has(w.hostId),onToggle:()=>n(w.hostId),disabled:h,themeMode:m},w.hostId)),v.length>0?(0,u.jsx)(pF,{hosts:v,selectedSet:S,subjectsByHost:r,onToggleHost:n,disabled:h,themeMode:m}):null]}),(0,u.jsxs)("div",{className:q("ml-auto flex shrink-0 items-center gap-4",g&&"ml-0 min-w-0 w-full flex-wrap gap-x-3 gap-y-2 sm:justify-end"),children:[o!==void 0&&s!==void 0?(0,u.jsx)(uF,{viewMode:o,onViewModeChange:s,disabled:h}):null,a,(0,u.jsxs)("label",{className:q("flex cursor-pointer items-center gap-2 text-[12px] text-muted-foreground",(h||d)&&"cursor-not-allowed opacity-40",g&&"shrink-0"),title:d?"Descriptions are available in table view":void 0,children:[(0,u.jsx)(pc,{checked:c,disabled:h||d,onCheckedChange:p,"aria-label":"Show field descriptions"}),(0,u.jsx)("span",{children:"Descriptions"})]}),(0,u.jsxs)("label",{className:q("flex cursor-pointer items-center gap-2 text-[12px] text-muted-foreground",h&&"cursor-not-allowed opacity-40",g&&"shrink-0"),children:[(0,u.jsx)(pc,{checked:i,disabled:h,onCheckedChange:l,"aria-label":"Show only diverging fields"}),(0,u.jsx)("span",{children:"Only diverging"})]})]})]})}function cF(e,t){const r=e.filter(o=>t.has(o.hostId)),n=Math.max(0,iF-r.length);return[...r,...e.filter(o=>!t.has(o.hostId)).slice(0,n)]}function uF({viewMode:e,onViewModeChange:t,disabled:r}){return(0,u.jsx)("div",{role:"group","aria-label":"View mode",className:"flex shrink-0 items-center gap-0.5 rounded-full border border-border p-0.5",children:[{value:"table",label:"Tables"},{value:"list",label:"List"}].map(n=>{const o=e===n.value;return(0,u.jsx)("button",{type:"button","aria-pressed":o,disabled:r,"data-testid":`compare-view-${n.value}`,onClick:()=>t(n.value),className:q("rounded-full px-2.5 py-0.5 text-[11px] transition-colors","disabled:cursor-not-allowed disabled:opacity-40","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",o?"bg-primary/10 text-foreground":"text-muted-foreground hover:text-foreground"),children:n.label},n.value)})})}function dF({host:e,subject:t,selected:r,onToggle:n,disabled:o,themeMode:s}){const a=t!==void 0?pn(t.hostStyle,t.config.chatUiOverride,s):_b(e,s),i=Lc();return(0,u.jsxs)(Nr.button,{type:"button",disabled:o,"aria-pressed":r,"data-testid":`host-compare-chip-${e.hostId}`,"data-selected":r?"true":"false",className:q("inline-flex max-w-[180px] items-center gap-1.5 rounded-full border px-2.5 py-1 text-[12px]","transition-colors duration-150","disabled:cursor-not-allowed disabled:opacity-50","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",r?"border-primary/35 bg-primary/8 text-foreground shadow-xs":"border-border bg-background text-muted-foreground hover:bg-muted/40 hover:text-foreground"),whileHover:i||o?void 0:{scale:1.04},whileTap:i||o?void 0:{scale:.94},animate:i?void 0:{y:r?-1:0},transition:{type:"spring",stiffness:480,damping:28,mass:.5},onClick:n,children:[(0,u.jsx)(Va,{logoSrc:a,name:en(e),size:"sm"}),(0,u.jsx)("span",{className:"truncate",children:en(e)})]})}function pF({hosts:e,selectedSet:t,subjectsByHost:r,onToggleHost:n,disabled:o,themeMode:s}){const a=e.filter(i=>t.has(i.hostId)).length;return(0,u.jsxs)(nd,{children:[(0,u.jsx)(Bb,{asChild:!0,children:(0,u.jsxs)(Ke,{type:"button",variant:"outline",size:"sm",disabled:o,className:"h-7 gap-1 rounded-full px-2.5 text-[12px]","data-testid":"host-compare-overflow-trigger",children:["More",a>0?(0,u.jsxs)("span",{className:"text-muted-foreground",children:["(",a,")"]}):null,(0,u.jsx)($c,{className:"size-3.5 opacity-60"})]})}),(0,u.jsx)(od,{align:"start",className:"w-[240px] p-0",children:(0,u.jsxs)(ad,{shouldFilter:!0,children:[(0,u.jsx)(Xb,{placeholder:"Search clients"}),(0,u.jsxs)(id,{children:[(0,u.jsx)(ld,{children:"No matching clients."}),e.map(i=>{const l=t.has(i.hostId),c=r[i.hostId],p=c!==void 0?pn(c.hostStyle,c.config.chatUiOverride,s):_b(i,s);return(0,u.jsxs)(cd,{value:`${en(i)} ${i.name} ${i.hostId}`,onSelect:()=>n(i.hostId),"data-testid":`host-compare-overflow-${i.hostId}`,children:[(0,u.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,u.jsx)(Va,{logoSrc:p,name:en(i),size:"sm"}),(0,u.jsx)("span",{className:"truncate",children:en(i)})]}),(0,u.jsx)("span",{className:q("text-[11px]",l?"text-foreground":"text-muted-foreground"),children:l?"Shown":"Hidden"})]},i.hostId)})]})]})})]})}var fF={backgroundImage:"linear-gradient(45deg, rgba(120,120,120,0.35) 25%, transparent 25%, transparent 75%, rgba(120,120,120,0.35) 75%), linear-gradient(45deg, rgba(120,120,120,0.35) 25%, transparent 25%, transparent 75%, rgba(120,120,120,0.35) 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px"};function Ph({value:e,className:t}){return(0,u.jsx)("span",{"aria-hidden":!0,className:q("inline-block size-3 shrink-0 overflow-hidden rounded-[3px] border border-border/70 align-middle",t),style:fF,children:(0,u.jsx)("span",{className:"block size-full",style:{backgroundColor:e}})})}function hF({currentTarget:e,target:t}){if(!t.matches(":focus-visible"))return;const r=t.closest("td, th"),n=r?.parentElement?.firstElementChild;if(!r||r===n||!n)return;const o=n.getBoundingClientRect().right+3,s=e.getBoundingClientRect().left+e.clientWidth-3,a=t.getBoundingClientRect();a.left<o?e.scrollLeft+=Math.floor(a.left-o):a.right>s&&(e.scrollLeft+=Math.ceil(a.right-s))}function mF({groups:e,visibleFieldIds:t,...r}){return e.flatMap(({section:n,subsections:o})=>o.map(({label:s,fields:a})=>{const i=a.filter(({id:l})=>t.has(l));return i.length===0?null:(0,u.jsxs)(f.Fragment,{children:[(0,u.jsx)("tr",{className:"border-b border-border bg-muted",children:(0,u.jsx)("th",{colSpan:r.subjects.length+2,className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground sm:px-5",children:n.label===s?s:`${n.label} / ${s}`})}),i.map(l=>(0,u.jsx)(gF,{field:l,...r},l.id))]},`${n.id}-${s}`)}))}function gF({field:e,renderCell:t,subjects:r,summaryColumn:n,showDescriptions:o,mobileOptimized:s}){const a=n.renderSlices?.(e);return(0,u.jsxs)("tr",{className:"border-b border-border last:border-b-0",children:[(0,u.jsxs)("th",{scope:"row",className:"sticky left-0 z-10 bg-card font-normal px-3 py-2.5 text-left after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:w-px after:bg-border after:content-[''] sm:px-5",children:[(0,u.jsx)("span",{className:"text-[13px] font-medium leading-tight text-foreground [overflow-wrap:anywhere]",children:n.renderFieldLabel?.(e)??e.label}),e.description&&o&&(0,u.jsx)("div",{className:"mt-1 text-[11px] leading-snug text-muted-foreground",children:e.description})]}),(0,u.jsx)("td",{className:q("border-l border-border px-2 py-2.5 align-top sm:px-3",s&&"[&_a]:scroll-ml-[var(--matrix-field-width)]"),children:(0,u.jsxs)("div",{className:"flex flex-col gap-1 text-left tabular-nums",children:[n.render(e),a&&(0,u.jsx)("div",{role:"group","aria-label":"Adoption by mode",className:"mt-1 grid grid-cols-3 gap-x-1.5 gap-y-2 border-t border-border pt-2",children:a})]})}),r.map(i=>(0,u.jsx)("td",{className:"border-l border-border px-3 py-2.5 text-center align-top sm:px-4",children:(0,u.jsx)(t,{field:e,subject:i,mobileOptimized:s,compact:!0})},i.hostId))]})}function Zb({subject:e,href:t,className:r}){return t?(0,u.jsxs)(to,{children:[(0,u.jsx)(ro,{asChild:!0,children:(0,u.jsx)("a",{href:t,"data-testid":`host-compare-verify-${e.hostId}`,className:q(r,"scroll-ml-[var(--matrix-field-width)] rounded-sm break-words underline decoration-border underline-offset-4 hover:text-primary focus-visible:outline-2 focus-visible:outline-ring"),children:e.hostName})}),(0,u.jsx)(no,{side:"top",sideOffset:6,variant:"muted",className:"dark",children:"Verify against your server"})]}):(0,u.jsx)("span",{className:q(r,"break-words"),children:e.hostName})}function eS({id:e,subject:t,className:r,compact:n}){const o=za(t.verifiedAt),s=Eb(t.verifiedAt);return o==="—"?null:(0,u.jsxs)("time",{id:e,dateTime:o,title:s?xb:void 0,className:q("mt-1.5 inline-flex items-center gap-1 text-[10px] leading-tight font-normal text-muted-foreground",r),children:[s&&(0,u.jsx)(Cm,{className:"size-3 shrink-0","aria-hidden":!0}),(0,u.jsxs)("span",{children:[n?(0,u.jsx)("span",{className:"sr-only",children:`Verified on ${o}`}):"Verified on ",(0,u.jsx)("span",{"aria-hidden":n||void 0,className:"whitespace-nowrap",children:o})]})]})}function vF({groups:e,visibleFieldIds:t,subjects:r,summaryColumn:n,showDescriptions:o,themeMode:s,renderCell:a,verifyHref:i}){const l=r.map(c=>({subject:c,href:i(c.hostId),logo:pn(c.hostStyle,c.config.chatUiOverride,s)}));return(0,u.jsx)("div",{"data-caniuse-matrix":"","data-testid":"compare-matrix",className:"min-w-0",children:e.flatMap(({section:c,subsections:p})=>p.map(({label:d,fields:h})=>{const m=h.filter(({id:g})=>t.has(g));return m.length?(0,u.jsxs)("section",{children:[(0,u.jsx)("h3",{className:"border-y border-border bg-muted px-3 py-1.5 text-xs font-semibold text-muted-foreground",children:c.label===d?d:`${c.label} / ${d}`}),m.map(g=>{const S=n.render(g),b=n.renderSlices?.(g);return(0,u.jsxs)("article",{"aria-label":g.label,className:"border-b border-border last:border-b-0",children:[(0,u.jsxs)("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[(0,u.jsxs)("div",{className:"min-w-0",children:[(0,u.jsx)("h4",{className:"text-base font-semibold [overflow-wrap:anywhere]",children:n.renderFieldLabel?.(g)??g.label}),o&&g.description&&(0,u.jsx)("p",{className:"mt-1 text-xs leading-snug text-muted-foreground",children:g.description})]}),S&&(0,u.jsxs)("div",{className:"max-w-[45%] shrink-0 tabular-nums",children:[(0,u.jsx)("div",{className:"text-[10px] text-muted-foreground",children:n.label}),S]})]}),(0,u.jsx)("ul",{children:l.map(({subject:_,href:v,logo:w})=>(0,u.jsxs)("li",{className:"grid min-h-9 grid-cols-[minmax(0,1fr)_40%] items-center gap-2 border-t border-border px-3 py-1.5",children:[(0,u.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,u.jsx)("img",{src:w,alt:"",className:"size-5 shrink-0 object-contain"}),(0,u.jsx)("div",{className:"min-w-0 [overflow-wrap:anywhere]",children:(0,u.jsx)(Zb,{subject:_,href:v,className:"block text-sm font-semibold leading-tight"})})]}),(0,u.jsx)("div",{className:"min-w-0 text-left leading-tight [overflow-wrap:anywhere] [&>*]:max-w-full [&>.inline-flex]:justify-start [&_[data-support-level]]:text-xs [&_[data-support-level]]:whitespace-normal",children:(0,u.jsx)(a,{field:g,subject:_,mobileOptimized:!0,compact:!0,stacked:!0})})]},_.hostId))}),b&&(0,u.jsx)("div",{role:"group","aria-label":"Adoption by mode",className:"grid grid-cols-3 gap-x-1.5 gap-y-2 border-t border-border px-3 py-2 tabular-nums",children:b})]},g.id)})]},`${c.id}-${d}`):null}))})}var yF={supported:"bg-success/50 text-foreground",partial:"bg-warning/50 text-foreground",neutral:"bg-muted/40 text-muted-foreground",unsupported:"bg-destructive/50 text-foreground",unknown:"bg-muted/40 text-muted-foreground"},bF={supported:"bg-success",partial:"bg-warning",neutral:"bg-muted-foreground/50",unsupported:"bg-destructive",unknown:"bg-muted-foreground/50"};function Ht({level:e,label:t,className:r,truncateLabel:n=!1}){return(0,u.jsxs)("span",{"data-support-level":e,className:q("inline-flex items-center gap-1.5 rounded-full px-2 py-0.5",n&&"max-w-full","text-[11px] font-medium leading-none whitespace-nowrap",yF[e],r),children:[(0,u.jsx)("span",{"aria-hidden":!0,"data-support-dot":"",className:q("size-1.5 rounded-full",bF[e])}),n?(0,u.jsx)("span",{className:"min-w-0 truncate",children:t}):t]})}var SF="template",pd="hostTab",Mh={agent:"behavior",tools:"tools",browser:"browser",computer:"computer",protocol:"protocol",apps:"apps",events:"events",appearance:"appearance"},_F={behavior:"agent",tools:"tools",browser:"browser",computer:"computer",protocol:"protocol",apps:"apps",events:"events",appearance:"appearance"};function tS(e){return _F[e]??null}function sB(e){const t=new URLSearchParams(e.startsWith("?")?e:`?${e}`).get(pd);return t?t==="behavior"?"behavior":t in Mh?Mh[t]:null:null}function aB(e,t){const r=tS(t);if(!e)return _a.hosts;const n=X0(e);return r?`${n}?${new URLSearchParams({[pd]:r}).toString()}`:n}function xF(e,t="behavior"){const r=new URLSearchParams({[SF]:e}),n=tS(t);return n&&r.set(pd,n),r.toString()}function rS({subjects:e,summaryColumn:t,fields:r=gn,divergingOnly:n=!1,supportFilter:o="all",searchQuery:s="",showDescriptions:a=!1,onRemoveHost:i,themeMode:l="light",mobileOptimized:c=!1,stacked:p=!1,verifyBaseUrl:d,disabledVerifyTemplateIds:h}){const m=(0,f.useMemo)(()=>Nb(r),[r]),g=(0,f.useMemo)(()=>e.map(E=>E.config),[e]),S=(0,f.useMemo)(()=>{const E=new Set;for(const T of r)Ab(T,g)&&E.add(T.id);return E},[g,r]),b=s.trim().length>0&&o!=="all",_=(0,f.useMemo)(()=>Mb({fields:r,configs:g,divergingOnly:n,supportFilter:b?"all":o,searchQuery:s}),[r,g,n,o,s,b]),v=(0,f.useMemo)(()=>r.filter(E=>_.has(E.id)),[r,_]),w=(0,f.useMemo)(()=>b?e.filter(E=>v.some(T=>BL(T,E.config,o))):e,[e,o,b,v]);return e.length===0?(0,u.jsx)("div",{className:"flex h-full min-h-[200px] items-center justify-center text-sm text-muted-foreground",children:"No clients to compare. Create at least one client in this project."}):_.size===0?(0,u.jsx)("div",{className:"flex h-full min-h-[160px] items-center justify-center rounded-xl border border-border bg-card text-sm text-muted-foreground",children:"No fields match the current search and filters."}):w.length===0?(0,u.jsx)("div",{className:"flex h-full min-h-[160px] items-center justify-center rounded-xl border border-border bg-card text-sm text-muted-foreground",children:"No clients match the current search and filters."}):p&&t?(0,u.jsx)(vF,{groups:m,visibleFieldIds:_,subjects:w,summaryColumn:t,showDescriptions:a,themeMode:l,renderCell:xc,verifyHref:E=>nS(d,E,h)}):(0,u.jsx)(Nr.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,ease:[.22,1,.36,1]},"data-testid":"compare-matrix",className:q("flex max-h-full min-w-0 flex-col overflow-hidden rounded-xl border border-border bg-card shadow-[0_1px_0_rgba(0,0,0,0.02),0_12px_30px_-18px_rgba(0,0,0,0.18)]",c&&"max-w-full"),children:(0,u.jsx)("div",{"data-testid":"compare-matrix-scroll",onFocus:c&&t?hF:void 0,className:q("min-h-0 overflow-auto",c&&"max-w-full [--matrix-field-width:140px] [-webkit-overflow-scrolling:touch] sm:[--matrix-field-width:300px]",c&&t&&"relative"),children:(0,u.jsxs)("table",{"data-caniuse-matrix":t?"":void 0,className:q("border-collapse text-center text-[13px]",c?"table-fixed min-w-full":"w-full"),style:c?{width:140+(t?224:0)+w.length*132}:void 0,children:[(0,u.jsxs)("colgroup",{children:[(0,u.jsx)("col",{className:c?"w-[var(--matrix-field-width)]":"w-[168px] sm:w-[300px]"}),t&&(0,u.jsx)("col",{className:"w-56"}),w.map(E=>(0,u.jsx)("col",{className:c?"w-[132px] sm:w-[220px]":"w-[148px] sm:w-[220px]"},E.hostId))]}),(0,u.jsx)("thead",{children:(0,u.jsxs)("tr",{children:[(0,u.jsx)("th",{className:"sticky left-0 top-0 z-30 bg-card border-b border-border px-3 py-3 text-left after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:w-px after:bg-border after:content-[''] sm:px-5 sm:py-4",children:(0,u.jsx)("span",{className:q("text-[11px] text-muted-foreground",!t&&"uppercase tracking-[0.16em]"),children:"Field"})}),t&&(0,u.jsx)("th",{scope:"col",className:"sticky top-0 z-20 border-b border-l border-border bg-card px-2 py-3 text-[11px] text-muted-foreground",children:t.label}),w.map(E=>(0,u.jsx)(RF,{subject:E,onRemove:i,themeMode:l,verifyBaseUrl:d,disabledVerifyTemplateIds:h,linkName:!!t},E.hostId))]})}),(0,u.jsxs)("tbody",{children:[d!==void 0&&!t?(0,u.jsx)(EF,{subjects:w,mobileOptimized:c}):null,t?(0,u.jsx)(mF,{groups:m,renderCell:xc,visibleFieldIds:_,subjects:w,summaryColumn:t,showDescriptions:a,mobileOptimized:c}):m.map((E,T)=>{if(E.subsections.flatMap(C=>C.fields).filter(C=>_.has(C.id)).length===0)return null;const I=E.subsections.flatMap(C=>C.fields).filter(C=>S.has(C.id)).length;return(0,u.jsx)(wF,{index:T,sectionLabel:E.section.label,divergeCount:I,subsections:E.subsections,subjects:w,coverageSubjects:e,divergingIds:S,visibleFieldIds:_,showDescriptions:a,mobileOptimized:c},E.section.id)})]})]})})})}function EF({subjects:e,mobileOptimized:t}){return(0,u.jsxs)("tr",{className:"border-b border-border bg-card",children:[(0,u.jsx)("td",{className:q("sticky left-0 z-10 bg-card px-3 py-1.5 text-left after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:w-px after:bg-border after:content-[''] sm:px-5",t&&"min-w-0"),children:(0,u.jsx)("span",{className:"text-[12px] font-medium leading-tight text-muted-foreground",children:"Verified at"})}),e.map(r=>(0,u.jsx)("td",{className:q("border-l border-border px-3 py-1.5 text-center align-top sm:px-4",t?"min-w-0":"min-w-[220px]"),children:(0,u.jsx)("div",{className:"flex min-h-5 items-center justify-center",children:Eb(r.verifiedAt)?(0,u.jsxs)("span",{title:`Last checked ${za(r.verifiedAt)}`,className:q("inline-flex items-center gap-1 text-[12px] leading-tight text-muted-foreground",t?"min-w-0 whitespace-normal":"whitespace-nowrap"),children:[(0,u.jsx)(Cm,{className:"size-3.5 shrink-0","aria-hidden":!0}),xb]}):(0,u.jsx)("span",{className:"text-[12px] tabular-nums text-muted-foreground",children:za(r.verifiedAt)})})},r.hostId))]})}function wF({index:e,sectionLabel:t,divergeCount:r,subsections:n,subjects:o,coverageSubjects:s,divergingIds:a,visibleFieldIds:i,showDescriptions:l,mobileOptimized:c}){const p=o.length+1;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("tr",{children:[(0,u.jsx)("th",{scope:"colgroup",className:"sticky left-0 z-20 border-y border-border bg-muted px-3 py-1 text-left after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:w-px after:bg-border after:content-[''] sm:px-5",children:(0,u.jsxs)(Nr.div,{className:"flex items-baseline gap-2",initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{delay:.08+e*.07,duration:.4,ease:[.22,1,.36,1]},children:[(0,u.jsx)("span",{className:"text-[13px] font-medium tracking-tight",children:t}),r>0&&(0,u.jsx)(Nr.span,{"aria-hidden":!0,className:"inline-block size-1.5 rounded-full bg-primary/70",initial:{scale:0},animate:{scale:1},transition:{delay:.2+e*.07,type:"spring",stiffness:600,damping:18}})]})}),(0,u.jsx)("td",{colSpan:p-1,className:"border-y border-border bg-muted"})]}),n.map(d=>{const h=d.fields.filter(m=>i.has(m.id));return h.length===0?null:(0,u.jsx)(kF,{label:d.label,fields:h,subjects:o,coverageSubjects:s,divergingIds:a,colSpan:p,showDescriptions:l,mobileOptimized:c},`${t}-${d.label}`)})]})}function kF({label:e,fields:t,subjects:r,coverageSubjects:n,divergingIds:o,colSpan:s,showDescriptions:a,mobileOptimized:i}){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("tr",{children:[(0,u.jsx)("td",{className:"sticky left-0 z-10 border-b border-border bg-card px-3 py-1.5 text-left text-[10px] uppercase tracking-wider text-muted-foreground after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:w-px after:bg-border after:content-[''] sm:px-5",children:e}),(0,u.jsx)("td",{colSpan:s-1,className:"border-b border-border bg-card"})]}),t.map(l=>(0,u.jsx)(IF,{field:l,subjects:r,coverageSubjects:n,diverges:o.has(l.id),showDescriptions:a,mobileOptimized:i},l.id))]})}function IF({field:e,subjects:t,coverageSubjects:r,diverges:n,showDescriptions:o,mobileOptimized:s}){const a=r.length>=2?UL(e,r.map(l=>l.config)):null,i=q("text-[13px] font-medium leading-tight text-foreground",s&&"min-w-0 break-words");return(0,u.jsxs)("tr",{className:"border-b border-border last:border-b-0",children:[(0,u.jsxs)("td",{className:"sticky left-0 z-10 bg-card px-3 py-2.5 text-left after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:w-px after:bg-border after:content-[''] sm:px-5",children:[n&&(0,u.jsx)(Nr.span,{"aria-hidden":"true",className:"absolute left-0 top-0 bottom-0 w-[3px] bg-primary/70 origin-top","data-testid":`diverge-gutter-${e.id}`,initial:{scaleY:0,opacity:0},animate:{scaleY:1,opacity:1},transition:{duration:.45,ease:[.22,1,.36,1]}}),(0,u.jsxs)("div",{className:q("flex items-center gap-1.5",s&&"min-w-0"),children:[(0,u.jsx)("span",{className:i,children:e.label}),a&&(0,u.jsxs)("span",{className:"text-[10.5px] text-muted-foreground tabular-nums",title:`Supported by ${a.supported} of ${a.total} clients`,"data-testid":`coverage-${e.id}`,children:[a.supported,"/",a.total]}),e.description&&!o&&(0,u.jsxs)(to,{children:[(0,u.jsx)(ro,{asChild:!0,children:(0,u.jsx)("button",{type:"button","aria-label":`About ${e.label}`,className:"inline-flex size-4 shrink-0 items-center justify-center rounded-full text-muted-foreground/60 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",children:(0,u.jsx)(dg,{className:"size-3"})})}),(0,u.jsx)(no,{side:"top",variant:"muted",className:"max-w-[260px] text-left [text-wrap:normal]",children:e.description})]})]}),e.description&&o&&(0,u.jsx)("div",{className:"mt-1 text-[11px] leading-snug text-muted-foreground",children:e.description})]}),t.map(l=>(0,u.jsx)("td",{className:"border-l border-border px-3 py-2.5 text-center align-top sm:px-4",children:(0,u.jsx)(xc,{field:e,subject:l,mobileOptimized:s})},l.hostId))]})}function xc({field:e,subject:t,mobileOptimized:r,compact:n=!1,stacked:o=!1}){const s=e.read(t.config),a=e.kind;if(s===br)return(0,u.jsx)(Ht,{level:"unsupported",label:"Not supported"});if(s===void 0&&a.kind!=="tri-state"&&a.kind!=="capability")return o?(0,u.jsx)(Ht,{level:"unknown",label:"No result"}):(0,u.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n&&(0,u.jsx)("span",{className:"sr-only",children:"No result"}),(0,u.jsx)("span",{"aria-hidden":n||void 0,children:"—"})]});switch(a.kind){case"boolean":return n?s===!0?(0,u.jsx)(Ht,{level:"supported",label:"Supported"}):(0,u.jsx)(Ht,{level:"unsupported",label:"Not supported"}):(0,u.jsx)(Ht,{level:s===!0?"supported":"neutral",label:s===!0?"Yes":"No"});case"tri-state":return(0,u.jsx)(Ht,{level:s===!0?"supported":s===!1?"neutral":"partial",label:s===!0?"On":s===!1?"Off":"Auto"});case"capability":{const i=Xn(e,t.config)??"neutral";if(s==null)return(0,u.jsx)(Ht,{level:n?"unsupported":i,label:"Not supported"});const l=zL(e,t.config),c=typeof s=="object"?Object.keys(s):[];return(0,u.jsxs)("span",{className:"inline-flex items-center justify-center gap-2",children:[(0,u.jsx)(Ht,{level:i,label:n&&i==="partial"?"Partial":"Supported"}),(0,u.jsx)(CF,{caveats:l,value:!n&&c.length>0?s:void 0})]})}case"number":return(0,u.jsx)("span",{className:"font-mono tabular-nums text-[12.5px]",children:typeof s=="number"?s.toFixed(2):String(s)});case"duration-ms":{const i=typeof s=="number"?s:Number(s);return Number.isFinite(i)?(0,u.jsxs)("span",{className:"font-mono tabular-nums text-[12.5px]",children:[i.toLocaleString()," ms"]}):(0,u.jsx)("span",{className:"text-[12px] text-muted-foreground/60",children:"—"})}case"enum":if(a.support){const i=Xn(e,t.config)??"neutral";return(0,u.jsx)(Ht,{level:i,label:String(s)})}return(0,u.jsx)("span",{className:q("text-[13px] text-foreground",r&&"break-words"),children:String(s)});case"mode-set":{const i=new Set(Array.isArray(s)?s:[]);return(0,u.jsx)("span",{className:"inline-flex flex-wrap items-center justify-center gap-1",children:a.modes.map(l=>(0,u.jsx)(Ht,{level:i.has(l)?"supported":"neutral",label:l},l))})}case"string":{const i=String(s);return i.length===0?(0,u.jsx)("span",{className:"text-[12px] text-muted-foreground/60",children:'""'}):(0,u.jsx)("span",{className:"font-mono text-[12px] break-all",children:i})}case"style-variable":{const i=s,l=e.label.startsWith("--color-");return"same"in i?(0,u.jsxs)("span",{className:"inline-flex max-w-full items-center justify-center gap-1.5",children:[l?(0,u.jsx)(Ph,{value:i.same}):null,(0,u.jsx)("span",{className:"min-w-0 font-mono text-[12px] break-all",children:i.same})]}):(0,u.jsx)("span",{className:"flex w-full flex-col gap-1.5",title:i.raw,children:["light","dark"].map(c=>(0,u.jsxs)("span",{className:"flex w-full flex-col items-center gap-0.5",children:[(0,u.jsx)("span",{className:"text-[10px] uppercase leading-none tracking-wide text-muted-foreground/60",children:c}),i[c]===void 0?(0,u.jsx)("span",{className:"text-[12px] text-muted-foreground/60",children:"—"}):(0,u.jsxs)("span",{className:"flex max-w-full items-center justify-center gap-1.5",children:[l?(0,u.jsx)(Ph,{value:i[c]}):null,(0,u.jsx)("span",{className:"min-w-0 font-mono text-[12px] break-all",children:i[c]})]})]},c))})}case"string-long":{const i=String(s),l=i.split(`
24
+ `;if(typeof e=="string")r=`${n}${e}`;else{const o=new TextEncoder().encode(n);r=new Uint8Array(o.length+e.length),r.set(o),r.set(e,o.length)}return r}async function CO({client:e,scope:t,replayId:r,event:n}){const o={event_id:r,integrations:typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0};e.emit("preprocessEvent",n,o);const s=await Rm(e.getOptions(),n,o,t,e,Hr());if(!s)return null;e.emit("postprocessEvent",s,o),s.platform=s.platform||"javascript";const{name:a,version:i,settings:l}=e.getSdkMetadata()?.sdk||{};return s.sdk={...s.sdk,name:a||"sentry.javascript.unknown",version:i||"0.0.0",settings:l},s}async function RO({recordingData:e,replayId:t,segmentId:r,eventContext:n,timestamp:o,session:s}){const a=IO({recordingData:e,headers:{segment_id:r}}),{urls:i,errorIds:l,traceIds:c,segmentNames:p,initialTimestamp:d}=n,h=me(),m=je(),g=h?.getTransport(),S=h?.getDsn();if(!h||!g||!S||!s.sampled)return Promise.resolve({});const b=await CO({scope:m,client:h,replayId:t,event:{type:eN,replay_start_timestamp:d/1e3,timestamp:o/1e3,error_ids:l,trace_ids:c,segment_names:p,urls:i,replay_id:t,segment_id:r,replay_type:s.sampled}});if(!b)return h.recordDroppedEvent("event_processor","replay"),oe&&se.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete b.sdkProcessingMetadata;const _=kO(b,a,S,h.getOptions().tunnel);let v;try{v=await g.send(_)}catch(E){const T=new Error(Au);try{T.cause=E}catch{}throw T}const w=gv({},v);if(mv(w,"replay"))throw new zu(w);if(typeof v.statusCode=="number"&&(v.statusCode<200||v.statusCode>=300))throw new By(v.statusCode);return v}var By=class extends Error{constructor(e){super(`Transport returned status code ${e}`)}},zu=class extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}},Kf=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function zy(e,t={count:0,interval:aN}){const{recordingData:r,onError:n}=e;if(r.length)try{return await RO(e),!0}catch(o){if(o instanceof By||o instanceof zu)throw o;if(Lm("Replays",{_retryCount:t.count}),n&&n(o),t.count>=iN){const s=new Error(`${Au} - max retries exceeded`);try{s.cause=o}catch{}throw s}return t.interval*=++t.count,new Promise((s,a)=>{ks(async()=>{try{await zy(e,t),s(!0)}catch(i){a(i)}},t.interval)})}}var Wy="__THROTTLED",TO="__SKIPPED";function AO(e,t,r){const n=new Map,o=i=>{const l=i-r;n.forEach((c,p)=>{p<l&&n.delete(p)})},s=()=>[...n.values()].reduce((i,l)=>i+l,0);let a=!1;return(...i)=>{const l=Math.floor(Date.now()/1e3);if(o(l),s()>=t){const p=a;return a=!0,p?TO:Wy}a=!1;const c=n.get(l)||0;return n.set(l,c+1),e(...i)}}var NO=class{constructor({options:e,recordingOptions:t}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:tN,sessionIdleExpire:rN},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,segmentNames:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=t,this._options=e,this._debouncedFlush=yO(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=AO((s,a)=>EM(this,s,a),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:n}=this.getOptions(),o=r?{threshold:Math.min(lN,r),timeout:r,scrollTimeout:cN,ignoreSelector:n?n.join(","):""}:void 0;if(o&&(this.clickDetector=new jP(this,o)),oe){const s=e._experiments;se.setConfig({captureExceptions:!!s.captureExceptions,traceInternals:!!s.traceInternals})}this._handleVisibilityChange=()=>{Fe.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const s=Kt({category:"ui.blur"});this._doChangeToBackgroundTasks(s)},this._handleWindowFocus=()=>{const s=Kt({category:"ui.focus"});this._doChangeToForegroundTasks(s)},this._handleKeyboardEvent=s=>{YP(this,s)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){oe&&se.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){const{errorSampleRate:t,sessionSampleRate:r}=this._options,n=t<=0&&r<=0;if(this._requiresManualStart=n,!n){if(this._initializeSessionForSampling(e),!this.session){oe&&se.exception(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",oe&&se.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){oe&&se.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){oe&&se.log("Buffering is in progress, call `flush()` to save the replay");return}oe&&se.infoTick("Starting replay in session mode"),this._updateUserActivity();const e=cl({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){oe&&se.log("Buffering is in progress, call `flush()` to save the replay");return}oe&&se.infoTick("Starting replay in buffer mode");const e=cl({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const e=this._canvas;this._stopRecording=jt({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:sN}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:SO(this),...bO(),onMutation:this._onMutationHandler.bind(this),...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:t}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";const r=t??"manual";me()?.emit("replayEnd",{sessionId:this.session?.id,reason:r});try{oe&&se.log(`Stopping Replay triggered by ${r}`),Ua(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,vM(this)}catch(n){this.handleException(n)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),oe&&se.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),oe&&se.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const t=Date.now();oe&&se.log("Converting buffer to session"),await this.flushImmediate();const r=this.stopRecording();!e||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession(),Yf(this.session.id)),this.startRecording())}addUpdate(e){const t=e();this.recordingMode==="buffer"||!this._isEnabled||t!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(e){if(!(e&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&sc(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const e=`${Fe.location.pathname}${Fe.location.hash}${Fe.location.search}`,t=`${Fe.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){const r=this._throttledAddEvent(e,t);if(r===Wy){const n=Kt({category:"replay.throttled"});this.addUpdate(()=>!$u(this,{type:RP,timestamp:n.timestamp||0,data:{tag:"breadcrumb",payload:n,metric:!0}}))}return r}getCurrentRoute(){const e=this.lastActiveSpan||pt(),t=e&&mt(e),r=(t&&Ae(t).data||{})[hr];if(!(!t||!r||!["route","custom"].includes(r)))return Ae(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=hM({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&me()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode==="session"&&this.session&&Yf(this.session.id)}_initializeSessionForSampling(e){const t=this._options.errorSampleRate>0,r=cl({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=r}_checkSession(){if(!this.session)return!1;const e=this.session;return Ha(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(e),!1):!0}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(e.id))}_addListeners(){try{Fe.document.addEventListener("visibilitychange",this._handleVisibilityChange),Fe.addEventListener("blur",this._handleWindowBlur),Fe.addEventListener("focus",this._handleWindowFocus),Fe.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(mO(this),this._hasInitializedCoreListeners=!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=iM(this)}_removeListeners(){try{Fe.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Fe.removeEventListener("blur",this._handleWindowBlur),Fe.removeEventListener("focus",this._handleWindowFocus),Fe.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}_doChangeToBackgroundTasks(e){if(this.session){if(Ha(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){Ua();return}e&&this._createCustomBreadcrumb(e),this.conditionalFlush()}}_doChangeToForegroundTasks(e){if(this.session){if(!this.checkAndHandleExpiredSession()){oe&&se.log("Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:ge.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){let e=QP(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const t=this._context.initialTimestamp/1e3;e=e.filter(r=>r.start>=t)}return Promise.all(Ci(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.segmentNames.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:t}=this;if(!e||!t||this._requiresManualStart||e.segmentId)return;const r=t.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),segmentNames:Array.from(this._context.segmentNames),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){const e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){oe&&se.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await gO(this),!!this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Kf;const r=this._popEventContext(),n=this.session.segmentId++;this._maybeSaveSession(),await zy({replayId:e,recordingData:await this.eventBuffer.finish(),segmentId:n,eventContext:r,session:this.session,timestamp:t,onError:o=>this.handleException(o)})}catch(t){this.handleException(t),this.stop({reason:"sendError"});const r=me();if(r){let n;t instanceof zu?n="ratelimit_backoff":t instanceof Kf?n="invalid":n="send_error",r.recordDroppedEvent(n,"replay")}}}async _flush({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){oe&&se.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const t=this.session.started,r=Date.now()-t;this._debouncedFlush.cancel();const n=r<this._options.minReplayDuration,o=r>this._options.maxReplayDuration+5e3;if(n||o){oe&&se.log(`Session duration (${Math.floor(r/1e3)}s) is too ${n?"short":"long"}, not sending replay.`),n&&this._debouncedFlush();return}const s=this.eventBuffer;s&&this.session.segmentId===0&&!s.hasCheckout&&oe&&se.log("Flushing initial segment without checkout.");const a=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(i){this.handleException(i)}finally{this._flushLock=void 0,a&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Ii(this.session)}_onMutationHandler(e){const{ignoreMutations:t}=this._options._experiments;if(t?.length&&e.some(a=>{const i=wO(a.target),l=t.join(",");return i?.matches(l)}))return!1;const r=e.length,n=this._options.mutationLimit,o=this._options.mutationBreadcrumbLimit,s=n&&r>n;if(r>o||s){const a=Kt({category:"replay.mutations",data:{count:r,limit:s}});this._createCustomBreadcrumb(a)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}};function So(e,t){return[...e,...t].join(",")}function PO({mask:e,unmask:t,block:r,unblock:n,ignore:o}){return{maskTextSelector:So(e,[".sentry-mask","[data-sentry-mask]"]),unmaskTextSelector:So(t,[]),blockSelector:So(r,[".sentry-block","[data-sentry-block]","base","iframe[srcdoc]:not([src])"]),unblockSelector:So(n,[]),ignoreSelector:So(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function MO({el:e,key:t,maskAttributes:r,maskAllText:n,privacyOptions:o,value:s}){if(o.unmaskTextSelector&&e.matches(o.unmaskTextSelector))return s;const a=r.includes(t),i=n&&t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"");return a||i?s.replace(/[\S]/g,"*"):s}var Xf='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',OO=["content-length","content-type","accept"],jO=Symbol.for("sentry__originalRequestBody"),Qf=!1,Zf=!1;function LO(){if(typeof Request>"u"||Zf)return;const e=Request;try{const t=function(r,n){const o=new e(r,n);return n?.body!=null&&(o[jO]=n.body),o};t.prototype=e.prototype,He.Request=t,Zf=!0}catch{}}var DO=(e=>new FO(e)),FO=class{constructor({flushMinDelay:e=nN,flushMaxDelay:t=oN,minReplayDuration:r=uN,maxReplayDuration:n=Cf,stickySession:o=!0,useCompression:s=!0,workerUrl:a,_experiments:i={},maskAllText:l=!0,maskAllInputs:c=!0,blockAllMedia:p=!0,mutationBreadcrumbLimit:d=750,mutationLimit:h=1e4,slowClickTimeout:m=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:S=[],networkDetailDenyUrls:b=[],networkCaptureBodies:_=!0,networkRequestHeaders:v=[],networkResponseHeaders:w=[],mask:E=[],maskAttributes:T=["title","placeholder","aria-label"],unmask:I=[],block:C=[],unblock:L=[],ignore:y=[],maskFn:A,beforeAddRecordingEvent:N,beforeErrorSampling:W,onError:O,attachRawBodyFromRequest:G=!1}={}){this.name="Replay";const H=PO({mask:E,unmask:I,block:C,unblock:L,ignore:y});if(this._recordingOptions={maskAllInputs:c,maskAllText:l,maskInputOptions:{password:!0},maskTextFn:A,maskInputFn:A,maskAttributeFn:(X,j,U)=>MO({maskAttributes:T,maskAllText:l,privacyOptions:H,key:X,value:j,el:U}),...H,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:X=>{try{X.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!i.recordCrossOriginIframes},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(r,dN),maxReplayDuration:Math.min(n,Cf),stickySession:o,useCompression:s,workerUrl:a,blockAllMedia:p,maskAllInputs:c,maskAllText:l,mutationBreadcrumbLimit:d,mutationLimit:h,slowClickTimeout:m,slowClickIgnoreSelectors:g,networkDetailAllowUrls:S,networkDetailDenyUrls:b,networkCaptureBodies:_,networkRequestHeaders:eh(v),networkResponseHeaders:eh(w),beforeAddRecordingEvent:N,beforeErrorSampling:W,onError:O,attachRawBodyFromRequest:G,_experiments:i},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Xf}`:Xf,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Vn())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Qf}set _isInitialized(e){Qf=e}afterAllSetup(e){!Vn()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&LO(),this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(e){return this._replay?this._replay.stop({forceFlush:e?.flush??this._replay.recordingMode==="session",reason:"manual"}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(e){if(this._replay?.isEnabled())return this._replay.getSessionId(e)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(e){const t=this.getReplayId(!0);t&&(Ca(e,{"sentry.replay_id":t}),this.getRecordingMode()==="buffer"&&Ca(e,{"sentry._internal.replay_is_buffering":!0}))}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){const t=HO(this._initialOptions,e);this._replay=new NO({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{const t=e.getIntegrationByName("ReplayCanvas");if(!t)return;this._replay._canvas=t.getOptions()}catch{}}};function HO(e,t){const r=t.getOptions(),n={sessionSampleRate:0,errorSampleRate:0,...e},o=Bo(r.replaysSessionSampleRate),s=Bo(r.replaysOnErrorSampleRate);return o==null&&s==null&&hs(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(n.sessionSampleRate=o),s!=null&&(n.errorSampleRate=s),n}function eh(e){return[...OO,...e.map(t=>t.toLowerCase())]}function UO(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function qy(e){try{return new URL(e,ve.location.origin).href}catch{return}}function $O(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Vy(e){try{return new Headers(e)}catch{return}}var Gy={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function BO(e,t){const{traceFetch:r,traceXHR:n,shouldCreateSpanForRequest:o,enableHTTPTimings:s,tracePropagationTargets:a,onRequestSpanStart:i,onRequestSpanEnd:l}={...Gy,...t},c=typeof o=="function"?o:m=>!0,p=m=>WO(m,a),d={},h=e.getOptions().propagateTraceparent;r&&Su(m=>{const g=VC(m,c,p,d,{propagateTraceparent:h,onRequestSpanEnd:l});if(g){const S=qy(m.fetchData.url),b=S?rn(S).host:void 0,_=S?Bt(S):void 0;g.setAttributes({[lv]:_,[pi]:_,"server.address":b}),s&&th(g,e),i?.(g,{headers:m.headers})}}),n&&Yv(m=>{const g=qO(m,c,p,d,h,l);g&&(s&&th(g,e),i?.(g,{headers:Vy(m.xhr.__sentry_xhr_v3__?.request_headers)}))})}var zO=300;function th(e,t){const{url:r}=Ae(e).data;if(!r||typeof r!="string")return;let n=()=>{setTimeout(o)};if(rr(t)){const s=e.end.bind(e);e.end=a=>{const i=a??dt();let l=!1;const c=()=>{l||(l=!0,setTimeout(o),s(i),clearTimeout(p))};n=c;const p=setTimeout(c,zO)}}const o=an("resource",({entries:s})=>{s.forEach(a=>{$O(a)&&a.name.endsWith(r)&&(e.setAttributes(qv(a)),n())})})}function WO(e,t){const r=sn();if(r){let n,o;try{n=new URL(e,r),o=new URL(r).origin}catch{return!1}const s=n.origin===o;return t?Qt(n.toString(),t)||s&&Qt(n.pathname,t):s}else{const n=!!e.match(/^\/(?!\/)/);return t?Qt(e,t):n}}function qO(e,t,r,n,o,s){const a=e.xhr,i=a?.[Xr];if(!a||a.__sentry_own_request__||!i)return;const{url:l,method:c}=i,p=er()&&t(l);if(e.endTimestamp){const E=a.__sentry_xhr_span_id__;if(!E)return;const T=n[E];T&&(p&&i.status_code!==void 0&&(Um(T,i.status_code),T.end(),s?.(T,{headers:Vy(Qv(a)),error:e.error})),delete n[E]);return}const d=qy(l),h=rn(d||l),m=d?Bt(d):void 0,g=Bt(uC(l)),S=me(),b=!!pt(),_=b||!!S&&rr(S),v=p&&_?zr({name:`${c} ${g}`,attributes:{url:Bt(l),type:"xhr","http.method":c,"http.url":m,[pi]:m,"server.address":h?.host,[Ze]:"auto.http.browser",[yr]:"http.client",...h?.search&&{"http.query":h?.search},...h?.hash&&{"http.fragment":h?.hash}}}):new nn,w=av(v)&&b?void 0:v;return p&&!_&&S?.recordDroppedEvent("no_parent_span","span"),a.__sentry_xhr_span_id__=v.spanContext().spanId,n[a.__sentry_xhr_span_id__]=v,r(l)&&VO(a,er()&&_?w:void 0,o),S&&S.emit("beforeOutgoingRequestSpan",v,e),v}function VO(e,t,r){const{"sentry-trace":n,baggage:o,traceparent:s}=wv({span:t,propagateTraceparent:r});n&&GO(e,n,o,s)}function GO(e,t,r,n){const o=e.__sentry_xhr_v3__?.request_headers;if(!(o?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),n&&!o?.traceparent&&e.setRequestHeader("traceparent",n),r){const s=o?.baggage;(!s||!UO(s))&&e.setRequestHeader("baggage",r)}}catch{}}var rh=new WeakMap,nh=new WeakMap,YO=9e4,JO=["text/event-stream","application/x-ndjson","application/stream+json"],KO=()=>({name:"FetchStreamPerformance",setup(){rR(e=>{if(e.response){const t=rh.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);const r=nh.get(e.response);r&&clearTimeout(r)}}}),Su(e=>{if(e.endTimestamp&&e.response){const t=e.response.headers?.get("content-type")||"";if(e.response.headers?.get("content-length")||!JO.some(l=>t.startsWith(l)))return;const r=e.fetchData?.url||"",n=e.fetchData?.method||"GET",o=Jo(r),s=r.startsWith("data:")?Bt(r):o?xv(o):r,a=zr({name:`${n} ${s}`,startTime:e.endTimestamp,attributes:{url:Bt(r),"http.method":n,type:"fetch",[yr]:"http.client.stream",[Ze]:"auto.http.browser.stream"}});rh.set(e.response,a);const i=setTimeout(()=>{a.isRecording()&&a.end()},YO);nh.set(e.response,i)}})}}),XO="WebVitals",QO=(e={})=>{const t=new Set(e.ignore??[]);return{name:XO,setup(r){const n=rr(r),{enableStandaloneClsSpans:o,enableStandaloneLcpSpans:s}=e._experiments??{},a=n||t.has("cls")?void 0:o||!1,i=n||t.has("lcp")?void 0:s||!1,l=sT({recordClsStandaloneSpans:a,recordLcpStandaloneSpans:i,client:r}),c=new WeakSet;r.on("afterStartPageLoadSpan",p=>{c.add(p)}),r.on("spanEnd",p=>{c.delete(p)&&(l(),hT(p,{recordClsOnPageloadSpan:a===!1,recordLcpOnPageloadSpan:i===!1,spanStreamingEnabled:n}))}),n?(t.has("lcp")||NT(r),t.has("cls")||MT(r),t.has("inp")||jT()):t.has("inp")||IT()},afterAllSetup(){t.has("inp")||AT()}}};function ZO(){ve.document?ve.document.addEventListener("visibilitychange",()=>{const e=pt();if(!e)return;const t=mt(e);if(ve.document.hidden&&t){const r="cancelled",{op:n,status:o}=Ae(t);It&&z.log(`[Tracing] Transaction: ${r} -> since tab moved to the background, op: ${n}`),o||t.setStatus({code:2,message:r}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):It&&z.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var Yy="sentry_previous_trace",e1="sentry.previous_trace";function t1(e,{linkPreviousTrace:t,consistentTraceSampling:r}){const n=t==="session-storage";let o=n?o1():void 0;e.on("spanStart",a=>{if(mt(a)!==a)return;const i=je().getPropagationContext();o=r1(o,a,i),n&&n1(o)});let s=!0;r&&e.on("beforeSampling",a=>{if(!o)return;const i=je(),l=i.getPropagationContext();if(s&&l.parentSpanId){s=!1;return}i.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(lc(o.spanContext))},sampleRand:o.sampleRand}),a.parentSampled=lc(o.spanContext),a.parentSampleRate=o.sampleRate,a.spanAttributes={...a.spanAttributes,[D_]:o.sampleRate}})}function r1(e,t,r){const n=Ae(t);function o(){try{const i=Number(n.data?.["sentry.sample_rate"]??r.dsc?.sample_rate);return Number.isNaN(i)?0:i}catch{return 0}}const s={spanContext:t.spanContext(),startTimestamp:n.start_timestamp,sampleRate:o(),sampleRand:r.sampleRand};if(!e)return s;const a=e.spanContext;return a.traceId===n.trace_id?e:(Date.now()/1e3-e.startTimestamp<=3600&&(It&&z.log(`Adding previous_trace \`${JSON.stringify(a)}\` link to span \`${JSON.stringify({op:n.op,...t.spanContext()})}\``),t.addLink({context:a,attributes:{[F_]:"previous_trace"}}),t.setAttribute(e1,`${a.traceId}-${a.spanId}-${lc(a)?1:0}`)),s)}function n1(e){try{ve.sessionStorage.setItem(Yy,JSON.stringify(e))}catch(t){It&&z.warn("Could not store previous trace in sessionStorage",t)}}function o1(){try{const e=ve.sessionStorage?.getItem(Yy);return JSON.parse(e)}catch{return}}function lc(e){return e.traceFlags===1}var s1="BrowserTracing",a1=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function i1(){const e=ve.navigator;return e?.userAgent?a1.test(e.userAgent):!1}var l1={...ua,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Gy},c1=((e={})=>{"enableElementTiming"in e&&hs(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},r=ve.document,{enableInp:n,enableLongTask:o,enableLongAnimationFrame:s,_experiments:{enableInteractions:a,enableStandaloneClsSpans:i,enableStandaloneLcpSpans:l},beforeStartSpan:c,idleTimeout:p,finalTimeout:d,childSpanTimeout:h,markBackgroundSpan:m,traceFetch:g,traceXHR:S,trackFetchStreamPerformance:b,shouldCreateSpanForRequest:_,enableHTTPTimings:v,ignoreResourceSpans:w,ignorePerformanceApiSpans:E,instrumentPageLoad:T,instrumentNavigation:I,detectRedirects:C,linkPreviousTrace:L,consistentTraceSampling:y,enableReportPageLoaded:A,onRequestSpanStart:N,onRequestSpanEnd:W}={...l1,...e},O=i1();let G,H;function X(j,U,ee=!0,V){const ue=U.op==="pageload",P=U.name,$=c?c(U):U,Y=Jo(V||sn()),J={...Y?.pathname&&{"url.path":Y.pathname},...Y&&!fi(Y)&&{"url.full":Y.href},...$.attributes};if(P!==$.name&&(J[hr]="custom"),$.attributes=J,!ee){const Se=Za();zr({...$,startTime:Se}).end(Se);return}t.name=$.name,t.source=J[hr];const ae=iv($,{idleTimeout:p,finalTimeout:d,childSpanTimeout:h,disableAutoFinish:ue,beforeSpanEnd:Se=>{fT(Se,{ignoreResourceSpans:w,ignorePerformanceApiSpans:E,spanStreamingEnabled:rr(j)}),ah(j,void 0);const Oe=je(),Xe=Oe.getPropagationContext();Oe.setPropagationContext({...Xe,traceId:ae.spanContext().traceId,sampled:ei(ae),dsc:hn(Se)}),ue&&(H=void 0)},trimIdleSpanEndTimestamp:!A});ue&&A&&(H=ae),ah(j,ae);function ie(){r&&["interactive","complete"].includes(r.readyState)&&(j.emit("idleSpanEnableAutoFinish",ae),r.removeEventListener("readystatechange",ie))}ue&&!A&&r&&(r.addEventListener("readystatechange",ie),ie())}return{name:s1,setup(j){if(O){It&&z.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if($k(),s&&He.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?iT():o&&aT(),a&&lT(),C&&r){const ee=()=>{G=dt()};addEventListener("click",ee,{capture:!0}),addEventListener("keydown",ee,{capture:!0,passive:!0})}function U(){const ee=ns(j);ee&&!Ae(ee).timestamp&&(It&&z.log(`[Tracing] Finishing current active span with op: ${Ae(ee).op}`),ee.setAttribute(Ea,"cancelled"),ee.end())}j.on("startNavigationSpan",(ee,V)=>{if(me()!==j)return;if(V?.isRedirect){It&&z.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),X(j,{op:"navigation.redirect",...ee},!1,V.url);return}G=void 0,U();const ue=je();ue.setPropagationContext({traceId:Bm(),sampleRand:Math.random(),propagationSpanId:er()?void 0:Nl()}),ue.setSDKProcessingMetadata({normalizedRequest:void 0}),X(j,{op:"navigation",...ee,parentSpan:null,forceTransaction:!0},!0,V?.url)}),j.on("startPageLoadSpan",(ee,V={})=>{if(me()!==j)return;U();const ue=V.sentryTrace||oh("sentry-trace")||sh("sentry-trace"),P=V.baggage||oh("baggage")||sh("baggage"),$=W_(ue,P),Y=je();Y.setPropagationContext($),er()||(Y.getPropagationContext().propagationSpanId=Nl()),Y.setSDKProcessingMetadata({normalizedRequest:Ta()}),X(j,{op:"pageload",...ee})}),j.on("endPageloadSpan",()=>{A&&H&&(H.setAttribute(Ea,"reportPageLoaded"),H.end())})},afterAllSetup(j){if(O)return;j.addIntegration&&!j.getIntegrationByName?.("WebVitals")&&j.addIntegration(QO({ignore:n?[]:["inp"],_experiments:{enableStandaloneClsSpans:i,enableStandaloneLcpSpans:l}}));let U=sn();if(L!=="off"&&t1(j,{linkPreviousTrace:L,consistentTraceSampling:y}),ve.location){if(T){const ee=ot();u1(j,{name:ve.location.pathname,startTime:ee?ee/1e3:void 0,attributes:{[hr]:"url",[Ze]:"auto.pageload.browser"}})}I&&_i(({to:ee,from:V})=>{if(V===void 0&&U?.indexOf(ee)!==-1){U=void 0;return}U=void 0;const ue=Jo(ee),P=ns(j),$=P&&C&&f1(P,G);d1(j,{name:ue?.pathname||ve.location.pathname,attributes:{[hr]:"url",[Ze]:"auto.navigation.browser"}},{url:ee,isRedirect:$})})}m&&ZO(),a&&p1(j,p,d,h,t),BO(j,{traceFetch:g,traceXHR:S,tracePropagationTargets:j.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:_,enableHTTPTimings:v,onRequestSpanStart:N,onRequestSpanEnd:W}),b&&j.addIntegration(KO())}}});function u1(e,t,r){e.emit("startPageLoadSpan",t,r),je().setTransactionName(t.name);const n=ns(e);return n&&e.emit("afterStartPageLoadSpan",n),n}function d1(e,t,r){const{url:n,isRedirect:o}=r||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o,url:n}),e.emit("startNavigationSpan",t,{isRedirect:o,url:n});const s=je();return s.setTransactionName(t.name),n&&!o&&s.setSDKProcessingMetadata({normalizedRequest:{...Ta(),url:n}}),ns(e)}function oh(e){return ve.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function sh(e){return ve.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(t=>t.name===e)?.description}function p1(e,t,r,n,o){const s=ve.document;let a;const i=()=>{const l="ui.action.click",c=ns(e);if(c){const p=Ae(c).op;if(["navigation","pageload"].includes(p)){It&&z.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(a&&(a.setAttribute(Ea,"interactionInterrupted"),a.end(),a=void 0),!o.name){It&&z.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}a=iv({name:o.name,op:l,attributes:{[hr]:o.source||"url"}},{idleTimeout:t,finalTimeout:r,childSpanTimeout:n})};s&&addEventListener("click",i,{capture:!0})}var Jy="_sentry_idleSpan";function ns(e){return e[Jy]}function ah(e,t){qn(e,Jy,t)}var ih=1.5;function f1(e,t){const r=Ae(e),n=Za();return!(n-r.start_timestamp>ih||t&&n-t<=ih)}function h1(e){return wa(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function m1(e){const t={...e};Ev(t,"react"),Lm("react",{version:f.version});const r=ZA(t);return Fm(g1),r}function g1(e){return h1(e)?"[SyntheticEvent]":ry(e)}function Ky({className:e,type:t,...r}){return(0,u.jsx)("input",{type:t,"data-slot":"input",className:q("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/30 focus-visible:ring-2","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}function Wu(e){return e!=="system"?e:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}var cc="themeMode",Xy="themePreset",Qy="mcpjam-ui-playground-host-style",uc="mcpjam-ui-playground-host-capabilities-override",dc="mcpjam-ui-playground-chat-ui-override",Zy="mcpjam-auto-connect-servers",eb="mcpjam-auto-collapse-sidebar";function v1(){if(typeof window>"u")return Dd.id;try{const e=localStorage.getItem(Qy),t=g0(e);if(t)return t}catch(e){console.warn("Failed to read persisted host style:",e)}return Dd.id}function y1(){if(typeof window>"u")return!1;try{return localStorage.getItem(Zy)==="true"}catch(e){return console.warn("Failed to read persisted auto-connect setting:",e),!1}}function b1(){if(typeof window>"u")return!1;try{return localStorage.getItem(eb)==="true"}catch(e){return console.warn("Failed to read persisted sidebar auto-collapse:",e),!1}}function S1(){if(typeof window>"u")return;let e;try{e=localStorage.getItem(dc)}catch(t){console.warn("Failed to read persisted chat UI override:",t);return}if(e)try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}catch(t){console.warn("Failed to parse persisted chat UI override:",t);return}}function _1(){if(typeof window>"u")return;let e;try{e=localStorage.getItem(uc)}catch(t){console.warn("Failed to read persisted host capabilities override:",t);return}if(e)try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}catch(t){console.warn("Failed to parse persisted host capabilities override:",t);return}}var tb=e=>t0()(t=>({themeMode:e?.themeMode??"light",themePreference:e?.themePreference??e?.themeMode??"light",themePreset:e?.themePreset??"default",hostStyle:e?.hostStyle??v1(),hostCapabilitiesOverride:e?.hostCapabilitiesOverride!==void 0?e.hostCapabilitiesOverride:_1(),chatUiOverride:e?.chatUiOverride!==void 0?e.chatUiOverride:S1(),autoConnectServersEnabled:e?.autoConnectServersEnabled??y1(),autoCollapseSidebarEnabled:e?.autoCollapseSidebarEnabled??b1(),setThemeMode:r=>{try{localStorage.setItem(cc,r)}catch(n){console.warn("Failed to persist theme mode:",n)}t({themeMode:r,themePreference:r})},setThemePreference:r=>{try{localStorage.setItem(cc,r)}catch(n){console.warn("Failed to persist theme preference:",n)}t({themePreference:r,themeMode:Wu(r)})},setThemePreset:r=>{try{localStorage.setItem(Xy,r)}catch(n){console.warn("Failed to persist theme preset:",n)}t({themePreset:r})},setHostStyle:r=>{try{localStorage.setItem(Qy,r)}catch(n){console.warn("Failed to persist host style:",n)}t({hostStyle:r})},setHostCapabilitiesOverride:r=>{try{r===void 0?localStorage.removeItem(uc):localStorage.setItem(uc,JSON.stringify(r))}catch(n){console.warn("Failed to persist host capabilities override:",n)}t({hostCapabilitiesOverride:r})},setChatUiOverride:r=>{try{r===void 0?localStorage.removeItem(dc):localStorage.setItem(dc,JSON.stringify(r))}catch(n){console.warn("Failed to persist chat UI override:",n)}t({chatUiOverride:r})},setAutoConnectServersEnabled:r=>{try{localStorage.setItem(Zy,r?"true":"false")}catch(n){console.warn("Failed to persist auto-connect setting:",n)}t({autoConnectServersEnabled:r})},setAutoCollapseSidebarEnabled:r=>{try{localStorage.setItem(eb,r?"true":"false")}catch(n){console.warn("Failed to persist sidebar auto-collapse:",n)}t({autoCollapseSidebarEnabled:r})}})),x1=[{label:"Light",value:"light"},{label:"Dark",value:"dark"}],F$=x1.map(e=>e.value),rb=[{label:"Default",value:"default",primary:{light:"oklch(0.205 0 0)",dark:"oklch(0.922 0 0)"}},{label:"Brutalist",value:"brutalist",primary:{light:"oklch(0.6489 0.2370 26.9728)",dark:"oklch(0.7044 0.1872 23.1858)"}},{label:"Soft Pop",value:"soft-pop",primary:{light:"oklch(0.5106 0.2301 276.9656)",dark:"oklch(0.6801 0.1583 276.9349)"}},{label:"Tangerine",value:"tangerine",primary:{light:"oklch(0.64 0.17 36.44)",dark:"oklch(0.64 0.17 36.44)"}}],H$=rb.map(e=>e.value);function nb(){try{const e=localStorage.getItem(cc);if(e==="dark"||e==="light"||e==="system")return e}catch(e){console.warn("Cannot access localStorage for theme mode:",e)}return null}function U$(){return nb()!==null}function ob(){return nb()??"dark"}function $$(){return Wu(ob())}function lh(){return document.documentElement.classList.contains("dark")?"dark":"light"}function sb(e){const t=document.documentElement;t.classList.add("disable-transitions"),t.classList.toggle("dark",e==="dark"),requestAnimationFrame(()=>{t.classList.remove("disable-transitions")})}function B$(){try{const e=localStorage.getItem(Xy),t=rb.map(r=>r.value);if(e&&t.includes(e))return e}catch(e){console.warn("Cannot access localStorage for theme preset:",e)}return"default"}function z$(e){document.documentElement.setAttribute("data-theme-preset",e)}function Rs({...e}){return(0,u.jsx)(Wm,{"data-slot":"dialog",...e})}function ab({...e}){return(0,u.jsx)(mx,{"data-slot":"dialog-trigger",...e})}function E1({...e}){return(0,u.jsx)(Gm,{"data-slot":"dialog-portal",...e})}function W$({...e}){return(0,u.jsx)(Xm,{"data-slot":"dialog-close",...e})}function w1({className:e,...t}){return(0,u.jsx)(Ym,{"data-slot":"dialog-overlay",className:q("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-overlay",e),...t})}function Ts({className:e,children:t,showCloseButton:r=!0,...n}){return(0,u.jsxs)(E1,{"data-slot":"dialog-portal",children:[(0,u.jsx)(w1,{}),(0,u.jsxs)(Jm,{"data-slot":"dialog-content",className:q("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...n,children:[t,r&&(0,u.jsxs)(Xm,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,u.jsx)(ri,{}),(0,u.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function os({className:e,...t}){return(0,u.jsx)("div",{"data-slot":"dialog-header",className:q("flex flex-col gap-2 text-center sm:text-left",e),...t})}function ch({className:e,...t}){return(0,u.jsx)("div",{"data-slot":"dialog-footer",className:q("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function ln({className:e,...t}){return(0,u.jsx)(xx,{"data-slot":"dialog-title",className:q("text-lg leading-none font-semibold pb-1",e),...t})}function ss({className:e,...t}){return(0,u.jsx)(wx,{"data-slot":"dialog-description",className:q("text-muted-foreground text-sm",e),...t})}var qu=(0,f.createContext)({isEnsuringUser:!1,isUserReady:!1});function q$({children:e,isEnsuringUser:t=!1,isUserReady:r}){const n=Bi(s=>s.queriesPaused),o=Bi(s=>s.authConfirmed);return(0,f.useEffect)(()=>{r&&o&&Bi.getState().resumeQueries()},[r,o]),(0,u.jsx)(qu.Provider,{value:{isEnsuringUser:t,isUserReady:r&&!n},children:e})}function Ti(){return(0,f.useContext)(qu).isUserReady}function V$(){return(0,f.useContext)(qu)}function G$(e){return f.createElement(Yw,{flushSync:dx.flushSync,...e})}function pc({className:e,...t}){return(0,u.jsx)(Xx,{"data-slot":"switch",className:q("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,u.jsx)(Zx,{"data-slot":"switch-thumb",className:q("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}var ib=(0,f.createContext)(null),Y$=ib.Provider,k1={status:"loading",catalog:null,version:null,source:null};function uh(e){console.warn("[host-catalog] client catalog degraded",e);try{gm("host_catalog_degraded",{location:"host_catalog",...e})}catch{}}var ta=null,ul=null,dl=0;async function I1(){const e=await T0({baseUrl:"/api/v1",timeoutMs:8e3}).catch(()=>({ok:!1,reason:"network"}));return e.ok?(e.source==="bundled"&&uh({status:"fallback",source:e.source,version:e.version}),{status:e.source==="bundled"?"fallback":"live",catalog:e.catalog,version:e.version,source:e.source}):(uh({status:"error",reason:e.reason}),{status:"error",catalog:null,version:null,source:null})}function Vu(){const e=(0,f.useContext)(ib),[t,r]=(0,f.useState)(ta??k1);return(0,f.useEffect)(()=>{if(e)return;if(ta){r(ta);return}let n=!0;const o=dl;return ul||(ul=I1().then(s=>(o===dl&&(ta=s.status==="loading"?{status:"error",catalog:null,version:null,source:null}:s),s))),ul.then(s=>{n&&o===dl&&r(s)}),()=>{n=!1}},[e]),e??t}var fc=768;function C1(){return typeof window>"u"?!1:window.innerWidth<fc}function R1(){const[e,t]=f.useState(C1);return f.useEffect(()=>{const r=window.matchMedia("(max-width: 767px)"),n=()=>{t(window.innerWidth<fc)};return r.addEventListener("change",n),t(window.innerWidth<fc),()=>r.removeEventListener("change",n)},[]),e}var T1="web-clients-enabled",A1=["claude","chatgpt"],N1={claude:"claude-web",chatgpt:"chatgpt-web"},dh={claude:"web-claude",chatgpt:"web-chatgpt"},J$={claude:"Claude web",chatgpt:"ChatGPT web"},K$={claude:["https://claude.ai"],chatgpt:["https://chatgpt.com","https://auth.openai.com"]};function P1(e){return A1.find(t=>N1[t]===e)}function X$(e){return P1(e)!==void 0}var Q$={claude:"page-2026-11-20",chatgpt:"page-2026-11-20"},Gu={"claude-code":"claudeCode",codex:"codex","codex-cli":"codex","copilot-cli":"copilotCli","cursor-cli":"cursorCli",opencode:"openCode",[dh.claude]:"webClients",[dh.chatgpt]:"webClients"},lb=new Set(Object.keys(Gu));function M1(e,t){const r=Gu[e];return r===void 0?!0:t[r]}function Ai(e,t){return M1(e,t)===!0}function O1(e){const t=new Set;for(const r of Object.keys(Gu))Ai(r,e)||t.add(r);return t}function Z$(e,t){return e.filter(r=>Ai(r.hostId,t))}function e2(e,t){return e.filter(r=>Ai(r.id,t))}function t2(e,t){return e.filter(r=>Ai(r.id,t))}function ko(e,t,r){return{code:e,message:t,...r===void 0?{}:{details:r}}}var cb=class extends Error{code;details;constructor(e,t,r){super(t),this.name="InspectorCommandClientError",this.code=e,this.details=r}};function j1(e,t,r){return new cb(e,t,r)}var Ir=new Map,Do=new Map,L1=2e3;function D1(e){const t=Do.get(e);if(!(!t||t.size===0)){Do.delete(e);for(const r of t)r()}}function F1(e,t){return new Promise(r=>{const n=Do.get(e)??new Set;Do.set(e,n);const o=setTimeout(()=>{n.delete(s),n.size===0&&Do.delete(e),r(!1)},t),s=()=>{clearTimeout(o),r(!0)};n.add(s)})}function H1(e,t){const r=Ir.get(e)??[];return Ir.set(e,[...r,t]),D1(e),()=>{const n=Ir.get(e)?.filter(o=>o!==t)??[];if(n.length===0){Ir.delete(e);return}Ir.set(e,n)}}function U1(e){return(Ir.get(e)?.length??0)>0}async function $1(e){let t=Ir.get(e.type)??[];if(t.length===0&&await F1(e.type,L1)&&(t=Ir.get(e.type)??[]),t.length===0)return{id:e.id,status:"error",error:ko("unsupported_in_mode",`No Inspector handler is registered for "${e.type}".`)};let r=null;for(const n of[...t].reverse())try{const o=await n(e);return{id:e.id,status:"success",...o===void 0?{}:{result:o}}}catch(o){if(o instanceof cb){if(o.code==="unsupported_in_mode"){r=o;continue}return{id:e.id,status:"error",error:ko(o.code,o.message,o.details)}}return{id:e.id,status:"error",error:ko("execution_failed",o instanceof Error?o.message:"Unknown Inspector command error.")}}return{id:e.id,status:"error",error:ko(r?.code??"unsupported_in_mode",r?.message??`No Inspector handler is registered for "${e.type}".`,r?.details)}}function Yu(e,t){switch(e){case"never":return!1;case"always":return!0;case"setting":return t===!0}}var B1={chat:{applySwitch:!0,answer:"person"},eval:{applySwitch:!1,answer:"deny"},synthetic:{applySwitch:!0,answer:"deny"},api:{applySwitch:!1,answer:"deny"},event:{applySwitch:!1,answer:"deny"}};function r2(e){return B1[e]}var pr={listEventTypes:"mcpjam_list_event_types",subscribe:"mcpjam_subscribe_to_events",update:"mcpjam_update_event_subscription",listSubscriptions:"mcpjam_list_event_subscriptions",delete:"mcpjam_delete_event_subscription"},z1=new Set(Object.values(pr));function W1(e){return z1.has(e)}var q1=new Set([pr.subscribe,pr.update,pr.delete]);function n2(e,t){return q1.has(e)&&Yu("setting",t)}function hc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function cr(e,t,r,n=!1){const o=e[t];if(!(n&&o===void 0)){if(typeof o!="string"||o.trim().length===0){r.push(`\`${t}\` must be a non-empty string`);return}return o.trim()}}function ph(e,t,r=!1){const n=e.triggers;if(r&&n===void 0)return;if(!Array.isArray(n)||n.length===0){t.push("`triggers` must be an array with one {event, params} trigger");return}if(n.length>1){t.push("`triggers` takes one trigger per subscription; create another subscription for a second event");return}const[o]=n;if(!hc(o)){t.push("`triggers[0]` must be an object with `event` and `params`");return}const s=cr(o,"event",t),a=o.params===void 0?{}:o.params;if(!hc(a)){t.push("`triggers[0].params` must be a JSON object");return}return s===void 0?void 0:{event:s,params:a}}function o2(e,t){const r=hc(t)?t:t===void 0?{}:null;if(!r)return{ok:!1,error:"The tool input must be a JSON object."};const n=[];let o;switch(e){case pr.listEventTypes:{const s=cr(r,"server",n,!0);o={tool:"list_event_types",...s?{server:s}:{}};break}case pr.subscribe:{const s=cr(r,"server",n),a=cr(r,"title",n),i=cr(r,"prompt",n),l=ph(r,n);s&&a&&i&&l&&(o={tool:"subscribe",server:s,title:a.slice(0,120),prompt:i,trigger:l});break}case pr.update:{const s=cr(r,"subscription_id",n),a=cr(r,"title",n,!0),i=cr(r,"prompt",n,!0),l=ph(r,n,!0),c=r.is_enabled;c!==void 0&&typeof c!="boolean"&&n.push("`is_enabled` must be true or false"),c===void 0&&r.title===void 0&&r.prompt===void 0&&r.triggers===void 0&&n.push("send at least one of `is_enabled`, `title`, `prompt` or `triggers`"),s&&(o={tool:"update",subscriptionId:s,...typeof c=="boolean"?{isEnabled:c}:{},...a?{title:a.slice(0,120)}:{},...i?{prompt:i}:{},...l?{trigger:l}:{}});break}case pr.listSubscriptions:o={tool:"list_subscriptions"};break;case pr.delete:{const s=cr(r,"subscription_id",n);s&&(o={tool:"delete",subscriptionId:s});break}}return n.length>0||!o?{ok:!1,error:`Fix the input and call ${e} again: ${n.join("; ")}.`}:{ok:!0,call:o}}var V1=/^app_[a-z0-9]{8}$/i,G1=/^page_[a-z0-9]{8}$/i,Y1=/^ui_[a-z0-9][a-z0-9_]{0,60}$/;function J1(e){return V1.test(e)}function ub(e){return Y1.test(e)}function K1(e){return G1.test(e)}var X1="setting";function s2(e){return Yu(X1,e)}function a2(e){return J1(e)||ub(e)||K1(e)||W1(e)}function i2(e){return Yu(Q1(e),e.requireToolApproval===!0)}function Q1(e){const{annotations:t}=e;return t?t.destructiveHint===!0?"setting":e.readOnly||t.readOnlyHint===!0?"never":"setting":e.readOnly?"never":"setting"}var l2="browser",Z1=new Set(["browser_observe","browser_webmcp_tools"]),ej=new Set(["browser_navigate","browser_act","browser_tabs","browser_webmcp_invoke"]),c2=[...ej,...Z1],fh=64,tj=512,rj=8192,nj=tx((e,t)=>({tools:new Map,globalNames:new Set,ownerTokens:new Map,shippedNames:new Set,registerUiTool:(r,n)=>{if(!ub(r.name))throw new Error(`[webmcp] UI tool name "${r.name}" must match ui_[a-z0-9][a-z0-9_]* (max 64 chars).`);if(r.annotations?.readOnlyHint!==void 0&&r.annotations.readOnlyHint!==r.readOnly)throw new Error(`[webmcp] UI tool "${r.name}" has readOnly=${r.readOnly} but annotations.readOnlyHint=${r.annotations.readOnlyHint}; they must agree.`);if(n?.signal?.aborted)return()=>{};t().tools.get(r.name)&&console.warn(`[webmcp] UI tool "${r.name}" re-registered; replacing.`);const o=Symbol(r.name);e(a=>{const i=new Map(a.tools);i.set(r.name,r);const l=new Set(a.globalNames);n?.scope==="global"?l.add(r.name):l.delete(r.name);const c=new Map(a.ownerTokens);return c.set(r.name,o),{tools:i,globalNames:l,ownerTokens:c}});const s=()=>{t().ownerTokens.get(r.name)===o&&t().unregisterUiTool(r.name)};return n?.signal?.addEventListener("abort",s,{once:!0}),s},unregisterUiTool:r=>{t().tools.has(r)&&e(n=>{const o=new Map(n.tools);o.delete(r);const s=new Set(n.globalNames);s.delete(r);const a=new Map(n.ownerTokens);return a.delete(r),{tools:o,globalNames:s,ownerTokens:a}})},resolve:r=>t().tools.get(r)??null,snapshotForChatBody:()=>{const r=[];let n=0;const{tools:o,globalNames:s}=t(),a=[...o.values()],i=[...a.filter(l=>s.has(l.name)),...a.filter(l=>!s.has(l.name))];for(const l of i){if(r.length>=fh){n+=1;continue}let c=l.inputSchema;if(c){let p=0;try{p=new TextEncoder().encode(JSON.stringify(c)).length}catch{continue}if(p>rj)continue}r.push({name:l.name,description:l.description.slice(0,tj),inputSchema:c,readOnly:l.readOnly,...l.annotations?{annotations:l.annotations}:{}})}return n>0&&console.warn(`[webmcp] UI tools snapshot capped at ${fh} entries; dropped ${n}.`),r.length>0&&e(l=>{const c=new Set(l.shippedNames);for(const p of r)c.add(p.name);return{shippedNames:c}}),r},wasShipped:r=>t().shippedNames.has(r)}));function u2(e){return e.nativePublication?.kind==="publish"}var Fo=new Map,ga=8192,hh=2e3;function oj(e,t){return Fo.set(e,t),()=>{Fo.get(e)===t&&Fo.delete(e)}}function sj(){return[...Fo.keys()].sort()}var db=Symbol("snapshot-too-large"),aj=ga*2;function ij(e){let t=0;return JSON.stringify(e,(r,n)=>{if(typeof n=="string"?t+=n.length:(typeof n=="number"||typeof n=="boolean")&&(t+=8),t>aj)throw db;return n})}function lj(e){let t;try{t=ij(e)}catch(r){return r===db?{truncated:!0,note:`Snapshot exceeded the ${ga}-char budget and was dropped to protect the main thread.`}:{error:"snapshot is not JSON-serializable"}}return t===void 0?{empty:!0}:t.length<=8192?e:{truncated:!0,note:`Snapshot exceeded ${ga} chars and was truncated.`,preview:t.slice(0,ga)}}async function cj(e){const t=Fo.get(e);if(!t)return{ok:!1,reason:"no_provider",error:`No snapshot provider for "${e}".`};let r;try{return{ok:!0,data:lj(await Promise.race([Promise.resolve().then(()=>t()),new Promise((n,o)=>{r=setTimeout(()=>o(new Error(`Snapshot for "${e}" timed out after ${hh}ms.`)),hh)})]))}}catch(n){return{ok:!1,reason:"failed",error:n instanceof Error?n.message:String(n)}}finally{r&&clearTimeout(r)}}async function d2(){const e=sj(),t=await Promise.all(e.map(async n=>{const o=await cj(n);return[n,o.ok?o.data:{error:o.error}]})),r={};for(const[n,o]of t)r[n]=o;return r}function uj(e,t){try{gm("ui_navigation_rejected",{location:"webmcp",segment:t==="unknown"?"unrecognized":e,reason:t})}catch{}}function dj(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`ui_${Date.now()}_${Math.random().toString(36).slice(2,10)}`}async function Ce(e){const t={...e,id:e.id??dj()},r=t.timeoutMs??3e4;let n;try{return await Promise.race([$1(t),new Promise(o=>{n=setTimeout(()=>{o({id:t.id,status:"error",error:ko("timeout",`Inspector command "${t.type}" timed out after ${r}ms. The action may still complete in the UI — observe state (e.g. ui_snapshot_app) before retrying instead of re-running it blindly.`)})},r)})])}finally{clearTimeout(n)}}function Re(e){return e.status==="success"?{ok:!0,data:e.result}:{ok:!1,error:`${e.error.code}: ${e.error.message}`}}function pj(){const e=_0();return e.sort()}function fj(e){const t=e?.trim()??"";if(!t)return{ok:!1,reason:"Navigation target is empty."};const r=t.replace(/^#/,"").replace(/^\/+/,"").split(/[/?]/)[0]||"servers",n=K0(r);return m0(n)?{ok:!0,path:w0(t),tab:n}:(uj(n,"unknown"),{ok:!1,reason:`Unknown navigation target "${e}". Valid targets: ${pj().join(", ")}.`})}async function p2(e){const t=fj(e);return t.ok?Re(await Ce({type:"navigate",payload:{target:t.path}})):{ok:!1,error:t.reason}}async function f2(e){return Re(await Ce({type:"selectServer",payload:{serverName:e}}))}async function hj(e){return Re(await Ce({type:"openPlayground",payload:e?{serverName:e}:{}}))}var pb=2e5;function h2(e,t=65536,r=pb){let n=0,o=0;const s=Symbol("over-cap");try{return JSON.stringify(e,(a,i)=>{if(o+=1,o>r)throw s;if(typeof i=="string"){if(n+=i.length,n>t)throw s}else if((typeof i=="number"||typeof i=="boolean")&&(n+=8,n>t))throw s;return i}),{bytes:n,truncated:!1}}catch(a){return a===s?{bytes:Math.min(n,t)||t,truncated:!0}:{bytes:0,truncated:!1}}}var Ju=16384;function fb(e){return e.length<=16384?e:`${e.slice(0,Ju)}… [truncated]`}function m2(e,t=Ju,r=pb){let n=0,o=0;const s=Symbol("over-budget");try{const a=JSON.stringify(e,function(i,l){if(o+=1,o>r)throw s;if(n+=Array.isArray(this)?1:i.length+4,typeof l=="string"){const c=t-n-2;if(c<=0)throw s;return n+=Math.min(l.length,c)+2,l.length>c?`${l.slice(0,c)}…`:l}if(l===null?n+=4:typeof l=="object"?n+=2:(typeof l=="number"||typeof l=="boolean")&&(n+=String(l).length),n>t)throw s;return l});return a===void 0||a.length>t?null:a}catch{return null}}var ze={kind:"publish",untrustedContent:!1},as={kind:"publish",untrustedContent:!0};function mj(e){return{kind:"publish",untrustedContent:e.untrustedContent,consequential:!0}}function g2(e){return{kind:"internal",reason:e}}var pl=Ju*2;function gj(e){let t=0;const r=Symbol("over-budget");try{return JSON.stringify(e,function(n,o){if(typeof o=="string"){if(t+=o.length,t>pl)throw r;return o}if((typeof o=="number"||typeof o=="boolean")&&(t+=8,t>pl))throw r;return o})}catch(n){if(n===r)return JSON.stringify(e)?.slice(0,pl)??"";throw n}}function vj(e){let t;try{t=gj(e===void 0?{ok:!0}:{ok:!0,data:e})}catch{t=JSON.stringify({ok:!0,note:"Result was not serializable."})}return{content:[{type:"text",text:fb(t)}]}}function ce(e){return{content:[{type:"text",text:fb(e)}],isError:!0}}function Pe(e){return e.ok?vj(e.data):ce(e.error)}function _e(e){if(typeof e!="string")return;const t=e.trim();return t.length>0?t:void 0}function hb(e){if(e===void 0)return{ok:!0};if(typeof e!="object"||e===null||Array.isArray(e))return{ok:!1};const t={};for(const[r,n]of Object.entries(e)){if(typeof n!="string")return{ok:!1};t[r]=n}return{ok:!0,record:t}}async function v2(e,t){if(U1(e))return null;const r=await hj(t);return r.ok?null:ce(`Could not open the playground first: ${r.error}`)}var fl={type:"string",description:"Server as shown on its card: display name (e.g. 'Asana') or a directory entry's catalog name."},mh={type:"string",enum:["text","app"],description:"Which entry of a dual-type card (Text and App) to target. Required when the card offers both."};function gh(e){return e===void 0?{ok:!0}:e==="text"||e==="app"?{ok:!0,variant:e}:{ok:!1}}function yj(){return[{name:"ui_connect_registry_server",description:"Install a server from a connector directory on this screen into the current project and start connecting it. Catalog entries only: for a server ALREADY in the project use ui_connect_server. It finishes in the background; watch ui_snapshot_app. Some entries are reported, not started: 'authorization_required' (it would redirect the browser) and 'endpoint_choice_required' (the URL is the user's to pick). Relay those; the user clicks Connect on the card.",inputSchema:{type:"object",properties:{serverName:fl,variant:mh},required:["serverName"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},nativePublication:as,mayNavigate:!0,execute:async e=>{const t=_e(e.serverName);if(!t)return ce("Missing required 'serverName' string.");const r=gh(e.variant);if(!r.ok)return ce(`'variant' must be "text" or "app" when provided.`);const n=await Ce({type:"connectRegistryServer",payload:{serverName:t,...r.variant?{variant:r.variant}:{}}});return Pe(Re(n))}},{name:"ui_disconnect_registry_server",description:"Disconnect a server that was installed from the registry and remove it from the current project. The catalog entry stays in the registry, so it can be reinstalled any time with ui_connect_registry_server. For a project server that did not come from the registry, use ui_disconnect_server.",inputSchema:{type:"object",properties:{serverName:fl,variant:mh},required:["serverName"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},nativePublication:ze,execute:async e=>{const t=_e(e.serverName);if(!t)return ce("Missing required 'serverName' string.");const r=gh(e.variant);if(!r.ok)return ce(`'variant' must be "text" or "app" when provided.`);const n=await Ce({type:"disconnectRegistryServer",payload:{serverName:t,...r.variant?{variant:r.variant}:{}}});return Pe(Re(n))}},{name:"ui_toggle_registry_star",description:"Star or unstar a registry server for the user. 'starred' is the explicit target state — true stars the card, false unstars it, and a card already in that state is left unchanged.",inputSchema:{type:"object",properties:{serverName:fl,starred:{type:"boolean",description:"Target state: true to star, false to unstar."}},required:["serverName","starred"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.serverName);if(!t)return ce("Missing required 'serverName' string.");if(typeof e.starred!="boolean")return ce("Missing required 'starred' boolean.");const r=await Ce({type:"toggleRegistryStar",payload:{serverName:t,starred:e.starred}});return Pe(Re(r))}},{name:"ui_search_registry_directory",description:"Search the Claude connector directory. Thousands of entries, far more than the page lists. Matches names, descriptions and tool/skill names, so 'invoice' and 'create_issue' work as well as 'Linear'. Omit 'query' to browse. Drives the screen's own controls, so results are what the user sees. Read them from ui_snapshot_app's `directory` block, then install with ui_connect_registry_server.",inputSchema:{type:"object",properties:{query:{type:"string",description:"What to search for. Omit or leave empty to browse the directory."},source:{type:"string",enum:["anthropic-directory"],description:"The Claude directory. Omit to keep the view on screen."},tier:{type:"string",enum:["all","anthropic","partner","community"],description:"Verification tier. Claude directory only; 'all' clears it."}},required:[],additionalProperties:!1},readOnly:!0,annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:as,execute:async e=>{const t=_e(e.query),r=_e(e.tier),n=_e(e.source);if(e.tier!==void 0&&!r)return ce("'tier' must be a non-empty string when provided.");if(e.source!==void 0&&!n)return ce("'source' must be a non-empty string when provided.");const o=await Ce({type:"searchRegistryDirectory",payload:{...t?{query:t}:{},...n?{source:n}:{},...r?{tier:r}:{}}});return Pe(Re(o))}}]}var hl={type:"string",description:"Eval suite as the Evaluate screen shows it: its name (e.g. 'Asana smoke tests') or its suite id."};function ml(e){return _e(e)??null}function bj(){return[{name:"ui_open_eval_suite_form",description:"Open the create-suite dialog on the Evaluate screen for the user to fill in and submit. Optionally prefills the suite name — nothing else. This only prepares the form; it never creates the suite (the user picks servers/hosts and submits). To act on an existing suite, use the run/generate/delete eval tools instead.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Optional suite name to prefill in the dialog."}},additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,mayNavigate:!0,execute:async e=>{const t=_e(e.name);if(e.name!==void 0&&t===void 0)return ce("'name' must be a non-empty string when provided.");const r=await Ce({type:"openEvalSuiteForm",payload:{...t?{name:t}:{}}});return Pe(Re(r))}},{name:"ui_run_eval_suite",description:"Start a run of an existing eval suite — real model and MCP tool calls that SPEND the organization's eval iteration quota (same gate as the Run button; an exhausted quota is reported as an error, and the run is refused). Each case runs `iterations` times; when omitted, the run uses the count the Set up run screen would start at, never the per-case saved defaults. The result reports the count used. The run continues in the background; observe progress with ui_snapshot_app.",inputSchema:{type:"object",properties:{suite:hl,iterations:{type:"integer",minimum:1,maximum:10,description:"Optional runs per case (1-10). Raised to the suite's minimum when lower. Omit to use the Set up run default."}},required:["suite"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},nativePublication:ze,mayNavigate:!0,execute:async e=>{const t=ml(e.suite);if(!t)return ce("Missing required 'suite' string.");const r=e.iterations;if(r!==void 0&&typeof r!="number")return ce("'iterations' must be a whole number from 1 to 10.");const n=await Ce({type:"runEvalSuite",payload:{suite:t,...r!==void 0?{iterations:r}:{}}});return Pe(Re(n))}},{name:"ui_cancel_eval_run",description:"Cancel an in-progress eval run by its run id (full id, or the shortened id the runs list displays). Cancelling stops work and spends nothing; a run that already finished is reported as such.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"The run to cancel: its id, full or as shown in the runs list."}},required:["runId"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.runId);if(!t)return ce("Missing required 'runId' string.");const r=await Ce({type:"cancelEvalRun",payload:{runId:t}});return Pe(Re(r))}},{name:"ui_generate_eval_tests",description:"Generate suggested test cases for an existing eval suite using an LLM over the suite's connected servers. SPENDS MONEY and adds the generated cases to the suite. Generation runs in the background; new cases appear in the suite's case list (check with ui_snapshot_app). A suite that runs several environments with different servers generates for one of them: pass 'environment'.",inputSchema:{type:"object",properties:{suite:hl,environment:{type:"string",description:"For a suite whose environments connect different servers: the environment to generate for, by id or by name as ui_snapshot_app lists it under selectedSuite.environments. Omit otherwise."}},required:["suite"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},nativePublication:ze,execute:async e=>{const t=ml(e.suite);if(!t)return ce("Missing required 'suite' string.");const r=_e(e.environment),n=await Ce({type:"generateEvalTests",payload:{suite:t,...r?{environment:r}:{}}});return Pe(Re(n))}},{name:"ui_edit_eval_case_draft",description:"Edit the test case CURRENTLY OPEN in the case editor (e.g. the 'Describe a case' workspace) — there is no suite/case id to pass, it always targets whatever case is on screen. Set 'prompt' to (re)write the case's user-turn prompt, 'addToolAssertion' to add a check that a specific tool was called with given arguments, or 'noTool' to mark the case as expecting no tool call. Fails with an error if no case is currently open for editing.",inputSchema:{type:"object",properties:{prompt:{type:"string",description:"The user prompt this case's first turn should send. Replaces whatever prompt the case already had."},addToolAssertion:{type:"object",description:"Add a check that the given tool was called with these arguments.",properties:{toolName:{type:"string"},arguments:{type:"object",description:"Expected arguments, as a plain object."}},required:["toolName"],additionalProperties:!1},noTool:{type:"boolean",description:"Mark the case as expecting no tool call at all."}},additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.prompt);if(e.prompt!==void 0&&t===void 0)return ce("'prompt' must be a non-empty string when provided.");let r;if(e.addToolAssertion!==void 0){const o=e.addToolAssertion;if(typeof o!="object"||o===null||Array.isArray(o))return ce("'addToolAssertion' must be an object.");const s=_e(o.toolName);if(!s)return ce("'addToolAssertion.toolName' is required and must be a non-empty string.");const a=o.arguments;if(a!==void 0&&(typeof a!="object"||a===null||Array.isArray(a)))return ce("'addToolAssertion.arguments' must be an object when provided.");r={toolName:s,...a?{arguments:a}:{}}}if(e.noTool!==void 0&&typeof e.noTool!="boolean")return ce("'noTool' must be a boolean when provided.");if(t===void 0&&r===void 0&&e.noTool===void 0)return ce("Provide at least one of 'prompt', 'addToolAssertion', or 'noTool'.");const n=await Ce({type:"editEvalCaseDraft",payload:{...t!==void 0?{prompt:t}:{},...r?{addToolAssertion:r}:{},...e.noTool!==void 0?{noTool:e.noTool}:{}}});return Pe(Re(n))}},{name:"ui_delete_eval_suite",description:"Permanently delete an existing eval suite, including its test cases and run history. Irreversible — be sure the user wants this exact suite gone. The suite is addressed by name or id, exactly as shown on the Evaluate screen.",inputSchema:{type:"object",properties:{suite:hl},required:["suite"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=ml(e.suite);if(!t)return ce("Missing required 'suite' string.");const r=await Ce({type:"deleteEvalSuite",payload:{suite:t}});return Pe(Re(r))}}]}var Sj={type:"string",description:"Persona as the Personas list shows it: its name (e.g. 'Impatient buyer') or its id."},_j={type:"string",description:"Goal as its card shows it: the goal text (e.g. 'Book a flight to Tokyo') or the goal id. Must belong to the currently selected persona."},vh="Launch a run of one existing goal: its sessions per host run on each of its hosts, making REAL model and MCP tool calls that SPEND the organization's quota (the same gate as the Run goal button: a quota or billing refusal comes back as an error and nothing runs). The goal must belong to the currently selected persona. The run continues in the background; ui_snapshot_app shows its progress.";function yh(e,t){return{name:e,description:t,inputSchema:{type:"object",properties:{journey:_j},required:["journey"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},nativePublication:ze,execute:async r=>{const n=_e(r.journey);if(!n)return ce("Missing required 'journey' string.");const o=await Ce({type:"launchSwarmRun",payload:{journey:n}});return Pe(Re(o))}}}function xj(){return[{name:"ui_create_persona",description:"Create a persona on the Swarms screen — a simulated user a goal runs as. Takes a short name and a role (e.g. 'QA tester', 'first-time customer'), plus optional free-text notes describing personality. Low-entropy, so this creates the persona directly and selects it. Goals and runs for the persona are added afterward.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Short display name for the persona."},role:{type:"string",description:"The persona's role (e.g. 'QA tester')."},notes:{type:"string",description:"Optional personality / behavior notes."}},required:["name","role"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.name),r=_e(e.role);if(!t)return ce("Missing required 'name' string.");if(!r)return ce("Missing required 'role' string.");const n=_e(e.notes);if(e.notes!==void 0&&typeof e.notes!="string")return ce("'notes' must be a string when provided.");const o=await Ce({type:"createPersona",payload:{name:t,role:r,...n?{notes:n}:{}}});return Pe(Re(o))}},{name:"ui_open_journey_form",description:"Open the new-goal form on the Swarms screen for the user to fill in and submit. A goal picks which HOSTS it runs against and how many sessions per host — high-entropy choices, so this only prepares the form; it never creates the goal. Optionally selects a persona and prefills the goal text. To START a goal that already exists, use ui_launch_goal_run instead.",inputSchema:{type:"object",properties:{persona:Sj,goal:{type:"string",description:"Optional goal text to prefill (what the persona is trying to accomplish)."}},additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.persona);if(e.persona!==void 0&&t===void 0)return ce("'persona' must be a non-empty string when provided.");const r=_e(e.goal);if(e.goal!==void 0&&r===void 0)return ce("'goal' must be a non-empty string when provided.");const n=await Ce({type:"openJourneyForm",payload:{...t?{persona:t}:{},...r?{goal:r}:{}}});return Pe(Re(n))}},yh("ui_launch_goal_run",vh),yh("ui_launch_swarm_run",`Old name for ui_launch_goal_run, kept for agents that still call it. ${vh}`)]}var ra={type:"string",description:"Host as the Hosts list shows it: its name (e.g. 'Claude') or its host id."};function Ej(e){if(!Array.isArray(e))return{ok:!1};const t=[];for(const r of e){const n=_e(r);if(!n)return{ok:!1};t.push(n)}return{ok:!0,names:t}}function wj(){return[{name:"ui_create_host",description:"Create a new host on the Hosts screen from a client TEMPLATE. Takes a display name and, optionally, the template's catalog id (e.g. 'claude', 'cursor', 'mcpjam'); omit it for the default template. Low-entropy — the config is seeded from the template exactly as the New Client dialog does — so this creates the host directly, selects it, and opens its editor. To change the host's model, system prompt, or behavior afterward, use ui_open_host_editor.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Display name for the new host."},template:{type:"string",description:"Optional catalog template id to seed from (e.g. 'claude', 'cursor'). Defaults to the standard template."}},required:["name"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},nativePublication:ze,mayNavigate:!0,execute:async e=>{const t=_e(e.name);if(!t)return ce("Missing required 'name' string.");const r=_e(e.template);if(e.template!==void 0&&r===void 0)return ce("'template' must be a non-empty string when provided.");const n=await Ce({type:"createHost",payload:{name:t,...r?{template:r}:{}}});return Pe(Re(n))}},{name:"ui_open_host_editor",description:"Open a host's editor on the Hosts screen for the user. This is the way to change host CONFIG — its model, system prompt, tool-approval and tool-discovery behavior, protocol, and appearance are high-entropy and edited in the editor's focus tabs, not committed from here. Selects the host and navigates to its canvas; it changes nothing on its own.",inputSchema:{type:"object",properties:{host:ra},required:["host"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,mayNavigate:!0,execute:async e=>{const t=_e(e.host);if(!t)return ce("Missing required 'host' string.");const r=await Ce({type:"openHostEditor",payload:{host:t}});return Pe(Re(r))}},{name:"ui_set_host_servers",description:"Set which of the project's MCP servers a host has attached, by name. 'servers' is the COMPLETE list of existing project server names the host should have — servers not listed are detached, and unknown names are rejected without changing anything. Reversible (reattach any time). To add a server to the project first, use the Connect-screen server tools.",inputSchema:{type:"object",properties:{host:ra,servers:{type:"array",items:{type:"string"},description:"Complete set of existing project server names to attach (empty array detaches all)."}},required:["host","servers"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.host);if(!t)return ce("Missing required 'host' string.");const r=Ej(e.servers);if(!r.ok)return ce("'servers' must be an array of non-empty project server names.");const n=await Ce({type:"setHostServers",payload:{host:t,servers:r.names}});return Pe(Re(n))}},{name:"ui_delete_host",description:"Permanently delete a host, including its configuration and sessions. Irreversible — be sure the user wants this exact host gone. The host is addressed by name or id, exactly as shown on the Hosts screen.",inputSchema:{type:"object",properties:{host:ra},required:["host"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.host);if(!t)return ce("Missing required 'host' string.");const r=await Ce({type:"deleteHost",payload:{host:t}});return Pe(Re(r))}},{name:"ui_duplicate_host",description:"Duplicate an existing host into a new one with the same configuration. Optionally names the copy; otherwise the backend derives a name. The new host is selected and opened. Low-entropy, so this commits directly.",inputSchema:{type:"object",properties:{host:ra,name:{type:"string",description:"Optional name for the duplicate."}},required:["host"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},nativePublication:ze,mayNavigate:!0,execute:async e=>{const t=_e(e.host);if(!t)return ce("Missing required 'host' string.");const r=_e(e.name);if(e.name!==void 0&&r===void 0)return ce("'name' must be a non-empty string when provided.");const n=await Ce({type:"duplicateHost",payload:{host:t,...r?{name:r}:{}}});return Pe(Re(n))}}]}var na={type:"object",properties:{},additionalProperties:!1};function kj(){return[{name:"ui_start_computer",description:"Start the project's cloud computer — provision it on first use, or wake it if it's asleep. This spins up REAL infrastructure and counts against the daily start cap (same gate as the Open-terminal button; a cap rejection is reported as an error and the start is refused). It does NOT open the interactive terminal (that's a human action). The computer comes up in the background; watch ui_snapshot_app for it to reach 'ready'.",inputSchema:na,readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},nativePublication:ze,execute:async()=>{const e=await Ce({type:"startComputer"});return Pe(Re(e))}},{name:"ui_hibernate_computer",description:"Hibernate the project's computer now — put it to sleep immediately. Non-destructive: files and state are preserved and it wakes on next use. Hibernating an already-asleep computer reports that there was nothing to pause.",inputSchema:na,readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async()=>{const e=await Ce({type:"hibernateComputer"});return Pe(Re(e))}},{name:"ui_reset_computer",description:"Reset the project's computer to its image — WIPES all files and mutable state on it. Irreversible; be sure the user wants a clean box. Reports if there was nothing to reset.",inputSchema:na,readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async()=>{const e=await Ce({type:"resetComputer"});return Pe(Re(e))}},{name:"ui_delete_computer",description:"Delete the project's computer entirely, removing all files on it. Irreversible — be sure the user wants this. A new computer can be started later with ui_start_computer.",inputSchema:na,readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async()=>{const e=await Ce({type:"deleteComputer"});return Pe(Re(e))}}]}var gl=["invited_only","link_guests","project"];function Ij(){return[{name:"ui_publish_scenario",description:"Publish one of this project's environments as a User Testing scenario — a share link real testers can open, whose sessions come back as insights — and open that scenario. Use it when someone wants to hand their setup to real people and read what happened. Idempotent: an environment that is already published is opened as-is, keeping the access it already has. Copying the share link is a human action — check ui_snapshot_app for whether a link exists.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment to publish, as the Environments screen names it (e.g. 'Checkout flow'), or its environment id."},access:{type:"string",enum:[...gl],description:"Who may open the link: 'invited_only' (people invited by email), 'link_guests' (anyone with the link, including signed-out visitors, funded by this organization), or 'project' (signed-in team members). Applied when the scenario is created; defaults to 'invited_only'."},name:{type:"string",description:"What to call the scenario. Defaults to the environment's own name. Applied when the scenario is created."}},required:["environment"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:mj({untrustedContent:!1}),execute:async e=>{const t=_e(e.environment);if(!t)return ce("Missing required 'environment' string (an environment name or id — list them with ui_snapshot_app).");const r=_e(e.access);if(r&&!gl.includes(r))return ce(`Unknown access "${r}". Use one of: ${gl.join(", ")}.`);const n=_e(e.name),o=await Ce({type:"publishScenario",payload:{environment:t,...r?{access:r}:{},...n?{name:n}:{}}});return Pe(Re(o))}},{name:"ui_delete_scenario",description:"Permanently delete a User Testing scenario — its share link stops working and its saved tester-session history is cleared. Irreversible; be sure the user wants this exact scenario gone. Addressed by scenario name or id, exactly as the scenario list shows it. What happens to the setup behind it varies by scenario: report what the result's note says rather than assuming.",inputSchema:{type:"object",properties:{scenario:{type:"string",description:"Scenario to delete, as the User Testing list names it, or its scenario id."}},required:["scenario"],additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.scenario);if(!t)return ce("Missing required 'scenario' string (a scenario name or id — list them with ui_snapshot_app).");const r=await Ce({type:"deleteScenario",payload:{scenario:t}});return Pe(Re(r))}}]}function Cj(){return[{name:"ui_read_resource",description:"Read a resource from the server selected on the Resources screen, exactly as the Read button does. 'resource' is a concrete resource's uri or name as the list shows it, OR a resource template's name/uriTemplate — pass 'templateArguments' to fill a template's parameters. The read reflects on screen and its content is returned TRUNCATED (large or binary bodies are capped/omitted for the transcript). Unknown resource → error; ambiguous → pass the exact uri. List what's available with ui_snapshot_app.",inputSchema:{type:"object",properties:{resource:{type:"string",description:"A resource's uri or name, or a resource template's name/uriTemplate, as shown on the Resources screen."},templateArguments:{type:"object",description:"Values for a resource template's parameters (string→string). Ignored for a concrete resource.",additionalProperties:{type:"string"}}},required:["resource"],additionalProperties:!1},readOnly:!0,annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},nativePublication:as,execute:async e=>{const t=_e(e.resource);if(!t)return ce("Missing required 'resource' string (a resource uri/name or a template name/uriTemplate).");const r=hb(e.templateArguments);if(!r.ok)return ce("'templateArguments' must be an object of string values when provided.");const n=await Ce({type:"readResource",payload:{resource:t,...r.record?{templateArguments:r.record}:{}}});return Pe(Re(n))}}]}function Rj(){return[{name:"ui_get_prompt",description:"Render a prompt from the server selected on the Prompts screen, exactly as the Run button does. 'prompt' is a prompt's name (or title) as the list shows it; 'arguments' supplies its argument values (all string-typed). The render reflects on screen and its content is returned TRUNCATED (large bodies are capped for the transcript). Unknown prompt → error; ambiguous → pass the exact name. List what's available with ui_snapshot_app.",inputSchema:{type:"object",properties:{prompt:{type:"string",description:"A prompt's name or title, as shown on the Prompts screen."},arguments:{type:"object",description:"Values for the prompt's arguments (string→string). Omit for a prompt that takes none.",additionalProperties:{type:"string"}}},required:["prompt"],additionalProperties:!1},readOnly:!0,annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},nativePublication:as,execute:async e=>{const t=_e(e.prompt);if(!t)return ce("Missing required 'prompt' string (a prompt name).");const r=hb(e.arguments);if(!r.ok)return ce("'arguments' must be an object of string values when provided.");const n=await Ce({type:"getPrompt",payload:{prompt:t,...r.record?{arguments:r.record}:{}}});return Pe(Re(n))}}]}var vl=["preregistered","dcr","cimd"];function Tj(){return[{name:"ui_open_oauth_server_config",description:"Open the OAuth debugger's Configure-Server modal for the user to review and save. Optionally prefills the server name, MCP server URL, and registration mode. Credentials (client ID/secret) are always typed by the human — they cannot be passed here. Omit serverName to edit the currently selected server; pass a new name to create a new test target. Never commits anything itself.",inputSchema:{type:"object",properties:{serverName:{type:"string",description:"Server to configure, as the server tabs show it. Omitted → the selected server (or a blank form when none is selected). A name matching a different existing server is rejected."},serverUrl:{type:"string",description:"MCP base URL to prefill (e.g. https://example.com/mcp)."},registrationMode:{type:"string",enum:[...vl],description:"Client registration mode to prefill: 'preregistered' (human enters a client ID), 'dcr' (Dynamic Client Registration), or 'cimd' (URL-based client metadata; 2025-11-25 only)."}},additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async e=>{const t=_e(e.serverName);if(e.serverName!==void 0&&t===void 0)return ce("'serverName' must be a non-empty string when provided.");const r=_e(e.serverUrl);if(e.serverUrl!==void 0&&r===void 0)return ce("'serverUrl' must be a non-empty string when provided.");const n=_e(e.registrationMode);if(e.registrationMode!==void 0&&(!n||!vl.includes(n)))return ce(`'registrationMode' must be one of: ${vl.join(", ")}.`);const o=await Ce({type:"openOauthServerConfig",payload:{...t?{serverName:t}:{},...r?{serverUrl:r}:{},...n?{registrationMode:n}:{}}});return Pe(Re(o))}},{name:"ui_advance_oauth_flow",description:"Advance the OAuth debugger exactly ONE protocol step — the same as clicking Continue. Steps make REAL requests to the target and its authorization server; the registration step can create a PERSISTENT client registration there. At the authorization step this opens a sign-in popup a HUMAN must complete (if none appeared, ask the user to check their popup blocker) — observe with ui_snapshot_app instead of re-calling. Errors if unconfigured, mid-step, or already complete.",inputSchema:{type:"object",properties:{},additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},nativePublication:as,execute:async()=>{const e=await Ce({type:"advanceOauthFlow",payload:{}});return Pe(Re(e))}},{name:"ui_reset_oauth_flow",description:"Reset the OAuth debugger's flow back to the start for the configured target. Clears the local step-by-step state (tokens, codes, logged requests) so the flow can be run again. Nothing is sent to any server.",inputSchema:{type:"object",properties:{},additionalProperties:!1},readOnly:!1,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},nativePublication:ze,execute:async()=>{const e=await Ce({type:"resetOauthFlow",payload:{}});return Pe(Re(e))}}]}var mb={registry:{surfaceId:"registry",buildTools:yj},evals:{surfaceId:"evals",buildTools:bj},swarms:{surfaceId:"swarms",buildTools:xj},hosts:{surfaceId:"hosts",buildTools:wj},computer:{surfaceId:"computer",buildTools:kj},scenarios:{surfaceId:"scenarios",buildTools:Ij},resources:{surfaceId:"resources",buildTools:Cj},prompts:{surfaceId:"prompts",buildTools:Rj},"oauth-flow":{surfaceId:"oauth-flow",buildTools:Tj}};function y2(e){const t=mb[e];return t?t.buildTools().map(r=>r.name):[]}function Ku(e){const{surfaceId:t}=e,r=e.enabled??!0,n=(0,f.useRef)(e.handlers),o=(0,f.useRef)(e.snapshot);(0,f.useLayoutEffect)(()=>{n.current=e.handlers,o.current=e.snapshot}),(0,f.useLayoutEffect)(()=>{if(!r)return;const s=new AbortController,a=[],i=mb[t];if(i){const c=nj.getState().registerUiTool;for(const p of i.buildTools())c(p,{signal:s.signal,scope:"surface"})}const l=Object.keys(n.current??{});for(const c of l){const p=d=>{const h=n.current?.[c];if(!h)throw j1("unsupported_in_mode",`Surface "${t}" no longer handles "${c}".`);return h(d)};a.push(H1(c,p))}return o.current&&a.push(oj(t,()=>o.current?.())),()=>{s.abort();for(const c of a)c()}},[t,r])}function b2(e){const t=[...e.serverItems,...e.appItems],r={mcpServer:0,mcpApps:0,oauth:0,http:0,other:0};for(const s of t)s.source==="mcp-server"?r.mcpServer+=1:s.source==="mcp-apps"?r.mcpApps+=1:s.source==="oauth"?r.oauth+=1:s.source==="http"?r.http+=1:r.other+=1;const n=s=>{const a=Date.parse(s);return Number.isNaN(a)?0:a},o=[...t].sort((s,a)=>n(a.timestamp)-n(s.timestamp));return{totalItems:t.length,counts:r,recent:o.slice(0,30).map(s=>({source:s.source,method:s.method,direction:s.direction,server:s.serverName??s.serverId,timestamp:s.timestamp}))}}function S2(e){return{connectedServerCount:e.servers.length,servers:e.servers.slice(0,30).map(t=>t.name),selectedServer:e.selectedServerName,showMatrix:e.showMatrix}}function gb(e){return{totalSelectableHosts:e.totalSelectableHosts,comparedHostCount:e.totalSelectedCount,comparedHosts:e.selectedHosts.slice(0,30).map(t=>t.hostName),capabilityRowCount:e.capabilityFields.length,capabilityRows:e.capabilityFields.slice(0,30).map(t=>t.label),viewMode:e.viewMode,hasSearchQuery:!!(e.searchQuery&&e.searchQuery.trim()),supportFilter:e.supportFilter,divergingOnly:e.divergingOnly,loadedSelectedCount:e.loadedSelectedCount}}function Aj(e){return{view:"capability-permalink",capabilitySlug:e.capabilitySlug??null,capability:e.capabilityLabel,slice:e.slice,hostCount:e.rows.length,hosts:e.rows.slice(0,30).map(t=>({host:t.hostName,support:t.supportLevel,label:t.supportLabel}))}}function _2(e){return{selectedServer:e.selectedServer,taskCount:e.tasks.length,hasActiveTasks:e.hasActiveTasks,autoRefresh:e.autoRefresh,tasks:e.tasks.slice(0,30).map(t=>({taskId:t.taskId,status:t.status,createdAt:t.createdAt})),selectedTaskId:e.selectedTaskId}}var x2="mcpjam",E2="/mcp.svg",vb={mcpjam:h0,claude:Wd,"claude-desktop":zd,"claude-code":A0,"claude-code-desktop":zd,"claude-code-web":Wd,chatgpt:$d,"chatgpt-desktop":Fd,"chatgpt-work":$d,"chatgpt-work-desktop":Fd,mistral:D0,goose:fm,slack:j0,cursor:Ud,"cursor-cli":Ud,codex:Hd,"codex-cli":Hd,opencode:im,"copilot-cli":dm,copilot:M0,vscode:Y0,agentcore:W0,n8n:N0,gemini:k0,perplexity:H0,cline:pm,notion:J0,grokbot:I0,muse:R0},yb={opencode:{light:im,dark:C0},goose:{light:fm,dark:B0},cline:{light:pm,dark:G0},"copilot-cli":{light:dm,dark:Q0}};function mc(e,t){return(t?yb[e]?.[t]:void 0)??vb[e]??"/mcp.svg"}var w2=Object.entries(vb).map(([e,t])=>({id:e,logoSrc:t,logoSrcByTheme:yb[e]})),ct="#6E6E80",Nj={mcpjam:"#E07856",claude:"#D97757","claude-desktop":"#D97757","claude-code":"#D97757","claude-code-desktop":"#D97757","claude-code-web":"#D97757",chatgpt:ct,"chatgpt-desktop":ct,"chatgpt-work":ct,"chatgpt-work-desktop":ct,codex:ct,"codex-cli":ct,mistral:"#FA520F",goose:ct,slack:"#611F69",cursor:ct,"cursor-cli":ct,"copilot-cli":ct,copilot:ct,vscode:"#0098FF",agentcore:"#FF9900",n8n:"#EA4B71",perplexity:"#20808D",cline:ct,notion:ct,grokbot:ct,muse:ct};function k2(e){return`color-mix(in oklch, ${Nj[e]??ct} 12%, var(--card))`}var bb=[[/mcpjam/i,"mcpjam"],[/claude[ -]?code[ -]?desktop/i,"claude-code-desktop"],[/claude[ -]?code[ -]?web/i,"claude-code-web"],[/claude[ -]?code/i,"claude-code"],[/claude[ -]?desktop/i,"claude-desktop"],[/claude/i,"claude"],[/chatgpt[ -]?work[ -]?desktop/i,"chatgpt-work-desktop"],[/chatgpt[ -]?work/i,"chatgpt-work"],[/chatgpt[ -]?desktop/i,"chatgpt-desktop"],[/chatgpt|openai/i,"chatgpt"],[/codex[ -]?cli/i,"codex-cli"],[/codex/i,"codex"],[/agent[ -]?core/i,"agentcore"],[/n8n/i,"n8n"],[/opencode/i,"opencode"],[/copilot[ -]cli/i,"copilot-cli"],[/copilot/i,"copilot"],[/cursor[ -]?cli/i,"cursor-cli"],[/cursor/i,"cursor"],[/vs ?code/i,"vscode"],[/goose/i,"goose"],[/cline/i,"cline"],[/gemini|google[ -]?adk/i,"gemini"],[/perplexity/i,"perplexity"],[/notion/i,"notion"],[/grok/i,"grokbot"],[/\bmuse\b/i,"muse"],[/slack/i,"slack"],[/mistral/i,"mistral"]];function Pj(e){for(const[t,r]of bb)if(t.test(e))return r;return $0(e)}function Sb(e,t){for(const[r,n]of bb)if(r.test(e))return mc(n,t);return E0(e,t)??"/mcp.svg"}function _b(e,t){return y0(e.hostStyle)?pn(e.hostStyle,void 0,t):Sb(e.name,t)}var Mj=1796232777697,Oj=new Intl.DateTimeFormat("en-CA",{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),jj=2592e6,xb="Last checked over 30 days ago";function za(e){return e===void 0||!Number.isFinite(e)?"—":Oj.format(new Date(e))}function Eb(e){return e===void 0||!Number.isFinite(e)?!1:Date.now()-e>jj}function Lj(e,t,r){return e!=="mcpjam"||r===null||!Number.isFinite(r)||r<=0?t:r}var cn="preset:";function Xu(e){return e.startsWith(cn)}function Qu(e,t={}){const r=[],n={},o=t.mcpjamWebDeployedAt===void 0?Mj:t.mcpjamWebDeployedAt;for(const s of z0(e)){if(t.excludedTemplateIds?.has(s.id))continue;const a=`${cn}${s.id}`,i=V0(e,s.id);if(!i)continue;const l={...i,id:a,schemaVersion:2,supportedProtocolVersions:s.supportedProtocolVersions,provenance:s.provenance,rendersMcpApps:s.rendersMcpApps,styleVariablesByTheme:s.styleVariablesByTheme};r.push({hostId:a,name:s.label,displayName:s.label,hostConfigId:a,modelId:l.modelId,serverCount:0,createdAt:0,updatedAt:0}),n[a]={hostId:a,hostName:s.label,hostStyle:l.hostStyle,configHashShort:s.id,verifiedAt:Lj(s.id,s.verifiedAt,o),config:l}}return{hosts:r,subjects:n}}function bh(e,t={}){const r=o=>o.hostId==="preset:mcpjam"||t[o.hostId]?.hostStyle==="mcpjam"||o.name!==void 0&&/mcpjam/i.test(o.name),n=e.filter(o=>!r(o));return n.length===e.length?[...e]:[...n,...e.filter(r)]}function gc(e,t={}){if(Xu(e.hostId))return e.hostId.slice(7);if(e.hostStyle)return e.hostStyle;const r=t[e.hostId]?.hostStyle;return r||(e.name?Pj(e.name):null)}function Dj(e,t,r={}){const n=new Set(e.map(o=>gc(o,r)).filter(o=>o!==null));return n.size===0?[...t]:t.filter(o=>!n.has(gc(o,r)))}function Fj(e,t,r={}){const n=[...t].sort((i,l)=>n_({hostId:i.hostId,createdAt:i.createdAt??0},{hostId:l.hostId,createdAt:l.createdAt??0})),o=new Map;for(const i of n){const l=gc(i,r);l&&!o.has(l)&&o.set(l,i.hostId)}if(o.size===0)return[...e];const s=new Set,a=[];for(const i of e){const l=Xu(i)?i.slice(7):null,c=l&&o.get(l)||i;s.has(c)||(s.add(c),a.push(c))}return a}var wb="host-compare-selected:",Hj={slackbot:"slack","slack-bot":"slack"},vc=[`${cn}chatgpt`,`${cn}claude`];function Uj(e){if(typeof window>"u")return null;try{const t=sessionStorage.getItem(`${wb}${e}`);if(!t)return null;const r=JSON.parse(t);return Array.isArray(r)?r.filter(n=>typeof n=="string"):null}catch{return null}}function $j(e,t){if(!(typeof window>"u"))try{sessionStorage.setItem(`${wb}${e}`,JSON.stringify([...t]))}catch{}}function Ln(e,t){const r=new Set;return e.filter(n=>!t.has(n)||r.has(n)?!1:(r.add(n),!0))}function Bj(e,t,r=1){return e.includes(t)?e.length<=r?[...e]:e.filter(n=>n!==t):[...e,t]}function kb(e){if(!e)return null;const t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0).map(zj),r=[...new Set(t)];return r.length>0?r:null}function zj(e){if(!e.startsWith("preset:"))return e;const t=e.slice(cn.length),r=Hj[t];return r?`${cn}${r}`:e}function Wj(e){const t=new Set(e.knownHostIds??e.liveHostIds),r=e.remapSelection??(a=>[...a]);if(e.urlSelection&&e.urlSelection.length>0){const a=Ln(r(e.urlSelection),t);if(a.length>0)return a}const n=Uj(e.projectId);if(n){const a=Ln(r(n),t);if(a.length>0)return a}const o=Ln(r(e.previousSelection),t);if(o.length>0)return o;const s=Ln(r(vc),t);return s.length>0?s:[...e.liveHostIds]}function qj(e){return e!==void 0&&e.kind!=="personal"}var I2="mcpjam",C2=e_;function Vj(e){if(!qj(e.computer))return e;const{computer:t,...r}=e;return r}function R2(e,t={}){const r=Dr(e);return t.themeMode!==void 0&&(r.hostContext={...r.hostContext,theme:t.themeMode}),Vj(r)}function T2(e){return{hostStyle:e.hostStyle,modelId:e.modelId,...e.modelSelection?.modelId===e.modelId?{modelSelection:e.modelSelection}:{},systemPrompt:e.systemPrompt,systemPromptDefault:e.systemPromptDefault,temperature:e.temperature,requireToolApproval:e.requireToolApproval,respectToolVisibility:e.respectToolVisibility??!0,runUnloadedToolCalls:e.runUnloadedToolCalls,progressiveToolDiscovery:e.progressiveToolDiscovery,requireNativeToolDiscovery:e.requireNativeToolDiscovery,modelVisibleMcpToolResults:e.modelVisibleMcpToolResults?Zj(e.modelVisibleMcpToolResults):void 0,mcpToolResultImageRendering:e.mcpToolResultImageRendering?eL(e.mcpToolResultImageRendering):void 0,serverIds:[...e.serverIds],optionalServerIds:[...e.optionalServerIds],builtInToolIds:e.builtInToolIds?[...e.builtInToolIds]:[],computer:e.computer?{kind:e.computer.kind,...e.computer.workdir?{workdir:e.computer.workdir}:{}}:void 0,browserProfileId:e.browserProfileId,harness:e.harness,agentLoop:e.agentLoop,connectionDefaults:{headers:{...e.connectionDefaults.headers},requestTimeout:e.connectionDefaults.requestTimeout},clientCapabilities:yl(e.clientCapabilities),hostContext:yl(e.hostContext),hostCapabilitiesOverride:e.hostCapabilitiesOverride?yl(e.hostCapabilitiesOverride):void 0,chatUiOverride:e.chatUiOverride?Qj(e.chatUiOverride):void 0,mcpProfile:e.mcpProfile?Xj(e.mcpProfile):void 0,serverConnectionOverrides:e.serverConnectionOverrides?Object.fromEntries(Object.entries(e.serverConnectionOverrides).map(([t,r])=>[t,{...r.headersOverride!==void 0?{headersOverride:{...r.headersOverride}}:{},...r.requestTimeoutOverride!==void 0?{requestTimeoutOverride:r.requestTimeoutOverride}:{},...r.mcpProtocolVersionOverride!==void 0?{mcpProtocolVersionOverride:r.mcpProtocolVersionOverride}:{}}])):void 0}}function A2(e){return q0(e,Ib)}function N2(e){return e?.initialize?.clientInfo}function P2(e){return e?.initialize?.supportedProtocolVersions}function M2(e){return e?.apps?.uiInitialize?.hostInfo}function Gj(e){const t=x0(e.hostStyle),r=e.profile?.apps?.compatRuntime,n=r?.openaiApps;return n===!1?{injected:!1}:(typeof n=="boolean"?n:t.injected)?{injected:!0,capabilities:Yj(t.injected?t.capabilities:S0,r?.openaiAppsOverrides)}:{injected:!1}}function Yj(e,t){return t?{callTool:t.callTool??e.callTool,sendFollowUpMessage:t.sendFollowUpMessage??e.sendFollowUpMessage,setWidgetState:t.setWidgetState??e.setWidgetState,requestDisplayMode:t.requestDisplayMode??e.requestDisplayMode,notifyIntrinsicHeight:t.notifyIntrinsicHeight??e.notifyIntrinsicHeight,openExternal:t.openExternal??e.openExternal,setOpenInAppUrl:t.setOpenInAppUrl??e.setOpenInAppUrl,requestModal:t.requestModal??e.requestModal,uploadFile:t.uploadFile??e.uploadFile,selectFiles:t.selectFiles??e.selectFiles,getFileDownloadUrl:t.getFileDownloadUrl??e.getFileDownloadUrl,requestCheckout:t.requestCheckout??e.requestCheckout,requestClose:t.requestClose??e.requestClose}:e}function Jj(e){return b0(e,Ib)}function Ib(e){return U0(e)?.mcp}function O2(e){if(e!==void 0)return{openLinks:e.openLinks!==void 0,serverTools:e.serverTools!==void 0,serverResources:e.serverResources!==void 0,logging:e.logging!==void 0,updateModelContext:e.updateModelContext!==void 0,message:e.message!==void 0,downloadFile:e.downloadFile!==void 0}}function Kj(e){return!(e.initialize!==void 0&&(e.initialize.clientInfo!==void 0||e.initialize.supportedProtocolVersions!==void 0&&e.initialize.supportedProtocolVersions.length>0))&&e.mcpProtocolVersion===void 0&&e.toolParamHeaderMirroring===void 0&&e.paginationTraversal===void 0&&e.mrtrSupport===void 0&&e.unauthorizedChallenge===void 0&&e.unauthorizedChallengeTrigger===void 0&&e.toolResultAuthChallenge===void 0&&e.toolResultAuthChallengeTrigger===void 0&&(e.toolListChanged===void 0||Object.values(e.toolListChanged).every(t=>t===void 0))&&(e.toolCallCancellation===void 0||Object.values(e.toolCallCancellation).every(t=>t===void 0))&&!e.apps&&!e.extensions}function j2(e,t){const r=t!==void 0&&Object.keys(t).length>0,n=e.mcpProfile,o=n?.apps??{},s={};for(const[l,c]of Object.entries(o))l!=="mcpAppsOverrides"&&c!==void 0&&(s[l]=c);r&&(s.mcpAppsOverrides=t);const a=Object.keys(s).length===0;if(n===void 0&&a)return e;const i={...n??{profileVersion:1},apps:a?void 0:s};return{...e,mcpProfile:Kj(i)?void 0:i}}function Xj(e){return Dr(e)}function Qj(e){return Dr(e)}function yl(e){return Dr(e)}function Dr(e){if(Array.isArray(e))return e.map(Dr);if(e&&typeof e=="object"){const t={};for(const[r,n]of Object.entries(e))t[r]=Dr(n);return t}return e}function Zj(e){return Dr(e)}function eL(e){return Dr(e)}function Cb(e){return e?.directContent?.image??!0}function Rb(e){return(e?.embeddedResources?.blob?.enabled??!0)&&(e?.embeddedResources?.blob?.image??!0)}function Tb(e){return(e?.linkedResources?.blob?.enabled??!0)&&(e?.linkedResources?.blob?.image??!0)}function L2(e,t){return{...e,directContent:{...e?.directContent,image:t}}}function D2(e,t){return{...e,embeddedResources:{...e?.embeddedResources,blob:{...e?.embeddedResources?.blob,image:t}}}}function F2(e,t){return{...e,linkedResources:{...e?.linkedResources,blob:{...e?.linkedResources?.blob,image:t}}}}function tL(e){return e?.placement??"inline"}function rL(e){return e?.directContent?.image??!0}function nL(e){return e?.embeddedResources?.blob?.image??!0}function oL(e){return e?.linkedResources?.blob?.image??!0}function H2(e,t){return{...e,placement:t}}function sL(e,t){return{...e,directContent:{...e?.directContent,image:t}}}function aL(e,t){return{...e,embeddedResources:{...e?.embeddedResources,blob:{...e?.embeddedResources?.blob,image:t}}}}function iL(e,t){return{...e,linkedResources:{...e?.linkedResources,blob:{...e?.linkedResources?.blob,image:t}}}}function U2(e,t){const r=Cb(t),n=Rb(t),o=Tb(t);if(r&&n&&o)return e;let s=e;return r||(s=sL(s,!1)),n||(s=aL(s,!1)),o||(s=iL(s,!1)),s}function $2(e,t){return!(e.hostStyle!==t.hostStyle||e.modelId!==t.modelId||(e.modelSelection?Zd(e.modelSelection):"")!==(t.modelSelection?Zd(t.modelSelection):"")||e.systemPrompt!==t.systemPrompt||e.temperature!==t.temperature||e.requireToolApproval!==t.requireToolApproval||e.respectToolVisibility!==t.respectToolVisibility||e.runUnloadedToolCalls!==t.runUnloadedToolCalls||e.progressiveToolDiscovery!==t.progressiveToolDiscovery||e.requireNativeToolDiscovery!==t.requireNativeToolDiscovery||!uL(e.modelVisibleMcpToolResults,t.modelVisibleMcpToolResults)||!dL(e.mcpToolResultImageRendering,t.mcpToolResultImageRendering)||!bl(e.serverIds,t.serverIds)||!bl(e.optionalServerIds,t.optionalServerIds)||!bl(e.builtInToolIds,t.builtInToolIds)||e.localBrowserEnabled!==t.localBrowserEnabled||e.computer===void 0!=(t.computer===void 0)||e.computer&&t.computer&&(e.computer.kind!==t.computer.kind||e.computer.workdir!==t.computer.workdir)||e.browserProfileId!==t.browserProfileId||e.harness!==t.harness||e.agentLoop!==t.agentLoop||e.connectionDefaults.requestTimeout!==t.connectionDefaults.requestTimeout||!va(e.connectionDefaults.headers,t.connectionDefaults.headers)||!va(e.clientCapabilities,t.clientCapabilities)||!va(e.hostContext,t.hostContext)||!pL(e.hostCapabilitiesOverride,t.hostCapabilitiesOverride)||!fL(e.chatUiOverride,t.chatUiOverride)||!cL(e.mcpProfile,t.mcpProfile)||!lL(e.serverConnectionOverrides,t.serverConnectionOverrides))}function lL(e,t){const r=n=>{if(!n)return{};const o={};for(const[s,a]of Object.entries(n)){if(!a)continue;const i=a.headersOverride!==void 0&&Object.keys(a.headersOverride).length>0,l=a.requestTimeoutOverride!==void 0,c=a.mcpProtocolVersionOverride!==void 0;(i||l||c)&&(o[s]={...i?{headersOverride:a.headersOverride}:{},...l?{requestTimeoutOverride:a.requestTimeoutOverride}:{},...c?{mcpProtocolVersionOverride:a.mcpProtocolVersionOverride}:{}})}return o};return Lt(r(e))===Lt(r(t))}function cL(e,t){return e===void 0&&t===void 0?!0:e===void 0||t===void 0?!1:Lt(e)===Lt(t)}function uL(e,t){return e===void 0&&t===void 0?!0:e===void 0||t===void 0?!1:Lt(e)===Lt(t)}function dL(e,t){return e===void 0&&t===void 0?!0:e===void 0||t===void 0?!1:Lt(e)===Lt(t)}function pL(e,t){return e===void 0&&t===void 0?!0:e===void 0||t===void 0?!1:va(e,t)}function fL(e,t){return e===void 0&&t===void 0?!0:e===void 0||t===void 0?!1:Lt(e)===Lt(t)}function bl(e,t){if(e.length!==t.length)return!1;const r=[...e].sort(),n=[...t].sort();for(let o=0;o<r.length;o++)if(r[o]!==n[o])return!1;return!0}function va(e,t){return Lt(e)===Lt(t)}function hL(e){return e.rendersMcpApps!==void 0}function Sl(e,t){if(e.rendersMcpApps!==!0)return!1;let r=e.mcpProfile?.apps?.mcpAppsOverrides;for(const n of t)r=r!==null&&typeof r=="object"?r[n]:void 0;return r===void 0}function Gr(e,t){return hL(e)&&(t===void 0||Object.keys(t).length===0)}var mL=[{key:"toolInputPartial",description:"Send ui/notifications/tool-input-partial while the agent streams arguments"},{key:"toolCancelled",description:"Notify the app when tool execution is cancelled (ui/notifications/tool-cancelled)"},{key:"hostContextChanged",description:"Notify the app when theme, display mode, or other host context changes"},{key:"resourceTeardown",description:"Send ui/resource-teardown before destroying the app view"},{key:"serverResources",description:"Advertise resources/read proxy capability in ui/initialize"},{key:"logging",description:"Accept notifications/message log calls from the app"},{key:"toolInfo",description:"Include calling-tool metadata in HostContext.toolInfo"},{key:"openLinks",description:"Advertise ui/open-link capability"},{key:"serverTools",description:"Advertise tools/call proxy capability"},{key:"updateModelContext",description:"Accept ui/update-model-context requests from the app"},{key:"message",description:"Accept ui/message requests that add content to the conversation"},{key:"downloadFile",description:"Accept ui/download-file requests from the app"},{key:"requestTeardown",description:"Honor ui/notifications/request-teardown by unmounting the app"},{key:"sandboxPermissions",description:"Honor _meta.ui.permissions when configuring the iframe"},{key:"cspFrameDomains",description:"Honor _meta.ui.csp.frameDomains for nested iframes"},{key:"cspBaseUriDomains",description:"Honor _meta.ui.csp.baseUriDomains in CSP"},{key:"resourcePrefersBorder",description:"Honor _meta.ui.prefersBorder when rendering app chrome"},{key:"safeAreaInsets",description:"Send hostContext.safeAreaInsets so an app can keep content clear of host chrome"}],gL=[{key:"callTool",label:"callTool"},{key:"sendFollowUpMessage",label:"sendFollowUpMessage"},{key:"setWidgetState",label:"setWidgetState"},{key:"requestDisplayMode",label:"requestDisplayMode"},{key:"notifyIntrinsicHeight",label:"notifyIntrinsicHeight"},{key:"openExternal",label:"openExternal"},{key:"setOpenInAppUrl",label:"setOpenInAppUrl"},{key:"requestModal",label:"requestModal"},{key:"uploadFile",label:"uploadFile"},{key:"selectFiles",label:"selectFiles"},{key:"getFileDownloadUrl",label:"getFileDownloadUrl"},{key:"requestCheckout",label:"requestCheckout"},{key:"requestClose",label:"requestClose"}],vL=["inline","fullscreen","pip"],yL=[{id:"protocol",label:"MCP Protocol",subtitle:"version · clientInfo · capabilities · connection"},{id:"agent",label:"Agent",subtitle:"model · sampling · system prompt"},{id:"apps",label:"Apps",subtitle:"SEP-1865 advertise · compat shim · sandbox"}],Je=e=>e.mcpProfile,Sh=new WeakMap,_o=e=>{let t=Sh.get(e);return t||(t=Jj({profile:e.mcpProfile,hostStyle:e.hostStyle}),Sh.set(e,t)),t},_h=new WeakMap,_l=e=>{let t=_h.get(e);return t||(t=Gj({profile:e.mcpProfile,hostStyle:e.hostStyle}),_h.set(e,t)),t},bL={accept:"supported","user-initiated-only":"partial",decline:"neutral"},SL={all:"supported","fullscreen-only":"partial",none:"neutral"},_L={on:"supported",off:"neutral",invalid:"unsupported"},xL=["--color-background-primary","--color-background-secondary","--color-background-tertiary","--color-background-inverse","--color-background-ghost","--color-background-info","--color-background-danger","--color-background-success","--color-background-warning","--color-background-disabled","--color-text-primary","--color-text-secondary","--color-text-tertiary","--color-text-inverse","--color-text-ghost","--color-text-info","--color-text-danger","--color-text-success","--color-text-warning","--color-text-disabled","--color-border-primary","--color-border-secondary","--color-border-tertiary","--color-border-inverse","--color-border-ghost","--color-border-info","--color-border-danger","--color-border-success","--color-border-warning","--color-border-disabled","--color-ring-primary","--color-ring-secondary","--color-ring-inverse","--color-ring-info","--color-ring-danger","--color-ring-success","--color-ring-warning","--font-sans","--font-mono","--font-weight-normal","--font-weight-medium","--font-weight-semibold","--font-weight-bold","--font-text-xs-size","--font-text-sm-size","--font-text-md-size","--font-text-lg-size","--font-heading-xs-size","--font-heading-sm-size","--font-heading-md-size","--font-heading-lg-size","--font-heading-xl-size","--font-heading-2xl-size","--font-heading-3xl-size","--font-text-xs-line-height","--font-text-sm-line-height","--font-text-md-line-height","--font-text-lg-line-height","--font-heading-xs-line-height","--font-heading-sm-line-height","--font-heading-md-line-height","--font-heading-lg-line-height","--font-heading-xl-line-height","--font-heading-2xl-line-height","--font-heading-3xl-line-height","--border-radius-xs","--border-radius-sm","--border-radius-md","--border-radius-lg","--border-radius-xl","--border-radius-full","--border-width-regular","--shadow-hairline","--shadow-sm","--shadow-md","--shadow-lg"],br=Symbol("not-supported");function EL(e){let t=0;for(const r of e)if(r==="(")t+=1;else if(r===")")t-=1;else if(r===","&&t===0)return!0;return!1}function wL(e){let t=0;for(const r of e)if(r==="(")t+=1;else if(r===")"&&(t-=1,t<0))return!1;return t===0}function kL(e){const t=e.trim();if(!t.toLowerCase().startsWith("light-dark(")||!t.endsWith(")"))return null;const r=t.slice(11,-1);if(!wL(r))return null;let n=0;for(let o=0;o<r.length;o+=1){const s=r[o];if(s==="(")n+=1;else if(s===")")n-=1;else if(s===","&&n===0){const a=r.slice(0,o).trim(),i=r.slice(o+1).trim();return!a||!i||EL(i)?null:{light:a,dark:i}}}return null}function IL(e,t){const r=e,n=r.styleVariablesByTheme,o=n?.light?.[t],s=n?.dark?.[t];if(typeof o=="string"||typeof s=="string")return o===s&&typeof o=="string"?{same:o}:{light:o,dark:s};const a=e.hostContext?.styles?.variables,i=a!==null&&typeof a=="object"?a[t]:void 0;if(typeof i=="string"){const l=kL(i);return l?l.light===l.dark?{same:l.light}:{...l,raw:i}:{same:i}}return r.provenance==="probe"?br:void 0}var CL=xL.map(e=>({id:`styles.${e}`,section:"apps",subsection:"Styles",label:e,path:`hostContext.styles.variables.${e}`,description:`Value the host sends widgets for ${e}.`,kind:{kind:"style-variable"},read:t=>IL(t,e)}));function xh(e){return e.rendersMcpApps===!1}var RL=[{id:"capabilities.uiExtension",section:"apps",subsection:"MCP Apps capabilities",label:Hi,path:`clientCapabilities.extensions.${Hi}`,description:"Shows MCP Apps widgets.",kind:{kind:"capability"},read:e=>e.clientCapabilities?.extensions?.[Hi]},{id:"appsCap.availableDisplayModes",section:"apps",subsection:"MCP Apps capabilities",label:"availableDisplayModes",path:"mcpProfile.apps.mcpAppsOverrides.availableDisplayModes (effective)",description:"Display modes the client offers widgets (inline / fullscreen / pip).",kind:{kind:"mode-set",modes:vL},read:e=>xh(e)?br:Sl(e,["availableDisplayModes"])?void 0:_o(e).availableDisplayModes},{id:"appsCap.widgetDisplayModeRequests",section:"apps",subsection:"MCP Apps capabilities",label:"widgetDisplayModeRequests",path:"mcpProfile.apps.mcpAppsOverrides.widgetDisplayModeRequests (effective)",description:"Policy for honoring widget display-mode change requests.",kind:{kind:"enum",support:bL},read:e=>xh(e)?br:Sl(e,["widgetDisplayModeRequests"])?void 0:_o(e).widgetDisplayModeRequests},...mL.map(({key:e,description:t})=>({id:`appsCap.${e}`,section:"apps",subsection:"MCP Apps capabilities",label:e,path:`mcpProfile.apps.mcpAppsOverrides.${e} (effective)`,description:t,kind:{kind:"boolean"},read:r=>Sl(r,[e])?void 0:_o(r)[e]})),...["fetch","xhr","websocket"].map(e=>({id:`appsCap.cspConnectDomains.${e}`,section:"apps",subsection:"MCP Apps capabilities",label:`cspConnectDomains.${e}`,path:`mcpProfile.apps.mcpAppsOverrides.cspConnectDomains.${e} (effective)`,description:`Allow widget ${e} connections to declared CSP connect domains.`,kind:{kind:"boolean"},read:t=>_o(t).cspConnectDomains?.[e]})),...["script","stylesheet","image","font","media"].map(e=>({id:`appsCap.cspResourceDomains.${e}`,section:"apps",subsection:"MCP Apps capabilities",label:`cspResourceDomains.${e}`,path:`mcpProfile.apps.mcpAppsOverrides.cspResourceDomains.${e} (effective)`,description:`Allow widget ${e} resources from declared CSP resource domains.`,kind:{kind:"boolean"},read:t=>_o(t).cspResourceDomains?.[e]}))],TL=[{id:"compatRuntime.openaiApps",section:"apps",subsection:"OpenAI compat shim",label:"Inject window.openai",path:"mcpProfile.apps.compatRuntime.openaiApps",description:"Inject the `window.openai` Apps-SDK shim. Undefined = use hostStyle preset.",kind:{kind:"boolean"},read:e=>_l(e).injected},...gL.filter(({key:e})=>e!=="requestDisplayMode").map(({key:e,label:t})=>({id:`openaiShim.${e}`,section:"apps",subsection:"OpenAI compat shim",label:t,path:`mcpProfile.apps.compatRuntime.openaiAppsOverrides.${e} (effective)`,description:`window.openai.${e}() available to widgets (shim must be injected).`,kind:{kind:"boolean"},read:r=>{const n=_l(r);return n.injected?!!n.capabilities[e]:!1}})),{id:"openaiShim.requestDisplayMode",section:"apps",subsection:"OpenAI compat shim",label:"requestDisplayMode",path:"mcpProfile.apps.compatRuntime.openaiAppsOverrides.requestDisplayMode (effective)",description:"Which display-mode requests the shim honors.",kind:{kind:"enum",support:SL},read:e=>{const t=_l(e);return t.injected?t.capabilities.requestDisplayMode:"none"}}],AL=["camera","microphone","geolocation","clipboardWrite"].map(e=>({id:`sandboxPerm.${e}`,section:"apps",subsection:"Sandbox permissions",label:e,path:`mcpProfile.apps.sandbox.permissions.allow.${e}`,description:`Grant the app iframe ${e} access.`,kind:{kind:"boolean"},read:t=>!!Je(t)?.apps?.sandbox?.permissions?.allow?.[e]})),NL=[{id:"toolResult.structuredContent",section:"apps",subsection:"Widget tool results",label:"Structured content",path:"mcpProfile.apps.mcpAppsOverrides.toolResult.structuredContent",description:"Whether the structuredContent half of a tool result reaches a widget that called the tool.",kind:{kind:"boolean"},read:e=>Je(e)?.apps?.mcpAppsOverrides?.toolResult?.structuredContent},...[["text","Text"],["image","Image"],["audio","Audio"],["resource","Embedded resource"],["resourceLink","Resource link"]].map(([e,t])=>({id:`toolResult.content.${e}`,section:"apps",subsection:"Widget tool results",label:t,path:`mcpProfile.apps.mcpAppsOverrides.toolResult.content.${e}`,description:`Whether ${t.toLowerCase()} blocks in a tool result reach a widget that called the tool.`,kind:{kind:"boolean"},read:r=>r.mcpProfile?.apps?.mcpAppsOverrides?.toolResult?.content?.[e]}))],PL=["localStorage","sessionStorage","indexedDB"].map(e=>({id:`sandbox.browserStorage.${e}`,section:"apps",subsection:"Sandbox",label:e==="indexedDB"?"IndexedDB":e,path:`mcpProfile.apps.sandbox.browserStorage.${e}`,description:`${e} works inside the sandboxed app iframe (probe-measured browser behavior, not MCP).`,kind:{kind:"boolean"},read:t=>Je(t)?.apps?.sandbox?.browserStorage?.[e]})),ML={id:"sandbox.sameOriginAppIframe",section:"apps",subsection:"Sandbox",label:"Same-origin app iframe",path:"mcpProfile.apps.sandbox.sameOriginAppIframe",description:"The app iframe shares the sandbox page's origin, so storage, cookies and same-origin fetches work. When not, the app runs in an opaque origin (probe-measured browser behavior, not MCP).",kind:{kind:"boolean"},read:e=>Je(e)?.apps?.sandbox?.sameOriginAppIframe},OL=[["listens","Opens notification channel","Client opens the server-to-client notification channel (legacy: standalone GET SSE stream; 2026-07-28: subscriptions/listen)."],["refetches","Re-fetches after list_changed","Client acts on notifications/tools/list_changed instead of keeping its cached tool list. Independent of the channel: a server can publish the notification on an open tools/call response stream, which reaches a client that never opened one."]].map(([e,t,r])=>({id:`toolListChanged.${e}`,section:"protocol",subsection:"Tool list changed",label:t,path:`mcpProfile.toolListChanged.${e}`,description:r,kind:{kind:"boolean"},read:n=>Je(n)?.toolListChanged?.[e]})),jL={id:"paginationTraversal",section:"protocol",subsection:"Pagination",label:"Follows nextCursor",path:"mcpProfile.paginationTraversal",description:"Client requests further pages of a paginated list instead of treating page one as the whole result.",kind:{kind:"enum",options:["full","firstPageOnly"],support:{full:"supported",firstPageOnly:"unsupported"}},read:e=>Je(e)?.paginationTraversal},LL=[["legacy","Tool cancellation (2025)","Client tells the server when the user stops an in-flight tool call on a 2025 connection, by sending notifications/cancelled."],["modern","Tool cancellation (2026)","Client tells the server when the user stops an in-flight tool call on a 2026-07-28 connection, by closing that request's response stream."]].map(([e,t,r])=>({id:`toolCallCancellation.${e}`,section:"protocol",subsection:"Cancellation",label:t,path:`mcpProfile.toolCallCancellation.${e}`,description:r,kind:{kind:"boolean"},read:n=>Je(n)?.toolCallCancellation?.[e]})),Eh={prompt:"supported",notify:"partial",passthrough:"unsupported"},DL=[{id:"unauthorizedChallenge",section:"protocol",subsection:"Mid-session sign-in",label:"When the server asks for sign-in",path:"mcpProfile.unauthorizedChallenge",description:"What the client does when a server asks the user to sign in: prompt to sign in and run the call again, tell the user to sign in, or show an ordinary error. If unset, the client prompts.",kind:{kind:"enum",options:Vd,support:Eh},read:e=>Je(e)?.unauthorizedChallenge},{id:"unauthorizedChallengeTrigger",section:"protocol",subsection:"Mid-session sign-in",label:"Server sign-in trigger",path:"mcpProfile.unauthorizedChallengeTrigger",description:"Accept any server sign-in request, only requests that name Bearer authentication, or only those that also provide a resource metadata link. If unset, any request counts.",kind:{kind:"enum",options:g_},read:e=>Je(e)?.unauthorizedChallengeTrigger},{id:"toolResultAuthChallenge",section:"protocol",subsection:"Mid-session sign-in",label:"When a tool result asks for sign-in",path:"mcpProfile.toolResultAuthChallenge",description:"What the client does when a tool result asks the user to sign in. If unset, the client treats the result as an ordinary tool error.",kind:{kind:"enum",options:Vd,support:Eh},read:e=>Je(e)?.toolResultAuthChallenge},{id:"toolResultAuthChallengeTrigger",section:"protocol",subsection:"Mid-session sign-in",label:"Tool result sign-in trigger",path:"mcpProfile.toolResultAuthChallengeTrigger",description:"What a tool result's sign-in request needs before it counts: nothing more, a tool that supports OAuth sign-in, or that plus an error code and description. If unset, it needs the tool to support OAuth sign-in and the result to carry both the error code and its description.",kind:{kind:"enum",options:m_},read:e=>Je(e)?.toolResultAuthChallengeTrigger}],gn=[{id:"modelId",section:"agent",subsection:"Agent tooling",label:"Model",path:"modelId",description:"LLM the client runs the agent on.",kind:{kind:"string"},read:e=>e.modelId},{id:"temperature",section:"agent",subsection:"Agent tooling",label:"Temperature",path:"temperature",description:"0–1 sampling temperature.",kind:{kind:"number"},read:e=>e.temperature},{id:"requireToolApproval",section:"agent",subsection:"Agent tooling",label:"Require tool approval",path:"requireToolApproval",description:"Asks for approval before MCP tool calls, commands and file edits. Loading a skill never asks.",kind:{kind:"boolean"},read:e=>e.requireToolApproval},{id:"runUnloadedToolCalls",section:"agent",subsection:"Agent tooling",label:"Run calls to unloaded tools",path:"runUnloadedToolCalls",description:"When the model calls a tool it has not loaded, run the call if its inputs are valid. Off refuses the call until the tool is loaded.",kind:{kind:"boolean"},read:e=>e.runUnloadedToolCalls??!0},{id:"respectToolVisibility",section:"agent",subsection:"Agent tooling",label:"Respect tool visibility",path:"respectToolVisibility",description:"SEP-1865 `_meta.ui.visibility` filter.",kind:{kind:"boolean"},read:e=>e.respectToolVisibility??!0},{id:"modelVisibleMcpToolResults.directContent.image",section:"agent",subsection:"Agent tooling",label:"Make tool image content visible to model",path:"modelVisibleMcpToolResults.directContent.image",description:"Pass MCP image content from tool results to the model.",kind:{kind:"boolean"},read:e=>Gr(e,e.modelVisibleMcpToolResults)?void 0:Cb(e.modelVisibleMcpToolResults)},{id:"modelVisibleMcpToolResults.embeddedResources.blob.image",section:"agent",subsection:"Agent tooling",label:"Make embedded resource images visible to model",path:"modelVisibleMcpToolResults.embeddedResources.blob.image",description:"Pass MCP embedded resource images from tool results to the model.",kind:{kind:"boolean"},read:e=>Gr(e,e.modelVisibleMcpToolResults)?void 0:Rb(e.modelVisibleMcpToolResults)},{id:"modelVisibleMcpToolResults.linkedResources.blob.image",section:"agent",subsection:"Agent tooling",label:"Make resource link images visible to model",path:"modelVisibleMcpToolResults.linkedResources.blob.image",description:"Resolve MCP resource link images and pass them to the model.",kind:{kind:"boolean"},read:e=>Gr(e,e.modelVisibleMcpToolResults)?void 0:Tb(e.modelVisibleMcpToolResults)},{id:"mcpToolResultImageRendering",section:"agent",subsection:"Agent tooling",label:"Render tool images",path:"mcpToolResultImageRendering.placement",description:"Human-facing display mode for MCP tool-returned images.",kind:{kind:"enum",options:["none","collapsed","inline"]},read:e=>Gr(e,e.mcpToolResultImageRendering)?void 0:tL(e.mcpToolResultImageRendering)},{id:"mcpToolResultImageRendering.directContent.image",section:"agent",subsection:"Agent tooling",label:"Render tool image content",path:"mcpToolResultImageRendering.directContent.image",description:"Render direct MCP image content from tool results in the UI.",kind:{kind:"boolean"},read:e=>Gr(e,e.mcpToolResultImageRendering)?void 0:rL(e.mcpToolResultImageRendering)},{id:"mcpToolResultImageRendering.embeddedResources.blob.image",section:"agent",subsection:"Agent tooling",label:"Render embedded resource images",path:"mcpToolResultImageRendering.embeddedResources.blob.image",description:"Render MCP embedded resource images from tool results in the UI.",kind:{kind:"boolean"},read:e=>Gr(e,e.mcpToolResultImageRendering)?void 0:nL(e.mcpToolResultImageRendering)},{id:"mcpToolResultImageRendering.linkedResources.blob.image",section:"agent",subsection:"Agent tooling",label:"Render resource link images",path:"mcpToolResultImageRendering.linkedResources.blob.image",description:"Resolve MCP resource link images and render them in the UI.",kind:{kind:"boolean"},read:e=>Gr(e,e.mcpToolResultImageRendering)?void 0:oL(e.mcpToolResultImageRendering)},{id:"progressiveToolDiscovery",section:"agent",subsection:"Agent tooling",label:"Progressive tools",path:"progressiveToolDiscovery",description:"search_mcp_tools / load_mcp_tools meta-tools above context thresholds. Undefined = client decides.",kind:{kind:"tri-state"},read:e=>e.progressiveToolDiscovery},{id:"systemPrompt",section:"agent",subsection:"System prompt",label:"System prompt",path:"systemPrompt",description:"Verbatim system prompt sent on every turn.",kind:{kind:"string-long"},read:e=>e.systemPrompt},{id:"clientInfo.version",section:"protocol",subsection:"clientInfo",label:"Client version",path:"mcpProfile.initialize.clientInfo.version",description:"Client name and version sent to the server.",kind:{kind:"string"},read:e=>{const t=Je(e)?.initialize?.clientInfo;return[typeof t?.name=="string"?t.name.trim():"",typeof t?.version=="string"?t.version.trim():""].filter(Boolean).join(" ")||void 0}},{id:"clientInfo.name",section:"protocol",subsection:"clientInfo",label:"Client name",path:"mcpProfile.initialize.clientInfo.name",description:"`initialize.clientInfo.name` sent to the server.",kind:{kind:"string"},read:e=>{const t=Je(e)?.initialize?.clientInfo;return typeof t?.name=="string"?t.name:void 0}},{id:"mcpProtocolVersion",section:"protocol",subsection:"Version",label:"Protocol version",path:"mcpProfile.mcpProtocolVersion",description:'Host default selection. "auto" negotiates at connect time; concrete versions pin that exact era. Per-server overrides win.',kind:{kind:"enum",options:["auto","2025-03-26","2025-06-18","2025-11-25","2026-07-28"]},read:e=>Je(e)?.mcpProtocolVersion},{id:"supportedProtocolVersions",section:"protocol",subsection:"Version",label:"Supported protocol versions",path:"mcpProfile.initialize.supportedProtocolVersions",description:"Accept-list supported in the initialize handshake.",kind:{kind:"string-array"},read:e=>e.supportedProtocolVersions??Je(e)?.initialize?.supportedProtocolVersions},{id:"capabilities.roots",section:"protocol",subsection:"Client capabilities supported",label:"Roots",path:"clientCapabilities.roots",description:"Filesystem roots exposed to the server.",kind:{kind:"capability"},read:e=>e.clientCapabilities?.roots},{id:"capabilities.sampling",section:"protocol",subsection:"Client capabilities supported",label:"Sampling",path:"clientCapabilities.sampling",description:"Server-initiated LLM calls.",kind:{kind:"capability"},read:e=>e.clientCapabilities?.sampling},{id:"capabilities.elicitation",section:"protocol",subsection:"Client capabilities supported",label:"Elicitation",path:"clientCapabilities.elicitation",description:"Mid-call structured prompts back to the user.",kind:{kind:"capability"},read:e=>e.clientCapabilities?.elicitation},{id:"capabilities.experimental",section:"protocol",subsection:"Client capabilities supported",label:"Experimental",path:"clientCapabilities.experimental",description:"Vendor-extension capabilities.",kind:{kind:"capability"},read:e=>e.clientCapabilities?.experimental},{id:"capabilities.skillsExtension",section:"protocol",subsection:"Client capabilities supported",label:"Skills over MCP",path:`clientCapabilities.extensions.${qd}`,description:"Server-served Agent Skills (skills/list, skills/get) with mandatory digest verification.",kind:{kind:"capability"},read:e=>e.clientCapabilities?.extensions?.[qd]},{id:"tasksPolicy",section:"protocol",subsection:"Client policy",label:"Task execution",path:`mcpProfile.extensions.${tn}.enabled`,description:"Whether surfaces beyond the Tools tab may run tools as MCP tasks.",kind:{kind:"enum",support:_L},read:e=>{const t=_g(e);return t==="unset"?void 0:t}},{id:"eventsDeliveryModes",section:"protocol",subsection:"Client policy",label:"Event delivery",path:`mcpProfile.extensions.${Z0}`,description:"The MCP Events delivery modes this client accepts.",kind:{kind:"mode-set",modes:P0,baseline:0},read:e=>{const t=v0(e);if(t.kind!=="unset")return t.kind==="valid"?t.modes:[]}},{id:"connectionDefaults.requestTimeout",section:"protocol",subsection:"Connection defaults",label:"Request timeout",path:"connectionDefaults.requestTimeout",description:"Outbound MCP request timeout.",kind:{kind:"duration-ms"},read:e=>e.connectionDefaults?.requestTimeout},{id:"connectionDefaults.headers",section:"protocol",subsection:"Connection defaults",label:"Default headers",path:"connectionDefaults.headers",description:"Default outbound headers (Authorization, etc.).",kind:{kind:"object",itemNoun:"header"},read:e=>e.connectionDefaults?.headers},...RL,...TL,...CL,{id:"uiInitialize.hostInfo",section:"apps",subsection:"MCP Apps spec bridge",label:"ui/initialize hostInfo",path:"mcpProfile.apps.uiInitialize.hostInfo",description:"Override the `hostInfo` sent in `ui/initialize`.",kind:{kind:"object",itemNoun:"field"},read:e=>Je(e)?.apps?.uiInitialize?.hostInfo},{id:"sandbox.csp.mode",section:"apps",subsection:"Sandbox",label:"CSP mode",path:"mcpProfile.apps.sandbox.csp.mode",description:"Starting CSP baseline for app iframes.",kind:{kind:"enum",options:["host-default","declared","relaxed"]},read:e=>Je(e)?.apps?.sandbox?.csp?.mode},{id:"sandbox.permissions.mode",section:"apps",subsection:"Sandbox",label:"Permissions mode",path:"mcpProfile.apps.sandbox.permissions.mode",description:"How spec permissions resolve in the iframe sandbox.",kind:{kind:"enum",options:["resource-declared","deny-all","custom"]},read:e=>Je(e)?.apps?.sandbox?.permissions?.mode},...AL,...PL,ML,...NL,...OL,jL,...LL,...DL,{id:"sandbox.sandboxAttrs",section:"apps",subsection:"Sandbox",label:"Sandbox attrs",path:"mcpProfile.apps.sandbox.sandboxAttrs",description:"Extra iframe `sandbox=` tokens unioned with `allow-scripts allow-same-origin`.",kind:{kind:"string-array"},read:e=>Je(e)?.apps?.sandbox?.sandboxAttrs},{id:"sandbox.allowFeatures",section:"apps",subsection:"Sandbox",label:"Permissions Policy features",path:"mcpProfile.apps.sandbox.allowFeatures",description:"Permissions Policy entries appended to the outer iframe.",kind:{kind:"object",itemNoun:"feature"},read:e=>Je(e)?.apps?.sandbox?.allowFeatures}],FL=new Map(gn.map(e=>[e.id,e]));function B2(e){const t=FL.get(e);if(!t)throw new Error(`hostConfigField: unknown field id "${e}". Did you rename it in host-config-field-schema.ts without updating callers?`);return t}function yc(e){return e===void 0?"__undef__":e===null?"null":typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(yc).join(",")}]`:`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${yc(e[t])}`).join(",")}}`}function Ab(e,t){if(t.length<2)return!1;const r=o=>yc(HL(e.read(o))),n=r(t[0]);for(let o=1;o<t.length;o+=1)if(r(t[o])!==n)return!0;return!1}function HL(e){if(e===null||typeof e!="object"||!("raw"in e))return e;const{raw:t,...r}=e;return r}function Nb(e=gn){return yL.map(t=>{const r=e.filter(s=>s.section===t.id),n=[],o=new Map;for(const s of r)o.has(s.subsection)||(n.push(s.subsection),o.set(s.subsection,[])),o.get(s.subsection).push(s);return{section:t,subsections:n.map(s=>({label:s,fields:o.get(s)}))}})}function As(e){const t=e.kind;return t.kind==="boolean"||t.kind==="tri-state"||t.kind==="capability"||t.kind==="mode-set"||t.kind==="enum"&&!!t.support}function Xn(e,t){const r=e.read(t);if(r===br)return"unsupported";switch(e.kind.kind){case"boolean":return r===void 0?null:r===!0?"supported":"neutral";case"tri-state":return r===!0?"supported":r===!1?"neutral":"partial";case"capability":return r==null?"neutral":typeof r=="object"?r.listChanged===!1?"partial":"supported":"neutral";case"enum":{const n=e.kind.support;return n?typeof r!="string"?"neutral":n[r]??"neutral":null}case"mode-set":{const n=e.kind.modes,o=new Set(Array.isArray(r)?r:[]),s=n.filter(a=>o.has(a)).length;return s>=n.length?"supported":s<=(e.kind.baseline??1)?"neutral":"partial"}default:return null}}function Pb(e,t){return t.map(r=>Xn(e,r)).filter(r=>r!==null)}function UL(e,t){if(!As(e))return null;const r=Pb(e,t);return r.length===0?null:{supported:r.filter(n=>n==="supported").length,total:r.length}}function $L(e,t,r){if(r==="all")return!0;if(!As(e))return!1;const n=Pb(e,t);if(n.length===0)return!1;switch(r){case"missing":return n.some(o=>o==="neutral"||o==="unsupported");case"partial":return n.some(o=>o==="partial");case"supported":return n.every(o=>o==="supported")}}function BL(e,t,r){if(r==="all")return!0;const n=Xn(e,t);if(n===null)return!1;switch(r){case"missing":return n==="neutral"||n==="unsupported";case"partial":return n==="partial";case"supported":return n==="supported"}}function wh(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}function Zu(e,t){const r=wh(t).split(/\s+/).filter(Boolean);if(r.length===0)return!0;const n=wh([e.id,e.label,e.subsection,e.path,e.description??""].join(" ")).split(/\s+/).filter(Boolean);return r.every(o=>n.some(s=>s.startsWith(o)))}function Mb(e){const t=e.searchQuery.trim().toLowerCase(),r=new Set;for(const n of e.fields??gn)e.divergingOnly&&!Ab(n,e.configs)||$L(n,e.configs,e.supportFilter)&&Zu(n,t)&&r.add(n.id);return r}function zL(e,t){const r=[];if(e.kind.kind!=="capability")return r;const n=e.read(t);if(!n||typeof n!="object")return r;const o=n;if(o.listChanged===!1&&r.push("Supported without list-changed notifications."),e.id==="capabilities.sampling"&&"tools"in o&&r.push("Supports tool use in sampling (SEP-1577)."),e.id==="capabilities.elicitation"){const s=["form","url"].filter(a=>a in o);s.length>0&&r.push(`Advertises ${s.map(a=>a==="url"?"URL":a).join(" and ")} elicitation.`)}return e.id==="capabilities.experimental"&&Object.keys(o).length>0&&r.push("Vendor / experimental — outside the core capability set."),r}var Ob=["preset:claude","preset:claude-desktop","preset:claude-code","preset:chatgpt","preset:codex","preset:codex-cli","preset:copilot","preset:copilot-cli","preset:cursor","preset:vscode","preset:slack"],WL=new Set(["modelId","temperature","systemPrompt","requireToolApproval","mcpProtocolVersion","clientInfo.name","connectionDefaults.requestTimeout","connectionDefaults.headers","uiInitialize.hostInfo","sandbox.csp.mode","sandbox.permissions.mode","sandbox.sandboxAttrs","sandbox.allowFeatures","unauthorizedChallenge","unauthorizedChallengeTrigger","toolResultAuthChallenge","toolResultAuthChallengeTrigger"]);function wn(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function qL(e){return e.id.startsWith("capabilities.")?wn(e.id.replace(/^capabilities\./,"")):e.id.startsWith("appsCap.")?`mcp-apps-${wn(e.label)}`:e.id.startsWith("openaiShim.")?`openai-shim-${wn(e.label)}`:e.id.startsWith("sandboxPerm.")?`sandbox-permission-${wn(e.label)}`:e.id.startsWith("styles.")?`style-${wn(e.label)}`:wn(e.label)}var VL=new Set(["supportedProtocolVersions","clientInfo.version"]),GL=["styles."];function jb(e){return WL.has(e.id)?!1:As(e)||VL.has(e.id)?!0:GL.some(t=>e.id.startsWith(t))}var Lb=gn.filter(jb),YL=gn.filter(e=>e.id==="mcpProtocolVersion"||jb(e));function Db(e,t){return Object.values(t).some(r=>e.read(r.config)!==void 0)}function Ni(e){return Lb.filter(t=>Db(t,e))}function JL(e){const t=new Set(Ni(e));return YL.filter(r=>r.id==="mcpProtocolVersion"||t.has(r))}var Wa={slug:"mcp-tasks",field:{id:"mcpTasks",section:"protocol",subsection:"Extensions",label:"MCP Tasks",path:"clientCapabilities.tasks",description:"Run long-lived MCP operations and check their progress.",kind:{kind:"string"},read:()=>{}}},KL=[...Lb.map(e=>({slug:qL(e),field:e})),Wa],bc=new Map,Fb=new Map;for(const e of KL){const t=bc.get(e.slug);if(t)throw new Error(`Duplicate caniuse capability slug "${e.slug}" for ${t.field.id} and ${e.field.id}`);bc.set(e.slug,e),Fb.set(e.field.id,e)}function Hb(e){return e?bc.get(e)??null:null}function ed(e){return Fb.get(e.id)??null}function is(e){return`/capabilities/${encodeURIComponent(e)}`}function td(e){const t=new Map(Ob.map((r,n)=>[r,n]));return[...e].sort((r,n)=>(t.get(r.hostId)??Number.POSITIVE_INFINITY)-(t.get(n.hostId)??Number.POSITIVE_INFINITY))}function XL(e,t){if((e.id.startsWith("toolResult.")||e.id.startsWith("sandbox.browserStorage.")||e.id==="sandbox.sameOriginAppIframe"||e.id.startsWith("toolListChanged.")||e.id==="paginationTraversal"||e.id.startsWith("toolCallCancellation.")||e.id==="unauthorizedChallenge"||e.id==="toolResultAuthChallenge"||e.id==="eventsDeliveryModes"||e.id.startsWith("appsCap.")||e.id.startsWith("modelVisibleMcpToolResults.")||e.id.startsWith("mcpToolResultImageRendering"))&&e.read(t)===void 0)return"unknown";const r=Xn(e,t);return r!==null?r:e.kind.kind==="boolean"&&e.read(t)===void 0?"neutral":"unknown"}var QL=new Set(["sandbox.sameOriginAppIframe"]);function rd(e,t){if(t!==void 0&&QL.has(t)){if(e==="supported")return"Yes";if(e==="neutral"||e==="unsupported")return"No"}switch(e){case"supported":return"Supported";case"partial":return"Partial";case"neutral":case"unsupported":return"Not supported";case"unknown":return"Not yet tested"}}var Ub=(0,f.createContext)(null);function z2({enabled:e=!0,children:t}){const[r,n]=(0,f.useState)([]),o=(0,f.useCallback)(s=>(n(a=>[...a,s]),()=>n(a=>a.filter(i=>i!==s))),[]);return(0,u.jsx)(Ub.Provider,{value:{active:r[0],enabled:e,enqueue:o},children:t})}function ZL(e){const t=(0,f.useContext)(Ub),r=(0,f.useId)(),[n,o]=(0,f.useState)(!1),s=(0,f.useCallback)(c=>{o(c!==null)},[]),a=t?.enabled??!0,i=a&&e||n,l=t?.enqueue;return(0,f.useLayoutEffect)(()=>{if(i)return l?.(r)},[l,r,i]),{enabled:a,open:a&&e&&(!t||t.active===r),contentRef:s}}var kh=null;function eD(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.hostedServices=="boolean"&&Array.isArray(t.hostedOnly)}function tD(){return kh??=Promise.resolve().then(()=>fetch("/api/web/capabilities",{cache:"no-store"})).then(async e=>{if(!e?.ok)return null;const t=await e.json().catch(()=>null);return eD(t)?t:null}).catch(()=>null),kh}function $b(e){const[t,r]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let n=!0;return tD().then(o=>{!n||!o||r(!o.hostedOnly.includes(e))}),()=>{n=!1}},[e]),t}function nd({...e}){return(0,u.jsx)($x,{"data-slot":"popover",...e})}function Bb({...e}){return(0,u.jsx)(zx,{"data-slot":"popover-trigger",...e})}function od({className:e,align:t="center",sideOffset:r=4,portalled:n=!0,...o}){const s=(0,u.jsx)(qx,{"data-slot":"popover-content",align:t,sideOffset:r,className:q("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o});return n?(0,u.jsx)(Wx,{children:s}):s}function rD({...e}){return(0,u.jsx)(Bx,{"data-slot":"popover-anchor",...e})}function nD({className:e,...t}){return(0,u.jsx)("textarea",{"data-slot":"textarea",className:q("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/30 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 min-w-0 rounded-md border bg-transparent px-3 py-2 text-base wrap-anywhere shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}var Ih=1,oD=.9,sD=.8,aD=.17,xl=.1,El=.999,iD=.9999,lD=.99,cD=/[\\\/_+.#"@\[\(\{&]/,uD=/[\\\/_+.#"@\[\(\{&]/g,dD=/[\s-]/,zb=/[\s-]/g;function Sc(e,t,r,n,o,s,a){if(s===t.length)return o===e.length?Ih:lD;var i=`${o},${s}`;if(a[i]!==void 0)return a[i];for(var l=n.charAt(s),c=r.indexOf(l,o),p=0,d,h,m,g;c>=0;)d=Sc(e,t,r,n,c+1,s+1,a),d>p&&(c===o?d*=Ih:cD.test(e.charAt(c-1))?(d*=sD,m=e.slice(o,c-1).match(uD),m&&o>0&&(d*=Math.pow(El,m.length))):dD.test(e.charAt(c-1))?(d*=oD,g=e.slice(o,c-1).match(zb),g&&o>0&&(d*=Math.pow(El,g.length))):(d*=aD,o>0&&(d*=Math.pow(El,c-o))),e.charAt(c)!==t.charAt(s)&&(d*=iD)),(d<xl&&r.charAt(c-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&r.charAt(c-1)!==n.charAt(s))&&(h=Sc(e,t,r,n,c+1,s+2,a),h*xl>d&&(d=h*xl)),d>p&&(p=d),c=r.indexOf(l,c+1);return a[i]=p,p}function Ch(e){return e.toLowerCase().replace(zb," ")}function pD(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Sc(e,t,Ch(e),Ch(t),0,0,{})}var xo='[cmdk-group=""]',wl='[cmdk-group-items=""]',fD='[cmdk-group-heading=""]',Wb='[cmdk-item=""]',Rh=`${Wb}:not([aria-disabled="true"])`,_c="cmdk-item-select",Tn="data-value",hD=(e,t,r)=>pD(e,t,r),qb=f.createContext(void 0),Ns=()=>f.useContext(qb),Vb=f.createContext(void 0),sd=()=>f.useContext(Vb),Gb=f.createContext(void 0),Yb=f.forwardRef((e,t)=>{let r=An(()=>{var P,$;return{search:"",value:($=(P=e.value)!=null?P:e.defaultValue)!=null?$:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=An(()=>new Set),o=An(()=>new Map),s=An(()=>new Map),a=An(()=>new Set),i=Jb(e),{label:l,children:c,value:p,onValueChange:d,filter:h,shouldFilter:m,loop:g,disablePointerSelection:S=!1,vimBindings:b=!0,..._}=e,v=Xt(),w=Xt(),E=Xt(),T=f.useRef(null),I=kD();un(()=>{if(p!==void 0){let P=p.trim();r.current.value=P,C.emit()}},[p]),un(()=>{I(6,O)},[]);let C=f.useMemo(()=>({subscribe:P=>(a.current.add(P),()=>a.current.delete(P)),snapshot:()=>r.current,setState:(P,$,Y)=>{var J,ae,ie,Se;if(!Object.is(r.current[P],$)){if(r.current[P]=$,P==="search")W(),A(),I(1,N);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Oe=document.getElementById(E);Oe?Oe.focus():(J=document.getElementById(v))==null||J.focus()}if(I(7,()=>{var Oe;r.current.selectedItemId=(Oe=G())==null?void 0:Oe.id,C.emit()}),Y||I(5,O),((ae=i.current)==null?void 0:ae.value)!==void 0){let Oe=$??"";(Se=(ie=i.current).onValueChange)==null||Se.call(ie,Oe);return}}C.emit()}},emit:()=>{a.current.forEach(P=>P())}}),[]),L=f.useMemo(()=>({value:(P,$,Y)=>{var J;$!==((J=s.current.get(P))==null?void 0:J.value)&&(s.current.set(P,{value:$,keywords:Y}),r.current.filtered.items.set(P,y($,Y)),I(2,()=>{A(),C.emit()}))},item:(P,$)=>(n.current.add(P),$&&(o.current.has($)?o.current.get($).add(P):o.current.set($,new Set([P]))),I(3,()=>{W(),A(),r.current.value||N(),C.emit()}),()=>{s.current.delete(P),n.current.delete(P),r.current.filtered.items.delete(P);let Y=G();I(4,()=>{W(),Y?.getAttribute("id")===P&&N(),C.emit()})}),group:P=>(o.current.has(P)||o.current.set(P,new Set),()=>{s.current.delete(P),o.current.delete(P)}),filter:()=>i.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:v,inputId:E,labelId:w,listInnerRef:T}),[]);function y(P,$){var Y,J;let ae=(J=(Y=i.current)==null?void 0:Y.filter)!=null?J:hD;return P?ae(P,r.current.search,$):0}function A(){if(!r.current.search||i.current.shouldFilter===!1)return;let P=r.current.filtered.items,$=[];r.current.filtered.groups.forEach(J=>{let ae=o.current.get(J),ie=0;ae.forEach(Se=>{let Oe=P.get(Se);ie=Math.max(Oe,ie)}),$.push([J,ie])});let Y=T.current;H().sort((J,ae)=>{var ie,Se;let Oe=J.getAttribute("id"),Xe=ae.getAttribute("id");return((ie=P.get(Xe))!=null?ie:0)-((Se=P.get(Oe))!=null?Se:0)}).forEach(J=>{let ae=J.closest(wl);ae?ae.appendChild(J.parentElement===ae?J:J.closest(`${wl} > *`)):Y.appendChild(J.parentElement===Y?J:J.closest(`${wl} > *`))}),$.sort((J,ae)=>ae[1]-J[1]).forEach(J=>{var ae;let ie=(ae=T.current)==null?void 0:ae.querySelector(`${xo}[${Tn}="${encodeURIComponent(J[0])}"]`);ie?.parentElement.appendChild(ie)})}function N(){let P=H().find(Y=>Y.getAttribute("aria-disabled")!=="true"),$=P?.getAttribute(Tn);C.setState("value",$||void 0)}function W(){var P,$,Y,J;if(!r.current.search||i.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let ae=0;for(let ie of n.current){let Se=y(($=(P=s.current.get(ie))==null?void 0:P.value)!=null?$:"",(J=(Y=s.current.get(ie))==null?void 0:Y.keywords)!=null?J:[]);r.current.filtered.items.set(ie,Se),Se>0&&ae++}for(let[ie,Se]of o.current)for(let Oe of Se)if(r.current.filtered.items.get(Oe)>0){r.current.filtered.groups.add(ie);break}r.current.filtered.count=ae}function O(){var P,$,Y;let J=G();J&&(((P=J.parentElement)==null?void 0:P.firstChild)===J&&((Y=($=J.closest(xo))==null?void 0:$.querySelector(fD))==null||Y.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function G(){var P;return(P=T.current)==null?void 0:P.querySelector(`${Wb}[aria-selected="true"]`)}function H(){var P;return Array.from(((P=T.current)==null?void 0:P.querySelectorAll(Rh))||[])}function X(P){let $=H()[P];$&&C.setState("value",$.getAttribute(Tn))}function j(P){var $;let Y=G(),J=H(),ae=J.findIndex(Se=>Se===Y),ie=J[ae+P];($=i.current)!=null&&$.loop&&(ie=ae+P<0?J[J.length-1]:ae+P===J.length?J[0]:J[ae+P]),ie&&C.setState("value",ie.getAttribute(Tn))}function U(P){let $=G(),Y=$?.closest(xo),J;for(;Y&&!J;)Y=P>0?ED(Y,xo):wD(Y,xo),J=Y?.querySelector(Rh);J?C.setState("value",J.getAttribute(Tn)):j(P)}let ee=()=>X(H().length-1),V=P=>{P.preventDefault(),P.metaKey?ee():P.altKey?U(1):j(1)},ue=P=>{P.preventDefault(),P.metaKey?X(0):P.altKey?U(-1):j(-1)};return f.createElement(it.div,{ref:t,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:P=>{var $;($=_.onKeyDown)==null||$.call(_,P);let Y=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||Y))switch(P.key){case"n":case"j":b&&P.ctrlKey&&V(P);break;case"ArrowDown":V(P);break;case"p":case"k":b&&P.ctrlKey&&ue(P);break;case"ArrowUp":ue(P);break;case"Home":P.preventDefault(),X(0);break;case"End":P.preventDefault(),ee();break;case"Enter":{P.preventDefault();let J=G();if(J){let ae=new Event(_c);J.dispatchEvent(ae)}}}}},f.createElement("label",{"cmdk-label":"",htmlFor:L.inputId,id:L.labelId,style:CD},l),Pi(e,P=>f.createElement(Vb.Provider,{value:C},f.createElement(qb.Provider,{value:L},P))))}),mD=f.forwardRef((e,t)=>{var r,n;let o=Xt(),s=f.useRef(null),a=f.useContext(Gb),i=Ns(),l=Jb(e),c=(n=(r=l.current)==null?void 0:r.forceMount)!=null?n:a?.forceMount;un(()=>{if(!c)return i.item(o,a?.id)},[c]);let p=Kb(o,s,[e.value,e.children,s],e.keywords),d=sd(),h=Fr(I=>I.value&&I.value===p.current),m=Fr(I=>c||i.filter()===!1?!0:I.search?I.filtered.items.get(o)>0:!0);f.useEffect(()=>{let I=s.current;if(!(!I||e.disabled))return I.addEventListener(_c,g),()=>I.removeEventListener(_c,g)},[m,e.onSelect,e.disabled]);function g(){var I,C;S(),(C=(I=l.current).onSelect)==null||C.call(I,p.current)}function S(){d.setState("value",p.current,!0)}if(!m)return null;let{disabled:b,value:_,onSelect:v,forceMount:w,keywords:E,...T}=e;return f.createElement(it.div,{ref:Uo(s,t),...T,id:o,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!h,"data-disabled":!!b,"data-selected":!!h,onPointerMove:b||i.getDisablePointerSelection()?void 0:S,onClick:b?void 0:g},e.children)}),gD=f.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...s}=e,a=Xt(),i=f.useRef(null),l=f.useRef(null),c=Xt(),p=Ns(),d=Fr(m=>o||p.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);un(()=>p.group(a),[]),Kb(a,i,[e.value,e.heading,l]);let h=f.useMemo(()=>({id:a,forceMount:o}),[o]);return f.createElement(it.div,{ref:Uo(i,t),...s,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},r&&f.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},r),Pi(e,m=>f.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},f.createElement(Gb.Provider,{value:h},m))))}),vD=f.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=f.useRef(null),s=Fr(a=>!a.search);return!r&&!s?null:f.createElement(it.div,{ref:Uo(o,t),...n,"cmdk-separator":"",role:"separator"})}),yD=f.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=e.value!=null,s=sd(),a=Fr(c=>c.search),i=Fr(c=>c.selectedItemId),l=Ns();return f.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),f.createElement(it.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":i,id:l.inputId,type:"text",value:o?e.value:a,onChange:c=>{o||s.setState("search",c.target.value),r?.(c.target.value)}})}),bD=f.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,s=f.useRef(null),a=f.useRef(null),i=Fr(c=>c.selectedItemId),l=Ns();return f.useEffect(()=>{if(a.current&&s.current){let c=a.current,p=s.current,d,h=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let m=c.offsetHeight;p.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(c),()=>{cancelAnimationFrame(d),h.unobserve(c)}}},[]),f.createElement(it.div,{ref:Uo(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":n,id:l.listId},Pi(e,c=>f.createElement("div",{ref:Uo(a,l.listInnerRef),"cmdk-list-sizer":""},c)))}),SD=f.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:s,container:a,...i}=e;return f.createElement(Wm,{open:r,onOpenChange:n},f.createElement(Gm,{container:a},f.createElement(Ym,{"cmdk-overlay":"",className:o}),f.createElement(Jm,{"aria-label":e.label,"cmdk-dialog":"",className:s},f.createElement(Yb,{ref:t,...i}))))}),_D=f.forwardRef((e,t)=>Fr(r=>r.filtered.count===0)?f.createElement(it.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),xD=f.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...s}=e;return f.createElement(it.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Pi(e,a=>f.createElement("div",{"aria-hidden":!0},a)))}),vn=Object.assign(Yb,{List:bD,Item:mD,Input:yD,Group:gD,Separator:vD,Dialog:SD,Empty:_D,Loading:xD});function ED(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function wD(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Jb(e){let t=f.useRef(e);return un(()=>{t.current=e}),t}var un=typeof window>"u"?f.useEffect:f.useLayoutEffect;function An(e){let t=f.useRef();return t.current===void 0&&(t.current=e()),t}function Fr(e){let t=sd(),r=()=>e(t.snapshot());return f.useSyncExternalStore(t.subscribe,r,r)}function Kb(e,t,r,n=[]){let o=f.useRef(),s=Ns();return un(()=>{var a;let i=(()=>{var c;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(c=p.current.textContent)==null?void 0:c.trim():o.current}})(),l=n.map(c=>c.trim());s.value(e,i,l),(a=t.current)==null||a.setAttribute(Tn,i),o.current=i}),o}var kD=()=>{let[e,t]=f.useState(),r=An(()=>new Map);return un(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,o)=>{r.current.set(n,o),t({})}};function ID(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Pi({asChild:e,children:t},r){return e&&f.isValidElement(t)?f.cloneElement(ID(t),{ref:t.ref},r(t.props.children)):r(t)}var CD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function ad({className:e,...t}){return(0,u.jsx)(vn,{"data-slot":"command",className:q("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function Xb({className:e,...t}){return(0,u.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,u.jsx)(nu,{className:"size-4 shrink-0 opacity-50"}),(0,u.jsx)(vn.Input,{"data-slot":"command-input",className:q("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function id({className:e,...t}){return(0,u.jsx)(vn.List,{"data-slot":"command-list",className:q("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function ld({...e}){return(0,u.jsx)(vn.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Qb({className:e,...t}){return(0,u.jsx)(vn.Group,{"data-slot":"command-group",className:q("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function W2({className:e,...t}){return(0,u.jsx)(vn.Separator,{"data-slot":"command-separator",className:q("bg-border -mx-1 h-px",e),...t})}function cd({className:e,...t}){return(0,u.jsx)(vn.Item,{"data-slot":"command-item",className:q("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function RD(e,t){const r=new Map;for(const n of e)r.get(n.name)?.projectId===t&&n.projectId!==t||r.set(n.name,n);return r}var TD=new Set(["none","null","undefined"]),AD=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,ND=["local_","project_"];function ud(e){const t=e?.trim();if(!t)return!1;const r=t.toLowerCase();return!TD.has(r)&&!AD.test(t)&&!ND.some(n=>r.startsWith(n))}function PD(e){return typeof e=="object"&&e!==null&&Array.isArray(e.members)}function MD(e){return Array.isArray(e)?{members:e,canManageMembers:!1}:PD(e)?{members:e.members,canManageMembers:e.canManageMembers}:{members:[],canManageMembers:!1}}function OD(e,t){return!e||!t?e:e.filter(r=>r.organizationId===t)}function jD({isAuthenticated:e,organizationId:t}){const r=Ti(),n=eo("projects:getMyProjects",e&&r?{}:"skip"),o=e&&(!r||n===void 0),s=(0,f.useMemo)(()=>OD(n,t),[n,t]);return{allProjects:n,projects:s,sortedProjects:(0,f.useMemo)(()=>s?[...s].sort((a,i)=>i.updatedAt-a.updatedAt):[],[s]),isLoading:o,hasProjects:(s?.length??0)>0,hasAnyProjects:(n?.length??0)>0}}var q2="Only project admins can create clients.";function V2({isAuthenticated:e,projectId:t}){const{allProjects:r,isLoading:n}=jD({isAuthenticated:e});return{canManage:(t?r?.find(o=>o._id===t):void 0)?.canDeleteProject===!0,isLoading:n}}function LD({isAuthenticated:e,projectId:t}){const r=e&&!!t,n=eo("projects:getProjectMembers",r?{projectId:t}:"skip"),o=r&&n===void 0,{members:s,canManageMembers:a}=(0,f.useMemo)(()=>MD(n),[n]),i=(0,f.useMemo)(()=>s?s.filter(c=>!c.isPending):[],[s]),l=(0,f.useMemo)(()=>s?s.filter(c=>c.isPending):[],[s]);return{members:s,activeMembers:i,pendingMembers:l,canManageMembers:a,isLoading:o,hasPendingMembers:l.length>0}}function G2(e){return e==="owner"||e==="admin"||e==="member"}function Y2(e){return e==="owner"||e==="admin"||e==="member"}function DD(e){return e==="owner"||e==="admin"}function J2(e){return e.isWorkOsSignedIn?DD(e.role):e.isAuthenticated&&e.hasProject&&!e.identityLoading}function K2({isAuthenticated:e,projectId:t,viewerEmail:r,identityLoading:n=!1}){const{activeMembers:o,isLoading:s}=LD({isAuthenticated:e,projectId:t}),a=r?.trim().toLowerCase()??null,i=(0,f.useMemo)(()=>{if(a)return o.find(h=>h.email.toLowerCase()===a)?.role},[o,a]),l=(0,f.useRef)(null),c=`${t??""}|${a??""}`,p=FD(s,n,r);p||(l.current={key:c,role:i});const d=l.current;return p&&d?.key===c?{role:d.role,isLoading:!1}:{role:i,isLoading:p}}function FD(e,t,r){return t?!0:r?.trim()?e:!1}function X2(){const e=Qe("projects:createProject"),t=Qe("projects:ensureDefaultProject");return{createProject:(0,f.useCallback)(r=>e({...r,themeMode:lh()}),[e]),ensureDefaultProject:(0,f.useCallback)((r={})=>t({...r,themeMode:lh()}),[t]),updateProject:Qe("projects:updateProject"),patchProjectDefaultConnection:Qe("hostConfigsV2:patchProjectDefaultConnection"),deleteProject:Qe("projects:deleteProject"),inviteProjectMember:Qe("projects:inviteProjectMember"),removeProjectMember:Qe("projects:removeProjectMember"),updateProjectMemberRole:Qe("projects:updateProjectMemberRole"),updateProjectInviteRole:Qe("projects:updateProjectInviteRole")}}function Q2(){const e=Qe("servers:createServer"),t=Qe("servers:createServerIfMissing"),r=Qe("servers:updateServer"),n=Qe("servers:deleteServer");return{createServer:e,createServerIfMissing:t,updateServer:r,createServerWithClientSecret:Fi("servers:createServerWithClientSecret"),moveServerToProject:Fi("servers:moveServerToProject"),updateServerWithClientSecret:Fi("servers:updateServerWithClientSecret"),deleteServer:n}}function Z2({projectId:e,isAuthenticated:t}){const r=Ti(),n=t&&r&&ud(e),o=e?.trim()??"",s=eo("servers:getProjectServers",n?{projectId:o}:"skip"),a=n&&s===void 0;return{servers:s,serversRecord:(0,f.useMemo)(()=>s?Object.fromEntries(RD(s,o)):{},[s,o]),isLoading:a,hasServers:(s?.length??0)>0}}function eB({projectIds:e,isAuthenticated:t}){const r=e.join("|"),n=(0,f.useMemo)(()=>e.length===0?[]:Array.from(new Set(e)).slice(0,500),[r]),o=eo("servers:listForProjects",t&&n.length>0?{projectIds:n}:"skip"),s=t&&n.length>0&&o===void 0;return{serversByProject:(0,f.useMemo)(()=>o??{},[o]),isLoading:s}}function HD(e){return e?.type==="user_testing"}function Th(e){return e.filter(t=>!HD(t.ownerScope))}var UD=s_("projectClients:ensureProjectClient");function $D({isAuthenticated:e,projectId:t,includePrivateBacking:r=!1}){const n=Ti(),o=t?.trim()??"",s=ud(o),a=eo("hosts:listHosts",e&&n&&s?{projectId:o}:"skip");return{hosts:(0,f.useMemo)(()=>{const i=a??[],l=Th(i),c=vm(l),p=i.map(d=>({...d,displayName:c.get(d.hostId)??d.name}));return r?p:Th(p)},[a,r]),isLoading:a===void 0}}var BD=/^[a-z0-9]{20,}$/i;function zD(e){const t=e?.trim();return!!(t&&BD.test(t))}function WD({isAuthenticated:e,hostId:t}){const r=Ti(),n=zD(t),o=e&&r&&n,s=t?.trim()??"",a=eo("hosts:getHost",o?{hostId:s}:"skip");return{host:a??null,isLoading:e&&n&&a===void 0}}function tB(){return{createHost:Qe("hosts:createHost"),updateHost:Qe("hosts:updateHost"),updateHostServers:Qe("hosts:updateHostServers"),deleteHost:Qe("hosts:deleteHost"),duplicateHost:Qe("hosts:duplicateHost"),ensureProjectClient:Qe(UD)}}var qD="claude-code-host-enabled";function VD(){const e=vr(qD),t=vr("local-harness-enabled");return e===!0||t===!0?!0:e===void 0||t===void 0?void 0:!1}function GD(){return VD()===!0}var YD="codex-host-enabled",JD="local-codex-enabled";function KD(){const e=vr(YD),t=vr(JD);return e===!0||t===!0?!0:e===void 0||t===void 0?void 0:!1}function XD(){return KD()===!0}function QD(){const e=vr("copilot-cli-harness");return vr("local-copilot-cli-enabled")}var ZD="cursor-host-enabled";function eF(){return vr(ZD)}function tF(){return eF()===!0}var rF="opencode-host-enabled";function nF(){return vr(rF)}function oF(){return nF()===!0}function sF(){return vr(T1)}function aF(){return sF()===!0}var dd=(0,f.createContext)(null),rB=({children:e,themeMode:t,themePreset:r,hostStyle:n})=>{const o=(0,f.useRef)(null);return o.current??=tb({themeMode:t,themePreference:ob()==="system"?"system":t,themePreset:r,hostStyle:n}),(0,f.useEffect)(()=>{const s=o.current,a=window.matchMedia?.("(prefers-color-scheme: dark)"),i=()=>{const p=s.getState().themePreference,d=Wu(p);s.getState().themeMode!==d&&s.setState({themeMode:d}),sb(d)};i();const l=s.subscribe((p,d)=>{p.themePreference!==d.themePreference&&i()}),c=()=>{s.getState().themePreference==="system"&&i()};return a?.addEventListener("change",c),()=>{l(),a?.removeEventListener("change",c)}},[]),(0,u.jsx)(dd.Provider,{value:o.current,children:e})},qa=e=>{const t=(0,f.useContext)(dd);if(!t)throw new Error("Missing PreferencesStoreProvider");return $m(t,e)},Ah=null,nB=e=>{Ah??=tb();const t=(0,f.useContext)(dd)??Ah;return $m(t,e)},Nh={xs:"size-3",default:"size-3.5",sm:"size-3.5",md:"size-4",stack:"size-5"};function Va({logoSrc:e,name:t,size:r,className:n}){if(e){const o=e===mc("opencode","light")||e===mc("opencode","dark");return(0,u.jsx)("img",{src:e,alt:"",className:q("shrink-0 object-contain",o?"h-5 w-4":Nh[r],n)})}return(0,u.jsx)("span",{"aria-hidden":!0,className:q("flex shrink-0 items-center justify-center rounded-md bg-muted font-semibold uppercase text-muted-foreground",r==="stack"||r==="md"?"text-[9px]":r==="xs"?"text-[7px]":"text-[8px]",Nh[r],n),children:t.slice(0,2)})}function oB({name:e,hostId:t,logoSrc:r,size:n="default",layout:o="inline",className:s}){const a=r??Sb(e),i=t??e,l=o==="stack"?"stack":n;return o==="stack"?(0,u.jsxs)("span",{className:q("inline-flex max-w-[11rem] flex-col items-center gap-1 text-foreground",s),title:i,children:[(0,u.jsx)(Va,{logoSrc:a,name:e,size:l}),(0,u.jsx)("span",{className:q("max-w-full truncate text-center font-medium leading-tight",n==="sm"?"text-[11px]":"text-xs"),children:e})]}):(0,u.jsxs)("span",{className:q("inline-flex max-w-[180px] items-center gap-1.5 rounded-full border text-foreground","border-primary/35 bg-primary/8 shadow-xs",n==="sm"?"px-2 py-0.5 text-[11px]":"px-2.5 py-1 text-[12px]",s),title:i,children:[(0,u.jsx)(Va,{logoSrc:a,name:e,size:l}),(0,u.jsx)("span",{className:"min-w-0 truncate font-medium leading-tight",children:e})]})}var iF=Math.max(6,Ob.length);function lF({hosts:e,selectedHostIds:t,subjectsByHost:r,onToggleHost:n,viewMode:o,onViewModeChange:s,filters:a,divergingOnly:i,onDivergingOnlyChange:l,showDescriptions:c,onShowDescriptionsChange:p,descriptionsDisabled:d=!1,disabled:h=!1,themeMode:m="light",mobileOptimized:g=!1}){const S=new Set(t),b=cF(e,S),_=new Set(b.map(w=>w.hostId)),v=e.filter(w=>!_.has(w.hostId));return(0,u.jsxs)("div",{className:q("mb-4 flex flex-wrap items-start gap-2",g&&"min-w-0"),children:[(0,u.jsxs)("div",{className:q("flex min-w-0 flex-1 flex-wrap items-center gap-2",g&&"basis-full"),children:[b.map(w=>(0,u.jsx)(dF,{host:w,subject:r[w.hostId],selected:S.has(w.hostId),onToggle:()=>n(w.hostId),disabled:h,themeMode:m},w.hostId)),v.length>0?(0,u.jsx)(pF,{hosts:v,selectedSet:S,subjectsByHost:r,onToggleHost:n,disabled:h,themeMode:m}):null]}),(0,u.jsxs)("div",{className:q("ml-auto flex shrink-0 items-center gap-4",g&&"ml-0 min-w-0 w-full flex-wrap gap-x-3 gap-y-2 sm:justify-end"),children:[o!==void 0&&s!==void 0?(0,u.jsx)(uF,{viewMode:o,onViewModeChange:s,disabled:h}):null,a,(0,u.jsxs)("label",{className:q("flex cursor-pointer items-center gap-2 text-[12px] text-muted-foreground",(h||d)&&"cursor-not-allowed opacity-40",g&&"shrink-0"),title:d?"Descriptions are available in table view":void 0,children:[(0,u.jsx)(pc,{checked:c,disabled:h||d,onCheckedChange:p,"aria-label":"Show field descriptions"}),(0,u.jsx)("span",{children:"Descriptions"})]}),(0,u.jsxs)("label",{className:q("flex cursor-pointer items-center gap-2 text-[12px] text-muted-foreground",h&&"cursor-not-allowed opacity-40",g&&"shrink-0"),children:[(0,u.jsx)(pc,{checked:i,disabled:h,onCheckedChange:l,"aria-label":"Show only diverging fields"}),(0,u.jsx)("span",{children:"Only diverging"})]})]})]})}function cF(e,t){const r=e.filter(o=>t.has(o.hostId)),n=Math.max(0,iF-r.length);return[...r,...e.filter(o=>!t.has(o.hostId)).slice(0,n)]}function uF({viewMode:e,onViewModeChange:t,disabled:r}){return(0,u.jsx)("div",{role:"group","aria-label":"View mode",className:"flex shrink-0 items-center gap-0.5 rounded-full border border-border p-0.5",children:[{value:"table",label:"Tables"},{value:"list",label:"List"}].map(n=>{const o=e===n.value;return(0,u.jsx)("button",{type:"button","aria-pressed":o,disabled:r,"data-testid":`compare-view-${n.value}`,onClick:()=>t(n.value),className:q("rounded-full px-2.5 py-0.5 text-[11px] transition-colors","disabled:cursor-not-allowed disabled:opacity-40","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",o?"bg-primary/10 text-foreground":"text-muted-foreground hover:text-foreground"),children:n.label},n.value)})})}function dF({host:e,subject:t,selected:r,onToggle:n,disabled:o,themeMode:s}){const a=t!==void 0?pn(t.hostStyle,t.config.chatUiOverride,s):_b(e,s),i=Lc();return(0,u.jsxs)(Nr.button,{type:"button",disabled:o,"aria-pressed":r,"data-testid":`host-compare-chip-${e.hostId}`,"data-selected":r?"true":"false",className:q("inline-flex max-w-[180px] items-center gap-1.5 rounded-full border px-2.5 py-1 text-[12px]","transition-colors duration-150","disabled:cursor-not-allowed disabled:opacity-50","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",r?"border-primary/35 bg-primary/8 text-foreground shadow-xs":"border-border bg-background text-muted-foreground hover:bg-muted/40 hover:text-foreground"),whileHover:i||o?void 0:{scale:1.04},whileTap:i||o?void 0:{scale:.94},animate:i?void 0:{y:r?-1:0},transition:{type:"spring",stiffness:480,damping:28,mass:.5},onClick:n,children:[(0,u.jsx)(Va,{logoSrc:a,name:en(e),size:"sm"}),(0,u.jsx)("span",{className:"truncate",children:en(e)})]})}function pF({hosts:e,selectedSet:t,subjectsByHost:r,onToggleHost:n,disabled:o,themeMode:s}){const a=e.filter(i=>t.has(i.hostId)).length;return(0,u.jsxs)(nd,{children:[(0,u.jsx)(Bb,{asChild:!0,children:(0,u.jsxs)(Ke,{type:"button",variant:"outline",size:"sm",disabled:o,className:"h-7 gap-1 rounded-full px-2.5 text-[12px]","data-testid":"host-compare-overflow-trigger",children:["More",a>0?(0,u.jsxs)("span",{className:"text-muted-foreground",children:["(",a,")"]}):null,(0,u.jsx)($c,{className:"size-3.5 opacity-60"})]})}),(0,u.jsx)(od,{align:"start",className:"w-[240px] p-0",children:(0,u.jsxs)(ad,{shouldFilter:!0,children:[(0,u.jsx)(Xb,{placeholder:"Search clients"}),(0,u.jsxs)(id,{children:[(0,u.jsx)(ld,{children:"No matching clients."}),e.map(i=>{const l=t.has(i.hostId),c=r[i.hostId],p=c!==void 0?pn(c.hostStyle,c.config.chatUiOverride,s):_b(i,s);return(0,u.jsxs)(cd,{value:`${en(i)} ${i.name} ${i.hostId}`,onSelect:()=>n(i.hostId),"data-testid":`host-compare-overflow-${i.hostId}`,children:[(0,u.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,u.jsx)(Va,{logoSrc:p,name:en(i),size:"sm"}),(0,u.jsx)("span",{className:"truncate",children:en(i)})]}),(0,u.jsx)("span",{className:q("text-[11px]",l?"text-foreground":"text-muted-foreground"),children:l?"Shown":"Hidden"})]},i.hostId)})]})]})})]})}var fF={backgroundImage:"linear-gradient(45deg, rgba(120,120,120,0.35) 25%, transparent 25%, transparent 75%, rgba(120,120,120,0.35) 75%), linear-gradient(45deg, rgba(120,120,120,0.35) 25%, transparent 25%, transparent 75%, rgba(120,120,120,0.35) 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px"};function Ph({value:e,className:t}){return(0,u.jsx)("span",{"aria-hidden":!0,className:q("inline-block size-3 shrink-0 overflow-hidden rounded-[3px] border border-border/70 align-middle",t),style:fF,children:(0,u.jsx)("span",{className:"block size-full",style:{backgroundColor:e}})})}function hF({currentTarget:e,target:t}){if(!t.matches(":focus-visible"))return;const r=t.closest("td, th"),n=r?.parentElement?.firstElementChild;if(!r||r===n||!n)return;const o=n.getBoundingClientRect().right+3,s=e.getBoundingClientRect().left+e.clientWidth-3,a=t.getBoundingClientRect();a.left<o?e.scrollLeft+=Math.floor(a.left-o):a.right>s&&(e.scrollLeft+=Math.ceil(a.right-s))}function mF({groups:e,visibleFieldIds:t,...r}){return e.flatMap(({section:n,subsections:o})=>o.map(({label:s,fields:a})=>{const i=a.filter(({id:l})=>t.has(l));return i.length===0?null:(0,u.jsxs)(f.Fragment,{children:[(0,u.jsx)("tr",{className:"border-b border-border bg-muted",children:(0,u.jsx)("th",{colSpan:r.subjects.length+2,className:"px-3 py-2 text-left text-xs font-semibold text-muted-foreground sm:px-5",children:n.label===s?s:`${n.label} / ${s}`})}),i.map(l=>(0,u.jsx)(gF,{field:l,...r},l.id))]},`${n.id}-${s}`)}))}function gF({field:e,renderCell:t,subjects:r,summaryColumn:n,showDescriptions:o,mobileOptimized:s}){const a=n.renderSlices?.(e);return(0,u.jsxs)("tr",{className:"border-b border-border last:border-b-0",children:[(0,u.jsxs)("th",{scope:"row",className:"sticky left-0 z-10 bg-card font-normal px-3 py-2.5 text-left after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:w-px after:bg-border after:content-[''] sm:px-5",children:[(0,u.jsx)("span",{className:"text-[13px] font-medium leading-tight text-foreground [overflow-wrap:anywhere]",children:n.renderFieldLabel?.(e)??e.label}),e.description&&o&&(0,u.jsx)("div",{className:"mt-1 text-[11px] leading-snug text-muted-foreground",children:e.description})]}),(0,u.jsx)("td",{className:q("border-l border-border px-2 py-2.5 align-top sm:px-3",s&&"[&_a]:scroll-ml-[var(--matrix-field-width)]"),children:(0,u.jsxs)("div",{className:"flex flex-col gap-1 text-left tabular-nums",children:[n.render(e),a&&(0,u.jsx)("div",{role:"group","aria-label":"Adoption by mode",className:"mt-1 grid grid-cols-3 gap-x-1.5 gap-y-2 border-t border-border pt-2",children:a})]})}),r.map(i=>(0,u.jsx)("td",{className:"border-l border-border px-3 py-2.5 text-center align-top sm:px-4",children:(0,u.jsx)(t,{field:e,subject:i,mobileOptimized:s,compact:!0})},i.hostId))]})}function Zb({subject:e,href:t,className:r}){return t?(0,u.jsxs)(to,{children:[(0,u.jsx)(ro,{asChild:!0,children:(0,u.jsx)("a",{href:t,"data-testid":`host-compare-verify-${e.hostId}`,className:q(r,"scroll-ml-[var(--matrix-field-width)] rounded-sm break-words underline decoration-border underline-offset-4 hover:text-primary focus-visible:outline-2 focus-visible:outline-ring"),children:e.hostName})}),(0,u.jsx)(no,{side:"top",sideOffset:6,variant:"muted",className:"dark",children:"Verify against your server"})]}):(0,u.jsx)("span",{className:q(r,"break-words"),children:e.hostName})}function eS({id:e,subject:t,className:r,compact:n}){const o=za(t.verifiedAt),s=Eb(t.verifiedAt);return o==="—"?null:(0,u.jsxs)("time",{id:e,dateTime:o,title:s?xb:void 0,className:q("mt-1.5 inline-flex items-center gap-1 text-[10px] leading-tight font-normal text-muted-foreground",r),children:[s&&(0,u.jsx)(Cm,{className:"size-3 shrink-0","aria-hidden":!0}),(0,u.jsxs)("span",{children:[n?(0,u.jsx)("span",{className:"sr-only",children:`Verified on ${o}`}):"Verified on ",(0,u.jsx)("span",{"aria-hidden":n||void 0,className:"whitespace-nowrap",children:o})]})]})}function vF({groups:e,visibleFieldIds:t,subjects:r,summaryColumn:n,showDescriptions:o,themeMode:s,renderCell:a,verifyHref:i}){const l=r.map(c=>({subject:c,href:i(c.hostId),logo:pn(c.hostStyle,c.config.chatUiOverride,s)}));return(0,u.jsx)("div",{"data-caniuse-matrix":"","data-testid":"compare-matrix",className:"min-w-0",children:e.flatMap(({section:c,subsections:p})=>p.map(({label:d,fields:h})=>{const m=h.filter(({id:g})=>t.has(g));return m.length?(0,u.jsxs)("section",{children:[(0,u.jsx)("h3",{className:"border-y border-border bg-muted px-3 py-1.5 text-xs font-semibold text-muted-foreground",children:c.label===d?d:`${c.label} / ${d}`}),m.map(g=>{const S=n.render(g),b=n.renderSlices?.(g);return(0,u.jsxs)("article",{"aria-label":g.label,className:"border-b border-border last:border-b-0",children:[(0,u.jsxs)("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[(0,u.jsxs)("div",{className:"min-w-0",children:[(0,u.jsx)("h4",{className:"text-base font-semibold [overflow-wrap:anywhere]",children:n.renderFieldLabel?.(g)??g.label}),o&&g.description&&(0,u.jsx)("p",{className:"mt-1 text-xs leading-snug text-muted-foreground",children:g.description})]}),S&&(0,u.jsxs)("div",{className:"max-w-[45%] shrink-0 tabular-nums",children:[(0,u.jsx)("div",{className:"text-[10px] text-muted-foreground",children:n.label}),S]})]}),(0,u.jsx)("ul",{children:l.map(({subject:_,href:v,logo:w})=>(0,u.jsxs)("li",{className:"grid min-h-9 grid-cols-[minmax(0,1fr)_40%] items-center gap-2 border-t border-border px-3 py-1.5",children:[(0,u.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,u.jsx)("img",{src:w,alt:"",className:"size-5 shrink-0 object-contain"}),(0,u.jsx)("div",{className:"min-w-0 [overflow-wrap:anywhere]",children:(0,u.jsx)(Zb,{subject:_,href:v,className:"block text-sm font-semibold leading-tight"})})]}),(0,u.jsx)("div",{className:"min-w-0 text-left leading-tight [overflow-wrap:anywhere] [&>*]:max-w-full [&>.inline-flex]:justify-start [&_[data-support-level]]:text-xs [&_[data-support-level]]:whitespace-normal",children:(0,u.jsx)(a,{field:g,subject:_,mobileOptimized:!0,compact:!0,stacked:!0})})]},_.hostId))}),b&&(0,u.jsx)("div",{role:"group","aria-label":"Adoption by mode",className:"grid grid-cols-3 gap-x-1.5 gap-y-2 border-t border-border px-3 py-2 tabular-nums",children:b})]},g.id)})]},`${c.id}-${d}`):null}))})}var yF={supported:"bg-success/50 text-foreground",partial:"bg-warning/50 text-foreground",neutral:"bg-muted/40 text-muted-foreground",unsupported:"bg-destructive/50 text-foreground",unknown:"bg-muted/40 text-muted-foreground"},bF={supported:"bg-success",partial:"bg-warning",neutral:"bg-muted-foreground/50",unsupported:"bg-destructive",unknown:"bg-muted-foreground/50"};function Ht({level:e,label:t,className:r,truncateLabel:n=!1}){return(0,u.jsxs)("span",{"data-support-level":e,className:q("inline-flex items-center gap-1.5 rounded-full px-2 py-0.5",n&&"max-w-full","text-[11px] font-medium leading-none whitespace-nowrap",yF[e],r),children:[(0,u.jsx)("span",{"aria-hidden":!0,"data-support-dot":"",className:q("size-1.5 rounded-full",bF[e])}),n?(0,u.jsx)("span",{className:"min-w-0 truncate",children:t}):t]})}var SF="template",pd="hostTab",Mh={agent:"behavior",tools:"tools",browser:"browser",computer:"computer",protocol:"protocol",apps:"apps",events:"events",appearance:"appearance"},_F={behavior:"agent",tools:"tools",browser:"browser",computer:"computer",protocol:"protocol",apps:"apps",events:"events",appearance:"appearance"};function tS(e){return _F[e]??null}function sB(e){const t=new URLSearchParams(e.startsWith("?")?e:`?${e}`).get(pd);return t?t==="behavior"?"behavior":t in Mh?Mh[t]:null:null}function aB(e,t){const r=tS(t);if(!e)return _a.hosts;const n=X0(e);return r?`${n}?${new URLSearchParams({[pd]:r}).toString()}`:n}function xF(e,t="behavior"){const r=new URLSearchParams({[SF]:e}),n=tS(t);return n&&r.set(pd,n),r.toString()}function rS({subjects:e,summaryColumn:t,fields:r=gn,divergingOnly:n=!1,supportFilter:o="all",searchQuery:s="",showDescriptions:a=!1,onRemoveHost:i,themeMode:l="light",mobileOptimized:c=!1,stacked:p=!1,verifyBaseUrl:d,disabledVerifyTemplateIds:h}){const m=(0,f.useMemo)(()=>Nb(r),[r]),g=(0,f.useMemo)(()=>e.map(E=>E.config),[e]),S=(0,f.useMemo)(()=>{const E=new Set;for(const T of r)Ab(T,g)&&E.add(T.id);return E},[g,r]),b=s.trim().length>0&&o!=="all",_=(0,f.useMemo)(()=>Mb({fields:r,configs:g,divergingOnly:n,supportFilter:b?"all":o,searchQuery:s}),[r,g,n,o,s,b]),v=(0,f.useMemo)(()=>r.filter(E=>_.has(E.id)),[r,_]),w=(0,f.useMemo)(()=>b?e.filter(E=>v.some(T=>BL(T,E.config,o))):e,[e,o,b,v]);return e.length===0?(0,u.jsx)("div",{className:"flex h-full min-h-[200px] items-center justify-center text-sm text-muted-foreground",children:"No clients to compare. Create at least one client in this project."}):_.size===0?(0,u.jsx)("div",{className:"flex h-full min-h-[160px] items-center justify-center rounded-xl border border-border bg-card text-sm text-muted-foreground",children:"No fields match the current search and filters."}):w.length===0?(0,u.jsx)("div",{className:"flex h-full min-h-[160px] items-center justify-center rounded-xl border border-border bg-card text-sm text-muted-foreground",children:"No clients match the current search and filters."}):p&&t?(0,u.jsx)(vF,{groups:m,visibleFieldIds:_,subjects:w,summaryColumn:t,showDescriptions:a,themeMode:l,renderCell:xc,verifyHref:E=>nS(d,E,h)}):(0,u.jsx)(Nr.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,ease:[.22,1,.36,1]},"data-testid":"compare-matrix",className:q("flex max-h-full min-w-0 flex-col overflow-hidden rounded-xl border border-border bg-card shadow-[0_1px_0_rgba(0,0,0,0.02),0_12px_30px_-18px_rgba(0,0,0,0.18)]",c&&"max-w-full"),children:(0,u.jsx)("div",{"data-testid":"compare-matrix-scroll",onFocus:c&&t?hF:void 0,className:q("min-h-0 overflow-auto",c&&"max-w-full [--matrix-field-width:140px] [-webkit-overflow-scrolling:touch] sm:[--matrix-field-width:300px]",c&&t&&"relative"),children:(0,u.jsxs)("table",{"data-caniuse-matrix":t?"":void 0,className:q("border-collapse text-center text-[13px]",c?"table-fixed min-w-full":"w-full"),style:c?{width:140+(t?224:0)+w.length*132}:void 0,children:[(0,u.jsxs)("colgroup",{children:[(0,u.jsx)("col",{className:c?"w-[var(--matrix-field-width)]":"w-[168px] sm:w-[300px]"}),t&&(0,u.jsx)("col",{className:"w-56"}),w.map(E=>(0,u.jsx)("col",{className:c?"w-[132px] sm:w-[220px]":"w-[148px] sm:w-[220px]"},E.hostId))]}),(0,u.jsx)("thead",{children:(0,u.jsxs)("tr",{children:[(0,u.jsx)("th",{className:"sticky left-0 top-0 z-30 bg-card border-b border-border px-3 py-3 text-left after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:w-px after:bg-border after:content-[''] sm:px-5 sm:py-4",children:(0,u.jsx)("span",{className:q("text-[11px] text-muted-foreground",!t&&"uppercase tracking-[0.16em]"),children:"Field"})}),t&&(0,u.jsx)("th",{scope:"col",className:"sticky top-0 z-20 border-b border-l border-border bg-card px-2 py-3 text-[11px] text-muted-foreground",children:t.label}),w.map(E=>(0,u.jsx)(RF,{subject:E,onRemove:i,themeMode:l,verifyBaseUrl:d,disabledVerifyTemplateIds:h,linkName:!!t},E.hostId))]})}),(0,u.jsxs)("tbody",{children:[d!==void 0&&!t?(0,u.jsx)(EF,{subjects:w,mobileOptimized:c}):null,t?(0,u.jsx)(mF,{groups:m,renderCell:xc,visibleFieldIds:_,subjects:w,summaryColumn:t,showDescriptions:a,mobileOptimized:c}):m.map((E,T)=>{if(E.subsections.flatMap(C=>C.fields).filter(C=>_.has(C.id)).length===0)return null;const I=E.subsections.flatMap(C=>C.fields).filter(C=>S.has(C.id)).length;return(0,u.jsx)(wF,{index:T,sectionLabel:E.section.label,divergeCount:I,subsections:E.subsections,subjects:w,coverageSubjects:e,divergingIds:S,visibleFieldIds:_,showDescriptions:a,mobileOptimized:c},E.section.id)})]})]})})})}function EF({subjects:e,mobileOptimized:t}){return(0,u.jsxs)("tr",{className:"border-b border-border bg-card",children:[(0,u.jsx)("td",{className:q("sticky left-0 z-10 bg-card px-3 py-1.5 text-left after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:w-px after:bg-border after:content-[''] sm:px-5",t&&"min-w-0"),children:(0,u.jsx)("span",{className:"text-[12px] font-medium leading-tight text-muted-foreground",children:"Verified at"})}),e.map(r=>(0,u.jsx)("td",{className:q("border-l border-border px-3 py-1.5 text-center align-top sm:px-4",t?"min-w-0":"min-w-[220px]"),children:(0,u.jsx)("div",{className:"flex min-h-5 items-center justify-center",children:Eb(r.verifiedAt)?(0,u.jsxs)("span",{title:`Last checked ${za(r.verifiedAt)}`,className:q("inline-flex items-center gap-1 text-[12px] leading-tight text-muted-foreground",t?"min-w-0 whitespace-normal":"whitespace-nowrap"),children:[(0,u.jsx)(Cm,{className:"size-3.5 shrink-0","aria-hidden":!0}),xb]}):(0,u.jsx)("span",{className:"text-[12px] tabular-nums text-muted-foreground",children:za(r.verifiedAt)})})},r.hostId))]})}function wF({index:e,sectionLabel:t,divergeCount:r,subsections:n,subjects:o,coverageSubjects:s,divergingIds:a,visibleFieldIds:i,showDescriptions:l,mobileOptimized:c}){const p=o.length+1;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("tr",{children:[(0,u.jsx)("th",{scope:"colgroup",className:"sticky left-0 z-20 border-y border-border bg-muted px-3 py-1 text-left after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:w-px after:bg-border after:content-[''] sm:px-5",children:(0,u.jsxs)(Nr.div,{className:"flex items-baseline gap-2",initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{delay:.08+e*.07,duration:.4,ease:[.22,1,.36,1]},children:[(0,u.jsx)("span",{className:"text-[13px] font-medium tracking-tight",children:t}),r>0&&(0,u.jsx)(Nr.span,{"aria-hidden":!0,className:"inline-block size-1.5 rounded-full bg-primary/70",initial:{scale:0},animate:{scale:1},transition:{delay:.2+e*.07,type:"spring",stiffness:600,damping:18}})]})}),(0,u.jsx)("td",{colSpan:p-1,className:"border-y border-border bg-muted"})]}),n.map(d=>{const h=d.fields.filter(m=>i.has(m.id));return h.length===0?null:(0,u.jsx)(kF,{label:d.label,fields:h,subjects:o,coverageSubjects:s,divergingIds:a,colSpan:p,showDescriptions:l,mobileOptimized:c},`${t}-${d.label}`)})]})}function kF({label:e,fields:t,subjects:r,coverageSubjects:n,divergingIds:o,colSpan:s,showDescriptions:a,mobileOptimized:i}){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("tr",{children:[(0,u.jsx)("td",{className:"sticky left-0 z-10 border-b border-border bg-card px-3 py-1.5 text-left text-[10px] uppercase tracking-wider text-muted-foreground after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:w-px after:bg-border after:content-[''] sm:px-5",children:e}),(0,u.jsx)("td",{colSpan:s-1,className:"border-b border-border bg-card"})]}),t.map(l=>(0,u.jsx)(IF,{field:l,subjects:r,coverageSubjects:n,diverges:o.has(l.id),showDescriptions:a,mobileOptimized:i},l.id))]})}function IF({field:e,subjects:t,coverageSubjects:r,diverges:n,showDescriptions:o,mobileOptimized:s}){const a=r.length>=2?UL(e,r.map(l=>l.config)):null,i=q("text-[13px] font-medium leading-tight text-foreground",s&&"min-w-0 break-words");return(0,u.jsxs)("tr",{className:"border-b border-border last:border-b-0",children:[(0,u.jsxs)("td",{className:"sticky left-0 z-10 bg-card px-3 py-2.5 text-left after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:w-px after:bg-border after:content-[''] sm:px-5",children:[n&&(0,u.jsx)(Nr.span,{"aria-hidden":"true",className:"absolute left-0 top-0 bottom-0 w-[3px] bg-primary/70 origin-top","data-testid":`diverge-gutter-${e.id}`,initial:{scaleY:0,opacity:0},animate:{scaleY:1,opacity:1},transition:{duration:.45,ease:[.22,1,.36,1]}}),(0,u.jsxs)("div",{className:q("flex items-center gap-1.5",s&&"min-w-0"),children:[(0,u.jsx)("span",{className:i,children:e.label}),a&&(0,u.jsxs)("span",{className:"text-[10.5px] text-muted-foreground tabular-nums",title:`Supported by ${a.supported} of ${a.total} clients`,"data-testid":`coverage-${e.id}`,children:[a.supported,"/",a.total]}),e.description&&!o&&(0,u.jsxs)(to,{children:[(0,u.jsx)(ro,{asChild:!0,children:(0,u.jsx)("button",{type:"button","aria-label":`About ${e.label}`,className:"inline-flex size-4 shrink-0 items-center justify-center rounded-full text-muted-foreground/60 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",children:(0,u.jsx)(dg,{className:"size-3"})})}),(0,u.jsx)(no,{side:"top",variant:"muted",className:"max-w-[260px] text-left [text-wrap:normal]",children:e.description})]})]}),e.description&&o&&(0,u.jsx)("div",{className:"mt-1 text-[11px] leading-snug text-muted-foreground",children:e.description})]}),t.map(l=>(0,u.jsx)("td",{className:"border-l border-border px-3 py-2.5 text-center align-top sm:px-4",children:(0,u.jsx)(xc,{field:e,subject:l,mobileOptimized:s})},l.hostId))]})}function xc({field:e,subject:t,mobileOptimized:r,compact:n=!1,stacked:o=!1}){const s=e.read(t.config),a=e.kind;if(s===br)return(0,u.jsx)(Ht,{level:"unsupported",label:"Not supported"});if(s===void 0&&a.kind!=="tri-state"&&a.kind!=="capability")return o?(0,u.jsx)(Ht,{level:"unknown",label:"No result"}):(0,u.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n&&(0,u.jsx)("span",{className:"sr-only",children:"No result"}),(0,u.jsx)("span",{"aria-hidden":n||void 0,children:"—"})]});switch(a.kind){case"boolean":return n?s===!0?(0,u.jsx)(Ht,{level:"supported",label:"Supported"}):(0,u.jsx)(Ht,{level:"unsupported",label:"Not supported"}):(0,u.jsx)(Ht,{level:s===!0?"supported":"neutral",label:s===!0?"Yes":"No"});case"tri-state":return(0,u.jsx)(Ht,{level:s===!0?"supported":s===!1?"neutral":"partial",label:s===!0?"On":s===!1?"Off":"Auto"});case"capability":{const i=Xn(e,t.config)??"neutral";if(s==null)return(0,u.jsx)(Ht,{level:n?"unsupported":i,label:"Not supported"});const l=zL(e,t.config),c=typeof s=="object"?Object.keys(s):[];return(0,u.jsxs)("span",{className:"inline-flex items-center justify-center gap-2",children:[(0,u.jsx)(Ht,{level:i,label:n&&i==="partial"?"Partial":"Supported"}),(0,u.jsx)(CF,{caveats:l,value:!n&&c.length>0?s:void 0})]})}case"number":return(0,u.jsx)("span",{className:"font-mono tabular-nums text-[12.5px]",children:typeof s=="number"?s.toFixed(2):String(s)});case"duration-ms":{const i=typeof s=="number"?s:Number(s);return Number.isFinite(i)?(0,u.jsxs)("span",{className:"font-mono tabular-nums text-[12.5px]",children:[i.toLocaleString()," ms"]}):(0,u.jsx)("span",{className:"text-[12px] text-muted-foreground/60",children:"—"})}case"enum":if(a.support){const i=Xn(e,t.config)??"neutral";return(0,u.jsx)(Ht,{level:i,label:String(s)})}return(0,u.jsx)("span",{className:q("text-[13px] text-foreground",r&&"break-words"),children:String(s)});case"mode-set":{const i=new Set(Array.isArray(s)?s:[]);return(0,u.jsx)("span",{className:"inline-flex flex-wrap items-center justify-center gap-1",children:a.modes.map(l=>(0,u.jsx)(Ht,{level:i.has(l)?"supported":"neutral",label:l},l))})}case"string":{const i=String(s);return i.length===0?(0,u.jsx)("span",{className:"text-[12px] text-muted-foreground/60",children:'""'}):(0,u.jsx)("span",{className:"font-mono text-[12px] break-all",children:i})}case"style-variable":{const i=s,l=e.label.startsWith("--color-");return"same"in i?(0,u.jsxs)("span",{className:"inline-flex max-w-full items-center justify-center gap-1.5",children:[l?(0,u.jsx)(Ph,{value:i.same}):null,(0,u.jsx)("span",{className:"min-w-0 font-mono text-[12px] break-all",children:i.same})]}):(0,u.jsx)("span",{className:"flex w-full flex-col gap-1.5",title:i.raw,children:["light","dark"].map(c=>(0,u.jsxs)("span",{className:"flex w-full flex-col items-center gap-0.5",children:[(0,u.jsx)("span",{className:"text-[10px] uppercase leading-none tracking-wide text-muted-foreground/60",children:c}),i[c]===void 0?(0,u.jsx)("span",{className:"text-[12px] text-muted-foreground/60",children:"—"}):(0,u.jsxs)("span",{className:"flex max-w-full items-center justify-center gap-1.5",children:[l?(0,u.jsx)(Ph,{value:i[c]}):null,(0,u.jsx)("span",{className:"min-w-0 font-mono text-[12px] break-all",children:i[c]})]})]},c))})}case"string-long":{const i=String(s),l=i.split(`
25
25
  `,1)[0]??"";return(0,u.jsxs)("div",{className:"flex flex-col items-center gap-0.5 text-center",children:[(0,u.jsx)("div",{className:"text-[12px] truncate max-w-[200px]",children:l||(0,u.jsx)("span",{className:"italic text-muted-foreground",children:"empty"})}),i.length>0&&(0,u.jsx)(Oh,{label:`view ${i.length.toLocaleString()} chars`,mobileOptimized:r,children:(0,u.jsx)("pre",{className:"whitespace-pre-wrap text-[11.5px] leading-snug font-mono max-w-[480px] max-h-[320px] overflow-auto",children:i})})]})}case"string-array":return Array.isArray(s)?s.length===0?(0,u.jsx)("span",{className:"text-[12px] text-muted-foreground/60",children:"[] empty"}):(0,u.jsx)("span",{className:q("text-[13px] leading-snug text-foreground",r&&"break-words"),children:s.join(", ")}):(0,u.jsx)("span",{className:"text-[12px] text-muted-foreground/60",children:"—"});case"object":{if(typeof s!="object"||s===null)return(0,u.jsx)("span",{className:"text-[12px] text-muted-foreground/60",children:"—"});const i=Object.entries(s);if(i.length===0)return(0,u.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:"{} empty"});const l=JSON.stringify(s);if(i.length>8||l.length>220){const c=a.itemNoun??"key";return(0,u.jsx)(Oh,{label:`${i.length} ${c}${i.length===1?"":"s"} ›`,mobileOptimized:r,children:(0,u.jsx)("pre",{className:"whitespace-pre-wrap text-[11.5px] leading-snug font-mono max-w-[480px] max-h-[320px] overflow-auto",children:JSON.stringify(s,null,2)})})}return(0,u.jsx)("div",{className:"flex flex-col items-center gap-0.5 text-center font-mono text-[11.5px] leading-snug",children:i.map(([c,p])=>(0,u.jsxs)("div",{className:"break-all",children:[(0,u.jsxs)("span",{className:"text-muted-foreground",children:[c,": "]}),(0,u.jsx)("span",{className:"text-foreground",children:TF(p)})]},c))})}}}function CF({caveats:e,value:t}){const r=e.length>0,n=t!==void 0;return!r&&!n?null:(0,u.jsxs)(to,{children:[(0,u.jsx)(ro,{asChild:!0,children:(0,u.jsx)("button",{type:"button","aria-label":"Capability details",className:"inline-flex size-4 shrink-0 items-center justify-center rounded-full text-muted-foreground/70 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",children:(0,u.jsx)(dg,{className:"size-3"})})}),(0,u.jsx)(no,{side:"top",variant:"muted",className:"max-w-[min(360px,calc(100vw-24px))] text-left [text-wrap:normal]",children:(0,u.jsxs)("div",{className:"space-y-2",children:[r?(0,u.jsx)("ul",{className:"space-y-1",children:e.map(o=>(0,u.jsx)("li",{children:o},o))}):null,n?(0,u.jsx)("pre",{className:"max-h-[240px] overflow-auto whitespace-pre-wrap font-mono text-[11px] leading-snug",children:JSON.stringify(t,null,2)}):null]})})]})}function RF({subject:e,onRemove:t,themeMode:r,verifyBaseUrl:n,disabledVerifyTemplateIds:o,linkName:s}){const a=pn(e.hostStyle,e.config.chatUiOverride,r),i=Lc(),l=nS(n,e.hostId,o),c="min-w-0 max-w-[160px] text-center text-[14px] font-medium leading-tight";return(0,u.jsxs)("th",{className:"sticky top-0 z-20 border-b border-l border-border bg-card px-3 py-3 text-center align-top sm:px-4 sm:py-4",children:[(0,u.jsxs)(Nr.div,{className:q("relative flex items-start justify-center gap-2",t&&"pl-5"),initial:i?!1:{opacity:0,x:-6},animate:{opacity:1,x:0},transition:{duration:.32,ease:[.22,1,.36,1]},children:[t?(0,u.jsx)(Nr.button,{type:"button","aria-label":`Remove ${e.hostName} from comparison`,"data-testid":`host-compare-remove-${e.hostId}`,className:"absolute left-0 top-0 inline-flex size-4 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",onClick:()=>t(e.hostId),whileHover:i?void 0:{scale:1.15},whileTap:i?void 0:{scale:.85,rotate:90},transition:{type:"spring",stiffness:520,damping:24},children:(0,u.jsx)(ri,{className:"size-3"})}):null,(0,u.jsx)("img",{src:a,alt:"",className:"mt-0.5 size-4 shrink-0 object-contain"}),s?(0,u.jsx)(Zb,{subject:e,href:l,className:c}):(0,u.jsx)("div",{className:q(c,"truncate"),title:e.hostName,children:e.hostName}),!s&&l?(0,u.jsxs)(to,{children:[(0,u.jsx)(ro,{asChild:!0,children:(0,u.jsx)("a",{href:l,"data-testid":`host-compare-verify-${e.hostId}`,"aria-label":`Verify ${e.hostName} against your server`,className:"mt-0.5 inline-flex size-4 shrink-0 items-center justify-center rounded-sm text-muted-foreground/70 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",children:(0,u.jsx)(cE,{className:"size-3.5"})})}),(0,u.jsx)(no,{side:"top",variant:"muted",children:"Verify against your server"})]}):null]},e.hostId),s&&(0,u.jsx)(eS,{subject:e})]})}function nS(e,t,r){if(!e)return null;if(!t.startsWith("preset:"))return e;const n=t.slice(cn.length);return r?.has(n)?null:`${e}/hosts?${xF(n,"behavior")}`}function TF(e){return typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e)}function Oh({label:e,children:t,mobileOptimized:r=!1}){const[n,o]=(0,f.useState)(!1);return(0,u.jsxs)(nd,{open:n,onOpenChange:o,children:[(0,u.jsx)(Bb,{asChild:!0,children:(0,u.jsx)("button",{type:"button",className:"text-center text-[11px] text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:e})}),(0,u.jsx)(od,{className:q("max-h-[400px] overflow-auto p-3",r?"max-w-[calc(100vw-24px)] sm:max-w-[520px]":"max-w-[520px]"),children:t})]})}var AF=[{level:"supported",title:"Supported"},{level:"partial",title:"Partial"},{level:"neutral",title:"Off / absent"}];function NF({subjects:e,fields:t=gn,divergingOnly:r=!1,supportFilter:n="all",searchQuery:o="",themeMode:s="light",mobileOptimized:a=!1}){const i=(0,f.useMemo)(()=>e.map(p=>p.config),[e]),l=(0,f.useMemo)(()=>Mb({fields:t,configs:i,divergingOnly:r,supportFilter:n,searchQuery:o}),[t,i,r,n,o]),c=(0,f.useMemo)(()=>t.filter(p=>l.has(p.id)&&As(p)),[t,l]);return e.length===0?(0,u.jsx)("div",{className:"flex h-full min-h-[200px] items-center justify-center text-sm text-muted-foreground",children:"No clients to compare. Create at least one client in this project."}):c.length===0?(0,u.jsx)("div",{className:"flex h-full min-h-[160px] items-center justify-center rounded-xl border border-border bg-card text-sm text-muted-foreground",children:"No capabilities match the current search and filters."}):(0,u.jsx)("div",{className:"grid gap-4",style:{gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 260px), 1fr))"},children:e.map(p=>(0,u.jsx)(PF,{subject:p,fields:c,themeMode:s,mobileOptimized:a},p.hostId))})}function PF({subject:e,fields:t,themeMode:r,mobileOptimized:n}){const o=pn(e.hostStyle,e.config.chatUiOverride,r),s=(0,f.useMemo)(()=>{const a={supported:[],partial:[],neutral:[],unsupported:[]};for(const i of t){const l=Xn(i,e.config);l&&a[l].push(i)}return a},[t,e.config]);return(0,u.jsxs)(Nr.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.32,ease:[.22,1,.36,1]},className:q("flex flex-col gap-4 rounded-xl border border-border bg-card p-4",n&&"min-w-0 overflow-hidden"),children:[(0,u.jsxs)("div",{className:"flex items-center gap-2 border-b border-border pb-3",children:[(0,u.jsx)("img",{src:o,alt:"",className:"size-4 shrink-0 object-contain"}),(0,u.jsx)("span",{className:"truncate text-[14px] font-medium",title:e.hostName,children:e.hostName})]}),AF.map(({level:a,title:i})=>{const l=s[a];return l.length===0?null:(0,u.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,u.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,u.jsx)("span",{className:"text-[11px] font-medium text-foreground",children:i}),(0,u.jsx)("span",{className:"text-[10.5px] tabular-nums text-muted-foreground",children:l.length})]}),(0,u.jsx)("div",{className:"flex flex-wrap gap-1.5",children:l.map(c=>(0,u.jsx)(Ht,{level:a,label:c.label,className:q(a==="neutral"&&"opacity-90"),truncateLabel:n},c.id))})]},a)})]})}var fd=f.forwardRef(({value:e,onValueChange:t,placeholder:r="Search…",className:n,clearable:o=!0,iconClassName:s,...a},i)=>(0,u.jsxs)("div",{className:q("relative",n),children:[(0,u.jsx)(nu,{className:q("absolute left-2.5 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground",s)}),(0,u.jsx)(Ky,{ref:i,value:e,onChange:l=>t(l.target.value),placeholder:r,type:"search",role:"searchbox","aria-label":r,autoComplete:"off",spellCheck:!1,className:"pl-7 pr-9 h-8 bg-background border-border hover:border-border/80 text-xs md:text-xs leading-4 text-foreground placeholder:text-muted-foreground/70 [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden w-full",...a}),o&&e&&(0,u.jsx)("button",{type:"button",onClick:()=>t(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors z-10 pointer-events-auto","aria-label":"Clear search",children:(0,u.jsx)(ri,{className:"h-3.5 w-3.5"})})]}));fd.displayName="SearchInput";var ya="hosts",Ec="capability",Ga="q",oS="(max-width: 640px)",Mi="h-8 rounded-full border-border bg-background px-3 text-[12px] font-medium text-foreground hover:border-border hover:bg-muted hover:text-foreground",MF=new Set(["modelId","systemPrompt","temperature"]);function OF(){return typeof window>"u"||typeof window.matchMedia!="function"?"table":window.matchMedia(oS).matches?"list":"table"}function jF(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}function jh(e){return e.trim().toLowerCase()}function LF(e,t){const r=jh(e);if(!r)return null;for(const n of t){const o=ed(n);if(!o)continue;const s=n.id.replace(/^capabilities\./,"");if([n.label,o.slug,n.id,s].map(jh).includes(r))return o}return null}function wc(e){const t=Hb(e.get(Ec));return t?t.field.label:e.get(Ga)??""}function sS(e,t,r){const n=t.trim();if(e.delete(Ec),e.delete(Ga),!n)return;const o=LF(n,r);if(o){e.set(Ec,o.slug);return}e.set(Ga,n)}function aS(e,t,r,n){const o=new URLSearchParams;e.length>0&&o.set(ya,e.join(",")),n?t&&o.set(Ga,t):sS(o,t,r);const s=o.toString();if(typeof window>"u")return s?`?${s}`:"";const{origin:a,pathname:i}=window.location;return`${a}${i}${s?`?${s}`:""}`}function iB({projectId:e,isAuthenticated:t,presetOnly:r=!1}){const n=!r&&t&&ud(e),{hosts:o,isLoading:s}=$D({isAuthenticated:n,projectId:e}),a=Vu(),i=r?a.catalog??jc():a.catalog,l=n?o:[],c=n?s:!1,p=r?"public":e??"",d=qa(F=>F.themeMode),h=$b("public-site-relays"),m=GD(),g=XD(),S=QD(),b=tF(),_=oF(),v=aF(),w=(0,f.useMemo)(()=>{if(r)return new Set;const F=O1({claudeCode:m,codex:g,copilotCli:S===!0,cursorCli:b,openCode:_,webClients:v});return F.delete("claude-code"),F.delete("codex"),F},[m,g,b,S,_,v,r]),E=r?lb:void 0,T=(0,f.useMemo)(()=>i?Qu(i,{excludedTemplateIds:w}):{hosts:[],subjects:{}},[i,w]),[I,C]=(0,f.useState)({}),L=(0,f.useMemo)(()=>{const F=td(T.hosts);if(r)return bh(F,I);const fe=bh([...l,...Dj(l,F,I)],I),ke=vm(fe.map($e=>({hostId:$e.hostId,name:$e.name,createdAt:Xu($e.hostId)?Number.MAX_SAFE_INTEGER:$e.createdAt})));return fe.map($e=>({...$e,displayName:ke.get($e.hostId)??$e.displayName}))},[l,r,T.hosts,I]),[y,A]=hu(),[N,W]=(0,f.useState)([]),[O,G]=(0,f.useState)(!1),[H,X]=(0,f.useState)("all"),[j,U]=(0,f.useState)(()=>wc(y)),[ee,V]=(0,f.useState)(()=>OF()),[ue,P]=(0,f.useState)(!1),$=(0,f.useRef)(!1),Y=j.trim().length>0,J=Y?H:"all",ae=(0,f.useRef)(!1),ie=(0,f.useMemo)(()=>l.map(F=>F.hostId),[l]),Se=(0,f.useMemo)(()=>T.hosts.map(F=>F.hostId),[T.hosts]),Oe=(0,f.useMemo)(()=>r?Se:ie,[ie,Se,r]),Xe=(0,f.useMemo)(()=>L.map(F=>F.hostId),[L]),Tt=(0,f.useMemo)(()=>r?Ni(T.subjects):JL(T.subjects),[r,T.subjects]),ho=(0,f.useMemo)(()=>{if(r)return Zh},[r]);(0,f.useEffect)(()=>{const F=wc(y);U(fe=>fe===F?fe:F)},[y]),(0,f.useEffect)(()=>{if(!r&&!e||c)return;const F=ae.current?null:kb(y.get(ya));ae.current=!0,W(fe=>{const ke=Wj({projectId:p,liveHostIds:Oe,knownHostIds:Xe,previousSelection:fe,urlSelection:F,remapSelection:$e=>Fj($e,l,I)});return jF(fe,ke)?fe:ke})},[Oe,Xe,c,l,r,e,y,p,I]),(0,f.useEffect)(()=>{!r&&!e||N.length!==0&&$j(p,N)},[r,e,p,N]),(0,f.useEffect)(()=>{if(!r&&!e||!ae.current||c||N.length===0)return;const F=new URLSearchParams(y);N.length===vc.length&&N.every((fe,ke)=>fe===vc[ke])?F.delete(ya):F.set(ya,N.join(",")),sS(F,j,Tt),F.toString()!==y.toString()&&A(F,{replace:!0})},[Tt,j,N,c,r,e,y,A]);const mo=(0,f.useCallback)((F,fe)=>{C(ke=>{const $e=ke[F];return $e&&$e.config===fe.config&&$e.hostName===fe.hostName?ke:{...ke,[F]:fe}})},[]);(0,f.useEffect)(()=>{if(c)return;const F=new Set(ie);C(fe=>{let ke=!1;const $e={};for(const[go,vo]of Object.entries(fe))F.has(go)?$e[go]=vo:ke=!0;return ke?$e:fe})},[ie,c]);const Le=(0,f.useMemo)(()=>new Set(N),[N]),rt=(0,f.useMemo)(()=>({...T.subjects,...I}),[T.subjects,I]),Dt=(0,f.useMemo)(()=>N.map(F=>rt[F]).filter(F=>F!==void 0),[N,rt]),nr=Dt.length,st=N.length,Wr=!c&&nr===st;(0,f.useEffect)(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const F=window.matchMedia(oS),fe=()=>{$.current||V(F.matches?"list":"table")};return fe(),typeof F.addEventListener=="function"?(F.addEventListener("change",fe),()=>F.removeEventListener("change",fe)):(F.addListener(fe),()=>F.removeListener(fe))},[]);const be=(0,f.useCallback)(F=>{W(fe=>Bj(fe,F))},[]),lt=(0,f.useCallback)(F=>{$.current=!0,F==="list"&&P(!1),V(F)},[]),ye=(0,f.useCallback)(F=>{P(F),F&&($.current=!0,V("table"))},[]),Ve=(0,f.useCallback)(()=>{U(""),X("all")},[]);return(0,f.useEffect)(()=>{Y||H==="all"||X("all")},[Y,H]),Ku({surfaceId:"host-compare",snapshot:()=>{const F=new Map(Dt.map(ke=>[ke.hostId,ke.hostName])),fe=new Map(L.map(ke=>[ke.hostId,en(ke)]));return gb({totalSelectableHosts:Xe.length,selectedHosts:N.map(ke=>({hostId:ke,hostName:F.get(ke)??fe.get(ke)??null})),capabilityFields:Tt,viewMode:ee,searchQuery:j,supportFilter:J,divergingOnly:O,loadedSelectedCount:nr,totalSelectedCount:st})}}),!r&&!e?(0,u.jsx)("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"Sign in to compare your clients."}):(0,u.jsxs)("div",{className:q("flex h-full min-h-0 flex-col bg-background",r&&"min-w-0 overflow-hidden"),children:[N.map(F=>{const fe=l.find(ke=>ke.hostId===F);return fe?(0,u.jsx)(FF,{hostId:fe.hostId,hostName:en(fe),hostConfigId:fe.hostConfigId,isAuthenticated:t,onLoaded:mo},fe.hostId):null}),(0,u.jsx)("div",{className:q(r?"flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden overflow-y-auto px-3 pb-3 pt-1 sm:px-4 sm:pb-4 sm:pt-2 md:px-6 md:pb-6 md:pt-2":"flex min-h-0 flex-1 flex-col overflow-auto p-4 md:p-8"),children:c?(0,u.jsx)(BF,{label:"Loading hosts…"}):L.length===0?(0,u.jsx)("div",{className:"rounded-xl border border-border bg-card p-10 text-center",children:(0,u.jsx)("p",{className:"text-sm text-muted-foreground",children:r?"No hosts are available in the live catalog.":"No hosts yet. Create one from the Host tab to populate the comparison."})}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)($F,{query:j,onQueryChange:U,fields:Tt,mobileOptimized:r,onReset:Ve,actions:r?(0,u.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-1.5",children:[h!==!1&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(lS,{}),(0,u.jsx)(iS,{})]}),(0,u.jsx)(cS,{selectedHostIds:N,searchQuery:j,fields:Tt}),(0,u.jsx)(DF,{})]}):void 0}),(0,u.jsx)(lF,{hosts:L,selectedHostIds:N,subjectsByHost:rt,onToggleHost:be,viewMode:ee,onViewModeChange:lt,filters:r?(0,u.jsx)(UF,{supportFilter:H,onSupportFilterChange:X,disabled:!Y}):void 0,divergingOnly:O,onDivergingOnlyChange:G,showDescriptions:ue,onShowDescriptionsChange:ye,descriptionsDisabled:ee==="list",disabled:c,themeMode:d,mobileOptimized:r}),st===0?(0,u.jsx)("div",{className:"rounded-xl border border-border bg-card p-10 text-center",children:(0,u.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select at least one client above to compare."})}):(0,u.jsxs)(u.Fragment,{children:[!Wr&&(0,u.jsxs)("div",{className:"mb-3 flex items-center gap-2 text-[11px] text-muted-foreground",children:[(0,u.jsx)(Ka,{className:"h-3 w-3 animate-spin"}),"Loading ",nr," / ",st," client configs…"]}),ee==="table"?(0,u.jsx)("div",{className:q("min-h-0 flex-1",r&&"min-h-[240px] sm:min-h-0"),children:(0,u.jsx)(rS,{subjects:Dt,fields:Tt,divergingOnly:O,supportFilter:J,searchQuery:j,showDescriptions:ue,themeMode:d,mobileOptimized:r,onRemoveHost:Le.size>1?be:void 0,verifyBaseUrl:ho,disabledVerifyTemplateIds:E})}):(0,u.jsx)(NF,{subjects:Dt,fields:Tt,divergingOnly:O,supportFilter:J,searchQuery:j,themeMode:d,mobileOptimized:r})]})]})})]})}function DF(){const e=qa(o=>o.themeMode),t=qa(o=>o.setThemeMode),r=e==="dark"?"light":"dark",n=`Switch to ${r} mode`;return(0,u.jsxs)(Ke,{type:"button",variant:"outline",size:"sm","aria-label":n,title:n,className:q("gap-1.5",Mi),onClick:()=>{sb(r),t(r)},children:[e==="dark"?(0,u.jsx)(lE,{className:"size-3.5"}):(0,u.jsx)(iE,{className:"size-3.5"}),(0,u.jsx)("span",{children:"Theme"})]})}function iS({footer:e=!1}){const[t,r]=(0,f.useState)(!1),[n,o]=(0,f.useState)(""),[s,a]=(0,f.useState)("idle"),i=n.trim(),l=(0,f.useCallback)(p=>{r(p),!p&&(o(""),a("idle"))},[]),c=(0,f.useCallback)(async p=>{if(p.preventDefault(),s!=="submitting"){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)){a("error");return}a("submitting");try{if(!(await fetch("/api/web/caniuse/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:i})})).ok)throw new Error("Subscribe failed");a("succeeded")}catch{a("error")}}},[s,i]);return(0,u.jsxs)(Rs,{open:t,onOpenChange:l,children:[(0,u.jsxs)(Ke,{type:"button",variant:e?"link":"outline",size:"sm","aria-label":"Notify me of client changes",title:"Notify me of client changes",className:e?"h-9 px-0 text-muted-foreground":q("gap-1.5",Mi),onClick:()=>r(!0),children:[!e&&(0,u.jsx)(rE,{className:"size-3.5"}),(0,u.jsx)("span",{children:e?"Notify Me":"Notify"})]}),(0,u.jsx)(Ts,{className:q("sm:max-w-[420px]",e&&"dark caniuse-dialog border-0 text-foreground"),children:s==="succeeded"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(os,{children:[(0,u.jsx)(ln,{children:"You're on the list."}),(0,u.jsx)(ss,{children:"We'll email you when hosts change."})]}),(0,u.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-emerald-600 dark:text-emerald-400",children:[(0,u.jsx)(xa,{className:"size-4 shrink-0"}),"Saved."]})]}):(0,u.jsxs)("form",{onSubmit:c,className:"space-y-3",noValidate:!0,children:[(0,u.jsxs)(os,{children:[(0,u.jsx)(ln,{children:"Stay up to date"}),(0,u.jsx)(ss,{children:"Get an email when a host adds or changes a capability."})]}),(0,u.jsxs)("div",{children:[(0,u.jsx)("input",{type:"email",value:n,onChange:p=>{o(p.target.value),s==="error"&&a("idle")},placeholder:"you@company.com","aria-label":"Email",autoFocus:!0,className:"h-9 w-full rounded-lg border border-border bg-background px-3 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-primary/40"}),s==="error"?(0,u.jsx)("p",{className:"mt-1 text-[11px] text-destructive",children:"Enter a valid email address."}):null]}),(0,u.jsx)(Ke,{type:"submit",size:"sm",disabled:s==="submitting",children:s==="submitting"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ka,{className:"size-4 animate-spin"}),"Sending"]}):"Notify me"})]})})]})}function lS({footer:e=!1}){const[t,r]=(0,f.useState)(!1),[n,o]=(0,f.useState)(""),[s,a]=(0,f.useState)("idle"),i=n.trim(),l=(0,f.useCallback)(p=>{r(p),!p&&(o(""),a("idle"))},[]),c=(0,f.useCallback)(async p=>{if(p.preventDefault(),!(!i||s==="submitting")){a("submitting");try{if(!(await fetch("/api/web/caniuse/report-inconsistency",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:i})})).ok)throw new Error("Report failed");a("succeeded")}catch{a("error")}}},[s,i]);return(0,u.jsxs)(Rs,{open:t,onOpenChange:l,children:[(0,u.jsxs)(Ke,{type:"button",variant:e?"link":"outline",size:"sm","aria-label":"Report inconsistency",title:"Report inconsistency",className:e?"h-9 px-0 text-muted-foreground":q("gap-1.5",Mi),onClick:()=>r(!0),children:[!e&&(0,u.jsx)(oE,{className:"size-3.5"}),(0,u.jsx)("span",{children:"Report"})]}),(0,u.jsx)(Ts,{className:q("sm:max-w-[440px]",e&&"dark caniuse-dialog border-0 text-foreground"),children:s==="succeeded"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(os,{children:[(0,u.jsx)(ln,{children:"Thanks for the heads up."}),(0,u.jsx)(ss,{children:"We've notified the MCPJam team."})]}),(0,u.jsx)(ch,{children:(0,u.jsx)(Ke,{type:"button",onClick:()=>l(!1),children:"Close"})})]}):(0,u.jsxs)("form",{onSubmit:c,className:e?"space-y-5":"space-y-4",children:[(0,u.jsxs)(os,{children:[(0,u.jsx)(ln,{children:"Report inconsistency"}),(0,u.jsx)(ss,{className:e?"sr-only":void 0,children:"Tell us what looks inconsistent."})]}),(0,u.jsxs)("div",{className:"grid gap-2",children:[(0,u.jsx)("label",{htmlFor:"caniuse-report-message",className:"text-sm font-medium text-foreground",children:"What looks inconsistent?"}),(0,u.jsx)(nD,{id:"caniuse-report-message",value:n,onChange:p=>{o(p.target.value),s==="error"&&a("idle")},placeholder:"Example: Claude supports this, but the table says it doesn't.",className:"min-h-[120px] resize-none",autoFocus:!0}),s==="error"?(0,u.jsx)("p",{className:"text-[12px] text-destructive",children:"Couldn't send report. Please try again."}):null]}),(0,u.jsxs)(ch,{children:[(0,u.jsx)(Ke,{type:"button",variant:"outline",onClick:()=>l(!1),disabled:s==="submitting",children:"Cancel"}),(0,u.jsx)(Ke,{type:"submit",disabled:!i||s==="submitting",children:s==="submitting"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ka,{className:"size-4 animate-spin"}),"Sending"]}):"Send report"})]})]})})]})}function FF({hostId:e,hostName:t,hostConfigId:r,isAuthenticated:n,onLoaded:o}){const{host:s}=WD({isAuthenticated:n,hostId:e});return(0,f.useEffect)(()=>{s&&o(e,{hostId:e,hostName:t,hostStyle:s.config.hostStyle,configHashShort:r.slice(-6),config:s.config})},[s,e,t,r,o]),null}var HF=[{value:"all",label:"All fields"},{value:"missing",label:"Missing"},{value:"partial",label:"Partial"},{value:"supported",label:"Full"}];function UF({supportFilter:e,onSupportFilterChange:t,disabled:r=!1}){return(0,u.jsxs)(d_,{children:[(0,u.jsx)(a_,{asChild:!0,children:(0,u.jsx)("button",{type:"button","aria-label":"Filter fields by support level",disabled:r,title:r?"Search first to filter":void 0,className:q("inline-flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:text-muted-foreground",!r&&e!=="all"&&"text-primary hover:text-primary"),children:(0,u.jsx)(aE,{className:"size-[18px]"})})}),(0,u.jsxs)(c_,{align:"end",className:"w-44 p-1",children:[(0,u.jsx)("div",{className:"px-2 pb-1 pt-1.5 text-[9.5px] font-bold uppercase tracking-wider text-muted-foreground/70",children:"Show"}),HF.map(n=>(0,u.jsxs)(i_,{"data-testid":`support-filter-${n.value}`,disabled:r,onClick:()=>{r||t(n.value)},className:"h-8 gap-2 rounded-md px-2 text-[12.5px]",children:[n.label,e===n.value?(0,u.jsx)(xa,{className:"ml-auto size-3.5 text-primary"}):null]},n.value))]})]})}function $F({query:e,onQueryChange:t,fields:r,mobileOptimized:n=!1,onReset:o,actions:s}){const[a,i]=(0,f.useState)(!1),l=(0,f.useRef)(null),c=qa(v=>v.themeMode)==="dark"?"/mcp_jam_dark.png":"/mcp_jam_light.png",p=(0,f.useMemo)(()=>Nb(r.filter(v=>!MF.has(v.id))),[r]),d=(0,f.useMemo)(()=>{const v=e.trim().toLowerCase();return p.map(w=>({...w,subsections:w.subsections.map(E=>({...E,fields:E.fields.filter(T=>Zu(T,v))})).filter(E=>E.fields.length>0)})).filter(w=>w.subsections.length>0)},[p,e]),h=(0,f.useCallback)(v=>{t(v.label),i(!1)},[t]),m=(0,f.useCallback)(()=>{i(!1),o?.()},[o]),g=e.trim().length>0,S=n?"shrink-0 cursor-pointer rounded-md border-0 bg-transparent p-0 text-[24px] font-semibold leading-none tracking-normal text-foreground transition-opacity hover:opacity-80 disabled:cursor-default disabled:opacity-100 disabled:hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40":"shrink-0 cursor-pointer rounded-md border-0 bg-transparent p-0 text-[15px] font-medium tracking-tight text-foreground transition-opacity hover:opacity-80 disabled:cursor-default disabled:opacity-100 disabled:hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",b=(0,f.useCallback)(v=>{const w=v.detail.originalEvent?.target??v.target;w&&l.current?.contains(w)&&v.preventDefault()},[]),_=(0,u.jsxs)(u.Fragment,{children:[o?(0,u.jsx)("button",{type:"button",className:S,"aria-label":"Show all clients and capabilities",disabled:!g,title:g?"Show all clients and capabilities":void 0,onClick:m,children:"Can I use…"}):(0,u.jsx)("span",{className:S,children:"Can I use…"}),(0,u.jsxs)(nd,{open:a,onOpenChange:i,children:[(0,u.jsx)(rD,{asChild:!0,children:(0,u.jsx)("div",{ref:l,className:q(n?"order-last w-full basis-full sm:order-none sm:min-w-[96px] sm:max-w-[420px] sm:flex-1 sm:basis-auto":"order-last w-full sm:order-none sm:w-auto sm:min-w-[240px] sm:flex-1"),children:n?(0,u.jsx)("input",{value:e,onChange:v=>{t(v.target.value),i(!0)},onFocus:()=>i(!0),placeholder:"Search capabilities, fields, descriptions…","aria-label":"Search client config fields",type:"search",autoComplete:"off",spellCheck:!1,className:"h-10 w-full border-0 border-b border-dotted border-muted-foreground/60 bg-transparent px-0 text-center text-sm text-foreground outline-none placeholder:text-center placeholder:text-muted-foreground/60 focus:border-foreground focus:ring-0 [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden"}):(0,u.jsx)(fd,{value:e,onValueChange:v=>{t(v),i(!0)},onFocus:()=>i(!0),placeholder:"Search capabilities, fields, descriptions…","aria-label":"Search client config fields",className:"w-full"})})}),(0,u.jsx)(od,{align:"start",className:"w-[var(--radix-popover-trigger-width)] p-0",onFocusOutside:b,onInteractOutside:b,onOpenAutoFocus:v=>v.preventDefault(),children:(0,u.jsx)(ad,{shouldFilter:!1,children:(0,u.jsxs)(id,{className:"max-h-[320px]",children:[(0,u.jsx)(ld,{children:"No matching fields."}),d.map(v=>(0,u.jsx)(Qb,{heading:v.section.label,children:v.subsections.map(w=>w.fields.map(E=>(0,u.jsx)(cd,{value:`${E.label} ${E.id} ${E.path} ${E.subsection} ${E.description??""}`,onSelect:()=>h(E),className:"items-start py-2",children:(0,u.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,u.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,u.jsx)("span",{className:"truncate text-[13px] font-medium",children:E.label}),(0,u.jsx)("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:w.label})]}),E.description?(0,u.jsx)("p",{className:"mt-0.5 line-clamp-2 text-[11px] leading-4 text-muted-foreground",children:E.description}):null]})},E.id)))},v.section.id))]})})})]}),n&&(0,u.jsx)("span",{className:"inline-flex shrink-0 items-center gap-2",children:(0,u.jsx)("span",{"aria-label":"Search MCP client capabilities across default clients",tabIndex:0,title:"Search MCP client capabilities across default clients",className:"text-[24px] font-semibold leading-none text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",children:"?"})})]});return(0,u.jsx)("div",{className:q("mb-4 flex flex-wrap items-center gap-3",n&&"@container min-w-0 items-center gap-2"),children:n?(0,u.jsxs)("div",{className:"flex basis-full flex-col items-center gap-2 pb-2 pt-1 @min-[900px]:grid @min-[900px]:grid-cols-[auto_minmax(0,1fr)_auto] @min-[900px]:items-center @min-[900px]:gap-4",children:[(0,u.jsx)("div",{className:"flex w-full min-w-0 flex-wrap items-center justify-center gap-2 sm:flex-nowrap @min-[900px]:col-start-2",children:_}),s?(0,u.jsx)("div",{className:"flex items-center justify-center gap-1.5 @min-[900px]:col-start-1 @min-[900px]:row-start-1 @min-[900px]:justify-self-start",children:s}):null,(0,u.jsxs)("a",{href:Zh,className:"inline-flex min-w-0 shrink-0 items-center gap-1.5 text-[11px] leading-none text-muted-foreground transition-opacity hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 @min-[900px]:col-start-3 @min-[900px]:row-start-1 @min-[900px]:justify-self-end","aria-label":"Open MCPJam",children:[(0,u.jsx)("span",{children:"Brought to you by"}),(0,u.jsx)("img",{src:c,alt:"MCPJam",className:"h-3.5 w-auto"})]})]}):_})}function cS({selectedHostIds:e,searchQuery:t,fields:r,preserveQuery:n=!1,copyOnShare:o=!1,iconOnly:s=!1}){const[a,i]=(0,f.useState)(!1),[l,c]=(0,f.useState)(!1),[p,d]=(0,f.useState)(!1),h=(0,f.useMemo)(()=>aS(e,t,r,n),[e,t,r,n]),m=(0,f.useCallback)(async()=>{try{await navigator.clipboard.writeText(h)}catch{console.debug("Comparison link clipboard write failed"),o&&i(!0);return}c(!0),window.setTimeout(()=>c(!1),2e3)},[o,h]),g=(0,u.jsxs)(Ke,{type:"button",variant:"outline",size:s?"icon":"sm","aria-label":o?"Copy comparison link":"Share",title:o?void 0:"Share",onClick:()=>o?void m():i(!0),className:q("gap-1.5",Mi,s&&"size-8 px-0"),children:[o&&l?(0,u.jsx)(xa,{className:"size-3.5"}):o?(0,u.jsx)(fg,{className:"size-3.5"}):(0,u.jsx)(vg,{className:"size-3.5"}),(0,u.jsx)("span",{"aria-live":"polite",className:s?"sr-only":void 0,children:o&&l?"Link copied":s?"":"Share"})]});return(0,u.jsxs)(Rs,{open:a,onOpenChange:i,children:[o?(0,u.jsxs)(to,{open:!a&&(l||p),onOpenChange:d,children:[(0,u.jsx)(ro,{asChild:!0,children:g}),(0,u.jsx)(no,{side:"top",sideOffset:6,variant:"muted",className:"dark",children:l?"Link copied":"Copy a link to this exact comparison"})]}):g,(0,u.jsxs)(Ts,{className:q("sm:max-w-[460px]",o&&"dark caniuse-dialog border-0 text-foreground"),children:[(0,u.jsxs)(os,{children:[(0,u.jsx)(ln,{children:"Share this comparison"}),(0,u.jsx)(ss,{children:"Anyone with this link will see the same comparison you're looking at."})]}),(0,u.jsx)("div",{className:"space-y-3",children:(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[(0,u.jsx)("input",{readOnly:!0,value:h,onFocus:S=>S.currentTarget.select(),"aria-label":"Shareable link",className:"min-w-0 flex-1 rounded-lg border border-border bg-background px-3 py-2 font-mono text-[11.5px] text-muted-foreground"}),(0,u.jsx)(Ke,{type:"button",onClick:m,className:"gap-2",children:l?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(xa,{className:"size-4"}),"Copied"]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(l_,{className:"size-4"}),"Copy"]})})]})})]})]})}function BF({label:e}){return(0,u.jsxs)("div",{className:"flex h-full min-h-[200px] items-center justify-center text-sm text-muted-foreground",children:[(0,u.jsx)(Ka,{className:"h-4 w-4 mr-2 animate-spin"}),e]})}var zF="/capabilities/client-version";function WF(e=window.location.hostname){return JS(e)?"/":_a.caniuseCompare}function Qn(e){return pn(e.hostStyle,e.config.chatUiOverride,"dark")}function uS({current:e,children:t}){const r=$b("public-site-relays"),n=(0,f.useRef)(null),{pathname:o}=vt();return(0,f.useEffect)(()=>{n.current&&(n.current.scrollTop=0)},[o]),(0,u.jsxs)("div",{ref:n,className:"dark caniuse-site flex h-full min-w-0 flex-col overflow-auto bg-background text-foreground","data-page":e,children:[(0,u.jsx)("header",{className:"shrink-0 border-b border-border/65 bg-inherit",children:(0,u.jsxs)("div",{className:"caniuse-wrap flex h-16 items-center gap-5 sm:gap-8",children:[(0,u.jsx)("a",{className:"caniuse-brand rounded-md focus-visible:outline-2 focus-visible:outline-ring",href:"https://www.mcpjam.com/","aria-label":"MCPJam",children:(0,u.jsx)("img",{alt:"",src:"/caniuse-jar.webp",width:"36",height:"40",className:"h-10 w-9 object-contain"})}),(0,u.jsxs)("nav",{"aria-label":"Can I use MCP",className:"flex h-full items-stretch gap-5 text-sm sm:gap-7",children:[(0,u.jsx)(on,{to:WF(),"aria-current":e==="compare"?"page":void 0,className:"caniuse-nav-link",children:"Compare"}),(0,u.jsx)(on,{to:zF,"aria-current":e==="capabilities"?"page":void 0,className:"caniuse-nav-link",children:"Capabilities"})]})]})}),(0,u.jsx)("main",{className:"caniuse-wrap grow shrink-0 pb-10",children:t}),(0,u.jsx)("footer",{className:"shrink-0 border-t border-border/65 bg-inherit text-muted-foreground",children:(0,u.jsxs)("div",{className:"caniuse-wrap flex min-h-16 flex-wrap items-center gap-x-4 gap-y-2 py-3",children:[r!==!1&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(lS,{footer:!0}),(0,u.jsx)(iS,{footer:!0})]}),(0,u.jsxs)("a",{href:"https://www.mcpjam.com/","aria-label":"By MCPJam",className:"ml-auto inline-flex items-center gap-1.5 rounded-sm text-sm hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",children:[(0,u.jsx)("span",{children:"By"}),(0,u.jsx)("img",{src:"/mcp_jam_dark.png",alt:"",width:"84",height:"14"})]})]})})]})}var kl=[{name:"elicitation",clients:["preset:claude","preset:cursor"]},{name:"MCP Apps",clients:["preset:chatgpt","preset:claude"]},{name:"Events",clients:["preset:codex","preset:chatgpt"]}],Lh=!1;function qF({eligible:e,subjects:t,children:r}){const n=Lc(),[o,s]=(0,f.useState)(()=>e&&!Lh?0:null),a=ZL(e&&!n&&o!==null),i=o===kl.length,l=a.open&&o!==null?kl[Math.min(o,kl.length-1)]:null;return(0,f.useEffect)(()=>{if(!a.open||o===null||i)return;Lh=!0;const c=window.setTimeout(()=>s(o+1),1400);return()=>window.clearTimeout(c)},[a.open,o,i]),(0,u.jsxs)("div",{className:"relative h-full min-w-0",onFocusCapture:()=>s(null),children:[r,l&&(0,u.jsx)("div",{ref:a.contentRef,"aria-hidden":"true",className:"caniuse-intro absolute inset-0 z-[60]","data-leaving":i||void 0,onPointerDown:()=>s(null),onAnimationEnd:c=>{i&&c.target===c.currentTarget&&s(null)},children:(0,u.jsx)("div",{className:"caniuse-wrap pt-24 sm:pt-36",children:(0,u.jsxs)("div",{className:"caniuse-hero flex flex-wrap items-baseline gap-x-[0.23em] gap-y-1 font-bold",children:[(0,u.jsx)("span",{className:"caniuse-reveal",children:"Can I use"}),(0,u.jsxs)("span",{className:"caniuse-prompt inline-flex min-w-0 flex-wrap items-center gap-x-[0.21em] gap-y-1",children:[(0,u.jsx)("span",{className:"text-primary",children:l.name})," in",l.clients.map(c=>{const p=t[c];return p&&(0,u.jsx)("img",{src:Qn(p),alt:"",className:"size-11 rounded-lg border border-border bg-card p-1.5 object-contain sm:size-14"},c)}),"?"]},l.name)]})})})]})}var VF="preset:mcpjam",hd="supportedProtocolVersions",dS="eventsDeliveryModes";function pS(e,t){if(e.kind.kind==="mode-set")return["any",...e.kind.modes];if(e.id!==hd)return[];const r=t.flatMap(({config:n})=>{const o=e.read(n);return Array.isArray(o)?o.filter(s=>typeof s=="string"):[]});return[...new Set(r)].sort().reverse()}function md(e){return e==="any"?"Any mode":e}function fS(e,t,r){const n=e.id===dS?r||"any":null,o=e.id==="clientInfo.version"||e.id.startsWith("styles.");return{rows:t.map(s=>{const a=e.read(s.config);return o?{subject:s,status:a===br?"unsupported":a!=null&&a!==""?"supported":"unknown"}:e.id===hd||n!==null||e.kind.kind==="mode-set"&&r&&r!=="any"?{subject:s,status:Array.isArray(a)?(r&&r!=="any"?a.includes(r):a.length>0)?"supported":"unsupported":a===br?"unsupported":"unknown"}:{subject:s,status:XL(e,s.config)}}),reporting:o,eventsMode:n}}function kc(e,t,r){const n=fS(e,t.filter(({hostId:d})=>d!==VF),r),{reporting:o,eventsMode:s}=n,a=n.rows.map(({subject:d,status:h})=>({subject:d,status:h==="neutral"?"unsupported":h})),i=a.filter(({subject:d})=>d.config.provenance==="probe"),l=i.length,c=i.filter(({status:d})=>d==="supported").length,p=i.filter(({status:d})=>d!=="unknown").length;return{rows:a,probedRows:i,full:c,probed:l,published:p,unpublished:l-p,reporting:o,eventsMode:s,score:p?Math.round(c/l*100):null}}function gd({full:e,probed:t,eventsMode:r}){return`${e} of ${t} probed clients have confirmed support for ${r==="any"?"at least one delivery mode":`${r} delivery`}.`}function mr(e){return e.id===hd?"Protocol versions":e.id===dS?"MCP Events":e.id==="capabilities.uiExtension"?"MCP Apps":e.label}function gr(e){const t=e.hostId.replace(/^preset:/,""),r=t.startsWith("chatgpt")?"chatgpt":t.startsWith("claude-code")?"claude-code":t.startsWith("claude")?"claude":t.startsWith("codex")?"codex":t.startsWith("cursor")?"cursor":t,n=t.endsWith("-cli")||t==="claude-code"||t==="opencode",o=t.includes("-desktop")||t==="goose",s=!n&&!o&&["claude","claude-code","chatgpt","codex","gemini","mistral"].includes(r),a=["cursor","vscode","cline","copilot"].includes(t);return{surface:n?"CLI":o?"Desktop":s?"Web":a?"IDE":"Apps & platforms",family:r,mode:r==="chatgpt"?t.includes("-work")?"Work":"Chat":r==="claude-code"?"Code":r==="claude"?"Chat":""}}function hS(e){const t=["Web","Desktop","IDE","CLI","Apps & platforms"];return[...e].sort((r,n)=>{const o=gr(r),s=gr(n);return t.indexOf(o.surface)-t.indexOf(s.surface)||o.family.localeCompare(s.family)||o.mode.localeCompare(s.mode)})}function mS(e,t){return Zu(e,t)||mr(e).toLowerCase().includes(t.trim().toLowerCase())}function gS({fields:e,query:t,onQueryChange:r,hero:n=!1}){const[o,s]=(0,f.useState)(!1),[a,i]=(0,f.useState)(0),l=(0,f.useRef)(null),c=(0,f.useId)(),p=n?"Type a capability":"Search capabilities",d=e.filter(v=>mS(v,t)).slice(0,12),h=o&&d.length>0,m=Math.min(a,d.length-1),g=v=>`${c}-${v}`;(0,f.useLayoutEffect)(()=>{h&&l.current&&(l.current.scrollTop=0)},[h,t]);function S(){i(0),s(!0)}function b(v){r(mr(v)),s(!1)}function _(v){if(!v.nativeEvent.isComposing){if(v.key==="Escape"&&o)v.preventDefault(),s(!1);else if(v.key==="Enter"&&h)v.preventDefault(),b(d[m]);else if((v.key==="ArrowDown"||v.key==="ArrowUp")&&d.length>0){if(v.preventDefault(),!h){S();return}const w=v.key==="ArrowDown"?1:-1,E=Math.max(0,Math.min(m+w,d.length-1));i(E),document.getElementById(g(E))?.scrollIntoView({block:"nearest"})}}}return(0,u.jsxs)("div",{className:q("relative flex w-full flex-col rounded-md",n?"min-w-0 max-w-[13em] shrink grow basis-[9em] bg-transparent":"min-w-28 flex-1 basis-full border border-border bg-background sm:basis-40"),onBlur:v=>{v.currentTarget.contains(v.relatedTarget)||s(!1)},children:[(0,u.jsxs)("div",{className:q("flex items-center gap-2",n?"border-b border-primary/40":"h-9 px-3"),children:[!n&&(0,u.jsx)(nu,{"aria-hidden":"true",className:"size-4 shrink-0 opacity-50"}),(0,u.jsx)("input",{type:"text",role:"combobox","aria-label":p,"aria-autocomplete":"list","aria-expanded":h,"aria-controls":c,"aria-activedescendant":h?g(m):void 0,autoComplete:"off",autoCorrect:"off",spellCheck:!1,placeholder:n?"type a capability…":"Search capabilities…",className:q("flex w-full bg-transparent outline-hidden placeholder:text-muted-foreground",n?"pb-1 text-[length:inherit] font-[weight:inherit] leading-[inherit] tracking-[inherit] text-primary":"h-10 rounded-md py-3 text-sm"),value:t,onFocus:S,onClick:()=>{o||S()},onChange:v=>{r(v.target.value),S()},onKeyDown:_})]}),(0,u.jsx)("div",{ref:l,id:c,role:"listbox","aria-label":p,hidden:!h,className:"absolute inset-x-0 top-full z-40 mt-2 max-h-64 overflow-y-auto rounded-lg border border-border bg-popover p-1 text-sm font-normal tracking-normal text-popover-foreground shadow-md",onMouseDown:v=>v.preventDefault(),children:d.map((v,w)=>(0,u.jsxs)("button",{id:g(w),type:"button",role:"option",tabIndex:-1,"aria-selected":w===m,className:"flex w-full flex-col items-start gap-0.5 rounded-sm px-2 py-1.5 text-left aria-selected:bg-accent aria-selected:text-accent-foreground",onPointerMove:E=>{E.pointerType==="mouse"&&i(w)},onClick:()=>b(v),children:[(0,u.jsxs)("span",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[(0,u.jsx)("span",{className:"font-semibold",children:mr(v)}),(0,u.jsx)("span",{className:"text-[11px] text-muted-foreground",children:v.subsection})]}),v.description&&(0,u.jsx)("span",{className:"text-xs text-muted-foreground",children:v.description})]},v.id))})]})}function GF(e,t,r,n){const o=n.trim();return e.flatMap(s=>{const a=mS(s,n);if(s!==t||r.length===0)return a?[{...s,label:mr(s)}]:[];const i=r.map(({slice:l})=>l).filter(l=>a||l.includes(o));return(a?[void 0,...i]:i).map(l=>({...s,id:l?`${s.id}:${l}`:s.id,label:l??mr(s),description:l?void 0:s.description,kind:{kind:"boolean"},read:c=>{const p=s.read(c);return Array.isArray(p)?l?p.includes(l):p.length>0:p===br?!1:void 0}}))})}function YF(e,t){return new Map(e.map(r=>[r.id,{overall:kc(r,t),slices:pS(r,t).filter(n=>n!=="any").map(n=>({slice:n,coverage:kc(r,t,n)}))}]))}function JF(e,t){const r=t?e.get(t.id)?.slices??[]:[],n=new Map(r.map(s=>[`supportedProtocolVersions:${s.slice}`,s]));function o(s){const a=n.get(s.id),i=ed(a&&t?t:s);if(!i)return null;const l=is(i.slug);return a?`${l}?slice=${encodeURIComponent(a.slice)}`:l}return{label:"Client adoption",renderFieldLabel:s=>{const a=o(s);return a&&(0,u.jsxs)(on,{to:a,className:"rounded-sm hover:text-primary hover:underline focus-visible:outline-2 focus-visible:outline-ring",children:[s.label," ",(0,u.jsx)(og,{"aria-hidden":!0,className:"inline size-3 text-muted-foreground"})]})},render:s=>{const a=n.get(s.id),i=o(s);if(!i)return null;const l=a?.coverage??e.get(s.id)?.overall;return l&&(0,u.jsx)(Dh,{path:i,coverage:l})},renderSlices:s=>{if(s.id===t?.id)return null;const a=e.get(s.id)?.slices;if(!a?.length)return null;const i=o(s);return i&&a.map(({slice:l,coverage:c})=>(0,u.jsx)(Dh,{path:`${i}?slice=${encodeURIComponent(l)}`,coverage:c,label:md(l)},l))}}}function Dh({path:e,coverage:t,label:r}){const{full:n,probed:o,unpublished:s,reporting:a,eventsMode:i,score:l}=t,c=l===null?"No results":`${l}%`,p=l===null?"No results published yet":i?gd(t):`${n} of ${o} probed clients ${a?"reported a value":"have confirmed support"}`,d=s?`${s} with no published result`:null,h=[l===null?p:`${c}, ${p}`,d].filter(Boolean).join(", ");return(0,u.jsxs)(on,{to:e,"aria-label":r?`${r}: ${h}`:h,className:"w-fit rounded-sm text-xs text-muted-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring",title:[p,d].filter(Boolean).join(" "),children:[r&&(0,u.jsx)("span",{className:"block font-medium capitalize [overflow-wrap:anywhere]",children:r}),(0,u.jsxs)("span",{className:l===null?void 0:r?"text-sm font-bold text-primary":"text-base font-bold leading-tight text-primary",children:[c,a&&l!==null&&(0,u.jsx)("span",{className:"ml-1 text-xs font-medium",children:"reported"})]}),l!==null&&(0,u.jsxs)("span",{className:"ml-1 inline-block",children:[n,"/",o]}),!r&&d&&(0,u.jsx)("span",{className:"block",children:d})]})}function KF({clients:e,selected:t,onChange:r}){const[n,o]=(0,f.useState)(null),s=(0,f.useId)(),a=(0,f.useRef)(null),i=t.map(({hostId:d})=>d),l=e.some(({hostId:d})=>!i.includes(d)),c=new Map;for(const d of hS(e)){const{surface:h}=gr(d),m=c.get(h)??[];m.push(d),c.set(h,m)}function p(d){if(d===n){o(null);return}r(n==="add"?[...i,d]:i.map(h=>h===n?d:h)),o(null)}return(0,u.jsxs)(Rs,{open:n!==null,onOpenChange:d=>{d||o(null)},children:[(0,u.jsxs)("div",{className:"mb-4 grid grid-cols-2 items-stretch gap-2 md:mb-5 md:flex md:min-h-[57px]",children:[t.length>0&&(0,u.jsx)("div",{className:"caniuse-client-strip contents md:flex md:min-w-0 md:flex-1 md:gap-2 md:overflow-x-auto md:rounded-md",children:t.map(d=>{const h=gr(d),m=Number.isFinite(d.verifiedAt)?`${s}-verified-${d.hostId}`:void 0;return(0,u.jsxs)("div",{className:"flex min-h-16 min-w-0 items-center rounded-lg border border-border bg-card text-card-foreground md:min-h-0 md:min-w-44 md:flex-1 md:shrink-0",children:[(0,u.jsxs)(Ke,{variant:"ghost",disabled:!l,className:"h-full min-w-0 flex-1 justify-start gap-1.5 px-2 py-1 text-left text-[13px] leading-[1.35] md:gap-2 md:px-2.5 md:py-2",onClick:g=>{a.current=g.currentTarget,o(d.hostId)},"aria-label":`Replace ${d.hostName}`,"aria-describedby":m,children:[(0,u.jsx)("img",{src:Qn(d),alt:"",className:"hidden size-5 shrink-0 rounded object-contain min-[360px]:block md:size-7"}),(0,u.jsxs)("span",{className:"min-w-0 flex-1 font-semibold",children:[(0,u.jsx)("span",{className:"block whitespace-normal wrap-break-word",title:d.hostName,children:h.family==="chatgpt"&&d.hostName.endsWith(" Desktop")?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("span",{className:"md:hidden",children:d.hostName.slice(0,-8)}),(0,u.jsx)("span",{className:"hidden md:inline",children:d.hostName})]}):d.hostName}),(0,u.jsx)("span",{className:"block text-[11px] font-medium text-muted-foreground md:inline md:rounded md:bg-muted md:px-1",children:h.surface}),(0,u.jsx)(eS,{id:m,subject:d,compact:!0,className:"mt-0 whitespace-nowrap md:hidden"})]}),(0,u.jsx)($c,{className:"hidden size-3.5 shrink-0 text-muted-foreground md:block"})]}),(0,u.jsx)(Ke,{variant:"ghost",size:"icon",className:"h-full w-8 shrink-0 text-muted-foreground md:mr-1 md:size-8","aria-label":`Remove ${d.hostName}`,onClick:()=>r(i.filter(g=>g!==d.hostId)),children:(0,u.jsx)(ri,{className:"size-3.5"})})]},d.hostId)})}),(0,u.jsx)(ab,{asChild:!0,children:(0,u.jsxs)(Ke,{disabled:!l,onClick:()=>{a.current=null,o("add")},className:"h-auto min-h-16 shrink-0 px-3 text-[13px] font-bold md:min-h-0 md:px-4",children:[(0,u.jsx)(f_,{className:"size-4"})," Add client"]})})]}),(0,u.jsxs)(Ts,{className:"dark caniuse-dialog gap-4 border-0 text-foreground","aria-describedby":void 0,onCloseAutoFocus:d=>{a.current?.isConnected&&(d.preventDefault(),a.current.focus())},children:[(0,u.jsx)(ln,{children:n==="add"?"Add client":"Replace client"}),(0,u.jsxs)(ad,{className:"bg-transparent text-foreground",children:[(0,u.jsx)(Xb,{placeholder:"Search clients or surfaces"}),(0,u.jsxs)(id,{className:"scroll-fade-y max-h-[min(360px,55dvh)] scroll-py-5 [--scroll-fade-reveal:24px] [--scroll-fade-size:16px]",children:[(0,u.jsx)(ld,{children:"No matching clients."}),[...c].map(([d,h])=>(0,u.jsx)(Qb,{heading:d,children:h.map(m=>{const g=n===m.hostId?"Current":i.includes(m.hostId)?"Comparing":null;return(0,u.jsxs)(cd,{value:m.hostId,keywords:[m.hostName,d,gr(m).mode],onSelect:()=>p(m.hostId),disabled:g==="Comparing",className:"gap-3 py-2 data-[disabled=true]:opacity-60",children:[(0,u.jsx)("img",{src:Qn(m),alt:"",className:"size-9 shrink-0 rounded-md border border-border bg-card object-contain p-1"}),(0,u.jsx)("span",{className:"min-w-0 flex-1 font-semibold",children:m.hostName}),g&&(0,u.jsx)("span",{className:"rounded-md border border-border px-1.5 py-0.5 text-xs text-muted-foreground",children:g})]},m.hostId)})},d))]})]})]})]})}var XF=[{status:"supported",title:"Supported",tint:"bg-success/15",token:"--success"},{status:"partial",title:"Partial support",tint:"bg-warning/15",token:"--warning"},{status:"unsupported",title:"Not supported",tint:"bg-destructive/15",token:"--destructive"},{status:"unknown",title:"No result",tint:"bg-muted",token:"--muted"}];function vS(e,t=e.rows){return XF.map(r=>({...r,title:r.status==="supported"?bS(e):e.reporting&&r.status==="unsupported"?"Not reported":r.title,clients:hS(t.filter(({status:n})=>n===r.status).map(({subject:n})=>n))}))}function yS(e,t){const{family:r,surface:n,mode:o}=gr(e);return t.rows.some(({subject:s})=>s.hostId!==e.hostId&&gr(s).family===r)?[n,o].filter(Boolean):[]}function QF({coverage:e}){const[t,r]=(0,f.useState)(null),n=(0,f.useRef)(!1);return(0,u.jsx)("div",{className:"grid gap-3",children:vS(e).filter(({clients:o})=>o.length>0).map(({status:o,title:s,tint:a,clients:i})=>(0,u.jsxs)("section",{"aria-label":s,className:q("caniuse-map-group grid items-start gap-2.5 rounded-lg border border-border/75 p-3 sm:grid-cols-[8rem_minmax(0,1fr)] sm:gap-4",a),children:[(0,u.jsxs)("h3",{className:"grid gap-1 text-xs font-semibold",children:[(0,u.jsx)("span",{className:"text-2xl font-bold leading-none tabular-nums",children:i.length})," ",s]}),(0,u.jsx)("ul",{className:"flex flex-wrap gap-1.5",children:i.map(l=>{const c=yS(l,e),p=l.verifiedAt?`Last checked ${za(l.verifiedAt)}`:"No verification date";return(0,u.jsx)("li",{children:(0,u.jsxs)(to,{open:t===l.hostId,onOpenChange:d=>r(h=>d?l.hostId:h===l.hostId?null:h),children:[(0,u.jsx)(ro,{asChild:!0,children:(0,u.jsxs)("div",{role:"img",tabIndex:0,onPointerDownCapture:d=>{d.pointerType==="touch"&&(n.current=t===l.hostId)},onClick:d=>{const h=d.nativeEvent;"pointerType"in h&&h.pointerType==="touch"&&(d.preventDefault(),r(n.current?null:l.hostId))},"aria-label":`${l.hostName}. ${p}`,className:"flex h-14 min-w-14 flex-col items-center justify-center gap-1 rounded-md border border-border bg-card px-1 text-card-foreground focus-visible:outline-2 focus-visible:outline-ring",children:[(0,u.jsx)("img",{src:Qn(l),alt:"",className:"size-6 rounded object-contain",loading:"lazy"}),c.length>0&&(0,u.jsx)("span",{"aria-hidden":"true",className:"flex gap-0.5 text-[9px] font-semibold leading-tight",children:c.map((d,h)=>(0,u.jsx)("span",{className:h?"rounded bg-accent px-1 text-accent-foreground":"rounded bg-muted px-1 text-muted-foreground",children:d},d))})]})}),(0,u.jsxs)(no,{variant:"muted",className:"dark caniuse-client-tooltip",sideOffset:6,children:[(0,u.jsx)("span",{className:"block font-semibold",children:l.hostName}),(0,u.jsx)("span",{className:"block",children:p})]})]})},l.hostId)})})]},o))})}function ZF(e,t,r){return e==="supported"&&(r.reporting||r.eventsMode==="any")?bS(r):r.reporting&&e==="unsupported"?"Not reported":rd(e,t)}function bS(e){return e.reporting?"Reported":e.eventsMode==="any"?"Supports at least one delivery mode":"Supported"}var Ic=1200;var Cc=1152;function eH(e,t,r,n=0){if(r(e)<=t)return e;let o=e;if(r(e.slice(0,n+1)+"…")>t&&(o="…"+e.slice(Math.max(0,n-4)),r(o)<=t))return o;do o=o.slice(0,-1);while(o&&r(o+"…")>t);return o+"…"}async function tH(e){const t=new Image;t.src=e;try{return await t.decode(),t}catch{return null}}async function SS(e,t,r){const n=e.getContext("2d");if(!n)throw new Error("Couldn't create the share image. Try again.");const o=n,s=[...new Set(["/caniuse-jar.webp","/mcp_jam_dark.png",...t.map(Qn)])],[a]=await Promise.all([Promise.all(s.map(async b=>[b,await tH(b)])),Promise.allSettled([document.fonts.load?.('700 32px "Caniuse Instrument Sans"')]),document.fonts.ready]);if(r.aborted)return null;const i=new Map(a),l=getComputedStyle(e),c=b=>l.getPropertyValue(b).trim();function p(b,_,v,w,E,T,I){o.beginPath(),o.roundRect(b,_,v,w,E),o.fillStyle=c(T),o.fill(),I&&(o.strokeStyle=c(I),o.stroke())}function d(b,_,v,w,E=600,T="--foreground"){o.font=`${E} ${w}px "Caniuse Instrument Sans", sans-serif`,o.fillStyle=c(T),o.fillText(b,_,v)}function h(b,_,v,w,E,T=600,I="--foreground",C=0){o.font=`${T} ${E}px "Caniuse Instrument Sans", sans-serif`,d(eH(b,w,L=>o.measureText(L).width,C),_,v,E,T,I)}function m(b,_,v,w,E){const T=i.get(b);if(!T||!T.naturalWidth||!T.naturalHeight)return;const I=Math.min(w/T.naturalWidth,E/T.naturalHeight),C=T.naturalWidth*I,L=T.naturalHeight*I;o.drawImage(T,_+(w-C)/2,v+(E-L)/2,C,L)}function g(b){p(48,b,1104,1,0,"--border")}p(0,0,Ic,630,0,"--background");const S=o.createRadialGradient(152,310,0,152,310,520);return S.addColorStop(0,c("--primary")),S.addColorStop(1,"transparent"),o.fillStyle=S,o.globalAlpha=.2,o.fillRect(0,0,Ic,630),o.globalAlpha=1,m("/caniuse-jar.webp",48,39,31,36),d("caniuse.dev",89,69,30,700),g(91),g(549),m("/mcp_jam_dark.png",1005,564,147,32),{ctx:o,text:d,fit:h,rect:p,divider:g,clientImage:(b,_,v,w)=>m(Qn(b),_,v,w,w)}}function Fh(e,t,r){if(t(e)<=r)return[e];const n=e.split(" ");let o=[e],s=t(e);for(let a=1;a<n.length;a++){const i=[n.slice(0,a).join(" "),n.slice(a).join(" ")],l=Math.max(...i.map(t));l<s&&(o=i,s=l)}return o}async function rH(e,t,r,n,o,s=""){const[a,i,l]=vS(n,n.probedRows),c=a.clients.length?a:i.clients.length?i:l,p=c.clients.slice(0,c.clients.length>4?3:4),d=await SS(e,p,o);if(!d)return;const{ctx:h,text:m,fit:g,rect:S,clientImage:b}=d,_="--muted-foreground",v=532;r&&(h.textAlign="right",m(r,Cc,69,24,500,_),h.textAlign="left"),h.font='700 72px "Caniuse Instrument Sans", sans-serif';const w=Fh(t,T=>h.measureText(T).width,v);let E=w.length===1?196:168;for(const T of w)g(T,48,E,v,w.length===1?72:55,700),E+=56;if(n.score===null)m("No published client results yet.",48,325,30,600,_);else{const T=n.reporting?"Reporting coverage":"Client adoption",I=n.reporting?"report a value":n.eventsMode==="any"?"support a delivery mode":n.eventsMode?`support ${n.eventsMode} delivery`:"fully support this capability",C=`${n.full} of ${n.probed} probed clients`;m(T,48,E,27,650),m(`${n.score}%`,48,415,181,700,"--primary"),m(C,48,468,33,700),m(I,48,506,32,500,_)}if(p.length){S(615,161,Cc-615,321,22,"--background","--border");const I=c===a?n.reporting?"Clients reporting a value":"Clients with support":c.title;S(639,185,318,42,21,"--card","--border"),m(I,659,214,25,700,c.token);const C=c.clients.length-p.length;for(let L=0;L<p.length+ +(C>0);L++){const y=639+L%2*249,A=245+Math.floor(L/2)*111;S(y,A,237,99,15,"--card","--border");const N=p[L];if(!N){m(`+${C} more`,y+19,A+58,26,700);continue}b(N,y+12,A+27,44);const W=yS(N,n),O=gr(N).family==="chatgpt"?"ChatGPT":N.hostName;h.font='700 24px "Caniuse Instrument Sans", sans-serif';const G=Fh(O,X=>h.measureText(X).width,157),H=G.length===2?29:W.length?42:59;G.forEach((X,j)=>{g(X,y+68,A+H+j*23,157,24,700)}),W.length&&g(W.join(" · "),y+68,A+77,157,20,500,_)}}m(n.unpublished?`${n.unpublished} without a published result`:`Results for all ${n.probed} probed clients`,48,589,22,500,_),g(s,578,589,407,22,650,_)}function nH(e,t){const r=new URL(is(e),"https://caniuse.dev");return t&&t!=="any"&&r.searchParams.set("slice",t),r.href}function oH({title:e,slug:t,slice:r,coverage:n}){const o=nH(t,r),s=md(n.eventsMode??r),a=[e,s,n.score===null?"No published client results yet":n.eventsMode?gd(n):`${n.full} of ${n.probed} probed clients ${n.reporting?"report a value":"fully support this capability"}`].filter(Boolean).join(" · "),i=(0,f.useCallback)((l,c)=>rH(l,e,s,n,c,`caniuse.dev${is(t)}`),[e,s,n,t]);return(0,u.jsx)(_S,{title:"Share capability",url:o,post:a,filename:`caniuse-${t}${r&&r!=="any"?`-${r}`:""}.png`,draw:i})}function _S({title:e,url:t,post:r,filename:n,draw:o,iconOnly:s=!1}){const[a,i]=(0,f.useState)(!1),[l,c]=(0,f.useState)("loading"),[p,d]=(0,f.useState)(""),[h,m]=(0,f.useState)(!1),[g,S]=(0,f.useState)(null),b=new URL("https://x.com/intent/tweet");b.search=new URLSearchParams({text:r,url:t}).toString();const _=new URL("https://www.linkedin.com/sharing/share-offsite/");_.searchParams.set("url",t),(0,f.useEffect)(()=>{if(!a||!g)return;const E=new AbortController;return c("loading"),o(g,E.signal).then(()=>{E.signal.aborted||c("ready")},()=>{E.signal.aborted||c("error")}),()=>E.abort()},[a,g,o]);async function v(){try{await navigator.clipboard.writeText(t),d("Link copied.")}catch{m(!0),d("Select the link to copy it.")}}function w(){g?.toBlob(E=>{if(!E){d("Couldn't download the report card. Try again.");return}const T=URL.createObjectURL(E),I=document.createElement("a");I.href=T,I.download=n,I.click(),window.setTimeout(()=>URL.revokeObjectURL(T),1e3)},"image/png")}return(0,u.jsxs)(Rs,{open:a,onOpenChange:E=>{i(E),E&&(c("loading"),d(""),m(!1))},children:[(0,u.jsx)(ab,{asChild:!0,children:(0,u.jsxs)(Ke,{variant:"outline",size:s?"icon":"sm","aria-label":s?e:void 0,title:s?e:void 0,className:q("shrink-0 border-primary/50 bg-accent hover:border-primary",s?"size-8":"h-9"),children:[(0,u.jsx)(vg,{className:"size-4"})," ",!s&&"Share"]})}),(0,u.jsxs)(Ts,{"aria-describedby":void 0,className:"dark caniuse-dialog max-h-[calc(100dvh-2rem)] overflow-auto border-0 text-foreground sm:max-w-[680px]",children:[(0,u.jsx)(ln,{children:e}),(0,u.jsxs)("div",{className:"relative aspect-[1200/630] overflow-hidden rounded-lg bg-background",children:[(0,u.jsx)("canvas",{ref:S,width:Ic,height:630,className:"block h-auto w-full",role:"img","aria-label":r}),l!=="ready"&&(0,u.jsx)("p",{role:"status",className:"absolute inset-0 grid place-items-center bg-background px-4 text-center text-sm text-muted-foreground",children:l==="loading"?"Preparing the report card…":"Couldn't generate the report card. Close Share and try again."})]}),(0,u.jsxs)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[(0,u.jsxs)(Ke,{size:"sm",onClick:v,children:[(0,u.jsx)(fg,{className:"size-4"})," Copy link"]}),(0,u.jsx)(Ke,{asChild:!0,variant:"outline",size:"sm",children:(0,u.jsxs)("a",{href:b.href,target:"_blank",rel:"noreferrer",children:[(0,u.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",children:(0,u.jsx)("use",{href:"/caniuse-share-icons.svg#x"})}),(0,u.jsx)("span",{children:"Post to X"})]})}),(0,u.jsx)(Ke,{asChild:!0,variant:"outline",size:"sm",children:(0,u.jsxs)("a",{href:_.href,target:"_blank",rel:"noreferrer",children:[(0,u.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",children:(0,u.jsx)("use",{href:"/caniuse-share-icons.svg#linkedin"})}),(0,u.jsx)("span",{children:"Post to LinkedIn"})]})}),(0,u.jsxs)(Ke,{variant:"outline",size:"sm",onClick:w,disabled:l!=="ready",children:[(0,u.jsx)(nE,{className:"size-4"})," Download image"]})]}),p&&(0,u.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:p}),h&&(0,u.jsx)(Ky,{readOnly:!0,"aria-label":"Shareable link",value:t,onFocus:E=>E.target.select()})]})]})}var sH=4,Hh=5;function aH(e,t){if(e===void 0||e===br){const r=e===void 0?"unknown":"unsupported";return{status:r,label:rd(r,t.id)}}return t.kind.kind==="style-variable"&&e&&typeof e=="object"?{status:"value",label:"same"in e?String(e.same):`Light ${"light"in e?e.light??"—":"—"}
26
26
  Dark ${"dark"in e?e.dark??"—":"—"}`}:{status:"value",label:e===""?'""':String(e)}}function iH(e,t,r){return(e.id.startsWith("supportedProtocolVersions")&&e.kind.kind==="boolean"?t.map(({config:n})=>{const o=e.read(n);return o===void 0?"unknown":o===!0?"supported":"unsupported"}):fS(e,t,r).rows.map(({status:n})=>n)).map(n=>({status:n,label:rd(n,e.id)}))}function lH(e,t){const r=e.flatMap(o=>{const s=As(o);return(o.kind.kind==="mode-set"?o.kind.modes:[void 0]).map(a=>{const i=s?iH(o,t,a):t.map(({config:d})=>aH(o.read(d),o)),l=i.filter(({status:d})=>d!=="unknown"),c=new Set(l.map(({label:d,status:h})=>`${h}:${d}`)),p=c.size>1?2:c.size&&l.length<i.length?1:0;return{label:a?`${o.label} · ${a[0].toUpperCase()}${a.slice(1)}`:o.label,support:s,difference:p,known:c.size>0,cells:i}})}),n=r.filter(o=>o.difference>0);return n.length?n.sort((o,s)=>s.difference-o.difference||Number(s.support)-Number(o.support)):r.filter(o=>o.known)}function cH(e,t){let r=0;for(const n of t){if(n===e)continue;let o=0;for(;o<e.length&&e[o]===n[o];)o++;r=Math.max(r,o)}return r}async function uH(e,t,r,n,o){const s=t.slice(0,sH),a=lH(r,s),i=await SS(e,s,o);if(!i)return;const{text:l,fit:c,rect:p,divider:d,clientImage:h}=i,m="--muted-foreground";l("MCP capability comparison",48,155,52,700);const g=a.some(E=>E.difference===2);l(g?"Where the clients differ":a.length&&s.length>1?a.every(E=>E.support&&!E.difference)?"Matching support across these clients":"Matching results across these clients":"Capability support",48,193,26,600,"--primary"),n&&c(`Search: ${n.slice(0,120)}`,593,193,559,23,500,m);const S=326,b=(Cc-48-S)/s.length,_=E=>48+S+E*b;s.forEach((E,T)=>{const I=_(T),{family:C,surface:L,mode:y}=gr(E),A=C==="chatgpt"?"ChatGPT":E.hostName,N=C==="chatgpt"?`${L} · ${y}`:L;h(E,I,219,39),c(A,I+49,236,b-56,21,700),c(N,I+49,260,b-56,18,500,m)}),d(275),a.length||l("No published results match this comparison.",48,340,29,600,m),a.slice(0,Hh).forEach((E,T)=>{const I=280+T*50;E.difference===2&&p(48,I+2,4,44,2,"--primary"),c(E.label,63,I+30,301,23,650);const C=E.cells.filter(({status:L})=>L==="value").map(({label:L})=>L.split(`
27
27
  `,2));E.cells.forEach(({label:L,status:y},A)=>{const N=_(A),W=y==="supported"?"--success":y==="partial"?"--warning":y==="value"?"--foreground":y==="unknown"?m:"--destructive",O=y==="value"?b-30:Math.min(143,b-30);p(N,I+7,O+20,34,8,"--card","--border");const G=L.split(`
28
28
  `,2);G.forEach((H,X)=>{const j=y==="value"?cH(H,C.flatMap(ee=>ee[X]??[])):0,U=G.length===2;c(H,N+10,I+(U?21+X*15:30),O,U?14:19,650,W,j)})}),d(I+49)});const v=Math.min(a.length,Hh),w=[t.length>s.length?`${s.length} of ${t.length} clients`:"",a.length>v?`${v} of ${a.length} ${g?"differences":"results"} shown`:""].filter(Boolean).join(" · ");l("caniuse.dev/compare",48,589,22,650,m),w&&c(w,325,589,635,22,500,m)}var dH=["preset:claude","preset:chatgpt","preset:cursor"];function lB(){const{catalog:e}=Vu(),t=e??jc(),{hosts:r,subjects:n}=(0,f.useMemo)(()=>Qu(t),[t]),o=(0,f.useMemo)(()=>td(r).map(({hostId:E})=>n[E]),[r,n]),s=(0,f.useMemo)(()=>[...Ni(n),Wa.field],[n]),{params:a,query:i,updateQuery:l,updateSelection:c}=pH(),p=vt(),d=new Set(o.map(({hostId:E})=>E)),h=Ln(kb(a.get("hosts"))??[],d),m=Ln(dH,d),g=a.get("hosts")===""?[]:h.length?h:m.length?m:[...d].slice(0,3),S=g.map(E=>n[E]),b=(0,f.useMemo)(()=>YF(s,o),[s,o]),_=s.find(E=>E.id==="supportedProtocolVersions"),v=(0,f.useMemo)(()=>GF(s,_,_?b.get(_.id)?.slices??[]:[],i),[s,_,b,i]),w=(0,f.useMemo)(()=>JF(b,_),[b,_]);return Ku({surfaceId:"host-compare",snapshot:()=>gb({totalSelectableHosts:o.length,selectedHosts:S,capabilityFields:v,viewMode:"table",searchQuery:i,supportFilter:"all",divergingOnly:!1,loadedSelectedCount:S.length,totalSelectedCount:S.length})}),(0,u.jsx)(qF,{eligible:p.key==="default"&&!a.size,subjects:n,children:(0,u.jsx)(uS,{current:"compare",children:(0,u.jsxs)("div",{className:"caniuse-reveal",children:[(0,u.jsxs)("div",{className:"pb-10 pt-12 sm:pb-14 sm:pt-20",children:[(0,u.jsxs)("div",{className:"caniuse-hero relative z-50 flex flex-wrap items-baseline gap-x-[0.23em] gap-y-1 font-bold",children:[(0,u.jsx)("h1",{className:"whitespace-nowrap",children:"Can I use"}),(0,u.jsx)(gS,{fields:s,query:i,onQueryChange:l,hero:!0})]}),(0,u.jsx)("p",{className:"caniuse-byline mt-5 text-muted-foreground",children:"Compare MCP client support for protocol versions, features, and extensions."})]}),(0,u.jsx)(KF,{clients:o,selected:S,onChange:c}),(0,u.jsx)(fH,{fields:s,matrixFields:v,selected:S,selectedIds:g,query:i,updateQuery:l,summaryColumn:w})]})})})}function pH(){const[e,t]=hu(),r=(0,f.useRef)(e);(0,f.useLayoutEffect)(()=>{r.current=e},[e]);const n=wc(e);function o(a){const i=new URLSearchParams(r.current);i.delete("capability"),a?i.set("q",a):i.delete("q"),r.current=i,t(i,{replace:!0,flushSync:!0})}function s(a){const i=new URLSearchParams(r.current);i.set("hosts",a.join(",")),r.current=i,t(i)}return{params:e,query:n,updateQuery:o,updateSelection:s}}function fH({fields:e,matrixFields:t,selected:r,selectedIds:n,query:o,updateQuery:s,summaryColumn:a}){const[i,l]=(0,f.useState)(!1),c=R1(),p=(0,f.useCallback)((d,h)=>uH(d,r,t,o,h),[r,t,o]);return(0,u.jsxs)("section",{"aria-labelledby":"caniuse-matrix-heading",className:"min-w-0 rounded-xl border border-border bg-card",children:[(0,u.jsxs)("div",{className:"relative z-40 flex flex-wrap items-center gap-x-3 gap-y-2 px-3 py-3 sm:px-5",children:[(0,u.jsxs)("div",{className:"flex basis-full items-center gap-2 sm:basis-auto",children:[(0,u.jsx)("h2",{id:"caniuse-matrix-heading",className:"font-bold",children:"Capability matrix"}),r.length>0&&(0,u.jsx)(cS,{selectedHostIds:n,searchQuery:o,fields:e,preserveQuery:!0,copyOnShare:!0,iconOnly:!0}),r.length>0&&(0,u.jsx)(_S,{title:"Share comparison",url:aS(n,o,e,!0),post:"Compare MCP client capability support on caniuse.dev",filename:"caniuse-client-comparison.png",draw:p,iconOnly:!0})]}),(0,u.jsxs)("label",{className:"flex shrink-0 cursor-pointer items-center gap-2 text-xs text-muted-foreground",children:[(0,u.jsx)(pc,{checked:i,onCheckedChange:l})," ","Show descriptions"]}),(0,u.jsx)(gS,{fields:e,query:o,onQueryChange:s})]}),r.length>0&&(0,u.jsx)("div",{className:"min-w-0 [&>div]:rounded-t-none [&>div]:border-x-0 [&>div]:border-b-0",children:(0,u.jsx)(rS,{subjects:r,fields:t,showDescriptions:i,themeMode:"dark",mobileOptimized:!0,stacked:c,verifyBaseUrl:"https://app.mcpjam.com",disabledVerifyTemplateIds:lb,summaryColumn:a})})]})}var hH=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,mH=["web","npm","desktop-mac","desktop-win","electron-mac","electron-win","local"];function xS(e){return typeof e=="string"&&/^[0-9a-f]{32}$/.test(e)?e:crypto.randomUUID().replaceAll("-","")}function vd(e,t){const r=[...new Set(e)].flatMap(n=>{const o=t.frameDebugIds?.[n];return o&&hH.test(o)?[{type:"sourcemap",code_file:n,debug_id:o}]:[]});return{...t.platform==="javascript"||t.platform==="node"?{platform:t.platform}:{},...t.dist&&mH.includes(t.dist)?{dist:t.dist}:{},...r.length?{debug_meta:{images:r}}:{}}}function gH(e){return{...typeof e=="string"&&/^[0-9a-f]{32}$/.test(e)?{event_id:e}:{},sent_at:new Date().toISOString()}}var vH=["before_send","event_processor","sample_rate","network_error","queue_overflow","ratelimit_backoff","internal_sdk_error","send_error","insufficient_data"],ES=["error","transaction","span","replay","attachment","session","profile","log_item","default"];function yH(e){if(typeof e.timestamp!="number"||!Number.isFinite(e.timestamp)||e.timestamp<0||e.timestamp>1e11)return null;const t=(Array.isArray(e.discarded_events)?e.discarded_events.slice(0,100):[]).flatMap(r=>{if(!r||typeof r!="object"||Array.isArray(r))return[];const{reason:n,category:o,quantity:s}=r;return typeof n=="string"&&vH.includes(n)&&typeof o=="string"&&ES.includes(o)&&typeof s=="number"&&Number.isSafeInteger(s)&&s>0&&s<=1e6?[{reason:n,category:o,quantity:s}]:[]});return t.length?{timestamp:e.timestamp,discarded_events:t}:null}function bH(e){return e==="event"?"error":e==="replay_event"||e==="replay_recording"?"replay":typeof e=="string"&&ES.includes(e)?e:"default"}var SH={chunkType:["text-start","text-delta","text-end","reasoning-start","reasoning-delta","reasoning-end","tool-*","data-*","start","start-step","finish-step","abort","message-metadata","custom","source-url","source-document","file","reasoning-file","finish","error","unknown"],contentType:["application/json","text/event-stream","text/html"],origin:["user_server","user_config","mcpjam","ambiguous"]};function _H(e,t){const r={};for(const[n,o]of Object.entries({...SH,...t.diagnosticFields,slug:t.slugs??[]})){const s=n==="code"?e.code??e.errorCode:e[n];typeof s=="string"&&o.includes(s)&&(r[n]=s)}for(const[n,o,s]of[["fieldCount",0,1e3],["httpStatus",100,599],["port",1,65535]]){const a=e[n];typeof a=="number"&&Number.isInteger(a)&&a>=o&&a<=s&&(r[n]=a)}return typeof e.requestId=="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(e.requestId)&&(r.requestId=e.requestId),r}var xH=["Error","TypeError","RangeError","ReferenceError","SyntaxError","AbortError","EvalReportingError"],EH=["fatal","error","warning","info","debug","log"],wH={deployment:["hosted","self_hosted"],actor_kind:["user","signedIn","guest","installation","unknown"],platform:["web","npm","electron","darwin","win32","linux"],origin:["mcpjam","dependency","external","unknown"],kind:["bug","expected","dependency","unknown"],severity:["error","warning","info"],error_origin:["user_server","user_config","mcpjam","ambiguous"],page_class:["incident","routine"],xaa_failure:["authorization_rejected","authorization_server_unknown"],surface:["mcpjam_agent","action","api","desktop","sdk"],entrypoint:["uploadEvalArtifact","evalRunReporter.flush","evalRunReporter.finalize","reportEvalResults"],http_status:Array.from({length:500},(e,t)=>String(t+100))};function Ne(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{}}function Zt(e,t){return typeof e=="string"&&t.includes(e)?e:void 0}function ls(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=t?e:void 0}function Ho(e,t){return typeof e=="string"&&t.test(e)?e:void 0}function kH(e){return Ho(e,/^(?:user_[0-9A-HJKMNP-TV-Z]{26}|(?:(?:installation:|local-runtime-)?)[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{16})$/)}function IH(e){const t=Ne(e),r=Zt(t.category,["navigation","ui.click","http","console","app","lifecycle","process","eval","auth"]),n=Zt(t.type,["default","debug","error","navigation","http","info","user"]);return r||n?{...r?{category:r}:{},...n?{type:n}:{}}:null}function wS(e,t){const r=Array.isArray(e)?e:[],n=[];for(const o of r.slice(-100)){const s=Ne(o),a=typeof s.filename=="string"?s.filename:"",i=t.frameAliases?.[a]??a;if(!t.files?.includes(i))continue;const l=t.frameOutputNames?.[i]??i,c=ls(s.lineno,1e6);if(c===void 0||!Number.isInteger(c)||c<1)continue;const p=ls(s.colno,1e6),d=p!==void 0&&Number.isInteger(p)?p:void 0;n.push({filename:l,in_app:!0,...c===void 0?{}:{lineno:c},...d===void 0?{}:{colno:d}})}return{frames:n,dropped:r.length-n.length}}function CH(e,t){const r=Ne(e).values;let n=0;return{values:(Array.isArray(r)?r.slice(-8):[]).map(o=>{const s=Ne(o),a=Zt(s.type,[...xH,...t.errors??[]])??"UnknownError",i=wS(Ne(s.stacktrace).frames,t);return n+=i.dropped,{type:a,value:a,...i.frames.length?{stacktrace:{frames:i.frames}}:{}}}),dropped:n}}var RH={xaa_as_status:e=>typeof e=="string"&&/^[1-5]\d{2}$/.test(e)?e:void 0,xaa_as_error:e=>typeof e=="string"&&/^[\x20-\x21\x23-\x5B\x5D-\x7E]{1,64}$/.test(e)?e:void 0};function TH(e){const t=Ne(e),r={};for(const[n,o]of Object.entries(wH)){const s=Zt(t[n],o);s&&(r[n]=s)}for(const[n,o]of Object.entries(RH)){const s=o(t[n]);s&&(r[n]=s)}return r}function kS(e,t){const r=xS(e.event_id),n=ls(e.timestamp,1e11),o=kH(t.actorId),s=Ho(t.release,/^(?:mcpjam-sdk@)?\d+\.\d+\.\d+(?:-[a-z0-9.-]+)?$|^[0-9a-f]{7,40}$/);return{...vd([],t),...r?{event_id:r}:{},...n===void 0?{}:{timestamp:n},...o?{user:{id:o}}:{},...s?{release:s}:{},...t.environment?{environment:t.environment}:{},tags:TH(e.tags)}}function AH(e,t={}){const r=Ne(e),n=CH(r.exception,t),o=Ne(r.extra),s=Zt(r.message,t.messages??[])??Zt(o.message,t.messages??[]),a=s??"telemetry_event",i=Array.isArray(r.breadcrumbs)?r.breadcrumbs.slice(-20).map(m=>IH(Ne(m))).filter(Boolean):[],l=n.values.flatMap(m=>m.stacktrace?.frames??[]),c=_H(o,t),p=typeof c.code=="string"?c.code:typeof c.slug=="string"?c.slug:void 0,d=typeof c.event=="string"?c.event:void 0,h=n.values.at(-1);return h&&p&&(h.value=p),{...kS(r,t),...vd(l.map(m=>String(m.filename)),t),level:Zt(r.level,EH)??"error",...n.values.length?{exception:{values:n.values},...s?{message:a}:{}}:{message:a},fingerprint:[...n.values.length?["{{ default }}"]:[],n.values.at(-1)?.type??a,...n.values.length&&s?[s]:[],...n.values.length&&!l.length&&d?[d]:[],...p?[p]:[]],extra:{...c,dropped_frames:Math.min(1e6,n.dropped)},...i.length?{breadcrumbs:i}:{}}}function ba(e,t={}){const r=Ne(e),n=Zt(r.description,t.routes??[])??"unknown_operation",o=Ho(r.span_id,/^[0-9a-f]{16}$/),s=Ho(r.trace_id,/^[0-9a-f]{32}$/),a=Ho(r.parent_span_id,/^[0-9a-f]{16}$/),i=ls(r.start_timestamp,1e11)??0,l=ls(r.timestamp,1e11)??i;return{description:n,op:Zt(r.op,["http.server","http.client","function","navigation","ui.action"])??"function",span_id:o??"0000000000000000",trace_id:s??"00000000000000000000000000000000",...a?{parent_span_id:a}:{},start_timestamp:i,timestamp:Math.max(i,l),data:{}}}function NH(e,t={}){const r=Ne(e),n=ba(r,t),o=ba(Ne(Ne(r.contexts).trace),t);return{...kS(r,t),type:"transaction",transaction:Zt(r.transaction,t.routes??[])??"unknown_operation",start_timestamp:n.start_timestamp,timestamp:n.timestamp,contexts:{trace:{trace_id:o.trace_id,span_id:o.span_id,op:o.op}},spans:(Array.isArray(r.spans)?r.spans.slice(0,100):[]).map(s=>ba(Ne(s),t))}}function Uh(e,t){const r=Ne(e),n=i=>({frames:wS(Ne(i).frames,t).frames}),o=i=>{const l=Ne(i);return{...l,values:(Array.isArray(l.values)?l.values:[]).map(c=>{const p=Ne(c);return{...p,...p.stacktrace?{stacktrace:n(p.stacktrace)}:{}}})}},s={...r,...r.stacktrace?{stacktrace:n(r.stacktrace)}:{},...r.exception?{exception:o(r.exception)}:{},...r.threads?{threads:o(r.threads)}:{}};delete s.debug_meta;const a=[s.stacktrace,...[s.exception,s.threads].flatMap(i=>(Array.isArray(Ne(i).values)?Ne(i).values:[]).map(l=>Ne(l).stacktrace))].flatMap(i=>{const l=Ne(i).frames;return(Array.isArray(l)?l:[]).map(c=>String(Ne(c).filename))});return{...s,...vd(a,t)}}var PH=[["claude-code",/claude[-_ ]?code/],["claude-ai",/claude/],["cursor",/cursor/],["windsurf",/windsurf|codeium/],["codex",/codex/],["copilot",/copilot/],["vscode",/vscode|visual studio code/],["chatgpt",/chatgpt|openai/],["gemini-cli",/gemini/],["goose",/goose/],["opencode",/opencode/],["cline",/cline/],["zed",/\bzed\b/],["mcp-inspector",/mcp[-_ ]inspector/],["mcpjam",/mcpjam/]],cB=[...PH.map(([e])=>e),"other"],MH=[],OH=["AI_APICallError","AI_DecisionRefusalError","AI_DecisionUnsupportedQuestionTypeError","AI_DownloadError","AI_EmptyResponseBodyError","AI_InvalidArgumentError","AI_InvalidDataContentError","AI_InvalidMessageRoleError","AI_InvalidPromptError","AI_InvalidResponseDataError","AI_InvalidStreamPartError","AI_InvalidToolApprovalError","AI_InvalidToolApprovalSignatureError","AI_InvalidToolInputError","AI_JSONParseError","AI_LoadAPIKeyError","AI_LoadSettingError","AI_MessageConversionError","AI_MissingToolResultsError","AI_NoContentGeneratedError","AI_NoImageGeneratedError","AI_NoObjectGeneratedError","AI_NoOutputGeneratedError","AI_NoSpeechGeneratedError","AI_NoSuchModelError","AI_NoSuchProviderError","AI_NoSuchProviderReferenceError","AI_NoSuchToolError","AI_NoTranscriptGeneratedError","AI_NoTranslationGeneratedError","AI_NoVideoGeneratedError","AI_RetryError","AI_SerializationError","AI_StreamProviderError","AI_TooManyEmbeddingValuesForCallError","AI_ToolCallNotFoundForApprovalError","AI_ToolCallRepairError","AI_ToolChoiceViolationError","AI_TypeValidationError","AI_UIMessageStreamError","AI_UnsupportedFunctionalityError","AI_UnsupportedModelVersionError","ActError","AdapterPathError","AdmissionLaneLeftError","AdmissionResponseError","AmbiguousSuiteTemplateError","ApiKeyReadinessError","ApiKeysRelayError","AppLoadStalledError","AppServerExitedError","AppToolValidationError","ArgvPolicyViolation","AuthChallengeSuspendSignal","AuthKitConfigError","AuthKitVerificationError","AuthoringRequestError","AuthorizationPrepareError","BadRequestException","BenchDefinitionChangedError","BenchNotEnabledError","BenchResultNotFoundError","BenchResultNotReadyError","BillingPopupBlockedError","BlobUploadError","BlockedEgressTargetError","BodyTooLargeError","BootstrapNotReadyError","BridgeExposureError","BrowserAdmissionError","BrowserPermissionUnavailableError","BrowserPolicyError","BrowserProtocolMismatchError","BrowserSessionInUseError","BrowserSessionServiceError","BrowserSessionTargetError","BrowserdClientError","CancelEvalRunError","CaseBatchPartialFailureError","CaseMetadataPinMismatchError","ChatStageBackendError","CheckStepError","CheckStoppedByPlan","ChromiumInstallError","ChromiumNotInstalledError","ClientInputError","CloneTokenUnavailableError","CloudSkillsError","CloudSkillsFetchTimeoutError","CodeEvaluatorTestError","CodexPermissionRefusedError","CommandTranslationError","ComposerResolveError","ConformanceLoginRequiredError","ConformanceRunCancelledError","ConvexError","ConvexHttpStatusError","CoordinatorError","CredentialPolicyBlockedError","DirectoryConnectError","DockerSandboxCommandError","EgressDecodeError","EgressResolutionError","EvalDescriptionExperimentError","EvalRouteFactsError","EvalRunCompareError","EvalRunDecisionSummaryError","EvalRunIterationsError","EvalRunStoppedError","EvalServerFactsError","EvalSetupPhaseError","EvalStageAnalyticsError","EventRunHaltError","EventToolsSnapshotError","EventsApiError","EventsBackendError","ExecutionControlError","ExternalAccountCredentialRefusal","FreshProfileRefusedError","FrozenRunRefusalError","GenericServerException","GrantStateUnreadableError","GuestAuthorityConfigError","GuestSessionRefusedError","GuestSessionRequestError","GuestSessionRevokedError","HandoffCallError","HarnessInfraSetupError","HarnessIterationRecordError","HarnessProxyPolicySealTooLargeError","HarnessSandboxResolutionError","HarnessToolNameCollisionError","HeaderMismatchError","HostResolutionError","HostedBrowserError","HostedDesktopUnavailableError","HostedIdentityError","HostedMrtrTerminalError","HostedReserveError","HostedServiceCredentialError","ImageUploadError","InboxHttpError","InsecureLocalBrowserOriginError","InspectorCommandClientError","InvalidClientProfileError","InvalidModelToolApprovalsError","JobUnexecutableError","JourneyPluginServersUnavailableError","JudgeStageBackendError","KeystoreUnavailableError","LaunchJourneyRunError","LaunchSwarmRunError","LeaseLostError","LeaseRouteRefusal","LeaseTakenMidAct","LedgerSinkError","LocalAutoApproveConsentRequiredError","LocalBrowserRequestError","LocalBrowserUnavailableError","LocalCheckError","LocalEventsError","LocalHarnessEnvError","LocalHarnessFileLimitError","LocalRateOverrideError","LocalRuntimePreparingError","McpAdmissionError","McpError","McpRequestError","MockRefusal","ModelResolutionRefusalError","MrtrDisplayRejectedError","MrtrDisplayTooLargeError","MrtrFingerprintTooComplexError","MrtrResumeStateDecodeError","MrtrResumeStateTooLargeError","MrtrSuspendedSignal","NativeWireError","NoFreePortError","NodeLauncherError","NotFoundException","OAuthConformanceSessionFailedError","OAuthConformanceSessionNotFoundError","OAuthRequestRejectedError","OauthException","ObservationWriteRefused","OrganizationNotReadyError","OtlpDecodeError","OtlpRequestError","PageDriverError","PageToolValidationError","PathConfinementError","PendingDirectReplayConflictError","PinnedSkillIntegrityError","PlanProtocolError","PlanUnreachableError","PluginActivationError","PluginApiError","PluginBundleCacheError","PluginContextUpdateRejected","PluginContinuationRefused","PluginContinuationTerminal","PluginDeepLinkError","PluginDeepLinkRefusal","PluginDescribedError","PluginFileTargetRefusal","PluginFileTransferError","PluginFormError","PluginInvocationError","PluginMentionError","PluginModelContextError","PluginSettingsError","PluginSettingsRequestError","PluginToolCallFailure","PluginWorkspaceAdmissionError","PluginWorkspaceRequestError","PrServerAuthorizationRequiredError","PrivateAuthorizationServerRefreshError","ProbeTimeoutError","ProducerVerificationUnavailableError","RateLimitExceededException","ReadinessLeaseLostError","ReadinessPackageUnreadableError","ReadinessRunCancelledError","ReadinessSubmissionUnreadableError","RealUiError","RecipeResolutionError","RecordedAssistantTurnError","RegistryUnreadableError","ReplayToolPolicyUnrecoverableError","ResourceGrantError","RetryBudgetExhaustedError","ReviewerAttemptRefusedError","RevokedSessionFeedError","RunPluginServersUnavailableError","RunPluginSnapshotError","RunSetupFailedError","SandboxAttachmentError","SavedReplyConnectionError","ScenarioHarnessRepublishRequiredError","ScopeStepUpSuspendSignal","ScoreRunNotFoundError","SecretNotTypedError","ServerConnectionBackendError","ServerMessage","ServiceCredentialUnavailableError","SessionBrowserError","SessionTokenError","ShareCardLookupLimited","ShareCardUnavailable","ShimConfigError","SignInBrowserAccountMismatchError","SignInBrowserNotFoundError","SignInBrowserNotNamedError","SignInExpiredError","SkillReadEnded","SlackBackendUnavailable","SnapshotTooLargeError","StaleClaimError","StaleLeaseError","SupervisorError","SwarmAgentError","SwarmGenerateError","SwarmSetupError","SwarmTargetMaterializeError","SwarmTargetPreflightError","SyntheticTimeoutError","TaskUnknownOrExpiredError","TasksFeatureError","TelemetryScrubError","ThreadAppError","TimeoutError","ToolOutcomeUnknownError","TourCancelled","TrafficStoreUnavailableError","TurnClosedError","TurnWindowConflictError","UiToolValidationError","UnauthorizedException","UnknownTaskError","UnsafeRedirectError","UnsupportedTransportError","VendorStatusError","ViewReplacedError","ViewerTokenConfigError","WebAccountUnavailableError","WebApiError","WebBackendRefusal","WebClientRunError","WebClientTurnRefusedError","WebMcpBridgeError","WebMcpChromiumNotInstalledError","WebMcpInvocationCancelledError","WebMcpInvokeIdReusedError","WebMcpLeaseBlockedError","WebMcpNoDisplayError","WebMcpOutcomeUnknownError","WebMcpQueueFullError","WebMcpSessionCapacityError","WebMcpSessionNotFoundError","WebMcpSessionUnavailableError","WebMcpToolGoneError","WebMcpUnsupportedError","WebRouteError","WidgetModelContextValidationError","WidgetSessionBusyError","WidgetSessionCapacityError","WidgetSessionNotFoundError","WidgetSessionUnavailableError","WorkosKeyBindingError","WorkspacePreviewError","ZodError"],jH=["Another tab holds the migration lease; will retry","Authoring service returned a non-JSON response","Auto-connecting to CLI-provided MCP server","Auto-connecting to server","Background task created","Cannot execute tool: no listed tool selected","Cannot execute tool: no serverId available","Cannot execute tool: server is not connected","Cannot fetch tools: no serverId available","Cannot handle elicitation response: no active request","Cold-share data-loss invariant tripped: createProject called with empty servers but source has servers","Connecting with synced OAuth credentials","Connection failed","Connection successful","Convex auth refusal diagnostic","Convex authentication recovery","Could not fetch CLI config from API","Could not fetch task capabilities","Could not re-read project servers before saving","Could not refresh account connections","Could not settle the failed sign-in callback","Could not verify the created server's project","Deferring reconnect: app still bootstrapping","Disconnecting from server","Disconnecting runtime servers before auth scope reset","Disconnecting server before project switch","Error responding to elicitation","Error uploading file:","Failed to delete project from Convex","Failed to ensure default guest project","Failed to ensure default project","Failed to fetch init info","Failed to fetch tools","Failed to migrate project","Failed to read pending OAuth marker","Failed to reconnect server after client switch","Failed to remove a server deleted while saving","Failed to remove server from Convex","Failed to sync OAuth profile to Convex","Failed to sync server status","Failed to sync server to Convex","Failed to update exact hosted server","Failed to update project","Failed to update project client config","Ignored stale chat OAuth callback","Ignoring servers in handleUpdateProject for authenticated user - use individual server operations","Local state migration completed","Local state migration hit a permanent error; not retrying","Local state migration partially failed; scheduling retry","Local state migration retry limit reached; will not retry until reload","Local state migration threw a permanent error; not retrying","Local state migration threw; scheduling retry","Marked pending OAuth connection as failed","Migrated project to Convex","Migrating local projects to Convex","OAuth authorization failed before callback completion","OAuth callback access rejected","OAuth callback failed","OAuth completion rejected","OAuth conformance warning","OAuth connection successful","OAuth connection test error","OAuth connection test failed","OAuth profile was not saved to Convex","OAuth reconnect failed","Processing CLI-provided MCP servers (from config file)","Project shared","Reconnect requires a fresh OAuth flow after synced credential lookup","Reconnect successful using synced OAuth credentials","Reconnecting to server","Reconnection failed","Reconnection successful","Reconnection with fresh OAuth successful","Refusing to sync server because active project does not belong to active organization","Removing server","Retrying OAuth connection after transient transport error","Retrying OAuth connection after transport exception","Saved server configuration without connecting","Saving CLI server without auto-connect","Server name already belongs to another project in this workspace","Server not found in Convex for deletion","Skipping CLI sign-in redirect during OAuth callback","Skipping auto-connect for OAuth server","Startup server status sync failed","Switching to project","Sync to Convex failed (pre-connection)","Synced OAuth credentials require a fresh OAuth flow","Task capabilities fetched","Tool execution completed","Tool execution network error","Tools fetched","[evals] Batch case create rejected the whole call","[evals] Batch case create returned warnings","[evals] Batch result named a case index we never sent","[evals] Failed to create test case","[evals] Failed to load suite for projectId fallback","[evals] Failed to resolve org model config","[evals] Failed to resolve org model config for test case","[evals] Failed to roll back empty suite after all cases failed","[evals] Failed to store replay config for suite run","[evals] Failed to upsert test case","[evals] Idempotent launch lookup failed; keeping the refusal","[evals] getRunPinnedSkills failed","[readiness] a resumed run could not be failed","[readiness] authorize failed; the run waits for recovery","[readiness] could not find a resumed run's reviewer attempt","[readiness] lease unconfirmed; the run waits for recovery","[readiness] no background credential for the reviewer account","[readiness] resumed a re-queued run","clearLocalFallbackProjectSelection: no active project resolved","persistRuntimeServerToProjectIfNeeded: auth/project state did not become ready in time; skipping Convex write","persistRuntimeServerToProjectIfNeeded: project server snapshot still unresolved; skipping Convex write","persistRuntimeServerToProjectIfNeeded: runtime server not persisted because a saved server with the same name already exists","persistRuntimeServerToProjectIfNeeded: syncServerToConvex returned no server id","persistRuntimeServerToProjectIfNeeded: syncServerToConvex threw","persistRuntimeServerToProjectIfNeeded: timed out waiting for project server echo after persist","persistRuntimeServerToProjectIfNeeded: unexpected error"],LH=["/*","/access-requests/:requestId","/bench/results/:secret","/billing","/callback","/capabilities/:capabilitySlug","/compare","/conformance/shared/:token","/embed/bench","/embed/bench/:runId","/embed/host-compare","/embed/score","/evals/shared/:token","/host-compare","/login","/oauth/callback/*","/organizations","/organizations/:orgId","/organizations/:orgId/api-keys","/organizations/:orgId/audit-log","/organizations/:orgId/billing","/organizations/:orgId/billing/byok","/organizations/:orgId/billing/usage","/organizations/:orgId/budget","/organizations/:orgId/data-management","/organizations/:orgId/discord","/organizations/:orgId/integrations","/organizations/:orgId/members","/organizations/:orgId/models","/organizations/:orgId/models/usage","/organizations/:orgId/observability","/organizations/:orgId/plans","/organizations/:orgId/security","/organizations/:orgId/sharing","/organizations/:orgId/slack","/p/:projectId//","/p/:projectId/chat","/p/:projectId/chat/*","/p/:projectId/ci-evals","/p/:projectId/ci-evals/*","/p/:projectId/client-config","/p/:projectId/clients","/p/:projectId/clients/:hostId","/p/:projectId/compatibility","/p/:projectId/computer","/p/:projectId/conformance","/p/:projectId/conformance/runs/:runId","/p/:projectId/environments","/p/:projectId/environments/:environmentId","/p/:projectId/evals","/p/:projectId/evals/create","/p/:projectId/evals/runs","/p/:projectId/evals/runs/commit/:commitSha","/p/:projectId/evals/runs/create","/p/:projectId/evals/runs/suite/:suiteId","/p/:projectId/evals/runs/suite/:suiteId/edit","/p/:projectId/evals/runs/suite/:suiteId/runs/:runId","/p/:projectId/evals/runs/suite/:suiteId/settings","/p/:projectId/evals/runs/suite/:suiteId/settings/evaluators","/p/:projectId/evals/runs/suite/:suiteId/test/:testId","/p/:projectId/evals/runs/suite/:suiteId/test/:testId/edit","/p/:projectId/evals/suite/:suiteId","/p/:projectId/evals/suite/:suiteId/edit","/p/:projectId/evals/suite/:suiteId/runs/:runId","/p/:projectId/evals/suite/:suiteId/settings","/p/:projectId/evals/suite/:suiteId/settings/evaluators","/p/:projectId/evals/suite/:suiteId/test/:testId","/p/:projectId/evals/suite/:suiteId/test/:testId/edit","/p/:projectId/evaluate","/p/:projectId/evaluate/create","/p/:projectId/evaluate/eval-server/:serverId","/p/:projectId/evaluate/suite/:suiteId","/p/:projectId/evaluate/suite/:suiteId/edit","/p/:projectId/evaluate/suite/:suiteId/runs/:runId","/p/:projectId/evaluate/suite/:suiteId/runs/:runId/cases/:caseId","/p/:projectId/evaluate/suite/:suiteId/runs/:runId/cases/:caseId/iterations/:iterationId","/p/:projectId/evaluate/suite/:suiteId/runs/:runId/compare","/p/:projectId/evaluate/suite/:suiteId/settings","/p/:projectId/evaluate/suite/:suiteId/settings/evaluators","/p/:projectId/evaluate/suite/:suiteId/test/:testId","/p/:projectId/evaluate/suite/:suiteId/test/:testId/edit","/p/:projectId/events","/p/:projectId/home","/p/:projectId/hosts","/p/:projectId/hosts/:hostId","/p/:projectId/learning","/p/:projectId/oauth-flow","/p/:projectId/playground","/p/:projectId/project-settings","/p/:projectId/project-settings/members","/p/:projectId/project-settings/secrets","/p/:projectId/prompts","/p/:projectId/readiness","/p/:projectId/registry","/p/:projectId/resources","/p/:projectId/scenarios","/p/:projectId/servers","/p/:projectId/servers/:serverId","/p/:projectId/servers/plugins/:pluginId","/p/:projectId/sessions","/p/:projectId/skills","/p/:projectId/swarms","/p/:projectId/swarms/:swarmId","/p/:projectId/swarms/new","/p/:projectId/tasks","/p/:projectId/tools","/p/:projectId/tracing","/p/:projectId/triggers","/p/:projectId/user-testing","/p/:projectId/user-testing/:scenarioId","/p/:projectId/user-testing/:scenarioId/edit","/p/:projectId/user-testing/new","/p/:projectId/webmcp","/p/:projectId/xaa-flow","/profile","/redeem","/results/:runToken","/settings","/settings/about","/settings/api-keys","/settings/appearance","/settings/github-checks","/settings/integrations","/settings/integrations/github","/settings/integrations/github/callback","/settings/support","/support","/web-accounts/:webAccountId/reconnect"],DH=["jsonrpc/parse_error","jsonrpc/invalid_request","jsonrpc/method_not_found","jsonrpc/invalid_params","jsonrpc/internal_error","jsonrpc/invalid_response_format","jsonrpc/connection_closed","jsonrpc/request_timeout","jsonrpc/header_mismatch","jsonrpc/unsupported_protocol_version","jsonrpc/missing_required_client_capability","jsonrpc/url_elicitation_required","transport/econnrefused","transport/econnreset","transport/etimedout","transport/enotfound","transport/eai_again","transport/undici","transport/fetch_failed","transport/socket_hang_up","transport/tls_untrusted","auth/http_401","auth/http_403","auth/oauth_refresh_failed","auth/consent_required","auth/missing_bearer","auth/insufficient_scope","auth/authorization_server_unreachable","auth/proxy_rejected","oauth/no_bearer_challenge","oauth/non_compliant_challenge","oauth/invalid_grant","oauth/invalid_client","oauth/redirect_mismatch","oauth/well_known_unreachable","sdk/not_yet_supported_in_stateless","sdk/stateless_requires_http","sdk/protocol_version_pin_unsupported","sdk/paginated_tool_header_discovery_unsupported","provider/invalid_tool_name","provider/auth_error","provider/not_allowlisted","provider/model_retired","provider/context_length_exceeded","provider/mcpjam_limit_daily","provider/mcpjam_limit_monthly","provider/mcpjam_limit_insufficient","provider/fallback_prohibited","provider/mcpjam_platform_budget","account/suspended","account/guest_input_too_large","provider/mcpjam_limit","provider/quota","server/rate_limited","server/http_error","provider/empty_response","generation/invalid_output","internal/unknown"],FH={code:["AUTH_REQUIRED","CONFLICT","FEATURE_NOT_SUPPORTED","FORBIDDEN","GENERATION_FAILED","INTERNAL_ERROR","NOT_FOUND","OAUTH_REQUIRED","RATE_LIMITED","SERVER_UNREACHABLE","TIMEOUT","UNAUTHORIZED","VALIDATION_ERROR","account_suspended","agent_turn_limit","ai_key_policy_unavailable","ai_scope_unresolved","app_load/actor_pending","app_load/auth_pending","app_load/guest_session_failed","app_load/guest_session_refused","app_load/session_refresh_failed","app_load/user_setup_pending","auth_required","billing_feature_not_included","billing_limit_reached","capability_missing","capability_unknown","credential_missing","feature_not_supported","free_tier_model_restricted","guest_input_too_large","guest_model_not_allowed","guest_session/bad_json","guest_session/bad_payload","guest_session/bad_response","guest_session/configuration","guest_session/exhausted","guest_session/http_4xx","guest_session/http_5xx","guest_session/network","guest_session/network/CERT_HAS_EXPIRED","guest_session/network/DEPTH_ZERO_SELF_SIGNED_CERT","guest_session/network/EAI_AGAIN","guest_session/network/ECONNREFUSED","guest_session/network/ECONNRESET","guest_session/network/EHOSTUNREACH","guest_session/network/ENETUNREACH","guest_session/network/ENOTFOUND","guest_session/network/ERR_TLS_CERT_ALTNAME_INVALID","guest_session/network/ETIMEDOUT","guest_session/network/SELF_SIGNED_CERT_IN_CHAIN","guest_session/network/UNABLE_TO_GET_ISSUER_CERT_LOCALLY","guest_session/network/UNABLE_TO_VERIFY_LEAF_SIGNATURE","guest_session/network/UND_ERR_CONNECT_TIMEOUT","guest_session/network/UND_ERR_SOCKET","guest_session/timeout","guest_session/unreachable","guest_session/upstream_status","invalid_model","no_free_port","not_found","oauth_required","org_keys_required","org_model_unconfigured","org_rate_limit","org_runtime_unsupported","platform_free_budget_exhausted","port_taken","provider_auth_failed","provider_unavailable","rate_limited","session_revoked","spend_budget_reached","startup_failed","unauthorized","user_rate_limit","validation_error","wallet_locked"],scope:["user","organization","platform"]},HH={files:MH,errors:OH,messages:jH,routes:LH,slugs:DH,diagnosticFields:FH},Ya=new WeakMap,Yt=new Map,Zn=()=>({strict:nm().policy.content!=="full",names:Oc(),actorId:om()??void 0}),Cr=(e,t)=>({strict:e.strict||t.strict||e.actorId!==t.actorId,names:e.names&&t.names&&e.actorId===t.actorId,actorId:e.actorId,drop:e.drop||t.drop}),Bn={strict:!0,names:!1};function cs(e,t=!1){return typeof e=="string"&&(t?/^[0-9a-f]{16}$/:/^[0-9a-f]{32}$/).test(e)?`${t?"s":"e"}:${e}`:void 0}function Oi(e,t){e&&(Yt.set(e,Yt.has(e)?Cr(Yt.get(e)??Bn,t):t),Yt.size>4096&&Yt.delete(Yt.keys().next().value??""))}function UH(e,t,r=!1){const n=Ne(e),o=cs(Ne(Ne(n.contexts).trace).span_id,!0),s=n.type==="transaction"?Yt.get(o??"")??Bn:Zn(),a=Cr(Zn(),s);a.drop=r,Ya.set(e,Cr(Ya.get(e)??a,a)),Oi(cs(n.event_id??t?.event_id),a)}function $H(e){Oi(cs(e.spanContext().spanId,!0),Zn())}function BH(e){const t=cs(Ne(e).span_id,!0),r=Cr(Yt.get(t??"")??Bn,Zn());return Ya.set(e,r),Oi(t,r),e}function Rc(e,t=!1){const r=Ne(e),n=cs(t?r.span_id:r.event_id,t),o=typeof e=="object"&&e!==null?Ya.get(e):void 0;let s=Cr(o??Yt.get(n??"")??Bn,Zn());if(!t){Array.isArray(r.spans)&&r.spans.length>1e3&&(s=Cr(s,Bn));for(const a of Array.isArray(r.spans)?r.spans.slice(0,1e3):[])s=Cr(s,Rc(a,!0));for(const a of r.type!=="replay_event"&&Array.isArray(r.breadcrumbs)?r.breadcrumbs:[])s=Cr(s,Yt.get(IS(a)??"")??Bn)}return s}function IS(e){const t=Ne(e).timestamp;return typeof t=="number"&&Number.isFinite(t)?`b:${t}`:void 0}function zH(e){Oi(IS(e),Zn())}var WH=new Set([0,1]),qH=new Set([2,3]),VH=new Set([4,5,6]),GH=3,Eo={mutation:0,styleSheetRule:8,font:10,styleDeclaration:13,adoptedStyleSheet:15},YH=new Set(["_cssText","style"]);function Ut(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Be(e,t,r){if(!(t in e))return e;const n=r(e[t]);return n===e[t]?e:{...e,[t]:n}}function Zr(e,t){if(!Array.isArray(e))return e;let r=null;return e.forEach((n,o)=>{const s=t(n);s!==n&&(r??=e.slice(),r[o]=s)}),r??e}function Jt(e){return typeof e=="string"?em(e):e}function JH(e){if(typeof e=="string")return Jt(e);if(!Ut(e))return e;let t=e;for(const r of Object.keys(e))t=Be(t,r,n=>Array.isArray(n)?Zr(n,Jt):Jt(n));return t}function CS(e){if(!Ut(e))return e;let t=e;for(const r of YH)t=Be(t,r,JH);return t}function yd(e){if(!Ut(e))return e;let t=e;return e.type===GH&&e.isStyle===!0&&(t=Be(t,"textContent",Jt)),t=Be(t,"attributes",CS),Be(t,"childNodes",r=>Zr(r,yd))}function $h(e){return Zr(e,t=>Ut(t)?Be(t,"rule",Jt):t)}function KH(e){switch(e.source){case Eo.mutation:{let t=Be(e,"adds",r=>Zr(r,n=>Ut(n)?Be(n,"node",yd):n));return t=Be(t,"texts",r=>Zr(r,n=>Ut(n)?Be(n,"value",Jt):n)),Be(t,"attributes",r=>Zr(r,n=>Ut(n)?Be(n,"attributes",CS):n))}case Eo.styleSheetRule:{let t=Be(e,"adds",$h);return t=Be(t,"replace",Jt),Be(t,"replaceSync",Jt)}case Eo.styleDeclaration:return Be(e,"set",t=>Ut(t)?Be(t,"value",Jt):t);case Eo.adoptedStyleSheet:return Be(e,"styles",t=>Zr(t,r=>Ut(r)?Be(r,"rules",$h):r));case Eo.font:return Be(e,"fontSource",Jt);default:return e}}function XH(e){return"cv"in e||!Ut(e.data)?null:e.type===2?Be(e,"data",t=>Be(t,"node",yd)):Be(e,"data",t=>KH(t))}function QH(e){if(!Array.isArray(e))return null;const t=[];for(const r of e){if(!Ut(r))return null;const n=r.type;if(typeof n!="number")return null;if(WH.has(n))t.push(r);else if(qH.has(n)){const o=XH(r);if(o===null)return null;t.push(o)}else if(VH.has(n))t.push(XS(r));else return null}return t}function Ja(e){const t=e.search(/[?#]/);return t===-1?e:e.slice(0,t)}var ZH=/^(?:[a-z][a-z\d+.-]*:|\/\/)/i;function eU(e,t){if(!ZH.test(e))return Ja(e);const r=tU(e,t);return r===void 0?"[redacted-url]":t!==void 0&&r!=="null"&&r===t?Ja(e):r}function tU(e,t){for(const r of[t,void 0])try{return new URL(e,r).origin}catch{}}var rU=e=>`[secret:${e}]`,nU=32;function oU(e){let t=0,r=0;for(let n=0;n<e.length;n++)e.charCodeAt(n)===92?(r+=1,r>t&&(t=r)):r=0;return t===0?1:Math.min(nU,Math.floor(Math.log2(t))+2)}function sU(e){let t="",r="";for(const n of e)JSON.stringify(n).slice(1,-1)===n?(r+=n,r.length>t.length&&(t=r)):r="";return t}function aU(e){const t=new Set;for(const r of e){const n=JSON.stringify(r).slice(1,-1);t.add(n[n.length-1])}return t}function iU(e,t={}){const r=t.replacement??rU,n=e.filter(v=>v.value.length>=8).slice().sort((v,w)=>w.value.length-v.value.length).map(v=>({...v,anchor:sU(v.value),tails:aU(v.value)}));if(n.length===0)return null;function o(v,w,E){const T=[];let I=v;for(let C=0;C<w;C++){const L=JSON.stringify(I).slice(1,-1);if(L===I||L.length>E)break;T.push(L),I=L}return T}const s=(v,w)=>w.search.length-v.search.length,a=new Map;function i(v,w,E,T,I){const C=`${v}:${E}:${I}`,L=a.get(C);if(L)return L;const y=o(w.value,E,T);return a.set(C,y),y}function l(v,w,E,T){const I=[],C=[];for(const[L,y]of n.entries()){const A=r(y.name);if(!(y.anchor===""||v.includes(y.anchor)))continue;if(I.push({search:y.value,replace:A}),JSON.stringify(y.value).slice(1,-1)===y.value){C.push({search:y.value,replace:A});continue}let N=!0;for(const W of y.tails)if(!v.includes(W)){N=!1;break}if(N)for(const W of i(L,y,w,E,T))C.push({search:W,replace:A}),I.push({search:W,replace:A})}return I.sort(s),C.sort(s),{all:I,json:C}}function c(v){const w=oU(v),E=v.length<=1?0:Math.ceil(Math.log2(v.length));return l(v,w,2**E,E)}function p(v,w){let E=v;for(const T of w)E.includes(T.search)&&(E=E.split(T.search).join(T.replace));return E}function d(v){return p(v,c(v).all)}function h(v){let w;try{w=JSON.parse(v)}catch{return p(v,c(v).json)}if(!w||typeof w!="object"||Array.isArray(w))return p(v,c(v).json);const E={};for(const[T,I]of Object.entries(w))Object.defineProperty(E,T,{value:_(I),enumerable:!0,writable:!0,configurable:!0});return JSON.stringify(E)}const m=8,g="[truncated: max depth]",S="[truncated: circular reference]";function b(v,w,E){if(typeof v=="string")return d(v);if(v===null||typeof v!="object")return v;if(w>=m)return g;if(Array.isArray(v)){if(E.has(v))return S;E.add(v);const T=v.map(I=>b(I,w+1,E));return E.delete(v),T}if(v&&typeof v=="object"){if(E.has(v))return S;const T=Object.getPrototypeOf(v);if(T!==Object.prototype&&T!==null)return v;E.add(v);const I={};for(const[C,L]of Object.entries(v))Object.defineProperty(I,d(C),{value:b(L,w+1,E),enumerable:!0,writable:!0,configurable:!0});return E.delete(v),I}return v}function _(v){return b(v,0,new Set)}return{scrubString:d,scrubSerializedJson:h,scrubDeep:_,size:n.length,needleCountFor:v=>c(v).all.length}}var lU=new Map,Il;function cU(){return Il===void 0&&(Il=iU([...lU].map(([e,t])=>({name:t,value:e})),{replacement:e=>`[redacted-${e}]`})),Il}function uU(e){return cU()?.scrubString(e)??e}var bd=()=>/\b(authorization["']?\s*:\s*)["']?[^\n\r"'`]+/gi,Sd=()=>/\bBearer\s+[A-Za-z0-9._~\-+/=]+\b/gi,_d=()=>/(?<![A-Za-z0-9])mcpjam-session\.[A-Za-z0-9_-]{24,}(?![A-Za-z0-9_-])/g,xd=()=>/\bsk-(?:[A-Za-z0-9]+-)*[A-Za-z0-9]{16,}\b/g,Ed=()=>/(?<![A-Za-z0-9])(?:ghs_[A-Za-z0-9_.-]{20,}|gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,}|glpat-[A-Za-z0-9_.-]{20,}|xox[abposr]-[A-Za-z0-9-]{10,}|A[KS]IA[0-9A-Z]{16}(?![A-Za-z0-9])|hf_[A-Za-z0-9]{30,}|gsk_[A-Za-z0-9]{20,}|xai-[A-Za-z0-9]{20,}|ya29\.[A-Za-z0-9_-]{20,})/g,wd=()=>/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,kd=()=>/\b((?:api[_-]?key|apikey|access[_-]?token|refresh[_-]?token|id[_-]?token|client[_-]?secret|authorization|secret|password|passwd|pwd|token|auth|key|sig|signature)\s*[=:]\s*["']?)[^&\s"'`]+/gi,Id=()=>/(\/\/[^\s/:@]+:)[^\s@/]+@/g;function uB(e,t="[redacted]"){if(!e)return e;const r=e.split(dU);return r.length===1?Bh(e,t):r.map((n,o)=>o%2===1?`{{secret:${n}}}`:Bh(n,t)).join("")}var dU=/\{\{secret:([A-Z_][A-Z0-9_]*)\}\}/g;function Bh(e,t){return e&&e.replace(bd(),`$1${t}`).replace(Sd(),`Bearer ${t}`).replace(_d(),t).replace(wd(),t).replace(Id(),`$1${t}@`).replace(xd(),t).replace(Ed(),t).replace(kd(),`$1${t}`)}var RS=["authorization","cookie","password","token","secret","apikey","privatekey","pkceverifier","pkcechallenge","stripecustomer","stripesubscription","stripeprice","xmcpsessionauth","secwebsocketprotocol","xmcpjamharnesslease"],pU=new Set(["emaildomain"]),fU=["email"],hU=1e3,zh=3,Cl=12,mU=500,gU=40,TS=/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi,vU=()=>/\b(?:https?|wss?):\/\/[^\s"'`<>(){}]+/gi;function yU(e){return e.toLowerCase().replace(/[-_\s]/g,"")}function dB(e){const t=yU(e);return RS.some(r=>t.includes(r))}var pB={allowedKeys:[...pU],keySuffixes:fU,keySubstrings:RS,valueShapes:[bd(),Sd(),_d(),wd(),Id(),TS,xd(),Ed(),kd()].map(({source:e,flags:t})=>({source:e,flags:t.replace("g","")}))};function bU(e){try{const t=new URL(e),r=t.pathname!=="/"||t.search!==""||t.hash!==""?"/…":"";return`${t.protocol}//${t.host}${r}`}catch{return"[redacted-url]"}}function SU(e){const t=/[.,;:!?]+$/.exec(e)?.[0]??"";return bU(e.slice(0,e.length-t.length))+t}function Cd(e,t){return e.length>t?`${e.slice(0,t)}… [+${e.length-t} chars]`:e}function AS(e){return em(uU(e)).replace(vU(),SU).replace(bd(),"$1[redacted]").replace(Sd(),"Bearer [redacted-token]").replace(_d(),"[redacted-token]").replace(wd(),"[redacted-jwt]").replace(Id(),"$1[redacted]@").replace(TS,"[redacted-email]").replace(xd(),"[redacted-secret]").replace(Ed(),"[redacted-secret]").replace(kd(),"$1[redacted]")}function Sa(e,t=hU){return Cd(AS(e),t)}function _U(e){try{return Cd(Tc(e,0,new Set),mU)}catch{return"unreadable"}}var xU=/^[A-Za-z_$][\w$-]{0,63}$/;function EU(e){return xU.test(e)?Cd(AS(e),gU):"[key]"}function Tc(e,t,r){if(e===null)return"null";if(typeof e=="string")return`string(${e.length})`;if(typeof e!="object")return typeof e;if(e instanceof Date)return"date";if(e instanceof Error)return"error";if(ArrayBuffer.isView(e))return`bytes(${e.byteLength})`;if(e instanceof ArrayBuffer)return`bytes(${e.byteLength})`;if(r.has(e))return"circular";if(Array.isArray(e)){if(e.length===0||t>=zh)return`array(${e.length})`;r.add(e);const s=Tc(e[0],t+1,r);return r.delete(e),`array(${e.length})<${s}>`}const n=Object.keys(e);if(t>=zh)return`object(${n.length} keys)`;r.add(e);const o=n.slice(0,Cl).map(s=>`${EU(s)}: ${Tc(e[s],t+1,r)}`);return r.delete(e),n.length>Cl&&o.push(`…+${n.length-Cl}`),`{${o.join(", ")}}`}var wU=["localhost",/^\//,/^https?:\/\/(?:[A-Za-z0-9-]+\.)+convex\.(?:cloud|site)(?::\d+)?(?:[/?#]|$)/,/^https?:\/\/rt(?:-http)?\.mcpjam\.com(?::\d+)?(?:[/?#]|$)/],kU=["ResizeObserver loop limit exceeded","ResizeObserver loop completed with undelivered notifications",/^AbortError/,/^(?:TypeError: )?Failed to fetch(?: \([^()]*\))?$/,"NetworkError when attempting to fetch resource","Load failed"],IU=/^Failed to execute '(?:removeChild|insertBefore)' on 'Node'/;function CU(e){const t=e.exception?.values?.[0];if(t?.type!=="NotFoundError")return e;const r=t.value??"";return IU.test(r)&&(e.fingerprint=["dom-mutation-conflict",e.environment??"unknown"]),e}function RU(e){if(e.tags?.source!=="oauth_debugger_step")return e;const t=e.extra?.finding,r=typeof t=="string"&&t!==""?t:(e.exception?.values?.[0]?.value??"").slice(0,160),n=e.extra?.step;return e.fingerprint=["oauth-debugger-step",typeof n=="string"&&n!==""?n:"unknown",r,e.environment??"unknown"],e}function TU(e){return t=>{if(e!==void 0){const r=(t.exception?.values??[]).map(n=>{const o=n.stacktrace?.frames??[];return AU(o)?[]:o.map(s=>s.filename)});if(sm(r,e))return null}return Ps(RU(CU(t)))}}function AU(e){return e.length===1&&e[0]?.function==="?"}function NU(e){try{return new URL(e).origin}catch{return Ja(e)}}function Ps(e){return QS(e)}var Rl=120;function PU(e,t){if(!e||e.length===0)return Sa(t??"",Rl);const[r]=e,n=typeof r=="string"?Sa(r,Rl):r instanceof Error?`${r.name}: ${Sa(r.message,Rl)}`:_U(r);return e.length>1?`${n} (+${e.length-1} args)`:n}function MU(e,t){const r=e,n=r.data;switch(r.category){case"console":{const o=Array.isArray(n?.arguments)?n.arguments:void 0;r.message=PU(o,r.message),r.data={...n?.logger!==void 0?{logger:n.logger}:{},...o?{argumentCount:o.length}:{}};break}case"http":case"fetch":case"xhr":n&&typeof n.url=="string"&&(n.url=t==="origin"?NU(n.url):eU(n.url,t.appOrigin)),delete n?.["http.query"],delete n?.["http.fragment"];break;case"navigation":for(const o of["from","to"]){const s=n?.[o];n&&typeof s=="string"&&(n[o]=Ja(s))}break;default:typeof r.message=="string"&&(r.message=Sa(r.message,500))}return Ps(e)}function Ac(e,t){return MU(e,{appOrigin:t})}function OU(e){return{dsn:e.dsn,environment:e.environment,...e.release?{release:e.release}:{},...e.dist?{dist:e.dist}:{},enabled:e.enabled??!0,sendDefaultPii:!1,tracesSampleRate:e.tracesSampleRate??.1,tracePropagationTargets:wU,initialScope:{tags:{deployment:e.deployment}}}}var jU={client:"https://c9df3785c734acfe9dad2d0c1e963e28@o4510109778378752.ingest.us.sentry.io/4510111435063296",server:"https://3b91932f3169d72c846ce063d4e0c934@o4510109778378752.ingest.us.sentry.io/4510112200065025",electron:"https://6a41a208e72267f181f66c47138f2b9d@o4510109778378752.ingest.us.sentry.io/4510112190431232"},LU={replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1},DU={replaysSessionSampleRate:0,replaysOnErrorSampleRate:0};function FU(e){return{...OU({...e,dsn:e.dsn??jU.client}),ignoreErrors:kU,beforeSend:TU(e.documentOrigin),beforeSendTransaction:Ps,beforeBreadcrumb:t=>Ac(t,e.documentOrigin),...e.replayEnabled?LU:DU}}var HU=2,UU=3,$U=4,BU=0;function fr(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function zU(e){return e.startsWith("rr_")||e==="_cssText"}function WU(e,t){return zU(e)?t:typeof t=="string"?l0(e,t):e.toLowerCase()==="style"&&fr(t)?Object.fromEntries(Object.entries(t).map(([r,n])=>[r,typeof n=="string"?n0(n):n])):t}function NS(e){if(fr(e))for(const[t,r]of Object.entries(e))e[t]=WU(t,r)}function Wh(e){const t=[e];for(;t.length>0;){const r=t.pop();fr(r)&&(NS(r.attributes),Array.isArray(r.childNodes)&&t.push(...r.childNodes))}}function qU(e){if(!fr(e)||!fr(e.data))return;const t=e.data;if(e.type===5&&fr(t.payload)){const r=typeof window>"u"?void 0:window.location.origin;if(t.tag==="breadcrumb")t.payload=Ac(t.payload,r)??{};else if(t.tag==="performanceSpan"&&typeof t.payload.description=="string"){const n=Ac({category:"fetch",data:{url:t.payload.description}},r);t.payload.description=n?.data?.url}}if(e.type===$U&&typeof t.href=="string")t.href=i0(t.href);else if(e.type===HU)Wh(t.node);else if(e.type===UU&&t.source===BU){if(Array.isArray(t.adds))for(const r of t.adds)fr(r)&&Wh(r.node);if(Array.isArray(t.attributes))for(const r of t.attributes)fr(r)&&NS(r.attributes)}}function qh(e){if(!Array.isArray(e))return null;for(const t of e)qU(t);return QH(e)}async function PS(e,t){const r=new Response(e).body;if(!r)throw new Error("no body");return new Response(r.pipeThrough(t))}async function VU(e){return await(await PS(e,new DecompressionStream("deflate"))).text()}async function GU(e){return new Uint8Array(await(await PS(e,new CompressionStream("deflate"))).arrayBuffer())}function Vh(e){const t=JSON.parse(e);if(!fr(t)||typeof t.segment_id!="number"||!Number.isSafeInteger(t.segment_id)||t.segment_id<0)throw new Error("Invalid replay segment");return`${JSON.stringify({segment_id:t.segment_id})}
29
29
  `}async function YU(e){try{if(typeof e=="string"){const i=e.indexOf(`
30
- `);if(i<0)return null;const l=Vh(e.slice(0,i)),c=qh(JSON.parse(e.slice(i+1)));return c===null?null:`${l}${JSON.stringify(c)}`}if(!ArrayBuffer.isView(e))return null;const t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=t.indexOf(10);if(r<0)return null;const n=new TextEncoder().encode(Vh(new TextDecoder().decode(t.subarray(0,r)))),o=qh(JSON.parse(await VU(t.subarray(r+1))));if(o===null)return null;const s=await GU(JSON.stringify(o)),a=new Uint8Array(n.length+s.length);return a.set(n),a.set(s,n.length),a}catch{return null}}async function JU(e){const[t,r]=e;if(!r.some(([o])=>o?.type==="replay_recording"))return e;const n=[];for(const[o,s]of r){if(o?.type!=="replay_recording"){n.push([o,s]);continue}const a=await YU(s);a!==null&&n.push([{type:"replay_recording",length:typeof a=="string"?new TextEncoder().encode(a).length:a.length},a])}return[t,n]}function MS(){return window.isElectron===!0||nm().policy.content==="strict"}function OS(){return"prod"}function Nc(){const e=globalThis.__MCPJAM_TELEMETRY_FILES__??[],t=typeof window>"u"?"":window.location.origin,r=globalThis.__MCPJAM_TELEMETRY_DEBUG_IDS__??{};return{...HH,files:[...e],frameAliases:Object.fromEntries(e.map(n=>[`${t}/${n}`,n])),frameOutputNames:Object.fromEntries(e.map(n=>[n,`app:///${n}`])),frameDebugIds:Object.fromEntries(e.flatMap(n=>r[n]?[[`app:///${n}`,r[n]]]:[])),actorId:om()??void 0,release:"3.27.0",environment:OS(),platform:"javascript",dist:"npm"}}var Pc=new Set;function jS(e){typeof e=="string"&&Pc.add(e)}function KU(e,t,r=()=>!1,n){return{...e,send:async o=>{if(await r())return{};const s=await JU(o);if(await r())return{};const a=s[1].find(([g])=>g.type==="replay_event")?.[1],i=a?.event_id,l=Rc(a);l.strict&&jS(i);const c=[];let p=!1;for(const[g,S]of s[1]){const b=String(g.type);if(b==="client_report"&&S&&typeof S=="object"&&!Array.isArray(S)){const E=yH(S);E&&c.push([{type:b},E]);continue}if(b==="replay_recording"){!l.strict&&i&&!Pc.has(i)&&c.push([g,S]);continue}if(!S||typeof S!="object"||Array.isArray(S))continue;const _=["event","transaction","replay_event"].includes(b);if(_&&p)continue;const v=Rc(S,b==="span");if(v.drop)continue;if(v.strict||=MS(),!v.strict){if(!["event","transaction","span","replay_event"].includes(b)||b==="replay_event"&&(!i||Pc.has(i)))continue;const E=t(b,S,v.names);E&&(c.push([{type:b},_?{...E,event_id:xS("event_id"in E?E.event_id:void 0)}:E]),p||=_);continue}const w={...Nc(),actorId:v.actorId};b==="event"&&(c.push([{type:b},AH(S,w)]),p=!0),b==="span"&&"span_id"in S&&c.push([{type:b},ba(S,w)]),b==="transaction"&&(c.push([{type:b},NH(S,w)]),p=!0)}const d=c.map(([g])=>String(g.type));for(const[g]of o[1]){const S=String(g.type),b=d.indexOf(S);b>=0?d.splice(b,1):S!=="client_report"&&n?.("before_send",bH(S),1)}if(!c.length)return{};const h=c.find(([g])=>["event","transaction","replay_event"].includes(String(g.type)))?.[1],m=h&&typeof h=="object"&&"event_id"in h?h.event_id:void 0;return e.send([gH(m),c])},flush:o=>e.flush(o)}}function XU(e){const t=rx();return(r,n)=>{if(r.type!==void 0)return!1;if(M_(n.originalException)||b_(n.originalException)||ox(n.originalException))return!0;const o=r.exception?.values??[],s=o.map(p=>{const d=p.stacktrace?.frames??[];return d.length===1&&d[0]?.function==="?"?[]:d.map(h=>h.filename)});if(e&&sm(s,e))return!0;const a=o.find(p=>ip(p.value??"")),i=ip(a?.value??""),l=z_(a?.value??""),c=typeof r.tags?.convex_backend=="string"?r.tags.convex_backend:l?.convex_backend;return!!i&&t(c,i.requestId)}}var QU=(...e)=>e.some(t=>t==="1"||t==="true");function ZU(e){return typeof e=="string"&&/^[A-Za-z0-9:_-]{1,256}$/.test(e)}function LS(){const e=typeof window>"u"?void 0:window.electronAPI?.sentry?.installationId;return ZU(e)&&e.startsWith("installation:")?{user:{id:e},tags:{actor_kind:"installation"}}:void 0}var DS=null,FS=!1;function e$(e){DS=e;try{window.electronAPI?.sentry?.setActor(e?{id:e.id,kind:e.kind}:null)}catch{}if(!e){const r=LS();Yd(r?.user??null),Pl("actor_kind",r?.tags.actor_kind);return}const t=e.kind==="signedIn"&&Oc(e.id);FS=t,Yd({id:e.id,...e.email&&t?{email:e.email,username:e.email}:{},...e.name&&t?{name:e.name}:{}}),Pl("actor_kind",e.kind)}tm(()=>{const e=DS;e&&(e.kind==="signedIn"&&Oc(e.id))!==FS&&e$(e)});var t$=["email","username","name","ip_address","geo"];function r$(e,t){try{if(t)return e;const r=e.user;if(!r||typeof r!="object")return e;const n={...r};for(const o of t$)delete n[o];e.user=n}catch{}return e}function fB(e){const t=e?.trim();Pl("organization_id",t||void 0)}function n$(){return FU({environment:OS(),release:"3.27.0",dist:"npm",deployment:"self_hosted",enabled:!a0(),replayEnabled:rm()!=="off",documentOrigin:typeof window>"u"?void 0:window.location.origin})}function o$(e){const t=KS(e),r=f0(t?.relativePath??e);return r?`${t?"/p/:projectId":""}/${r.path}`.replace(/\/{2,}/g,"/"):e0(e)??"unknown_operation"}function s$(e){const t=Ps(e);if(!t){for(const r of ZS)delete e[r];return}for(const r of Object.keys(e))r in t||delete e[r];Object.assign(e,t)}function a$(e,t){return(r,n,o)=>{const s=n;let a=s;if(r==="event"&&(a=e.beforeSend(s)),r==="event"&&a&&a.type===void 0&&(a=t({...a,type:void 0},{})),!a)return null;if(r$(a,o),r==="span"){const i=Ps(n);return i?Uh(i,Nc()):null}return r==="replay_event"?delete a.breadcrumbs:a.breadcrumbs&&(a.breadcrumbs=a.breadcrumbs.map(i=>e.beforeBreadcrumb(i)).filter(i=>i!==null)),r==="transaction"&&(a=e.beforeSendTransaction(a)),a?(s$(a),Uh(a,Nc())):null}}function hB(){const e=n$(),t=LS(),r=U_(),n=XU(typeof window>"u"?void 0:window.location.origin);m1({...e,initialScope:{...e.initialScope,...t,tags:{...e.initialScope.tags,...t?.tags}},beforeSend:void 0,beforeSendTransaction:void 0,beforeBreadcrumb:e.beforeBreadcrumb,beforeSendSpan:BH,transport:o=>KU(Zv(o),a$(e,r),async()=>{if(!e.enabled||QU(navigator.doNotTrack))return!0;if(!window.isElectron)return!1;try{return await window.electronAPI?.sentry?.isDisabled?.()!==!1}catch{return!0}},o.recordDroppedEvent),integrations:[c1({beforeStartSpan:o=>({...o,name:o$(o.name)})})]}),me()?.on?.("preprocessEvent",(o,s)=>UH(o,s,n(o,s??{}))),me()?.on?.("spanStart",$H),me()?.on?.("beforeAddBreadcrumb",zH),tm(()=>i$(window.location))}var oa=!1,Gh="session",Yh=!1,Nn=null,Jh=!1;function i$(e){try{if(!s0())return;const t=c0()!=="full"||MS()||rm()!=="hosted"||o0(e);Jh=t;const r=me(),n=r?.getIntegrationByName?.("Replay");if(!n){!t&&!Yh&&r&&(Yh=!0,RI(DO(r0)));return}if(t){jS(n.getReplayId?.()),n.getReplayId?.()&&(oa=!0,Gh=n.getRecordingMode?.()==="buffer"?"buffer":"session");const o=n.stop?.();if(o&&typeof o.then=="function"){const s=Promise.resolve(o).catch(()=>{}),a=Nn?Promise.all([Nn,s]):s;Nn=a,a.then(()=>{Nn===a&&(Nn=null)})}return}if(oa){oa=!1;const o=Gh,s=()=>{o==="buffer"?n.startBuffering?.():n.start?.()};HS(()=>{if(Jh){oa=!0;return}s()})}}catch{}}function HS(e){const t=Nn;if(!t){e();return}t.then(()=>HS(e))}function mB(e,t){Vc(e,t)}function gB(e,t){if(t&&typeof t=="object"&&"tags"in t&&t.tags?.source==="chat_auth_resume"){Qa(r=>{r.addEventProcessor(n=>({...n,request:void 0,breadcrumbs:[],contexts:void 0})),Jd(e,t)});return}Jd(e,t)}var l$=["Base protocol","Client features","Server features","Extensions","Agent behavior","MCP Apps details"],Mc=["capabilities.uiExtension","mcpTasks","capabilities.skillsExtension","eventsDeliveryModes"],Kh={eventsDeliveryModes:"https://github.com/modelcontextprotocol/experimental-ext-triggers-events/blob/28ec35e905daa241f019981e2836b4a02f1c0368/docs/design-sketch-proposal.md",mcpTasks:"https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2663","capabilities.uiExtension":"https://modelcontextprotocol.io/extensions/apps/overview","capabilities.skillsExtension":"https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2640"};function Xh({field:e}){return Mc.includes(e.id)?"Extensions":e.section==="apps"?"MCP Apps details":e.section==="agent"?"Agent behavior":e.id.startsWith("capabilities.")||e.id.startsWith("roots")||e.id.startsWith("sampling")||e.id.startsWith("elicitation")?"Client features":e.id.startsWith("tool")||e.id.startsWith("resource")||e.id.startsWith("prompt")?"Server features":"Base protocol"}function vB({capabilitySlug:e}){const{catalog:t}=Vu(),r=t??jc(),{hosts:n,subjects:o}=(0,f.useMemo)(()=>Qu(r),[r]),s=(0,f.useMemo)(()=>td(n).map(({hostId:y})=>o[y]),[n,o]),a=(0,f.useMemo)(()=>[...Ni(o).flatMap(y=>{const A=ed(y);return A?[A]:[]}),Wa],[o]),i=Hb(e),l=i&&(i===Wa||Db(i.field,o))?i:null,[c,p]=hu(),[d,h]=(0,f.useState)(""),m=ai(),g=l?pS(l.field,s):[],S=c.get("slice")??"",b=g.includes(S)?S:"",_=(0,f.useMemo)(()=>l?kc(l.field,s,b):null,[l,s,b]),v=l?mr(l.field):"Capability not found",w=_?.eventsMode?"Support among probed clients":_?.reporting?"Reporting coverage":"Client adoption",E=l?Xh(l):"Extensions";Ku({surfaceId:"host-compare",snapshot:()=>Aj({capabilitySlug:l?.slug,capabilityLabel:l?v:null,slice:b&&b!=="any"?b:null,rows:_?.rows.map(({subject:y,status:A})=>({hostName:y.hostName,supportLevel:A,supportLabel:ZF(A,l?.field.id,_)}))??[]})});function T(y){const A=new URLSearchParams(c);A.delete("view"),y?A.set("slice",y):A.delete("slice"),p(A)}const I=l$.map(y=>({name:y,entries:a.filter(A=>Xh(A)===y)})).filter(({entries:y})=>y.length);I.find(({name:y})=>y==="Extensions")?.entries.sort((y,A)=>Mc.indexOf(y.field.id)-Mc.indexOf(A.field.id));const C=d.trim().toLowerCase(),L=C?I.map(({name:y,entries:A})=>({name:y,entries:A.filter(({field:N})=>mr(N).toLowerCase().includes(C))})).filter(({entries:y})=>y.length>0):I;return(0,u.jsx)(uS,{current:"capabilities",children:(0,u.jsxs)("div",{className:"grid gap-5 py-6 md:grid-cols-[220px_minmax(0,1fr)] lg:gap-8 lg:py-9",children:[(0,u.jsxs)("label",{className:"grid min-w-0 gap-1.5 text-xs text-muted-foreground md:hidden",children:["Browse capabilities",(0,u.jsxs)("span",{className:"relative",children:[(0,u.jsxs)("select",{className:"min-h-11 w-full min-w-0 appearance-none truncate rounded-lg border border-border bg-card pl-3 pr-10 text-base text-card-foreground forced-colors:appearance-auto",value:l?.slug??"",onChange:y=>m(is(y.target.value)),children:[!l&&(0,u.jsx)("option",{value:"",disabled:!0,children:"Choose a capability"}),I.map(({name:y,entries:A})=>(0,u.jsx)("optgroup",{label:y,children:A.map(({slug:N,field:W})=>(0,u.jsx)("option",{value:N,children:mr(W)},N))},y))]}),(0,u.jsx)($c,{"aria-hidden":"true",className:"pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground forced-colors:hidden"})]})]}),(0,u.jsxs)("nav",{"aria-label":"Browse capabilities",className:"hidden min-w-0 self-start md:sticky md:top-4 md:block md:max-h-[calc(100dvh-2rem)] md:overflow-auto",children:[(0,u.jsx)(fd,{className:"caniuse-sidebar-search mx-px mb-2 [&_input]:h-9 [&_input]:text-sm",iconClassName:"size-3.5",placeholder:"Search capabilities",value:d,onValueChange:h}),L.length===0&&(0,u.jsx)("p",{className:"px-2 py-2 text-sm text-muted-foreground",role:"status",children:"No matching capabilities"}),L.map(({name:y,entries:A})=>(0,u.jsxs)("details",{open:!!C||y===E,className:"group border-b border-border/60 last:border-b-0",children:[(0,u.jsxs)("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 rounded-md px-2 py-2.5 text-sm font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-ring group-open:text-foreground group-open:hover:bg-muted [&::-webkit-details-marker]:hidden",children:[y,(0,u.jsx)(p_,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground group-open:rotate-90"})]}),(0,u.jsx)("div",{className:"grid gap-0.5 pb-2",children:A.map(({slug:N,field:W})=>(0,u.jsx)(on,{to:is(N),"aria-current":N===l?.slug?"page":void 0,className:"rounded-md border border-transparent px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted hover:text-foreground aria-[current=page]:border-primary/40 aria-[current=page]:bg-primary/10 aria-[current=page]:font-semibold aria-[current=page]:text-primary",children:mr(W)},N))})]},C?`search-${y}`:y))]}),(0,u.jsxs)("div",{className:"min-w-0",children:[(0,u.jsxs)("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-3",children:[(0,u.jsxs)("div",{className:"min-w-0 max-w-full flex-[1_1_max-content]",children:[(0,u.jsx)("h1",{className:"wrap-break-word text-3xl font-bold tracking-tight sm:text-4xl",children:v}),l&&(0,u.jsxs)("p",{className:"mt-2 max-w-[66ch] text-sm leading-6 text-muted-foreground",children:[l.field.description,Kh[l.field.id]&&(0,u.jsxs)(u.Fragment,{children:[" ",(0,u.jsxs)("a",{className:"inline-flex items-center gap-1 font-medium text-foreground underline decoration-primary/70 underline-offset-4",href:Kh[l.field.id],target:"_blank",rel:"noreferrer",children:[l.field.id==="eventsDeliveryModes"?"Read proposal":"Read specification"," ",(0,u.jsx)(og,{className:"size-3"})]})]})]})]}),l&&_&&(0,u.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,u.jsx)(Ke,{asChild:!0,variant:"outline",size:"sm",className:"h-9",children:(0,u.jsxs)("a",{href:`https://app.mcpjam.com${l.field.id==="eventsDeliveryModes"?`${_a.events}?fallback=playground`:_a.playground}`,children:[(0,u.jsx)(sE,{className:"size-4"})," Test this capability"]})}),(0,u.jsx)(oH,{title:v,slug:l.slug,slice:b,coverage:_},`${l.slug}/${b}`)]})]}),l&&_?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("section",{"aria-label":w,className:"caniuse-glow mt-5 overflow-hidden rounded-xl border border-primary/25 bg-card text-card-foreground",children:[(0,u.jsxs)("div",{className:"grid sm:grid-cols-2",children:[(0,u.jsxs)("div",{className:"px-5 py-5 sm:px-7 sm:py-6",children:[(0,u.jsx)("p",{className:"text-sm font-medium text-foreground",children:w}),(0,u.jsx)("div",{className:"mt-1 text-5xl font-bold tracking-normal text-primary tabular-nums sm:text-7xl",children:_.score===null?"—":`${_.score}%`}),(0,u.jsx)("p",{className:"mt-2 text-pretty text-sm text-foreground/85",children:_.score===null?"No published client results yet.":_.eventsMode?gd(_):_.reporting?`${_.full} of ${_.probed} probed clients report a value.`:`${_.full} of ${_.probed} probed clients fully support this capability.`})]}),(0,u.jsxs)("div",{className:"border-t border-primary/15 px-5 py-4 sm:border-l sm:border-t-0 sm:px-7 sm:py-6",children:[(0,u.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Published results"}),(0,u.jsxs)("p",{className:"mt-1 text-3xl font-bold tracking-normal sm:text-5xl",children:[(0,u.jsx)("span",{className:"text-primary",children:_.published}),(0,u.jsxs)("span",{className:"text-foreground/85",children:["/",_.probed]})]}),(0,u.jsx)("p",{className:"mt-2 text-sm text-foreground/85",children:"Probed clients"})]})]}),g.length>0&&(0,u.jsx)("div",{className:"flex flex-wrap gap-1.5 border-t border-primary/20 bg-card/85 px-4 py-2 sm:px-7",role:"group","aria-label":"Coverage breakdown",children:(g.includes("any")?g:["",...g]).map(y=>{const A=(b||(g.includes("any")?"any":""))===y;return(0,u.jsx)(Ke,{variant:"outline",size:"sm",className:"h-10 bg-muted text-xs aria-pressed:border-primary/65 aria-pressed:bg-accent aria-pressed:text-accent-foreground sm:h-8","aria-pressed":A,onClick:()=>T(y==="any"?"":y),children:y?md(y):"All versions"},y)})})]}),(0,u.jsxs)("section",{className:"mt-6","aria-labelledby":"caniuse-map-heading",children:[(0,u.jsx)("h2",{id:"caniuse-map-heading",className:"mb-3 text-xl font-bold tracking-tight",children:"Client map"}),_.rows.length!==_.probed&&(0,u.jsx)("p",{className:"mb-3 text-sm text-muted-foreground",children:"The map shows every client in the catalog. Coverage scores use only the clients we tested."}),(0,u.jsx)(QF,{coverage:_})]})]}):(0,u.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:"Choose a capability from the list."})]})]})})}export{RD as $,J$ as $n,fg as $r,Mj as $t,QD as A,f2 as An,D$ as Ar,Rb as At,J2 as B,i2 as Bn,R$ as Br,lL as Bt,nB as C,fb as Cn,B$ as Cr,tL as Ct,nF as D,p2 as Dn,Ky as Dr,rL as Dt,oF as E,pj as En,z$ as Er,$2 as Et,zD as F,nj as Fn,vt as Fr,Gj as Ft,V2 as G,j1 as Gn,w$ as Gr,D2 as Gt,Y2 as H,W1 as Hn,k$ as Hr,sL as Ht,WD as I,l2 as In,ai as Ir,A2 as It,jD as J,H1 as Jn,cE as Jr,H2 as Jt,LD as K,$1 as Kn,I$ as Kr,iL as Kt,$D as L,a2 as Ln,A$ as Lr,Jj as Lt,KD as M,cj as Mn,M$ as Mr,Tb as Mt,GD as N,oj as Nn,O$ as Nr,Kj as Nt,tF as O,hj as On,on as Or,Cb as Ot,VD as P,u2 as Pn,P$ as Pr,N2 as Pt,K2 as Q,M1 as Qn,iE as Qr,Lj as Qt,tB as R,K1 as Rn,N$ as Rr,M2 as Rt,qa as S,m2 as Sn,$$ as Sr,U2 as St,sF as T,Ce as Tn,sb as Tr,T2 as Tt,G2 as U,o2 as Un,E$ as Ur,L2 as Ut,DD as V,n2 as Vn,C$ as Vr,j2 as Vt,ud as W,r2 as Wn,_g as Wr,aL as Wt,eB as X,e2 as Xn,vg as Xr,za as Xt,Z2 as Y,t2 as Yn,lE as Yr,xb as Yt,Q2 as Z,Z$ as Zn,nu as Zr,Eb as Zt,sB as _,Gm as _i,Pe as _n,os as _r,mL as _t,i$ as a,rE as ai,mc as an,R1 as ar,id as at,Va as b,b$ as bi,Ju as bn,ln as br,R2 as bt,dB as c,_$ as ci,_2 as cn,G$ as cr,nD as ct,iB as d,$x as di,y2 as dn,Ti as dr,od as dt,dg as ei,_b as en,Q$ as er,ad as et,fd as f,Wm as fi,ze as fn,Rs as fr,Bb as ft,tS as g,Ym as gi,ce as gn,ch as gr,vL as gt,aB as h,wx as hi,v2 as hn,ss as hr,B2 as ht,hB as i,nE as ii,E2 as in,P1 as ir,cd as it,XD as j,d2 as jn,hu as jr,oL as jt,eF as k,fj as kn,L$ as kr,nL as kt,uB as l,qx as li,b2 as ln,q$ as lr,nd as lt,SF as m,Jm as mi,_e as mn,Ts as mr,ZL as mt,mB as n,sE as ni,x2 as nn,A1 as nr,Qb as nt,e$ as o,og as oi,k2 as on,Vu as or,W2 as ot,pd as p,Xm as pi,as as pn,W$ as pr,z2 as pt,X2 as q,U1 as qn,ri as qr,F2 as qt,gB as r,oE as ri,w2 as rn,X$ as rr,Xb as rt,fB as s,Bx as si,S2 as sn,pc as sr,hD as st,vB as t,aE as ti,Sb as tn,K$ as tr,ld as tt,lB as u,Wx as ui,Ku as un,V$ as ur,rD as ut,fF as v,xx as vi,g2 as vn,w1 as vr,gL as vt,aF as w,Re as wn,U$ as wr,O2 as wt,rB as x,h2 as xn,ab as xr,C2 as xt,oB as y,mx as yi,vj as yn,E1 as yr,I2 as yt,q2 as z,s2 as zn,Bw as zr,P2 as zt};
30
+ `);if(i<0)return null;const l=Vh(e.slice(0,i)),c=qh(JSON.parse(e.slice(i+1)));return c===null?null:`${l}${JSON.stringify(c)}`}if(!ArrayBuffer.isView(e))return null;const t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=t.indexOf(10);if(r<0)return null;const n=new TextEncoder().encode(Vh(new TextDecoder().decode(t.subarray(0,r)))),o=qh(JSON.parse(await VU(t.subarray(r+1))));if(o===null)return null;const s=await GU(JSON.stringify(o)),a=new Uint8Array(n.length+s.length);return a.set(n),a.set(s,n.length),a}catch{return null}}async function JU(e){const[t,r]=e;if(!r.some(([o])=>o?.type==="replay_recording"))return e;const n=[];for(const[o,s]of r){if(o?.type!=="replay_recording"){n.push([o,s]);continue}const a=await YU(s);a!==null&&n.push([{type:"replay_recording",length:typeof a=="string"?new TextEncoder().encode(a).length:a.length},a])}return[t,n]}function MS(){return window.isElectron===!0||nm().policy.content==="strict"}function OS(){return"prod"}function Nc(){const e=globalThis.__MCPJAM_TELEMETRY_FILES__??[],t=typeof window>"u"?"":window.location.origin,r=globalThis.__MCPJAM_TELEMETRY_DEBUG_IDS__??{};return{...HH,files:[...e],frameAliases:Object.fromEntries(e.map(n=>[`${t}/${n}`,n])),frameOutputNames:Object.fromEntries(e.map(n=>[n,`app:///${n}`])),frameDebugIds:Object.fromEntries(e.flatMap(n=>r[n]?[[`app:///${n}`,r[n]]]:[])),actorId:om()??void 0,release:"3.27.1",environment:OS(),platform:"javascript",dist:"npm"}}var Pc=new Set;function jS(e){typeof e=="string"&&Pc.add(e)}function KU(e,t,r=()=>!1,n){return{...e,send:async o=>{if(await r())return{};const s=await JU(o);if(await r())return{};const a=s[1].find(([g])=>g.type==="replay_event")?.[1],i=a?.event_id,l=Rc(a);l.strict&&jS(i);const c=[];let p=!1;for(const[g,S]of s[1]){const b=String(g.type);if(b==="client_report"&&S&&typeof S=="object"&&!Array.isArray(S)){const E=yH(S);E&&c.push([{type:b},E]);continue}if(b==="replay_recording"){!l.strict&&i&&!Pc.has(i)&&c.push([g,S]);continue}if(!S||typeof S!="object"||Array.isArray(S))continue;const _=["event","transaction","replay_event"].includes(b);if(_&&p)continue;const v=Rc(S,b==="span");if(v.drop)continue;if(v.strict||=MS(),!v.strict){if(!["event","transaction","span","replay_event"].includes(b)||b==="replay_event"&&(!i||Pc.has(i)))continue;const E=t(b,S,v.names);E&&(c.push([{type:b},_?{...E,event_id:xS("event_id"in E?E.event_id:void 0)}:E]),p||=_);continue}const w={...Nc(),actorId:v.actorId};b==="event"&&(c.push([{type:b},AH(S,w)]),p=!0),b==="span"&&"span_id"in S&&c.push([{type:b},ba(S,w)]),b==="transaction"&&(c.push([{type:b},NH(S,w)]),p=!0)}const d=c.map(([g])=>String(g.type));for(const[g]of o[1]){const S=String(g.type),b=d.indexOf(S);b>=0?d.splice(b,1):S!=="client_report"&&n?.("before_send",bH(S),1)}if(!c.length)return{};const h=c.find(([g])=>["event","transaction","replay_event"].includes(String(g.type)))?.[1],m=h&&typeof h=="object"&&"event_id"in h?h.event_id:void 0;return e.send([gH(m),c])},flush:o=>e.flush(o)}}function XU(e){const t=rx();return(r,n)=>{if(r.type!==void 0)return!1;if(M_(n.originalException)||b_(n.originalException)||ox(n.originalException))return!0;const o=r.exception?.values??[],s=o.map(p=>{const d=p.stacktrace?.frames??[];return d.length===1&&d[0]?.function==="?"?[]:d.map(h=>h.filename)});if(e&&sm(s,e))return!0;const a=o.find(p=>ip(p.value??"")),i=ip(a?.value??""),l=z_(a?.value??""),c=typeof r.tags?.convex_backend=="string"?r.tags.convex_backend:l?.convex_backend;return!!i&&t(c,i.requestId)}}var QU=(...e)=>e.some(t=>t==="1"||t==="true");function ZU(e){return typeof e=="string"&&/^[A-Za-z0-9:_-]{1,256}$/.test(e)}function LS(){const e=typeof window>"u"?void 0:window.electronAPI?.sentry?.installationId;return ZU(e)&&e.startsWith("installation:")?{user:{id:e},tags:{actor_kind:"installation"}}:void 0}var DS=null,FS=!1;function e$(e){DS=e;try{window.electronAPI?.sentry?.setActor(e?{id:e.id,kind:e.kind}:null)}catch{}if(!e){const r=LS();Yd(r?.user??null),Pl("actor_kind",r?.tags.actor_kind);return}const t=e.kind==="signedIn"&&Oc(e.id);FS=t,Yd({id:e.id,...e.email&&t?{email:e.email,username:e.email}:{},...e.name&&t?{name:e.name}:{}}),Pl("actor_kind",e.kind)}tm(()=>{const e=DS;e&&(e.kind==="signedIn"&&Oc(e.id))!==FS&&e$(e)});var t$=["email","username","name","ip_address","geo"];function r$(e,t){try{if(t)return e;const r=e.user;if(!r||typeof r!="object")return e;const n={...r};for(const o of t$)delete n[o];e.user=n}catch{}return e}function fB(e){const t=e?.trim();Pl("organization_id",t||void 0)}function n$(){return FU({environment:OS(),release:"3.27.1",dist:"npm",deployment:"self_hosted",enabled:!a0(),replayEnabled:rm()!=="off",documentOrigin:typeof window>"u"?void 0:window.location.origin})}function o$(e){const t=KS(e),r=f0(t?.relativePath??e);return r?`${t?"/p/:projectId":""}/${r.path}`.replace(/\/{2,}/g,"/"):e0(e)??"unknown_operation"}function s$(e){const t=Ps(e);if(!t){for(const r of ZS)delete e[r];return}for(const r of Object.keys(e))r in t||delete e[r];Object.assign(e,t)}function a$(e,t){return(r,n,o)=>{const s=n;let a=s;if(r==="event"&&(a=e.beforeSend(s)),r==="event"&&a&&a.type===void 0&&(a=t({...a,type:void 0},{})),!a)return null;if(r$(a,o),r==="span"){const i=Ps(n);return i?Uh(i,Nc()):null}return r==="replay_event"?delete a.breadcrumbs:a.breadcrumbs&&(a.breadcrumbs=a.breadcrumbs.map(i=>e.beforeBreadcrumb(i)).filter(i=>i!==null)),r==="transaction"&&(a=e.beforeSendTransaction(a)),a?(s$(a),Uh(a,Nc())):null}}function hB(){const e=n$(),t=LS(),r=U_(),n=XU(typeof window>"u"?void 0:window.location.origin);m1({...e,initialScope:{...e.initialScope,...t,tags:{...e.initialScope.tags,...t?.tags}},beforeSend:void 0,beforeSendTransaction:void 0,beforeBreadcrumb:e.beforeBreadcrumb,beforeSendSpan:BH,transport:o=>KU(Zv(o),a$(e,r),async()=>{if(!e.enabled||QU(navigator.doNotTrack))return!0;if(!window.isElectron)return!1;try{return await window.electronAPI?.sentry?.isDisabled?.()!==!1}catch{return!0}},o.recordDroppedEvent),integrations:[c1({beforeStartSpan:o=>({...o,name:o$(o.name)})})]}),me()?.on?.("preprocessEvent",(o,s)=>UH(o,s,n(o,s??{}))),me()?.on?.("spanStart",$H),me()?.on?.("beforeAddBreadcrumb",zH),tm(()=>i$(window.location))}var oa=!1,Gh="session",Yh=!1,Nn=null,Jh=!1;function i$(e){try{if(!s0())return;const t=c0()!=="full"||MS()||rm()!=="hosted"||o0(e);Jh=t;const r=me(),n=r?.getIntegrationByName?.("Replay");if(!n){!t&&!Yh&&r&&(Yh=!0,RI(DO(r0)));return}if(t){jS(n.getReplayId?.()),n.getReplayId?.()&&(oa=!0,Gh=n.getRecordingMode?.()==="buffer"?"buffer":"session");const o=n.stop?.();if(o&&typeof o.then=="function"){const s=Promise.resolve(o).catch(()=>{}),a=Nn?Promise.all([Nn,s]):s;Nn=a,a.then(()=>{Nn===a&&(Nn=null)})}return}if(oa){oa=!1;const o=Gh,s=()=>{o==="buffer"?n.startBuffering?.():n.start?.()};HS(()=>{if(Jh){oa=!0;return}s()})}}catch{}}function HS(e){const t=Nn;if(!t){e();return}t.then(()=>HS(e))}function mB(e,t){Vc(e,t)}function gB(e,t){if(t&&typeof t=="object"&&"tags"in t&&t.tags?.source==="chat_auth_resume"){Qa(r=>{r.addEventProcessor(n=>({...n,request:void 0,breadcrumbs:[],contexts:void 0})),Jd(e,t)});return}Jd(e,t)}var l$=["Base protocol","Client features","Server features","Extensions","Agent behavior","MCP Apps details"],Mc=["capabilities.uiExtension","mcpTasks","capabilities.skillsExtension","eventsDeliveryModes"],Kh={eventsDeliveryModes:"https://github.com/modelcontextprotocol/experimental-ext-triggers-events/blob/28ec35e905daa241f019981e2836b4a02f1c0368/docs/design-sketch-proposal.md",mcpTasks:"https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2663","capabilities.uiExtension":"https://modelcontextprotocol.io/extensions/apps/overview","capabilities.skillsExtension":"https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2640"};function Xh({field:e}){return Mc.includes(e.id)?"Extensions":e.section==="apps"?"MCP Apps details":e.section==="agent"?"Agent behavior":e.id.startsWith("capabilities.")||e.id.startsWith("roots")||e.id.startsWith("sampling")||e.id.startsWith("elicitation")?"Client features":e.id.startsWith("tool")||e.id.startsWith("resource")||e.id.startsWith("prompt")?"Server features":"Base protocol"}function vB({capabilitySlug:e}){const{catalog:t}=Vu(),r=t??jc(),{hosts:n,subjects:o}=(0,f.useMemo)(()=>Qu(r),[r]),s=(0,f.useMemo)(()=>td(n).map(({hostId:y})=>o[y]),[n,o]),a=(0,f.useMemo)(()=>[...Ni(o).flatMap(y=>{const A=ed(y);return A?[A]:[]}),Wa],[o]),i=Hb(e),l=i&&(i===Wa||Db(i.field,o))?i:null,[c,p]=hu(),[d,h]=(0,f.useState)(""),m=ai(),g=l?pS(l.field,s):[],S=c.get("slice")??"",b=g.includes(S)?S:"",_=(0,f.useMemo)(()=>l?kc(l.field,s,b):null,[l,s,b]),v=l?mr(l.field):"Capability not found",w=_?.eventsMode?"Support among probed clients":_?.reporting?"Reporting coverage":"Client adoption",E=l?Xh(l):"Extensions";Ku({surfaceId:"host-compare",snapshot:()=>Aj({capabilitySlug:l?.slug,capabilityLabel:l?v:null,slice:b&&b!=="any"?b:null,rows:_?.rows.map(({subject:y,status:A})=>({hostName:y.hostName,supportLevel:A,supportLabel:ZF(A,l?.field.id,_)}))??[]})});function T(y){const A=new URLSearchParams(c);A.delete("view"),y?A.set("slice",y):A.delete("slice"),p(A)}const I=l$.map(y=>({name:y,entries:a.filter(A=>Xh(A)===y)})).filter(({entries:y})=>y.length);I.find(({name:y})=>y==="Extensions")?.entries.sort((y,A)=>Mc.indexOf(y.field.id)-Mc.indexOf(A.field.id));const C=d.trim().toLowerCase(),L=C?I.map(({name:y,entries:A})=>({name:y,entries:A.filter(({field:N})=>mr(N).toLowerCase().includes(C))})).filter(({entries:y})=>y.length>0):I;return(0,u.jsx)(uS,{current:"capabilities",children:(0,u.jsxs)("div",{className:"grid gap-5 py-6 md:grid-cols-[220px_minmax(0,1fr)] lg:gap-8 lg:py-9",children:[(0,u.jsxs)("label",{className:"grid min-w-0 gap-1.5 text-xs text-muted-foreground md:hidden",children:["Browse capabilities",(0,u.jsxs)("span",{className:"relative",children:[(0,u.jsxs)("select",{className:"min-h-11 w-full min-w-0 appearance-none truncate rounded-lg border border-border bg-card pl-3 pr-10 text-base text-card-foreground forced-colors:appearance-auto",value:l?.slug??"",onChange:y=>m(is(y.target.value)),children:[!l&&(0,u.jsx)("option",{value:"",disabled:!0,children:"Choose a capability"}),I.map(({name:y,entries:A})=>(0,u.jsx)("optgroup",{label:y,children:A.map(({slug:N,field:W})=>(0,u.jsx)("option",{value:N,children:mr(W)},N))},y))]}),(0,u.jsx)($c,{"aria-hidden":"true",className:"pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground forced-colors:hidden"})]})]}),(0,u.jsxs)("nav",{"aria-label":"Browse capabilities",className:"hidden min-w-0 self-start md:sticky md:top-4 md:block md:max-h-[calc(100dvh-2rem)] md:overflow-auto",children:[(0,u.jsx)(fd,{className:"caniuse-sidebar-search mx-px mb-2 [&_input]:h-9 [&_input]:text-sm",iconClassName:"size-3.5",placeholder:"Search capabilities",value:d,onValueChange:h}),L.length===0&&(0,u.jsx)("p",{className:"px-2 py-2 text-sm text-muted-foreground",role:"status",children:"No matching capabilities"}),L.map(({name:y,entries:A})=>(0,u.jsxs)("details",{open:!!C||y===E,className:"group border-b border-border/60 last:border-b-0",children:[(0,u.jsxs)("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 rounded-md px-2 py-2.5 text-sm font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-ring group-open:text-foreground group-open:hover:bg-muted [&::-webkit-details-marker]:hidden",children:[y,(0,u.jsx)(p_,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground group-open:rotate-90"})]}),(0,u.jsx)("div",{className:"grid gap-0.5 pb-2",children:A.map(({slug:N,field:W})=>(0,u.jsx)(on,{to:is(N),"aria-current":N===l?.slug?"page":void 0,className:"rounded-md border border-transparent px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted hover:text-foreground aria-[current=page]:border-primary/40 aria-[current=page]:bg-primary/10 aria-[current=page]:font-semibold aria-[current=page]:text-primary",children:mr(W)},N))})]},C?`search-${y}`:y))]}),(0,u.jsxs)("div",{className:"min-w-0",children:[(0,u.jsxs)("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-3",children:[(0,u.jsxs)("div",{className:"min-w-0 max-w-full flex-[1_1_max-content]",children:[(0,u.jsx)("h1",{className:"wrap-break-word text-3xl font-bold tracking-tight sm:text-4xl",children:v}),l&&(0,u.jsxs)("p",{className:"mt-2 max-w-[66ch] text-sm leading-6 text-muted-foreground",children:[l.field.description,Kh[l.field.id]&&(0,u.jsxs)(u.Fragment,{children:[" ",(0,u.jsxs)("a",{className:"inline-flex items-center gap-1 font-medium text-foreground underline decoration-primary/70 underline-offset-4",href:Kh[l.field.id],target:"_blank",rel:"noreferrer",children:[l.field.id==="eventsDeliveryModes"?"Read proposal":"Read specification"," ",(0,u.jsx)(og,{className:"size-3"})]})]})]})]}),l&&_&&(0,u.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,u.jsx)(Ke,{asChild:!0,variant:"outline",size:"sm",className:"h-9",children:(0,u.jsxs)("a",{href:`https://app.mcpjam.com${l.field.id==="eventsDeliveryModes"?`${_a.events}?fallback=playground`:_a.playground}`,children:[(0,u.jsx)(sE,{className:"size-4"})," Test this capability"]})}),(0,u.jsx)(oH,{title:v,slug:l.slug,slice:b,coverage:_},`${l.slug}/${b}`)]})]}),l&&_?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("section",{"aria-label":w,className:"caniuse-glow mt-5 overflow-hidden rounded-xl border border-primary/25 bg-card text-card-foreground",children:[(0,u.jsxs)("div",{className:"grid sm:grid-cols-2",children:[(0,u.jsxs)("div",{className:"px-5 py-5 sm:px-7 sm:py-6",children:[(0,u.jsx)("p",{className:"text-sm font-medium text-foreground",children:w}),(0,u.jsx)("div",{className:"mt-1 text-5xl font-bold tracking-normal text-primary tabular-nums sm:text-7xl",children:_.score===null?"—":`${_.score}%`}),(0,u.jsx)("p",{className:"mt-2 text-pretty text-sm text-foreground/85",children:_.score===null?"No published client results yet.":_.eventsMode?gd(_):_.reporting?`${_.full} of ${_.probed} probed clients report a value.`:`${_.full} of ${_.probed} probed clients fully support this capability.`})]}),(0,u.jsxs)("div",{className:"border-t border-primary/15 px-5 py-4 sm:border-l sm:border-t-0 sm:px-7 sm:py-6",children:[(0,u.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Published results"}),(0,u.jsxs)("p",{className:"mt-1 text-3xl font-bold tracking-normal sm:text-5xl",children:[(0,u.jsx)("span",{className:"text-primary",children:_.published}),(0,u.jsxs)("span",{className:"text-foreground/85",children:["/",_.probed]})]}),(0,u.jsx)("p",{className:"mt-2 text-sm text-foreground/85",children:"Probed clients"})]})]}),g.length>0&&(0,u.jsx)("div",{className:"flex flex-wrap gap-1.5 border-t border-primary/20 bg-card/85 px-4 py-2 sm:px-7",role:"group","aria-label":"Coverage breakdown",children:(g.includes("any")?g:["",...g]).map(y=>{const A=(b||(g.includes("any")?"any":""))===y;return(0,u.jsx)(Ke,{variant:"outline",size:"sm",className:"h-10 bg-muted text-xs aria-pressed:border-primary/65 aria-pressed:bg-accent aria-pressed:text-accent-foreground sm:h-8","aria-pressed":A,onClick:()=>T(y==="any"?"":y),children:y?md(y):"All versions"},y)})})]}),(0,u.jsxs)("section",{className:"mt-6","aria-labelledby":"caniuse-map-heading",children:[(0,u.jsx)("h2",{id:"caniuse-map-heading",className:"mb-3 text-xl font-bold tracking-tight",children:"Client map"}),_.rows.length!==_.probed&&(0,u.jsx)("p",{className:"mb-3 text-sm text-muted-foreground",children:"The map shows every client in the catalog. Coverage scores use only the clients we tested."}),(0,u.jsx)(QF,{coverage:_})]})]}):(0,u.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:"Choose a capability from the list."})]})]})})}export{RD as $,J$ as $n,fg as $r,Mj as $t,QD as A,f2 as An,D$ as Ar,Rb as At,J2 as B,i2 as Bn,R$ as Br,lL as Bt,nB as C,fb as Cn,B$ as Cr,tL as Ct,nF as D,p2 as Dn,Ky as Dr,rL as Dt,oF as E,pj as En,z$ as Er,$2 as Et,zD as F,nj as Fn,vt as Fr,Gj as Ft,V2 as G,j1 as Gn,w$ as Gr,D2 as Gt,Y2 as H,W1 as Hn,k$ as Hr,sL as Ht,WD as I,l2 as In,ai as Ir,A2 as It,jD as J,H1 as Jn,cE as Jr,H2 as Jt,LD as K,$1 as Kn,I$ as Kr,iL as Kt,$D as L,a2 as Ln,A$ as Lr,Jj as Lt,KD as M,cj as Mn,M$ as Mr,Tb as Mt,GD as N,oj as Nn,O$ as Nr,Kj as Nt,tF as O,hj as On,on as Or,Cb as Ot,VD as P,u2 as Pn,P$ as Pr,N2 as Pt,K2 as Q,M1 as Qn,iE as Qr,Lj as Qt,tB as R,K1 as Rn,N$ as Rr,M2 as Rt,qa as S,m2 as Sn,$$ as Sr,U2 as St,sF as T,Ce as Tn,sb as Tr,T2 as Tt,G2 as U,o2 as Un,E$ as Ur,L2 as Ut,DD as V,n2 as Vn,C$ as Vr,j2 as Vt,ud as W,r2 as Wn,_g as Wr,aL as Wt,eB as X,e2 as Xn,vg as Xr,za as Xt,Z2 as Y,t2 as Yn,lE as Yr,xb as Yt,Q2 as Z,Z$ as Zn,nu as Zr,Eb as Zt,sB as _,Gm as _i,Pe as _n,os as _r,mL as _t,i$ as a,rE as ai,mc as an,R1 as ar,id as at,Va as b,b$ as bi,Ju as bn,ln as br,R2 as bt,dB as c,_$ as ci,_2 as cn,G$ as cr,nD as ct,iB as d,$x as di,y2 as dn,Ti as dr,od as dt,dg as ei,_b as en,Q$ as er,ad as et,fd as f,Wm as fi,ze as fn,Rs as fr,Bb as ft,tS as g,Ym as gi,ce as gn,ch as gr,vL as gt,aB as h,wx as hi,v2 as hn,ss as hr,B2 as ht,hB as i,nE as ii,E2 as in,P1 as ir,cd as it,XD as j,d2 as jn,hu as jr,oL as jt,eF as k,fj as kn,L$ as kr,nL as kt,uB as l,qx as li,b2 as ln,q$ as lr,nd as lt,SF as m,Jm as mi,_e as mn,Ts as mr,ZL as mt,mB as n,sE as ni,x2 as nn,A1 as nr,Qb as nt,e$ as o,og as oi,k2 as on,Vu as or,W2 as ot,pd as p,Xm as pi,as as pn,W$ as pr,z2 as pt,X2 as q,U1 as qn,ri as qr,F2 as qt,gB as r,oE as ri,w2 as rn,X$ as rr,Xb as rt,fB as s,Bx as si,S2 as sn,pc as sr,hD as st,vB as t,aE as ti,Sb as tn,K$ as tr,ld as tt,lB as u,Wx as ui,Ku as un,V$ as ur,rD as ut,fF as v,xx as vi,g2 as vn,w1 as vr,gL as vt,aF as w,Re as wn,U$ as wr,O2 as wt,rB as x,h2 as xn,ab as xr,C2 as xt,oB as y,mx as yi,vj as yn,E1 as yr,I2 as yt,q2 as z,s2 as zn,Bw as zr,P2 as zt};
31
31
 
32
- //# sourceMappingURL=CaniuseCapabilityPage-CXmikV_v.js.map
32
+ //# sourceMappingURL=CaniuseCapabilityPage-CrC-cTZL.js.map