@lovelybunch/api 1.0.71-alpha.4 → 1.0.71-alpha.6

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 (97) hide show
  1. package/dist/routes/api/v1/context/images/index.d.ts +2 -0
  2. package/dist/routes/api/v1/context/images/index.js +2 -0
  3. package/dist/routes/api/v1/context/images/route.d.ts +3 -0
  4. package/dist/routes/api/v1/context/images/route.js +253 -0
  5. package/dist/routes/api/v1/context/index.js +2 -0
  6. package/dist/routes/api/v1/resources/generate-audio/index.d.ts +3 -0
  7. package/dist/routes/api/v1/resources/generate-audio/index.js +5 -0
  8. package/dist/routes/api/v1/resources/generate-audio/route.d.ts +19 -0
  9. package/dist/routes/api/v1/resources/generate-audio/route.js +129 -0
  10. package/dist/routes/api/v1/resources/generate-video/index.d.ts +3 -0
  11. package/dist/routes/api/v1/resources/generate-video/index.js +5 -0
  12. package/dist/routes/api/v1/resources/generate-video/route.d.ts +19 -0
  13. package/dist/routes/api/v1/resources/generate-video/route.js +235 -0
  14. package/dist/routes/api/v1/resources/index.js +4 -0
  15. package/dist/routes/api/v1/resources/route.js +3 -3
  16. package/package.json +4 -4
  17. package/static/assets/{AgentDetailPage-BkWRFbPj.js → AgentDetailPage-Bw8wHgla.js} +1 -1
  18. package/static/assets/{AgentEditPage-DN0TouUG.js → AgentEditPage-CQ9Y3ez8.js} +1 -1
  19. package/static/assets/{AgentsPage-DW6eV7oU.js → AgentsPage-DcgU1MPa.js} +1 -1
  20. package/static/assets/{AgentsSettingsPage-BJKnn0R0.js → AgentsSettingsPage-CgoXxqGL.js} +1 -1
  21. package/static/assets/{ApiKeysSettingsPage-ChFu9Eo6.js → ApiKeysSettingsPage-BgqGOa4p.js} +3 -3
  22. package/static/assets/{ArchitectureEditPage-DWrvSS5U.js → ArchitectureEditPage-DrEnTloL.js} +1 -1
  23. package/static/assets/{ArchitecturePage-BdQG779E.js → ArchitecturePage-Dpd6cyyT.js} +1 -1
  24. package/static/assets/{AuthSettingsPage-BXMn4xXd.js → AuthSettingsPage-wu1zFEx-.js} +2 -2
  25. package/static/assets/{CallbackPage-AxQqTxCV.js → CallbackPage-DYzikcPp.js} +1 -1
  26. package/static/assets/{CodePage-CfKZ52Zo.js → CodePage-CtM-PEHU.js} +1 -1
  27. package/static/assets/{CollapsibleSection-ZFq6LSXW.js → CollapsibleSection-B23j-nZD.js} +1 -1
  28. package/static/assets/{DashboardPage-Df-d3-fG.js → DashboardPage-BoPCq6M9.js} +1 -1
  29. package/static/assets/{GitPage-DAWR8rrg.js → GitPage-DYicFQBx.js} +1 -1
  30. package/static/assets/{GitSettingsPage-CzGuiY9j.js → GitSettingsPage-B-1Nnid8.js} +2 -2
  31. package/static/assets/{IdentityPage-DbsNwWtP.js → IdentityPage-Cvj6SDPj.js} +2 -2
  32. package/static/assets/{ImplementationStepsEditor-DZq7KcDP.js → ImplementationStepsEditor-CCfJKk2U.js} +1 -1
  33. package/static/assets/{IntegrationsSettingsPage-qvvsp1_G.js → IntegrationsSettingsPage-BgLXCF-u.js} +1 -1
  34. package/static/assets/{KnowledgeDetailPage-BMnj1qiH.js → KnowledgeDetailPage-I9erHJXN.js} +1 -1
  35. package/static/assets/{KnowledgeEditPage-BZa4E2M9.js → KnowledgeEditPage-BfaWotPl.js} +1 -1
  36. package/static/assets/{KnowledgePage-Dtq9BKZi.js → KnowledgePage-x9ShzjoT.js} +2 -2
  37. package/static/assets/{LoginPage-BnlCd8Cm.js → LoginPage-CZtwhbdN.js} +1 -1
  38. package/static/assets/{McpSettingsPage-COPMqimV.js → McpSettingsPage-BHPjMqOX.js} +1 -1
  39. package/static/assets/{NewAgentPage-Dtvey1oU.js → NewAgentPage-D-Pj_KgZ.js} +1 -1
  40. package/static/assets/{NewKnowledgePage-CbiRD2V3.js → NewKnowledgePage-CoVnCUx6.js} +1 -1
  41. package/static/assets/{NewProposalPage-B1tUJIZz.js → NewProposalPage-nCTq2mBC.js} +1 -1
  42. package/static/assets/{ProjectEditPage-CwM8LXHy.js → ProjectEditPage-d1cMZArt.js} +1 -1
  43. package/static/assets/{ProjectPage-BHa8M3vI.js → ProjectPage-KwwOjk5b.js} +1 -1
  44. package/static/assets/{PromptsSettingsPage-CwGmsIAW.js → PromptsSettingsPage-fSs6HBAk.js} +1 -1
  45. package/static/assets/{ProposalDetailPage-DC7NMuFi.js → ProposalDetailPage-BnLOBPPT.js} +1 -1
  46. package/static/assets/{ProposalEditPage-CfUidv6D.js → ProposalEditPage-bIYTFTmG.js} +1 -1
  47. package/static/assets/{ProposalsPage-V8ut_TsU.js → ProposalsPage-D8W2d6g6.js} +1 -1
  48. package/static/assets/ResourcesPage-Dq9DZFd7.js +71 -0
  49. package/static/assets/{RulesSettingsPage-BJ72X2Y3.js → RulesSettingsPage-SWRxKVNH.js} +1 -1
  50. package/static/assets/{SchedulePage-DBYxTZMb.js → SchedulePage-DGxD8ZaL.js} +1 -1
  51. package/static/assets/{TagInput-Cqju3cXZ.js → TagInput-CYcNHzrk.js} +1 -1
  52. package/static/assets/{TerminalPage-Iow1ciWG.js → TerminalPage-fabajZvk.js} +1 -1
  53. package/static/assets/{TerminalSessionPage-CZdzhFhY.js → TerminalSessionPage-DuJsKT9f.js} +1 -1
  54. package/static/assets/{UserPreferencesPage-CAuJ7yO4.js → UserPreferencesPage-DQMtobsK.js} +1 -1
  55. package/static/assets/{UserSettingsPage-0j7ha-RI.js → UserSettingsPage-CFEb7pD0.js} +1 -1
  56. package/static/assets/{UtilitiesPage-OgkcmaOS.js → UtilitiesPage-qStPGLN_.js} +1 -1
  57. package/static/assets/{alert-D2VTq6m-.js → alert-Baaj8mli.js} +1 -1
  58. package/static/assets/{arrow-down-vmWOjyjO.js → arrow-down-CSpiROUo.js} +1 -1
  59. package/static/assets/{arrow-left-Do2jUSS9.js → arrow-left-CdJt7_wH.js} +1 -1
  60. package/static/assets/{arrow-up-hMM1cdZm.js → arrow-up-ugn3lusK.js} +1 -1
  61. package/static/assets/{badge-D7ZZbMEG.js → badge-fHjW-wEe.js} +1 -1
  62. package/static/assets/{browser-modal-CWDhylx7.js → browser-modal-D6BB5mxm.js} +1 -1
  63. package/static/assets/{calendar-C5JtKp_F.js → calendar-DXMWQL-h.js} +1 -1
  64. package/static/assets/{card-D_zGBKua.js → card-C9ekeZtD.js} +1 -1
  65. package/static/assets/{chevron-left-JjvWea8A.js → chevron-left-BkP_F3xd.js} +1 -1
  66. package/static/assets/{circle-alert-DQD0CPB3.js → circle-alert-DnIYekt3.js} +1 -1
  67. package/static/assets/{circle-check-xj41FKuF.js → circle-check-BO-qmBFl.js} +1 -1
  68. package/static/assets/{circle-check-big-KfJvKA9H.js → circle-check-big-BUVglreY.js} +1 -1
  69. package/static/assets/{circle-play-BlGnYWUU.js → circle-play-84ZOWBDG.js} +1 -1
  70. package/static/assets/{circle-x-Ds97aY1x.js → circle-x-EQNlLpRR.js} +1 -1
  71. package/static/assets/{clipboard-D3NA8gb4.js → clipboard-Dv0iwZO9.js} +1 -1
  72. package/static/assets/{clock-9dU_D6sL.js → clock-BxO7xcX9.js} +1 -1
  73. package/static/assets/{download-CNckZYWh.js → download-CpaVC4DU.js} +1 -1
  74. package/static/assets/{eye-Dp6wEoME.js → eye-BSR7OEmk.js} +1 -1
  75. package/static/assets/{folder-git-2-B9ILjFN2.js → folder-git-2-9fWvFiHp.js} +1 -1
  76. package/static/assets/index-BAEEeZzi.js +458 -0
  77. package/static/assets/index-DdGUrKz8.css +2 -0
  78. package/static/assets/label-CRsu1MwQ.js +1 -0
  79. package/static/assets/{markdown-editor-BiM9h5iI.js → markdown-editor-Dop22vuJ.js} +1 -1
  80. package/static/assets/{pause-BNL49HvB.js → pause-C7KYrzQF.js} +1 -1
  81. package/static/assets/{play-8b83f5X0.js → play-DhUf2mKM.js} +1 -1
  82. package/static/assets/{plus-Be79gWKj.js → plus-CemYz5Fm.js} +1 -1
  83. package/static/assets/radio-group-Dz2cO4IQ.js +1 -0
  84. package/static/assets/{refresh-cw-C0_Ot2Zc.js → refresh-cw-BL3y7jJo.js} +1 -1
  85. package/static/assets/{search-CrIdR7ah.js → search-BvRo_rak.js} +1 -1
  86. package/static/assets/{switch-BYPAX9oF.js → switch-CDOrVL8G.js} +1 -1
  87. package/static/assets/{tabs-Ug7Ug5Ha.js → tabs-CP_A6r0A.js} +1 -1
  88. package/static/assets/{tag-BgO5mxYK.js → tag-BpNIhvRX.js} +1 -1
  89. package/static/assets/{terminal-preview-CDrLQbSE.js → terminal-preview-CbgoHEQH.js} +1 -1
  90. package/static/assets/{use-terminal-CNk4WtA6.js → use-terminal-ZvK-kdxE.js} +1 -1
  91. package/static/assets/{zap-cD8GAJPg.js → zap-DOtH7YrV.js} +1 -1
  92. package/static/index.html +2 -2
  93. package/static/assets/ResourcesPage-Cofgbx3H.js +0 -66
  94. package/static/assets/index-Bbxvuj4b.js +0 -458
  95. package/static/assets/index-Ca98xZVe.css +0 -2
  96. package/static/assets/label-CZGCmBD7.js +0 -1
  97. package/static/assets/radio-group-DpxssBzw.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-Bbxvuj4b.js";/**
