@decocms/mesh 2.11.0 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-C-YsmNug.js → AlertCircle-Cso_Xxvk.js} +1 -1
- package/dist/client/assets/{ArrowLeft-I0eE0ajz.js → ArrowLeft-BrsZ2N_5.js} +1 -1
- package/dist/client/assets/{Check-Bn7iaq_h.js → Check-JFkjTCfG.js} +1 -1
- package/dist/client/assets/{ChevronDown-CXsTFOR4.js → ChevronDown-HtFMO0lw.js} +1 -1
- package/dist/client/assets/{Clock-7YlOAEqw.js → Clock-CW5u1cfj.js} +1 -1
- package/dist/client/assets/{Code01-Dp2-HwWV.js → Code01-CgNchnl3.js} +1 -1
- package/dist/client/assets/{Copy01-Cufxb7u1.js → Copy01-Dadp_RDG.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-Cq3m_A8z.js → DotsHorizontal-B0A7sUYv.js} +1 -1
- package/dist/client/assets/{DotsVertical-BIpduKLf.js → DotsVertical-BHUUUCDx.js} +1 -1
- package/dist/client/assets/Edit01-CxRkZTQ1.js +1 -0
- package/dist/client/assets/{File06-DD5RANl_.js → File06-D0TXCuMx.js} +1 -1
- package/dist/client/assets/{FilterLines-1Ine1y4n.js → FilterLines-_uykt7r4.js} +1 -1
- package/dist/client/assets/{FlipBackward-DBqfxU3c.js → FlipBackward-GGMv99yc.js} +1 -1
- package/dist/client/assets/{GitBranch01-BHo3ByP2.js → GitBranch01-BUTuezlq.js} +1 -1
- package/dist/client/assets/{Grid01-C578o4mm.js → Grid01-BbdtRdR8.js} +1 -1
- package/dist/client/assets/{Inbox01-BtHWN2dX.js → Inbox01-CgwXLK3n.js} +1 -1
- package/dist/client/assets/{InfoCircle-BkGKY7qc.js → InfoCircle-D6qJG9Nl.js} +1 -1
- package/dist/client/assets/{Key01-DYP1HQKa.js → Key01-8ewaPBuD.js} +1 -1
- package/dist/client/assets/{LinkExternal01-d5tCjGRk.js → LinkExternal01-D0Wjfr3t.js} +1 -1
- package/dist/client/assets/{Loading01-BGeWv0Kv.js → Loading01-NW_f44Lz.js} +1 -1
- package/dist/client/assets/{Lock01-jWWo80rN.js → Lock01-BTPtPjN4.js} +1 -1
- package/dist/client/assets/{Play-B3EbuXEZ.js → Play-CIMfsFF1.js} +1 -1
- package/dist/client/assets/{Plus-CgN71ZpK.js → Plus-DaP4KLuJ.js} +1 -1
- package/dist/client/assets/{SearchMd-u2U3iAnY.js → SearchMd-tOSOFUes.js} +1 -1
- package/dist/client/assets/{Terminal-Fj__rdxn.js → Terminal-ANRX3jJ8.js} +1 -1
- package/dist/client/assets/{Trash01-Vutqn1RC.js → Trash01-CjDzx3jP.js} +1 -1
- package/dist/client/assets/{X-P1RHfgBU.js → X-D3ljCSd1.js} +1 -1
- package/dist/client/assets/{XClose-DeI9b46h.js → XClose-Ba3zyI0J.js} +1 -1
- package/dist/client/assets/{alert-dialog-BApkfnBU.js → alert-dialog-_Gzpv9vf.js} +1 -1
- package/dist/client/assets/{auth-B4yoGafc.js → auth-C9dSkS_x.js} +1 -1
- package/dist/client/assets/{auth-catchall-CbILVwsO.js → auth-catchall-DRL5ZGJM.js} +1 -1
- package/dist/client/assets/{avatar-HUmJyCrO.js → avatar-D1o5pnzU.js} +1 -1
- package/dist/client/assets/{badge-_9VZKl7s.js → badge-0b6sJe4S.js} +1 -1
- package/dist/client/assets/{card-DUrBojml.js → card-B3fsloDi.js} +1 -1
- package/dist/client/assets/{checkbox-y4VvHU-Y.js → checkbox-2xIaHvS4.js} +1 -1
- package/dist/client/assets/{collection-detail-o5P4OEwm.js → collection-detail-Bu5gtjud.js} +31 -31
- package/dist/client/assets/{collection-display-button-D_pspwv8.js → collection-display-button-BGIcja12.js} +1 -1
- package/dist/client/assets/{collection-header-DjAukiYw.js → collection-header-DhWbmVkk.js} +1 -1
- package/dist/client/assets/{collection-page-DUwIO-4_.js → collection-page-B4ZjGX9V.js} +1 -1
- package/dist/client/assets/{collection-search-C8qrPxpe.js → collection-search-CYZk6T6Z.js} +1 -1
- package/dist/client/assets/collection-tab-IeT0mJ-2.js +1 -0
- package/dist/client/assets/{collection-table-wrapper-m6-zCmZ8.js → collection-table-wrapper-D2niE2Ci.js} +1 -1
- package/dist/client/assets/connection-card-D0c_wvmz.js +1 -0
- package/dist/client/assets/connection-detail-BmNPUV8x.js +1 -0
- package/dist/client/assets/connections-U2y3agtD.js +1 -0
- package/dist/client/assets/constants-Cy709IUA.js +1 -0
- package/dist/client/assets/{create-organization-dialog-DJCSaeq_.js → create-organization-dialog-D0WQQsLG.js} +1 -1
- package/dist/client/assets/{dialog-DPjf1g07.js → dialog-BXeLl5mO.js} +1 -1
- package/dist/client/assets/{dropdown-menu-JqpADJWR.js → dropdown-menu-CnL8UM0z.js} +1 -1
- package/dist/client/assets/{empty-state-B1YgYZRX.js → empty-state-BmkZOMzL.js} +1 -1
- package/dist/client/assets/empty-state-DzS1Zp7m.js +2 -0
- package/dist/client/assets/{env-vars-editor-58M0X5HW.js → env-vars-editor-B_mIaT86.js} +1 -1
- package/dist/client/assets/{error-boundary-swyLIuj9.js → error-boundary-BQnJ9S9E.js} +1 -1
- package/dist/client/assets/{extract-connection-data-yHByD-hG.js → extract-connection-data-DPoJQhk8.js} +1 -1
- package/dist/client/assets/{form-BNePwzri.js → form-DrOt6d2d.js} +1 -1
- package/dist/client/assets/gateway-detail-CniDbJPb.js +1 -0
- package/dist/client/assets/gateways-DmEpJOpx.js +1 -0
- package/dist/client/assets/{home-Dge_UN-5.js → home-HrkEcREJ.js} +1 -1
- package/dist/client/assets/{index-Dd-uCtJP.js → index-Bb8rHnPb.js} +1 -1
- package/dist/client/assets/index-CBIrwxtj.js +88 -0
- package/dist/client/assets/index-ChrSnaFS.css +1 -0
- package/dist/client/assets/{index-D825aBGT.js → index-DMNk-OUX.js} +3 -3
- package/dist/client/assets/index-GoXtajA4.js +25 -0
- package/dist/client/assets/{index-CZYkP-qE.js → index-XOpbMEap.js} +1 -1
- package/dist/client/assets/{input-CUSLU-5Y.js → input-68J17rBp.js} +1 -1
- package/dist/client/assets/{layout-DiLh4D4s.js → layout-Olb4shdE.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-Bva2qxQ8.js → lazy-highlighter-Ccgc_fxj.js} +1 -1
- package/dist/client/assets/localstorage-keys-C62ZbWuB.js +1 -0
- package/dist/client/assets/{login-5v9kcVjq.js → login-UTKAAaeX.js} +1 -1
- package/dist/client/assets/{mcp-oauth-2LWG2fNF.js → mcp-oauth-Db8WtQ8u.js} +1 -1
- package/dist/client/assets/mcp-server-detail-BvVQovUz.js +1 -0
- package/dist/client/assets/members-V-vtwMYY.js +3 -0
- package/dist/client/assets/{monaco-editor-CXJFCG3L.js → monaco-editor-B_MycISs.js} +1 -1
- package/dist/client/assets/{monitoring-BxS1M7G9.js → monitoring-CBmCnQ7i.js} +20 -20
- package/dist/client/assets/{oauth-callback-D352dL7W.js → oauth-callback-BYBqbF1w.js} +1 -1
- package/dist/client/assets/page-DYF0Qz3l.js +1 -0
- package/dist/client/assets/page-DrIZd1pO.js +35 -0
- package/dist/client/assets/{pin-to-sidebar-button-CxO4Rtia.js → pin-to-sidebar-button-B1xHHS9n.js} +1 -1
- package/dist/client/assets/{popover-CiuXmEMm.js → popover-DC9U4d6e.js} +1 -1
- package/dist/client/assets/{project-context-provider-Y7j1MLG3.js → project-context-provider-BJIP5a-U.js} +1 -1
- package/dist/client/assets/{resizable-CpuhJlAj.js → resizable-CW5_SPIS.js} +1 -1
- package/dist/client/assets/{resource-tabs-DzYdyOT8.js → resource-tabs-BKSlcL1W.js} +1 -1
- package/dist/client/assets/{select-BiK6lA7A.js → select-B9KJyTZZ.js} +1 -1
- package/dist/client/assets/{settings-BydLLEEd.js → settings-CYg4YPRI.js} +1 -1
- package/dist/client/assets/shell-layout-KIN6fL5j.js +3 -0
- package/dist/client/assets/{spinner-D8JOERWZ.js → spinner-B0sczm1j.js} +1 -1
- package/dist/client/assets/{switch-CHSRGx1X.js → switch-BuVvmF04.js} +1 -1
- package/dist/client/assets/{textarea-DA688jdJ.js → textarea-BAUX8Qgd.js} +1 -1
- package/dist/client/assets/thread-history-popover-Dv63nk6L.js +20 -0
- package/dist/client/assets/tool-set-selector-DMsE0yRo.js +1 -0
- package/dist/client/assets/tools-list-Dgf0oqyC.js +1 -0
- package/dist/client/assets/{use-binding-pQGzNysE.js → use-binding-Dj4lal1A.js} +1 -1
- package/dist/client/assets/use-connection-DoWszS3j.js +1 -0
- package/dist/client/assets/{use-connection-resources-CrBNfIuI.js → use-connection-resources-BywYCfzc.js} +1 -1
- package/dist/client/assets/use-create-gateway-Ca5SEa8I.js +1 -0
- package/dist/client/assets/use-gateway-CRpsitbG.js +1 -0
- package/dist/client/assets/{use-gateway-system-prompt-D3bv_TPR.js → use-gateway-system-prompt-B4ia2QxW.js} +1 -1
- package/dist/client/assets/{use-list-state-CUahB2OC.js → use-list-state-CPUcOhR_.js} +1 -1
- package/dist/client/assets/use-mcp-L2lisTXg.js +1 -0
- package/dist/client/assets/{use-members-BlHxrgPJ.js → use-members-7eRdYOTr.js} +1 -1
- package/dist/client/assets/{use-mobile-DSucR6ge.js → use-mobile--ytA5LT5.js} +1 -1
- package/dist/client/assets/use-organization-settings-D6rXW2c_.js +1 -0
- package/dist/client/assets/use-tool-call-BBonHr6l.js +1 -0
- package/dist/client/assets/{value-BHNPJ9GX.js → value-Bd2XBV_y.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Do1cIl7g.js → view-mode-toggle-BpjQ6V4P.js} +1 -1
- package/dist/client/assets/workflow-CjynHD6b.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +236 -208
- package/dist/server/migrate.js +129 -129
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/LICENSE +47 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/README.md +82 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.d.ts +11 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs +43 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cjs +45 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.cjs +46 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.d.ts +11 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.d.ts +11 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.mjs +46 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.wasm +0 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.mts +83 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.ts +83 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js +2 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js.map +1 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs +2 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs.map +1 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.mts +20 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.ts +20 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js +2 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js.map +1 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs +2 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs.map +1 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/package.json +61 -0
- package/dist/server/server.js +228 -200
- package/package.json +1 -1
- package/dist/client/assets/collection-tab-BtKR4Bs-.js +0 -1
- package/dist/client/assets/connection-card-Bho36DLV.js +0 -1
- package/dist/client/assets/connection-detail-DzUkx3x6.js +0 -1
- package/dist/client/assets/connections-CGjqBYcN.js +0 -1
- package/dist/client/assets/constants-CDd5Bb9b.js +0 -1
- package/dist/client/assets/gateway-detail-7_rs5-Bk.js +0 -1
- package/dist/client/assets/gateways-LhzXTNdU.js +0 -1
- package/dist/client/assets/index-DfsK7wxC.js +0 -88
- package/dist/client/assets/index-KJvlasGf.css +0 -1
- package/dist/client/assets/index-sXi95TSr.js +0 -25
- package/dist/client/assets/localstorage-keys-DCk__Bcu.js +0 -1
- package/dist/client/assets/mcp-server-detail-Bl4-1OcQ.js +0 -1
- package/dist/client/assets/members-DUjkcn9b.js +0 -3
- package/dist/client/assets/page-DJ2XmEDk.js +0 -1
- package/dist/client/assets/page-DlLPoWnp.js +0 -35
- package/dist/client/assets/shell-layout-hT1WnhFU.js +0 -3
- package/dist/client/assets/thread-history-popover-d49eUsmE.js +0 -72
- package/dist/client/assets/tool-set-selector-qCxd45H-.js +0 -1
- package/dist/client/assets/tools-list-aRycV8Sk.js +0 -1
- package/dist/client/assets/use-connection-CJ5nWy0c.js +0 -2
- package/dist/client/assets/use-gateway-Cov2sDNb.js +0 -1
- package/dist/client/assets/use-mcp-Wds2Jlc5.js +0 -1
- package/dist/client/assets/use-organization-settings-zICyumVv.js +0 -1
- package/dist/client/assets/use-tool-call-CS4qR4o3.js +0 -1
- package/dist/client/assets/useQuery-El_kGGDY.js +0 -1
- package/dist/client/assets/workflow-C_xTbZed.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as ee,j as t,r as te,f as oe}from"./index-DMNk-OUX.js";import{C as re}from"./collection-header-DhWbmVkk.js";import{C as ne}from"./collection-page-B4ZjGX9V.js";import{C as ie}from"./collection-search-CYZk6T6Z.js";import{C as ae}from"./collection-table-wrapper-D2niE2Ci.js";import{C as le}from"./connection-card-D0c_wvmz.js";import{E as W,I as ce}from"./empty-state-DzS1Zp7m.js";import{E as de}from"./error-boundary-BQnJ9S9E.js";import{u as me,a as ue,i as x}from"./use-gateway-CRpsitbG.js";import{u as ge,s as J}from"./use-list-state-CPUcOhR_.js";import{u as pe}from"./use-create-gateway-Ca5SEa8I.js";import{u as he}from"./project-context-provider-BJIP5a-U.js";import{c as fe,b as xe,d as je,A as Ce,e as we,g as ye,a as Ne,f as De}from"./alert-dialog-_Gzpv9vf.js";import{B as se}from"./badge-0b6sJe4S.js";import{B as q}from"./input-68J17rBp.js";import{b as Q,D as U,a as X,c as B}from"./dropdown-menu-CnL8UM0z.js";import{i as Y}from"./DotsVertical-BHUUUCDx.js";import{i as Se}from"./Loading01-NW_f44Lz.js";import{s as Z}from"./Trash01-CjDzx3jP.js";import"./collection-display-button-BGIcja12.js";import"./Grid01-BbdtRdR8.js";import"./Check-JFkjTCfG.js";import"./view-mode-toggle-BpjQ6V4P.js";import"./SearchMd-tOSOFUes.js";import"./card-B3fsloDi.js";import"./use-mobile--ytA5LT5.js";function ve(e,r){switch(r.type){case"delete":return{mode:"deleting",gateway:r.gateway};case"close":return{mode:"idle"}}}function be(){const e=ee.c(63),{org:r}=he(),i=oe();let j;e[0]!==r.slug?(j={namespace:r.slug,resource:"gateways"},e[0]=r.slug,e[1]=j):j=e[1];const s=ge(j),f=me(s);let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={navigateOnCreate:!0},e[2]=C):C=e[2];const{createGateway:G,isCreating:w}=pe(C),O=ue();let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y={mode:"idle"},e[3]=y):y=e[3];const[n,N]=te.useReducer(ve,y);let D;e[4]!==O||e[5]!==n.gateway||e[6]!==n.mode?(D=async()=>{if(n.mode!=="deleting")return;const o=n.gateway.id;N({type:"close"});try{await O.delete.mutateAsync(o)}catch{}},e[4]=O,e[5]=n.gateway,e[6]=n.mode,e[7]=D):D=e[7];const R=D;let S,v,b,k,I,_;e[8]===Symbol.for("react.memo_cache_sentinel")?(S={id:"icon",header:"",render:Ke,cellClassName:"w-16 shrink-0",wrap:!0},v={id:"title",header:"Name",render:Pe,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},b={id:"description",header:"Description",render:Ee,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},k={id:"mode",header:"Mode",accessor:$e,cellClassName:"w-[100px]"},I={id:"connections",header:"Connections",render:ze,cellClassName:"w-24 shrink-0"},_={id:"status",header:"Status",render:Me,cellClassName:"w-24 shrink-0",sortable:!0},e[8]=S,e[9]=v,e[10]=b,e[11]=k,e[12]=I,e[13]=_):(S=e[8],v=e[9],b=e[10],k=e[11],I=e[12],_=e[13]);let A;e[14]!==i||e[15]!==r.slug?(A=[S,v,b,k,I,_,{id:"actions",header:"",render:o=>t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ae,children:t.jsx(Y,{size:20})})}),t.jsxs(X,{align:"end",onClick:_e,children:[t.jsxs(B,{onClick:a=>{a.stopPropagation(),i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(J,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:a=>{a.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(Z,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[14]=i,e[15]=r.slug,e[16]=A):A=e[16];const T=A,V=w?"Creating...":"Create Agent";let M;e[17]!==G||e[18]!==w||e[19]!==V?(M=t.jsx(q,{onClick:G,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:w,children:V}),e[17]=G,e[18]=w,e[19]=V,e[20]=M):M=e[20];const H=M,L=n.mode==="deleting";let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&N({type:"close"}),e[21]=z):z=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(fe,{children:"Delete Agent?"}),e[22]=$):$=e[22];const F=n.mode==="deleting"&&n.gateway.title;let l;e[23]!==F?(l=t.jsxs(xe,{children:[$,t.jsxs(je,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:F}),"."]})]}),e[23]=F,e[24]=l):l=e[24];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[25]=E):E=e[25];let c;e[26]!==R?(c=t.jsxs(we,{children:[E,t.jsx(ye,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[26]=R,e[27]=c):c=e[27];let d;e[28]!==l||e[29]!==c?(d=t.jsxs(Ne,{children:[l,c]}),e[28]=l,e[29]=c,e[30]=d):d=e[30];let m;e[31]!==L||e[32]!==d?(m=t.jsx(De,{open:L,onOpenChange:z,children:d}),e[31]=L,e[32]=d,e[33]=m):m=e[33];let P;e[34]===Symbol.for("react.memo_cache_sentinel")?(P=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[34]=P):P=e[34];let u;e[35]!==H||e[36]!==s.handleSort||e[37]!==s.setViewMode||e[38]!==s.sortDirection||e[39]!==s.sortKey||e[40]!==s.viewMode?(u=t.jsx(re,{title:"Agents",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:P,ctaButton:H}),e[35]=H,e[36]=s.handleSort,e[37]=s.setViewMode,e[38]=s.sortDirection,e[39]=s.sortKey,e[40]=s.viewMode,e[41]=u):u=e[41];let g;e[42]!==s?(g=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[42]=s,e[43]=g):g=e[43];let p;e[44]!==s.search||e[45]!==s.setSearch||e[46]!==g?(p=t.jsx(ie,{value:s.search,onChange:s.setSearch,placeholder:"Search for an agent...",onKeyDown:g}),e[44]=s.search,e[45]=s.setSearch,e[46]=g,e[47]=p):p=e[47];let h;e[48]!==T||e[49]!==f||e[50]!==s.handleSort||e[51]!==s.search||e[52]!==s.sortDirection||e[53]!==s.sortKey||e[54]!==s.viewMode||e[55]!==i||e[56]!==r.slug?(h=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:f.length===0?t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:s.search?"No agents found":"No agents yet",description:s.search?`No agents match "${s.search}"`:"Create an agent to aggregate tools from multiple Connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:f.map(o=>t.jsx(le,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(x,{}),onClick:()=>i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ie,children:t.jsx(Y,{size:20})})}),t.jsxs(X,{align:"end",onClick:ke,children:[t.jsxs(B,{onClick:a=>{a.stopPropagation(),i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(J,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:a=>{a.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(Z,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ae,{columns:T,data:f,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${s.search}"`}):t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple Connections."})}),e[48]=T,e[49]=f,e[50]=s.handleSort,e[51]=s.search,e[52]=s.sortDirection,e[53]=s.sortKey,e[54]=s.viewMode,e[55]=i,e[56]=r.slug,e[57]=h):h=e[57];let K;return e[58]!==m||e[59]!==u||e[60]!==p||e[61]!==h?(K=t.jsxs(ne,{children:[m,u,p,h]}),e[58]=m,e[59]=u,e[60]=p,e[61]=h,e[62]=K):K=e[62],K}function ke(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function _e(e){return e.stopPropagation()}function Ae(e){return e.stopPropagation()}function Me(e){return t.jsx(se,{variant:e.status==="active"?"default":"outline",children:e.status})}function ze(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function $e(e){return t.jsx(se,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ee(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Pe(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Ke(e){return t.jsx(ce,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(x,{size:16})})}function ct(){const e=ee.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(de,{children:t.jsx(te.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Se,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(be,{})})}),e[0]=r):r=e[0],r}export{ct as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,j as s,a as I,r as C,e as F,f as E,s as O,t as w}from"./index-D825aBGT.js";import{C as k}from"./card-DUrBojml.js";import{c as y,I as R,B as $}from"./input-CUSLU-5Y.js";import{A as D}from"./avatar-HUmJyCrO.js";import{i as H}from"./AlertCircle-C-YsmNug.js";import{i as G}from"./Check-Bn7iaq_h.js";import{s as Q}from"./Plus-CgN71ZpK.js";import{i as q}from"./SearchMd-u2U3iAnY.js";import{s as B}from"./XClose-DeI9b46h.js";import{C as T}from"./create-organization-dialog-DJCSaeq_.js";import"./alert-dialog-BApkfnBU.js";import"./form-BNePwzri.js";import"./spinner-D8JOERWZ.js";function U(t){const e=f.c(10),{children:n,className:l,onNavigate:i,showHoverRing:r}=t,d=r===void 0?!1:r;let o;e[0]!==i?(o=p=>{i&&i(p)},e[0]=i,e[1]=o):o=e[1];const m=o,x=i&&"cursor-pointer",a=d&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==x||e[4]!==a?(c=y("group transition-all flex flex-col gap-0",x,a,l),e[2]=l,e[3]=x,e[4]=a,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==c?(g=s.jsx(k,{className:c,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=c,e[9]=g):g=e[9],g}function M(t){const e=f.c(7),{url:n,fallback:l,shape:i,size:r,objectFit:d,className:o}=t,m=i===void 0?"square":i,x=r===void 0?"lg":r,a=d===void 0?"contain":d;let c;return e[0]!==o||e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==x||e[5]!==n?(c=s.jsx(D,{url:n,fallback:l,shape:m,size:x,objectFit:a,className:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=m,e[4]=x,e[5]=n,e[6]=c):c=e[6],c}function P(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function V(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("font-medium truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("p",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function X(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("h3",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Y(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex flex-col gap-[2px]",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function J(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex justify-between items-start",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function K(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function W(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Z(){const t=f.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex justify-between items-start",children:s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),s.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(k,{className:"group transition-colors flex flex-col",children:[n,s.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const u=Object.assign(U,{Avatar:M,AvatarSection:J,Header:P,Title:V,Subtitle:X,Content:Y,Footer:K,Badge:W,Skeleton:Z}),ee={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},te={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},se={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},ie={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},le={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},ne={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function L(t){const e=f.c(13),{children:n,columns:l,gap:i,className:r}=t;let d;e[0]!==l?(d=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=d):d=e[1];const o=d,x=ee[i===void 0?4:i],a=o.sm&&te[o.sm],c=o.md&&se[o.md],g=o.lg&&ie[o.lg],p=o.xl&&le[o.xl],v=o["2xl"]&&ne[o["2xl"]];let N;e[2]!==r||e[3]!==x||e[4]!==a||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==v?(N=y("w-full grid",x,a,c,g,p,v,r),e[2]=r,e[3]=x,e[4]=a,e[5]=c,e[6]=g,e[7]=p,e[8]=v,e[9]=N):N=e[9];const b=N;let h;return e[10]!==n||e[11]!==b?(h=s.jsx("div",{className:b,children:n}),e[10]=n,e[11]=b,e[12]=h):h=e[12],h}function re(t){const e=f.c(9),{count:n,columns:l,gap:i,className:r}=t,d=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,x=i===void 0?4:i;let a;e[2]!==d?(a=Array.from({length:d}).map(ae),e[2]=d,e[3]=a):a=e[3];let c;return e[4]!==r||e[5]!==m||e[6]!==x||e[7]!==a?(c=s.jsx(L,{columns:m,gap:x,className:r,children:a}),e[4]=r,e[5]=m,e[6]=x,e[7]=a,e[8]=c):c=e[8],c}function ae(t,e){return s.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),s.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const A=Object.assign(L,{Skeleton:re});function oe({invitation:t}){const[e,n]=C.useState(!1),[l,i]=C.useState(!1),r=O(),d=E(),o=async()=>{n(!0);try{const a=await I.organization.acceptInvitation({invitationId:t.id});if(a.error)w.error(a.error.message),n(!1);else{const c=await I.organization.setActive({organizationId:t.organizationId});c?.data?.slug?(w.success("Invitation accepted!"),d({to:"/$org",params:{org:c.data.slug}})):(w.success("Invitation accepted! Redirecting..."),d({to:"/"}))}}catch{w.error("Failed to accept invitation"),n(!1)}},m=async()=>{i(!0);try{const a=await I.organization.rejectInvitation({invitationId:t.id});a.error?(w.error(a.error.message),i(!1)):(w.success("Invitation rejected"),await r.invalidateQueries(),i(!1))}catch{w.error("Failed to reject invitation"),i(!1)}},x=t.organizationName||t.organizationId;return s.jsxs(u,{className:"border-dashed",children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:"",fallback:x,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsx(u.Subtitle,{children:"You've been invited to join"}),s.jsx(u.Title,{children:x})]})]}),s.jsx(u.Footer,{className:"border-t border-dashed",children:s.jsxs("div",{className:"flex h-3.5 items-center gap-2 w-full",children:[s.jsx($,{onClick:o,disabled:e||l,className:"flex-1",size:"sm",children:e?"Accepting...":s.jsxs(s.Fragment,{children:[s.jsx(G,{size:16}),"Accept"]})}),s.jsx($,{variant:"outline",onClick:m,disabled:e||l,className:"flex-1",size:"sm",children:l?"Declining...":s.jsxs(s.Fragment,{children:[s.jsx(B,{size:16}),"Decline"]})})]})})]})}function ce({query:t}){const e=C.useContext(F),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).filter(d=>d.status==="pending"),r=t?(()=>{const d=t.toLowerCase();return i.filter(o=>o.organizationName?.toLowerCase().includes(d)||o.organizationId.toLowerCase().includes(d))})():i;return r.length===0?null:s.jsxs("div",{className:"mb-16",children:[s.jsx("h2",{className:"text-lg font-medium pb-2 border-b border-border/50 mb-6 px-2",children:"Invitations"}),s.jsx(A,{columns:{sm:2,md:3,lg:4},children:r.map(d=>s.jsx(oe,{invitation:d},d.id))})]})}function de(t){const e=f.c(14),{query:n}=t,{data:l}=I.useListOrganizations(),i=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const a=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(a)||c.slug.toLowerCase().includes(a))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const d=r;if(!l||l.length===0){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=a):a=e[3],a}if(d.length===0){let a;return e[4]!==n?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=a):a=e[5],a}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==d||e[8]!==i){let a;e[10]!==i?(a=c=>s.jsxs(u,{onNavigate:()=>i({to:"/$org",params:{org:c.slug}}),children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsxs(u.Subtitle,{children:["@",c.slug]}),s.jsx(u.Title,{children:c.name})]})]}),s.jsx(u.Footer,{children:s.jsxs("div",{className:"flex h-3.5 items-center text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=i,e[11]=a):a=e[11],m=d.map(a),e[7]=d,e[8]=i,e[9]=m}else m=e[9];let x;return e[12]!==m?(x=s.jsx(A,{columns:o,children:m}),e[12]=m,e[13]=x):x=e[13],x}function me(t){const e=f.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(H,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[l,s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=i):i=e[2],i}function xe(){const t=f.c(27),{error:e,isPending:n}=I.useListOrganizations(),[l,i]=C.useState(""),[r,d]=C.useState(!1),o=C.useDeferredValue(l);if(n){let j;return t[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx("div",{className:"@container",children:s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})}),t[0]=j):j=t[0],j}if(e){let j;return t[1]!==e?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx(me,{error:e})}),t[1]=e,t[2]=j):j=t[2],j}let m;t[3]!==o?(m=s.jsx(C.Suspense,{fallback:null,children:s.jsx(ce,{query:o})}),t[3]=o,t[4]=m):m=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("h2",{className:"text-lg font-medium",children:"My organizations"}),t[5]=x):x=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(q,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=j=>i(j.target.value),t[7]=c):c=t[7];let g;t[8]!==l?(g=s.jsxs("div",{className:"relative",children:[a,s.jsx(R,{className:"pl-8 h-8 w-52 border-none shadow-none focus-visible:ring-0",placeholder:"Search organizations...",value:l,onChange:c})]}),t[8]=l,t[9]=g):g=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs($,{size:"sm",onClick:()=>d(!0),children:[s.jsx(Q,{size:16}),s.jsx("span",{children:"New organization"})]}),t[10]=p):p=t[10];let v;t[11]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/50 mb-6 px-2",children:[x,s.jsxs("div",{className:"flex items-center gap-3",children:[g,p]})]}),t[11]=g,t[12]=v):v=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[13]=N):N=t[13];let b;t[14]!==o?(b=s.jsx(C.Suspense,{fallback:N,children:s.jsx(de,{query:o})}),t[14]=o,t[15]=b):b=t[15];let h;t[16]!==v||t[17]!==b?(h=s.jsxs("div",{children:[v,b]}),t[16]=v,t[17]=b,t[18]=h):h=t[18];let S;t[19]!==m||t[20]!==h?(S=s.jsxs("div",{className:"@container",children:[m,h]}),t[19]=m,t[20]=h,t[21]=S):S=t[21];let z;t[22]!==r?(z=s.jsx(T,{open:r,onOpenChange:d}),t[22]=r,t[23]=z):z=t[23];let _;return t[24]!==S||t[25]!==z?(_=s.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[S,z]}),t[24]=S,t[25]=z,t[26]=_):_=t[26],_}function ze(){const t=f.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"min-h-full",children:s.jsx(xe,{})}),t[0]=e):e=t[0],e}export{ze as default};
|
|
1
|
+
import{c as f,j as s,a as I,r as C,e as F,f as E,s as O,t as w}from"./index-DMNk-OUX.js";import{C as k}from"./card-B3fsloDi.js";import{c as y,I as R,B as $}from"./input-68J17rBp.js";import{A as D}from"./avatar-D1o5pnzU.js";import{i as H}from"./AlertCircle-Cso_Xxvk.js";import{i as G}from"./Check-JFkjTCfG.js";import{s as Q}from"./Plus-DaP4KLuJ.js";import{i as q}from"./SearchMd-tOSOFUes.js";import{s as B}from"./XClose-Ba3zyI0J.js";import{C as T}from"./create-organization-dialog-D0WQQsLG.js";import"./alert-dialog-_Gzpv9vf.js";import"./form-DrOt6d2d.js";import"./spinner-B0sczm1j.js";function U(t){const e=f.c(10),{children:n,className:l,onNavigate:i,showHoverRing:r}=t,d=r===void 0?!1:r;let o;e[0]!==i?(o=p=>{i&&i(p)},e[0]=i,e[1]=o):o=e[1];const m=o,x=i&&"cursor-pointer",a=d&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==x||e[4]!==a?(c=y("group transition-all flex flex-col gap-0",x,a,l),e[2]=l,e[3]=x,e[4]=a,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==c?(g=s.jsx(k,{className:c,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=c,e[9]=g):g=e[9],g}function M(t){const e=f.c(7),{url:n,fallback:l,shape:i,size:r,objectFit:d,className:o}=t,m=i===void 0?"square":i,x=r===void 0?"lg":r,a=d===void 0?"contain":d;let c;return e[0]!==o||e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==x||e[5]!==n?(c=s.jsx(D,{url:n,fallback:l,shape:m,size:x,objectFit:a,className:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=m,e[4]=x,e[5]=n,e[6]=c):c=e[6],c}function P(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function V(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("font-medium truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("p",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function X(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("h3",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Y(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex flex-col gap-[2px]",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function J(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex justify-between items-start",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function K(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function W(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Z(){const t=f.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex justify-between items-start",children:s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),s.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(k,{className:"group transition-colors flex flex-col",children:[n,s.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const u=Object.assign(U,{Avatar:M,AvatarSection:J,Header:P,Title:V,Subtitle:X,Content:Y,Footer:K,Badge:W,Skeleton:Z}),ee={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},te={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},se={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},ie={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},le={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},ne={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function L(t){const e=f.c(13),{children:n,columns:l,gap:i,className:r}=t;let d;e[0]!==l?(d=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=d):d=e[1];const o=d,x=ee[i===void 0?4:i],a=o.sm&&te[o.sm],c=o.md&&se[o.md],g=o.lg&&ie[o.lg],p=o.xl&&le[o.xl],v=o["2xl"]&&ne[o["2xl"]];let N;e[2]!==r||e[3]!==x||e[4]!==a||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==v?(N=y("w-full grid",x,a,c,g,p,v,r),e[2]=r,e[3]=x,e[4]=a,e[5]=c,e[6]=g,e[7]=p,e[8]=v,e[9]=N):N=e[9];const b=N;let h;return e[10]!==n||e[11]!==b?(h=s.jsx("div",{className:b,children:n}),e[10]=n,e[11]=b,e[12]=h):h=e[12],h}function re(t){const e=f.c(9),{count:n,columns:l,gap:i,className:r}=t,d=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,x=i===void 0?4:i;let a;e[2]!==d?(a=Array.from({length:d}).map(ae),e[2]=d,e[3]=a):a=e[3];let c;return e[4]!==r||e[5]!==m||e[6]!==x||e[7]!==a?(c=s.jsx(L,{columns:m,gap:x,className:r,children:a}),e[4]=r,e[5]=m,e[6]=x,e[7]=a,e[8]=c):c=e[8],c}function ae(t,e){return s.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),s.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const A=Object.assign(L,{Skeleton:re});function oe({invitation:t}){const[e,n]=C.useState(!1),[l,i]=C.useState(!1),r=O(),d=E(),o=async()=>{n(!0);try{const a=await I.organization.acceptInvitation({invitationId:t.id});if(a.error)w.error(a.error.message),n(!1);else{const c=await I.organization.setActive({organizationId:t.organizationId});c?.data?.slug?(w.success("Invitation accepted!"),d({to:"/$org",params:{org:c.data.slug}})):(w.success("Invitation accepted! Redirecting..."),d({to:"/"}))}}catch{w.error("Failed to accept invitation"),n(!1)}},m=async()=>{i(!0);try{const a=await I.organization.rejectInvitation({invitationId:t.id});a.error?(w.error(a.error.message),i(!1)):(w.success("Invitation rejected"),await r.invalidateQueries(),i(!1))}catch{w.error("Failed to reject invitation"),i(!1)}},x=t.organizationName||t.organizationId;return s.jsxs(u,{className:"border-dashed",children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:"",fallback:x,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsx(u.Subtitle,{children:"You've been invited to join"}),s.jsx(u.Title,{children:x})]})]}),s.jsx(u.Footer,{className:"border-t border-dashed",children:s.jsxs("div",{className:"flex h-3.5 items-center gap-2 w-full",children:[s.jsx($,{onClick:o,disabled:e||l,className:"flex-1",size:"sm",children:e?"Accepting...":s.jsxs(s.Fragment,{children:[s.jsx(G,{size:16}),"Accept"]})}),s.jsx($,{variant:"outline",onClick:m,disabled:e||l,className:"flex-1",size:"sm",children:l?"Declining...":s.jsxs(s.Fragment,{children:[s.jsx(B,{size:16}),"Decline"]})})]})})]})}function ce({query:t}){const e=C.useContext(F),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).filter(d=>d.status==="pending"),r=t?(()=>{const d=t.toLowerCase();return i.filter(o=>o.organizationName?.toLowerCase().includes(d)||o.organizationId.toLowerCase().includes(d))})():i;return r.length===0?null:s.jsxs("div",{className:"mb-16",children:[s.jsx("h2",{className:"text-lg font-medium pb-2 border-b border-border/50 mb-6 px-2",children:"Invitations"}),s.jsx(A,{columns:{sm:2,md:3,lg:4},children:r.map(d=>s.jsx(oe,{invitation:d},d.id))})]})}function de(t){const e=f.c(14),{query:n}=t,{data:l}=I.useListOrganizations(),i=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const a=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(a)||c.slug.toLowerCase().includes(a))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const d=r;if(!l||l.length===0){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=a):a=e[3],a}if(d.length===0){let a;return e[4]!==n?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=a):a=e[5],a}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==d||e[8]!==i){let a;e[10]!==i?(a=c=>s.jsxs(u,{onNavigate:()=>i({to:"/$org",params:{org:c.slug}}),children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsxs(u.Subtitle,{children:["@",c.slug]}),s.jsx(u.Title,{children:c.name})]})]}),s.jsx(u.Footer,{children:s.jsxs("div",{className:"flex h-3.5 items-center text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=i,e[11]=a):a=e[11],m=d.map(a),e[7]=d,e[8]=i,e[9]=m}else m=e[9];let x;return e[12]!==m?(x=s.jsx(A,{columns:o,children:m}),e[12]=m,e[13]=x):x=e[13],x}function me(t){const e=f.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(H,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[l,s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=i):i=e[2],i}function xe(){const t=f.c(27),{error:e,isPending:n}=I.useListOrganizations(),[l,i]=C.useState(""),[r,d]=C.useState(!1),o=C.useDeferredValue(l);if(n){let j;return t[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx("div",{className:"@container",children:s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})}),t[0]=j):j=t[0],j}if(e){let j;return t[1]!==e?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx(me,{error:e})}),t[1]=e,t[2]=j):j=t[2],j}let m;t[3]!==o?(m=s.jsx(C.Suspense,{fallback:null,children:s.jsx(ce,{query:o})}),t[3]=o,t[4]=m):m=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("h2",{className:"text-lg font-medium",children:"My organizations"}),t[5]=x):x=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(q,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=j=>i(j.target.value),t[7]=c):c=t[7];let g;t[8]!==l?(g=s.jsxs("div",{className:"relative",children:[a,s.jsx(R,{className:"pl-8 h-8 w-52 border-none shadow-none focus-visible:ring-0",placeholder:"Search organizations...",value:l,onChange:c})]}),t[8]=l,t[9]=g):g=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs($,{size:"sm",onClick:()=>d(!0),children:[s.jsx(Q,{size:16}),s.jsx("span",{children:"New organization"})]}),t[10]=p):p=t[10];let v;t[11]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/50 mb-6 px-2",children:[x,s.jsxs("div",{className:"flex items-center gap-3",children:[g,p]})]}),t[11]=g,t[12]=v):v=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[13]=N):N=t[13];let b;t[14]!==o?(b=s.jsx(C.Suspense,{fallback:N,children:s.jsx(de,{query:o})}),t[14]=o,t[15]=b):b=t[15];let h;t[16]!==v||t[17]!==b?(h=s.jsxs("div",{children:[v,b]}),t[16]=v,t[17]=b,t[18]=h):h=t[18];let S;t[19]!==m||t[20]!==h?(S=s.jsxs("div",{className:"@container",children:[m,h]}),t[19]=m,t[20]=h,t[21]=S):S=t[21];let z;t[22]!==r?(z=s.jsx(T,{open:r,onOpenChange:d}),t[22]=r,t[23]=z):z=t[23];let _;return t[24]!==S||t[25]!==z?(_=s.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[S,z]}),t[24]=S,t[25]=z,t[26]=_):_=t[26],_}function ze(){const t=f.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"min-h-full",children:s.jsx(xe,{})}),t[0]=e):e=t[0],e}export{ze as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aZ as K,a_ as C,a$ as V,b0 as z,an as _,s as W,b1 as X,b2 as Y,r as h,b3 as Z,b4 as $,b5 as J,b6 as ee,b7 as k,b8 as P,b9 as se,ba as te,aj as A,ab as re,ai as oe,j as m,ac as Q,al as ne,ad as g,aa as O,ak as ae,af as w,ae as ie,
|
|
1
|
+
import{aZ as K,a_ as C,a$ as V,b0 as z,an as _,s as W,b1 as X,b2 as Y,r as h,b3 as Z,b4 as $,b5 as J,b6 as ee,b7 as k,b8 as P,b9 as se,ba as te,aj as A,ab as re,ai as oe,j as m,ac as Q,al as ne,ad as g,aa as O,ak as ae,af as w,ae as ie,aO as ue,aN as ce}from"./index-DMNk-OUX.js";function I(r,s){const t=new Set(s);return r.filter(o=>!t.has(o))}function de(r,s,t){const o=r.slice(0);return o[s]=t,o}var le=class extends K{#r;#e;#o;#n;#s;#t;#a;#i;#u=[];constructor(r,s,t){super(),this.#r=r,this.#n=t,this.#o=[],this.#s=[],this.#e=[],this.setQueries(s)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(s=>{this.#h(r,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,s){this.#o=r,this.#n=s,C.batch(()=>{const t=this.#s,o=this.#l(this.#o);o.forEach(i=>i.observer.setOptions(i.defaultedQueryOptions));const e=o.map(i=>i.observer),n=e.map(i=>i.getCurrentResult()),a=t.length!==e.length,c=e.some((i,d)=>i!==t[d]),l=a||c,v=l?!0:n.some((i,d)=>{const b=this.#e[d];return!b||!V(i,b)});!l&&!v||(l&&(this.#u=o,this.#s=e),this.#e=n,this.hasListeners()&&(l&&(I(t,e).forEach(i=>{i.destroy()}),I(e,t).forEach(i=>{i.subscribe(d=>{this.#h(i,d)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,s){const t=this.#l(r),o=t.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[o,e=>this.#d(e??o,s),()=>this.#c(o,t)]}#c(r,s){return s.map((t,o)=>{const e=r[o];return t.defaultedQueryOptions.notifyOnChangeProps?e:t.observer.trackResult(e,n=>{s.forEach(a=>{a.observer.trackProp(n)})})})}#d(r,s){return s?((!this.#t||this.#e!==this.#i||s!==this.#a)&&(this.#a=s,this.#i=this.#e,this.#t=z(this.#t,s(r))),this.#t):r}#l(r){const s=new Map;this.#s.forEach(o=>{const e=o.options.queryHash;if(!e)return;const n=s.get(e);n?n.push(o):s.set(e,[o])});const t=[];return r.forEach(o=>{const e=this.#r.defaultQueryOptions(o),a=s.get(e.queryHash)?.shift()??new _(this.#r,e);t.push({defaultedQueryOptions:e,observer:a})}),t}#h(r,s){const t=this.#s.indexOf(r);t!==-1&&(this.#e=de(this.#e,t,s),this.#p())}#p(){if(this.hasListeners()){const r=this.#t,s=this.#c(this.#e,this.#u),t=this.#d(s,this.#n?.combine);r!==t&&C.batch(()=>{this.listeners.forEach(o=>{o(this.#e)})})}}};function Ce({queries:r,...s},t){const o=W(t),e=X(),n=Y(),a=h.useMemo(()=>r.map(u=>{const p=o.defaultQueryOptions(u);return p._optimisticResults=e?"isRestoring":"optimistic",p}),[r,o,e]);a.forEach(u=>{Z(u);const p=o.getQueryCache().get(u.queryHash);$(u,n,p)}),J(n);const[c]=h.useState(()=>new le(o,a,s)),[l,v,i]=c.getOptimisticResult(a,s.combine),d=!e&&s.subscribed!==!1;h.useSyncExternalStore(h.useCallback(u=>d?c.subscribe(C.batchCalls(u)):ee,[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),h.useEffect(()=>{c.setQueries(a,s)},[a,s,c]);const f=l.some((u,p)=>k(a[p],u))?l.flatMap((u,p)=>{const y=a[p];if(y){const x=new _(o,y);if(k(y,u))return P(y,x,n);se(u,e)&&P(y,x,n)}return[]}):[];if(f.length>0)throw Promise.all(f);const R=l.find((u,p)=>{const y=a[p];return y&&te({result:u,errorResetBoundary:n,throwOnError:y.throwOnError,query:o.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(R?.error)throw R.error;return v(i())}var S="Radio",[he,j]=Q(S),[pe,fe]=he(S),G=h.forwardRef((r,s)=>{const{__scopeRadio:t,name:o,checked:e=!1,required:n,disabled:a,value:c="on",onCheck:l,form:v,...i}=r,[d,b]=h.useState(null),f=O(s,p=>b(p)),R=h.useRef(!1),u=d?v||!!d.closest("form"):!0;return m.jsxs(pe,{scope:t,checked:e,disabled:a,children:[m.jsx(g.button,{type:"button",role:"radio","aria-checked":e,"data-state":D(e),"data-disabled":a?"":void 0,disabled:a,value:c,...i,ref:f,onClick:w(r.onClick,p=>{e||l?.(),u&&(R.current=p.isPropagationStopped(),R.current||p.stopPropagation())})}),u&&m.jsx(q,{control:d,bubbles:!R.current,name:o,value:c,checked:e,required:n,disabled:a,form:v,style:{transform:"translateX(-100%)"}})]})});G.displayName=S;var M="RadioIndicator",N=h.forwardRef((r,s)=>{const{__scopeRadio:t,forceMount:o,...e}=r,n=fe(M,t);return m.jsx(ie,{present:o||n.checked,children:m.jsx(g.span,{"data-state":D(n.checked),"data-disabled":n.disabled?"":void 0,...e,ref:s})})});N.displayName=M;var Re="RadioBubbleInput",q=h.forwardRef(({__scopeRadio:r,control:s,checked:t,bubbles:o=!0,...e},n)=>{const a=h.useRef(null),c=O(a,n),l=ue(t),v=ce(s);return h.useEffect(()=>{const i=a.current;if(!i)return;const d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==t&&f){const R=new Event("click",{bubbles:o});f.call(i,t),i.dispatchEvent(R)}},[l,t,o]),m.jsx(g.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...e,tabIndex:-1,ref:c,style:{...e.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});q.displayName=Re;function D(r){return r?"checked":"unchecked"}var ve=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],E="RadioGroup",[be]=Q(E,[A,j]),L=A(),B=j(),[me,ye]=be(E),F=h.forwardRef((r,s)=>{const{__scopeRadioGroup:t,name:o,defaultValue:e,value:n,required:a=!1,disabled:c=!1,orientation:l,dir:v,loop:i=!0,onValueChange:d,...b}=r,f=L(t),R=re(v),[u,p]=oe({prop:n,defaultProp:e??null,onChange:d,caller:E});return m.jsx(me,{scope:t,name:o,required:a,disabled:c,value:u,onValueChange:p,children:m.jsx(ne,{asChild:!0,...f,orientation:l,dir:R,loop:i,children:m.jsx(g.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":c?"":void 0,dir:R,...b,ref:s})})})});F.displayName=E;var T="RadioGroupItem",H=h.forwardRef((r,s)=>{const{__scopeRadioGroup:t,disabled:o,...e}=r,n=ye(T,t),a=n.disabled||o,c=L(t),l=B(t),v=h.useRef(null),i=O(s,v),d=n.value===e.value,b=h.useRef(!1);return h.useEffect(()=>{const f=u=>{ve.includes(u.key)&&(b.current=!0)},R=()=>b.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",R),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",R)}},[]),m.jsx(ae,{asChild:!0,...c,focusable:!a,active:d,children:m.jsx(G,{disabled:a,required:n.required,checked:d,...l,...e,name:n.name,ref:i,onCheck:()=>n.onValueChange(e.value),onKeyDown:w(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:w(e.onFocus,()=>{b.current&&v.current?.click()})})})});H.displayName=T;var ge="RadioGroupIndicator",U=h.forwardRef((r,s)=>{const{__scopeRadioGroup:t,...o}=r,e=B(t);return m.jsx(N,{...e,...o,ref:s})});U.displayName=ge;var we=F,Oe=H,Se=U;export{Oe as I,we as R,Se as a,Ce as u};
|