@decocms/mesh 1.0.0-alpha.6 → 1.0.0-alpha.8

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 (75) hide show
  1. package/dist/client/assets/{alert-dialog-Caf0mgW9.js → alert-dialog-pYV3wSPs.js} +1 -1
  2. package/dist/client/assets/{auth-CGqqbEan.js → auth-D1xg1rd7.js} +1 -1
  3. package/dist/client/assets/{auth-catchall-Bw-KJI1v.js → auth-catchall-BZaDWHEa.js} +1 -1
  4. package/dist/client/assets/{avatar-CdPaDOIs.js → avatar-DAMcOnM4.js} +1 -1
  5. package/dist/client/assets/{badge-j-myHF25.js → badge-Bi_GpkO_.js} +1 -1
  6. package/dist/client/assets/{button-DnKGwZ1P.js → button-G3aMPyFq.js} +1 -1
  7. package/dist/client/assets/{card-I0CWqn2J.js → card-CE1-D3SY.js} +1 -1
  8. package/dist/client/assets/{checkbox-v3iP8MNg.js → checkbox-DgaTW36u.js} +1 -1
  9. package/dist/client/assets/{circle-alert-CpqBZI3V.js → circle-alert-B9wPiUFk.js} +1 -1
  10. package/dist/client/assets/{collection-detail-BSfYYwzG.js → collection-detail-Bj_y2m-h.js} +1 -1
  11. package/dist/client/assets/{collection-display-button-Cws3c2TG.js → collection-display-button-BOWw7rwa.js} +1 -1
  12. package/dist/client/assets/{collection-header-CJC3zXGa.js → collection-header-BeSLFcaG.js} +1 -1
  13. package/dist/client/assets/{collection-page-CkAonVNX.js → collection-page-C_ScBEek.js} +1 -1
  14. package/dist/client/assets/{collection-search-Bd4XQ4_K.js → collection-search-DFSSOoxU.js} +1 -1
  15. package/dist/client/assets/{collection-table-wrapper-Dv4rgxdy.js → collection-table-wrapper-CKt7U95e.js} +1 -1
  16. package/dist/client/assets/{connection-card-CgJm9r5i.js → connection-card-Bj0wmYgV.js} +1 -1
  17. package/dist/client/assets/{connection-detail-HAGAOVY9.js → connection-detail-kWSPNag3.js} +1 -1
  18. package/dist/client/assets/{connections-C8Z338-P.js → connections-C7HPEBbQ.js} +1 -1
  19. package/dist/client/assets/{create-organization-dialog-CWgFMDXV.js → create-organization-dialog-BpSaszPg.js} +1 -1
  20. package/dist/client/assets/{dialog-Qusr5Dgc.js → dialog-C1eFYVPZ.js} +1 -1
  21. package/dist/client/assets/{dropdown-menu-BIeRR6rM.js → dropdown-menu-CtSLEdvQ.js} +1 -1
  22. package/dist/client/assets/{empty-state-DV83eIhT.js → empty-state-YCqZyamY.js} +1 -1
  23. package/dist/client/assets/{error-boundary-qOVcoWbq.js → error-boundary-9CuK9oWa.js} +1 -1
  24. package/dist/client/assets/{extract-connection-data-DzgXoQyz.js → extract-connection-data-Cu9jjhV-.js} +1 -1
  25. package/dist/client/assets/{form-0C1lYHJ2.js → form-BsxjQn2d.js} +1 -1
  26. package/dist/client/assets/{gateway-detail-mD14k5vr.js → gateway-detail-C5d-KPPl.js} +1 -1
  27. package/dist/client/assets/{gateways-BSGLH5Mc.js → gateways-BSgfG0sP.js} +1 -1
  28. package/dist/client/assets/{home-B1IT0slW.js → home-Bu1wH9nU.js} +1 -1
  29. package/dist/client/assets/{icon-C1glN-Ga.js → icon-Cxep_tfx.js} +1 -1
  30. package/dist/client/assets/{index-D2ODleHN.js → index-BRGTweKk.js} +1 -1
  31. package/dist/client/assets/{index-DqmRoUE9.js → index-Bhg5-H1t.js} +1 -1
  32. package/dist/client/assets/{index-C1xA8jg5.js → index-BtenH3n7.js} +1 -1
  33. package/dist/client/assets/{index-B5e6fytH.js → index-MoI-rvC3.js} +15 -15
  34. package/dist/client/assets/{index-Chpp7zg0.js → index-fqd6S2iW.js} +1 -1
  35. package/dist/client/assets/{input-DpAKmHHm.js → input-CXe38a5R.js} +1 -1
  36. package/dist/client/assets/{integration-icon-C_Dk6BbN.js → integration-icon-C162QlgN.js} +1 -1
  37. package/dist/client/assets/{layout-BMHVtK0w.js → layout-DqgJyIdL.js} +1 -1
  38. package/dist/client/assets/{lazy-highlighter-9rAB2zZq.js → lazy-highlighter-DdBDXFu3.js} +1 -1
  39. package/dist/client/assets/{localstorage-keys-DC7ymQmZ.js → localstorage-keys-CzubTFSO.js} +1 -1
  40. package/dist/client/assets/{login-BMjQy3tL.js → login-CTfLDBBt.js} +1 -1
  41. package/dist/client/assets/{members-k_V-Gxfi.js → members-B8JX8n6Q.js} +1 -1
  42. package/dist/client/assets/{monitoring-BG-rBDyv.js → monitoring-D7cSD8lu.js} +1 -1
  43. package/dist/client/assets/{monitoring-stats-row-PYfuhQHX.js → monitoring-stats-row-CX3aDsAR.js} +1 -1
  44. package/dist/client/assets/{oauth-callback-CQ4D18kW.js → oauth-callback-BSpJjtnq.js} +1 -1
  45. package/dist/client/assets/{page-h-kmS-QS.js → page-DEl_xdLR.js} +1 -1
  46. package/dist/client/assets/{popover-TCQphQTw.js → popover-iDiv_aJK.js} +1 -1
  47. package/dist/client/assets/{prism-CcSucC56.js → prism-vdds-nIT.js} +1 -1
  48. package/dist/client/assets/{resource-tabs-E4yf0eYT.js → resource-tabs-CNxf_u1f.js} +1 -1
  49. package/dist/client/assets/{schema-BLzWyGtx.js → schema-BJ2fRDqu.js} +1 -1
  50. package/dist/client/assets/{select-fvQCifl4.js → select-B4j1Cb8E.js} +1 -1
  51. package/dist/client/assets/{settings-Bjk195Z6.js → settings-CJre-VTk.js} +1 -1
  52. package/dist/client/assets/{shell-layout-B8oNCzSa.js → shell-layout-BqISuLuR.js} +3 -3
  53. package/dist/client/assets/{spinner-Cck765yW.js → spinner-BgjBycmB.js} +1 -1
  54. package/dist/client/assets/{store-DD1aCoWU.js → store-CL6xQwes.js} +1 -1
  55. package/dist/client/assets/{store-app-detail-DZvzqAVf.js → store-app-detail-BqHjNu0f.js} +1 -1
  56. package/dist/client/assets/{textarea--4iImQiq.js → textarea-BK0_vna7.js} +1 -1
  57. package/dist/client/assets/{tool-set-selector-Fu1vBXWK.js → tool-set-selector-DYpFtHWh.js} +1 -1
  58. package/dist/client/assets/{tooltip-DjXyjtiH.js → tooltip-CyReuecv.js} +1 -1
  59. package/dist/client/assets/{upload-DkfUhTLj.js → upload-n_AaBb-Z.js} +1 -1
  60. package/dist/client/assets/{use-binding-BLIUV5ER.js → use-binding-DdwHCRqV.js} +1 -1
  61. package/dist/client/assets/{use-connection-IMyxygAc.js → use-connection-DiHU9E79.js} +1 -1
  62. package/dist/client/assets/{use-gateway-CuMrhcvh.js → use-gateway-B9o1M04u.js} +1 -1
  63. package/dist/client/assets/{use-list-state-Bas0EIwN.js → use-list-state-CKwEYaZT.js} +1 -1
  64. package/dist/client/assets/{use-members-DHcrnzKP.js → use-members-BH0kTiC2.js} +1 -1
  65. package/dist/client/assets/{use-mobile-CxX0wu31.js → use-mobile-BjUr6Jaq.js} +1 -1
  66. package/dist/client/assets/{use-organization-settings-CpvpbwdB.js → use-organization-settings-Cywci2R8.js} +1 -1
  67. package/dist/client/assets/{use-tool-call-p0lqBezD.js → use-tool-call-CPpXYXAZ.js} +1 -1
  68. package/dist/client/assets/useQuery-BpCQj7wy.js +1 -0
  69. package/dist/client/assets/utils-BLlwSV8I.js +1 -0
  70. package/dist/client/index.html +1 -1
  71. package/dist/server/cli.js +163 -163
  72. package/dist/server/server.js +158 -158
  73. package/package.json +1 -1
  74. package/dist/client/assets/useQuery-BO2jzwkw.js +0 -1
  75. package/dist/client/assets/utils-BLBjpUfr.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as i,bA as m,az as A,j as r,bB as w,aB as T,ab as O,aE as M,bC as I,ad as D,ac as z,ax as F,ae as L,a9 as B,aa as G,a8 as k,c as n}from"./index-B5e6fytH.js";import{c as p}from"./utils-BLBjpUfr.js";import{b as v}from"./button-DnKGwZ1P.js";var x="AlertDialog",[H]=T(x,[m]),d=m(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(k,{...a,...t,modal:!0})};N.displayName=x;var V="AlertDialogTrigger",W=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(F,{...o,...a,ref:e})});W.displayName=V;var Y="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t})};y.displayName=Y;var q="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(L,{...o,...a,ref:e})});_.displayName=q;var f="AlertDialogContent",[J,K]=H(f),Q=I("AlertDialogContent"),b=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=A(e,c),u=i.useRef(null);return r.jsx(w,{contentName:f,titleName:j,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(O,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:M(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});b.displayName=f;var j="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(B,{...o,...a,ref:e})});h.displayName=j;var E="AlertDialogDescription",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(G,{...o,...a,ref:e})});C.displayName=E;var U="AlertDialogAction",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(D,{...o,...a,ref:e})});R.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=A(e,o);return r.jsx(D,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
1
+ import{r as i,bA as m,az as A,j as r,bB as w,aB as T,ab as O,aE as M,bC as I,ad as D,ac as z,ax as F,ae as L,a9 as B,aa as G,a8 as k,c as n}from"./index-MoI-rvC3.js";import{c as p}from"./utils-BLlwSV8I.js";import{b as v}from"./button-G3aMPyFq.js";var x="AlertDialog",[H]=T(x,[m]),d=m(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(k,{...a,...t,modal:!0})};N.displayName=x;var V="AlertDialogTrigger",W=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(F,{...o,...a,ref:e})});W.displayName=V;var Y="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t})};y.displayName=Y;var q="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(L,{...o,...a,ref:e})});_.displayName=q;var f="AlertDialogContent",[J,K]=H(f),Q=I("AlertDialogContent"),b=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=A(e,c),u=i.useRef(null);return r.jsx(w,{contentName:f,titleName:j,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(O,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:M(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});b.displayName=f;var j="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(B,{...o,...a,ref:e})});h.displayName=j;var E="AlertDialogDescription",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(G,{...o,...a,ref:e})});C.displayName=E;var U="AlertDialogAction",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(D,{...o,...a,ref:e})});R.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=A(e,o);return r.jsx(D,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
2
2
 
3
3
  You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
4
 
@@ -1 +1 @@
1
- import{ap as r,bY as n,bj as i,br as _,bs as y,aq as t,bt as f,bi as k,bo as u,bl as O,bk as I,bZ as ze,bq as Ve,b_ as He,b$ as De}from"./index-B5e6fytH.js";const ae="2025-06-18",xo=[ae,"2025-03-26","2024-11-05","2024-10-07"],z="2.0",fe=y([t(),f().int()]),we=t(),Je=r({progressToken:n(fe)}).passthrough(),x=r({_meta:n(Je)}).passthrough(),S=r({method:t(),params:n(x)}),q=r({_meta:n(r({}).passthrough())}).passthrough(),b=r({method:t(),params:n(q)}),C=r({_meta:n(r({}).passthrough())}).passthrough(),V=y([t(),f().int()]),Re=r({jsonrpc:u(z),id:V}).merge(S).strict(),Co=e=>Re.safeParse(e).success,ye=r({jsonrpc:u(z)}).merge(b).strict(),To=e=>ye.safeParse(e).success,Se=r({jsonrpc:u(z),id:V,result:C}).strict(),bo=e=>Se.safeParse(e).success;var me;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"})(me||(me={}));const ve=r({jsonrpc:u(z),id:V,error:r({code:f().int(),message:t(),data:n(O())})}).strict(),Po=e=>ve.safeParse(e).success,ko=y([Re,ye,Se,ve]),xe=C.strict(),Ce=b.extend({method:u("notifications/cancelled"),params:q.extend({requestId:V,reason:t().optional()})}),We=r({src:t(),mimeType:n(t()),sizes:n(i(t()))}).passthrough(),A=r({icons:i(We).optional()}).passthrough(),M=r({name:t(),title:n(t())}).passthrough(),Te=M.extend({version:t(),websiteUrl:n(t())}).merge(A),Be=r({experimental:n(r({}).passthrough()),sampling:n(r({}).passthrough()),elicitation:n(r({}).passthrough()),roots:n(r({listChanged:n(_())}).passthrough())}).passthrough(),Ge=S.extend({method:u("initialize"),params:x.extend({protocolVersion:t(),capabilities:Be,clientInfo:Te})}),Ze=r({experimental:n(r({}).passthrough()),logging:n(r({}).passthrough()),completions:n(r({}).passthrough()),prompts:n(r({listChanged:n(_())}).passthrough()),resources:n(r({subscribe:n(_()),listChanged:n(_())}).passthrough()),tools:n(r({listChanged:n(_())}).passthrough())}).passthrough(),Ye=C.extend({protocolVersion:t(),capabilities:Ze,serverInfo:Te,instructions:n(t())}),be=b.extend({method:u("notifications/initialized")}),Uo=e=>be.safeParse(e).success,Pe=S.extend({method:u("ping")}),Ke=r({progress:f(),total:n(f()),message:n(t())}).passthrough(),ke=b.extend({method:u("notifications/progress"),params:q.merge(Ke).extend({progressToken:fe})}),H=S.extend({params:x.extend({cursor:n(we)}).optional()}),D=C.extend({nextCursor:n(we)}),Ue=r({uri:t(),mimeType:n(t()),_meta:n(r({}).passthrough())}).passthrough(),Le=Ue.extend({text:t()}),ie=t().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ee=Ue.extend({blob:ie}),Oe=M.extend({uri:t(),description:n(t()),mimeType:n(t()),_meta:n(r({}).passthrough())}).merge(A),Qe=M.extend({uriTemplate:t(),description:n(t()),mimeType:n(t()),_meta:n(r({}).passthrough())}).merge(A),Xe=H.extend({method:u("resources/list")}),Fe=D.extend({resources:i(Oe)}),et=H.extend({method:u("resources/templates/list")}),tt=D.extend({resourceTemplates:i(Qe)}),ot=S.extend({method:u("resources/read"),params:x.extend({uri:t()})}),nt=C.extend({contents:i(y([Le,Ee]))}),st=b.extend({method:u("notifications/resources/list_changed")}),rt=S.extend({method:u("resources/subscribe"),params:x.extend({uri:t()})}),at=S.extend({method:u("resources/unsubscribe"),params:x.extend({uri:t()})}),it=b.extend({method:u("notifications/resources/updated"),params:q.extend({uri:t()})}),ct=r({name:t(),description:n(t()),required:n(_())}).passthrough(),ut=M.extend({description:n(t()),arguments:n(i(ct)),_meta:n(r({}).passthrough())}).merge(A),lt=H.extend({method:u("prompts/list")}),pt=D.extend({prompts:i(ut)}),dt=S.extend({method:u("prompts/get"),params:x.extend({name:t(),arguments:n(I(t()))})}),ce=r({type:u("text"),text:t(),_meta:n(r({}).passthrough())}).passthrough(),ue=r({type:u("image"),data:ie,mimeType:t(),_meta:n(r({}).passthrough())}).passthrough(),le=r({type:u("audio"),data:ie,mimeType:t(),_meta:n(r({}).passthrough())}).passthrough(),ht=r({type:u("resource"),resource:y([Le,Ee]),_meta:n(r({}).passthrough())}).passthrough(),mt=Oe.extend({type:u("resource_link")}),Ie=y([ce,ue,le,mt,ht]),_t=r({role:k(["user","assistant"]),content:Ie}).passthrough(),gt=C.extend({description:n(t()),messages:i(_t)}),ft=b.extend({method:u("notifications/prompts/list_changed")}),wt=r({title:n(t()),readOnlyHint:n(_()),destructiveHint:n(_()),idempotentHint:n(_()),openWorldHint:n(_())}).passthrough(),Rt=M.extend({description:n(t()),inputSchema:r({type:u("object"),properties:n(r({}).passthrough()),required:n(i(t()))}).passthrough(),outputSchema:n(r({type:u("object"),properties:n(r({}).passthrough()),required:n(i(t()))}).passthrough()),annotations:n(wt),_meta:n(r({}).passthrough())}).merge(A),yt=H.extend({method:u("tools/list")}),St=D.extend({tools:i(Rt)}),qe=C.extend({content:i(Ie).default([]),structuredContent:r({}).passthrough().optional(),isError:n(_())});qe.or(C.extend({toolResult:O()}));const vt=S.extend({method:u("tools/call"),params:x.extend({name:t(),arguments:n(I(O()))})}),xt=b.extend({method:u("notifications/tools/list_changed")}),Ae=k(["debug","info","notice","warning","error","critical","alert","emergency"]),Ct=S.extend({method:u("logging/setLevel"),params:x.extend({level:Ae})}),Tt=b.extend({method:u("notifications/message"),params:q.extend({level:Ae,logger:n(t()),data:O()})}),bt=r({name:t().optional()}).passthrough(),Pt=r({hints:n(i(bt)),costPriority:n(f().min(0).max(1)),speedPriority:n(f().min(0).max(1)),intelligencePriority:n(f().min(0).max(1))}).passthrough(),kt=r({role:k(["user","assistant"]),content:y([ce,ue,le])}).passthrough(),Ut=S.extend({method:u("sampling/createMessage"),params:x.extend({messages:i(kt),systemPrompt:n(t()),includeContext:n(k(["none","thisServer","allServers"])),temperature:n(f()),maxTokens:f().int(),stopSequences:n(i(t())),metadata:n(r({}).passthrough()),modelPreferences:n(Pt)})}),Lt=C.extend({model:t(),stopReason:n(k(["endTurn","stopSequence","maxTokens"]).or(t())),role:k(["user","assistant"]),content:ze("type",[ce,ue,le])}),Et=r({type:u("boolean"),title:n(t()),description:n(t()),default:n(_())}).passthrough(),Ot=r({type:u("string"),title:n(t()),description:n(t()),minLength:n(f()),maxLength:n(f()),format:n(k(["email","uri","date","date-time"]))}).passthrough(),It=r({type:k(["number","integer"]),title:n(t()),description:n(t()),minimum:n(f()),maximum:n(f())}).passthrough(),qt=r({type:u("string"),title:n(t()),description:n(t()),enum:i(t()),enumNames:n(i(t()))}).passthrough(),At=y([Et,Ot,It,qt]),Mt=S.extend({method:u("elicitation/create"),params:x.extend({message:t(),requestedSchema:r({type:u("object"),properties:I(t(),At),required:n(i(t()))}).passthrough()})}),Nt=C.extend({action:k(["accept","decline","cancel"]),content:n(I(t(),O()))}),jt=r({type:u("ref/resource"),uri:t()}).passthrough(),$t=r({type:u("ref/prompt"),name:t()}).passthrough(),zt=S.extend({method:u("completion/complete"),params:x.extend({ref:y([$t,jt]),argument:r({name:t(),value:t()}).passthrough(),context:n(r({arguments:n(I(t(),t()))}))})}),Vt=C.extend({completion:r({values:i(t()).max(100),total:n(f().int()),hasMore:n(_())}).passthrough()}),Ht=r({uri:t().startsWith("file://"),name:n(t()),_meta:n(r({}).passthrough())}).passthrough(),Dt=S.extend({method:u("roots/list")}),Jt=C.extend({roots:i(Ht)}),Wt=b.extend({method:u("notifications/roots/list_changed")});y([Pe,Ge,zt,Ct,dt,lt,Xe,et,ot,rt,at,vt,yt]);y([Ce,ke,be,Wt]);y([xe,Lt,Nt,Jt]);y([Pe,Ut,Mt,Dt]);y([Ce,ke,Tt,it,st,xt,ft]);y([xe,Ye,Vt,gt,pt,Fe,tt,nt,qe,St]);class Lo extends Error{constructor(o,a,s){super(`MCP error ${o}: ${a}`),this.code=o,this.data=s,this.name="McpError"}}let pe;pe=globalThis.crypto;async function Bt(e){return(await pe).getRandomValues(new Uint8Array(e))}async function Gt(e){const o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",a=Math.pow(2,8)-Math.pow(2,8)%o.length;let s="";for(;s.length<e;){const c=await Bt(e-s.length);for(const p of c)p<a&&(s+=o[p%o.length])}return s}async function Zt(e){return await Gt(e)}async function Yt(e){const o=await(await pe).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(o))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Kt(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const o=await Zt(e),a=await Yt(o);return{code_verifier:o,code_challenge:a}}const w=t().url().superRefine((e,o)=>{if(!URL.canParse(e))return o.addIssue({code:He.custom,message:"URL must be parseable",fatal:!0}),De}).refine(e=>{const o=new URL(e);return o.protocol!=="javascript:"&&o.protocol!=="data:"&&o.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Qt=r({resource:t().url(),authorization_servers:i(w).optional(),jwks_uri:t().url().optional(),scopes_supported:i(t()).optional(),bearer_methods_supported:i(t()).optional(),resource_signing_alg_values_supported:i(t()).optional(),resource_name:t().optional(),resource_documentation:t().optional(),resource_policy_uri:t().url().optional(),resource_tos_uri:t().url().optional(),tls_client_certificate_bound_access_tokens:_().optional(),authorization_details_types_supported:i(t()).optional(),dpop_signing_alg_values_supported:i(t()).optional(),dpop_bound_access_tokens_required:_().optional()}).passthrough(),Me=r({issuer:t(),authorization_endpoint:w,token_endpoint:w,registration_endpoint:w.optional(),scopes_supported:i(t()).optional(),response_types_supported:i(t()),response_modes_supported:i(t()).optional(),grant_types_supported:i(t()).optional(),token_endpoint_auth_methods_supported:i(t()).optional(),token_endpoint_auth_signing_alg_values_supported:i(t()).optional(),service_documentation:w.optional(),revocation_endpoint:w.optional(),revocation_endpoint_auth_methods_supported:i(t()).optional(),revocation_endpoint_auth_signing_alg_values_supported:i(t()).optional(),introspection_endpoint:t().optional(),introspection_endpoint_auth_methods_supported:i(t()).optional(),introspection_endpoint_auth_signing_alg_values_supported:i(t()).optional(),code_challenge_methods_supported:i(t()).optional()}).passthrough(),Xt=r({issuer:t(),authorization_endpoint:w,token_endpoint:w,userinfo_endpoint:w.optional(),jwks_uri:w,registration_endpoint:w.optional(),scopes_supported:i(t()).optional(),response_types_supported:i(t()),response_modes_supported:i(t()).optional(),grant_types_supported:i(t()).optional(),acr_values_supported:i(t()).optional(),subject_types_supported:i(t()),id_token_signing_alg_values_supported:i(t()),id_token_encryption_alg_values_supported:i(t()).optional(),id_token_encryption_enc_values_supported:i(t()).optional(),userinfo_signing_alg_values_supported:i(t()).optional(),userinfo_encryption_alg_values_supported:i(t()).optional(),userinfo_encryption_enc_values_supported:i(t()).optional(),request_object_signing_alg_values_supported:i(t()).optional(),request_object_encryption_alg_values_supported:i(t()).optional(),request_object_encryption_enc_values_supported:i(t()).optional(),token_endpoint_auth_methods_supported:i(t()).optional(),token_endpoint_auth_signing_alg_values_supported:i(t()).optional(),display_values_supported:i(t()).optional(),claim_types_supported:i(t()).optional(),claims_supported:i(t()).optional(),service_documentation:t().optional(),claims_locales_supported:i(t()).optional(),ui_locales_supported:i(t()).optional(),claims_parameter_supported:_().optional(),request_parameter_supported:_().optional(),request_uri_parameter_supported:_().optional(),require_request_uri_registration:_().optional(),op_policy_uri:w.optional(),op_tos_uri:w.optional()}).passthrough(),Ft=Xt.merge(Me.pick({code_challenge_methods_supported:!0})),Ne=r({access_token:t(),id_token:t().optional(),token_type:t(),expires_in:f().optional(),scope:t().optional(),refresh_token:t().optional()}).strip(),eo=r({error:t(),error_description:t().optional(),error_uri:t().optional()}),_e=w.optional().or(u("").transform(()=>{})),to=r({redirect_uris:i(w),token_endpoint_auth_method:t().optional(),grant_types:i(t()).optional(),response_types:i(t()).optional(),client_name:t().optional(),client_uri:w.optional(),logo_uri:_e,scope:t().optional(),contacts:i(t()).optional(),tos_uri:_e,policy_uri:t().optional(),jwks_uri:w.optional(),jwks:Ve().optional(),software_id:t().optional(),software_version:t().optional(),software_statement:t().optional()}).strip(),oo=r({client_id:t(),client_secret:t().optional(),client_id_issued_at:f().optional(),client_secret_expires_at:f().optional()}).strip(),no=to.merge(oo);r({error:t(),error_description:t().optional()}).strip();r({token:t(),token_type_hint:t().optional()}).strip();function so(e){const o=typeof e=="string"?new URL(e):new URL(e.href);return o.hash="",o}function ro({requestedResource:e,configuredResource:o}){const a=typeof e=="string"?new URL(e):new URL(e.href),s=typeof o=="string"?new URL(o):new URL(o.href);if(a.origin!==s.origin||a.pathname.length<s.pathname.length)return!1;const c=a.pathname.endsWith("/")?a.pathname:a.pathname+"/",p=s.pathname.endsWith("/")?s.pathname:s.pathname+"/";return c.startsWith(p)}class R extends Error{constructor(o,a){super(o),this.errorUri=a,this.name=this.constructor.name}toResponseObject(){const o={error:this.errorCode,error_description:this.message};return this.errorUri&&(o.error_uri=this.errorUri),o}get errorCode(){return this.constructor.errorCode}}class Z extends R{}Z.errorCode="invalid_request";class N extends R{}N.errorCode="invalid_client";class j extends R{}j.errorCode="invalid_grant";class $ extends R{}$.errorCode="unauthorized_client";class Y extends R{}Y.errorCode="unsupported_grant_type";class K extends R{}K.errorCode="invalid_scope";class Q extends R{}Q.errorCode="access_denied";class E extends R{}E.errorCode="server_error";class X extends R{}X.errorCode="temporarily_unavailable";class F extends R{}F.errorCode="unsupported_response_type";class ee extends R{}ee.errorCode="unsupported_token_type";class te extends R{}te.errorCode="invalid_token";class oe extends R{}oe.errorCode="method_not_allowed";class ne extends R{}ne.errorCode="too_many_requests";class se extends R{}se.errorCode="invalid_client_metadata";class re extends R{}re.errorCode="insufficient_scope";const ao={[Z.errorCode]:Z,[N.errorCode]:N,[j.errorCode]:j,[$.errorCode]:$,[Y.errorCode]:Y,[K.errorCode]:K,[Q.errorCode]:Q,[E.errorCode]:E,[X.errorCode]:X,[F.errorCode]:F,[ee.errorCode]:ee,[te.errorCode]:te,[oe.errorCode]:oe,[ne.errorCode]:ne,[se.errorCode]:se,[re.errorCode]:re};class Eo extends Error{constructor(o){super(o??"Unauthorized")}}const W="code",B="S256";function je(e,o){const a=e.client_secret!==void 0;return o.length===0?a?"client_secret_post":"none":a&&o.includes("client_secret_basic")?"client_secret_basic":a&&o.includes("client_secret_post")?"client_secret_post":o.includes("none")?"none":a?"client_secret_post":"none"}function $e(e,o,a,s){const{client_id:c,client_secret:p}=o;switch(e){case"client_secret_basic":io(c,p,a);return;case"client_secret_post":co(c,p,s);return;case"none":uo(c,s);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function io(e,o,a){if(!o)throw new Error("client_secret_basic authentication requires a client_secret");const s=btoa(`${e}:${o}`);a.set("Authorization",`Basic ${s}`)}function co(e,o,a){a.set("client_id",e),o&&a.set("client_secret",o)}function uo(e,o){o.set("client_id",e)}async function de(e){const o=e instanceof Response?e.status:void 0,a=e instanceof Response?await e.text():e;try{const s=eo.parse(JSON.parse(a)),{error:c,error_description:p,error_uri:d}=s,l=ao[c]||E;return new l(p||"",d)}catch(s){const c=`${o?`HTTP ${o}: `:""}Invalid OAuth error response: ${s}. Raw body: ${a}`;return new E(c)}}async function Oo(e,o){var a,s;try{return await G(e,o)}catch(c){if(c instanceof N||c instanceof $)return await((a=e.invalidateCredentials)===null||a===void 0?void 0:a.call(e,"all")),await G(e,o);if(c instanceof j)return await((s=e.invalidateCredentials)===null||s===void 0?void 0:s.call(e,"tokens")),await G(e,o);throw c}}async function G(e,{serverUrl:o,authorizationCode:a,scope:s,resourceMetadataUrl:c,fetchFn:p}){let d,l;try{d=await po(o,{resourceMetadataUrl:c},p),d.authorization_servers&&d.authorization_servers.length>0&&(l=d.authorization_servers[0])}catch{}l||(l=o);const h=await lo(o,e,d),g=await fo(l,{fetchFn:p});let m=await Promise.resolve(e.clientInformation());if(!m){if(a!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const v=await So(l,{metadata:g,clientMetadata:e.clientMetadata,fetchFn:p});await e.saveClientInformation(v),m=v}if(a!==void 0){const v=await e.codeVerifier(),J=await Ro(l,{metadata:g,clientInformation:m,authorizationCode:a,codeVerifier:v,redirectUri:e.redirectUrl,resource:h,addClientAuthentication:e.addClientAuthentication,fetchFn:p});return await e.saveTokens(J),"AUTHORIZED"}const T=await e.tokens();if(T?.refresh_token)try{const v=await yo(l,{metadata:g,clientInformation:m,refreshToken:T.refresh_token,resource:h,addClientAuthentication:e.addClientAuthentication,fetchFn:p});return await e.saveTokens(v),"AUTHORIZED"}catch(v){if(!(!(v instanceof R)||v instanceof E))throw v}const P=e.state?await e.state():void 0,{authorizationUrl:U,codeVerifier:L}=await wo(l,{metadata:g,clientInformation:m,state:P,redirectUrl:e.redirectUrl,scope:s||e.clientMetadata.scope,resource:h});return await e.saveCodeVerifier(L),await e.redirectToAuthorization(U),"REDIRECT"}async function lo(e,o,a){const s=so(e);if(o.validateResourceURL)return await o.validateResourceURL(s,a?.resource);if(a){if(!ro({requestedResource:s,configuredResource:a.resource}))throw new Error(`Protected resource ${a.resource} does not match expected ${s} (or origin)`);return new URL(a.resource)}}function Io(e){const o=e.headers.get("WWW-Authenticate");if(!o)return;const[a,s]=o.split(" ");if(a.toLowerCase()!=="bearer"||!s)return;const p=/resource_metadata="([^"]*)"/.exec(o);if(p)try{return new URL(p[1])}catch{return}}async function po(e,o,a=fetch){const s=await _o(e,"oauth-protected-resource",a,{protocolVersion:o?.protocolVersion,metadataUrl:o?.resourceMetadataUrl});if(!s||s.status===404)throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!s.ok)throw new Error(`HTTP ${s.status} trying to load well-known OAuth protected resource metadata.`);return Qt.parse(await s.json())}async function he(e,o,a=fetch){try{return await a(e,{headers:o})}catch(s){if(s instanceof TypeError)return o?he(e,void 0,a):void 0;throw s}}function ho(e,o="",a={}){return o.endsWith("/")&&(o=o.slice(0,-1)),a.prependPathname?`${o}/.well-known/${e}`:`/.well-known/${e}${o}`}async function ge(e,o,a=fetch){return await he(e,{"MCP-Protocol-Version":o},a)}function mo(e,o){return!e||e.status>=400&&e.status<500&&o!=="/"}async function _o(e,o,a,s){var c,p;const d=new URL(e),l=(c=s?.protocolVersion)!==null&&c!==void 0?c:ae;let h;if(s?.metadataUrl)h=new URL(s.metadataUrl);else{const m=ho(o,d.pathname);h=new URL(m,(p=s?.metadataServerUrl)!==null&&p!==void 0?p:d),h.search=d.search}let g=await ge(h,l,a);if(!s?.metadataUrl&&mo(g,d.pathname)){const m=new URL(`/.well-known/${o}`,d);g=await ge(m,l,a)}return g}function go(e){const o=typeof e=="string"?new URL(e):e,a=o.pathname!=="/",s=[];if(!a)return s.push({url:new URL("/.well-known/oauth-authorization-server",o.origin),type:"oauth"}),s.push({url:new URL("/.well-known/openid-configuration",o.origin),type:"oidc"}),s;let c=o.pathname;return c.endsWith("/")&&(c=c.slice(0,-1)),s.push({url:new URL(`/.well-known/oauth-authorization-server${c}`,o.origin),type:"oauth"}),s.push({url:new URL("/.well-known/oauth-authorization-server",o.origin),type:"oauth"}),s.push({url:new URL(`/.well-known/openid-configuration${c}`,o.origin),type:"oidc"}),s.push({url:new URL(`${c}/.well-known/openid-configuration`,o.origin),type:"oidc"}),s}async function fo(e,{fetchFn:o=fetch,protocolVersion:a=ae}={}){const s={"MCP-Protocol-Version":a,Accept:"application/json"},c=go(e);for(const{url:p,type:d}of c){const l=await he(p,s,o);if(l){if(!l.ok){if(l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${d==="oauth"?"OAuth":"OpenID provider"} metadata from ${p}`)}return d==="oauth"?Me.parse(await l.json()):Ft.parse(await l.json())}}}async function wo(e,{metadata:o,clientInformation:a,redirectUrl:s,scope:c,state:p,resource:d}){let l;if(o){if(l=new URL(o.authorization_endpoint),!o.response_types_supported.includes(W))throw new Error(`Incompatible auth server: does not support response type ${W}`);if(o.code_challenge_methods_supported&&!o.code_challenge_methods_supported.includes(B))throw new Error(`Incompatible auth server: does not support code challenge method ${B}`)}else l=new URL("/authorize",e);const h=await Kt(),g=h.code_verifier,m=h.code_challenge;return l.searchParams.set("response_type",W),l.searchParams.set("client_id",a.client_id),l.searchParams.set("code_challenge",m),l.searchParams.set("code_challenge_method",B),l.searchParams.set("redirect_uri",String(s)),p&&l.searchParams.set("state",p),c&&l.searchParams.set("scope",c),c?.includes("offline_access")&&l.searchParams.append("prompt","consent"),d&&l.searchParams.set("resource",d.href),{authorizationUrl:l,codeVerifier:g}}async function Ro(e,{metadata:o,clientInformation:a,authorizationCode:s,codeVerifier:c,redirectUri:p,resource:d,addClientAuthentication:l,fetchFn:h}){var g;const m="authorization_code",T=o?.token_endpoint?new URL(o.token_endpoint):new URL("/token",e);if(o?.grant_types_supported&&!o.grant_types_supported.includes(m))throw new Error(`Incompatible auth server: does not support grant type ${m}`);const P=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),U=new URLSearchParams({grant_type:m,code:s,code_verifier:c,redirect_uri:String(p)});if(l)l(P,U,e,o);else{const v=(g=o?.token_endpoint_auth_methods_supported)!==null&&g!==void 0?g:[],J=je(a,v);$e(J,a,P,U)}d&&U.set("resource",d.href);const L=await(h??fetch)(T,{method:"POST",headers:P,body:U});if(!L.ok)throw await de(L);return Ne.parse(await L.json())}async function yo(e,{metadata:o,clientInformation:a,refreshToken:s,resource:c,addClientAuthentication:p,fetchFn:d}){var l;const h="refresh_token";let g;if(o){if(g=new URL(o.token_endpoint),o.grant_types_supported&&!o.grant_types_supported.includes(h))throw new Error(`Incompatible auth server: does not support grant type ${h}`)}else g=new URL("/token",e);const m=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),T=new URLSearchParams({grant_type:h,refresh_token:s});if(p)p(m,T,e,o);else{const U=(l=o?.token_endpoint_auth_methods_supported)!==null&&l!==void 0?l:[],L=je(a,U);$e(L,a,m,T)}c&&T.set("resource",c.href);const P=await(d??fetch)(g,{method:"POST",headers:m,body:T});if(!P.ok)throw await de(P);return Ne.parse({refresh_token:s,...await P.json()})}async function So(e,{metadata:o,clientMetadata:a,fetchFn:s}){let c;if(o){if(!o.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");c=new URL(o.registration_endpoint)}else c=new URL("/register",e);const p=await(s??fetch)(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!p.ok)throw await de(p);return no.parse(await p.json())}export{qe as C,me as E,gt as G,Ye as I,ko as J,Fe as L,Lo as M,ke as P,nt as R,xo as S,Eo as U,Oo as a,pt as b,St as c,Ce as d,Pe as e,Po as f,Co as g,To as h,bo as i,ae as j,xe as k,Vt as l,tt as m,Io as n,Uo as o};
1
+ import{ap as r,bY as n,bj as i,br as _,bs as y,aq as t,bt as f,bi as k,bo as u,bl as O,bk as I,bZ as ze,bq as Ve,b_ as He,b$ as De}from"./index-MoI-rvC3.js";const ae="2025-06-18",xo=[ae,"2025-03-26","2024-11-05","2024-10-07"],z="2.0",fe=y([t(),f().int()]),we=t(),Je=r({progressToken:n(fe)}).passthrough(),x=r({_meta:n(Je)}).passthrough(),S=r({method:t(),params:n(x)}),q=r({_meta:n(r({}).passthrough())}).passthrough(),b=r({method:t(),params:n(q)}),C=r({_meta:n(r({}).passthrough())}).passthrough(),V=y([t(),f().int()]),Re=r({jsonrpc:u(z),id:V}).merge(S).strict(),Co=e=>Re.safeParse(e).success,ye=r({jsonrpc:u(z)}).merge(b).strict(),To=e=>ye.safeParse(e).success,Se=r({jsonrpc:u(z),id:V,result:C}).strict(),bo=e=>Se.safeParse(e).success;var me;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"})(me||(me={}));const ve=r({jsonrpc:u(z),id:V,error:r({code:f().int(),message:t(),data:n(O())})}).strict(),Po=e=>ve.safeParse(e).success,ko=y([Re,ye,Se,ve]),xe=C.strict(),Ce=b.extend({method:u("notifications/cancelled"),params:q.extend({requestId:V,reason:t().optional()})}),We=r({src:t(),mimeType:n(t()),sizes:n(i(t()))}).passthrough(),A=r({icons:i(We).optional()}).passthrough(),M=r({name:t(),title:n(t())}).passthrough(),Te=M.extend({version:t(),websiteUrl:n(t())}).merge(A),Be=r({experimental:n(r({}).passthrough()),sampling:n(r({}).passthrough()),elicitation:n(r({}).passthrough()),roots:n(r({listChanged:n(_())}).passthrough())}).passthrough(),Ge=S.extend({method:u("initialize"),params:x.extend({protocolVersion:t(),capabilities:Be,clientInfo:Te})}),Ze=r({experimental:n(r({}).passthrough()),logging:n(r({}).passthrough()),completions:n(r({}).passthrough()),prompts:n(r({listChanged:n(_())}).passthrough()),resources:n(r({subscribe:n(_()),listChanged:n(_())}).passthrough()),tools:n(r({listChanged:n(_())}).passthrough())}).passthrough(),Ye=C.extend({protocolVersion:t(),capabilities:Ze,serverInfo:Te,instructions:n(t())}),be=b.extend({method:u("notifications/initialized")}),Uo=e=>be.safeParse(e).success,Pe=S.extend({method:u("ping")}),Ke=r({progress:f(),total:n(f()),message:n(t())}).passthrough(),ke=b.extend({method:u("notifications/progress"),params:q.merge(Ke).extend({progressToken:fe})}),H=S.extend({params:x.extend({cursor:n(we)}).optional()}),D=C.extend({nextCursor:n(we)}),Ue=r({uri:t(),mimeType:n(t()),_meta:n(r({}).passthrough())}).passthrough(),Le=Ue.extend({text:t()}),ie=t().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ee=Ue.extend({blob:ie}),Oe=M.extend({uri:t(),description:n(t()),mimeType:n(t()),_meta:n(r({}).passthrough())}).merge(A),Qe=M.extend({uriTemplate:t(),description:n(t()),mimeType:n(t()),_meta:n(r({}).passthrough())}).merge(A),Xe=H.extend({method:u("resources/list")}),Fe=D.extend({resources:i(Oe)}),et=H.extend({method:u("resources/templates/list")}),tt=D.extend({resourceTemplates:i(Qe)}),ot=S.extend({method:u("resources/read"),params:x.extend({uri:t()})}),nt=C.extend({contents:i(y([Le,Ee]))}),st=b.extend({method:u("notifications/resources/list_changed")}),rt=S.extend({method:u("resources/subscribe"),params:x.extend({uri:t()})}),at=S.extend({method:u("resources/unsubscribe"),params:x.extend({uri:t()})}),it=b.extend({method:u("notifications/resources/updated"),params:q.extend({uri:t()})}),ct=r({name:t(),description:n(t()),required:n(_())}).passthrough(),ut=M.extend({description:n(t()),arguments:n(i(ct)),_meta:n(r({}).passthrough())}).merge(A),lt=H.extend({method:u("prompts/list")}),pt=D.extend({prompts:i(ut)}),dt=S.extend({method:u("prompts/get"),params:x.extend({name:t(),arguments:n(I(t()))})}),ce=r({type:u("text"),text:t(),_meta:n(r({}).passthrough())}).passthrough(),ue=r({type:u("image"),data:ie,mimeType:t(),_meta:n(r({}).passthrough())}).passthrough(),le=r({type:u("audio"),data:ie,mimeType:t(),_meta:n(r({}).passthrough())}).passthrough(),ht=r({type:u("resource"),resource:y([Le,Ee]),_meta:n(r({}).passthrough())}).passthrough(),mt=Oe.extend({type:u("resource_link")}),Ie=y([ce,ue,le,mt,ht]),_t=r({role:k(["user","assistant"]),content:Ie}).passthrough(),gt=C.extend({description:n(t()),messages:i(_t)}),ft=b.extend({method:u("notifications/prompts/list_changed")}),wt=r({title:n(t()),readOnlyHint:n(_()),destructiveHint:n(_()),idempotentHint:n(_()),openWorldHint:n(_())}).passthrough(),Rt=M.extend({description:n(t()),inputSchema:r({type:u("object"),properties:n(r({}).passthrough()),required:n(i(t()))}).passthrough(),outputSchema:n(r({type:u("object"),properties:n(r({}).passthrough()),required:n(i(t()))}).passthrough()),annotations:n(wt),_meta:n(r({}).passthrough())}).merge(A),yt=H.extend({method:u("tools/list")}),St=D.extend({tools:i(Rt)}),qe=C.extend({content:i(Ie).default([]),structuredContent:r({}).passthrough().optional(),isError:n(_())});qe.or(C.extend({toolResult:O()}));const vt=S.extend({method:u("tools/call"),params:x.extend({name:t(),arguments:n(I(O()))})}),xt=b.extend({method:u("notifications/tools/list_changed")}),Ae=k(["debug","info","notice","warning","error","critical","alert","emergency"]),Ct=S.extend({method:u("logging/setLevel"),params:x.extend({level:Ae})}),Tt=b.extend({method:u("notifications/message"),params:q.extend({level:Ae,logger:n(t()),data:O()})}),bt=r({name:t().optional()}).passthrough(),Pt=r({hints:n(i(bt)),costPriority:n(f().min(0).max(1)),speedPriority:n(f().min(0).max(1)),intelligencePriority:n(f().min(0).max(1))}).passthrough(),kt=r({role:k(["user","assistant"]),content:y([ce,ue,le])}).passthrough(),Ut=S.extend({method:u("sampling/createMessage"),params:x.extend({messages:i(kt),systemPrompt:n(t()),includeContext:n(k(["none","thisServer","allServers"])),temperature:n(f()),maxTokens:f().int(),stopSequences:n(i(t())),metadata:n(r({}).passthrough()),modelPreferences:n(Pt)})}),Lt=C.extend({model:t(),stopReason:n(k(["endTurn","stopSequence","maxTokens"]).or(t())),role:k(["user","assistant"]),content:ze("type",[ce,ue,le])}),Et=r({type:u("boolean"),title:n(t()),description:n(t()),default:n(_())}).passthrough(),Ot=r({type:u("string"),title:n(t()),description:n(t()),minLength:n(f()),maxLength:n(f()),format:n(k(["email","uri","date","date-time"]))}).passthrough(),It=r({type:k(["number","integer"]),title:n(t()),description:n(t()),minimum:n(f()),maximum:n(f())}).passthrough(),qt=r({type:u("string"),title:n(t()),description:n(t()),enum:i(t()),enumNames:n(i(t()))}).passthrough(),At=y([Et,Ot,It,qt]),Mt=S.extend({method:u("elicitation/create"),params:x.extend({message:t(),requestedSchema:r({type:u("object"),properties:I(t(),At),required:n(i(t()))}).passthrough()})}),Nt=C.extend({action:k(["accept","decline","cancel"]),content:n(I(t(),O()))}),jt=r({type:u("ref/resource"),uri:t()}).passthrough(),$t=r({type:u("ref/prompt"),name:t()}).passthrough(),zt=S.extend({method:u("completion/complete"),params:x.extend({ref:y([$t,jt]),argument:r({name:t(),value:t()}).passthrough(),context:n(r({arguments:n(I(t(),t()))}))})}),Vt=C.extend({completion:r({values:i(t()).max(100),total:n(f().int()),hasMore:n(_())}).passthrough()}),Ht=r({uri:t().startsWith("file://"),name:n(t()),_meta:n(r({}).passthrough())}).passthrough(),Dt=S.extend({method:u("roots/list")}),Jt=C.extend({roots:i(Ht)}),Wt=b.extend({method:u("notifications/roots/list_changed")});y([Pe,Ge,zt,Ct,dt,lt,Xe,et,ot,rt,at,vt,yt]);y([Ce,ke,be,Wt]);y([xe,Lt,Nt,Jt]);y([Pe,Ut,Mt,Dt]);y([Ce,ke,Tt,it,st,xt,ft]);y([xe,Ye,Vt,gt,pt,Fe,tt,nt,qe,St]);class Lo extends Error{constructor(o,a,s){super(`MCP error ${o}: ${a}`),this.code=o,this.data=s,this.name="McpError"}}let pe;pe=globalThis.crypto;async function Bt(e){return(await pe).getRandomValues(new Uint8Array(e))}async function Gt(e){const o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",a=Math.pow(2,8)-Math.pow(2,8)%o.length;let s="";for(;s.length<e;){const c=await Bt(e-s.length);for(const p of c)p<a&&(s+=o[p%o.length])}return s}async function Zt(e){return await Gt(e)}async function Yt(e){const o=await(await pe).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(o))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Kt(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const o=await Zt(e),a=await Yt(o);return{code_verifier:o,code_challenge:a}}const w=t().url().superRefine((e,o)=>{if(!URL.canParse(e))return o.addIssue({code:He.custom,message:"URL must be parseable",fatal:!0}),De}).refine(e=>{const o=new URL(e);return o.protocol!=="javascript:"&&o.protocol!=="data:"&&o.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Qt=r({resource:t().url(),authorization_servers:i(w).optional(),jwks_uri:t().url().optional(),scopes_supported:i(t()).optional(),bearer_methods_supported:i(t()).optional(),resource_signing_alg_values_supported:i(t()).optional(),resource_name:t().optional(),resource_documentation:t().optional(),resource_policy_uri:t().url().optional(),resource_tos_uri:t().url().optional(),tls_client_certificate_bound_access_tokens:_().optional(),authorization_details_types_supported:i(t()).optional(),dpop_signing_alg_values_supported:i(t()).optional(),dpop_bound_access_tokens_required:_().optional()}).passthrough(),Me=r({issuer:t(),authorization_endpoint:w,token_endpoint:w,registration_endpoint:w.optional(),scopes_supported:i(t()).optional(),response_types_supported:i(t()),response_modes_supported:i(t()).optional(),grant_types_supported:i(t()).optional(),token_endpoint_auth_methods_supported:i(t()).optional(),token_endpoint_auth_signing_alg_values_supported:i(t()).optional(),service_documentation:w.optional(),revocation_endpoint:w.optional(),revocation_endpoint_auth_methods_supported:i(t()).optional(),revocation_endpoint_auth_signing_alg_values_supported:i(t()).optional(),introspection_endpoint:t().optional(),introspection_endpoint_auth_methods_supported:i(t()).optional(),introspection_endpoint_auth_signing_alg_values_supported:i(t()).optional(),code_challenge_methods_supported:i(t()).optional()}).passthrough(),Xt=r({issuer:t(),authorization_endpoint:w,token_endpoint:w,userinfo_endpoint:w.optional(),jwks_uri:w,registration_endpoint:w.optional(),scopes_supported:i(t()).optional(),response_types_supported:i(t()),response_modes_supported:i(t()).optional(),grant_types_supported:i(t()).optional(),acr_values_supported:i(t()).optional(),subject_types_supported:i(t()),id_token_signing_alg_values_supported:i(t()),id_token_encryption_alg_values_supported:i(t()).optional(),id_token_encryption_enc_values_supported:i(t()).optional(),userinfo_signing_alg_values_supported:i(t()).optional(),userinfo_encryption_alg_values_supported:i(t()).optional(),userinfo_encryption_enc_values_supported:i(t()).optional(),request_object_signing_alg_values_supported:i(t()).optional(),request_object_encryption_alg_values_supported:i(t()).optional(),request_object_encryption_enc_values_supported:i(t()).optional(),token_endpoint_auth_methods_supported:i(t()).optional(),token_endpoint_auth_signing_alg_values_supported:i(t()).optional(),display_values_supported:i(t()).optional(),claim_types_supported:i(t()).optional(),claims_supported:i(t()).optional(),service_documentation:t().optional(),claims_locales_supported:i(t()).optional(),ui_locales_supported:i(t()).optional(),claims_parameter_supported:_().optional(),request_parameter_supported:_().optional(),request_uri_parameter_supported:_().optional(),require_request_uri_registration:_().optional(),op_policy_uri:w.optional(),op_tos_uri:w.optional()}).passthrough(),Ft=Xt.merge(Me.pick({code_challenge_methods_supported:!0})),Ne=r({access_token:t(),id_token:t().optional(),token_type:t(),expires_in:f().optional(),scope:t().optional(),refresh_token:t().optional()}).strip(),eo=r({error:t(),error_description:t().optional(),error_uri:t().optional()}),_e=w.optional().or(u("").transform(()=>{})),to=r({redirect_uris:i(w),token_endpoint_auth_method:t().optional(),grant_types:i(t()).optional(),response_types:i(t()).optional(),client_name:t().optional(),client_uri:w.optional(),logo_uri:_e,scope:t().optional(),contacts:i(t()).optional(),tos_uri:_e,policy_uri:t().optional(),jwks_uri:w.optional(),jwks:Ve().optional(),software_id:t().optional(),software_version:t().optional(),software_statement:t().optional()}).strip(),oo=r({client_id:t(),client_secret:t().optional(),client_id_issued_at:f().optional(),client_secret_expires_at:f().optional()}).strip(),no=to.merge(oo);r({error:t(),error_description:t().optional()}).strip();r({token:t(),token_type_hint:t().optional()}).strip();function so(e){const o=typeof e=="string"?new URL(e):new URL(e.href);return o.hash="",o}function ro({requestedResource:e,configuredResource:o}){const a=typeof e=="string"?new URL(e):new URL(e.href),s=typeof o=="string"?new URL(o):new URL(o.href);if(a.origin!==s.origin||a.pathname.length<s.pathname.length)return!1;const c=a.pathname.endsWith("/")?a.pathname:a.pathname+"/",p=s.pathname.endsWith("/")?s.pathname:s.pathname+"/";return c.startsWith(p)}class R extends Error{constructor(o,a){super(o),this.errorUri=a,this.name=this.constructor.name}toResponseObject(){const o={error:this.errorCode,error_description:this.message};return this.errorUri&&(o.error_uri=this.errorUri),o}get errorCode(){return this.constructor.errorCode}}class Z extends R{}Z.errorCode="invalid_request";class N extends R{}N.errorCode="invalid_client";class j extends R{}j.errorCode="invalid_grant";class $ extends R{}$.errorCode="unauthorized_client";class Y extends R{}Y.errorCode="unsupported_grant_type";class K extends R{}K.errorCode="invalid_scope";class Q extends R{}Q.errorCode="access_denied";class E extends R{}E.errorCode="server_error";class X extends R{}X.errorCode="temporarily_unavailable";class F extends R{}F.errorCode="unsupported_response_type";class ee extends R{}ee.errorCode="unsupported_token_type";class te extends R{}te.errorCode="invalid_token";class oe extends R{}oe.errorCode="method_not_allowed";class ne extends R{}ne.errorCode="too_many_requests";class se extends R{}se.errorCode="invalid_client_metadata";class re extends R{}re.errorCode="insufficient_scope";const ao={[Z.errorCode]:Z,[N.errorCode]:N,[j.errorCode]:j,[$.errorCode]:$,[Y.errorCode]:Y,[K.errorCode]:K,[Q.errorCode]:Q,[E.errorCode]:E,[X.errorCode]:X,[F.errorCode]:F,[ee.errorCode]:ee,[te.errorCode]:te,[oe.errorCode]:oe,[ne.errorCode]:ne,[se.errorCode]:se,[re.errorCode]:re};class Eo extends Error{constructor(o){super(o??"Unauthorized")}}const W="code",B="S256";function je(e,o){const a=e.client_secret!==void 0;return o.length===0?a?"client_secret_post":"none":a&&o.includes("client_secret_basic")?"client_secret_basic":a&&o.includes("client_secret_post")?"client_secret_post":o.includes("none")?"none":a?"client_secret_post":"none"}function $e(e,o,a,s){const{client_id:c,client_secret:p}=o;switch(e){case"client_secret_basic":io(c,p,a);return;case"client_secret_post":co(c,p,s);return;case"none":uo(c,s);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function io(e,o,a){if(!o)throw new Error("client_secret_basic authentication requires a client_secret");const s=btoa(`${e}:${o}`);a.set("Authorization",`Basic ${s}`)}function co(e,o,a){a.set("client_id",e),o&&a.set("client_secret",o)}function uo(e,o){o.set("client_id",e)}async function de(e){const o=e instanceof Response?e.status:void 0,a=e instanceof Response?await e.text():e;try{const s=eo.parse(JSON.parse(a)),{error:c,error_description:p,error_uri:d}=s,l=ao[c]||E;return new l(p||"",d)}catch(s){const c=`${o?`HTTP ${o}: `:""}Invalid OAuth error response: ${s}. Raw body: ${a}`;return new E(c)}}async function Oo(e,o){var a,s;try{return await G(e,o)}catch(c){if(c instanceof N||c instanceof $)return await((a=e.invalidateCredentials)===null||a===void 0?void 0:a.call(e,"all")),await G(e,o);if(c instanceof j)return await((s=e.invalidateCredentials)===null||s===void 0?void 0:s.call(e,"tokens")),await G(e,o);throw c}}async function G(e,{serverUrl:o,authorizationCode:a,scope:s,resourceMetadataUrl:c,fetchFn:p}){let d,l;try{d=await po(o,{resourceMetadataUrl:c},p),d.authorization_servers&&d.authorization_servers.length>0&&(l=d.authorization_servers[0])}catch{}l||(l=o);const h=await lo(o,e,d),g=await fo(l,{fetchFn:p});let m=await Promise.resolve(e.clientInformation());if(!m){if(a!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const v=await So(l,{metadata:g,clientMetadata:e.clientMetadata,fetchFn:p});await e.saveClientInformation(v),m=v}if(a!==void 0){const v=await e.codeVerifier(),J=await Ro(l,{metadata:g,clientInformation:m,authorizationCode:a,codeVerifier:v,redirectUri:e.redirectUrl,resource:h,addClientAuthentication:e.addClientAuthentication,fetchFn:p});return await e.saveTokens(J),"AUTHORIZED"}const T=await e.tokens();if(T?.refresh_token)try{const v=await yo(l,{metadata:g,clientInformation:m,refreshToken:T.refresh_token,resource:h,addClientAuthentication:e.addClientAuthentication,fetchFn:p});return await e.saveTokens(v),"AUTHORIZED"}catch(v){if(!(!(v instanceof R)||v instanceof E))throw v}const P=e.state?await e.state():void 0,{authorizationUrl:U,codeVerifier:L}=await wo(l,{metadata:g,clientInformation:m,state:P,redirectUrl:e.redirectUrl,scope:s||e.clientMetadata.scope,resource:h});return await e.saveCodeVerifier(L),await e.redirectToAuthorization(U),"REDIRECT"}async function lo(e,o,a){const s=so(e);if(o.validateResourceURL)return await o.validateResourceURL(s,a?.resource);if(a){if(!ro({requestedResource:s,configuredResource:a.resource}))throw new Error(`Protected resource ${a.resource} does not match expected ${s} (or origin)`);return new URL(a.resource)}}function Io(e){const o=e.headers.get("WWW-Authenticate");if(!o)return;const[a,s]=o.split(" ");if(a.toLowerCase()!=="bearer"||!s)return;const p=/resource_metadata="([^"]*)"/.exec(o);if(p)try{return new URL(p[1])}catch{return}}async function po(e,o,a=fetch){const s=await _o(e,"oauth-protected-resource",a,{protocolVersion:o?.protocolVersion,metadataUrl:o?.resourceMetadataUrl});if(!s||s.status===404)throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!s.ok)throw new Error(`HTTP ${s.status} trying to load well-known OAuth protected resource metadata.`);return Qt.parse(await s.json())}async function he(e,o,a=fetch){try{return await a(e,{headers:o})}catch(s){if(s instanceof TypeError)return o?he(e,void 0,a):void 0;throw s}}function ho(e,o="",a={}){return o.endsWith("/")&&(o=o.slice(0,-1)),a.prependPathname?`${o}/.well-known/${e}`:`/.well-known/${e}${o}`}async function ge(e,o,a=fetch){return await he(e,{"MCP-Protocol-Version":o},a)}function mo(e,o){return!e||e.status>=400&&e.status<500&&o!=="/"}async function _o(e,o,a,s){var c,p;const d=new URL(e),l=(c=s?.protocolVersion)!==null&&c!==void 0?c:ae;let h;if(s?.metadataUrl)h=new URL(s.metadataUrl);else{const m=ho(o,d.pathname);h=new URL(m,(p=s?.metadataServerUrl)!==null&&p!==void 0?p:d),h.search=d.search}let g=await ge(h,l,a);if(!s?.metadataUrl&&mo(g,d.pathname)){const m=new URL(`/.well-known/${o}`,d);g=await ge(m,l,a)}return g}function go(e){const o=typeof e=="string"?new URL(e):e,a=o.pathname!=="/",s=[];if(!a)return s.push({url:new URL("/.well-known/oauth-authorization-server",o.origin),type:"oauth"}),s.push({url:new URL("/.well-known/openid-configuration",o.origin),type:"oidc"}),s;let c=o.pathname;return c.endsWith("/")&&(c=c.slice(0,-1)),s.push({url:new URL(`/.well-known/oauth-authorization-server${c}`,o.origin),type:"oauth"}),s.push({url:new URL("/.well-known/oauth-authorization-server",o.origin),type:"oauth"}),s.push({url:new URL(`/.well-known/openid-configuration${c}`,o.origin),type:"oidc"}),s.push({url:new URL(`${c}/.well-known/openid-configuration`,o.origin),type:"oidc"}),s}async function fo(e,{fetchFn:o=fetch,protocolVersion:a=ae}={}){const s={"MCP-Protocol-Version":a,Accept:"application/json"},c=go(e);for(const{url:p,type:d}of c){const l=await he(p,s,o);if(l){if(!l.ok){if(l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${d==="oauth"?"OAuth":"OpenID provider"} metadata from ${p}`)}return d==="oauth"?Me.parse(await l.json()):Ft.parse(await l.json())}}}async function wo(e,{metadata:o,clientInformation:a,redirectUrl:s,scope:c,state:p,resource:d}){let l;if(o){if(l=new URL(o.authorization_endpoint),!o.response_types_supported.includes(W))throw new Error(`Incompatible auth server: does not support response type ${W}`);if(o.code_challenge_methods_supported&&!o.code_challenge_methods_supported.includes(B))throw new Error(`Incompatible auth server: does not support code challenge method ${B}`)}else l=new URL("/authorize",e);const h=await Kt(),g=h.code_verifier,m=h.code_challenge;return l.searchParams.set("response_type",W),l.searchParams.set("client_id",a.client_id),l.searchParams.set("code_challenge",m),l.searchParams.set("code_challenge_method",B),l.searchParams.set("redirect_uri",String(s)),p&&l.searchParams.set("state",p),c&&l.searchParams.set("scope",c),c?.includes("offline_access")&&l.searchParams.append("prompt","consent"),d&&l.searchParams.set("resource",d.href),{authorizationUrl:l,codeVerifier:g}}async function Ro(e,{metadata:o,clientInformation:a,authorizationCode:s,codeVerifier:c,redirectUri:p,resource:d,addClientAuthentication:l,fetchFn:h}){var g;const m="authorization_code",T=o?.token_endpoint?new URL(o.token_endpoint):new URL("/token",e);if(o?.grant_types_supported&&!o.grant_types_supported.includes(m))throw new Error(`Incompatible auth server: does not support grant type ${m}`);const P=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),U=new URLSearchParams({grant_type:m,code:s,code_verifier:c,redirect_uri:String(p)});if(l)l(P,U,e,o);else{const v=(g=o?.token_endpoint_auth_methods_supported)!==null&&g!==void 0?g:[],J=je(a,v);$e(J,a,P,U)}d&&U.set("resource",d.href);const L=await(h??fetch)(T,{method:"POST",headers:P,body:U});if(!L.ok)throw await de(L);return Ne.parse(await L.json())}async function yo(e,{metadata:o,clientInformation:a,refreshToken:s,resource:c,addClientAuthentication:p,fetchFn:d}){var l;const h="refresh_token";let g;if(o){if(g=new URL(o.token_endpoint),o.grant_types_supported&&!o.grant_types_supported.includes(h))throw new Error(`Incompatible auth server: does not support grant type ${h}`)}else g=new URL("/token",e);const m=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),T=new URLSearchParams({grant_type:h,refresh_token:s});if(p)p(m,T,e,o);else{const U=(l=o?.token_endpoint_auth_methods_supported)!==null&&l!==void 0?l:[],L=je(a,U);$e(L,a,m,T)}c&&T.set("resource",c.href);const P=await(d??fetch)(g,{method:"POST",headers:m,body:T});if(!P.ok)throw await de(P);return Ne.parse({refresh_token:s,...await P.json()})}async function So(e,{metadata:o,clientMetadata:a,fetchFn:s}){let c;if(o){if(!o.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");c=new URL(o.registration_endpoint)}else c=new URL("/register",e);const p=await(s??fetch)(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!p.ok)throw await de(p);return no.parse(await p.json())}export{qe as C,me as E,gt as G,Ye as I,ko as J,Fe as L,Lo as M,ke as P,nt as R,xo as S,Eo as U,Oo as a,pt as b,St as c,Ce as d,Pe as e,Po as f,Co as g,To as h,bo as i,ae as j,xe as k,Vt as l,tt as m,Io as n,Uo as o};
@@ -1 +1 @@
1
- import{c as r,d as m,j as n,A as o}from"./index-B5e6fytH.js";function i(){const e=r.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={from:"/auth/$pathname"},e[0]=t):t=e[0];const{pathname:s}=m(t);let a;return e[1]!==s?(a=n.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:n.jsx(o,{pathname:s})}),e[1]=s,e[2]=a):a=e[2],a}export{i as default};
1
+ import{c as r,d as m,j as n,A as o}from"./index-MoI-rvC3.js";function i(){const e=r.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={from:"/auth/$pathname"},e[0]=t):t=e[0];const{pathname:s}=m(t);let a;return e[1]!==s?(a=n.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:n.jsx(o,{pathname:s})}),e[1]=s,e[2]=a):a=e[2],a}export{i as default};
@@ -1 +1 @@
1
- import{c as k,j as i,r as V,af as R,au as $,av as O,aw as U}from"./index-B5e6fytH.js";import{c as m}from"./utils-BLBjpUfr.js";import{I as L}from"./icon-C1glN-Ga.js";function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(U,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function T(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function _(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(O,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const E=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],D="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function W(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%E.length;return E[s]}const S=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-xs font-semibold","2xs":"w-4 h-4 text-xs font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),B=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),G=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function H(r){const e=k.c(35);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,[f,x]=V.useState(!1);let I;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],I=c;break e}I=t}const C=I;let z;e:{if(j){z=D;break e}if(typeof t=="string"){let c;e[11]!==t?(c=W(t),e[11]=t,e[12]=c):c=e[12],z=c;break e}z=E[0]}const y=z;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const A=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(S({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==y||e[23]!==C||e[24]!==A||e[25]!==f||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&A?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",y),children:i.jsx(L,{name:A,size:G(h)})}):i.jsxs(i.Fragment,{children:[l&&!f&&i.jsx(T,{src:l,loading:"lazy",alt:"Avatar",className:m(B({objectFit:u})),onError:()=>x(!0)}),(!l||f)&&i.jsx(_,{className:m(y,"rounded-none"),children:C})]}),e[22]=y,e[23]=C,e[24]=A,e[25]=f,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let F;return e[31]!==o||e[32]!==v||e[33]!==w?(F=i.jsx(M,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=F):F=e[34],F}function J(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,f=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==f||e[16]!==l?(x=i.jsx(H,{shape:b,url:l,fallback:t,size:f,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=f,e[16]=l,e[17]=x):x=e[17],x}J.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{J as A};
1
+ import{c as k,j as i,r as V,af as R,au as $,av as O,aw as U}from"./index-MoI-rvC3.js";import{c as m}from"./utils-BLlwSV8I.js";import{I as L}from"./icon-Cxep_tfx.js";function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(U,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function T(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function _(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(O,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const E=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],D="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function W(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%E.length;return E[s]}const S=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-xs font-semibold","2xs":"w-4 h-4 text-xs font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),B=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),G=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function H(r){const e=k.c(35);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,[f,x]=V.useState(!1);let I;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],I=c;break e}I=t}const C=I;let z;e:{if(j){z=D;break e}if(typeof t=="string"){let c;e[11]!==t?(c=W(t),e[11]=t,e[12]=c):c=e[12],z=c;break e}z=E[0]}const y=z;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const A=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(S({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==y||e[23]!==C||e[24]!==A||e[25]!==f||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&A?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",y),children:i.jsx(L,{name:A,size:G(h)})}):i.jsxs(i.Fragment,{children:[l&&!f&&i.jsx(T,{src:l,loading:"lazy",alt:"Avatar",className:m(B({objectFit:u})),onError:()=>x(!0)}),(!l||f)&&i.jsx(_,{className:m(y,"rounded-none"),children:C})]}),e[22]=y,e[23]=C,e[24]=A,e[25]=f,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let F;return e[31]!==o||e[32]!==v||e[33]!==w?(F=i.jsx(M,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=F):F=e[34],F}function J(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,f=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==f||e[16]!==l?(x=i.jsx(H,{shape:b,url:l,fallback:t,size:f,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=f,e[16]=l,e[17]=x):x=e[17],x}J.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{J as A};
@@ -1 +1 @@
1
- import{c as d,af as u,j as l,ag as v}from"./index-B5e6fytH.js";import{c as g}from"./utils-BLBjpUfr.js";const f=u("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function m(o){const e=d.c(12);let r,s,i,t;e[0]!==o?({className:r,variant:t,asChild:i,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=i,e[4]=t):(r=e[1],s=e[2],i=e[3],t=e[4]);const c=(i===void 0?!1:i)?v:"span";let a;e[5]!==r||e[6]!==t?(a=g(f({variant:t}),r),e[5]=r,e[6]=t,e[7]=a):a=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==a?(n=l.jsx(c,{"data-slot":"badge",className:a,...s}),e[8]=c,e[9]=s,e[10]=a,e[11]=n):n=e[11],n}export{m as B};
1
+ import{c as d,af as u,j as l,ag as v}from"./index-MoI-rvC3.js";import{c as g}from"./utils-BLlwSV8I.js";const f=u("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function m(o){const e=d.c(12);let r,s,i,t;e[0]!==o?({className:r,variant:t,asChild:i,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=i,e[4]=t):(r=e[1],s=e[2],i=e[3],t=e[4]);const c=(i===void 0?!1:i)?v:"span";let a;e[5]!==r||e[6]!==t?(a=g(f({variant:t}),r),e[5]=r,e[6]=t,e[7]=a):a=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==a?(n=l.jsx(c,{"data-slot":"badge",className:a,...s}),e[8]=c,e[9]=s,e[10]=a,e[11]=n):n=e[11],n}export{m as B};
@@ -1 +1 @@
1
- import{bR as p,bS as v,bT as l,bU as g,bV as b,a1 as f,r as u,bW as m,bX as x,c as y,af as O,j as k,ag as C}from"./index-B5e6fytH.js";import{c as E}from"./utils-BLBjpUfr.js";var M=class extends p{#e;#i=void 0;#t;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),v(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),t?.mutationKey&&this.options.mutationKey&&l(t.mutationKey)!==l(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(e){this.#r(),this.#n(e)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#n()}mutate(e,t){return this.#s=t,this.#t?.removeObserver(this),this.#t=this.#e.getMutationCache().build(this.#e,this.options),this.#t.addObserver(this),this.#t.execute(e)}#r(){const e=this.#t?.state??g();this.#i={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#n(e){b.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#i.variables,i=this.#i.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#s.onSuccess?.(e.data,t,i,s),this.#s.onSettled?.(e.data,null,t,i,s)):e?.type==="error"&&(this.#s.onError?.(e.error,t,i,s),this.#s.onSettled?.(void 0,e.error,t,i,s))}this.listeners.forEach(t=>{t(this.#i)})})}};function K(e,t){const i=f(t),[s]=u.useState(()=>new M(i,e));u.useEffect(()=>{s.setOptions(e)},[s,e]);const r=u.useSyncExternalStore(u.useCallback(n=>s.subscribe(b.batchCalls(n)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=u.useCallback((n,d)=>{s.mutate(n,d).catch(m)},[s]);if(r.error&&x(s.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:o,mutateAsync:r.mutate}}const S=O("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground",brand:"bg-brand-green-light text-brand-green-dark hover:bg-brand-green-light/90"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 px-3 has-[>svg]:px-2.5",xs:"h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}});function z(e){const t=y.c(14);let i,s,r,o,n;t[0]!==e?({className:i,variant:n,size:r,asChild:o,...s}=e,t[0]=e,t[1]=i,t[2]=s,t[3]=r,t[4]=o,t[5]=n):(i=t[1],s=t[2],r=t[3],o=t[4],n=t[5]);const c=(o===void 0?!1:o)?C:"button";let a;t[6]!==i||t[7]!==r||t[8]!==n?(a=E(S({variant:n,size:r,className:i})),t[6]=i,t[7]=r,t[8]=n,t[9]=a):a=t[9];let h;return t[10]!==c||t[11]!==s||t[12]!==a?(h=k.jsx(c,{"data-slot":"button",className:a,...s}),t[10]=c,t[11]=s,t[12]=a,t[13]=h):h=t[13],h}export{z as B,S as b,K as u};
1
+ import{bR as p,bS as v,bT as l,bU as g,bV as b,a1 as f,r as u,bW as m,bX as x,c as y,af as O,j as k,ag as C}from"./index-MoI-rvC3.js";import{c as E}from"./utils-BLlwSV8I.js";var M=class extends p{#e;#i=void 0;#t;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),v(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),t?.mutationKey&&this.options.mutationKey&&l(t.mutationKey)!==l(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(e){this.#r(),this.#n(e)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#n()}mutate(e,t){return this.#s=t,this.#t?.removeObserver(this),this.#t=this.#e.getMutationCache().build(this.#e,this.options),this.#t.addObserver(this),this.#t.execute(e)}#r(){const e=this.#t?.state??g();this.#i={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#n(e){b.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#i.variables,i=this.#i.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#s.onSuccess?.(e.data,t,i,s),this.#s.onSettled?.(e.data,null,t,i,s)):e?.type==="error"&&(this.#s.onError?.(e.error,t,i,s),this.#s.onSettled?.(void 0,e.error,t,i,s))}this.listeners.forEach(t=>{t(this.#i)})})}};function K(e,t){const i=f(t),[s]=u.useState(()=>new M(i,e));u.useEffect(()=>{s.setOptions(e)},[s,e]);const r=u.useSyncExternalStore(u.useCallback(n=>s.subscribe(b.batchCalls(n)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=u.useCallback((n,d)=>{s.mutate(n,d).catch(m)},[s]);if(r.error&&x(s.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:o,mutateAsync:r.mutate}}const S=O("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground",brand:"bg-brand-green-light text-brand-green-dark hover:bg-brand-green-light/90"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 px-3 has-[>svg]:px-2.5",xs:"h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}});function z(e){const t=y.c(14);let i,s,r,o,n;t[0]!==e?({className:i,variant:n,size:r,asChild:o,...s}=e,t[0]=e,t[1]=i,t[2]=s,t[3]=r,t[4]=o,t[5]=n):(i=t[1],s=t[2],r=t[3],o=t[4],n=t[5]);const c=(o===void 0?!1:o)?C:"button";let a;t[6]!==i||t[7]!==r||t[8]!==n?(a=E(S({variant:n,size:r,className:i})),t[6]=i,t[7]=r,t[8]=n,t[9]=a):a=t[9];let h;return t[10]!==c||t[11]!==s||t[12]!==a?(h=k.jsx(c,{"data-slot":"button",className:a,...s}),t[10]=c,t[11]=s,t[12]=a,t[13]=h):h=t[13],h}export{z as B,S as b,K as u};
@@ -1 +1 @@
1
- import{c as l,j as c}from"./index-B5e6fytH.js";import{c as d}from"./utils-BLBjpUfr.js";function f(r){const e=l.c(8);let t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=d("bg-card text-card-foreground hover:bg-accent/50 flex flex-col gap-6 rounded-xl border border-border/75",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==a||e[6]!==s?(o=c.jsx("div",{"data-slot":"card",className:s,...a}),e[5]=a,e[6]=s,e[7]=o):o=e[7],o}function p(r){const e=l.c(8);let t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=d("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto]",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==a||e[6]!==s?(o=c.jsx("div",{"data-slot":"card-header",className:s,...a}),e[5]=a,e[6]=s,e[7]=o):o=e[7],o}function m(r){const e=l.c(8);let t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=d("leading-none font-semibold",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==a||e[6]!==s?(o=c.jsx("div",{"data-slot":"card-title",className:s,...a}),e[5]=a,e[6]=s,e[7]=o):o=e[7],o}function u(r){const e=l.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let a;return e[2]!==t?(a=c.jsx("div",{"data-slot":"card-content",...t}),e[2]=t,e[3]=a):a=e[3],a}export{f as C,p as a,m as b,u as c};
1
+ import{c as l,j as c}from"./index-MoI-rvC3.js";import{c as d}from"./utils-BLlwSV8I.js";function f(r){const e=l.c(8);let t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=d("bg-card text-card-foreground hover:bg-accent/50 flex flex-col gap-6 rounded-xl border border-border/75",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==a||e[6]!==s?(o=c.jsx("div",{"data-slot":"card",className:s,...a}),e[5]=a,e[6]=s,e[7]=o):o=e[7],o}function p(r){const e=l.c(8);let t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=d("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto]",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==a||e[6]!==s?(o=c.jsx("div",{"data-slot":"card-header",className:s,...a}),e[5]=a,e[6]=s,e[7]=o):o=e[7],o}function m(r){const e=l.c(8);let t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=d("leading-none font-semibold",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==a||e[6]!==s?(o=c.jsx("div",{"data-slot":"card-title",className:s,...a}),e[5]=a,e[6]=s,e[7]=o):o=e[7],o}function u(r){const e=l.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let a;return e[2]!==t?(a=c.jsx("div",{"data-slot":"card-content",...t}),e[2]=t,e[3]=a):a=e[3],a}export{f as C,p as a,m as b,u as c};
@@ -1 +1 @@
1
- import{c as d,j as c,b9 as n,ba as l}from"./index-B5e6fytH.js";import{c as m}from"./utils-BLBjpUfr.js";import{f as b}from"./select-fvQCifl4.js";function x(o){const e=d.c(9);let r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let i;e[3]!==r?(i=m("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=i):i=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(l,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(b,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==a||e[7]!==i?(s=c.jsx(n,{"data-slot":"checkbox",className:i,...a,children:t}),e[6]=a,e[7]=i,e[8]=s):s=e[8],s}export{x as C};
1
+ import{c as d,j as c,b9 as n,ba as l}from"./index-MoI-rvC3.js";import{c as m}from"./utils-BLlwSV8I.js";import{f as b}from"./select-B4j1Cb8E.js";function x(o){const e=d.c(9);let r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let i;e[3]!==r?(i=m("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=i):i=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(l,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(b,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==a||e[7]!==i?(s=c.jsx(n,{"data-slot":"checkbox",className:i,...a,children:t}),e[6]=a,e[7]=i,e[8]=s):s=e[8],s}export{x as C};
@@ -1 +1 @@
1
- import{b6 as e}from"./index-B5e6fytH.js";const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],y=e("circle-alert",c);export{y as C};
1
+ import{b6 as e}from"./index-MoI-rvC3.js";const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],y=e("circle-alert",c);export{y as C};
@@ -1 +1 @@
1
- import{b6 as _,r as y,d as R,as as ee,j as t,c as S,af as te,a6 as se,b5 as W}from"./index-B5e6fytH.js";import{f as oe,c as D,U as B,a as ne,e as re}from"./use-connection-IMyxygAc.js";import{T as ae}from"./tool-set-selector-Fu1vBXWK.js";import{B as ie}from"./badge-j-myHF25.js";import{B as I}from"./button-DnKGwZ1P.js";import{I as z}from"./icon-C1glN-Ga.js";import{I as V}from"./input-DpAKmHHm.js";import{S as ce}from"./spinner-Cck765yW.js";import{T as q}from"./textarea--4iImQiq.js";import{c as k}from"./utils-BLBjpUfr.js";import{a as G,u as le,O as de,P as me,E as ue}from"./index-DqmRoUE9.js";import{b as Z,a as xe,V as H}from"./layout-BMHVtK0w.js";import{U as fe}from"./upload-DkfUhTLj.js";import{u as pe}from"./index-C1xA8jg5.js";import{C as he}from"./circle-alert-CpqBZI3V.js";import{E as ge}from"./error-boundary-qOVcoWbq.js";import"./tooltip-DjXyjtiH.js";import"./integration-icon-C_Dk6BbN.js";import"./checkbox-v3iP8MNg.js";import"./select-fvQCifl4.js";import"./collection-search-Bd4XQ4_K.js";import"./use-organization-settings-CpvpbwdB.js";import"./empty-state-DV83eIhT.js";import"./use-binding-BLIUV5ER.js";import"./auth-CGqqbEan.js";import"./use-tool-call-p0lqBezD.js";import"./chunk-2RRQPJJO-DGhxLrrR.js";import"./form-0C1lYHJ2.js";import"./use-gateway-CuMrhcvh.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./extract-connection-data-DzgXoQyz.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-Chpp7zg0.js";import"./index-D2ODleHN.js";import"./schema-BLzWyGtx.js";const be=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],je=_("box",be);const ve=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ne=_("clock",ve);const ye=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],we=_("code",ye);const Se=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Ce=_("copy",Se);const ke=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],$e=_("database",ke);const Ie=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],_e=_("info",Ie);const Te=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],K=_("play",Te);function Ee(s){const e=S.c(14),{value:n,onChange:a,alt:r}=s,o=y.useRef(null);let i;e[0]!==a?(i=p=>{const v=p.target.files?.[0];if(v){const w=new FileReader;w.onloadend=()=>{const j=w.result;a(j)},w.readAsDataURL(v)}},e[0]=a,e[1]=i):i=e[1];const m=i;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o.current?.click()},e[2]=l):l=e[2];const u=l;let c;e[3]!==m?(c=t.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*",onChange:m}),e[3]=m,e[4]=c):c=e[4];let h;e[5]!==r||e[6]!==n?(h=n?t.jsx("img",{src:n,alt:r||"Avatar",className:"w-full h-full object-cover"}):t.jsx("div",{className:"w-full h-full flex items-center justify-center text-2xl",children:"🤖"}),e[5]=r,e[6]=n,e[7]=h):h=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:t.jsx(fe,{className:"h-5 w-5 text-white"})}),e[8]=g):g=e[8];let b;e[9]!==h?(b=t.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[h,g]}),e[9]=h,e[10]=b):b=e[10];let f;return e[11]!==c||e[12]!==b?(f=t.jsxs("div",{className:"relative h-14 w-14 shrink-0 cursor-pointer group",onClick:u,children:[c,b]}),e[11]=c,e[12]=b,e[13]=f):f=e[13],f}function Ae({itemId:s,onBack:e,onUpdate:n}){const[a,r]=y.useState(!1),[o,i]=y.useState("profile"),{connectionId:m}=R({from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"}),l=m??B,u=D(l),c=oe(l,"AGENT",s,u),{register:h,handleSubmit:g,reset:b,setValue:f,watch:p,formState:{isDirty:v}}=ee({defaultValues:{title:"",description:"",instructions:"",avatar:"",tool_set:{}}}),w=p("avatar"),j=p("tool_set")??{};y.useEffect(()=>{c&&b({title:c.title??"",description:c.description??"",instructions:c.instructions??"",avatar:c.avatar??"",tool_set:c.tool_set??{}})},[c,b]);const x=async $=>{r(!0);try{await n($)}finally{r(!1)}},M=$=>{f("tool_set",$,{shouldDirty:!0})};return c?t.jsxs(Z,{onBack:e,children:[t.jsxs(xe,{children:[t.jsx(I,{variant:o==="profile"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="profile"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("profile"),children:"Profile"}),t.jsx(I,{variant:o==="tools"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="tools"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("tools"),children:"Tools"}),t.jsx(I,{variant:o==="triggers"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="triggers"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("triggers"),disabled:!0,children:"Triggers"}),t.jsx(I,{variant:o==="advanced"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="advanced"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("advanced"),disabled:!0,children:"Advanced"})]}),t.jsxs(H,{children:[t.jsx(G,{connectionId:m,title:c.title,icon:c.avatar??"smart_toy"}),t.jsx(I,{className:"bg-[#d0ec1a] text-[#07401a] hover:bg-[#d0ec1a]/90 h-7 text-xs font-medium",onClick:g(x),disabled:!v||a,children:a?t.jsxs(t.Fragment,{children:[t.jsx(z,{name:"progress_activity",size:12,className:"mr-2 animate-spin"}),"Saving..."]}):"Save changes"})]}),o==="profile"&&t.jsx("div",{className:"p-5",children:t.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[t.jsxs("div",{className:"flex gap-4 items-start",children:[t.jsx(Ee,{value:w,onChange:$=>f("avatar",$,{shouldDirty:!0}),alt:p("title")}),t.jsxs("div",{className:"space-y-3 pt-1 flex-1",children:[t.jsx(V,{...h("title"),className:"text-2xl font-medium text-foreground border-transparent hover:border-input focus:border-input px-0 h-auto bg-transparent shadow-none",placeholder:"Agent Name"}),t.jsx(V,{...h("description"),className:"text-sm text-muted-foreground border-transparent hover:border-input focus:border-input px-0 h-auto bg-transparent shadow-none",placeholder:"Brief description"})]})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(ie,{variant:"secondary",className:"px-2 py-0.5 h-6 gap-1.5 bg-secondary/50 text-muted-foreground font-normal text-xs hover:bg-secondary/50",children:[t.jsx(_e,{className:"h-3.5 w-3.5"}),"Type @ to add tools and more"]}),t.jsx("div",{className:"relative",children:t.jsx(q,{...h("instructions"),className:"min-h-[400px] resize-none text-sm leading-relaxed font-normal border-0 focus-visible:ring-0 px-0 py-0 shadow-none",placeholder:"Enter agent instructions..."})})]})]})}),o==="tools"&&t.jsx(ae,{toolSet:j,onToolSetChange:M}),o==="triggers"&&t.jsx("div",{className:"p-5",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Triggers tab coming soon"})}),o==="advanced"&&t.jsx("div",{className:"p-5",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Advanced tab coming soon"})})]}):t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{})})}const ze=te("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/10 text-destructive border-destructive [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Re(s){const e=S.c(10);let n,a,r;e[0]!==s?({className:n,variant:r,...a}=s,e[0]=s,e[1]=n,e[2]=a,e[3]=r):(n=e[1],a=e[2],r=e[3]);let o;e[4]!==n||e[5]!==r?(o=k(ze({variant:r}),n),e[4]=n,e[5]=r,e[6]=o):o=e[6];let i;return e[7]!==a||e[8]!==o?(i=t.jsx("div",{"data-slot":"alert",role:"alert",className:o,...a}),e[7]=a,e[8]=o,e[9]=i):i=e[9],i}function Me(s){const e=S.c(8);let n,a;e[0]!==s?({className:n,...a}=s,e[0]=s,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let r;e[3]!==n?(r=k("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=t.jsx("div",{"data-slot":"alert-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function Oe(s){const e=S.c(8);let n,a;e[0]!==s?({className:n,...a}=s,e[0]=s,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let r;e[3]!==n?(r=k("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=t.jsx("div",{"data-slot":"alert-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function Pe(s){try{const e=new URL(s);return e.pathname=e.pathname.replace(/\/i:([a-f0-9-]+)/gi,"/$1"),e.toString()}catch{return s}}const Ue=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ve(s){const e=S.c(15),{toolName:n,connectionId:a,connection:r,onBack:o}=s;let i;e[0]!==r.connection_url?(i=Pe(r.connection_url),e[0]=r.connection_url,e[1]=i):i=e[1];const m=i,l=`/mcp/${a}`;let u;e[2]!==l?(u=new URL(l,window.location.origin),e[2]=l,e[3]=u):u=e[3];const c=u,h=r.connection_token??null;let g;if(e[4]!==m||e[5]!==h?(g={url:m,token:h},e[4]=m,e[5]=h,e[6]=g):g=e[6],!le(g)){let v;return e[7]!==o?(v=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{onAuthenticate:()=>o(),buttonText:"Go back"})}),e[7]=o,e[8]=v):v=e[8],v}const f=`${a}:${n}`;let p;return e[9]!==a||e[10]!==c||e[11]!==o||e[12]!==f||e[13]!==n?(p=t.jsx(De,{toolName:n,connectionId:a,mcpProxyUrl:c,onBack:o},f),e[9]=a,e[10]=c,e[11]=o,e[12]=f,e[13]=n,e[14]=p):p=e[14],p}function De({toolName:s,connectionId:e,mcpProxyUrl:n,onBack:a}){const[r,o]=y.useState({}),[i,m]=y.useState("{}"),[l,u]=y.useState(null),[c,h]=y.useState(null),[g,b]=y.useState(!1),[f,p]=y.useState(null),[v,w]=y.useState("json"),j=pe({url:n.href,clientName:"MCP Tool Inspector",clientUri:window.location.origin,autoReconnect:!1});y.useEffect(()=>{j.error&&console.error("MCP Error:",j.error)},[j.error]);const x=j.tools?.find(d=>d.name===s),M=x?.inputSchema?.properties,$=M?Object.keys(M):[],A=$.length>0,O={};if(A&&x?.inputSchema?.properties)for(const d of $)O[d]=x.inputSchema.required?.includes(d)?"":void 0;const J=d=>Object.prototype.hasOwnProperty.call(r,d),Q=async()=>{b(!0),h(null),u(null),p(null);const d=performance.now(),C=D(e);try{const N=A?{...O,...r}:(()=>{const T=i.trim();if(!T)return{};const E=JSON.parse(T);if(E&&typeof E=="object")return E;throw new Error("Raw JSON input must be an object.")})();A&&x?.inputSchema?.properties&&Object.entries(x.inputSchema.properties).forEach(([T,E])=>{if((E.type==="object"||E.type==="array")&&typeof N[T]=="string")try{N[T]=JSON.parse(N[T])}catch{}});const P=await C(s,N),U=performance.now(),X=Math.round(U-d);u(P);const Y=JSON.stringify(P),F=new TextEncoder().encode(Y).length;p({duration:`${X}ms`,bytes:`${F} bytes`,tokens:`~${Math.ceil(F/4)} tokens`,cost:"$0.0000"})}catch(N){const P=N instanceof Error?N.message:String(N);h(P||"Unknown error occurred");const U=performance.now();p({duration:`${Math.round(U-d)}ms`})}finally{b(!1)}},L=(d,C)=>{o(N=>({...N,[d]:C}))};return t.jsxs(Z,{onBack:a,children:[t.jsx(H,{children:t.jsx(G,{connectionId:e,title:x?.title??Ue(s),icon:"build"})}),t.jsxs("div",{className:"flex flex-col items-center w-full max-w-[1500px] mx-auto p-10 gap-4",children:[t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h1",{className:"text-2xl font-medium text-foreground",children:s}),t.jsx("p",{className:"text-muted-foreground text-base",children:x?.description||"No description available"})]}),t.jsxs("div",{className:"flex items-center gap-4 py-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[j.state==="ready"?t.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"}):j.state==="connecting"||j.state==="authenticating"?t.jsx(z,{name:"progress_activity",size:12,className:"animate-spin text-yellow-500"}):t.jsx("div",{className:"h-2 w-2 rounded-full bg-red-500"}),t.jsx("span",{className:"font-mono text-sm capitalize text-muted-foreground",children:j.state.replace("_"," ")})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ne,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:f?.duration||"-"})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:f?.tokens||"-"})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx($e,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:f?.bytes||"-"})]})]}),c&&t.jsxs(Re,{variant:"destructive",className:"max-w-[800px] w-full bg-red-50 dark:bg-red-900/10 border-red-200 dark:border-red-900",children:[t.jsx(he,{className:"h-4 w-4"}),t.jsx(Me,{children:"Execution Failed"}),t.jsx(Oe,{children:c})]}),t.jsxs("div",{className:"flex flex-col gap-4 w-full max-w-[800px] items-center",children:[t.jsxs("div",{className:"w-full bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"h-4 w-4 rounded-sm bg-primary/10 flex items-center justify-center",children:t.jsx(K,{className:"h-3 w-3 text-primary"})}),t.jsx("span",{className:"font-medium text-sm",children:"Input"})]}),t.jsxs(I,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Q,disabled:g,children:[g?t.jsx(z,{name:"progress_activity",size:14,className:"animate-spin"}):t.jsx(K,{className:"h-3.5 w-3.5 fill-current"}),"Execute tool"]})]}),t.jsxs("div",{className:"p-4 space-y-4",children:[t.jsx("div",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:"Arguments"}),A&&x?.inputSchema?.properties?Object.entries(x.inputSchema.properties).map(([d,C])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("label",{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:d}),x.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"}),t.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:C.type})]}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:C.description}),C.type==="object"||C.type==="array"?t.jsx(q,{className:"flex min-h-[60px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 font-mono",value:J(d)?r[d]??"":O[d]??"",onChange:N=>L(d,N.target.value),placeholder:`Enter ${d} as JSON...`}):t.jsx(V,{value:J(d)?r[d]??"":O[d]??"",onChange:N=>L(d,N.target.value),placeholder:`Enter ${d}...`})]},d)):t.jsx("div",{className:"text-sm text-muted-foreground italic",children:"No arguments defined in schema."}),x?.inputSchema&&!A&&t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx("textarea",{className:"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",value:i,onChange:d=>m(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]})]})]}),t.jsxs("div",{className:"w-full bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted/30",children:[t.jsx("span",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:"Execution Result"}),t.jsxs("div",{className:"flex items-center bg-muted rounded-lg p-1 h-8",children:[t.jsx("button",{onClick:()=>w("json"),className:k("px-3 py-1 text-xs font-medium rounded-md transition-all",v==="json"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"JSON"}),t.jsxs("button",{onClick:()=>w("view"),className:k("px-3 py-1 text-xs font-medium rounded-md transition-all flex items-center gap-1",v==="view"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),disabled:!0,title:"Coming soon",children:["Create view",t.jsx(me,{className:"h-3 w-3"})]})]})]}),t.jsxs("div",{className:"relative min-h-[200px] max-h-[500px] overflow-auto bg-zinc-950 text-zinc-50 p-4 font-mono text-xs",children:[l?t.jsx("pre",{className:"whitespace-pre-wrap break-all",children:JSON.stringify(l,null,2)}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-zinc-700",children:[t.jsx(we,{className:"h-8 w-8 mb-2 opacity-50"}),t.jsx("p",{children:"Run the tool to see results"})]}),l&&t.jsx("div",{className:"absolute top-4 right-4 flex gap-2",children:t.jsx(I,{size:"icon",variant:"secondary",className:"h-8 w-8 bg-zinc-800 text-zinc-400 hover:text-white hover:bg-zinc-700 border-zinc-700",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(l,null,2)),se.success("Copied to clipboard")},children:t.jsx(Ce,{className:"h-4 w-4"})})})]})]})]})]})]})}function Be(s){const e=S.c(8),{itemId:n,onBack:a}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=R(r).connectionId??B,m=ne(i);if(!m){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=c):c=e[1],c}let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(z,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),e[2]=l):l=e[2];let u;return e[3]!==m||e[4]!==i||e[5]!==a||e[6]!==n?(u=t.jsx(y.Suspense,{fallback:l,children:t.jsx(Ve,{toolName:n,connectionId:i,connection:m,onBack:a})}),e[3]=m,e[4]=i,e[5]=a,e[6]=n,e[7]=u):u=e[7],u}const Je={agent:Ae};function Le(){const s=S.c(6),e=W();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=n):n=s[0];const a=R(n),r=decodeURIComponent(a.itemId);let o;s[1]!==e.history?(o=()=>{e.history.back()},s[1]=e.history,s[2]=o):o=s[2];const i=o,m=Fe;let l;return s[3]!==i||s[4]!==r?(l=t.jsx(Be,{itemId:r,onBack:i,onUpdate:m}),s[3]=i,s[4]=r,s[5]=l):l=s[5],l}async function Fe(s){return Promise.resolve()}function Ke(){const s=S.c(17),e=W();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=n):n=s[0];const a=R(n),r=a.connectionId,o=decodeURIComponent(a.collectionName),i=decodeURIComponent(a.itemId);let m;s[1]!==e.history?(m=()=>{e.history.back()},s[1]=e.history,s[2]=m):m=s[2];const l=m,u=r??B;let c;s[3]!==u?(c=D(u),s[3]=u,s[4]=c):c=s[4];const g=re(u,o,c);let b;s[5]!==g||s[6]!==i?(b=async x=>{i&&await g.update.mutateAsync({id:i,data:x})},s[5]=g,s[6]=i,s[7]=b):b=s[7];const f=b;let p;s[8]!==o?(p=o?.toLowerCase(),s[8]=o,s[9]=p):p=s[9];const v=p,w=v&&Je[v];if(w){let x;return s[10]!==w||s[11]!==l||s[12]!==f||s[13]!==i?(x=t.jsx(w,{itemId:i,onBack:l,onUpdate:f}),s[10]=w,s[11]=l,s[12]=f,s[13]=i,s[14]=x):x=s[14],x}let j;return s[15]!==l?(j=t.jsx(ue,{icon:"extension",title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:l,children:"Go back"}}),s[15]=l,s[16]=j):j=s[16],j}function We(){const s=S.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=e):e=s[0];const n=R(e);if(decodeURIComponent(n.collectionName)==="tools"){let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Le,{}),s[1]=i):i=s[1],i}let o;return s[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Ke,{}),s[2]=o):o=s[2],o}function _t(){const s=S.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ge,{children:t.jsx(y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(z,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(We,{})})}),s[0]=e):e=s[0],e}export{_t as default};
1
+ import{b6 as _,r as y,d as R,as as ee,j as t,c as S,af as te,a6 as se,b5 as W}from"./index-MoI-rvC3.js";import{f as oe,c as D,U as B,a as ne,e as re}from"./use-connection-DiHU9E79.js";import{T as ae}from"./tool-set-selector-DYpFtHWh.js";import{B as ie}from"./badge-Bi_GpkO_.js";import{B as I}from"./button-G3aMPyFq.js";import{I as z}from"./icon-Cxep_tfx.js";import{I as V}from"./input-CXe38a5R.js";import{S as ce}from"./spinner-BgjBycmB.js";import{T as q}from"./textarea-BK0_vna7.js";import{c as k}from"./utils-BLlwSV8I.js";import{a as G,u as le,O as de,P as me,E as ue}from"./index-Bhg5-H1t.js";import{b as Z,a as xe,V as H}from"./layout-DqgJyIdL.js";import{U as fe}from"./upload-n_AaBb-Z.js";import{u as pe}from"./index-BtenH3n7.js";import{C as he}from"./circle-alert-B9wPiUFk.js";import{E as ge}from"./error-boundary-9CuK9oWa.js";import"./tooltip-CyReuecv.js";import"./integration-icon-C162QlgN.js";import"./checkbox-DgaTW36u.js";import"./select-B4j1Cb8E.js";import"./collection-search-DFSSOoxU.js";import"./use-organization-settings-Cywci2R8.js";import"./empty-state-YCqZyamY.js";import"./use-binding-DdwHCRqV.js";import"./auth-D1xg1rd7.js";import"./use-tool-call-CPpXYXAZ.js";import"./chunk-2RRQPJJO-DGhxLrrR.js";import"./form-BsxjQn2d.js";import"./use-gateway-B9o1M04u.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./extract-connection-data-Cu9jjhV-.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-fqd6S2iW.js";import"./index-BRGTweKk.js";import"./schema-BJ2fRDqu.js";const be=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],je=_("box",be);const ve=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ne=_("clock",ve);const ye=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],we=_("code",ye);const Se=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Ce=_("copy",Se);const ke=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],$e=_("database",ke);const Ie=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],_e=_("info",Ie);const Te=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],K=_("play",Te);function Ee(s){const e=S.c(14),{value:n,onChange:a,alt:r}=s,o=y.useRef(null);let i;e[0]!==a?(i=p=>{const v=p.target.files?.[0];if(v){const w=new FileReader;w.onloadend=()=>{const j=w.result;a(j)},w.readAsDataURL(v)}},e[0]=a,e[1]=i):i=e[1];const m=i;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o.current?.click()},e[2]=l):l=e[2];const u=l;let c;e[3]!==m?(c=t.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*",onChange:m}),e[3]=m,e[4]=c):c=e[4];let h;e[5]!==r||e[6]!==n?(h=n?t.jsx("img",{src:n,alt:r||"Avatar",className:"w-full h-full object-cover"}):t.jsx("div",{className:"w-full h-full flex items-center justify-center text-2xl",children:"🤖"}),e[5]=r,e[6]=n,e[7]=h):h=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:t.jsx(fe,{className:"h-5 w-5 text-white"})}),e[8]=g):g=e[8];let b;e[9]!==h?(b=t.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[h,g]}),e[9]=h,e[10]=b):b=e[10];let f;return e[11]!==c||e[12]!==b?(f=t.jsxs("div",{className:"relative h-14 w-14 shrink-0 cursor-pointer group",onClick:u,children:[c,b]}),e[11]=c,e[12]=b,e[13]=f):f=e[13],f}function Ae({itemId:s,onBack:e,onUpdate:n}){const[a,r]=y.useState(!1),[o,i]=y.useState("profile"),{connectionId:m}=R({from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"}),l=m??B,u=D(l),c=oe(l,"AGENT",s,u),{register:h,handleSubmit:g,reset:b,setValue:f,watch:p,formState:{isDirty:v}}=ee({defaultValues:{title:"",description:"",instructions:"",avatar:"",tool_set:{}}}),w=p("avatar"),j=p("tool_set")??{};y.useEffect(()=>{c&&b({title:c.title??"",description:c.description??"",instructions:c.instructions??"",avatar:c.avatar??"",tool_set:c.tool_set??{}})},[c,b]);const x=async $=>{r(!0);try{await n($)}finally{r(!1)}},M=$=>{f("tool_set",$,{shouldDirty:!0})};return c?t.jsxs(Z,{onBack:e,children:[t.jsxs(xe,{children:[t.jsx(I,{variant:o==="profile"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="profile"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("profile"),children:"Profile"}),t.jsx(I,{variant:o==="tools"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="tools"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("tools"),children:"Tools"}),t.jsx(I,{variant:o==="triggers"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="triggers"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("triggers"),disabled:!0,children:"Triggers"}),t.jsx(I,{variant:o==="advanced"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="advanced"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("advanced"),disabled:!0,children:"Advanced"})]}),t.jsxs(H,{children:[t.jsx(G,{connectionId:m,title:c.title,icon:c.avatar??"smart_toy"}),t.jsx(I,{className:"bg-[#d0ec1a] text-[#07401a] hover:bg-[#d0ec1a]/90 h-7 text-xs font-medium",onClick:g(x),disabled:!v||a,children:a?t.jsxs(t.Fragment,{children:[t.jsx(z,{name:"progress_activity",size:12,className:"mr-2 animate-spin"}),"Saving..."]}):"Save changes"})]}),o==="profile"&&t.jsx("div",{className:"p-5",children:t.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[t.jsxs("div",{className:"flex gap-4 items-start",children:[t.jsx(Ee,{value:w,onChange:$=>f("avatar",$,{shouldDirty:!0}),alt:p("title")}),t.jsxs("div",{className:"space-y-3 pt-1 flex-1",children:[t.jsx(V,{...h("title"),className:"text-2xl font-medium text-foreground border-transparent hover:border-input focus:border-input px-0 h-auto bg-transparent shadow-none",placeholder:"Agent Name"}),t.jsx(V,{...h("description"),className:"text-sm text-muted-foreground border-transparent hover:border-input focus:border-input px-0 h-auto bg-transparent shadow-none",placeholder:"Brief description"})]})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(ie,{variant:"secondary",className:"px-2 py-0.5 h-6 gap-1.5 bg-secondary/50 text-muted-foreground font-normal text-xs hover:bg-secondary/50",children:[t.jsx(_e,{className:"h-3.5 w-3.5"}),"Type @ to add tools and more"]}),t.jsx("div",{className:"relative",children:t.jsx(q,{...h("instructions"),className:"min-h-[400px] resize-none text-sm leading-relaxed font-normal border-0 focus-visible:ring-0 px-0 py-0 shadow-none",placeholder:"Enter agent instructions..."})})]})]})}),o==="tools"&&t.jsx(ae,{toolSet:j,onToolSetChange:M}),o==="triggers"&&t.jsx("div",{className:"p-5",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Triggers tab coming soon"})}),o==="advanced"&&t.jsx("div",{className:"p-5",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Advanced tab coming soon"})})]}):t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{})})}const ze=te("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/10 text-destructive border-destructive [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Re(s){const e=S.c(10);let n,a,r;e[0]!==s?({className:n,variant:r,...a}=s,e[0]=s,e[1]=n,e[2]=a,e[3]=r):(n=e[1],a=e[2],r=e[3]);let o;e[4]!==n||e[5]!==r?(o=k(ze({variant:r}),n),e[4]=n,e[5]=r,e[6]=o):o=e[6];let i;return e[7]!==a||e[8]!==o?(i=t.jsx("div",{"data-slot":"alert",role:"alert",className:o,...a}),e[7]=a,e[8]=o,e[9]=i):i=e[9],i}function Me(s){const e=S.c(8);let n,a;e[0]!==s?({className:n,...a}=s,e[0]=s,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let r;e[3]!==n?(r=k("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=t.jsx("div",{"data-slot":"alert-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function Oe(s){const e=S.c(8);let n,a;e[0]!==s?({className:n,...a}=s,e[0]=s,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let r;e[3]!==n?(r=k("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=t.jsx("div",{"data-slot":"alert-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function Pe(s){try{const e=new URL(s);return e.pathname=e.pathname.replace(/\/i:([a-f0-9-]+)/gi,"/$1"),e.toString()}catch{return s}}const Ue=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ve(s){const e=S.c(15),{toolName:n,connectionId:a,connection:r,onBack:o}=s;let i;e[0]!==r.connection_url?(i=Pe(r.connection_url),e[0]=r.connection_url,e[1]=i):i=e[1];const m=i,l=`/mcp/${a}`;let u;e[2]!==l?(u=new URL(l,window.location.origin),e[2]=l,e[3]=u):u=e[3];const c=u,h=r.connection_token??null;let g;if(e[4]!==m||e[5]!==h?(g={url:m,token:h},e[4]=m,e[5]=h,e[6]=g):g=e[6],!le(g)){let v;return e[7]!==o?(v=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{onAuthenticate:()=>o(),buttonText:"Go back"})}),e[7]=o,e[8]=v):v=e[8],v}const f=`${a}:${n}`;let p;return e[9]!==a||e[10]!==c||e[11]!==o||e[12]!==f||e[13]!==n?(p=t.jsx(De,{toolName:n,connectionId:a,mcpProxyUrl:c,onBack:o},f),e[9]=a,e[10]=c,e[11]=o,e[12]=f,e[13]=n,e[14]=p):p=e[14],p}function De({toolName:s,connectionId:e,mcpProxyUrl:n,onBack:a}){const[r,o]=y.useState({}),[i,m]=y.useState("{}"),[l,u]=y.useState(null),[c,h]=y.useState(null),[g,b]=y.useState(!1),[f,p]=y.useState(null),[v,w]=y.useState("json"),j=pe({url:n.href,clientName:"MCP Tool Inspector",clientUri:window.location.origin,autoReconnect:!1});y.useEffect(()=>{j.error&&console.error("MCP Error:",j.error)},[j.error]);const x=j.tools?.find(d=>d.name===s),M=x?.inputSchema?.properties,$=M?Object.keys(M):[],A=$.length>0,O={};if(A&&x?.inputSchema?.properties)for(const d of $)O[d]=x.inputSchema.required?.includes(d)?"":void 0;const J=d=>Object.prototype.hasOwnProperty.call(r,d),Q=async()=>{b(!0),h(null),u(null),p(null);const d=performance.now(),C=D(e);try{const N=A?{...O,...r}:(()=>{const T=i.trim();if(!T)return{};const E=JSON.parse(T);if(E&&typeof E=="object")return E;throw new Error("Raw JSON input must be an object.")})();A&&x?.inputSchema?.properties&&Object.entries(x.inputSchema.properties).forEach(([T,E])=>{if((E.type==="object"||E.type==="array")&&typeof N[T]=="string")try{N[T]=JSON.parse(N[T])}catch{}});const P=await C(s,N),U=performance.now(),X=Math.round(U-d);u(P);const Y=JSON.stringify(P),F=new TextEncoder().encode(Y).length;p({duration:`${X}ms`,bytes:`${F} bytes`,tokens:`~${Math.ceil(F/4)} tokens`,cost:"$0.0000"})}catch(N){const P=N instanceof Error?N.message:String(N);h(P||"Unknown error occurred");const U=performance.now();p({duration:`${Math.round(U-d)}ms`})}finally{b(!1)}},L=(d,C)=>{o(N=>({...N,[d]:C}))};return t.jsxs(Z,{onBack:a,children:[t.jsx(H,{children:t.jsx(G,{connectionId:e,title:x?.title??Ue(s),icon:"build"})}),t.jsxs("div",{className:"flex flex-col items-center w-full max-w-[1500px] mx-auto p-10 gap-4",children:[t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h1",{className:"text-2xl font-medium text-foreground",children:s}),t.jsx("p",{className:"text-muted-foreground text-base",children:x?.description||"No description available"})]}),t.jsxs("div",{className:"flex items-center gap-4 py-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[j.state==="ready"?t.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"}):j.state==="connecting"||j.state==="authenticating"?t.jsx(z,{name:"progress_activity",size:12,className:"animate-spin text-yellow-500"}):t.jsx("div",{className:"h-2 w-2 rounded-full bg-red-500"}),t.jsx("span",{className:"font-mono text-sm capitalize text-muted-foreground",children:j.state.replace("_"," ")})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ne,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:f?.duration||"-"})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:f?.tokens||"-"})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx($e,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:f?.bytes||"-"})]})]}),c&&t.jsxs(Re,{variant:"destructive",className:"max-w-[800px] w-full bg-red-50 dark:bg-red-900/10 border-red-200 dark:border-red-900",children:[t.jsx(he,{className:"h-4 w-4"}),t.jsx(Me,{children:"Execution Failed"}),t.jsx(Oe,{children:c})]}),t.jsxs("div",{className:"flex flex-col gap-4 w-full max-w-[800px] items-center",children:[t.jsxs("div",{className:"w-full bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"h-4 w-4 rounded-sm bg-primary/10 flex items-center justify-center",children:t.jsx(K,{className:"h-3 w-3 text-primary"})}),t.jsx("span",{className:"font-medium text-sm",children:"Input"})]}),t.jsxs(I,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Q,disabled:g,children:[g?t.jsx(z,{name:"progress_activity",size:14,className:"animate-spin"}):t.jsx(K,{className:"h-3.5 w-3.5 fill-current"}),"Execute tool"]})]}),t.jsxs("div",{className:"p-4 space-y-4",children:[t.jsx("div",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:"Arguments"}),A&&x?.inputSchema?.properties?Object.entries(x.inputSchema.properties).map(([d,C])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("label",{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:d}),x.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"}),t.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:C.type})]}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:C.description}),C.type==="object"||C.type==="array"?t.jsx(q,{className:"flex min-h-[60px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 font-mono",value:J(d)?r[d]??"":O[d]??"",onChange:N=>L(d,N.target.value),placeholder:`Enter ${d} as JSON...`}):t.jsx(V,{value:J(d)?r[d]??"":O[d]??"",onChange:N=>L(d,N.target.value),placeholder:`Enter ${d}...`})]},d)):t.jsx("div",{className:"text-sm text-muted-foreground italic",children:"No arguments defined in schema."}),x?.inputSchema&&!A&&t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx("textarea",{className:"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",value:i,onChange:d=>m(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]})]})]}),t.jsxs("div",{className:"w-full bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted/30",children:[t.jsx("span",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:"Execution Result"}),t.jsxs("div",{className:"flex items-center bg-muted rounded-lg p-1 h-8",children:[t.jsx("button",{onClick:()=>w("json"),className:k("px-3 py-1 text-xs font-medium rounded-md transition-all",v==="json"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"JSON"}),t.jsxs("button",{onClick:()=>w("view"),className:k("px-3 py-1 text-xs font-medium rounded-md transition-all flex items-center gap-1",v==="view"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),disabled:!0,title:"Coming soon",children:["Create view",t.jsx(me,{className:"h-3 w-3"})]})]})]}),t.jsxs("div",{className:"relative min-h-[200px] max-h-[500px] overflow-auto bg-zinc-950 text-zinc-50 p-4 font-mono text-xs",children:[l?t.jsx("pre",{className:"whitespace-pre-wrap break-all",children:JSON.stringify(l,null,2)}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-zinc-700",children:[t.jsx(we,{className:"h-8 w-8 mb-2 opacity-50"}),t.jsx("p",{children:"Run the tool to see results"})]}),l&&t.jsx("div",{className:"absolute top-4 right-4 flex gap-2",children:t.jsx(I,{size:"icon",variant:"secondary",className:"h-8 w-8 bg-zinc-800 text-zinc-400 hover:text-white hover:bg-zinc-700 border-zinc-700",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(l,null,2)),se.success("Copied to clipboard")},children:t.jsx(Ce,{className:"h-4 w-4"})})})]})]})]})]})]})}function Be(s){const e=S.c(8),{itemId:n,onBack:a}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=R(r).connectionId??B,m=ne(i);if(!m){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=c):c=e[1],c}let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(z,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),e[2]=l):l=e[2];let u;return e[3]!==m||e[4]!==i||e[5]!==a||e[6]!==n?(u=t.jsx(y.Suspense,{fallback:l,children:t.jsx(Ve,{toolName:n,connectionId:i,connection:m,onBack:a})}),e[3]=m,e[4]=i,e[5]=a,e[6]=n,e[7]=u):u=e[7],u}const Je={agent:Ae};function Le(){const s=S.c(6),e=W();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=n):n=s[0];const a=R(n),r=decodeURIComponent(a.itemId);let o;s[1]!==e.history?(o=()=>{e.history.back()},s[1]=e.history,s[2]=o):o=s[2];const i=o,m=Fe;let l;return s[3]!==i||s[4]!==r?(l=t.jsx(Be,{itemId:r,onBack:i,onUpdate:m}),s[3]=i,s[4]=r,s[5]=l):l=s[5],l}async function Fe(s){return Promise.resolve()}function Ke(){const s=S.c(17),e=W();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=n):n=s[0];const a=R(n),r=a.connectionId,o=decodeURIComponent(a.collectionName),i=decodeURIComponent(a.itemId);let m;s[1]!==e.history?(m=()=>{e.history.back()},s[1]=e.history,s[2]=m):m=s[2];const l=m,u=r??B;let c;s[3]!==u?(c=D(u),s[3]=u,s[4]=c):c=s[4];const g=re(u,o,c);let b;s[5]!==g||s[6]!==i?(b=async x=>{i&&await g.update.mutateAsync({id:i,data:x})},s[5]=g,s[6]=i,s[7]=b):b=s[7];const f=b;let p;s[8]!==o?(p=o?.toLowerCase(),s[8]=o,s[9]=p):p=s[9];const v=p,w=v&&Je[v];if(w){let x;return s[10]!==w||s[11]!==l||s[12]!==f||s[13]!==i?(x=t.jsx(w,{itemId:i,onBack:l,onUpdate:f}),s[10]=w,s[11]=l,s[12]=f,s[13]=i,s[14]=x):x=s[14],x}let j;return s[15]!==l?(j=t.jsx(ue,{icon:"extension",title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:l,children:"Go back"}}),s[15]=l,s[16]=j):j=s[16],j}function We(){const s=S.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=e):e=s[0];const n=R(e);if(decodeURIComponent(n.collectionName)==="tools"){let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Le,{}),s[1]=i):i=s[1],i}let o;return s[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Ke,{}),s[2]=o):o=s[2],o}function _t(){const s=S.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ge,{children:t.jsx(y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(z,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(We,{})})}),s[0]=e):e=s[0],e}export{_t as default};
@@ -1 +1 @@
1
- import{c as F,r as R,j as t}from"./index-B5e6fytH.js";import{B as G}from"./button-DnKGwZ1P.js";import{c as H,D as J,a as Q,b as U}from"./dropdown-menu-BIeRR6rM.js";import{I as w}from"./icon-C1glN-Ga.js";import{d as X,b as Y,a as Z,T as ee}from"./tooltip-DjXyjtiH.js";import{c as L}from"./utils-BLBjpUfr.js";function ne(W){const e=F.c(47),{viewMode:r,onViewModeChange:i,sortKey:I,sortDirection:y,onSort:N,sortOptions:v}=W;let _;e[0]!==v?(_=v===void 0?[]:v,e[0]=v,e[1]=_):_=e[1];const C=_,E=R.useRef(null),B=R.useRef(null);let z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z={left:0,width:0,opacity:0},e[2]=z):z=e[2];const[j,q]=R.useState(z);let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k=s=>{if(!s.current)return;const{offsetLeft:o,offsetWidth:A}=s.current;q({left:o,width:A,opacity:1})},e[3]=k):k=e[3];const V=k;let S,T;e[4]!==r?(S=()=>{V(r==="table"?E:B)},T=[r],e[4]=r,e[5]=S,e[6]=T):(S=e[5],T=e[6]),R.useEffect(S,T);let l;e[7]!==r?(l=s=>{s&&setTimeout(()=>{V(r==="table"?E:B)},0)},e[7]=r,e[8]=l):l=e[8];let D;e[9]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(X,{children:t.jsxs(Y,{children:[t.jsx(Z,{asChild:!0,children:t.jsx(J,{asChild:!0,children:t.jsx(G,{variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(w,{name:"tune",size:16})})})}),t.jsx(ee,{children:"Search filters"})]})}),e[9]=D):D=e[9];let n;e[10]!==i?(n=()=>{i("table")},e[10]=i,e[11]=n):n=e[11];const O=r==="table"?"text-foreground":"text-muted-foreground";let a;e[12]!==O?(a=L("transition-colors ease-out duration-200",O),e[12]=O,e[13]=a):a=e[13];let c;e[14]!==a?(c=t.jsx(w,{name:"table_rows",size:16,className:a}),e[14]=a,e[15]=c):c=e[15];let d;e[16]!==c||e[17]!==n?(d=t.jsx("button",{ref:E,type:"button",onClick:n,className:"relative z-10 flex-1 flex items-center justify-center gap-2 h-12 px-4 rounded-lg",children:c}),e[16]=c,e[17]=n,e[18]=d):d=e[18];let f;e[19]!==i?(f=()=>{i("cards")},e[19]=i,e[20]=f):f=e[20];const P=r==="cards"?"text-foreground":"text-muted-foreground";let u;e[21]!==P?(u=L("transition-colors ease-out duration-200",P),e[21]=P,e[22]=u):u=e[22];let m;e[23]!==u?(m=t.jsx(w,{name:"grid_view",size:16,className:u}),e[23]=u,e[24]=m):m=e[24];let x;e[25]!==f||e[26]!==m?(x=t.jsx("button",{ref:B,type:"button",onClick:f,className:"relative z-10 flex-1 flex items-center justify-center gap-2 h-12 px-4 rounded-lg",children:m}),e[25]=f,e[26]=m,e[27]=x):x=e[27];const $=`${j.left}px`,K=`${j.width}px`;let p;e[28]!==j.opacity||e[29]!==$||e[30]!==K?(p=t.jsx("div",{className:"absolute z-0 h-12 bg-background border border-border rounded-lg transition-all ease-out duration-200",style:{left:$,width:K,opacity:j.opacity}}),e[28]=j.opacity,e[29]=$,e[30]=K,e[31]=p):p=e[31];let h;e[32]!==d||e[33]!==x||e[34]!==p?(h=t.jsx("div",{className:"p-2 border-b border-border",children:t.jsx("div",{className:"relative bg-muted rounded-lg p-1",children:t.jsxs("div",{className:"relative flex gap-0",children:[d,x,p]})})}),e[32]=d,e[33]=x,e[34]=p,e[35]=h):h=e[35];let b;e[36]!==N||e[37]!==y||e[38]!==I||e[39]!==C?(b=C.length>0&&N&&t.jsxs("div",{className:"p-2",children:[t.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),C.map(s=>{const o=I===s.id;return t.jsx(H,{onClick:()=>N(s.id),className:L("h-8 px-2 py-0 cursor-pointer",o&&"bg-accent"),children:t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[o&&t.jsx(w,{name:"check",size:16,className:"text-foreground shrink-0"}),!o&&t.jsx("div",{className:"w-4 shrink-0"}),t.jsx("span",{className:"text-sm text-foreground flex-1",children:s.label}),o&&y&&t.jsx(w,{name:y==="asc"?"arrow_upward":"arrow_downward",size:16,className:"text-foreground shrink-0"})]})},s.id)})]}),e[36]=N,e[37]=y,e[38]=I,e[39]=C,e[40]=b):b=e[40];let g;e[41]!==h||e[42]!==b?(g=t.jsxs(Q,{align:"end",className:"w-[200px] p-0 gap-0",children:[h,b]}),e[41]=h,e[42]=b,e[43]=g):g=e[43];let M;return e[44]!==g||e[45]!==l?(M=t.jsxs(U,{onOpenChange:l,children:[D,g]}),e[44]=g,e[45]=l,e[46]=M):M=e[46],M}export{ne as C};
1
+ import{c as F,r as R,j as t}from"./index-MoI-rvC3.js";import{B as G}from"./button-G3aMPyFq.js";import{c as H,D as J,a as Q,b as U}from"./dropdown-menu-CtSLEdvQ.js";import{I as w}from"./icon-Cxep_tfx.js";import{d as X,b as Y,a as Z,T as ee}from"./tooltip-CyReuecv.js";import{c as L}from"./utils-BLlwSV8I.js";function ne(W){const e=F.c(47),{viewMode:r,onViewModeChange:i,sortKey:I,sortDirection:y,onSort:N,sortOptions:v}=W;let _;e[0]!==v?(_=v===void 0?[]:v,e[0]=v,e[1]=_):_=e[1];const C=_,E=R.useRef(null),B=R.useRef(null);let z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z={left:0,width:0,opacity:0},e[2]=z):z=e[2];const[j,q]=R.useState(z);let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k=s=>{if(!s.current)return;const{offsetLeft:o,offsetWidth:A}=s.current;q({left:o,width:A,opacity:1})},e[3]=k):k=e[3];const V=k;let S,T;e[4]!==r?(S=()=>{V(r==="table"?E:B)},T=[r],e[4]=r,e[5]=S,e[6]=T):(S=e[5],T=e[6]),R.useEffect(S,T);let l;e[7]!==r?(l=s=>{s&&setTimeout(()=>{V(r==="table"?E:B)},0)},e[7]=r,e[8]=l):l=e[8];let D;e[9]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(X,{children:t.jsxs(Y,{children:[t.jsx(Z,{asChild:!0,children:t.jsx(J,{asChild:!0,children:t.jsx(G,{variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(w,{name:"tune",size:16})})})}),t.jsx(ee,{children:"Search filters"})]})}),e[9]=D):D=e[9];let n;e[10]!==i?(n=()=>{i("table")},e[10]=i,e[11]=n):n=e[11];const O=r==="table"?"text-foreground":"text-muted-foreground";let a;e[12]!==O?(a=L("transition-colors ease-out duration-200",O),e[12]=O,e[13]=a):a=e[13];let c;e[14]!==a?(c=t.jsx(w,{name:"table_rows",size:16,className:a}),e[14]=a,e[15]=c):c=e[15];let d;e[16]!==c||e[17]!==n?(d=t.jsx("button",{ref:E,type:"button",onClick:n,className:"relative z-10 flex-1 flex items-center justify-center gap-2 h-12 px-4 rounded-lg",children:c}),e[16]=c,e[17]=n,e[18]=d):d=e[18];let f;e[19]!==i?(f=()=>{i("cards")},e[19]=i,e[20]=f):f=e[20];const P=r==="cards"?"text-foreground":"text-muted-foreground";let u;e[21]!==P?(u=L("transition-colors ease-out duration-200",P),e[21]=P,e[22]=u):u=e[22];let m;e[23]!==u?(m=t.jsx(w,{name:"grid_view",size:16,className:u}),e[23]=u,e[24]=m):m=e[24];let x;e[25]!==f||e[26]!==m?(x=t.jsx("button",{ref:B,type:"button",onClick:f,className:"relative z-10 flex-1 flex items-center justify-center gap-2 h-12 px-4 rounded-lg",children:m}),e[25]=f,e[26]=m,e[27]=x):x=e[27];const $=`${j.left}px`,K=`${j.width}px`;let p;e[28]!==j.opacity||e[29]!==$||e[30]!==K?(p=t.jsx("div",{className:"absolute z-0 h-12 bg-background border border-border rounded-lg transition-all ease-out duration-200",style:{left:$,width:K,opacity:j.opacity}}),e[28]=j.opacity,e[29]=$,e[30]=K,e[31]=p):p=e[31];let h;e[32]!==d||e[33]!==x||e[34]!==p?(h=t.jsx("div",{className:"p-2 border-b border-border",children:t.jsx("div",{className:"relative bg-muted rounded-lg p-1",children:t.jsxs("div",{className:"relative flex gap-0",children:[d,x,p]})})}),e[32]=d,e[33]=x,e[34]=p,e[35]=h):h=e[35];let b;e[36]!==N||e[37]!==y||e[38]!==I||e[39]!==C?(b=C.length>0&&N&&t.jsxs("div",{className:"p-2",children:[t.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),C.map(s=>{const o=I===s.id;return t.jsx(H,{onClick:()=>N(s.id),className:L("h-8 px-2 py-0 cursor-pointer",o&&"bg-accent"),children:t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[o&&t.jsx(w,{name:"check",size:16,className:"text-foreground shrink-0"}),!o&&t.jsx("div",{className:"w-4 shrink-0"}),t.jsx("span",{className:"text-sm text-foreground flex-1",children:s.label}),o&&y&&t.jsx(w,{name:y==="asc"?"arrow_upward":"arrow_downward",size:16,className:"text-foreground shrink-0"})]})},s.id)})]}),e[36]=N,e[37]=y,e[38]=I,e[39]=C,e[40]=b):b=e[40];let g;e[41]!==h||e[42]!==b?(g=t.jsxs(Q,{align:"end",className:"w-[200px] p-0 gap-0",children:[h,b]}),e[41]=h,e[42]=b,e[43]=g):g=e[43];let M;return e[44]!==g||e[45]!==l?(M=t.jsxs(U,{onOpenChange:l,children:[D,g]}),e[44]=g,e[45]=l,e[46]=M):M=e[46],M}export{ne as C};
@@ -1 +1 @@
1
- import{c as j,j as i}from"./index-B5e6fytH.js";import{C as b}from"./collection-display-button-Cws3c2TG.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-base font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
1
+ import{c as j,j as i}from"./index-MoI-rvC3.js";import{C as b}from"./collection-display-button-BOWw7rwa.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-base font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
@@ -1 +1 @@
1
- import{c as s,j as c}from"./index-B5e6fytH.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
1
+ import{c as s,j as c}from"./index-MoI-rvC3.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
@@ -1 +1 @@
1
- import{c as x,j as a}from"./index-B5e6fytH.js";import{I as u}from"./icon-C1glN-Ga.js";import{I as b}from"./input-DpAKmHHm.js";import{c as g}from"./utils-BLBjpUfr.js";function I(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let r;e[0]!==m?(r=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{name:"search",size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let s;e[3]!==c?(s=p=>c(p.target.value),e[3]=c,e[4]=s):s=e[4];let t;e[5]!==i||e[6]!==f||e[7]!==s||e[8]!==n?(t=a.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[o,a.jsx(b,{value:n,onChange:s,onKeyDown:i,placeholder:f,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]}),e[5]=i,e[6]=f,e[7]=s,e[8]=n,e[9]=t):t=e[9];let l;return e[10]!==r||e[11]!==t?(l=a.jsx("div",{className:r,children:t}),e[10]=r,e[11]=t,e[12]=l):l=e[12],l}export{I as C};
1
+ import{c as x,j as a}from"./index-MoI-rvC3.js";import{I as u}from"./icon-Cxep_tfx.js";import{I as b}from"./input-CXe38a5R.js";import{c as g}from"./utils-BLlwSV8I.js";function I(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let r;e[0]!==m?(r=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{name:"search",size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let s;e[3]!==c?(s=p=>c(p.target.value),e[3]=c,e[4]=s):s=e[4];let t;e[5]!==i||e[6]!==f||e[7]!==s||e[8]!==n?(t=a.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[o,a.jsx(b,{value:n,onChange:s,onKeyDown:i,placeholder:f,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]}),e[5]=i,e[6]=f,e[7]=s,e[8]=n,e[9]=t):t=e[9];let l;return e[10]!==r||e[11]!==t?(l=a.jsx("div",{className:r,children:t}),e[10]=r,e[11]=t,e[12]=l):l=e[12],l}export{I as C};
@@ -1 +1 @@
1
- import{c as N,j as o}from"./index-B5e6fytH.js";import{c as u}from"./utils-BLBjpUfr.js";import{I as T}from"./icon-C1glN-Ga.js";function $(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function R(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function I(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=N.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:p}=a;let b;e[0]!==r?(b=function(n,h){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&r&&o.jsx(T,{name:r==="asc"?"arrow_upward":"arrow_downward",size:16,className:"text-muted-foreground transition-colors"})})},e[0]=r,e[1]=b):b=e[1];const g=b;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=function(n,h){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===h-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=x):x=e[2];const i=x;let d;if(e[3]!==t||e[4]!==f||e[5]!==g||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==g||e[11]!==l?(m=(n,h)=>{const C=l===n.id;return o.jsx(I,{className:u(i(h,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&g(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=g,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=g,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(R,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==p){let m;e[20]!==t||e[21]!==c||e[22]!==p?(m=(n,h)=>{const C=p?.(n);return o.jsx(S,{"data-row-index":h,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(w=>o.jsx(L,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",w.cellClassName,w.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u("min-w-0 w-full",!w.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:w.render?w.render(n):w.accessor?w.accessor(n):null})},w.id))},h)},e[20]=t,e[21]=c,e[22]=p,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=p,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(H,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs($,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function _(a){const e=N.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:p,emptyState:b}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==b?(i=b||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=b,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let x;return e[5]!==t||e[6]!==s||e[7]!==p||e[8]!==c||e[9]!==f||e[10]!==r?(x=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(z,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:p})}),e[5]=t,e[6]=s,e[7]=p,e[8]=c,e[9]=f,e[10]=r,e[11]=x):x=e[11],x}export{_ as C};
1
+ import{c as N,j as o}from"./index-MoI-rvC3.js";import{c as u}from"./utils-BLlwSV8I.js";import{I as T}from"./icon-Cxep_tfx.js";function $(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function R(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function I(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=N.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:p}=a;let b;e[0]!==r?(b=function(n,h){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&r&&o.jsx(T,{name:r==="asc"?"arrow_upward":"arrow_downward",size:16,className:"text-muted-foreground transition-colors"})})},e[0]=r,e[1]=b):b=e[1];const g=b;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=function(n,h){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===h-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=x):x=e[2];const i=x;let d;if(e[3]!==t||e[4]!==f||e[5]!==g||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==g||e[11]!==l?(m=(n,h)=>{const C=l===n.id;return o.jsx(I,{className:u(i(h,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&g(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=g,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=g,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(R,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==p){let m;e[20]!==t||e[21]!==c||e[22]!==p?(m=(n,h)=>{const C=p?.(n);return o.jsx(S,{"data-row-index":h,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(w=>o.jsx(L,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",w.cellClassName,w.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u("min-w-0 w-full",!w.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:w.render?w.render(n):w.accessor?w.accessor(n):null})},w.id))},h)},e[20]=t,e[21]=c,e[22]=p,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=p,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(H,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs($,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function _(a){const e=N.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:p,emptyState:b}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==b?(i=b||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=b,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let x;return e[5]!==t||e[6]!==s||e[7]!==p||e[8]!==c||e[9]!==f||e[10]!==r?(x=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(z,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:p})}),e[5]=t,e[6]=s,e[7]=p,e[8]=c,e[9]=f,e[10]=r,e[11]=x):x=e[11],x}export{_ as C};
@@ -1 +1 @@
1
- import{c as S,j as s}from"./index-B5e6fytH.js";import{B as _}from"./badge-j-myHF25.js";import{C as A}from"./card-I0CWqn2J.js";import{c as j}from"./utils-BLBjpUfr.js";import{I as $}from"./integration-icon-C_Dk6BbN.js";function L(v){const t=S.c(44),{connection:e,onClick:N,headerActions:i,footer:C,className:b,size:R,fallbackIcon:k}=v,z=R===void 0?"md":R,I=z==="sm"?"p-4":"p-6",w=z==="sm"?"text-sm":"text-base",B=z==="sm"?"text-xs":"text-base",E=N&&"hover:bg-muted/50";let o;t[0]!==b||t[1]!==E?(o=j("cursor-pointer transition-colors group",E,b),t[0]=b,t[1]=E,t[2]=o):o=t[2];let l;t[3]!==I?(l=j("flex flex-col gap-4 relative",I),t[3]=I,t[4]=l):l=t[4];let a;t[5]!==e.icon||t[6]!==e.title||t[7]!==k?(a=s.jsx($,{icon:e.icon,name:e.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:k}),t[5]=e.icon,t[6]=e.title,t[7]=k,t[8]=a):a=t[8];let n;t[9]!==e.status||t[10]!==i?(n=e.status&&s.jsx(_,{variant:e.status==="active"?"default":"outline",className:j("text-xs transition-opacity",i&&"opacity-100 group-hover:opacity-0"),children:e.status}),t[9]=e.status,t[10]=i,t[11]=n):n=t[11];let c;t[12]!==i?(c=i&&s.jsx("div",{className:j("absolute top-0 right-0 transition-opacity","opacity-0 group-hover:opacity-100"),onClick:D,children:i}),t[12]=i,t[13]=c):c=t[13];let r;t[14]!==n||t[15]!==c?(r=s.jsxs("div",{className:"relative",children:[n,c]}),t[14]=n,t[15]=c,t[16]=r):r=t[16];let m;t[17]!==a||t[18]!==r?(m=s.jsxs("div",{className:"flex items-start justify-between",children:[a,r]}),t[17]=a,t[18]=r,t[19]=m):m=t[19];let p;t[20]!==w?(p=j("font-medium text-foreground truncate",w),t[20]=w,t[21]=p):p=t[21];let d;t[22]!==e.title||t[23]!==p?(d=s.jsx("h3",{className:p,children:e.title}),t[22]=e.title,t[23]=p,t[24]=d):d=t[24];let f;t[25]!==B?(f=j("text-muted-foreground line-clamp-2",B),t[25]=B,t[26]=f):f=t[26];const P=e.description||"No description";let x;t[27]!==f||t[28]!==P?(x=s.jsx("p",{className:f,children:P}),t[27]=f,t[28]=P,t[29]=x):x=t[29];let u;t[30]!==d||t[31]!==x?(u=s.jsxs("div",{className:"flex flex-col gap-0",children:[d,x]}),t[30]=d,t[31]=x,t[32]=u):u=t[32];let h;t[33]!==C?(h=C&&s.jsx("div",{onClick:q,children:C}),t[33]=C,t[34]=h):h=t[34];let g;t[35]!==u||t[36]!==h||t[37]!==l||t[38]!==m?(g=s.jsxs("div",{className:l,children:[m,u,h]}),t[35]=u,t[36]=h,t[37]=l,t[38]=m,t[39]=g):g=t[39];let y;return t[40]!==N||t[41]!==g||t[42]!==o?(y=s.jsx(A,{className:o,onClick:N,children:g}),t[40]=N,t[41]=g,t[42]=o,t[43]=y):y=t[43],y}function q(v){return v.stopPropagation()}function D(v){return v.stopPropagation()}export{L as C};
1
+ import{c as S,j as s}from"./index-MoI-rvC3.js";import{B as _}from"./badge-Bi_GpkO_.js";import{C as A}from"./card-CE1-D3SY.js";import{c as j}from"./utils-BLlwSV8I.js";import{I as $}from"./integration-icon-C162QlgN.js";function L(v){const t=S.c(44),{connection:e,onClick:N,headerActions:i,footer:C,className:b,size:R,fallbackIcon:k}=v,z=R===void 0?"md":R,I=z==="sm"?"p-4":"p-6",w=z==="sm"?"text-sm":"text-base",B=z==="sm"?"text-xs":"text-base",E=N&&"hover:bg-muted/50";let o;t[0]!==b||t[1]!==E?(o=j("cursor-pointer transition-colors group",E,b),t[0]=b,t[1]=E,t[2]=o):o=t[2];let l;t[3]!==I?(l=j("flex flex-col gap-4 relative",I),t[3]=I,t[4]=l):l=t[4];let a;t[5]!==e.icon||t[6]!==e.title||t[7]!==k?(a=s.jsx($,{icon:e.icon,name:e.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:k}),t[5]=e.icon,t[6]=e.title,t[7]=k,t[8]=a):a=t[8];let n;t[9]!==e.status||t[10]!==i?(n=e.status&&s.jsx(_,{variant:e.status==="active"?"default":"outline",className:j("text-xs transition-opacity",i&&"opacity-100 group-hover:opacity-0"),children:e.status}),t[9]=e.status,t[10]=i,t[11]=n):n=t[11];let c;t[12]!==i?(c=i&&s.jsx("div",{className:j("absolute top-0 right-0 transition-opacity","opacity-0 group-hover:opacity-100"),onClick:D,children:i}),t[12]=i,t[13]=c):c=t[13];let r;t[14]!==n||t[15]!==c?(r=s.jsxs("div",{className:"relative",children:[n,c]}),t[14]=n,t[15]=c,t[16]=r):r=t[16];let m;t[17]!==a||t[18]!==r?(m=s.jsxs("div",{className:"flex items-start justify-between",children:[a,r]}),t[17]=a,t[18]=r,t[19]=m):m=t[19];let p;t[20]!==w?(p=j("font-medium text-foreground truncate",w),t[20]=w,t[21]=p):p=t[21];let d;t[22]!==e.title||t[23]!==p?(d=s.jsx("h3",{className:p,children:e.title}),t[22]=e.title,t[23]=p,t[24]=d):d=t[24];let f;t[25]!==B?(f=j("text-muted-foreground line-clamp-2",B),t[25]=B,t[26]=f):f=t[26];const P=e.description||"No description";let x;t[27]!==f||t[28]!==P?(x=s.jsx("p",{className:f,children:P}),t[27]=f,t[28]=P,t[29]=x):x=t[29];let u;t[30]!==d||t[31]!==x?(u=s.jsxs("div",{className:"flex flex-col gap-0",children:[d,x]}),t[30]=d,t[31]=x,t[32]=u):u=t[32];let h;t[33]!==C?(h=C&&s.jsx("div",{onClick:q,children:C}),t[33]=C,t[34]=h):h=t[34];let g;t[35]!==u||t[36]!==h||t[37]!==l||t[38]!==m?(g=s.jsxs("div",{className:l,children:[m,u,h]}),t[35]=u,t[36]=h,t[37]=l,t[38]=m,t[39]=g):g=t[39];let y;return t[40]!==N||t[41]!==g||t[42]!==o?(y=s.jsx(A,{className:o,onClick:N,children:g}),t[40]=N,t[41]=g,t[42]=o,t[43]=y):y=t[43],y}function q(v){return v.stopPropagation()}function D(v){return v.stopPropagation()}export{L as C};