1
+ import{c as e}from"./index-BAEEeZzi.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-Bbxvuj4b.js";/**
1
+ import{c as a}from"./index-BAEEeZzi.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-Bbxvuj4b.js";/**
1
+ import{c as e}from"./index-BAEEeZzi.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{r as n,b8 as E,aq as K,ak as T,j as a,al as N,b9 as U,ao as x,ap as w,ba as V,an as g,bb as z,at as H,as as $,f as I,bc as W}from"./index-BAEEeZzi.js";var C="Radio",[X,k]=N(C),[Y,J]=X(C),_=n.forwardRef((r,t)=>{const{__scopeRadio:e,name:c,checked:o=!1,required:s,disabled:i,value:p="on",onCheck:f,form:R,...v}=r,[l,m]=n.useState(null),d=w(t,y=>m(y)),u=n.useRef(!1),b=l?R||!!l.closest("form"):!0;return a.jsxs(Y,{scope:e,checked:o,disabled:i,children:[a.jsx(x.button,{type:"button",role:"radio","aria-checked":o,"data-state":S(o),"data-disabled":i?"":void 0,disabled:i,value:p,...v,ref:d,onClick:g(r.onClick,y=>{o||f?.(),b&&(u.current=y.isPropagationStopped(),u.current||y.stopPropagation())})}),b&&a.jsx(P,{control:l,bubbles:!u.current,name:c,value:p,checked:o,required:s,disabled:i,form:R,style:{transform:"translateX(-100%)"}})]})});_.displayName=C;var j="RadioIndicator",G=n.forwardRef((r,t)=>{const{__scopeRadio:e,forceMount:c,...o}=r,s=J(j,e);return a.jsx(z,{present:c||s.checked,children:a.jsx(x.span,{"data-state":S(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});G.displayName=j;var Q="RadioBubbleInput",P=n.forwardRef(({__scopeRadio:r,control:t,checked:e,bubbles:c=!0,...o},s)=>{const i=n.useRef(null),p=w(i,s),f=H(e),R=$(t);return n.useEffect(()=>{const v=i.current;if(!v)return;const l=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(l,"checked").set;if(f!==e&&d){const u=new Event("click",{bubbles:c});d.call(v,e),v.dispatchEvent(u)}},[f,e,c]),a.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:e,...o,tabIndex:-1,ref:p,style:{...o.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});P.displayName=Q;function S(r){return r?"checked":"unchecked"}var Z=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],h="RadioGroup",[ee,ce]=N(h,[E,k]),A=E(),D=k(),[oe,re]=ee(h),M=n.forwardRef((r,t)=>{const{__scopeRadioGroup:e,name:c,defaultValue:o,value:s,required:i=!1,disabled:p=!1,orientation:f,dir:R,loop:v=!0,onValueChange:l,...m}=r,d=A(e),u=K(R),[b,y]=T({prop:s,defaultProp:o??null,onChange:l,caller:h});return a.jsx(oe,{scope:e,name:c,required:i,disabled:p,value:b,onValueChange:y,children:a.jsx(U,{asChild:!0,...d,orientation:f,dir:u,loop:v,children:a.jsx(x.div,{role:"radiogroup","aria-required":i,"aria-orientation":f,"data-disabled":p?"":void 0,dir:u,...m,ref:t})})})});M.displayName=h;var O="RadioGroupItem",q=n.forwardRef((r,t)=>{const{__scopeRadioGroup:e,disabled:c,...o}=r,s=re(O,e),i=s.disabled||c,p=A(e),f=D(e),R=n.useRef(null),v=w(t,R),l=s.value===o.value,m=n.useRef(!1);return n.useEffect(()=>{const d=b=>{Z.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",d),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",d),document.removeEventListener("keyup",u)}},[]),a.jsx(V,{asChild:!0,...p,focusable:!i,active:l,children:a.jsx(_,{disabled:i,required:s.required,checked:l,...f,...o,name:s.name,ref:v,onCheck:()=>s.onValueChange(o.value),onKeyDown:g(d=>{d.key==="Enter"&&d.preventDefault()}),onFocus:g(o.onFocus,()=>{m.current&&R.current?.click()})})})});q.displayName=O;var ae="RadioGroupIndicator",F=n.forwardRef((r,t)=>{const{__scopeRadioGroup:e,...c}=r,o=D(e);return a.jsx(G,{...o,...c,ref:t})});F.displayName=ae;var L=M,B=q,te=F;const se=n.forwardRef(({className:r,...t},e)=>a.jsx(L,{className:I("grid gap-2",r),...t,ref:e}));se.displayName=L.displayName;const ne=n.forwardRef(({className:r,...t},e)=>a.jsx(B,{ref:e,className:I("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),...t,children:a.jsx(te,{className:"flex items-center justify-center",children:a.jsx(W,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ne.displayName=B.displayName;export{se as R,ne as a};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-Bbxvuj4b.js";/**
1
+ import{c as e}from"./index-BAEEeZzi.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-Bbxvuj4b.js";/**
1
+ import{c}from"./index-BAEEeZzi.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as c,j as e,f as i}from"./index-Bbxvuj4b.js";const d=c.forwardRef(({className:s,onCheckedChange:r,onChange:t,...o},n)=>{const l=a=>{t?.(a),r?.(a.target.checked)};return e.jsxs("label",{className:i("relative inline-flex cursor-pointer",s),children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",onChange:l,ref:n,...o}),e.jsx("div",{className:"block bg-gray-300 w-9 h-5 rounded-full transition-colors duration-200 ease-in-out peer-checked:bg-blue-600"}),e.jsx("div",{className:"absolute left-0 top-0 bg-white w-4 h-4 rounded-full mt-0.5 ml-0.5 transition-transform duration-200 ease-in-out transform peer-checked:translate-x-4 shadow"})]})});d.displayName="Switch";export{d as S};
1
+ import{r as c,j as e,f as i}from"./index-BAEEeZzi.js";const d=c.forwardRef(({className:s,onCheckedChange:r,onChange:t,...o},n)=>{const l=a=>{t?.(a),r?.(a.target.checked)};return e.jsxs("label",{className:i("relative inline-flex cursor-pointer",s),children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",onChange:l,ref:n,...o}),e.jsx("div",{className:"block bg-gray-300 w-9 h-5 rounded-full transition-colors duration-200 ease-in-out peer-checked:bg-blue-600"}),e.jsx("div",{className:"absolute left-0 top-0 bg-white w-4 h-4 rounded-full mt-0.5 ml-0.5 transition-transform duration-200 ease-in-out transform peer-checked:translate-x-4 shadow"})]})});d.displayName="Switch";export{d as S};
@@ -1 +1 @@
1
- import{r as l,a$ as F,b0 as $,j as c,b1 as D,bc as V,b3 as g,a_ as y,b2 as k,b5 as G,b6 as m,b7 as L,f as T}from"./index-Bbxvuj4b.js";var p="Tabs",[K,Q]=D(p,[y]),h=y(),[B,x]=K(p),N=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,onValueChange:r,defaultValue:d,orientation:n="horizontal",dir:u,activationMode:f="automatic",...v}=e,i=F(u),[s,b]=$({prop:o,onChange:r,defaultProp:d??"",caller:p});return c.jsx(B,{scope:t,baseId:V(),value:s,onValueChange:b,orientation:n,dir:i,activationMode:f,children:c.jsx(g.div,{dir:i,"data-orientation":n,...v,ref:a})})});N.displayName=p;var C="TabsList",I=l.forwardRef((e,a)=>{const{__scopeTabs:t,loop:o=!0,...r}=e,d=x(C,t),n=h(t);return c.jsx(k,{asChild:!0,...n,orientation:d.orientation,dir:d.dir,loop:o,children:c.jsx(g.div,{role:"tablist","aria-orientation":d.orientation,...r,ref:a})})});I.displayName=C;var R="TabsTrigger",j=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,disabled:r=!1,...d}=e,n=x(R,t),u=h(t),f=A(n.baseId,o),v=E(n.baseId,o),i=o===n.value;return c.jsx(G,{asChild:!0,...u,focusable:!r,active:i,children:c.jsx(g.button,{type:"button",role:"tab","aria-selected":i,"aria-controls":v,"data-state":i?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:f,...d,ref:a,onMouseDown:m(e.onMouseDown,s=>{!r&&s.button===0&&s.ctrlKey===!1?n.onValueChange(o):s.preventDefault()}),onKeyDown:m(e.onKeyDown,s=>{[" ","Enter"].includes(s.key)&&n.onValueChange(o)}),onFocus:m(e.onFocus,()=>{const s=n.activationMode!=="manual";!i&&!r&&s&&n.onValueChange(o)})})})});j.displayName=R;var w="TabsContent",_=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,forceMount:r,children:d,...n}=e,u=x(w,t),f=A(u.baseId,o),v=E(u.baseId,o),i=o===u.value,s=l.useRef(i);return l.useEffect(()=>{const b=requestAnimationFrame(()=>s.current=!1);return()=>cancelAnimationFrame(b)},[]),c.jsx(L,{present:r||i,children:({present:b})=>c.jsx(g.div,{"data-state":i?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!b,id:v,tabIndex:0,...n,ref:a,style:{...e.style,animationDuration:s.current?"0s":void 0},children:b&&d})})});_.displayName=w;function A(e,a){return`${e}-trigger-${a}`}function E(e,a){return`${e}-content-${a}`}var q=N,S=I,M=j,P=_;const U=q,z=l.forwardRef(({className:e,...a},t)=>c.jsx(S,{ref:t,className:T("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...a}));z.displayName=S.displayName;const H=l.forwardRef(({className:e,...a},t)=>c.jsx(M,{ref:t,className:T("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...a}));H.displayName=M.displayName;const O=l.forwardRef(({className:e,...a},t)=>c.jsx(P,{ref:t,className:T("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...a}));O.displayName=P.displayName;export{U as T,z as a,H as b,O as c};
1
+ import{r as l,aq as F,ak as $,j as c,al as k,be as D,ao as g,b8 as y,b9 as V,ba as G,an as m,bb as L,f as T}from"./index-BAEEeZzi.js";var p="Tabs",[K,Q]=k(p,[y]),h=y(),[q,x]=K(p),N=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,onValueChange:r,defaultValue:d,orientation:n="horizontal",dir:u,activationMode:f="automatic",...v}=e,i=F(u),[s,b]=$({prop:o,onChange:r,defaultProp:d??"",caller:p});return c.jsx(q,{scope:t,baseId:D(),value:s,onValueChange:b,orientation:n,dir:i,activationMode:f,children:c.jsx(g.div,{dir:i,"data-orientation":n,...v,ref:a})})});N.displayName=p;var C="TabsList",I=l.forwardRef((e,a)=>{const{__scopeTabs:t,loop:o=!0,...r}=e,d=x(C,t),n=h(t);return c.jsx(V,{asChild:!0,...n,orientation:d.orientation,dir:d.dir,loop:o,children:c.jsx(g.div,{role:"tablist","aria-orientation":d.orientation,...r,ref:a})})});I.displayName=C;var R="TabsTrigger",j=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,disabled:r=!1,...d}=e,n=x(R,t),u=h(t),f=A(n.baseId,o),v=E(n.baseId,o),i=o===n.value;return c.jsx(G,{asChild:!0,...u,focusable:!r,active:i,children:c.jsx(g.button,{type:"button",role:"tab","aria-selected":i,"aria-controls":v,"data-state":i?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:f,...d,ref:a,onMouseDown:m(e.onMouseDown,s=>{!r&&s.button===0&&s.ctrlKey===!1?n.onValueChange(o):s.preventDefault()}),onKeyDown:m(e.onKeyDown,s=>{[" ","Enter"].includes(s.key)&&n.onValueChange(o)}),onFocus:m(e.onFocus,()=>{const s=n.activationMode!=="manual";!i&&!r&&s&&n.onValueChange(o)})})})});j.displayName=R;var w="TabsContent",_=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,forceMount:r,children:d,...n}=e,u=x(w,t),f=A(u.baseId,o),v=E(u.baseId,o),i=o===u.value,s=l.useRef(i);return l.useEffect(()=>{const b=requestAnimationFrame(()=>s.current=!1);return()=>cancelAnimationFrame(b)},[]),c.jsx(L,{present:r||i,children:({present:b})=>c.jsx(g.div,{"data-state":i?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!b,id:v,tabIndex:0,...n,ref:a,style:{...e.style,animationDuration:s.current?"0s":void 0},children:b&&d})})});_.displayName=w;function A(e,a){return`${e}-trigger-${a}`}function E(e,a){return`${e}-content-${a}`}var B=N,S=I,M=j,P=_;const U=B,z=l.forwardRef(({className:e,...a},t)=>c.jsx(S,{ref:t,className:T("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...a}));z.displayName=S.displayName;const H=l.forwardRef(({className:e,...a},t)=>c.jsx(M,{ref:t,className:T("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...a}));H.displayName=M.displayName;const O=l.forwardRef(({className:e,...a},t)=>c.jsx(P,{ref:t,className:T("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...a}));O.displayName=P.displayName;export{U as T,z as a,H as b,O as c};
@@ -1,4 +1,4 @@
1
- import{c}from"./index-Bbxvuj4b.js";/**
1
+ import{c}from"./index-BAEEeZzi.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as p,r as e,ab as S,j as u}from"./index-Bbxvuj4b.js";import{x as F,a as N}from"./xterm-DTxiCjtJ.js";/**
1
+ import{c as p,r as e,ab as S,j as u}from"./index-BAEEeZzi.js";import{x as F,a as N}from"./xterm-DTxiCjtJ.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as i,ag as b,A as f}from"./index-Bbxvuj4b.js";function j(){const[y,u]=i.useState([]),[g,c]=i.useState(!1),[m,o]=i.useState(null),{refresh:p}=b(),d=i.useCallback(async(s,n,r)=>{try{c(!0),o(null);const e=await fetch(`${f}/api/v1/terminal/${s}/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enableLogging:n||!1,startupCommand:r})});if(!e.ok){const a=await e.json();throw new Error(a.error||"Failed to create terminal session")}const t=await e.json();return await p(),t.sessionId}catch(e){const t=e instanceof Error?e.message:"Unknown error";return o(t),null}finally{c(!1)}},[p]),S=i.useCallback(async s=>{try{c(!0),o(null);let n;if(s.startsWith("session-")){const e=s.split("-");n=`${e[0]}-${e[1]}`}else{const e=s.split("-");n=`${e[0]}-${e[1]}`}const r=await fetch(`${f}/api/v1/terminal/${n}/destroy`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s})});if(!r.ok){const e=await r.json();throw new Error(e.error||"Failed to destroy terminal session")}return u(e=>e.filter(t=>t.id!==s)),await p(),!0}catch(n){const r=n instanceof Error?n.message:"Unknown error";return o(r),!1}finally{c(!1)}},[p]),$=i.useCallback(async(s,n,r)=>{try{o(null);let e;if(s.startsWith("session-")){const a=s.split("-");e=`${a[0]}-${a[1]}`}else{const a=s.split("-");e=`${a[0]}-${a[1]}`}const t=await fetch(`${f}/api/v1/terminal/${e}/resize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s,cols:n,rows:r})});if(!t.ok){const a=await t.json();throw new Error(a.error||"Failed to resize terminal session")}return!0}catch(e){const t=e instanceof Error?e.message:"Unknown error";return o(t),!1}},[]),k=i.useCallback(async(s,n,r)=>{try{c(!0),o(null);const e=new URLSearchParams;s&&e.set("proposalId",s),n&&(e.set("withPreview","true"),r&&Number.isFinite(r)&&e.set("lines",String(r)));const t=`${f}/api/v1/terminal/sessions${e.toString()?`?${e.toString()}`:""}`,a=await fetch(t);if(!a.ok){const l=await a.json();throw new Error(l.error||"Failed to fetch terminal sessions")}const w=await a.json();u(w.sessions)}catch(e){const t=e instanceof Error?e.message:"Unknown error";o(t)}finally{c(!1)}},[]),E=i.useCallback(async(s,n=8)=>{try{o(null);const r=new URLSearchParams;r.set("sessionId",s),r.set("withPreview","true"),r.set("lines",String(n)),r.set("colorize","true");const e=`${f}/api/v1/terminal/sessions?${r.toString()}`,t=await fetch(e);if(!t.ok){const l=await t.json().catch(()=>({}));throw new Error(l.error||"Failed to fetch preview")}const a=await t.json(),w=Array.isArray(a?.sessions)&&a.sessions[0]?.preview?a.sessions[0].preview:[];return u(l=>l.map(h=>h.id===s?{...h,preview:w}:h)),w}catch(r){const e=r instanceof Error?r.message:"Unknown error";return o(e),[]}},[]);return{sessions:y,loading:g,error:m,createSession:d,destroySession:S,resizeSession:$,refreshSessions:k,fetchPreview:E}}export{j as u};
1
+ import{r as i,ag as b,A as f}from"./index-BAEEeZzi.js";function j(){const[y,u]=i.useState([]),[g,c]=i.useState(!1),[m,o]=i.useState(null),{refresh:p}=b(),d=i.useCallback(async(s,n,r)=>{try{c(!0),o(null);const e=await fetch(`${f}/api/v1/terminal/${s}/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enableLogging:n||!1,startupCommand:r})});if(!e.ok){const a=await e.json();throw new Error(a.error||"Failed to create terminal session")}const t=await e.json();return await p(),t.sessionId}catch(e){const t=e instanceof Error?e.message:"Unknown error";return o(t),null}finally{c(!1)}},[p]),S=i.useCallback(async s=>{try{c(!0),o(null);let n;if(s.startsWith("session-")){const e=s.split("-");n=`${e[0]}-${e[1]}`}else{const e=s.split("-");n=`${e[0]}-${e[1]}`}const r=await fetch(`${f}/api/v1/terminal/${n}/destroy`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s})});if(!r.ok){const e=await r.json();throw new Error(e.error||"Failed to destroy terminal session")}return u(e=>e.filter(t=>t.id!==s)),await p(),!0}catch(n){const r=n instanceof Error?n.message:"Unknown error";return o(r),!1}finally{c(!1)}},[p]),$=i.useCallback(async(s,n,r)=>{try{o(null);let e;if(s.startsWith("session-")){const a=s.split("-");e=`${a[0]}-${a[1]}`}else{const a=s.split("-");e=`${a[0]}-${a[1]}`}const t=await fetch(`${f}/api/v1/terminal/${e}/resize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s,cols:n,rows:r})});if(!t.ok){const a=await t.json();throw new Error(a.error||"Failed to resize terminal session")}return!0}catch(e){const t=e instanceof Error?e.message:"Unknown error";return o(t),!1}},[]),k=i.useCallback(async(s,n,r)=>{try{c(!0),o(null);const e=new URLSearchParams;s&&e.set("proposalId",s),n&&(e.set("withPreview","true"),r&&Number.isFinite(r)&&e.set("lines",String(r)));const t=`${f}/api/v1/terminal/sessions${e.toString()?`?${e.toString()}`:""}`,a=await fetch(t);if(!a.ok){const l=await a.json();throw new Error(l.error||"Failed to fetch terminal sessions")}const w=await a.json();u(w.sessions)}catch(e){const t=e instanceof Error?e.message:"Unknown error";o(t)}finally{c(!1)}},[]),E=i.useCallback(async(s,n=8)=>{try{o(null);const r=new URLSearchParams;r.set("sessionId",s),r.set("withPreview","true"),r.set("lines",String(n)),r.set("colorize","true");const e=`${f}/api/v1/terminal/sessions?${r.toString()}`,t=await fetch(e);if(!t.ok){const l=await t.json().catch(()=>({}));throw new Error(l.error||"Failed to fetch preview")}const a=await t.json(),w=Array.isArray(a?.sessions)&&a.sessions[0]?.preview?a.sessions[0].preview:[];return u(l=>l.map(h=>h.id===s?{...h,preview:w}:h)),w}catch(r){const e=r instanceof Error?r.message:"Unknown error";return o(e),[]}},[]);return{sessions:y,loading:g,error:m,createSession:d,destroySession:S,resizeSession:$,refreshSessions:k,fetchPreview:E}}export{j as u};
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-Bbxvuj4b.js";/**
1
+ import{c as a}from"./index-BAEEeZzi.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
package/static/index.html CHANGED
@@ -8,8 +8,8 @@
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
9
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet">
10
10
  <title>Coconut - Agentic Development Environment</title>
11
- <script type="module" crossorigin src="/assets/index-Bbxvuj4b.js"></script>
12
- <link rel="stylesheet" crossorigin href="/assets/index-Ca98xZVe.css">
11
+ <script type="module" crossorigin src="/assets/index-BAEEeZzi.js"></script>
12
+ <link rel="stylesheet" crossorigin href="/assets/index-DdGUrKz8.css">
13
13
  </head>
14
14
  <body class="font-inter">
15
15
  <div id="root"></div>
@@ -1,66 +0,0 @@
1
- import{c as _,r as n,j as e,D as le,a as re,b as ne,d as ie,n as q,S as Fe,B as u,ah as Me,H as Ke,A as z,aj as we,a0 as be,v as E,w as U,x as O,y as G,z as W,ac as Pe,ai as Je,X as Xe,C as es,g as te,ak as ye,al as ss,am as as,an as ts,e as Te,T as Ie,I as De,ao as ls}from"./index-Bbxvuj4b.js";import{C as ve,b as $e,a as Ne,c as rs,d as ns}from"./card-D_zGBKua.js";import{L as g}from"./label-CZGCmBD7.js";import{B as oe}from"./badge-D7ZZbMEG.js";import{c as is}from"./clipboard-B9ndUJKl.js";import{R as Ye}from"./registry-ANRa5WBi.js";import{D as ke}from"./download-CNckZYWh.js";import{C as os}from"./chevron-left-JjvWea8A.js";import{C as cs}from"./calendar-C5JtKp_F.js";import{P as Re}from"./plus-Be79gWKj.js";import{S as ds}from"./search-CrIdR7ah.js";/**
2
- * @license lucide-react v0.542.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const ms=[["path",{d:"M17.5 22h.5a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"rslqgf"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 19a2 2 0 1 1 4 0v1a2 2 0 1 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 1 1-4 0v-1a2 2 0 1 1 4 0",key:"9f7x3i"}]],_e=_("file-audio",ms);/**
7
- * @license lucide-react v0.542.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const hs=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],Ce=_("file-code",hs);/**
12
- * @license lucide-react v0.542.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const us=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],Le=_("file-image",us);/**
17
- * @license lucide-react v0.542.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const xs=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],Ee=_("file-json",xs);/**
22
- * @license lucide-react v0.542.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const fs=[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],Ue=_("file-play",fs);/**
27
- * @license lucide-react v0.542.0 - ISC
28
- *
29
- * This source code is licensed under the ISC license.
30
- * See the LICENSE file in the root directory of this source tree.
31
- */const ps=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],Oe=_("file-spreadsheet",ps);/**
32
- * @license lucide-react v0.542.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */const js=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 13v-1h6v1",key:"1bb014"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M11 18h2",key:"12mj7e"}]],Ge=_("file-type",js);/**
37
- * @license lucide-react v0.542.0 - ISC
38
- *
39
- * This source code is licensed under the ISC license.
40
- * See the LICENSE file in the root directory of this source tree.
41
- */const gs=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],vs=_("hard-drive",gs);/**
42
- * @license lucide-react v0.542.0 - ISC
43
- *
44
- * This source code is licensed under the ISC license.
45
- * See the LICENSE file in the root directory of this source tree.
46
- */const Ns=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],ce=_("image",Ns);/**
47
- * @license lucide-react v0.542.0 - ISC
48
- *
49
- * This source code is licensed under the ISC license.
50
- * See the LICENSE file in the root directory of this source tree.
51
- */const ws=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],We=_("music",ws);/**
52
- * @license lucide-react v0.542.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */const bs=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],ze=_("presentation",bs);/**
57
- * @license lucide-react v0.542.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */const ys=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],ks=_("upload",ys);/**
62
- * @license lucide-react v0.542.0 - ISC
63
- *
64
- * This source code is licensed under the ISC license.
65
- * See the LICENSE file in the root directory of this source tree.
66
- */const Cs=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],Ss=_("video",Cs);async function Ze(o){const b=o.startsWith("http")?o:`${Ye}${o}`,l=await fetch(b,{headers:{Accept:"application/json","User-Agent":"coconut-frontend"}});if(!l.ok)throw new Error(`Failed to fetch registry resource: ${l.status}`);return l.json()}async function Fs(){return Ze("/registry/resources/root.json")}async function Ae(o){return Ze(o)}function fe(o){if(o)return o.startsWith("http")?o:`${Ye}${o}`}function Ms({open:o,onOpenChange:b,onSelectExample:l}){const[y,S]=n.useState([]),[f,M]=n.useState(!1),[P,p]=n.useState(null),[k,j]=n.useState(null),[h,v]=n.useState(null),[F,D]=n.useState(!1),[T,x]=n.useState(null);n.useEffect(()=>{o&&(M(!0),p(null),j(null),v(null),x(null),Fs().then(r=>{S(r.elements??[]),r.elements&&r.elements.length>0&&I(r.elements[0])}).catch(r=>{console.error("Failed to load registry resources",r),S([]),p("Failed to load examples from registry")}).finally(()=>M(!1)))},[o]);const I=async r=>{j(r.id),x(null),v(null),D(!0);try{const d=await Ae(r.endpoint);v(d)}catch(d){console.error("Failed to load resource detail",d),x("Unable to load details for this example")}finally{D(!1)}},$=()=>{h?.prompt&&(l(h.prompt),b(!1))},N=async r=>{if(k===r.id&&h?.prompt){l(h.prompt),b(!1);return}try{const d=await Ae(r.endpoint);d.prompt&&(l(d.prompt),b(!1))}catch(d){console.error("Failed to load resource detail",d)}};return e.jsx(le,{open:o,onOpenChange:b,children:e.jsxs(re,{className:"max-w-[95vw] sm:max-w-[90vw] w-full sm:w-[90vw] max-h-[95vh] sm:max-h-[90vh] h-[95vh] sm:h-[90vh] p-0 gap-0 flex flex-col",children:[e.jsx(ne,{className:"px-4 sm:px-6 pt-4 sm:pt-6 pb-3 sm:pb-4 border-b flex-shrink-0",children:e.jsx(ie,{className:"text-base sm:text-lg",children:"Example Prompts"})}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden md:hidden",children:[e.jsx("div",{className:"h-[40%] min-h-0 p-3 flex items-center justify-center bg-muted/30 overflow-hidden",children:F?e.jsxs("div",{className:"flex items-center text-muted-foreground",children:[e.jsx(q,{className:"h-5 w-5 animate-spin mr-2"}),"Loading..."]}):T?e.jsx("p",{className:"text-sm text-muted-foreground",children:T}):h?e.jsx("img",{src:fe(h.imageUrl),alt:h.title,className:"max-w-full max-h-full object-contain rounded-lg shadow-lg"}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Select an example"})}),e.jsxs("div",{className:"flex-1 min-h-0 border-t flex flex-col",children:[f?e.jsxs("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:[e.jsx(q,{className:"h-5 w-5 animate-spin mr-2"}),"Loading examples..."]}):P?e.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:P}):y.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No examples available"}):e.jsx(Fe,{className:"flex-1",children:e.jsx("div",{className:"p-3 space-y-2",children:y.map(r=>e.jsxs("button",{onClick:()=>I(r),onDoubleClick:()=>N(r),className:`w-full text-left p-2 rounded-lg border-2 transition-all flex gap-3 ${k===r.id?"border-primary bg-primary/5":"border-transparent bg-muted/50 hover:bg-muted"}`,children:[r.thumbnailUrl&&e.jsx("img",{src:fe(r.thumbnailUrl),alt:"",className:"w-12 h-12 rounded object-cover flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:r.name}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description})]})]},r.id))})}),e.jsx("div",{className:"p-3 border-t flex-shrink-0",children:e.jsxs(u,{onClick:$,disabled:!h?.prompt||F,className:"w-full",children:[e.jsx(Me,{className:"mr-2 h-4 w-4"}),"Use This Prompt"]})})]})]}),e.jsxs("div",{className:"flex-1 hidden md:flex overflow-hidden",children:[e.jsxs("div",{className:"w-[35%] border-r flex flex-col",children:[f?e.jsxs("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:[e.jsx(q,{className:"h-5 w-5 animate-spin mr-2"}),"Loading examples..."]}):P?e.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:P}):y.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No examples available"}):e.jsx(Fe,{className:"flex-1",children:e.jsx("div",{className:"p-4 space-y-3",children:y.map(r=>e.jsxs("button",{onClick:()=>I(r),onDoubleClick:()=>N(r),className:`w-full text-left p-3 rounded-lg border-2 transition-all flex gap-3 ${k===r.id?"border-primary bg-primary/5 shadow-sm":"border-transparent bg-muted/50 hover:bg-muted hover:border-muted-foreground/20"}`,children:[r.thumbnailUrl&&e.jsx("img",{src:fe(r.thumbnailUrl),alt:"",className:"w-16 h-16 rounded object-cover flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium",children:r.name}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 mt-1",children:r.description}),r.tags&&r.tags.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1 mt-2",children:[r.tags.slice(0,3).map(d=>e.jsx(oe,{variant:"secondary",className:"text-[10px]",children:d},d)),r.tags.length>3&&e.jsxs(oe,{variant:"outline",className:"text-[10px]",children:["+",r.tags.length-3]})]})]})]},r.id))})}),e.jsx("div",{className:"p-4 border-t flex-shrink-0",children:e.jsxs(u,{onClick:$,disabled:!h?.prompt||F,className:"w-full",children:[e.jsx(Me,{className:"mr-2 h-4 w-4"}),"Use This Prompt"]})})]}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx("div",{className:"flex-1 min-h-0 p-6 flex items-center justify-center bg-muted/30 overflow-hidden",children:F?e.jsxs("div",{className:"flex items-center text-muted-foreground",children:[e.jsx(q,{className:"h-5 w-5 animate-spin mr-2"}),"Loading details..."]}):T?e.jsx("p",{className:"text-sm text-muted-foreground",children:T}):h?e.jsx("img",{src:fe(h.imageUrl),alt:h.title,className:"max-w-full max-h-full object-contain rounded-lg shadow-lg"}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Select an example to preview"})}),h&&e.jsxs("div",{className:"border-t p-4 bg-background flex-shrink-0 max-h-[30%] overflow-y-auto",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-2 font-medium",children:"Full Prompt:"}),e.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:h.prompt})]})]})]})]})})}const Se={"nano-banana-pro":{id:"nano-banana-pro",label:"Nano Banana Pro",replicateId:"google/nano-banana-pro",features:{resolution:!0,outputQuality:!1,goFast:!1,safetyTolerance:!1,matchInputImage:!1},resolutionOptions:[{value:"1K",label:"1K"},{value:"2K",label:"2K"},{value:"4K",label:"4K"}],defaults:{resolution:"2K"}},"flux-2-dev":{id:"flux-2-dev",label:"FLUX.2 Dev",replicateId:"black-forest-labs/flux-2-dev",features:{resolution:!1,outputQuality:!0,goFast:!0,safetyTolerance:!1,matchInputImage:!0},defaults:{outputQuality:80,goFast:!0}},"flux-2-pro":{id:"flux-2-pro",label:"FLUX.2 Pro",replicateId:"black-forest-labs/flux-2-pro",features:{resolution:!0,outputQuality:!0,goFast:!1,safetyTolerance:!0,matchInputImage:!1},resolutionOptions:[{value:"0.5 MP",label:"0.5 MP"},{value:"1 MP",label:"1 MP"},{value:"2 MP",label:"2 MP"},{value:"4 MP",label:"4 MP"}],defaults:{resolution:"2 MP",outputQuality:80,safetyTolerance:2}}},Ve=Object.values(Se).map(o=>({value:o.id,label:o.label})),Qe=[{value:"1:1",label:"1:1"},{value:"2:3",label:"2:3"},{value:"3:2",label:"3:2"},{value:"3:4",label:"3:4"},{value:"4:3",label:"4:3"},{value:"4:5",label:"4:5"},{value:"5:4",label:"5:4"},{value:"9:16",label:"9:16"},{value:"16:9",label:"16:9"},{value:"21:9",label:"21:9"}],Ps={value:"match_input_image",label:"Match Input"},Be=[{value:"png",label:"PNG"},{value:"jpg",label:"JPG"},{value:"webp",label:"WebP"}],qe=[{value:"60",label:"60"},{value:"70",label:"70"},{value:"80",label:"80"},{value:"90",label:"90"},{value:"100",label:"100"}],He=[{value:"1",label:"1 (Strict)"},{value:"2",label:"2"},{value:"3",label:"3"},{value:"4",label:"4"},{value:"5",label:"5"},{value:"6",label:"6 (Relaxed)"}];function Ts({open:o,onOpenChange:b,onSave:l}){const[y,S]=n.useState(""),[f,M]=n.useState("nano-banana-pro"),[P,p]=n.useState("4:3"),[k,j]=n.useState("2K"),[h,v]=n.useState("png"),[F,D]=n.useState("80"),[T,x]=n.useState(!0),[I,$]=n.useState("2"),[N,r]=n.useState(null),[d,L]=n.useState(!1),[R,A]=n.useState(!1),[H,i]=n.useState([]),[c,V]=n.useState([]),[Q,ee]=n.useState(!0),[de,se]=n.useState(!1),{toast:X}=Ke(),C=Se[f],me=C.features.matchInputImage?[Ps,...Qe]:Qe,ae=C.resolutionOptions||[];n.useEffect(()=>{const a=Se[f];a.defaults.resolution&&a.features.resolution&&j(a.defaults.resolution),a.defaults.outputQuality!==void 0&&D(String(a.defaults.outputQuality)),a.defaults.goFast!==void 0&&x(a.defaults.goFast),a.defaults.safetyTolerance!==void 0&&$(String(a.defaults.safetyTolerance)),p(w=>w==="match_input_image"&&!a.features.matchInputImage?"4:3":w)},[f]),n.useEffect(()=>{o&&pe()},[o]);const pe=async()=>{try{const w=await(await fetch(`${z}/api/v1/resources`)).json();if(w.success){const J=(w.data||[]).filter(B=>{const s=B.type==="image/jpeg"||B.name.toLowerCase().endsWith(".jpg")||B.name.toLowerCase().endsWith(".jpeg"),t=B.type==="image/png"||B.name.toLowerCase().endsWith(".png");return(s||t)&&B.thumbnailPath});i(J)}}catch(a){console.error("Failed to fetch image resources:",a)}},he=async()=>{if(!y.trim()){X({title:"Prompt required",description:"Please enter a prompt to generate an image",variant:"destructive"});return}L(!0),r(null);try{const a=Q||c.length===0?[]:[...c],w=await fetch(`${z}/api/v1/resources/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:y,model:f,dimensions:P,resolution:C.features.resolution?k:void 0,output_format:h,output_quality:C.features.outputQuality?parseInt(F):void 0,go_fast:C.features.goFast?T:void 0,safety_tolerance:C.features.safetyTolerance?parseInt(I):void 0,image_input:a})}),J=await w.json();if(!w.ok||!J.success){const B=J.error?.message||"Failed to generate image",s=J.error?.code==="MISSING_API_TOKEN";throw new Error(s?"Replicate API token not configured. Please add it in Settings → Integrations.":B)}r(J.data.imageUrl),X({title:"Image generated",description:"Your image has been generated successfully"})}catch(a){console.error("Generation error:",a),X({title:"Generation failed",description:a instanceof Error?a.message:"Failed to generate image. Please try again.",variant:"destructive"})}finally{L(!1)}},ue=async()=>{if(N){A(!0);try{await l(N),S(""),M("nano-banana-pro"),p("4:3"),j("2K"),v("png"),D("80"),x(!0),$("2"),r(null),ee(!0),V([]),b(!1)}catch(a){X({title:"Save failed",description:a instanceof Error?a.message:"Failed to save image. Please try again.",variant:"destructive"})}finally{A(!1)}}},je=()=>{!d&&!R&&b(!1)},K=()=>{ee(!0),V([])},xe=a=>{Q&&ee(!1),c.includes(a)?(V(c.filter(w=>w!==a)),c.length===1&&ee(!0)):c.length<3?V([...c,a]):X({title:"Maximum selection",description:"You can only select up to 3 images",variant:"destructive"})},ge=a=>{S(a)};return e.jsxs(le,{open:o,onOpenChange:je,children:[e.jsxs(re,{className:"max-w-[95vw] sm:max-w-[90vw] w-full sm:w-[90vw] max-h-[95vh] sm:max-h-[90vh] h-[95vh] sm:h-[90vh] p-0 gap-0 flex flex-col",children:[e.jsx(ne,{className:"px-4 sm:px-6 pt-4 sm:pt-6 pb-3 sm:pb-4 border-b flex-shrink-0",children:e.jsx(ie,{className:"text-base sm:text-lg",children:"Generate Image"})}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden md:hidden",children:[e.jsx("div",{className:"flex-1 min-h-0 p-3 flex items-center justify-center bg-muted/30 overflow-hidden",children:d?e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-3",children:[e.jsx(q,{className:"h-10 w-10 animate-spin text-muted-foreground"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Generating..."})]}):N?e.jsx("div",{className:"w-full h-full min-h-0 flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:N,alt:"Generated",className:"max-w-full max-h-full object-contain rounded-lg shadow-lg"})}):e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-3 text-muted-foreground",children:[e.jsx(ce,{className:"h-12 w-12"}),e.jsx("p",{className:"text-xs",children:"Preview"}),e.jsxs(u,{size:"sm",onClick:()=>se(!0),className:"mt-2",children:[e.jsx(we,{className:"mr-2 h-4 w-4"}),"View Examples"]})]})}),e.jsx("div",{className:"border-t bg-background p-2 flex-shrink-0",children:e.jsxs("div",{className:"flex gap-1.5 overflow-x-auto pb-1",children:[e.jsx("button",{onClick:K,className:`flex-shrink-0 h-16 w-16 flex items-center justify-center border-2 rounded-md transition-colors text-xs ${Q?"border-primary bg-primary/10":"border-muted hover:border-muted-foreground/50"}`,children:"None"}),H.map(a=>{const w=c.includes(a.id);return e.jsx("button",{onClick:()=>xe(a.id),className:`flex-shrink-0 h-16 w-16 border-2 rounded-md overflow-hidden transition-colors ${w?"border-primary ring-2 ring-primary":"border-muted hover:border-muted-foreground/50"}`,children:e.jsx("img",{src:`${z}/api/v1/resources/${a.id}/thumbnail`,alt:a.name,className:"w-full h-full object-cover"})},a.id)})]})}),e.jsx("div",{className:"border-t p-3 overflow-y-auto flex-shrink-0 max-h-[45vh]",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(g,{htmlFor:"prompt-mobile",className:"text-xs",children:"Prompt"}),e.jsx(be,{id:"prompt-mobile",placeholder:"Describe the image...",value:y,onChange:a=>S(a.target.value),rows:2,className:"resize-none text-sm"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(g,{htmlFor:"model-mobile",className:"text-xs",children:"Model"}),e.jsxs(E,{value:f,onValueChange:a=>M(a),children:[e.jsx(U,{id:"model-mobile",className:"h-8 text-xs",children:e.jsx(O,{})}),e.jsx(G,{children:Ve.map(a=>e.jsx(W,{value:a.value,children:a.label},a.value))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(g,{htmlFor:"outputFormat-mobile",className:"text-xs",children:"Format"}),e.jsxs(E,{value:h,onValueChange:v,children:[e.jsx(U,{id:"outputFormat-mobile",className:"h-8 text-xs",children:e.jsx(O,{})}),e.jsx(G,{children:Be.map(a=>e.jsx(W,{value:a.value,children:a.label},a.value))})]})]}),C.features.goFast&&e.jsx("div",{className:"space-y-1 flex flex-col justify-end",children:e.jsxs("div",{className:"flex items-center space-x-2 h-8",children:[e.jsx(Pe,{id:"goFast-mobile",checked:T,onCheckedChange:a=>x(a===!0)}),e.jsx(g,{htmlFor:"goFast-mobile",className:"text-xs cursor-pointer",children:"Go Fast"})]})}),C.features.safetyTolerance&&e.jsxs("div",{className:"space-y-1",children:[e.jsx(g,{htmlFor:"safetyTolerance-mobile",className:"text-xs",children:"Safety"}),e.jsxs(E,{value:I,onValueChange:$,children:[e.jsx(U,{id:"safetyTolerance-mobile",className:"h-8 text-xs",children:e.jsx(O,{})}),e.jsx(G,{children:He.map(a=>e.jsx(W,{value:a.value,children:a.label},a.value))})]})]})]}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[C.features.resolution&&e.jsxs("div",{className:"space-y-1 flex-1 min-w-[80px]",children:[e.jsx(g,{htmlFor:"resolution-mobile",className:"text-xs",children:"Resolution"}),e.jsxs(E,{value:k,onValueChange:j,children:[e.jsx(U,{id:"resolution-mobile",className:"h-8 text-xs",children:e.jsx(O,{})}),e.jsx(G,{children:ae.map(a=>e.jsx(W,{value:a.value,children:a.label},a.value))})]})]}),e.jsxs("div",{className:"space-y-1 flex-1 min-w-[80px]",children:[e.jsx(g,{htmlFor:"aspectRatio-mobile",className:"text-xs",children:"Ratio"}),e.jsxs(E,{value:P,onValueChange:p,children:[e.jsx(U,{id:"aspectRatio-mobile",className:"h-8 text-xs",children:e.jsx(O,{})}),e.jsx(G,{children:me.map(a=>e.jsx(W,{value:a.value,children:a.label},a.value))})]})]}),C.features.outputQuality&&e.jsxs("div",{className:"space-y-1 flex-1 min-w-[80px]",children:[e.jsx(g,{htmlFor:"outputQuality-mobile",className:"text-xs",children:"Quality"}),e.jsxs(E,{value:F,onValueChange:D,children:[e.jsx(U,{id:"outputQuality-mobile",className:"h-8 text-xs",children:e.jsx(O,{})}),e.jsx(G,{children:qe.map(a=>e.jsx(W,{value:a.value,children:a.label},a.value))})]})]})]}),e.jsxs("div",{className:"flex gap-2 pt-1",children:[e.jsx(u,{onClick:he,disabled:!y.trim()||d||R,className:"flex-1 h-9",size:"sm",children:d?e.jsx(q,{className:"h-4 w-4 animate-spin"}):"Generate"}),e.jsx(u,{onClick:ue,disabled:!N||d||R,variant:"outline",className:"flex-1 h-9",size:"sm",children:R?e.jsx(q,{className:"h-4 w-4 animate-spin"}):"Save"})]})]})})]}),e.jsxs("div",{className:"flex-1 hidden md:flex overflow-hidden",children:[e.jsx("div",{className:"w-[22%] border-r p-6 overflow-y-auto",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"prompt",children:"Prompt"}),e.jsx(be,{id:"prompt",placeholder:"Describe the image you want to generate...",value:y,onChange:a=>S(a.target.value),rows:4,className:"resize-none"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"model",children:"Model"}),e.jsxs(E,{value:f,onValueChange:a=>M(a),children:[e.jsx(U,{id:"model",children:e.jsx(O,{})}),e.jsx(G,{children:Ve.map(a=>e.jsx(W,{value:a.value,children:a.label},a.value))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"aspectRatio",children:"Aspect Ratio"}),e.jsxs(E,{value:P,onValueChange:p,children:[e.jsx(U,{id:"aspectRatio",children:e.jsx(O,{})}),e.jsx(G,{children:me.map(a=>e.jsx(W,{value:a.value,children:a.label},a.value))})]})]}),C.features.resolution&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"resolution",children:"Resolution"}),e.jsxs(E,{value:k,onValueChange:j,children:[e.jsx(U,{id:"resolution",children:e.jsx(O,{})}),e.jsx(G,{children:ae.map(a=>e.jsx(W,{value:a.value,children:a.label},a.value))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"outputFormat",children:"Output Format"}),e.jsxs(E,{value:h,onValueChange:v,children:[e.jsx(U,{id:"outputFormat",children:e.jsx(O,{})}),e.jsx(G,{children:Be.map(a=>e.jsx(W,{value:a.value,children:a.label},a.value))})]})]}),C.features.outputQuality&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"outputQuality",children:"Output Quality"}),e.jsxs(E,{value:F,onValueChange:D,children:[e.jsx(U,{id:"outputQuality",children:e.jsx(O,{})}),e.jsx(G,{children:qe.map(a=>e.jsx(W,{value:a.value,children:a.label},a.value))})]})]}),C.features.goFast&&e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Pe,{id:"goFast",checked:T,onCheckedChange:a=>x(a===!0)}),e.jsx(g,{htmlFor:"goFast",className:"cursor-pointer",children:"Go Fast"})]}),C.features.safetyTolerance&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"safetyTolerance",children:"Safety Tolerance"}),e.jsxs(E,{value:I,onValueChange:$,children:[e.jsx(U,{id:"safetyTolerance",children:e.jsx(O,{})}),e.jsx(G,{children:He.map(a=>e.jsx(W,{value:a.value,children:a.label},a.value))})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 pt-4",children:[e.jsx(u,{onClick:he,disabled:!y.trim()||d||R,className:"w-full",children:d?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"mr-2 h-4 w-4 animate-spin"}),"Generating..."]}):"Generate"}),e.jsx(u,{onClick:ue,disabled:!N||d||R,variant:"outline",className:"w-full",children:R?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save"})]})]})}),e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[e.jsx("div",{className:"flex-1 min-h-0 p-6 flex items-center justify-center bg-muted/30 overflow-hidden",children:d?e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4",children:[e.jsx(q,{className:"h-12 w-12 animate-spin text-muted-foreground"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Generating image..."})]}):N?e.jsx("div",{className:"w-full h-full min-h-0 flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:N,alt:"Generated",className:"max-w-full max-h-full object-contain rounded-lg shadow-lg"})}):e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4 text-muted-foreground",children:[e.jsx(ce,{className:"h-16 w-16"}),e.jsx("p",{className:"text-sm",children:"Generated image will appear here"}),e.jsxs(u,{onClick:()=>se(!0),className:"mt-2",children:[e.jsx(we,{className:"mr-2 h-4 w-4"}),"View Examples"]})]})}),e.jsx("div",{className:"border-t bg-background p-4 flex-shrink-0",children:e.jsxs("div",{className:"flex gap-2 overflow-x-auto",children:[e.jsx("button",{onClick:K,className:`flex-shrink-0 h-32 w-32 flex items-center justify-center border-2 rounded-md transition-colors ${Q?"border-primary bg-primary/10":"border-muted hover:border-muted-foreground/50"}`,children:e.jsx("span",{className:"text-sm font-medium",children:"None"})}),H.map(a=>{const w=c.includes(a.id);return e.jsx("button",{onClick:()=>xe(a.id),className:`flex-shrink-0 h-32 w-32 border-2 rounded-md overflow-hidden transition-colors ${w?"border-primary ring-2 ring-primary":"border-muted hover:border-muted-foreground/50"}`,children:e.jsx("img",{src:`${z}/api/v1/resources/${a.id}/thumbnail`,alt:a.name,className:"w-full h-full object-cover"})},a.id)})]})})]})]})]}),e.jsx(Ms,{open:de,onOpenChange:se,onSelectExample:ge})]})}function Is({open:o,onOpenChange:b,resource:l,onCopyPath:y,onDownload:S,onNavigate:f,canNavigatePrev:M,canNavigateNext:P}){const[p,k]=n.useState(null),[j,h]=n.useState(!1),v=l?`${z}/api/v1/resources/${l.id}`:"",F=l?.type.startsWith("image/")??!1,D=l?l.type==="image/svg+xml"||l.name.toLowerCase().endsWith(".svg"):!1,T=l?l.type==="application/pdf"||l.name.toLowerCase().endsWith(".pdf"):!1,x=l?.type.startsWith("video/")??!1,I=l?.type.startsWith("audio/")??!1,$=l?l.type.startsWith("text/")||l.type==="application/json"||l.type.includes("javascript")||l.type.includes("typescript")||l.type.includes("xml")||l.name.toLowerCase().match(/\.(txt|md|json|js|ts|jsx|tsx|css|html|xml|yaml|yml|log|sh|bash|zsh|fish)$/)!==null:!1,N=l?l.name.toLowerCase().endsWith(".md")||l.name.toLowerCase().endsWith(".markdown"):!1,r=l?l.type==="application/json"||l.name.toLowerCase().endsWith(".json"):!1,d=l?l.type==="text/html"||l.name.toLowerCase().endsWith(".html"):!1;if(n.useEffect(()=>{const i=c=>{if(o){if(c.key==="Escape"){b(!1);return}if(c.key==="ArrowLeft"&&M){c.preventDefault(),f("prev");return}c.key==="ArrowRight"&&P&&(c.preventDefault(),f("next"))}};if(o)return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[o,b,f,M,P]),n.useEffect(()=>{o&&l&&($||N||r||d)?(h(!0),fetch(v).then(i=>{if(i.ok)return i.text();throw new Error("Failed to load file")}).then(i=>{k(i)}).catch(i=>{console.error("Failed to load text content:",i),k(null)}).finally(()=>{h(!1)})):k(null)},[o,l?.id,$,N,r,d,v]),!l)return null;const L=i=>{if(i===0)return"0 B";const c=1024,V=["B","KB","MB","GB"],Q=Math.floor(Math.log(i)/Math.log(c));return parseFloat((i/Math.pow(c,Q)).toFixed(2))+" "+V[Q]},R=i=>new Date(i).toLocaleString(),A=i=>i.startsWith("image/")?e.jsx(ce,{className:"h-6 w-6"}):i.startsWith("video/")?e.jsx(Ss,{className:"h-6 w-6"}):i.startsWith("audio/")?e.jsx(We,{className:"h-6 w-6"}):i.includes("text")||i.includes("document")||i.includes("code")?e.jsx(te,{className:"h-6 w-6"}):i.includes("json")||i.includes("javascript")||i.includes("typescript")?e.jsx(Ce,{className:"h-6 w-6"}):e.jsx(ye,{className:"h-6 w-6"}),H=()=>{if(D)return e.jsx("img",{src:v,alt:l.name,className:"max-w-full max-h-full object-contain rounded-lg shadow-lg"});if(T)return e.jsx("iframe",{src:v,className:"w-full h-full min-h-[600px] rounded-lg border",title:l.name});if(x)return e.jsx("video",{src:v,controls:!0,className:"max-w-full max-h-full rounded-lg shadow-lg",children:"Your browser does not support the video tag."});if(I)return e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4 p-8",children:[e.jsx(We,{className:"h-16 w-16 text-muted-foreground"}),e.jsx("audio",{src:v,controls:!0,className:"w-full max-w-md",children:"Your browser does not support the audio tag."})]});if(N&&p!==null)return j?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."})}):e.jsx("div",{className:"w-full h-full overflow-auto p-6 prose prose-sm dark:prose-invert max-w-none",children:e.jsx(ss,{remarkPlugins:[ts],rehypePlugins:[as],children:p})});if(d&&p!==null)return j?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."})}):e.jsx("iframe",{srcDoc:p,className:"w-full h-full min-h-[600px] rounded-lg border",title:l.name,sandbox:"allow-same-origin"});if(r&&p!==null){if(j)return e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."})});let i=p;try{const c=JSON.parse(p);i=JSON.stringify(c,null,2)}catch{}return e.jsx("div",{className:"w-full h-full overflow-auto p-6",children:e.jsx("pre",{className:"text-xs bg-muted p-4 rounded-lg overflow-auto",children:e.jsx("code",{children:i})})})}return $&&p!==null?j?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."})}):e.jsx("div",{className:"w-full h-full overflow-auto p-6",children:e.jsx("pre",{className:"text-xs bg-muted p-4 rounded-lg overflow-auto whitespace-pre-wrap",children:e.jsx("code",{children:p})})}):F?e.jsx("img",{src:v,alt:l.name,className:"max-w-full max-h-full object-contain rounded-lg shadow-lg"}):e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4 text-muted-foreground",children:[A(l.type),e.jsx("p",{className:"text-sm",children:"Preview not available for this file type"}),e.jsxs(u,{variant:"outline",onClick:()=>S(l),children:[e.jsx(ke,{className:"mr-2 h-4 w-4"}),"Download to view"]})]})};return e.jsx(le,{open:o,onOpenChange:b,children:e.jsxs(re,{className:"max-w-[90vw] w-[90vw] max-h-[90vh] h-[90vh] p-0 gap-0 flex flex-col [&>button]:hidden",children:[e.jsx(ne,{className:"px-6 pt-6 pb-4 border-b flex-shrink-0",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[A(l.type),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx(ie,{className:"text-xl truncate",children:l.name}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:l.type})]})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[e.jsx(u,{variant:"ghost",size:"sm",onClick:()=>y(l),title:"Copy path to clipboard",children:e.jsx(Je,{className:"h-4 w-4"})}),e.jsx(u,{variant:"ghost",size:"sm",onClick:()=>S(l),title:"Download",children:e.jsx(ke,{className:"h-4 w-4"})}),e.jsx(u,{variant:"ghost",size:"sm",onClick:()=>b(!1),title:"Close",children:e.jsx(Xe,{className:"h-4 w-4"})})]})]})}),e.jsx("div",{className:"flex-1 flex overflow-hidden",children:e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex-1 relative flex items-center justify-center bg-muted/30 p-6 overflow-auto",children:[M&&e.jsx("button",{type:"button",onClick:()=>f("prev"),className:"absolute left-4 top-1/2 -translate-y-1/2 rounded-full border bg-background/80 p-2 shadow-sm hover:bg-background transition-colors","aria-label":"Previous resource",children:e.jsx(os,{className:"h-5 w-5"})}),P&&e.jsx("button",{type:"button",onClick:()=>f("next"),className:"absolute right-4 top-1/2 -translate-y-1/2 rounded-full border bg-background/80 p-2 shadow-sm hover:bg-background transition-colors","aria-label":"Next resource",children:e.jsx(es,{className:"h-5 w-5"})}),H()]}),e.jsx("div",{className:"border-t p-6 flex-shrink-0 bg-background",children:e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold mb-3",children:"Information"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(vs,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"Size:"}),e.jsx("span",{children:L(l.size)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(cs,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"Uploaded:"}),e.jsx("span",{children:R(l.uploadedAt)})]})]})]})}),e.jsxs("div",{className:"space-y-4",children:[l.metadata.description&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Description"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:l.metadata.description})]}),l.metadata.tags&&l.metadata.tags.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Tags"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:l.metadata.tags.map(i=>e.jsx(oe,{variant:"secondary",children:i},i))})]})]})]})})]})})]})})}function Vs(){const[o,b]=n.useState([]),[l,y]=n.useState(!0),[S,f]=n.useState(!1),[M,P]=n.useState(""),[p,k]=n.useState(!1),[j,h]=n.useState([]),[v,F]=n.useState(""),[D,T]=n.useState(""),[x,I]=n.useState([]),[$,N]=n.useState(!1),[r,d]=n.useState(null),[L,R]=n.useState(null),[A,H]=n.useState(null),i=n.useRef(null),{toast:c}=Ke();n.useEffect(()=>{V()},[]);const V=async()=>{try{y(!0);const t=await(await fetch(`${z}/api/v1/resources`)).json();t.success&&b(t.data||[])}catch(s){console.error("Failed to fetch resources:",s)}finally{y(!1)}},Q=s=>{s.length!==0&&I(Array.from(s))},ee=async()=>{if(x.length!==0){f(!0);try{for(const s of x){const t=new FormData;if(t.append("file",s),t.append("tags",j.join(", ")),t.append("description",D),!(await fetch(`${z}/api/v1/resources`,{method:"POST",body:t})).ok)throw new Error("Upload failed")}h([]),F(""),T(""),I([]),k(!1),await V(),c({title:"Upload successful",description:`${x.length} file(s) uploaded successfully`})}catch(s){console.error("Upload failed:",s),c({title:"Upload failed",description:"Failed to upload files. Please try again.",variant:"destructive"})}finally{f(!1)}}},de=()=>{h([]),F(""),T(""),I([]),k(!1)},se=s=>{if(s.key==="Enter"){s.preventDefault();const t=v.trim();t&&!j.includes(t)&&(h([...j,t]),F(""))}},X=s=>{h(j.filter(t=>t!==s))},C=s=>{I(x.filter((t,m)=>m!==s))},me=async()=>{if(A)try{if((await fetch(`${z}/api/v1/resources/${A.id}`,{method:"DELETE"})).ok)await V(),c({title:"Resource deleted",description:`${A.name} has been deleted`});else throw new Error("Delete failed")}catch(s){console.error("Failed to delete resource:",s),c({title:"Delete failed",description:"Failed to delete resource. Please try again.",variant:"destructive"})}finally{H(null)}},ae=async s=>{try{const t=`.nut/resources/files/${s.path}`;await is(t),c({title:"Path copied!",description:`Copied ${t} to clipboard`})}catch(t){console.error("Failed to copy path:",t),c({title:"Failed to copy",description:"Unable to copy path to clipboard",variant:"destructive"})}},pe=s=>{if(s===0)return"0 B";const t=1024,m=["B","KB","MB","GB"],Y=Math.floor(Math.log(s)/Math.log(t));return parseFloat((s/Math.pow(t,Y)).toFixed(2))+" "+m[Y]},he=(s,t)=>{const m=t.toLowerCase();return s.startsWith("image/")?s==="image/svg+xml"||m.endsWith(".svg")?e.jsx(Le,{className:"h-4 w-4"}):e.jsx(ce,{className:"h-4 w-4"}):s.startsWith("video/")?e.jsx(Ue,{className:"h-4 w-4"}):s.startsWith("audio/")?e.jsx(_e,{className:"h-4 w-4"}):s==="application/pdf"||m.endsWith(".pdf")?e.jsx(te,{className:"h-4 w-4"}):m.match(/\.(js|jsx|ts|tsx|py|java|cpp|c|h|hpp|cs|go|rs|rb|php|swift|kt|scala|r|m|mm)$/)?e.jsx(Ce,{className:"h-4 w-4"}):s==="application/json"||m.endsWith(".json")?e.jsx(Ee,{className:"h-4 w-4"}):s.includes("spreadsheet")||s.includes("excel")||m.match(/\.(xls|xlsx|csv)$/)?e.jsx(Oe,{className:"h-4 w-4"}):s.includes("presentation")||s.includes("powerpoint")||m.match(/\.(ppt|pptx)$/)?e.jsx(ze,{className:"h-4 w-4"}):s.startsWith("text/")||s.includes("document")||s.includes("word")?e.jsx(te,{className:"h-4 w-4"}):s.includes("font")||m.match(/\.(ttf|otf|woff|woff2|eot)$/)?e.jsx(Ge,{className:"h-4 w-4"}):e.jsx(ye,{className:"h-4 w-4"})},ue=(s,t)=>{const m=t.toLowerCase();return s.startsWith("image/")?s==="image/svg+xml"||m.endsWith(".svg")?e.jsx(Le,{className:"h-16 w-16"}):e.jsx(ce,{className:"h-16 w-16"}):s.startsWith("video/")?e.jsx(Ue,{className:"h-16 w-16"}):s.startsWith("audio/")?e.jsx(_e,{className:"h-16 w-16"}):s==="application/pdf"||m.endsWith(".pdf")?e.jsx(te,{className:"h-16 w-16"}):m.match(/\.(js|jsx|ts|tsx|py|java|cpp|c|h|hpp|cs|go|rs|rb|php|swift|kt|scala|r|m|mm)$/)?e.jsx(Ce,{className:"h-16 w-16"}):s==="application/json"||m.endsWith(".json")?e.jsx(Ee,{className:"h-16 w-16"}):s.includes("spreadsheet")||s.includes("excel")||m.match(/\.(xls|xlsx|csv)$/)?e.jsx(Oe,{className:"h-16 w-16"}):s.includes("presentation")||s.includes("powerpoint")||m.match(/\.(ppt|pptx)$/)?e.jsx(ze,{className:"h-16 w-16"}):s.startsWith("text/")||s.includes("document")||s.includes("word")?e.jsx(te,{className:"h-16 w-16"}):s.includes("font")||m.match(/\.(ttf|otf|woff|woff2|eot)$/)?e.jsx(Ge,{className:"h-16 w-16"}):e.jsx(ye,{className:"h-16 w-16"})},je=s=>{const t=s.name.toLowerCase(),m=s.type.startsWith("image/");return s.type==="image/svg+xml"||t.endsWith(".svg")?e.jsx("div",{className:"w-full h-32 flex items-center justify-center bg-muted/30 rounded-md border overflow-hidden p-2",children:e.jsx("img",{src:`${z}/api/v1/resources/${s.id}`,alt:s.name,className:"w-full h-full object-contain"})}):m&&s.thumbnailPath?e.jsx("img",{src:`${z}/api/v1/resources/${s.id}/thumbnail`,alt:s.name,className:"w-full h-32 object-cover rounded-md border",onError:Z=>{Z.currentTarget.style.display="none"}}):e.jsx("div",{className:"w-full h-32 flex items-center justify-center bg-muted/50 rounded-md border",children:e.jsx("div",{className:"text-muted-foreground",children:ue(s.type,s.name)})})},K=o.filter(s=>{if(!M)return!0;const t=M.toLowerCase();return s.name.toLowerCase().includes(t)||s.metadata.description?.toLowerCase().includes(t)||s.metadata.tags?.some(m=>m.toLowerCase().includes(t))}),xe=s=>{s.preventDefault(),s.stopPropagation()},ge=s=>{s.preventDefault(),s.stopPropagation(),s.dataTransfer.files&&s.dataTransfer.files.length>0&&Q(s.dataTransfer.files)},a=(s,t)=>{if(t.target.closest("button"))return;d(s);const Y=K.findIndex(Z=>Z.id===s.id);R(Y>=0?Y:null)},w=s=>{window.open(`${z}/api/v1/resources/${s.id}?download=true`)},J=async s=>{f(!0);try{const t=await fetch(s);if(!t.ok)throw new Error("Failed to download generated image");const m=await t.blob(),Y=`generated-image-${Date.now()}.png`,Z=new FormData;if(Z.append("file",m,Y),Z.append("tags",j.join(",")),Z.append("description",D),!(await fetch(`${z}/api/v1/resources`,{method:"POST",body:Z})).ok)throw new Error("Upload failed");await V(),c({title:"Image saved",description:"Generated image has been saved to resources"})}catch(t){throw console.error("Failed to save generated image:",t),c({title:"Save failed",description:t.message||"Failed to save generated image",variant:"destructive"}),t}finally{f(!1)}},B=s=>{if(L===null)return;const t=s==="next"?L+1:L-1;if(t<0||t>=K.length)return;const m=K[t];R(t),d(m)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-xl sm:text-2xl font-bold tracking-tight",children:"Resources"}),e.jsx("p",{className:"text-muted-foreground text-sm hidden sm:block",children:"Manage files and resources for your project"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsxs(u,{variant:"outline",size:"sm",onClick:()=>N(!0),children:[e.jsx(we,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Generate"})]}),e.jsxs(u,{size:"sm",onClick:()=>k(!p),children:[e.jsx(Re,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Add Resource"})]})]})]}),e.jsx(le,{open:p,onOpenChange:s=>!s&&de(),children:e.jsxs(re,{className:"max-w-2xl",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Upload Resource"}),e.jsx(Te,{children:"Add files to your project resources"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border-2 border-dashed border-muted-foreground/25 rounded-lg p-8 text-center cursor-pointer hover:border-muted-foreground/50 transition-colors",onDragOver:xe,onDrop:ge,onClick:()=>i.current?.click(),children:[e.jsx(ks,{className:"mx-auto h-8 w-8 text-muted-foreground"}),e.jsx("p",{className:"mt-2 text-sm font-medium",children:"Drop files here or click to browse"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Support for images, documents, and other files"})]}),e.jsx("input",{ref:i,type:"file",multiple:!0,className:"hidden",onChange:s=>s.target.files&&Q(s.target.files)}),x.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs(g,{children:["Selected Files (",x.length,")"]}),e.jsx("div",{className:"border rounded-lg p-3 max-h-40 overflow-y-auto space-y-2",children:x.map((s,t)=>e.jsxs("div",{className:"flex items-center justify-between text-sm bg-muted/50 rounded px-3 py-2",children:[e.jsx("span",{className:"truncate flex-1",children:s.name}),e.jsx(u,{variant:"ghost",size:"sm",onClick:()=>C(t),className:"h-6 w-6 p-0 ml-2",children:e.jsx(Ie,{className:"h-3 w-3"})})]},t))})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"tags",children:"Tags"}),e.jsx(De,{id:"tags",placeholder:"Type a tag and press Enter",value:v,onChange:s=>F(s.target.value),onKeyDown:se}),j.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:j.map(s=>e.jsxs(oe,{variant:"secondary",className:"text-xs",children:[s,e.jsx("button",{type:"button",onClick:()=>X(s),className:"ml-1 hover:text-destructive",children:"×"})]},s))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"description",children:"Description"}),e.jsx(be,{id:"description",placeholder:"Brief description of this resource...",value:D,onChange:s=>T(s.target.value),rows:3})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[e.jsx(u,{variant:"outline",onClick:de,disabled:S,children:"Cancel"}),e.jsx(u,{onClick:ee,disabled:x.length===0||S,children:S?"Uploading...":`Upload ${x.length>0?`(${x.length})`:""}`})]})]})]})}),e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs("div",{className:"relative flex-1 w-full",children:[e.jsx(ds,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(De,{placeholder:"Search resources...",value:M,onChange:s=>P(s.target.value),className:"pl-8"})]})}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:l?Array.from({length:6}).map((s,t)=>e.jsxs(ve,{className:"animate-pulse",children:[e.jsxs($e,{children:[e.jsx("div",{className:"h-4 bg-muted rounded w-3/4"}),e.jsx("div",{className:"h-3 bg-muted rounded w-1/2"})]}),e.jsx(Ne,{children:e.jsx("div",{className:"h-20 bg-muted rounded"})})]},t)):K.length>0?K.map(s=>e.jsxs(ve,{className:"hover:shadow-lg hover:bg-muted transition-all cursor-pointer",onClick:t=>a(s,t),children:[e.jsxs($e,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[he(s.type,s.name),e.jsx(rs,{className:"text-sm font-medium truncate",children:s.name})]}),e.jsxs(ns,{className:"text-xs",children:[pe(s.size)," • ",new Date(s.uploadedAt).toLocaleDateString()]}),e.jsxs("div",{className:"flex justify-end space-x-1 mt-2",children:[e.jsx(u,{variant:"ghost",size:"sm",onClick:t=>{t.stopPropagation(),ae(s)},title:"Copy path to clipboard",children:e.jsx(Je,{className:"h-3 w-3"})}),e.jsx(u,{variant:"ghost",size:"sm",onClick:t=>{t.stopPropagation(),w(s)},children:e.jsx(ke,{className:"h-3 w-3"})}),e.jsx(u,{variant:"ghost",size:"sm",onClick:t=>{t.stopPropagation(),H(s)},children:e.jsx(Ie,{className:"h-3 w-3"})})]})]}),e.jsxs(Ne,{className:"pt-0",children:[e.jsx("div",{className:"mb-3",children:je(s)}),s.metadata.description&&e.jsx("p",{className:"text-sm text-muted-foreground mb-2 line-clamp-2",children:s.metadata.description}),s.metadata.tags&&s.metadata.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:s.metadata.tags.map(t=>e.jsx(oe,{variant:"secondary",className:"text-xs",children:t},t))})]})]},s.id)):e.jsx("div",{className:"col-span-full",children:e.jsx(ve,{children:e.jsxs(Ne,{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(ls,{className:"h-12 w-12 text-muted-foreground/50"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No resources yet"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground text-center max-w-sm",children:"Upload files to get started. Resources can be referenced by LLMs and team members for enhanced context."}),e.jsxs(u,{className:"mt-4",onClick:()=>k(!0),children:[e.jsx(Re,{className:"mr-2 h-4 w-4"}),"Add First Resource"]})]})})})}),S&&e.jsx("div",{className:"fixed bottom-4 right-4 bg-background border rounded-lg shadow-lg p-4",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-primary"}),e.jsx("span",{className:"text-sm",children:"Uploading files..."})]})}),e.jsx(Ts,{open:$,onOpenChange:N,onSave:J}),e.jsx(Is,{open:!!r,onOpenChange:s=>{s||d(null),s||R(null)},resource:r,onCopyPath:ae,onDownload:w,onNavigate:B,canNavigatePrev:L!==null&&L>0,canNavigateNext:L!==null&&L<K.length-1}),e.jsx(le,{open:!!A,onOpenChange:s=>!s&&H(null),children:e.jsxs(re,{className:"max-w-md",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Delete Resource"}),e.jsxs(Te,{children:["Are you sure you want to delete ",e.jsx("strong",{children:A?.name}),"? This action cannot be undone."]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[e.jsx(u,{variant:"outline",onClick:()=>H(null),children:"Cancel"}),e.jsx(u,{variant:"destructive",onClick:me,children:"Delete"})]})]})})]})}export{Vs as default};