tarsk 0.4.10 → 0.4.13
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/index.js +2857 -622
- package/dist/public/assets/account-view-CXpwWuJZ.js +1 -0
- package/dist/public/assets/api-BfUK32d1.js +1 -0
- package/dist/public/assets/{browser-tab-CWkk3b20.js → browser-tab-BdzIB5R4.js} +1 -1
- package/dist/public/assets/context-menu-CC9JLx5B.js +1 -0
- package/dist/public/assets/conversation-history-view-C6iUsZjA.js +1 -0
- package/dist/public/assets/{dialogs-config-CB7G-sX6.js → dialogs-config-Ofxg1Bn0.js} +2 -2
- package/dist/public/assets/diff-view-C-Kz7R_T.js +3 -0
- package/dist/public/assets/explorer-tab-view-DC8arYcw.js +2 -0
- package/dist/public/assets/explorer-tree-BwLCrdfR.js +1 -0
- package/dist/public/assets/explorer-view-CPCrOqXp.js +1 -0
- package/dist/public/assets/history-view-CAVl9GFy.js +1 -0
- package/dist/public/assets/index-BVLzVjoR.css +1 -0
- package/dist/public/assets/index-DIWoaAFy.js +30 -0
- package/dist/public/assets/onboarding-DTzcWokE.js +1 -0
- package/dist/public/assets/onboarding-dialog-BQvu_Nac.js +1 -0
- package/dist/public/assets/project-settings-view-CZPKYKCu.js +1 -0
- package/dist/public/assets/provider-details-view-BBvKe6Am.js +1 -0
- package/dist/public/assets/providers-sidebar-DSrnVDNy.js +1 -0
- package/dist/public/assets/react-vendor-9yNfIRPs.js +17 -0
- package/dist/public/assets/settings-view-D6FAPBQP.js +2 -0
- package/dist/public/assets/store-BuY90jLM.js +2 -0
- package/dist/public/assets/{terminal-panel-Bv2hLEfW.js → terminal-panel-Zyr6xth3.js} +2 -2
- package/dist/public/assets/textarea-CxhrnOOz.js +1 -0
- package/dist/public/assets/todos-view-yiH-gaUK.js +1 -0
- package/dist/public/assets/{utils-DVGxCyLB.js → utils-7CkwsQJ0.js} +1 -1
- package/dist/public/index.html +10 -9
- package/package.json +1 -1
- package/dist/public/assets/account-view-D1x7ZeLs.js +0 -1
- package/dist/public/assets/add-agent-view-Ctbm0EgW.js +0 -1
- package/dist/public/assets/add-rule-view-xKAYGOl5.js +0 -7
- package/dist/public/assets/add-skill-view-D63xCrVn.js +0 -1
- package/dist/public/assets/add-slash-command-view-paJjkCml.js +0 -1
- package/dist/public/assets/conversation-history-view-BdJJ-7zE.js +0 -1
- package/dist/public/assets/diff-view-kPjfhf7_.js +0 -3
- package/dist/public/assets/file-tree-sidebar-D58ROyfi.js +0 -1
- package/dist/public/assets/files-tab-view-DhnLTfaB.js +0 -2
- package/dist/public/assets/files-view-C1vg37wD.js +0 -1
- package/dist/public/assets/history-view-D-hEB6Qt.js +0 -1
- package/dist/public/assets/index-D7yQjYyf.js +0 -16
- package/dist/public/assets/index-DVHw8RF4.css +0 -1
- package/dist/public/assets/mcp-manager-J9VCn8-1.js +0 -1
- package/dist/public/assets/mcp-server-edit-view-yd_q5UVd.js +0 -5
- package/dist/public/assets/mcp-servers-sidebar-Bwg40dY8.js +0 -1
- package/dist/public/assets/mcp-view-BYzQiRVC.js +0 -1
- package/dist/public/assets/onboarding-CxK4aR2J.js +0 -1
- package/dist/public/assets/onboarding-dialog-DX7DCkK0.js +0 -1
- package/dist/public/assets/project-settings-view-CkAqtfjP.js +0 -1
- package/dist/public/assets/provider-details-view-CzsPzv6h.js +0 -1
- package/dist/public/assets/providers-sidebar-BokZx2tk.js +0 -1
- package/dist/public/assets/radio-group-BpmnaKJk.js +0 -1
- package/dist/public/assets/react-vendor-CR4cAsbx.js +0 -17
- package/dist/public/assets/settings-view-CoL0k8nt.js +0 -2
- package/dist/public/assets/side-panel-resizer-CVC2NC75.js +0 -1
- package/dist/public/assets/store-CxlaVYZ6.js +0 -2
- package/dist/public/assets/todos-view-FJ5GkG21.js +0 -1
- /package/dist/public/assets/{monaco-Cp3BWanQ.js → monaco-CgzMkQ7t.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/providers-sidebar-DSrnVDNy.js","assets/rolldown-runtime-Dw2cE7zH.js","assets/index-DIWoaAFy.js","assets/react-vendor-9yNfIRPs.js","assets/history-view-CAVl9GFy.js","assets/dialogs-config-Ofxg1Bn0.js","assets/monaco-CgzMkQ7t.js","assets/onboarding-DTzcWokE.js","assets/textarea-CxhrnOOz.js","assets/store-BuY90jLM.js","assets/utils-7CkwsQJ0.js","assets/index-BVLzVjoR.css","assets/provider-details-view-BBvKe6Am.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{Yt as t,br as n,ra as r,ta as i}from"./dialogs-config-Ofxg1Bn0.js";import{_t as a,gt as o,ht as s,mt as c}from"./react-vendor-9yNfIRPs.js";import{f as l,n as u,r as d,t as f}from"./index-DIWoaAFy.js";var p=i(),m=e(r(),1),h=n(),g=(0,m.forwardRef)(function(e,t){let n=(0,p.c)(20),{sidebar:r,children:i,defaultSidebarSize:a,minSidebarSize:o,maxSidebarSize:s,minContentSize:c,collapsible:l,collapsedSize:m,className:g,onCollapse:_,onExpand:v}=e,y=a===void 0?25:a,b=o===void 0?20:o,x=s===void 0?30:s,S=c===void 0?40:c,C=l===void 0?!1:l,w=m===void 0?0:m,T=`h-full ${g===void 0?``:g}`,E;n[0]!==w||n[1]!==C||n[2]!==y||n[3]!==x||n[4]!==b||n[5]!==_||n[6]!==v||n[7]!==t||n[8]!==r?(E=(0,h.jsx)(u,{ref:t,defaultSize:y,minSize:b,maxSize:x,collapsible:C,collapsedSize:w,onCollapse:_,onExpand:v,className:`border-r border-transparent`,children:r}),n[0]=w,n[1]=C,n[2]=y,n[3]=x,n[4]=b,n[5]=_,n[6]=v,n[7]=t,n[8]=r,n[9]=E):E=n[9];let D;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,h.jsx)(f,{withHandle:!0,className:`ml-[-40px]`}),n[10]=D):D=n[10];let O;n[11]!==i||n[12]!==S?(O=(0,h.jsx)(u,{minSize:S,className:`overflow-hidden`,children:i}),n[11]=i,n[12]=S,n[13]=O):O=n[13];let k;n[14]!==O||n[15]!==E?(k=(0,h.jsxs)(d,{direction:`horizontal`,className:`h-full`,children:[E,D,O]}),n[14]=O,n[15]=E,n[16]=k):k=n[16];let A;return n[17]!==k||n[18]!==T?(A=(0,h.jsx)(`div`,{className:T,children:k}),n[17]=k,n[18]=T,n[19]=A):A=n[19],A}),_=(0,m.lazy)(()=>a(()=>import(`./providers-sidebar-DSrnVDNy.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),v=(0,m.lazy)(()=>a(()=>import(`./provider-details-view-BBvKe6Am.js`),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]))),y=[`providers`];function b(e){let t=(0,p.c)(5),{title:n}=e,r;t[0]===n?r=t[1]:(r=(0,h.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:n}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Content coming soon...`}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,h.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,h.jsxs)(`div`,{className:`text-center`,children:[r,i]})}),t[3]=r,t[4]=a),a}function x(){let e=(0,p.c)(30),{tab:t}=o(),n=s(),r=c(),i;if(e[0]!==r.search||e[1]!==t){let n=new URLSearchParams(r.search).get(`tab`);i=n&&y.includes(n)?n:t&&y.includes(t)?t:`providers`,e[0]=r.search,e[1]=t,e[2]=i}else i=e[2];let a=i,[u,d]=(0,m.useState)(!1),f=(0,m.useRef)(null),[x,C]=(0,m.useState)(null),w=S,T;e[3]===n?T=e[4]:(T=()=>{n(`/`)},e[3]=n,e[4]=T);let E=T,D;e[5]===n?D=e[6]:(D=e=>{C(e),n(`/settings?tab=providers`,{replace:!0})},e[5]=n,e[6]=D);let O=D,k,A;e[7]!==r.pathname||e[8]!==n?(k=()=>{[`/settings/account`,`/settings/project`,`/settings/mcp-servers`,`/settings/mcp-server-edit`,`/settings/add-skill`,`/settings/add-command`,`/settings/add-rule`,`/settings/add-agent`].some(e=>r.pathname.startsWith(e))&&n(`/settings/providers`,{replace:!0})},A=[r.pathname,n],e[7]=r.pathname,e[8]=n,e[9]=k,e[10]=A):(k=e[9],A=e[10]),(0,m.useEffect)(k,A);let j;e[11]!==E||e[12]!==O||e[13]!==x?(j=()=>(0,h.jsx)(l,{onTitleClose:E,subtitle:`Model Providers`,onResetOnboarding:w,children:(0,h.jsx)(`div`,{className:`px-2 py-2`,children:(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(`div`,{className:`animate-pulse h-4 bg-muted rounded`}),children:(0,h.jsx)(_,{selectedProvider:x,onProviderSelect:O})})})}),e[11]=E,e[12]=O,e[13]=x,e[14]=j):j=e[14];let M=j,N;e[15]!==a||e[16]!==x?(N=()=>{switch(a){case`providers`:return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(b,{title:`Provider Details`}),children:(0,h.jsx)(v,{selectedProviderName:x})});default:return(0,h.jsx)(b,{title:`Settings`})}},e[15]=a,e[16]=x,e[17]=N):N=e[17];let P=N,F,I;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>d(!0),I=()=>d(!1),e[18]=F,e[19]=I):(F=e[18],I=e[19]);let L;e[20]===M?L=e[21]:(L=M(),e[20]=M,e[21]=L);let R=`h-full overflow-auto ${u?`ml-[40px]`:``}`,z;e[22]===P?z=e[23]:(z=P(),e[22]=P,e[23]=z);let B;e[24]!==R||e[25]!==z?(B=(0,h.jsx)(`div`,{className:R,children:z}),e[24]=R,e[25]=z,e[26]=B):B=e[26];let V;return e[27]!==B||e[28]!==L?(V=(0,h.jsx)(g,{ref:f,collapsible:!0,onCollapse:F,onExpand:I,sidebar:L,children:B}),e[27]=B,e[28]=L,e[29]=V):V=e[29],V}async function S(){try{await t()}catch(e){let t=e;console.error(`Failed to reset onboarding:`,t)}}export{x as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{ra as t,ta as n}from"./dialogs-config-Ofxg1Bn0.js";function r(e){return typeof e==`string`?e.replace(/\\n/g,`
|
|
2
|
+
`).replace(/✅/g,`✓`):``}function i(e){if(!e||typeof e!=`string`)return null;let t=e.trim();if(!t)return null;let n=[],r=0;for(;r<t.length;){let e=t.indexOf(`[`,r);if(e===-1){let e=t.slice(r).trim();e&&n.push({type:`reasoning`,text:e});break}let i=t.slice(r,e).trim();i&&n.push({type:`reasoning`,text:i});let a=0,o=-1;for(let n=e;n<t.length;n++)if(t[n]===`[`)a++;else if(t[n]===`]`&&(a--,a===0)){o=n;break}if(o===-1){let r=t.slice(e).trim();r&&n.push({type:`reasoning`,text:r});break}try{let r=JSON.parse(t.slice(e,o+1));if(Array.isArray(r)){for(let e of r)if(e&&typeof e==`object`&&`type`in e){let t=e.type;(t===`tool-result`||t===`tool_use`)&&n.push(e)}}}catch{let r=t.slice(e,o+1).trim();r&&n.push({type:`reasoning`,text:r})}r=o+1}return n.length>0?n:null}function a(e){return e.map(e=>{if(typeof e==`object`&&e&&!(`type`in e)){let t=e;if(t.reasoning)return{type:`reasoning`,text:typeof t.reasoning==`string`?t.reasoning:JSON.stringify(t.reasoning)};let n=t.text??t.content??t.answer;if(n)return{type:`text`,text:typeof n==`string`?n:JSON.stringify(n)}}return e})}function o(e){let t=[];e.reasoning&&typeof e.reasoning==`string`&&t.push({type:`reasoning`,text:e.reasoning});let n=(typeof e.text==`string`?e.text:null)??(typeof e.content==`string`?e.content:null)??(typeof e.answer==`string`?e.answer:null);return n&&t.push({type:`text`,text:n}),t.length===0&&Object.keys(e).length>0&&t.push({type:`text`,text:JSON.stringify(e,null,2)}),t}function s(e){if(!e)return null;let t=e.trim();if(t.startsWith(`{`)||t.startsWith(`[`))try{let e=JSON.parse(t);if(Array.isArray(e))return a(e);if(typeof e==`object`&&e)return o(e)}catch{}let n=[],r=e.indexOf(`{`),i=e.indexOf(`[`),s=r===-1?i:i===-1?r:Math.min(r,i);if(s!==-1){let t=e.slice(s),r=Math.max(t.lastIndexOf(`]`),t.lastIndexOf(`}`));if(r!==-1){let e=t.substring(0,r+1);try{let i=JSON.parse(e);Array.isArray(i)?n.push(...a(i)):n.push(...o(i));let s=t.substring(r+1).trim();return s&&n.push({type:`text`,text:s}),n}catch{}}}return null}function c(e,t,n){let r=e[e.length-1];return r?.type===t?[...e.slice(0,-1),{type:t,chunks:[...r.chunks,n]}]:[...e,{type:t,chunks:[n]}]}function l(e,t){return e[e.length-1]?.type===`content`?[...e.slice(0,-1),{type:`content`,chunks:[t]}]:[...e,{type:`content`,chunks:[t]}]}function u(e){let t=[];for(let n of e){let e=n.chunks.join(``);if(n.type===`thinking`){let n=i(e)??[];t.push(...n)}else{let n=s(e)??(e.trim()?[{type:`text`,text:e}]:[]);t.push(...n)}}return t}function d(e){let t=u(e);return t.length===0?`...`:t.length===1&&t[0]?.type===`text`&&`text`in t[0]?t[0].text:JSON.stringify(t)}var f=n(),p=e(t(),1),m=function(e){return e.SetProjects=`SET_PROJECTS`,e.SetProjectsLoading=`SET_PROJECTS_LOADING`,e.SelectThread=`SELECT_THREAD`,e.SetMessages=`SET_MESSAGES`,e.AddMessage=`ADD_MESSAGE`,e.EnqueueChatMessage=`ENQUEUE_CHAT_MESSAGE`,e.RemoveQueuedChatMessage=`REMOVE_QUEUED_CHAT_MESSAGE`,e.SetStreaming=`SET_STREAMING`,e.AppendStreamContent=`APPEND_STREAM_CONTENT`,e.SetStreamContent=`SET_STREAM_CONTENT`,e.AppendStreamThinking=`APPEND_STREAM_THINKING`,e.AppendStreamChunk=`APPEND_STREAM_CHUNK`,e.SetStreamModel=`SET_STREAM_MODEL`,e.SetProjectModel=`SET_PROJECT_MODEL`,e.ResetStream=`RESET_STREAM`,e.StopStream=`STOP_STREAM`,e.ToggleSidebar=`TOGGLE_SIDEBAR`,e.SetCreatingProject=`SET_CREATING_PROJECT`,e.ConfigUpdated=`CONFIG_UPDATED`,e.SetProcessingThreads=`SET_PROCESSING_THREADS`,e.AddProcessingThread=`ADD_PROCESSING_THREAD`,e.RemoveProcessingThread=`REMOVE_PROCESSING_THREAD`,e.AddCreatingProject=`ADD_CREATING_PROJECT`,e.AddCreatingThread=`ADD_CREATING_THREAD`,e.RemoveCreatingProject=`REMOVE_CREATING_PROJECT`,e.RemoveCreatingThread=`REMOVE_CREATING_THREAD`,e.MarkThreadCompleted=`MARK_THREAD_COMPLETED`,e.ClearThreadCompleted=`CLEAR_THREAD_COMPLETED`,e.AddDeletingThread=`ADD_DELETING_THREAD`,e.RemoveDeletingThread=`REMOVE_DELETING_THREAD`,e.AddDeletingProject=`ADD_DELETING_PROJECT`,e.RemoveDeletingProject=`REMOVE_DELETING_PROJECT`,e.AppendCommandOutput=`APPEND_COMMAND_OUTPUT`,e.SetRunningCommand=`SET_RUNNING_COMMAND`,e.ClearCommandOutput=`CLEAR_COMMAND_OUTPUT`,e.ToggleTerminal=`TOGGLE_TERMINAL`,e.SetTerminalOpen=`SET_TERMINAL_OPEN`,e.QueueTerminalCommand=`QUEUE_TERMINAL_COMMAND`,e.ClearQueuedTerminalCommand=`CLEAR_QUEUED_TERMINAL_COMMAND`,e.AppendTerminalLine=`APPEND_TERMINAL_LINE`,e.ClearTerminalOutput=`CLEAR_TERMINAL_OUTPUT`,e.SetTerminalHeight=`SET_TERMINAL_HEIGHT`,e.SetTerminalCwd=`SET_TERMINAL_CWD`,e.SetTerminalRunning=`SET_TERMINAL_RUNNING`,e.SetTerminalHistory=`SET_TERMINAL_HISTORY`,e.SetTerminalHistoryIndex=`SET_TERMINAL_HISTORY_INDEX`,e.UpdateThreadTitle=`UPDATE_THREAD_TITLE`,e.ClearFocusChatInput=`CLEAR_FOCUS_CHAT_INPUT`,e.ClearMessages=`CLEAR_MESSAGES`,e.UpdateToolCallProgress=`UPDATE_TOOL_CALL_PROGRESS`,e.SetPendingChatMessage=`SET_PENDING_CHAT_MESSAGE`,e.ClearPendingChatMessage=`CLEAR_PENDING_CHAT_MESSAGE`,e.SetDiffComments=`SET_DIFF_COMMENTS`,e.ClearSelection=`CLEAR_SELECTION`,e}({}),h={projects:[],projectsLoading:!0,selectedThreadId:null,selectedProjectId:null,messages:[],queuedChatMessages:[],isStreaming:!1,streamingContent:``,streamingThinking:``,streamingSegments:[],streamingModel:``,projectModelSelections:{},sidebarOpen:!0,isCreatingProject:!1,configUpdatedAt:0,processingThreadIds:[],completedThreadIds:[],deletingThreadIds:[],deletingProjectIds:[],commandOutput:``,isRunningCommand:!1,terminalStates:{},focusChatInput:!1,toolCallProgress:{},pendingChatMessage:null,diffComments:{}};function g(e,t){switch(t.type){case m.SetProjects:{let n={...e.projectModelSelections};for(let e of t.projects)for(let t of e.threads){if(!t.model)continue;let e=n[t.threadId];n[t.threadId]={id:t.model,provider:t.modelProvider,name:e?.name??t.model,description:e?.description??``,context_length:e?.context_length,features:e?.features,input_modalities:e?.input_modalities,max_output:e?.max_output,pricing:e?.pricing,tarsk_use:e?.tarsk_use,coding_index:e?.coding_index,supportsImages:e?.supportsImages}}return{...e,projects:t.projects,projectModelSelections:n}}case m.SetProjectsLoading:return{...e,projectsLoading:t.projectsLoading};case m.SelectThread:return{...e,selectedThreadId:t.threadId,selectedProjectId:t.projectId,messages:t.initialMessages??[],focusChatInput:t.focusInput??!1};case m.ClearSelection:return{...e,selectedThreadId:null,selectedProjectId:null,messages:[]};case m.SetMessages:return{...e,messages:t.messages};case m.AddMessage:return{...e,messages:[...e.messages,t.message]};case m.EnqueueChatMessage:return{...e,queuedChatMessages:[...e.queuedChatMessages,t.message]};case m.RemoveQueuedChatMessage:return{...e,queuedChatMessages:e.queuedChatMessages.filter(e=>e.id!==t.queuedMessageId)};case m.SetStreaming:return{...e,isStreaming:t.isStreaming};case m.AppendStreamContent:return{...e,streamingContent:e.streamingContent+t.content};case m.SetStreamContent:{let n=l(e.streamingSegments,t.content);return{...e,streamingContent:t.content,streamingSegments:n}}case m.AppendStreamThinking:return{...e,streamingThinking:e.streamingThinking+t.content};case m.AppendStreamChunk:return{...e,streamingSegments:t.segments,streamingContent:t.chunkType===`content`?e.streamingContent+t.content:e.streamingContent,streamingThinking:t.chunkType===`thinking`?e.streamingThinking+t.content:e.streamingThinking};case m.SetStreamModel:return{...e,streamingModel:t.model};case m.SetProjectModel:return console.log(`[Store] SetProjectModel action:`,{threadId:t.threadId,model:{id:t.model.id,provider:t.model.provider}}),{...e,projects:e.projects.map(e=>({...e,threads:e.threads.map(e=>e.threadId===t.threadId?{...e,model:t.model.id,modelProvider:t.model.provider}:e)})),projectModelSelections:{...e.projectModelSelections,[t.threadId]:t.model}};case m.ResetStream:return{...e,streamingContent:``,streamingThinking:``,streamingSegments:[],streamingModel:``,isStreaming:!1,toolCallProgress:{}};case m.StopStream:return{...e,isStreaming:!1};case m.ToggleSidebar:return{...e,sidebarOpen:!e.sidebarOpen};case m.SetCreatingProject:return{...e,isCreatingProject:t.isCreating};case m.ConfigUpdated:return{...e,configUpdatedAt:Date.now()};case m.SetProcessingThreads:return{...e,processingThreadIds:t.threadIds};case m.AddProcessingThread:return{...e,processingThreadIds:e.processingThreadIds.includes(t.threadId)?e.processingThreadIds:[...e.processingThreadIds,t.threadId]};case m.RemoveProcessingThread:return{...e,processingThreadIds:e.processingThreadIds.filter(e=>e!==t.threadId)};case m.AddCreatingProject:return{...e,projects:[...e.projects,{projectId:t.projectId,name:t.projectName,gitUrl:t.gitUrl,threads:[{threadId:t.threadId,title:`thread-1`,path:``,currentBranch:``}]}]};case m.AddCreatingThread:return{...e,projects:e.projects.map(e=>e.projectId===t.projectId?{...e,threads:[...e.threads,{threadId:t.threadId,title:t.title,path:``,currentBranch:``}]}:e)};case m.RemoveCreatingProject:return{...e,projects:e.projects.filter(e=>e.projectId!==t.projectId)};case m.RemoveCreatingThread:return{...e,projects:e.projects.map(e=>e.projectId===t.projectId?{...e,threads:e.threads.filter(e=>e.threadId!==t.threadId)}:e)};case m.MarkThreadCompleted:return{...e,completedThreadIds:e.completedThreadIds.includes(t.threadId)?e.completedThreadIds:[...e.completedThreadIds,t.threadId]};case m.ClearThreadCompleted:return{...e,completedThreadIds:e.completedThreadIds.filter(e=>e!==t.threadId)};case m.AddDeletingThread:return{...e,deletingThreadIds:e.deletingThreadIds.includes(t.threadId)?e.deletingThreadIds:[...e.deletingThreadIds,t.threadId]};case m.RemoveDeletingThread:return{...e,deletingThreadIds:e.deletingThreadIds.filter(e=>e!==t.threadId)};case m.AddDeletingProject:return{...e,deletingProjectIds:e.deletingProjectIds.includes(t.projectId)?e.deletingProjectIds:[...e.deletingProjectIds,t.projectId]};case m.RemoveDeletingProject:return{...e,deletingProjectIds:e.deletingProjectIds.filter(e=>e!==t.projectId)};case m.AppendCommandOutput:return{...e,commandOutput:e.commandOutput+t.content};case m.SetRunningCommand:return{...e,isRunningCommand:t.isRunning};case m.ClearCommandOutput:return{...e,commandOutput:``};case m.ToggleTerminal:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,open:!r.open}}}}case m.SetTerminalOpen:{let n=t.threadId??`default`,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,open:t.open}}}}case m.QueueTerminalCommand:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,queuedRelativeFolder:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,queuedCommand:t.command,queuedRelativeFolder:t.relativeFolder??null,open:!0}}}}case m.ClearQueuedTerminalCommand:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,queuedCommand:null}}}}case m.AppendTerminalLine:{let n=t.threadId??`default`,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,outputLines:[...r.outputLines,t.line]}}}}case m.ClearTerminalOutput:{let n=t.threadId??`default`,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,outputLines:[]}}}}case m.SetTerminalHeight:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,height:t.height}}}}case m.SetTerminalCwd:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,cwd:t.cwd}}}}case m.SetTerminalRunning:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,isRunning:t.isRunning}}}}case m.SetTerminalHistory:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,history:t.history}}}}case m.SetTerminalHistoryIndex:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,historyIndex:t.index}}}}case m.UpdateThreadTitle:return{...e,projects:e.projects.map(e=>e.projectId===t.projectId?{...e,threads:e.threads.map(e=>e.threadId===t.threadId?{...e,title:t.title}:e)}:e)};case m.ClearFocusChatInput:return{...e,focusChatInput:!1};case m.ClearMessages:return{...e,messages:[]};case m.UpdateToolCallProgress:return{...e,toolCallProgress:{...e.toolCallProgress,[t.toolCallId]:t.progress}};case m.SetPendingChatMessage:return{...e,pendingChatMessage:t.message};case m.ClearPendingChatMessage:return{...e,pendingChatMessage:null};case m.SetDiffComments:return{...e,diffComments:{...e.diffComments,[t.threadId]:t.comments}};default:return e}}var _=(0,p.createContext)({state:h,dispatch:()=>{}});function v(){return(0,p.useContext)(_)}function y(e){let t=(0,f.c)(11),{state:n,dispatch:r}=v();if(!e){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n={terminalState:{open:!1,queuedCommand:null,queuedRelativeFolder:null,outputLines:e,height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1},dispatch:b},t[1]=n):n=t[1],n}let i;t[2]!==n.terminalStates||t[3]!==e?(i=n.terminalStates[e]||{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1},t[2]=n.terminalStates,t[3]=e,t[4]=i):i=t[4];let a=i,o;t[5]!==r||t[6]!==e?(o=t=>{r({...t,threadId:e})},t[5]=r,t[6]=e,t[7]=o):o=t[7];let s=o,c;return t[8]!==s||t[9]!==a?(c={terminalState:a,dispatch:s},t[8]=s,t[9]=a,t[10]=c):c=t[10],c}function b(){}export{v as a,u as c,r as d,s as f,h as i,c as l,_ as n,y as o,i as p,g as r,d as s,m as t,l as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{
|
|
2
|
-
`);l=n.pop()??``;for(let e of n)if(e.trim())try{let t=JSON.parse(e);typeof t==`string`?p({type:c.AppendTerminalLine,line:{type:`output`,content:t}}):t.type===`error`?p({type:c.AppendTerminalLine,line:{type:`error`,content:t.message}}):t.type===`cwd`&&p({type:c.SetTerminalCwd,cwd:t.path})}catch{p({type:c.AppendTerminalLine,line:{type:`output`,content:e}})}}if(l.trim())try{let e=JSON.parse(l);typeof e==`string`?p({type:c.AppendTerminalLine,line:{type:`output`,content:e}}):e.type===`error`?p({type:c.AppendTerminalLine,line:{type:`error`,content:e.message}}):e.type===`cwd`&&p({type:c.SetTerminalCwd,cwd:e.path})}catch{p({type:c.AppendTerminalLine,line:{type:`output`,content:l}})}}catch(e){p({type:c.AppendTerminalLine,line:{type:`error`,content:e instanceof Error?e.message:`Failed to run command`}})}finally{p({type:c.SetTerminalRunning,isRunning:!1})}}},[
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{Fi as t,Wi as n,Xt as r,br as i,ra as a}from"./dialogs-config-Ofxg1Bn0.js";import{a as o,o as s,t as c}from"./store-BuY90jLM.js";import{c as l}from"./index-DIWoaAFy.js";var u=e(a(),1),d=i();function f(){let e=o().state,{selectedProjectId:i,selectedThreadId:a}=e,{terminalState:f,dispatch:p}=s(a),{queuedCommand:m,queuedRelativeFolder:h,outputLines:g,history:_,historyIndex:v,cwd:y,isRunning:b}=f,[x,S]=(0,u.useState)(``),[C,w]=(0,u.useState)([]),T=e.projects.flatMap(e=>e.threads).find(e=>e.threadId===a)?.path??null,E=!y||y===`.`||y===`./`?T:y,D=!E||E===T,{activeMainTab:O}=l(),k=(0,u.useRef)(null),A=(0,u.useRef)(null),j=(0,u.useRef)(0);(0,u.useEffect)(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[C]),(0,u.useEffect)(()=>{w(g),j.current=g.length},[a,g]),(0,u.useEffect)(()=>{if(g.length===0)w([]),j.current=0;else if(g.length>j.current){let e=g.slice(j.current);w(t=>[...t,...e]),j.current=g.length}},[g]),(0,u.useEffect)(()=>{b||A.current?.focus()},[b]),(0,u.useEffect)(()=>{O===`terminal`&&A.current?.focus()},[O]);let M=(0,u.useCallback)(async(e,t)=>{if(!(!i||!a||!e.trim())){p({type:c.AppendTerminalLine,line:{type:`input`,content:e}}),p({type:c.SetTerminalHistory,history:[e,..._.filter(t=>t!==e)].slice(0,50)}),p({type:c.SetTerminalHistoryIndex,index:-1}),S(``),p({type:c.SetTerminalRunning,isRunning:!0});try{let n=await r(i,a,e,t??void 0);if(!n){p({type:c.AppendTerminalLine,line:{type:`system`,content:`Command started but no output stream received.`}}),p({type:c.SetTerminalRunning,isRunning:!1});return}let o=n.getReader(),s=new TextDecoder,l=``;for(;;){let{done:e,value:t}=await o.read();if(e)break;l+=s.decode(t,{stream:!0});let n=l.split(`
|
|
2
|
+
`);l=n.pop()??``;for(let e of n)if(e.trim())try{let t=JSON.parse(e);typeof t==`string`?p({type:c.AppendTerminalLine,line:{type:`output`,content:t}}):t.type===`error`?p({type:c.AppendTerminalLine,line:{type:`error`,content:t.message}}):t.type===`cwd`&&p({type:c.SetTerminalCwd,cwd:t.path})}catch{p({type:c.AppendTerminalLine,line:{type:`output`,content:e}})}}if(l.trim())try{let e=JSON.parse(l);typeof e==`string`?p({type:c.AppendTerminalLine,line:{type:`output`,content:e}}):e.type===`error`?p({type:c.AppendTerminalLine,line:{type:`error`,content:e.message}}):e.type===`cwd`&&p({type:c.SetTerminalCwd,cwd:e.path})}catch{p({type:c.AppendTerminalLine,line:{type:`output`,content:l}})}}catch(e){p({type:c.AppendTerminalLine,line:{type:`error`,content:e instanceof Error?e.message:`Failed to run command`}})}finally{p({type:c.SetTerminalRunning,isRunning:!1})}}},[i,a,p,_]);return(0,u.useEffect)(()=>{m&&!b&&(M(m,h??void 0),p({type:c.ClearQueuedTerminalCommand}))},[m,h,b,p,M]),(0,d.jsxs)(`div`,{className:`flex flex-col h-full bg-neutral-950 text-neutral-200 font-mono text-sm overflow-hidden`,children:[(0,d.jsxs)(`div`,{ref:k,className:`flex-1 overflow-y-auto p-4 space-y-0.5 terminal-scrollbar`,onClick:e=>{e.target===e.currentTarget&&A.current?.focus()},children:[C.length===0&&!b&&(0,d.jsx)(`div`,{className:`text-neutral-600 italic text-xs`,children:`Enter your commands below...`}),C.map((e,t)=>(0,d.jsxs)(`div`,{className:`whitespace-pre-wrap break-all leading-6 ${e.type===`input`?`flex items-start gap-2 text-neutral-200`:e.type===`error`?`text-red-400`:e.type===`system`?`text-blue-400`:``}`,children:[e.type===`input`&&(0,d.jsx)(n,{className:`h-4 w-4 mt-1 shrink-0 text-blue-400/70`}),(0,d.jsx)(`span`,{children:e.content})]},t))]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-t border-white/5 bg-white/5`,children:[!D&&(0,d.jsx)(`span`,{className:`text-blue-400 text-xs font-bold whitespace-nowrap`,children:E.split(`/`).pop()}),(0,d.jsx)(n,{className:`h-4 w-4 text-blue-400 ${D?``:`-ml-1`}`}),(0,d.jsx)(`input`,{ref:A,type:`text`,className:`flex-1 bg-transparent border-none outline-none text-neutral-200 placeholder:text-neutral-700 h-6`,placeholder:b?`Running...`:`Type a command...`,value:x,onChange:e=>S(e.target.value),onKeyDown:e=>{if(e.key===`Enter`)M(x);else if(e.key===`ArrowUp`){e.preventDefault();let t=v+1;t<_.length&&(p({type:c.SetTerminalHistoryIndex,index:t}),S(_[t]))}else if(e.key===`ArrowDown`){e.preventDefault();let t=v-1;t>=0?(p({type:c.SetTerminalHistoryIndex,index:t}),S(_[t])):(p({type:c.SetTerminalHistoryIndex,index:-1}),S(``))}},disabled:b}),(0,d.jsxs)(`div`,{className:`flex items-center gap-1 px-1.5 py-0.5 rounded border border-white/10 bg-white/5`,children:[(0,d.jsx)(t,{className:`h-3 w-3 text-neutral-600`}),(0,d.jsx)(`span`,{className:`text-[10px] text-neutral-600 uppercase font-bold`,children:`Enter`})]})]})]})}export{f as TerminalPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{Vn as t,br as n,ra as r,ta as i}from"./dialogs-config-Ofxg1Bn0.js";var a=i(),o=e(r(),1),s=n(),c=o.forwardRef((e,n)=>{let r=(0,a.c)(9),i,o;r[0]===e?(i=r[1],o=r[2]):({className:i,...o}=e,r[0]=e,r[1]=i,r[2]=o);let c;r[3]===i?c=r[4]:(c=t(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,i),r[3]=i,r[4]=c);let l;return r[5]!==o||r[6]!==n||r[7]!==c?(l=(0,s.jsx)(`textarea`,{className:c,ref:n,...o}),r[5]=o,r[6]=n,r[7]=c,r[8]=l):l=r[8],l});c.displayName=`Textarea`;export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./dialogs-config-Ofxg1Bn0.js";import"./react-vendor-9yNfIRPs.js";import"./store-BuY90jLM.js";import"./textarea-CxhrnOOz.js";import"./history-view-CAVl9GFy.js";import{u as e}from"./index-DIWoaAFy.js";export{e as TodosView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{ra as t}from"./dialogs-config-Ofxg1Bn0.js";var n=e(t(),1),r=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},i=[`light`,`dark`],a=`(prefers-color-scheme: dark)`,o=typeof window>`u`,s=n.createContext(void 0),c={setTheme:e=>{},themes:[]},l=()=>n.useContext(s)??c,u=e=>n.useContext(s)?n.createElement(n.Fragment,null,e.children):n.createElement(f,{...e}),d=[`light`,`dark`],f=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:o=!0,storageKey:c=`theme`,themes:l=d,defaultTheme:u=r?`system`:`light`,attribute:f=`data-theme`,value:_,children:v,nonce:y,scriptProps:b})=>{let[x,S]=n.useState(()=>m(c,u)),[C,w]=n.useState(()=>x===`system`?g():x),T=_?Object.values(_):l,E=n.useCallback(e=>{let n=e;if(!n)return;e===`system`&&r&&(n=g());let a=_?_[n]:n,s=t?h(y):null,c=document.documentElement,l=e=>{e===`class`?(c.classList.remove(...T),a&&c.classList.add(a)):e.startsWith(`data-`)&&(a?c.setAttribute(e,a):c.removeAttribute(e))};if(Array.isArray(f)?f.forEach(l):l(f),o){let e=i.includes(u)?u:null,t=i.includes(n)?n:e;c.style.colorScheme=t}s?.()},[y]),D=n.useCallback(e=>{let t=typeof e==`function`?e(x):e;S(t);try{localStorage.setItem(c,t)}catch{}},[x]),O=n.useCallback(t=>{w(g(t)),x===`system`&&r&&!e&&E(`system`)},[x,e]);n.useEffect(()=>{let e=window.matchMedia(a);return e.addListener(O),O(e),()=>e.removeListener(O)},[O]),n.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?S(e.newValue):D(u))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[D]),n.useEffect(()=>{E(e??x)},[e,x]);let k=n.useMemo(()=>({theme:x,setTheme:D,forcedTheme:e,resolvedTheme:x===`system`?C:x,themes:r?[...l,`system`]:l,systemTheme:r?C:void 0}),[x,D,e,C,r,l]);return n.createElement(s.Provider,{value:k},n.createElement(p,{forcedTheme:e,storageKey:c,attribute:f,enableSystem:r,enableColorScheme:o,defaultTheme:u,value:_,themes:l,nonce:y,scriptProps:b}),v)},p=n.memo(({forcedTheme:e,storageKey:t,attribute:i,enableSystem:a,enableColorScheme:o,defaultTheme:s,value:c,themes:l,nonce:u,scriptProps:d})=>{let f=JSON.stringify([i,t,s,e,l,c,a,o]).slice(1,-1);return n.createElement(`script`,{...d,suppressHydrationWarning:!0,nonce:typeof window>`u`?u:``,dangerouslySetInnerHTML:{__html:`(${r.toString()})(${f})`}})}),m=(e,t)=>{if(o)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},h=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},g=e=>(e||=window.matchMedia(a),e.matches?`dark`:`light`);export{l as n,u as t};
|
package/dist/public/index.html
CHANGED
|
@@ -19,16 +19,17 @@
|
|
|
19
19
|
<meta name="apple-mobile-web-app-title" content="Tarsk" />
|
|
20
20
|
|
|
21
21
|
<title>Tarsk</title>
|
|
22
|
-
<script type="module" crossorigin src="/assets/index-
|
|
22
|
+
<script type="module" crossorigin src="/assets/index-DIWoaAFy.js"></script>
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dw2cE7zH.js">
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/assets/dialogs-config-
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/history-view-
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/monaco-
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/react-vendor-
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/onboarding-
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
30
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
31
|
-
<link rel="
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/dialogs-config-Ofxg1Bn0.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/history-view-CAVl9GFy.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/assets/monaco-CgzMkQ7t.js">
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/assets/react-vendor-9yNfIRPs.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/onboarding-DTzcWokE.js">
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/textarea-CxhrnOOz.js">
|
|
30
|
+
<link rel="modulepreload" crossorigin href="/assets/store-BuY90jLM.js">
|
|
31
|
+
<link rel="modulepreload" crossorigin href="/assets/utils-7CkwsQJ0.js">
|
|
32
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BVLzVjoR.css">
|
|
32
33
|
</head>
|
|
33
34
|
<body class="font-sans antialiased">
|
|
34
35
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{Nt as t,Pi as n,Rr as r,Vr as i,X as a,dn as o,er as s,li as c,wi as l}from"./dialogs-config-CB7G-sX6.js";import{a as u}from"./index-D7yQjYyf.js";var d=e(n(),1),f=s();function p(){let[e,n]=(0,d.useState)(null),[s,p]=(0,d.useState)(!0);(0,d.useEffect)(()=>{m();let e=()=>{document.visibilityState===`visible`&&m()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]);async function m(){p(!0);try{n(await a())}catch(e){u({title:`Error`,description:e instanceof Error?e.message:`Failed to load account info`,variant:`destructive`})}finally{p(!1)}}function h(){t(`https://buy.stripe.com/14AcN6feK0Jjbheb2H3Nm03?client_reference_id=${e?.clientReferenceId??``}`)}function g(){t(`https://buy.stripe.com/9B67sMd6CgIh70Y0o33Nm04?client_reference_id=${e?.clientReferenceId??``}`)}if(s)return(0,f.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,f.jsx)(i,{className:`h-5 w-5 animate-spin text-muted-foreground`})});let _=e?.plan===`unlimited-pro`;return(0,f.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,f.jsxs)(`div`,{className:`mb-6`,children:[(0,f.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Account`}),(0,f.jsx)(`p`,{className:`text-muted-foreground`,children:`Manage your Tarsk plan and prompt balance.`})]}),(0,f.jsxs)(`div`,{className:`space-y-6`,children:[(0,f.jsxs)(`div`,{className:`flex gap-4`,children:[(0,f.jsxs)(`div`,{className:`flex-1 rounded-xl border bg-card p-5 space-y-2`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-muted-foreground`,children:[(0,f.jsx)(r,{className:`h-4 w-4`}),`Balance`]}),(0,f.jsx)(`div`,{className:`flex items-end gap-2`,children:_?(0,f.jsx)(`span`,{className:`text-3xl font-bold`,children:`Unlimited`}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`span`,{className:`text-3xl font-bold`,children:e?.promptsRemaining.toLocaleString()??0}),(0,f.jsx)(`span`,{className:`text-muted-foreground mb-1 text-sm`,children:`prompts remaining`})]})})]}),(0,f.jsxs)(`div`,{className:`flex-1 rounded-xl border bg-card p-5 space-y-3`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-muted-foreground`,children:[(0,f.jsx)(c,{className:`h-4 w-4`}),`Current Plan`]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsx)(`span`,{className:`text-lg font-semibold`,children:_?`Unlimited Pro`:`Pay as you go`}),_&&(0,f.jsx)(`span`,{className:`rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary`,children:`Active`})]}),(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:_?`You have unlimited prompts with no restrictions.`:`Purchase prompts as needed. Upgrade to Pro for unlimited access.`})]})]}),!_&&(0,f.jsxs)(`div`,{className:`space-y-3`,children:[(0,f.jsx)(`h2`,{className:`text-sm font-semibold text-muted-foreground uppercase tracking-wide`,children:`Add Prompts`}),(0,f.jsxs)(`div`,{className:`rounded-xl border bg-card p-5 flex items-center justify-between gap-4`,children:[(0,f.jsxs)(`div`,{className:`space-y-1`,children:[(0,f.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,f.jsx)(`span`,{className:`font-semibold`,children:`1,000 Prompts`})}),(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Top up your balance with 1,000 additional prompts for $5.`})]}),(0,f.jsx)(o,{onClick:h,className:`shrink-0`,children:`Top Up Balance`})]}),(0,f.jsxs)(`div`,{className:`rounded-xl border bg-card p-5 flex items-center justify-between gap-4`,children:[(0,f.jsxs)(`div`,{className:`space-y-1`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsx)(c,{className:`h-4 w-4 text-primary`}),(0,f.jsx)(`span`,{className:`font-semibold`,children:`Unlimited Pro Plan`})]}),(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Unlimited prompts for $100 and lifetime access to Tarsk.`}),(0,f.jsxs)(`ul`,{className:`text-sm text-muted-foreground space-y-0.5`,children:[(0,f.jsxs)(`li`,{className:`flex items-center gap-1.5`,children:[(0,f.jsx)(l,{className:`h-3 w-3 text-primary`}),`Unlimited prompts`]}),(0,f.jsxs)(`li`,{className:`flex items-center gap-1.5`,children:[(0,f.jsx)(l,{className:`h-3 w-3 text-primary`}),`Priority access`]})]})]}),(0,f.jsx)(o,{onClick:g,className:`shrink-0`,children:`Purchase`})]})]})]})]})}export{p as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{I as t,Pi as n,Vr as r,c as i,dn as a,er as o,l as s,xi as c}from"./dialogs-config-CB7G-sX6.js";import"./react-vendor-CR4cAsbx.js";import"./history-view-D-hEB6Qt.js";import{a as l,c as u}from"./index-D7yQjYyf.js";import{n as d,t as f}from"./radio-group-BpmnaKJk.js";var p=e(n(),1),m=o();function h({threadId:e,onAgentCreated:n}){let[o,h]=(0,p.useState)(``),[g,_]=(0,p.useState)(``),[v,y]=(0,p.useState)(``),[b,x]=(0,p.useState)(`local`),[S,C]=(0,p.useState)(!1),w=o.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),T=w.length>0&&w.length<=64;return e?(0,m.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,m.jsxs)(`div`,{className:`mb-6`,children:[(0,m.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Agent`}),(0,m.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new subagent. The agent will be saved as an AGENT.md file in the .agents/agents folder.`})]}),(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(s,{htmlFor:`agentName`,children:`Agent Name`}),(0,m.jsx)(i,{id:`agentName`,value:o,onChange:e=>h(e.target.value),placeholder:`e.g. Security Reviewer`,disabled:S}),o&&(0,m.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Folder name: `,(0,m.jsx)(`span`,{className:`font-mono`,children:w||`...`})]})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(s,{htmlFor:`agentDescription`,children:`Description`}),(0,m.jsx)(u,{id:`agentDescription`,value:g,onChange:e=>_(e.target.value),placeholder:`Describe what this agent does and when it should be invoked`,className:`resize-none min-h-[120px]`,disabled:S})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(s,{htmlFor:`agentTools`,children:`Allowed Tools (optional)`}),(0,m.jsx)(i,{id:`agentTools`,value:v,onChange:e=>y(e.target.value),placeholder:`e.g. read grep glob`,disabled:S}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Space-separated list of tools this agent can use. Leave empty to allow all coding tools.`})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(s,{children:`Scope`}),(0,m.jsxs)(f,{value:b,onValueChange:e=>x(e),className:`flex gap-4`,disabled:S,children:[(0,m.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,m.jsx)(d,{value:`local`,id:`scope-local`}),(0,m.jsx)(s,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,m.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,m.jsx)(d,{value:`global`,id:`scope-global`,disabled:!0}),(0,m.jsx)(s,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b===`local`?`This agent will only be available for this project.`:`This agent will be available across all projects (coming soon).`})]}),(0,m.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,m.jsx)(a,{onClick:async()=>{if(!(!T||!g.trim()||!e)){C(!0);try{let r=await t(e,w,g.trim(),v.trim()||void 0);l({title:`Agent created`,description:`Agent '${w}' was created successfully.`}),h(``),_(``),y(``),x(`local`),n?.(r.path,`AGENT.md`)}catch(e){l({title:`Error`,description:e instanceof Error?e.message:`Failed to create agent`,variant:`destructive`})}finally{C(!1)}}},disabled:!T||!g.trim()||S,children:S?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(r,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,m.jsxs)(m.Fragment,{children:[`Continue`,(0,m.jsx)(c,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,m.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,m.jsxs)(`div`,{className:`text-center`,children:[(0,m.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Thread Selected`}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a thread to add an agent.`})]})})}export{h as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{Mi as t,Pi as n,Ut as r,Vr as i,c as a,dn as o,er as s,l as c,xi as l,xn as u}from"./dialogs-config-CB7G-sX6.js";import{i as d,r as f}from"./react-vendor-CR4cAsbx.js";import"./history-view-D-hEB6Qt.js";import{a as p,c as m}from"./index-D7yQjYyf.js";import{n as h,t as g}from"./radio-group-BpmnaKJk.js";var _=t(),v=e(n(),1),y=s(),b=v.forwardRef((e,t)=>{let n=(0,_.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,y.jsx)(d,{className:u(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,y.jsx)(f,{className:a,...i,ref:t,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});b.displayName=f.displayName;function x({threadId:e,onRuleCreated:t}){let[n,s]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,_]=(0,v.useState)(!1),[x,S]=(0,v.useState)(`local`),[C,w]=(0,v.useState)(!1),T=n.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),E=T.length>0&&T.length<=64;return e?(0,y.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,y.jsxs)(`div`,{className:`mb-6`,children:[(0,y.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Rule`}),(0,y.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new agent rule. The rule will be saved as a .md file in the .agents/rules folder.`})]}),(0,y.jsxs)(`div`,{className:`space-y-6`,children:[(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsx)(c,{htmlFor:`ruleName`,children:`Rule Name`}),(0,y.jsx)(a,{id:`ruleName`,value:n,onChange:e=>s(e.target.value),placeholder:`e.g. Code Style Guide`,disabled:C}),n&&(0,y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`File name: `,(0,y.jsxs)(`span`,{className:`font-mono`,children:[T||`...`,`.md`]})]})]}),(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsx)(c,{htmlFor:`ruleDescription`,children:`Description`}),(0,y.jsx)(m,{id:`ruleDescription`,value:u,onChange:e=>d(e.target.value),placeholder:`Describe when Tarsk should apply this rule...`,className:`resize-none min-h-[120px]`,disabled:C})]}),(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,y.jsx)(c,{htmlFor:`alwaysApply`,children:`Always Apply`}),(0,y.jsx)(b,{id:`alwaysApply`,checked:f,onCheckedChange:_,disabled:C})]}),(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f?`This rule will be automatically added to context for all conversations.`:`Only the rule description will be added to context, allowing the agent to read the rule file when needed.`})]}),(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsx)(c,{children:`Scope`}),(0,y.jsxs)(g,{value:x,onValueChange:e=>S(e),className:`flex gap-4`,disabled:C,children:[(0,y.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,y.jsx)(h,{value:`local`,id:`scope-local`}),(0,y.jsx)(c,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,y.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,y.jsx)(h,{value:`global`,id:`scope-global`,disabled:!0}),(0,y.jsx)(c,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:x===`local`?`This rule will only be available for this project.`:`This rule will be available across all projects (coming soon).`})]}),(0,y.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,y.jsx)(o,{onClick:async()=>{if(!(!E||!e)){w(!0);try{let n=`---
|
|
2
|
-
description: ${u.trim()}
|
|
3
|
-
alwaysApply: ${f}
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Place your rule instructions here as markdown.
|
|
7
|
-
`;await r(e,`.agents/rules/${T}.md`,n),p({title:`Rule created`,description:`Rule '${T}' was created successfully.`}),s(``),d(``),_(!1),S(`local`),t?.(T)}catch(e){p({title:`Error`,description:e instanceof Error?e.message:`Failed to create rule`,variant:`destructive`})}finally{w(!1)}}},disabled:!E||!u.trim()||C,children:C?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(i,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,y.jsxs)(y.Fragment,{children:[`Continue`,(0,y.jsx)(l,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,y.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,y.jsxs)(`div`,{className:`text-center`,children:[(0,y.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Thread Selected`}),(0,y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a thread to add a rule.`})]})})}export{x as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{L as t,Pi as n,Vr as r,c as i,dn as a,er as o,l as s,xi as c}from"./dialogs-config-CB7G-sX6.js";import"./react-vendor-CR4cAsbx.js";import"./history-view-D-hEB6Qt.js";import{a as l,c as u}from"./index-D7yQjYyf.js";import{n as d,t as f}from"./radio-group-BpmnaKJk.js";var p=e(n(),1),m=o();function h({threadId:e,onSkillCreated:n}){let[o,h]=(0,p.useState)(``),[g,_]=(0,p.useState)(``),[v,y]=(0,p.useState)(`local`),[b,x]=(0,p.useState)(!1),S=o.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),C=S.length>0&&S.length<=64;return e?(0,m.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,m.jsxs)(`div`,{className:`mb-6`,children:[(0,m.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Skill`}),(0,m.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new agent skill. The skill will be saved as a SKILL.md file in the .agents/skills folder.`})]}),(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(s,{htmlFor:`skillName`,children:`Skill Name`}),(0,m.jsx)(i,{id:`skillName`,value:o,onChange:e=>h(e.target.value),placeholder:`e.g. Code Review`,disabled:b}),o&&(0,m.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Folder name: `,(0,m.jsx)(`span`,{className:`font-mono`,children:S||`...`})]})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(s,{htmlFor:`skillDescription`,children:`Description`}),(0,m.jsx)(u,{id:`skillDescription`,value:g,onChange:e=>_(e.target.value),placeholder:`Describe when Tarsk should apply this skill`,className:`resize-none min-h-[120px]`,disabled:b})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(s,{children:`Scope`}),(0,m.jsxs)(f,{value:v,onValueChange:e=>y(e),className:`flex gap-4`,disabled:b,children:[(0,m.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,m.jsx)(d,{value:`local`,id:`scope-local`}),(0,m.jsx)(s,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,m.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,m.jsx)(d,{value:`global`,id:`scope-global`,disabled:!0}),(0,m.jsx)(s,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:v===`local`?`This skill will only be available for this project.`:`This skill will be available across all projects (coming soon).`})]}),(0,m.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,m.jsx)(a,{onClick:async()=>{if(!(!C||!g.trim()||!e)){x(!0);try{let r=await t(e,S,g.trim());l({title:`Skill created`,description:`Skill '${S}' was created successfully.`}),h(``),_(``),y(`local`),n?.(r.path,`SKILL.md`)}catch(e){l({title:`Error`,description:e instanceof Error?e.message:`Failed to create skill`,variant:`destructive`})}finally{x(!1)}}},disabled:!C||!g.trim()||b,children:b?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(r,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,m.jsxs)(m.Fragment,{children:[`Continue`,(0,m.jsx)(c,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,m.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,m.jsxs)(`div`,{className:`text-center`,children:[(0,m.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Thread Selected`}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a thread to add a skill.`})]})})}export{h as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{P as t,Pi as n,Vr as r,c as i,dn as a,er as o,l as s,xi as c}from"./dialogs-config-CB7G-sX6.js";import"./react-vendor-CR4cAsbx.js";import"./history-view-D-hEB6Qt.js";import{a as l}from"./index-D7yQjYyf.js";import{n as u,t as d}from"./radio-group-BpmnaKJk.js";var f=e(n(),1),p=o();function m({projectId:e,threadId:n,onCommandCreated:o}){let[m,h]=(0,f.useState)(``),[g,_]=(0,f.useState)(``),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(`default`),[S,C]=(0,f.useState)(`local`),[w,T]=(0,f.useState)(!1),E=m.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),D=E.length>0&&E.length<=64;return e?(0,p.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,p.jsxs)(`div`,{className:`mb-6`,children:[(0,p.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Slash Command`}),(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new slash command. The command will be saved as a .md file in the ~/.agents/commands folder.`})]}),(0,p.jsxs)(`div`,{className:`space-y-6`,children:[(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(s,{htmlFor:`commandName`,children:`Command Name`}),(0,p.jsx)(i,{id:`commandName`,value:m,onChange:e=>h(e.target.value),placeholder:`e.g. review`,disabled:w}),m&&(0,p.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Command: `,(0,p.jsxs)(`span`,{className:`font-mono`,children:[`/`,E||`...`]})]})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(s,{htmlFor:`commandDescription`,children:`Description`}),(0,p.jsx)(i,{id:`commandDescription`,value:g,onChange:e=>_(e.target.value),placeholder:`Brief description shown in autocomplete`,disabled:w})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(s,{htmlFor:`argumentHint`,children:`Argument Hint (optional)`}),(0,p.jsx)(i,{id:`argumentHint`,value:v,onChange:e=>y(e.target.value),placeholder:`e.g. <focus-area> or <branch-name>`,disabled:w}),(0,p.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Shows after the command name to guide users what to type`})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(s,{children:`Mode`}),(0,p.jsxs)(d,{value:b,onValueChange:e=>x(e),className:`flex gap-4`,disabled:w,children:[(0,p.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,p.jsx)(u,{value:`default`,id:`mode-default`}),(0,p.jsx)(s,{htmlFor:`mode-default`,className:`font-normal cursor-pointer`,children:`Default`})]}),(0,p.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,p.jsx)(u,{value:`plan`,id:`mode-plan`}),(0,p.jsx)(s,{htmlFor:`mode-plan`,className:`font-normal cursor-pointer`,children:`Plan`})]})]}),(0,p.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b===`default`?`Standard chat mode`:`Activates plan mode when this command is used`})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(s,{children:`Scope`}),(0,p.jsxs)(d,{value:S,onValueChange:e=>C(e),className:`flex gap-4`,disabled:w,children:[(0,p.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,p.jsx)(u,{value:`local`,id:`scope-local`}),(0,p.jsx)(s,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,p.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,p.jsx)(u,{value:`global`,id:`scope-global`,disabled:!0}),(0,p.jsx)(s,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,p.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:S===`local`?`This command will only be available for this project.`:`This command will be available across all projects (coming soon).`})]}),(0,p.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,p.jsx)(a,{onClick:async()=>{if(!(!D||!e)){T(!0);try{await t(E,``,{description:g.trim()||void 0,argumentHint:v.trim()||void 0,mode:b===`plan`?`plan`:void 0},S===`global`?`global`:`project`,n??void 0),l({title:`Command created`,description:`Command '/${E}' was created successfully.`}),h(``),_(``),y(``),x(`default`),C(`local`),o?.(E)}catch(e){l({title:`Error`,description:e instanceof Error?e.message:`Failed to create command`,variant:`destructive`})}finally{T(!1)}}},disabled:!D||w,children:w?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(r,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,p.jsxs)(p.Fragment,{children:[`Continue`,(0,p.jsx)(c,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,p.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,p.jsxs)(`div`,{className:`text-center`,children:[(0,p.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Project Selected`}),(0,p.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a project to add a slash command.`})]})})}export{m as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./dialogs-config-CB7G-sX6.js";import{t as e}from"./history-view-D-hEB6Qt.js";export{e as ConversationHistoryView,e as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{Fr as t,Mi as n,Or as r,Pi as i,Qr as a,Rr as o,Si as s,Vr as c,Z as l,Zr as u,bn as d,cn as f,dn as p,ei as m,er as h,gn as g,hn as _,in as v,kr as y,q as b,rt as x,vn as S,vt as C,xi as w,xn as T,yn as E,zr as D}from"./dialogs-config-CB7G-sX6.js";import{n as O}from"./react-vendor-CR4cAsbx.js";import{a as k,t as A}from"./store-CxlaVYZ6.js";import{c as j,s as M,u as N}from"./history-view-D-hEB6Qt.js";import{n as P}from"./utils-DVGxCyLB.js";import"./onboarding-CxK4aR2J.js";import{_ as ee,c as F,l as te,n as ne,o as re,r as ie,v as ae}from"./index-D7yQjYyf.js";import"./monaco-Cp3BWanQ.js";import{t as oe}from"./side-panel-resizer-CVC2NC75.js";var I=e(i(),1),L=n(),R=h();function z(e){let t=(0,L.c)(17),{children:n,title:r,headerAction:i,footer:a}=e,o;t[0]===r?o=t[1]:(o=r&&(0,R.jsx)(`span`,{className:`text-sm font-semibold tracking-tight`,children:r}),t[0]=r,t[1]=o);let s;t[2]===o?s=t[3]:(s=(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:o}),t[2]=o,t[3]=s);let c;t[4]===i?c=t[5]:(c=i&&(0,R.jsx)(`div`,{className:`flex items-center gap-2 ml-auto`,children:i}),t[4]=i,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-b border-sidebar-border px-4 py-6`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]===n?u=t[10]:(u=(0,R.jsx)(f,{className:`flex-1`,children:n}),t[9]=n,t[10]=u);let d;t[11]===a?d=t[12]:(d=a&&(0,R.jsx)(`div`,{className:`border-t border-sidebar-border`,children:a}),t[11]=a,t[12]=d);let p;return t[13]!==l||t[14]!==u||t[15]!==d?(p=(0,R.jsxs)(`div`,{className:`flex flex-col h-full`,children:[l,u,d]}),t[13]=l,t[14]=u,t[15]=d,t[16]=p):p=t[16],p}function se(e){let t=[],n={};return e.forEach((e,r)=>{let i=e.path.split(`/`),a=t,o=``;for(let e=0;e<i.length-1;e++){if(o=o?`${o}/${i[e]}`:i[e],!n[o]){let t={id:`dir:${o}`,name:i[e],children:[]};n[o]=t,a.push(t)}a=n[o].children}a.push({id:`file:${e.path}`,name:i[i.length-1],fileIndex:r,status:e.status})}),t}var B={added:`text-green-500`,deleted:`text-red-500`,untracked:`text-green-500`,renamed:`text-blue-500`,modified:`text-orange-500`},V={added:`A`,deleted:`D`,untracked:`U`,renamed:`R`,modified:`M`};function ce(e){return T(`status-badge font-mono text-xs font-semibold`,B[e]??`text-orange-500`)}function H(e){return V[e]??`M`}function le(e){let t=(0,L.c)(35),{treeData:n,files:r,isLoading:i,error:o,selectedFileIndex:s,onFileSelect:l}=e,d;t[0]===r?d=t[1]:(d=r.reduce(K,0),t[0]=r,t[1]=d);let f=d,p;t[2]===r?p=t[3]:(p=r.reduce(U,0),t[2]=r,t[3]=p);let h=p,g=r.length===1?``:`s`,_;t[4]!==r.length||t[5]!==g?(_=(0,R.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[r.length,` file`,g]}),t[4]=r.length,t[5]=g,t[6]=_):_=t[6];let v;t[7]===f?v=t[8]:(v=(0,R.jsxs)(`span`,{className:`text-xs text-green-500`,children:[`+`,f]}),t[7]=f,t[8]=v);let y;t[9]===h?y=t[10]:(y=(0,R.jsxs)(`span`,{className:`text-xs text-red-500`,children:[`-`,h]}),t[9]=h,t[10]=y);let b;t[11]!==_||t[12]!==v||t[13]!==y?(b=(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[_,v,y]}),t[11]=_,t[12]=v,t[13]=y,t[14]=b):b=t[14];let x=b;if(i){let e;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,R.jsx)(`div`,{className:`flex-1 flex items-center justify-center pt-3 pb-2`,children:(0,R.jsx)(c,{className:`h-6 w-6 animate-spin text-muted-foreground`})}),t[15]=e):e=t[15];let n;return t[16]===x?n=t[17]:(n=(0,R.jsx)(z,{title:`Review Changes`,headerAction:x,children:e}),t[16]=x,t[17]=n),n}if(o){let e;t[18]===o?e=t[19]:(e=(0,R.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-4 pt-7 pb-2`,children:(0,R.jsx)(`p`,{className:`text-destructive text-xs text-center`,children:o})}),t[18]=o,t[19]=e);let n;return t[20]!==x||t[21]!==e?(n=(0,R.jsx)(z,{title:`Review Changes`,headerAction:x,children:e}),t[20]=x,t[21]=e,t[22]=n):n=t[22],n}if(r.length===0){let e;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,R.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-4 pt-7 pb-2`,children:(0,R.jsx)(`p`,{className:`text-muted-foreground text-xs text-center`,children:`No changes to review`})}),t[23]=e):e=t[23];let n;return t[24]===x?n=t[25]:(n=(0,R.jsx)(z,{title:`Review Changes`,headerAction:x,children:e}),t[24]=x,t[25]=n),n}let S;t[26]!==l||t[27]!==s?(S=(e,t)=>{let{isOpen:n,toggle:r}=t,i=!!e.children;return(0,R.jsxs)(ee,{onClick:()=>{i?r():e.fileIndex!==void 0&&l(e.fileIndex)},selected:!i&&e.fileIndex===s,className:`gap-1.5`,children:[i?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(w,{className:T(`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform`,n&&`rotate-90`)}),n?(0,R.jsx)(a,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}):(0,R.jsx)(u,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`})]}):(0,R.jsx)(m,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,R.jsx)(`span`,{className:`truncate flex-1 min-w-0`,children:e.name}),!i&&e.status&&(0,R.jsx)(`span`,{className:ce(e.status),children:H(e.status)})]})},t[26]=l,t[27]=s,t[28]=S):S=t[28];let C;t[29]!==S||t[30]!==n?(C=(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto pt-3 pb-2 px-1`,children:(0,R.jsx)(ae,{nodes:n,defaultOpen:!0,resetKey:n,indent:16,childContainerClassName:`ml-4 border-l border-sidebar-border pl-2`,renderNode:S})}),t[29]=S,t[30]=n,t[31]=C):C=t[31];let E;return t[32]!==x||t[33]!==C?(E=(0,R.jsx)(z,{title:`Review Changes`,headerAction:x,children:C}),t[32]=x,t[33]=C,t[34]=E):E=t[34],E}function U(e,t){return e+t.hunks.reduce(W,0)}function W(e,t){return e+t.changes.filter(G).length}function G(e){return e.type===`delete`}function K(e,t){return e+t.hunks.reduce(q,0)}function q(e,t){return e+t.changes.filter(ue).length}function ue(e){return e.type===`add`}function de(e){let t=(0,L.c)(35),{open:n,lineNumber:r,lineContent:i,initialComment:a,isEditing:o,onSave:s,onDelete:c,onClose:l}=e,[u,f]=(0,I.useState)((a===void 0?``:a)??``),m;t[0]!==s||t[1]!==u?(m=()=>{u.trim()&&s(u.trim())},t[0]=s,t[1]=u,t[2]=m):m=t[2];let h=m,v;t[3]===h?v=t[4]:(v=e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),h())},t[3]=h,t[4]=v);let y=v,b;t[5]===l?b=t[6]:(b=e=>{e||l()},t[5]=l,t[6]=b);let x;t[7]===r?x=t[8]:(x=(0,R.jsx)(E,{children:(0,R.jsxs)(d,{className:`text-sm font-medium`,children:[`Comment on line `,r]})}),t[7]=r,t[8]=x);let C=i||` `,w;t[9]===C?w=t[10]:(w=(0,R.jsx)(`div`,{className:`rounded bg-muted px-3 py-2 font-mono text-xs text-muted-foreground overflow-x-auto whitespace-pre`,children:C}),t[9]=C,t[10]=w);let T;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>f(e.target.value),t[11]=T):T=t[11];let D;t[12]!==y||t[13]!==u?(D=(0,R.jsx)(F,{autoFocus:!0,placeholder:`Add a comment... (Cmd+Enter to save)`,value:u,onChange:T,onKeyDown:y,rows:12,className:`resize-none text-sm`}),t[12]=y,t[13]=u,t[14]=D):D=t[14];let O;t[15]!==o||t[16]!==c?(O=o&&c&&(0,R.jsx)(p,{variant:`destructive`,size:`sm`,onClick:c,className:`mr-auto`,children:`Delete`}),t[15]=o,t[16]=c,t[17]=O):O=t[17];let k;t[18]===u?k=t[19]:(k=u.trim(),t[18]=u,t[19]=k);let A=!k,j;t[20]!==h||t[21]!==A?(j=(0,R.jsx)(p,{size:`sm`,onClick:h,disabled:A,children:`Save`}),t[20]=h,t[21]=A,t[22]=j):j=t[22];let M;t[23]!==O||t[24]!==j?(M=(0,R.jsxs)(S,{className:`gap-2 sm:gap-0`,children:[O,j]}),t[23]=O,t[24]=j,t[25]=M):M=t[25];let N;t[26]!==M||t[27]!==x||t[28]!==w||t[29]!==D?(N=(0,R.jsxs)(g,{className:`max-w-2xl`,children:[x,w,D,M]}),t[26]=M,t[27]=x,t[28]=w,t[29]=D,t[30]=N):N=t[30];let P;return t[31]!==n||t[32]!==N||t[33]!==b?(P=(0,R.jsx)(_,{open:n,onOpenChange:b,children:N}),t[31]=n,t[32]=N,t[33]=b,t[34]=P):P=t[34],P}function J({threadId:e,onExit:n}){let{state:i,dispatch:a}=k(),{resolvedTheme:c}=P(),[u,d]=(0,I.useState)([]),[f,m]=(0,I.useState)(!0),[h,g]=(0,I.useState)(null),[_,S]=(0,I.useState)(0),[E,ee]=(0,I.useState)(!1),[F,ae]=(0,I.useState)(!1),L=(0,I.useRef)(null),z=(0,I.useMemo)(()=>i.diffComments[e]??[],[i.diffComments,e]),B=(0,I.useCallback)(t=>{let n=i.diffComments[e]??[],r=typeof t==`function`?t(n):t;a({type:A.SetDiffComments,threadId:e,comments:r})},[a,e,i.diffComments]),[V,ce]=(0,I.useState)(null),[H,U]=(0,I.useState)(null),[W,G]=(0,I.useState)(null),K=(0,I.useRef)(null),q=(0,I.useRef)(z),ue=(0,I.useRef)(V),J=(0,I.useRef)({isFullView:E,selectedFileIndex:_,files:u}),Y=(0,I.useRef)({original:[],modified:[]}),fe=(0,I.useRef)(!0);(0,I.useEffect)(()=>{q.current=z},[z]),(0,I.useEffect)(()=>{ue.current=V},[V]),(0,I.useEffect)(()=>{J.current={isFullView:E,selectedFileIndex:_,files:u}},[E,_,u]);let pe=(0,I.useCallback)(()=>{L.current&&(F?L.current.expand():L.current.collapse())},[F]),me=(0,I.useCallback)(async()=>{if(e){m(!0),g(null);try{d((await x(e)).files||[]),S(0)}catch(e){g(e instanceof Error?e.message:`Failed to load diff`)}finally{m(!1)}}},[e]);(0,I.useEffect)(()=>{me()},[me]);let X=(0,I.useRef)(!1);(0,I.useEffect)(()=>{if((i.diffComments[e]??[]).length>0){X.current=!0;return}C(e).then(t=>{t.diffComments&&t.diffComments.length>0&&a({type:A.SetDiffComments,threadId:e,comments:t.diffComments}),X.current=!0}).catch(()=>{X.current=!0})},[e]),(0,I.useEffect)(()=>{X.current&&v(e,{diffComments:z}).catch(()=>{})},[e,z]);let he=(0,I.useMemo)(()=>se(u),[u]),Z=e=>{if(e.hunks.length===0)return null;let t=1/0,n=0;return e.hunks.forEach(e=>{let r=Math.min(e.oldStart,e.newStart),i=e.oldStart+e.oldLines,a=e.newStart+e.newLines,o=Math.max(i,a);t=Math.min(t,r),n=Math.max(n,o)}),t===1/0?null:{startLine:Math.max(1,t-2),endLine:n+2}},ge=(e,t,n)=>e.split(`
|
|
2
|
-
`).slice(t-1,n).join(`
|
|
3
|
-
`),_e=e=>{let t=Z(e);return t?t.startLine<=1:!0},ve=e=>({ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,json:`json`,md:`markdown`,css:`css`,scss:`scss`,html:`html`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,cpp:`cpp`,h:`c`,hpp:`cpp`,sh:`shell`,yaml:`yaml`,yml:`yaml`,xml:`xml`,sql:`sql`})[e.split(`.`).pop()??``]||`plaintext`,Q=u[_],ye=Q?E?Q.oldContent:(()=>{let e=Z(Q);return e?ge(Q.oldContent,e.startLine,e.endLine):Q.oldContent})():``,be=Q?E?Q.newContent:(()=>{let e=Z(Q);return e?ge(Q.newContent,e.startLine,e.endLine):Q.newContent})():``,$=(0,I.useCallback)(()=>{if(!fe.current)return;let e=K.current;if(!e)return;let{isFullView:t,selectedFileIndex:n,files:r}=J.current,i=q.current,a=ue.current,o=r[n];if(!o)return;let s=(e,r)=>{let s=t?null:Z(o),c=i.filter(e=>e.fileIndex===n&&e.side===r).map(e=>{let t=s?e.lineNumber-s.startLine+1:e.lineNumber;if(t<1)return null;let n=i.indexOf(e)===a;return{range:{startLineNumber:t,startColumn:1,endLineNumber:t,endColumn:1},options:{isWholeLine:!0,className:n?`diff-comment-active-line`:`diff-comment-marked-line`,glyphMarginHoverMessage:{value:e.comment}}}}).filter(e=>e!==null),l=r===`original`?Y.current.original:Y.current.modified,u=e.deltaDecorations(l,c);r===`original`?Y.current.original=u:Y.current.modified=u};s(e.getOriginalEditor(),`original`),s(e.getModifiedEditor(),`modified`)},[]);(0,I.useEffect)(()=>{$()},[$,z,V,_,E,Q]),(0,I.useEffect)(()=>()=>{K.current=null,Y.current={original:[],modified:[]}},[_]),(0,I.useEffect)(()=>()=>{fe.current=!1,K.current=null,Y.current={original:[],modified:[]}},[]);let xe=(0,I.useCallback)(e=>{K.current=e;let t=(e,t)=>{e.onMouseDown(n=>{if(!n.target?.position)return;let r=n.target.position.lineNumber,{isFullView:i,selectedFileIndex:a,files:o}=J.current,s=o[a];if(!s)return;let c=i?null:Z(s),l=c?c.startLine+r-1:r,u=e.getModel()?.getLineContent(r)??``,d=q.current.find(e=>e.fileIndex===a&&e.lineNumber===l&&e.side===t);d?G(d):U({lineNumber:l,lineContent:u,side:t})})};t(e.getOriginalEditor(),`original`),t(e.getModifiedEditor(),`modified`),setTimeout(()=>{K.current===e&&$()},150)},[$]),Se=(0,I.useCallback)(e=>{if(H&&Q){let t={id:`comment-${Date.now()}`,filePath:Q.path,fileIndex:_,lineNumber:H.lineNumber,lineContent:H.lineContent,comment:e,side:H.side};B(e=>[...e,t]),U(null)}else W&&(B(t=>t.map(t=>t.id===W.id?{...t,comment:e}:t)),G(null))},[H,W,Q,_,B]),Ce=(0,I.useCallback)(()=>{W&&(B(e=>e.filter(e=>e.id!==W.id)),G(null))},[W,B]),we=(0,I.useCallback)(e=>{if(z.length===0)return;let t=(e%z.length+z.length)%z.length,n=z[t];ce(t),S(n.fileIndex),setTimeout(()=>{let e=K.current;if(!e)return;let t=u[n.fileIndex];if(!t)return;let r=E?null:Z(t),i=r?n.lineNumber-r.startLine+1:n.lineNumber;(n.side===`original`?e.getOriginalEditor():e.getModifiedEditor()).revealLineInCenter(Math.max(1,i)),$()},100)},[z,u,E,$]),Te=(0,I.useCallback)(()=>{we((V??0)-1)},[we,V]),Ee=(0,I.useCallback)(()=>{we((V??-1)+1)},[we,V]),De=(0,I.useCallback)(async()=>{let t=i.projectModelSelections[e];if(!t)try{let e=await l(),n=Object.values(e).flat();if(n.length>0)t=n[0];else{console.error(`No models available to process comments`);return}}catch(e){console.error(`Failed to load models:`,e);return}let r=t.id,o=t.provider;try{let{prompt:t}=await b(e,z);B([]),a({type:A.SetPendingChatMessage,message:{threadId:e,message:t,model:r,provider:o}}),n()}catch(e){console.error(`Failed to fix comments:`,e),typeof window<`u`&&window.alert(`Failed to process comments. Please try again.`)}},[z,i.projectModelSelections,a,e,n,B]),Oe={readOnly:!0,renderSideBySide:!0,ignoreTrimWhitespace:!1,renderOverviewRuler:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},folding:!1,lineNumbers:Q&&(E||_e(Q))?`on`:`off`,diffWordWrap:`on`,originalEditable:!1,automaticLayout:!0,theme:c===`dark`?`vs-dark`:`vs-light`};return(0,R.jsxs)(`div`,{className:`diff-view-root flex h-full flex-col`,children:[(0,R.jsx)(`div`,{className:`diff-body flex flex-1 overflow-hidden`,children:(0,R.jsxs)(ie,{direction:`horizontal`,children:[(0,R.jsx)(ne,{className:`overflow-hidden bg-transparent`,children:(0,R.jsxs)(`div`,{className:`diff-editor-panel flex h-full bg-transparent flex-col overflow-hidden`,children:[(0,R.jsxs)(re,{className:T(`bg-transparent`,F&&`h-auto py-3 flex-col items-start gap-3 md:flex-row md:items-center md:h-[71px] md:py-0 md:gap-2 justify-between`),children:[(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,R.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:Q?Q.path:`Review Changes`})}),(0,R.jsxs)(`div`,{className:T(`flex items-center gap-2`,F&&`ml-0`,!F&&`ml-auto`,`md:ml-auto`),children:[(0,R.jsx)(p,{variant:`ghost`,size:`sm`,onClick:()=>ee(e=>!e),disabled:!Q,className:`h-8 gap-1 px-2 text-xs`,children:E?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(t,{className:`h-3 w-3`}),` Show changes only`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(D,{className:`h-3 w-3`}),` Show full file`]})}),z.length>0&&(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(M,{children:[(0,R.jsx)(N,{asChild:!0,children:(0,R.jsx)(p,{variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-full`,onClick:Te,disabled:(V??0)===0,children:(0,R.jsx)(s,{className:`h-3 w-3`})})}),(0,R.jsx)(j,{children:`Previous comment`})]}),(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:z.length===1?`1 Comment`:`Comment ${(V??0)+1} of ${z.length}`}),(0,R.jsxs)(M,{children:[(0,R.jsx)(N,{asChild:!0,children:(0,R.jsx)(p,{variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-full`,onClick:Ee,disabled:(V??0)===z.length-1,children:(0,R.jsx)(w,{className:`h-3 w-3`})})}),(0,R.jsx)(j,{children:`Next comment`})]})]}),z.length>0&&(0,R.jsxs)(M,{children:[(0,R.jsx)(N,{asChild:!0,children:(0,R.jsxs)(p,{size:`sm`,onClick:De,className:`h-8 gap-1 px-3 text-xs bg-foreground text-background hover:bg-foreground/90`,children:[(0,R.jsx)(o,{className:`h-3 w-3`}),`Fix all comments`]})}),(0,R.jsx)(j,{children:`Send all comments to Tarsk for resolution`})]}),(0,R.jsxs)(p,{variant:`ghost`,size:`icon`,className:`h-8 w-8 text-muted-foreground shrink-0`,onClick:pe,children:[F?(0,R.jsx)(r,{className:`h-4 w-4`}):(0,R.jsx)(y,{className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Toggle file tree`})]})]})]}),(0,R.jsxs)(`div`,{className:`flex-1 bg-transparent relative`,children:[(0,R.jsx)(O,{height:`100%`,language:ve(Q?.path||``),original:ye,modified:be,onMount:xe,options:Oe},`diff-${_}`),(0,R.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0`,children:(0,R.jsx)(te,{})})]})]})}),(0,R.jsx)(oe,{isOpen:!F}),(0,R.jsx)(ne,{ref:L,defaultSize:25,minSize:12,maxSize:40,collapsible:!0,collapsedSize:0,onCollapse:()=>ae(!0),onExpand:()=>ae(!1),className:`border-l border-transparent ml-[40px]`,children:(0,R.jsx)(`div`,{className:`h-full overflow-hidden`,children:(0,R.jsx)(le,{treeData:he,files:u,isLoading:f,error:h,selectedFileIndex:_,onFileSelect:S})})})]})}),(0,R.jsx)(de,{open:H!==null||W!==null,lineNumber:W?.lineNumber??H?.lineNumber??0,lineContent:W?.lineContent??H?.lineContent??``,initialComment:W?.comment,isEditing:W!==null,onSave:Se,onDelete:Ce,onClose:()=>{U(null),G(null)}},`${W?.id??``}-${H?.lineNumber??``}-${H?.side??``}`)]})}export{J as DiffView,J as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{Ci as t,Mi as n,Pi as r,Qr as i,Ti as a,U as o,Vr as s,Zr as c,bt as l,dn as u,ei as d,er as f,fr as p,wr as m,xi as h}from"./dialogs-config-CB7G-sX6.js";import{X as g}from"./react-vendor-CR4cAsbx.js";import{c as _,l as v,s as y,u as b}from"./history-view-D-hEB6Qt.js";import{_ as x,a as S,d as C,f as w,g as T,h as E,m as D,p as O}from"./index-D7yQjYyf.js";var k=e(r(),1),A=n(),j=f();function M(e){let t=(0,A.c)(19),{open:n,onOpenChange:r,folderName:i,folderPath:a,threadId:s,onDeleteComplete:c}=e,l;t[0]!==i||t[1]!==a||t[2]!==c||t[3]!==r||t[4]!==s?(l=async()=>{try{await o(s,a),c(a),r(!1),S({title:`Success`,description:`Folder "${i}" deleted.`})}catch(e){let t=e;S({title:`Error`,description:t instanceof Error?t.message:`Failed to delete folder`,variant:`destructive`})}},t[0]=i,t[1]=a,t[2]=c,t[3]=r,t[4]=s,t[5]=l):l=t[5];let u=l,d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,j.jsx)(T,{children:`Delete Folder`}),t[6]=d):d=t[6];let f;t[7]===i?f=t[8]:(f=(0,j.jsxs)(E,{children:[`Are you sure you want to delete "`,i,`" and all files inside it? This action cannot be undone.`]}),t[7]=i,t[8]=f);let p;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,j.jsx)(O,{children:`Cancel`}),t[9]=p):p=t[9];let m;t[10]===u?m=t[11]:(m=(0,j.jsxs)(`div`,{className:`flex gap-3 justify-end`,children:[p,(0,j.jsx)(w,{onClick:u,className:`bg-red-600 hover:bg-red-700`,children:`Delete`})]}),t[10]=u,t[11]=m);let h;t[12]!==f||t[13]!==m?(h=(0,j.jsxs)(D,{children:[d,f,m]}),t[12]=f,t[13]=m,t[14]=h):h=t[14];let g;return t[15]!==r||t[16]!==n||t[17]!==h?(g=(0,j.jsx)(C,{open:n,onOpenChange:r,children:h}),t[15]=r,t[16]=n,t[17]=h,t[18]=g):g=t[18],g}function N(e){let n=(0,A.c)(76),{node:r,selectedPath:o,level:s,openFolders:l,onToggleFolder:f,onSelectFile:g,onAddSkill:S,onAddRule:C,onAddCommand:w,onAddAgent:T,onDeleteFolder:E,onDeleteFile:D,threadId:O}=e,P;n[0]!==r.id||n[1]!==l?(P=l.has(r.id),n[0]=r.id,n[1]=l,n[2]=P):P=n[2];let F=P,I=o===r.path,[L,R]=(0,k.useState)(!1),z=r.path===`.agents/skills`,B=r.path===`.agents/rules`,V=r.path===`.agents/commands`,H=r.path===`.agents/agents`;if(r.type===`folder`){let e;n[3]!==r.id||n[4]!==f?(e=e=>{e.stopPropagation(),f(r.id)},n[3]=r.id,n[4]=f,n[5]=e):e=n[5];let a,d;n[6]===F?(a=n[7],d=n[8]):(a=(0,j.jsx)(`span`,{className:`text-muted-foreground w-3 flex-shrink-0`,children:F?(0,j.jsx)(t,{className:`h-3 w-3`}):(0,j.jsx)(h,{className:`h-3 w-3`})}),d=F?(0,j.jsx)(i,{className:`h-4 w-4 flex-shrink-0`}):(0,j.jsx)(c,{className:`h-4 w-4 flex-shrink-0`}),n[6]=F,n[7]=a,n[8]=d);let k=`flex-1 truncate ${r.virtual?`text-muted-foreground italic`:``}`,A;n[9]!==r.name||n[10]!==k?(A=(0,j.jsx)(`span`,{className:k,children:r.name}),n[9]=r.name,n[10]=k,n[11]=A):A=n[11];let P;n[12]!==H||n[13]!==V||n[14]!==B||n[15]!==z||n[16]!==T||n[17]!==w||n[18]!==C||n[19]!==S?(P=(z||B||V||H)&&(0,j.jsx)(v,{children:(0,j.jsxs)(y,{children:[(0,j.jsx)(b,{asChild:!0,children:(0,j.jsx)(u,{variant:`action`,size:`icon-sm`,className:`shrink-0 opacity-0 group-hover:opacity-100`,onClick:e=>{e.stopPropagation(),z?S():B?C():V?w():H&&T()},children:(0,j.jsx)(m,{})})}),(0,j.jsx)(_,{children:z?`Add skill`:B?`Add rule`:V?`Add command`:`Add agent`})]})}),n[12]=H,n[13]=V,n[14]=B,n[15]=z,n[16]=T,n[17]=w,n[18]=C,n[19]=S,n[20]=P):P=n[20];let I;n[21]!==H||n[22]!==V||n[23]!==B||n[24]!==z?(I=!z&&!B&&!V&&!H&&(0,j.jsx)(v,{children:(0,j.jsxs)(y,{children:[(0,j.jsx)(b,{asChild:!0,children:(0,j.jsx)(u,{variant:`action`,size:`icon-sm`,className:`shrink-0 opacity-0 group-hover:opacity-100`,onClick:e=>{e.stopPropagation(),R(!0)},children:(0,j.jsx)(p,{})})}),(0,j.jsx)(_,{children:`Delete folder`})]})}),n[21]=H,n[22]=V,n[23]=B,n[24]=z,n[25]=I):I=n[25];let U;n[26]!==s||n[27]!==e||n[28]!==a||n[29]!==d||n[30]!==A||n[31]!==P||n[32]!==I?(U=(0,j.jsxs)(x,{level:s,basePadding:10,onClick:e,children:[a,d,A,P,I]}),n[26]=s,n[27]=e,n[28]=a,n[29]=d,n[30]=A,n[31]=P,n[32]=I,n[33]=U):U=n[33];let W;n[34]!==F||n[35]!==s||n[36]!==r.children||n[37]!==T||n[38]!==w||n[39]!==C||n[40]!==S||n[41]!==D||n[42]!==E||n[43]!==g||n[44]!==f||n[45]!==l||n[46]!==o||n[47]!==O?(W=F&&r.children&&(0,j.jsx)(`div`,{className:`ml-8 border-l border-sidebar-border`,children:r.children.map(e=>(0,j.jsx)(N,{node:e,selectedPath:o,level:s+1,openFolders:l,onToggleFolder:f,onSelectFile:g,onAddSkill:S,onAddRule:C,onAddCommand:w,onAddAgent:T,onDeleteFolder:E,onDeleteFile:D,threadId:O},e.id))}),n[34]=F,n[35]=s,n[36]=r.children,n[37]=T,n[38]=w,n[39]=C,n[40]=S,n[41]=D,n[42]=E,n[43]=g,n[44]=f,n[45]=l,n[46]=o,n[47]=O,n[48]=W):W=n[48];let G;n[49]!==r.name||n[50]!==r.path||n[51]!==E||n[52]!==L||n[53]!==O?(G=(0,j.jsx)(M,{open:L,onOpenChange:R,folderName:r.name,folderPath:r.path,threadId:O,onDeleteComplete:E}),n[49]=r.name,n[50]=r.path,n[51]=E,n[52]=L,n[53]=O,n[54]=G):G=n[54];let K;return n[55]!==W||n[56]!==G||n[57]!==U?(K=(0,j.jsxs)(`div`,{children:[U,W,G]}),n[55]=W,n[56]=G,n[57]=U,n[58]=K):K=n[58],K}let U;n[59]!==r||n[60]!==g?(U=e=>{e.stopPropagation(),g(r)},n[59]=r,n[60]=g,n[61]=U):U=n[61];let W;n[62]===r.path?W=n[63]:(W=r.path===`AGENTS.md`?(0,j.jsx)(a,{className:`h-4 w-4 flex-shrink-0`}):(0,j.jsx)(d,{className:`h-4 w-4 flex-shrink-0`}),n[62]=r.path,n[63]=W);let G=r.path===`AGENTS.md`?`Instructions`:r.name,K;n[64]===G?K=n[65]:(K=(0,j.jsx)(`span`,{className:`flex-1 truncate`,children:G}),n[64]=G,n[65]=K);let q;n[66]!==r||n[67]!==D?(q=r.path.endsWith(`.md`)&&(0,j.jsx)(v,{children:(0,j.jsxs)(y,{children:[(0,j.jsx)(b,{asChild:!0,children:(0,j.jsx)(u,{variant:`action`,size:`icon-sm`,className:`shrink-0 opacity-0 group-hover:opacity-100`,onClick:e=>{e.stopPropagation(),D(r)},children:(0,j.jsx)(p,{})})}),(0,j.jsx)(_,{children:`Delete file`})]})}),n[66]=r,n[67]=D,n[68]=q):q=n[68];let J;return n[69]!==I||n[70]!==s||n[71]!==U||n[72]!==W||n[73]!==K||n[74]!==q?(J=(0,j.jsxs)(x,{level:s,basePadding:22,selected:I,onClick:U,children:[W,K,q]}),n[69]=I,n[70]=s,n[71]=U,n[72]=W,n[73]=K,n[74]=q,n[75]=J):J=n[75],J}function P({threadId:e,selectedPath:t,onFileSelect:n,className:r,expandPath:i,onAddSkill:a,onAddCommand:c,onAddRule:u,onAddAgent:d}){let f=g(),[p,m]=(0,k.useState)([]),[h,_]=(0,k.useState)(!1),[v,y]=(0,k.useState)(new Set),[b,x]=(0,k.useState)(!1),C=(0,k.useCallback)(async()=>{if(e){_(!0);try{m(await l(e)),y(new Set),x(!0)}catch(e){S({title:`Error`,description:e instanceof Error?e.message:`Failed to load files`,variant:`destructive`})}finally{_(!1)}}},[e]);(0,k.useEffect)(()=>{C()},[C]),(0,k.useEffect)(()=>{!b||!i||!p.length||y(e=>{let t=new Set(e),n=i.substring(0,i.lastIndexOf(`/`));if(n){let e=n.split(`/`),r=``;for(let n of e){r=r?`${r}/${n}`:n;let e=p.find(e=>e.path===r&&e.type===`folder`);e&&t.add(e.id)}}return t})},[i,b,p]);let w=(0,k.useCallback)(e=>{y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),T=(0,k.useCallback)(()=>{a?a():f(`/settings/add-skill`)},[f,a]),E=(0,k.useCallback)(()=>{u?u():f(`/settings/add-rule?threadId=${e}`,{replace:!0})},[f,e,u]),D=(0,k.useCallback)(()=>{c?c():f(`/settings/add-command`)},[f,c]),O=(0,k.useCallback)(()=>{d?d():f(`/settings/add-agent`)},[f,d]),A=(0,k.useCallback)(e=>{C()},[C]),M=(0,k.useCallback)(async t=>{try{await o(e,t.path),S({title:`File deleted`,description:`${t.path===`AGENTS.md`?`Instructions`:t.name} has been deleted successfully.`}),C()}catch(e){S({title:`Error`,description:e instanceof Error?e.message:`Failed to delete file`,variant:`destructive`})}},[e,C]);return(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(`div`,{className:`h-full overflow-y-auto py-2 ${r}`,children:h?(0,j.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,j.jsx)(s,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):p.map(r=>(0,j.jsx)(N,{node:r,selectedPath:t,level:0,openFolders:v,onToggleFolder:w,onSelectFile:n,onAddSkill:T,onAddRule:E,onAddCommand:D,onAddAgent:O,onDeleteFolder:A,onDeleteFile:M,threadId:e},r.id))})})}export{P as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-view-BYzQiRVC.js","assets/rolldown-runtime-Dw2cE7zH.js","assets/index-D7yQjYyf.js","assets/react-vendor-CR4cAsbx.js","assets/history-view-D-hEB6Qt.js","assets/dialogs-config-CB7G-sX6.js","assets/monaco-Cp3BWanQ.js","assets/onboarding-CxK4aR2J.js","assets/store-CxlaVYZ6.js","assets/utils-DVGxCyLB.js","assets/index-DVHw8RF4.css","assets/mcp-manager-J9VCn8-1.js","assets/mcp-server-edit-view-yd_q5UVd.js","assets/mcp-servers-sidebar-Bwg40dY8.js","assets/files-view-C1vg37wD.js","assets/file-tree-sidebar-D58ROyfi.js","assets/add-skill-view-D63xCrVn.js","assets/radio-group-BpmnaKJk.js","assets/add-slash-command-view-paJjkCml.js","assets/add-rule-view-xKAYGOl5.js","assets/add-agent-view-Ctbm0EgW.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{Mi as t,Pi as n,cn as r,er as i}from"./dialogs-config-CB7G-sX6.js";import{$ as a}from"./react-vendor-CR4cAsbx.js";import{a as ee}from"./store-CxlaVYZ6.js";import{n as o,r as s}from"./index-D7yQjYyf.js";import{t as te}from"./side-panel-resizer-CVC2NC75.js";var c=t(),l=e(n(),1),u=i(),d=(0,l.lazy)(()=>a(()=>import(`./mcp-view-BYzQiRVC.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),ne=(0,l.lazy)(()=>a(()=>import(`./mcp-server-edit-view-yd_q5UVd.js`),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]))),re=(0,l.lazy)(()=>a(()=>import(`./mcp-servers-sidebar-Bwg40dY8.js`),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11]))),ie=(0,l.lazy)(()=>a(()=>import(`./files-view-C1vg37wD.js`),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10]))),ae=(0,l.lazy)(()=>a(()=>import(`./file-tree-sidebar-D58ROyfi.js`),__vite__mapDeps([15,1,2,3,4,5,6,7,8,9,10]))),oe=(0,l.lazy)(()=>a(()=>import(`./add-skill-view-D63xCrVn.js`),__vite__mapDeps([16,1,2,3,4,5,6,7,8,9,10,17]))),f=(0,l.lazy)(()=>a(()=>import(`./add-slash-command-view-paJjkCml.js`),__vite__mapDeps([18,1,2,3,4,5,6,7,8,9,10,17]))),p=(0,l.lazy)(()=>a(()=>import(`./add-rule-view-xKAYGOl5.js`),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,17]))),m=(0,l.lazy)(()=>a(()=>import(`./add-agent-view-Ctbm0EgW.js`),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,17])));function h(e){let t=(0,c.c)(5),{title:n}=e,r;t[0]===n?r=t[1]:(r=(0,u.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:n}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,u.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Content coming soon...`}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,u.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,u.jsxs)(`div`,{className:`text-center`,children:[r,i]})}),t[3]=r,t[4]=a),a}function g(){let e=(0,c.c)(56),{state:t}=ee(),n=(0,l.useRef)(null),[i,a]=(0,l.useState)(!1),[g,_]=(0,l.useState)(`files`),[v,fe]=(0,l.useState)(null),[y,b]=(0,l.useState)(0),[x,pe]=(0,l.useState)(0),[S,C]=(0,l.useState)(void 0),w;if(e[0]!==t.projects||e[1]!==t.selectedProjectId){let n;e[3]===t.selectedProjectId?n=e[4]:(n=e=>e.projectId===t.selectedProjectId,e[3]=t.selectedProjectId,e[4]=n),w=t.projects.find(n),e[0]=t.projects,e[1]=t.selectedProjectId,e[2]=w}else w=e[2];let T=w,E=t.selectedProjectId,D;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{C(e),_(`mcp-server-edit`)},e[5]=D):D=e[5];let O=D,k;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{C(void 0),_(`mcp-server-edit`)},e[6]=k):k=e[6];let A=k,j;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>{pe(de)},e[7]=j):j=e[7];let M=j,N;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{fe(e),_(`files`)},e[8]=N):N=e[8];let P=N,F,I,L,R,z,B,V,H,U;e[9]!==g||e[10]!==S||e[11]!==i||e[12]!==E||e[13]!==v||e[14]!==T?.projectPath||e[15]!==t.selectedThreadId?(R=`flex h-full flex-col overflow-hidden`,I=s,U=`horizontal`,L=`flex-1 overflow-hidden`,F=o,H=`overflow-hidden`,V=`flex h-full flex-col overflow-hidden`,z=`flex-1 overflow-hidden`,B=(()=>{switch(g){case`mcp-server-edit`:return(0,u.jsx)(l.Suspense,{fallback:(0,u.jsx)(h,{title:`Edit MCP Server`}),children:(0,u.jsx)(ne,{projectPath:T?.projectPath,serverName:S,onBack:()=>{M(),_(`mcp-servers`)}})});case`mcp-servers`:return(0,u.jsx)(l.Suspense,{fallback:(0,u.jsx)(h,{title:`MCP Servers`}),children:(0,u.jsx)(d,{sidebarRef:n,isSidebarCollapsed:i,onServersChange:M})});case`files`:return(0,u.jsx)(l.Suspense,{fallback:(0,u.jsx)(h,{title:`Files`}),children:(0,u.jsx)(ie,{selectedFile:v,onFileSelect:P})});case`add-skill`:return(0,u.jsx)(l.Suspense,{fallback:(0,u.jsx)(h,{title:`Add Skill`}),children:(0,u.jsx)(oe,{threadId:t.selectedThreadId,onSkillCreated:(e,t)=>{let n={id:e,name:t,type:`file`,path:e};b(ue),P(n)}})});case`add-command`:return(0,u.jsx)(l.Suspense,{fallback:(0,u.jsx)(h,{title:`Add Command`}),children:(0,u.jsx)(f,{projectId:E,threadId:t.selectedThreadId,onCommandCreated:e=>{let t=`.agents/commands/${e}.md`,n={id:t,name:`${e}.md`,path:t,type:`file`,virtual:!1};b(le),P(n)}})});case`add-rule`:return(0,u.jsx)(l.Suspense,{fallback:(0,u.jsx)(h,{title:`Add Rule`}),children:(0,u.jsx)(p,{threadId:t.selectedThreadId,onRuleCreated:e=>{let t=`.agents/rules/${e}.md`,n={id:t,name:`${e}.md`,path:t,type:`file`,virtual:!1};b(ce),P(n)}})});case`add-agent`:return(0,u.jsx)(l.Suspense,{fallback:(0,u.jsx)(h,{title:`Add Agent`}),children:(0,u.jsx)(m,{threadId:t.selectedThreadId,onAgentCreated:(e,t)=>{let n={id:e,name:t,type:`file`,path:e};b(se),P(n)}})});default:return(0,u.jsx)(h,{title:`Files`})}})(),e[9]=g,e[10]=S,e[11]=i,e[12]=E,e[13]=v,e[14]=T?.projectPath,e[15]=t.selectedThreadId,e[16]=F,e[17]=I,e[18]=L,e[19]=R,e[20]=z,e[21]=B,e[22]=V,e[23]=H,e[24]=U):(F=e[16],I=e[17],L=e[18],R=e[19],z=e[20],B=e[21],V=e[22],H=e[23],U=e[24]);let W;e[25]!==z||e[26]!==B?(W=(0,u.jsx)(`div`,{className:z,children:B}),e[25]=z,e[26]=B,e[27]=W):W=e[27];let G;e[28]!==W||e[29]!==V?(G=(0,u.jsx)(`div`,{className:V,children:W}),e[28]=W,e[29]=V,e[30]=G):G=e[30];let K;e[31]!==F||e[32]!==G||e[33]!==H?(K=(0,u.jsx)(F,{className:H,children:G}),e[31]=F,e[32]=G,e[33]=H,e[34]=K):K=e[34];let q=!i,J;e[35]===q?J=e[36]:(J=(0,u.jsx)(te,{isOpen:q}),e[35]=q,e[36]=J);let Y,X;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(Y=()=>a(!0),X=()=>a(!1),e[37]=Y,e[38]=X):(Y=e[37],X=e[38]);let Z;e[39]!==y||e[40]!==x||e[41]!==E||e[42]!==v?.path||e[43]!==T?.projectPath||e[44]!==t.selectedThreadId?(Z=(0,u.jsx)(o,{ref:n,defaultSize:25,minSize:12,maxSize:40,collapsible:!0,collapsedSize:0,onCollapse:Y,onExpand:X,className:`border-l border-transparent ml-[40px]`,children:(0,u.jsx)(`div`,{className:`h-full overflow-hidden`,children:(0,u.jsx)(r,{className:`h-full`,children:(0,u.jsx)(`div`,{className:`px-2 py-2 space-y-3`,children:E?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(l.Suspense,{fallback:(0,u.jsx)(`div`,{className:`animate-pulse h-4 bg-muted rounded`}),children:(0,u.jsx)(re,{projectPath:T?.projectPath,onAddServer:A,onEditServer:O,onViewMCPServers:()=>_(`mcp-servers`),refreshKey:x})}),(0,u.jsx)(l.Suspense,{fallback:(0,u.jsx)(`div`,{className:`animate-pulse h-4 bg-muted rounded`}),children:(0,u.jsx)(ae,{threadId:t.selectedThreadId??``,selectedPath:v?.path??null,expandPath:v?.path??null,onFileSelect:P,onAddSkill:()=>_(`add-skill`),onAddCommand:()=>_(`add-command`),onAddRule:()=>_(`add-rule`),onAddAgent:()=>_(`add-agent`)},y)})]}):(0,u.jsx)(`p`,{className:`px-2 py-4 text-xs text-muted-foreground text-center`,children:`No project selected.`})})})})}),e[39]=y,e[40]=x,e[41]=E,e[42]=v?.path,e[43]=T?.projectPath,e[44]=t.selectedThreadId,e[45]=Z):Z=e[45];let Q;e[46]!==I||e[47]!==L||e[48]!==K||e[49]!==J||e[50]!==Z||e[51]!==U?(Q=(0,u.jsxs)(I,{direction:U,className:L,children:[K,J,Z]}),e[46]=I,e[47]=L,e[48]=K,e[49]=J,e[50]=Z,e[51]=U,e[52]=Q):Q=e[52];let $;return e[53]!==R||e[54]!==Q?($=(0,u.jsx)(`div`,{className:R,children:Q}),e[53]=R,e[54]=Q,e[55]=$):$=e[55],$}function se(e){return e+1}function ce(e){return e+1}function le(e){return e+1}function ue(e){return e+1}function de(e){return e+1}export{g as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{Pi as t,Ut as n,Vr as r,dn as i,er as a,ti as o,yt as s}from"./dialogs-config-CB7G-sX6.js";import{Q as c,Y as l,t as u}from"./react-vendor-CR4cAsbx.js";import{a as d}from"./store-CxlaVYZ6.js";import{n as f}from"./utils-DVGxCyLB.js";import{a as p,o as m}from"./index-D7yQjYyf.js";import"./monaco-Cp3BWanQ.js";var h=e(t(),1),g=a();function _(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,json:`json`,md:`markdown`,mdc:`markdown`,css:`css`,scss:`scss`,html:`html`,py:`python`,sh:`shell`,yaml:`yaml`,yml:`yaml`,xml:`xml`,sql:`sql`}[e.split(`.`).pop()??``]??`plaintext`}function v({selectedFile:e,onFileSelect:t}){let{state:a}=d(),{resolvedTheme:v}=f(),y=l(),[b]=c(),x=a.selectedThreadId,[S,C]=(0,h.useState)(``),[w,T]=(0,h.useState)(``),[E,D]=(0,h.useState)(!1),[O,k]=(0,h.useState)(!1);(0,h.useEffect)(()=>{let e=b.get(`skill`);if(e&&x){t({id:e,name:`SKILL.md`,type:`file`,path:e});let n=new URLSearchParams(b);n.delete(`skill`);let r=`${y.pathname}${n.toString()?`?${n.toString()}`:``}`;window.history.replaceState({},``,r)}},[b,x,t,y.pathname]);let A=async()=>{if(!(!x||!e)){k(!0);try{await n(x,e.path,S),T(S),p({title:`Saved`,description:`${e.path===`AGENTS.md`?`Instructions`:e.name} saved successfully.`})}catch(e){p({title:`Error`,description:e instanceof Error?e.message:`Failed to save file`,variant:`destructive`})}finally{k(!1)}}},j=(0,h.useCallback)(async e=>{if(x){D(!0);try{let t=await s(x,e.path);C(t.content),T(t.content)}catch(e){p({title:`Error`,description:e instanceof Error?e.message:`Failed to load file`,variant:`destructive`})}finally{D(!1)}}},[x]);return(0,h.useEffect)(()=>{e&&x?j(e):(C(``),T(``))},[e,x,j]),x?(0,g.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,g.jsxs)(m,{className:`justify-between`,children:[(0,g.jsxs)(`div`,{className:`flex flex-col`,children:[(0,g.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e?e.path===`AGENTS.md`?`Instructions`:e.name:`Select a file to edit`}),(0,g.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e?e.path:`Browse and edit agent skills, rules, commands, and markdown files`})]}),e&&(0,g.jsx)(`div`,{className:`flex gap-1`,children:(0,g.jsxs)(i,{size:`sm`,onClick:()=>void A(),disabled:O||!S||S===w,children:[O?(0,g.jsx)(r,{className:`h-4 w-4 animate-spin`}):null,`Save`]})})]}),(0,g.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:(0,g.jsx)(`div`,{className:`h-full relative overflow-hidden`,children:E?(0,g.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,g.jsx)(r,{className:`h-6 w-6 animate-spin text-muted-foreground`})}):e?(0,g.jsx)(u,{height:`100%`,language:_(e.path),value:S,onChange:e=>C(e??``),theme:v===`dark`?`vs-dark`:`vs-light`,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,automaticLayout:!0,fontSize:13,lineNumbers:`on`,renderLineHighlight:`line`,scrollbar:{vertical:`auto`,horizontal:`auto`}}}):(0,g.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center p-8`,children:[(0,g.jsx)(o,{className:`h-10 w-10 text-muted-foreground/50`}),(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:`No file selected`}),(0,g.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`Select a file from the tree to edit it`})]})]})})})]}):(0,g.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center`,children:[(0,g.jsx)(o,{className:`h-8 w-8 text-muted-foreground`}),(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Select a thread to browse its AI files`})]})}export{v as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{$n as t,Bn as n,Ci as r,Gn as i,In as a,Jn as o,Kn as s,Ln as c,Mi as l,Ni as u,Pi as d,Qn as f,Rn as p,Si as m,Un as h,Vn as g,Xn as _,Yn as v,Zn as y,a as b,bi as x,cn as S,dn as C,er as w,hi as T,i as E,ln as D,m as O,nr as k,o as A,or as j,rr as M,s as N,tt as ee,ui as te,un as ne,wi as re,xi as P,xn as F,zn as ie}from"./dialogs-config-CB7G-sX6.js";var ae=[`top`,`right`,`bottom`,`left`],I=Math.min,L=Math.max,oe=Math.round,se=Math.floor,R=e=>({x:e,y:e}),ce={left:`right`,right:`left`,bottom:`top`,top:`bottom`},le={start:`end`,end:`start`};function ue(e,t,n){return L(e,I(t,n))}function z(e,t){return typeof e==`function`?e(t):e}function B(e){return e.split(`-`)[0]}function de(e){return e.split(`-`)[1]}function fe(e){return e===`x`?`y`:`x`}function pe(e){return e===`y`?`height`:`width`}var me=new Set([`top`,`bottom`]);function V(e){return me.has(B(e))?`y`:`x`}function he(e){return fe(V(e))}function ge(e,t,n){n===void 0&&(n=!1);let r=de(e),i=he(e),a=pe(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Te(o)),[o,Te(o)]}function _e(e){let t=Te(e);return[ve(e),t,ve(t)]}function ve(e){return e.replace(/start|end/g,e=>le[e])}var ye=[`left`,`right`],be=[`right`,`left`],xe=[`top`,`bottom`],Se=[`bottom`,`top`];function Ce(e,t,n){switch(e){case`top`:case`bottom`:return n?t?be:ye:t?ye:be;case`left`:case`right`:return t?xe:Se;default:return[]}}function we(e,t,n,r){let i=de(e),a=Ce(B(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ve)))),a}function Te(e){return e.replace(/left|right|bottom|top/g,e=>ce[e])}function Ee(e){return{top:0,right:0,bottom:0,left:0,...e}}function De(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ee(e)}function Oe(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ke(e,t,n){let{reference:r,floating:i}=e,a=V(t),o=he(t),s=pe(o),c=B(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(de(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Ae(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=z(t,e),p=De(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Oe(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Oe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var je=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ke(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:{...o,detectOverflow:o.detectOverflow??Ae},elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=ke(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}},Me=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=z(e,t)||{};if(l==null)return{};let d=De(u),f={x:n,y:r},p=he(i),m=pe(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=I(d[_],T),D=I(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=ue(O,A,k),M=!c.arrow&&de(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Ne=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=z(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=B(r),_=V(o),v=B(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Te(o)]:_e(o)),x=p!==`none`;!d&&x&&b.push(...we(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ge(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==V(t))||T.every(e=>V(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=V(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Pe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Fe(e){return ae.some(t=>e[t]>=0)}var Ie=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=z(e,t);switch(i){case`referenceHidden`:{let e=Pe(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Fe(e)}}}case`escaped`:{let e=Pe(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Fe(e)}}}default:return{}}}}},Le=new Set([`left`,`top`]);async function Re(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=B(n),s=de(n),c=V(n)===`y`,l=Le.has(o)?-1:1,u=a&&c?-1:1,d=z(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ze=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Re(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Be=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=z(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=V(B(i)),p=fe(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=ue(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=ue(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Ve=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=z(e,t),u={x:n,y:r},d=V(i),f=fe(d),p=u[f],m=u[d],h=z(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Le.has(B(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},He=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=z(e,t),u=await o.detectOverflow(t,l),d=B(i),f=de(i),p=V(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=I(h-u[g],v),x=I(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=L(u.left,0),t=L(u.right,0),n=L(u.top,0),r=L(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:L(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:L(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Ue(){return typeof window<`u`}function We(e){return Ge(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((Ge(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ge(e){return Ue()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return Ue()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return Ue()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function Ke(e){return!Ue()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}var qe=new Set([`inline`,`contents`]);function Je(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=K(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!qe.has(i)}var Ye=new Set([`table`,`td`,`th`]);function Xe(e){return Ye.has(We(e))}var Ze=[`:popover-open`,`:modal`];function Qe(e){return Ze.some(t=>{try{return e.matches(t)}catch{return!1}})}var $e=[`transform`,`translate`,`scale`,`rotate`,`perspective`],et=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],tt=[`paint`,`layout`,`strict`,`content`];function nt(e){let t=it(),n=W(e)?K(e):e;return $e.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||et.some(e=>(n.willChange||``).includes(e))||tt.some(e=>(n.contain||``).includes(e))}function rt(e){let t=q(e);for(;G(t)&&!ot(t);){if(nt(t))return t;if(Qe(t))return null;t=q(t)}return null}function it(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var at=new Set([`html`,`body`,`#document`]);function ot(e){return at.has(We(e))}function K(e){return H(e).getComputedStyle(e)}function st(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function q(e){if(We(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ke(e)&&e.host||U(e);return Ke(t)?t.host:t}function ct(e){let t=q(e);return ot(t)?e.ownerDocument?e.ownerDocument.body:e.body:G(t)&&Je(t)?t:ct(t)}function lt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ct(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=ut(a);return t.concat(a,a.visualViewport||[],Je(r)?r:[],e&&n?lt(e):[])}return t.concat(r,lt(r,[],n))}function ut(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dt(e){let t=K(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=oe(n)!==a||oe(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ft(e){return W(e)?e:e.contextElement}function pt(e){let t=ft(e);if(!G(t))return R(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=dt(t),o=(a?oe(n.width):n.width)/r,s=(a?oe(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var mt=R(0);function ht(e){let t=H(e);return!it()||!t.visualViewport?mt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==H(e)?!1:t}function _t(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ft(e),o=R(1);t&&(r?W(r)&&(o=pt(r)):o=pt(e));let s=gt(a,n,r)?ht(a):R(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=H(a),t=r&&W(r)?H(r):r,n=e,i=ut(n);for(;i&&r&&t!==n;){let e=pt(i),t=i.getBoundingClientRect(),r=K(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=ut(n)}}return Oe({width:u,height:d,x:c,y:l})}function vt(e,t){let n=st(e).scrollLeft;return t?t.left+n:_t(U(e)).left+n}function yt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-vt(e,n),y:n.top+t.scrollTop}}function bt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?Qe(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=R(1),u=R(0),d=G(r);if((d||!d&&!a)&&((We(r)!==`body`||Je(o))&&(c=st(r)),G(r))){let e=_t(r);l=pt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?yt(o,c):R(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function xt(e){return Array.from(e.getClientRects())}function St(e){let t=U(e),n=st(e),r=e.ownerDocument.body,i=L(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=L(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+vt(e),s=-n.scrollTop;return K(r).direction===`rtl`&&(o+=L(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ct=25;function wt(e,t){let n=H(e),r=U(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=it();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=vt(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Ct&&(a-=o)}else l<=Ct&&(a+=l);return{width:a,height:o,x:s,y:c}}var Tt=new Set([`absolute`,`fixed`]);function Et(e,t){let n=_t(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=G(e)?pt(e):R(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Dt(e,t,n){let r;if(t===`viewport`)r=wt(e,n);else if(t===`document`)r=St(U(e));else if(W(t))r=Et(t,n);else{let n=ht(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Oe(r)}function Ot(e,t){let n=q(e);return n===t||!W(n)||ot(n)?!1:K(n).position===`fixed`||Ot(n,t)}function kt(e,t){let n=t.get(e);if(n)return n;let r=lt(e,[],!1).filter(e=>W(e)&&We(e)!==`body`),i=null,a=K(e).position===`fixed`,o=a?q(e):e;for(;W(o)&&!ot(o);){let t=K(o),n=nt(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Tt.has(i.position)||Je(o)&&!n&&Ot(e,o))?r=r.filter(e=>e!==o):i=t,o=q(o)}return t.set(e,r),r}function At(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Qe(t)?[]:kt(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Dt(t,n,i);return e.top=L(r.top,e.top),e.right=I(r.right,e.right),e.bottom=I(r.bottom,e.bottom),e.left=L(r.left,e.left),e},Dt(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function jt(e){let{width:t,height:n}=dt(e);return{width:t,height:n}}function Mt(e,t,n){let r=G(t),i=U(t),a=n===`fixed`,o=_t(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=R(0);function l(){c.x=vt(i)}if(r||!r&&!a)if((We(t)!==`body`||Je(i))&&(s=st(t)),r){let e=_t(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?yt(i,s):R(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Nt(e){return K(e).position===`static`}function Pt(e,t){if(!G(e)||K(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function Ft(e,t){let n=H(e);if(Qe(e))return n;if(!G(e)){let t=q(e);for(;t&&!ot(t);){if(W(t)&&!Nt(t))return t;t=q(t)}return n}let r=Pt(e,t);for(;r&&Xe(r)&&Nt(r);)r=Pt(r,t);return r&&ot(r)&&Nt(r)&&!nt(r)?n:r||rt(e)||n}var It=async function(e){let t=this.getOffsetParent||Ft,n=this.getDimensions,r=await n(e.floating);return{reference:Mt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Lt(e){return K(e).direction===`rtl`}var Rt={convertOffsetParentRelativeRectToViewportRelativeRect:bt,getDocumentElement:U,getClippingRect:At,getOffsetParent:Ft,getElementRects:It,getClientRects:xt,getDimensions:jt,getScale:pt,isElement:W,isRTL:Lt};function zt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bt(e,t){let n=null,r,i=U(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=se(d),h=se(i.clientWidth-(u+f)),g=se(i.clientHeight-(d+p)),_=se(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:L(0,I(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!zt(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Vt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ft(e),u=i||a?[...l?lt(l):[],...lt(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Bt(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?_t(e):null;c&&g();function g(){let t=_t(e);h&&!zt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ht=ze,Ut=Be,Wt=Ne,Gt=He,Kt=Ie,qt=Me,Jt=Ve,Yt=(e,t,n)=>{let r=new Map,i={platform:Rt,...n},a={...i.platform,_c:r};return je(e,t,{...i,platform:a})},J=e(d(),1),Xt=e(u(),1),Zt=typeof document<`u`?J.useLayoutEffect:function(){};function Qt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Qt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Qt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function $t(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function en(e,t){let n=$t(e);return Math.round(t*n)/n}function tn(e){let t=J.useRef(e);return Zt(()=>{t.current=e}),t}function nn(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=J.useState(r);Qt(f,r)||p(r);let[m,h]=J.useState(null),[g,_]=J.useState(null),v=J.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=J.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=J.useRef(null),C=J.useRef(null),w=J.useRef(u),T=c!=null,E=tn(c),D=tn(i),O=tn(l),k=J.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Yt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Qt(w.current,t)&&(w.current=t,Xt.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Zt(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=J.useRef(!1);Zt(()=>(A.current=!0,()=>{A.current=!1}),[]),Zt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=J.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=J.useMemo(()=>({reference:b,floating:x}),[b,x]),N=J.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=en(M.floating,u.x),r=en(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...$t(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return J.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var rn=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:qt({element:r.current,padding:i}).fn(n):r?qt({element:r,padding:i}).fn(n):{}}}},an=(e,t)=>({...Ht(e),options:[e,t]}),on=(e,t)=>({...Ut(e),options:[e,t]}),sn=(e,t)=>({...Jt(e),options:[e,t]}),cn=(e,t)=>({...Wt(e),options:[e,t]}),ln=(e,t)=>({...Gt(e),options:[e,t]}),un=(e,t)=>({...Kt(e),options:[e,t]}),dn=(e,t)=>({...rn(e),options:[e,t]}),Y=w(),fn=`Arrow`,pn=J.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,Y.jsx)(s.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,Y.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});pn.displayName=fn;var mn=pn;function hn(e){let[t,n]=J.useState(void 0);return f(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var gn=`Popper`,[_n,vn]=t(gn),[yn,bn]=_n(gn),xn=e=>{let{__scopePopper:t,children:n}=e,[r,i]=J.useState(null);return(0,Y.jsx)(yn,{scope:t,anchor:r,onAnchorChange:i,children:n})};xn.displayName=gn;var Sn=`PopperAnchor`,Cn=J.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=bn(Sn,n),o=J.useRef(null),c=k(t,o),l=J.useRef(null);return J.useEffect(()=>{let e=l.current;l.current=r?.current||o.current,e!==l.current&&a.onAnchorChange(l.current)}),r?null:(0,Y.jsx)(s.div,{...i,ref:c})});Cn.displayName=Sn;var wn=`PopperContent`,[Tn,En]=_n(wn),Dn=J.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:g=`optimized`,onPlaced:_,...v}=e,y=bn(wn,n),[b,x]=J.useState(null),S=k(t,e=>x(e)),[C,w]=J.useState(null),T=hn(C),E=T?.width??0,D=T?.height??0,O=r+(o===`center`?``:`-`+o),A=typeof p==`number`?p:{top:0,right:0,bottom:0,left:0,...p},j=Array.isArray(d)?d:[d],M=j.length>0,N={padding:A,boundary:j.filter(jn),altBoundary:M},{refs:ee,floatingStyles:te,placement:ne,isPositioned:re,middlewareData:P}=nn({strategy:`fixed`,placement:O,whileElementsMounted:(...e)=>Vt(...e,{animationFrame:g===`always`}),elements:{reference:y.anchor},middleware:[an({mainAxis:a+D,alignmentAxis:c}),u&&on({mainAxis:!0,crossAxis:!1,limiter:m===`partial`?sn():void 0,...N}),u&&cn({...N}),ln({...N,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),C&&dn({element:C,padding:l}),Mn({arrowWidth:E,arrowHeight:D}),h&&un({strategy:`referenceHidden`,...N})]}),[F,ie]=Nn(ne),ae=i(_);f(()=>{re&&ae?.()},[re,ae]);let I=P.arrow?.x,L=P.arrow?.y,oe=P.arrow?.centerOffset!==0,[se,R]=J.useState();return f(()=>{b&&R(window.getComputedStyle(b).zIndex)},[b]),(0,Y.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...te,transform:re?te.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,Y.jsx)(Tn,{scope:n,placedSide:F,onArrowChange:w,arrowX:I,arrowY:L,shouldHideArrow:oe,children:(0,Y.jsx)(s.div,{"data-side":F,"data-align":ie,...v,ref:S,style:{...v.style,animation:re?void 0:`none`}})})})});Dn.displayName=wn;var On=`PopperArrow`,kn={top:`bottom`,right:`left`,bottom:`top`,left:`right`},An=J.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=En(On,n),a=kn[i.placedSide];return(0,Y.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,Y.jsx)(mn,{...r,ref:t,style:{...r.style,display:`block`}})})});An.displayName=On;function jn(e){return e!==null}var Mn=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Nn(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Nn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Pn=xn,Fn=Cn,In=Dn,Ln=An,Rn=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),zn=`VisuallyHidden`,Bn=J.forwardRef((e,t)=>(0,Y.jsx)(s.span,{...e,ref:t,style:{...Rn,...e.style}}));Bn.displayName=zn;var Vn=Bn,[Hn,Un]=t(`Tooltip`,[vn]),Wn=vn(),Gn=`TooltipProvider`,Kn=700,qn=`tooltip.open`,[Jn,Yn]=Hn(Gn),Xn=e=>{let{__scopeTooltip:t,delayDuration:n=Kn,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=J.useRef(!0),s=J.useRef(!1),c=J.useRef(0);return J.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,Y.jsx)(Jn,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:J.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:J.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:J.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Xn.displayName=Gn;var Zn=`Tooltip`,[Qn,$n]=Hn(Zn),er=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Yn(Zn,e.__scopeTooltip),l=Wn(t),[u,d]=J.useState(null),f=y(),p=J.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=J.useRef(!1),[v,b]=_({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(qn))):c.onClose(),a?.(e)},caller:Zn}),x=J.useMemo(()=>v?g.current?`delayed-open`:`instant-open`:`closed`,[v]),S=J.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,b(!0)},[b]),C=J.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),w=J.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,b(!0),p.current=0},h)},[h,b]);return J.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,Y.jsx)(Pn,{...l,children:(0,Y.jsx)(Qn,{scope:t,contentId:f,open:v,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:J.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:J.useCallback(()=>{m?C():(window.clearTimeout(p.current),p.current=0)},[C,m]),onOpen:S,onClose:C,disableHoverableContent:m,children:n})})};er.displayName=Zn;var tr=`TooltipTrigger`,nr=J.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=$n(tr,n),a=Yn(tr,n),o=Wn(n),c=k(t,J.useRef(null),i.onTriggerChange),l=J.useRef(!1),u=J.useRef(!1),d=J.useCallback(()=>l.current=!1,[]);return J.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,Y.jsx)(Fn,{asChild:!0,...o,children:(0,Y.jsx)(s.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:M(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:M(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:M(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:M(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:M(e.onBlur,i.onClose),onClick:M(e.onClick,i.onClose)})})});nr.displayName=tr;var rr=`TooltipPortal`,[ir,ar]=Hn(rr,{forceMount:void 0}),or=e=>{let{__scopeTooltip:t,forceMount:r,children:i,container:a}=e,o=$n(rr,t);return(0,Y.jsx)(ir,{scope:t,forceMount:r,children:(0,Y.jsx)(ie,{present:r||o.open,children:(0,Y.jsx)(n,{asChild:!0,container:a,children:i})})})};or.displayName=rr;var sr=`TooltipContent`,cr=J.forwardRef((e,t)=>{let n=ar(sr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=$n(sr,e.__scopeTooltip);return(0,Y.jsx)(ie,{present:r||o.open,children:o.disableHoverableContent?(0,Y.jsx)(pr,{side:i,...a,ref:t}):(0,Y.jsx)(lr,{side:i,...a,ref:t})})}),lr=J.forwardRef((e,t)=>{let n=$n(sr,e.__scopeTooltip),r=Yn(sr,e.__scopeTooltip),i=J.useRef(null),a=k(t,i),[o,s]=J.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=J.useCallback(()=>{s(null),d(!1)},[d]),p=J.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=_r(r,gr(r,n.getBoundingClientRect())),a=vr(t.getBoundingClientRect());s(br([...i,...a])),d(!0)},[d]);return J.useEffect(()=>()=>f(),[f]),J.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),J.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!yr(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,Y.jsx)(pr,{...e,ref:a})}),[ur,dr]=Hn(Zn,{isInside:!1}),fr=v(`TooltipContent`),pr=J.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=$n(sr,n),l=Wn(n),{onClose:u}=c;return J.useEffect(()=>(document.addEventListener(qn,u),()=>document.removeEventListener(qn,u)),[u]),J.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,Y.jsx)(h,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,Y.jsxs)(In,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,Y.jsx)(fr,{children:r}),(0,Y.jsx)(ur,{scope:n,isInside:!0,children:(0,Y.jsx)(Vn,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});cr.displayName=sr;var mr=`TooltipArrow`,hr=J.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Wn(n);return dr(mr,n).isInside?null:(0,Y.jsx)(Ln,{...i,...r,ref:t})});hr.displayName=mr;function gr(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function _r(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function vr(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function yr(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function br(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),xr(t)}function xr(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Sr=Xn,Cr=er,wr=nr,Tr=cr,X=l(),Er=Sr,Dr=Cr,Or=wr,kr=J.forwardRef((e,t)=>{let n=(0,X.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,sideOffset:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a===void 0?4:a,s;n[4]===r?s=n[5]:(s=F(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,r),n[4]=r,n[5]=s);let c;return n[6]!==i||n[7]!==t||n[8]!==o||n[9]!==s?(c=(0,Y.jsx)(Tr,{ref:t,sideOffset:o,className:s,...i}),n[6]=i,n[7]=t,n[8]=o,n[9]=s,n[10]=c):c=n[10],c});kr.displayName=Tr.displayName;function Ar(e){let t=J.useRef({value:e,previous:e});return J.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var jr=J.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`w-full caption-bottom text-sm`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(`div`,{className:`relative w-full overflow-auto`,children:(0,Y.jsx)(`table`,{ref:t,className:a,...i})}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});jr.displayName=`Table`;var Mr=J.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`[&_tr]:border-b`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(`thead`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Mr.displayName=`TableHeader`;var Nr=J.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`[&_tr:last-child]:border-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(`tbody`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Nr.displayName=`TableBody`;var Pr=J.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`border-t bg-muted/50 font-medium [&>tr]:last:border-b-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(`tfoot`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Pr.displayName=`TableFooter`;var Fr=J.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(`tr`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Fr.displayName=`TableRow`;var Z=J.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(`th`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Z.displayName=`TableHead`;var Q=J.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`p-4 align-middle [&:has([role=checkbox])]:pr-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(`td`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Q.displayName=`TableCell`;var Ir=J.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`mt-4 text-sm text-muted-foreground`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(`caption`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ir.displayName=`TableCaption`;var Lr=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Rr=[` `,`Enter`],zr=`Select`,[Br,Vr,Hr]=O(zr),[Ur,Wr]=t(zr,[Hr,vn]),Gr=vn(),[Kr,qr]=Ur(zr),[Jr,Yr]=Ur(zr),Xr=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=Gr(t),[g,v]=J.useState(null),[b,x]=J.useState(null),[S,C]=J.useState(!1),w=ne(l),[T,E]=_({prop:r,defaultProp:i??!1,onChange:a,caller:zr}),[D,O]=_({prop:o,defaultProp:s,onChange:c,caller:zr}),k=J.useRef(null),A=g?m||!!g.closest(`form`):!0,[j,M]=J.useState(new Set),N=Array.from(j).map(e=>e.props.value).join(`;`);return(0,Y.jsx)(Pn,{...h,children:(0,Y.jsxs)(Kr,{required:p,scope:t,trigger:g,onTriggerChange:v,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:y(),value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,children:[(0,Y.jsx)(Br.Provider,{scope:t,children:(0,Y.jsx)(Jr,{scope:e.__scopeSelect,onNativeOptionAdd:J.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:J.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),A?(0,Y.jsxs)(Wi,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:D,onChange:e=>O(e.target.value),disabled:f,form:m,children:[D===void 0?(0,Y.jsx)(`option`,{value:``}):null,Array.from(j)]},N):null]})})};Xr.displayName=zr;var Zr=`SelectTrigger`,Qr=J.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Gr(n),o=qr(Zr,n),c=o.disabled||r,l=k(t,o.onTriggerChange),u=Vr(n),d=J.useRef(`touch`),[f,p,m]=Ki(e=>{let t=u().filter(e=>!e.disabled),n=qi(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),h=e=>{c||(o.onOpenChange(!0),m()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,Y.jsx)(Fn,{asChild:!0,...a,children:(0,Y.jsx)(s.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":Gi(o.value)?``:void 0,...i,ref:l,onClick:M(i.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&h(e)}),onPointerDown:M(i.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(h(e),e.preventDefault())}),onKeyDown:M(i.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&Lr.includes(e.key)&&(h(),e.preventDefault())})})})});Qr.displayName=Zr;var $r=`SelectValue`,ei=J.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...c}=e,l=qr($r,n),{onValueNodeHasChildrenChange:u}=l,d=a!==void 0,p=k(t,l.onValueNodeChange);return f(()=>{u(d)},[u,d]),(0,Y.jsx)(s.span,{...c,ref:p,style:{pointerEvents:`none`},children:Gi(l.value)?(0,Y.jsx)(Y.Fragment,{children:o}):a})});ei.displayName=$r;var ti=`SelectIcon`,ni=J.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,Y.jsx)(s.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});ni.displayName=ti;var ri=`SelectPortal`,ii=e=>(0,Y.jsx)(n,{asChild:!0,...e});ii.displayName=ri;var ai=`SelectContent`,oi=J.forwardRef((e,t)=>{let n=qr(ai,e.__scopeSelect),[r,i]=J.useState();if(f(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?Xt.createPortal((0,Y.jsx)(si,{scope:e.__scopeSelect,children:(0,Y.jsx)(Br.Slot,{scope:e.__scopeSelect,children:(0,Y.jsx)(`div`,{children:e.children})})}),t):null}return(0,Y.jsx)(di,{...e,ref:t})});oi.displayName=ai;var $=10,[si,ci]=Ur(ai),li=`SelectContentImpl`,ui=o(`SelectContent.RemoveScroll`),di=J.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:_,collisionPadding:v,sticky:y,hideWhenDetached:b,avoidCollisions:x,...S}=e,C=qr(ai,n),[w,T]=J.useState(null),[E,D]=J.useState(null),O=k(t,e=>T(e)),[A,j]=J.useState(null),[N,ee]=J.useState(null),te=Vr(n),[ne,re]=J.useState(!1),P=J.useRef(!1);J.useEffect(()=>{if(w)return a(w)},[w]),p();let F=J.useCallback(e=>{let[t,...n]=te().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&E&&(E.scrollTop=0),n===r&&E&&(E.scrollTop=E.scrollHeight),n?.focus(),document.activeElement!==i))return},[te,E]),ie=J.useCallback(()=>F([A,w]),[F,A,w]);J.useEffect(()=>{ne&&ie()},[ne,ie]);let{onOpenChange:ae,triggerPointerDownPosRef:I}=C;J.useEffect(()=>{if(w){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||ae(!1),document.removeEventListener(`pointermove`,t),I.current=null};return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[w,ae,I]),J.useEffect(()=>{let e=()=>ae(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ae]);let[L,oe]=Ki(e=>{let t=te().filter(e=>!e.disabled),n=qi(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),se=J.useCallback((e,t,n)=>{let r=!P.current&&!n;(C.value!==void 0&&C.value===t||r)&&(j(e),r&&(P.current=!0))},[C.value]),R=J.useCallback(()=>w?.focus(),[w]),ce=J.useCallback((e,t,n)=>{let r=!P.current&&!n;(C.value!==void 0&&C.value===t||r)&&ee(e)},[C.value]),le=r===`popper`?hi:pi,ue=le===hi?{side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:_,collisionPadding:v,sticky:y,hideWhenDetached:b,avoidCollisions:x}:{};return(0,Y.jsx)(si,{scope:n,content:w,viewport:E,onViewportChange:D,itemRefCallback:se,selectedItem:A,onItemLeave:R,itemTextRefCallback:ce,focusSelectedItem:ie,selectedItemText:N,position:r,isPositioned:ne,searchRef:L,children:(0,Y.jsx)(c,{as:ui,allowPinchZoom:!0,children:(0,Y.jsx)(g,{asChild:!0,trapped:C.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:M(i,e=>{C.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,Y.jsx)(h,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:(0,Y.jsx)(le,{role:`listbox`,id:C.contentId,"data-state":C.open?`open`:`closed`,dir:C.dir,onContextMenu:e=>e.preventDefault(),...S,...ue,onPlaced:()=>re(!0),ref:O,style:{display:`flex`,flexDirection:`column`,outline:`none`,...S.style},onKeyDown:M(S.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&oe(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=te().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>F(t)),e.preventDefault()}})})})})})})});di.displayName=li;var fi=`SelectItemAlignedPosition`,pi=J.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=qr(ai,n),o=ci(ai,n),[c,l]=J.useState(null),[u,d]=J.useState(null),p=k(t,e=>d(e)),m=Vr(n),h=J.useRef(!1),g=J.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,x=J.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&u&&_&&v&&y){let e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-$,d=D(a,[$,Math.max($,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-$,d=D(a,[$,Math.max($,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let o=m(),s=window.innerHeight-$*2,l=_.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),p=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+p+l+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-$,O=s-E,k=v.offsetHeight/2,A=v.offsetTop+k,j=f+p+A,M=x-j;if(j<=E){let e=o.length>0&&v===o[o.length-1].ref.current;c.style.bottom=`0px`;let t=u.clientHeight-_.offsetTop-_.offsetHeight,n=j+Math.max(O,k+(e?T:0)+t+g);c.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+k)+M;c.style.height=t+`px`,_.scrollTop=j-E+_.offsetTop}c.style.margin=`${$}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,a.trigger,a.valueNode,c,u,_,v,y,a.dir,r]);f(()=>x(),[x]);let[S,C]=J.useState();return f(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]),(0,Y.jsx)(gi,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:J.useCallback(e=>{e&&g.current===!0&&(x(),b?.(),g.current=!1)},[x,b]),children:(0,Y.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,Y.jsx)(s.div,{...i,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});pi.displayName=fi;var mi=`SelectPopperPosition`,hi=J.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=$,...a}=e,o=Gr(n);return(0,Y.jsx)(In,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});hi.displayName=mi;var[gi,_i]=Ur(ai,{}),vi=`SelectViewport`,yi=J.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=ci(vi,n),o=_i(vi,n),c=k(t,a.onViewportChange),l=J.useRef(0);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,Y.jsx)(Br.Slot,{scope:n,children:(0,Y.jsx)(s.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:M(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-$*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})});yi.displayName=vi;var bi=`SelectGroup`,[xi,Si]=Ur(bi),Ci=J.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=y();return(0,Y.jsx)(xi,{scope:n,id:i,children:(0,Y.jsx)(s.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Ci.displayName=bi;var wi=`SelectLabel`,Ti=J.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Si(wi,n);return(0,Y.jsx)(s.div,{id:i.id,...r,ref:t})});Ti.displayName=wi;var Ei=`SelectItem`,[Di,Oi]=Ur(Ei),ki=J.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,c=qr(Ei,n),l=ci(Ei,n),u=c.value===r,[d,f]=J.useState(a??``),[p,m]=J.useState(!1),h=k(t,e=>l.itemRefCallback?.(e,r,i)),g=y(),_=J.useRef(`touch`),v=()=>{i||(c.onValueChange(r),c.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,Y.jsx)(Di,{scope:n,value:r,disabled:i,textId:g,isSelected:u,onItemTextChange:J.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:(0,Y.jsx)(Br.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:(0,Y.jsx)(s.div,{role:`option`,"aria-labelledby":g,"data-highlighted":p?``:void 0,"aria-selected":u&&p,"data-state":u?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:h,onFocus:M(o.onFocus,()=>m(!0)),onBlur:M(o.onBlur,()=>m(!1)),onClick:M(o.onClick,()=>{_.current!==`mouse`&&v()}),onPointerUp:M(o.onPointerUp,()=>{_.current===`mouse`&&v()}),onPointerDown:M(o.onPointerDown,e=>{_.current=e.pointerType}),onPointerMove:M(o.onPointerMove,e=>{_.current=e.pointerType,i?l.onItemLeave?.():_.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:M(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:M(o.onKeyDown,e=>{l.searchRef?.current!==``&&e.key===` `||(Rr.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})});ki.displayName=Ei;var Ai=`SelectItemText`,ji=J.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=qr(Ai,n),c=ci(Ai,n),l=Oi(Ai,n),u=Yr(Ai,n),[d,p]=J.useState(null),m=k(t,e=>p(e),l.onItemTextChange,e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),h=d?.textContent,g=J.useMemo(()=>(0,Y.jsx)(`option`,{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=u;return f(()=>(_(g),()=>v(g)),[_,v,g]),(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(s.span,{id:l.textId,...a,ref:m}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Xt.createPortal(a.children,o.valueNode):null]})});ji.displayName=Ai;var Mi=`SelectItemIndicator`,Ni=J.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Oi(Mi,n).isSelected?(0,Y.jsx)(s.span,{"aria-hidden":!0,...r,ref:t}):null});Ni.displayName=Mi;var Pi=`SelectScrollUpButton`,Fi=J.forwardRef((e,t)=>{let n=ci(Pi,e.__scopeSelect),r=_i(Pi,e.__scopeSelect),[i,a]=J.useState(!1),o=k(t,r.onScrollButtonChange);return f(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,Y.jsx)(Ri,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Fi.displayName=Pi;var Ii=`SelectScrollDownButton`,Li=J.forwardRef((e,t)=>{let n=ci(Ii,e.__scopeSelect),r=_i(Ii,e.__scopeSelect),[i,a]=J.useState(!1),o=k(t,r.onScrollButtonChange);return f(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,Y.jsx)(Ri,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Li.displayName=Ii;var Ri=J.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=ci(`SelectScrollButton`,n),o=J.useRef(null),c=Vr(n),l=J.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return J.useEffect(()=>()=>l(),[l]),f(()=>{c().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[c]),(0,Y.jsx)(s.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:M(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:M(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:M(i.onPointerLeave,()=>{l()})})}),zi=`SelectSeparator`,Bi=J.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,Y.jsx)(s.div,{"aria-hidden":!0,...r,ref:t})});Bi.displayName=zi;var Vi=`SelectArrow`,Hi=J.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Gr(n),a=qr(Vi,n),o=ci(Vi,n);return a.open&&o.position===`popper`?(0,Y.jsx)(Ln,{...i,...r,ref:t}):null});Hi.displayName=Vi;var Ui=`SelectBubbleInput`,Wi=J.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=J.useRef(null),a=k(r,i),o=Ar(t);return J.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,Y.jsx)(s.select,{...n,style:{...Rn,...n.style},ref:a,defaultValue:t})});Wi.displayName=Ui;function Gi(e){return e===``||e===void 0}function Ki(e){let t=i(e),n=J.useRef(``),r=J.useRef(0),a=J.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),o=J.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return J.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}function qi(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ji(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ji(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Yi=Xr,Xi=Qr,Zi=ei,Qi=ni,$i=ii,ea=oi,ta=yi,na=Ti,ra=ki,ia=ji,aa=Ni,oa=Fi,sa=Li,ca=Bi,la=Yi,ua=Zi,da=J.forwardRef((e,t)=>{let n=(0,X.c)(12),i,a,o;n[0]===e?(i=n[1],a=n[2],o=n[3]):({className:a,children:i,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o);let s;n[4]===a?s=n[5]:(s=F(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,a),n[4]=a,n[5]=s);let c;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(Qi,{asChild:!0,children:(0,Y.jsx)(r,{className:`h-4 w-4 opacity-50`})}),n[6]=c):c=n[6];let l;return n[7]!==i||n[8]!==o||n[9]!==t||n[10]!==s?(l=(0,Y.jsxs)(Xi,{ref:t,className:s,...o,children:[i,c]}),n[7]=i,n[8]=o,n[9]=t,n[10]=s,n[11]=l):l=n[11],l});da.displayName=Xi.displayName;var fa=J.forwardRef((e,t)=>{let n=(0,X.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`flex cursor-default items-center justify-center py-1`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(x,{className:`h-4 w-4`}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,Y.jsx)(oa,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});fa.displayName=oa.displayName;var pa=J.forwardRef((e,t)=>{let n=(0,X.c)(10),i,a;n[0]===e?(i=n[1],a=n[2]):({className:i,...a}=e,n[0]=e,n[1]=i,n[2]=a);let o;n[3]===i?o=n[4]:(o=F(`flex cursor-default items-center justify-center py-1`,i),n[3]=i,n[4]=o);let s;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(r,{className:`h-4 w-4`}),n[5]=s):s=n[5];let c;return n[6]!==a||n[7]!==t||n[8]!==o?(c=(0,Y.jsx)(sa,{ref:t,className:o,...a,children:s}),n[6]=a,n[7]=t,n[8]=o,n[9]=c):c=n[9],c});pa.displayName=sa.displayName;var ma=J.forwardRef((e,t)=>{let n=(0,X.c)(21),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:i,children:r,position:o,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=o===void 0?`popper`:o,c=s===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,l;n[5]!==i||n[6]!==c?(l=F(`relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,c,i),n[5]=i,n[6]=c,n[7]=l):l=n[7];let u;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(fa,{}),n[8]=u):u=n[8];let d=s===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`,f;n[9]===d?f=n[10]:(f=F(`p-1`,d),n[9]=d,n[10]=f);let p;n[11]!==r||n[12]!==f?(p=(0,Y.jsx)(ta,{className:f,children:r}),n[11]=r,n[12]=f,n[13]=p):p=n[13];let m;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Y.jsx)(pa,{}),n[14]=m):m=n[14];let h;return n[15]!==s||n[16]!==a||n[17]!==t||n[18]!==l||n[19]!==p?(h=(0,Y.jsx)($i,{children:(0,Y.jsxs)(ea,{ref:t,className:l,position:s,...a,children:[u,p,m]})}),n[15]=s,n[16]=a,n[17]=t,n[18]=l,n[19]=p,n[20]=h):h=n[20],h});ma.displayName=ea.displayName;var ha=J.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`py-1.5 pl-8 pr-2 text-sm font-semibold`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(na,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ha.displayName=na.displayName;var ga=J.forwardRef((e,t)=>{let n=(0,X.c)(14),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=F(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,Y.jsx)(aa,{children:(0,Y.jsx)(re,{className:`h-4 w-4`})})}),n[6]=s):s=n[6];let c;n[7]===r?c=n[8]:(c=(0,Y.jsx)(ia,{children:r}),n[7]=r,n[8]=c);let l;return n[9]!==a||n[10]!==t||n[11]!==o||n[12]!==c?(l=(0,Y.jsxs)(ra,{ref:t,className:o,...a,children:[s,c]}),n[9]=a,n[10]=t,n[11]=o,n[12]=c,n[13]=l):l=n[13],l});ga.displayName=ra.displayName;var _a=J.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`-mx-1 my-1 h-px bg-muted`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(ca,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});_a.displayName=ca.displayName;var va=`__ALL_PROJECTS__`;function ya(e){let t=(0,X.c)(8),{text:n,maxLength:r}=e,i=r===void 0?100:r;if(n.length<=i){let e;return t[0]===n?e=t[1]:(e=(0,Y.jsx)(Y.Fragment,{children:n}),t[0]=n,t[1]=e),e}let a;t[2]!==i||t[3]!==n?(a=n.substring(0,i),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(`span`,{className:`text-muted-foreground ml-2`,children:`...`}),t[5]=o):o=t[5];let s;return t[6]===a?s=t[7]:(s=(0,Y.jsxs)(Y.Fragment,{children:[a,o]}),t[6]=a,t[7]=s),s}function ba(e,t){let n=`${t} - `,r=e.title??e.threadId;return r.startsWith(n)?r.slice(n.length):r}async function xa(e){let t=[],n=new Set,r=``;for(let i of e)try{let e=await ee(i.threadId);e?.messages&&(t.push(...e.messages),e.conversationIds&&e.conversationIds.forEach(e=>n.add(e)),e.lastUpdated>r&&(r=e.lastUpdated))}catch(e){console.warn(`Failed to load history for thread ${i.threadId}:`,e)}return t.sort((e,t)=>new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime()),{messages:t,conversationIds:Array.from(n),lastUpdated:r??new Date().toISOString()}}function Sa({isOpen:e,onClose:t,initialFilter:n,projects:r,inline:i}){let[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(!1),[l,u]=(0,J.useState)(null),[d,f]=(0,J.useState)(0),[p,h]=(0,J.useState)(``),[g,_]=(0,J.useState)(``),v=(0,J.useCallback)(async e=>{c(!0),u(null);try{o(await ee(e))}catch(e){u(e instanceof Error?e.message:`Failed to load conversation history`)}finally{c(!1)}},[]),y=(0,J.useCallback)(async e=>{if(e){c(!0),u(null);try{let t=r.find(t=>t.projectId===e);if(!t||t.threads.length===0){o({threadId:e,messages:[],lastUpdated:new Date().toISOString(),conversationIds:[]});return}o({threadId:e,...await xa(t.threads)})}catch(e){u(e instanceof Error?e.message:`Failed to load project history`)}finally{c(!1)}}},[r]),x=(0,J.useCallback)(async()=>{c(!0),u(null);try{o({threadId:va,...await xa(r.flatMap(e=>e.threads))})}catch(e){u(e instanceof Error?e.message:`Failed to load all projects history`)}finally{c(!1)}},[r]);(0,J.useEffect)(()=>{e&&n?n.type===`thread`?(_(n.id),h(``),f(0),v(n.id)):n.type===`project`&&(h(n.id),_(``),f(0),y(n.id)):e||(o(null),_(``),h(``),f(0),u(null))},[e,n,v,y]);let w=e=>{_(e),h(``),f(0),v(e)},D=e=>{h(e),_(``),f(0),e===va?x():y(e)},O=e=>new Date(e).toLocaleString(),k=(e,t)=>{let n=new Date(e),r=new Date(t).getTime()-n.getTime();if(r<0)return{display:`0:00`,tooltip:`0 seconds`};let i=Math.floor(r/1e3),a=Math.floor(i/60),o=i%60,s=`${a}:${o.toString().padStart(2,`0`)}`,c;return c=a===0?`${o} second${o===1?``:`s`}`:o===0?`${a} minute${a===1?``:`s`}`:`${a} minute${a===1?``:`s`} ${o} second${o===1?``:`s`}`,{display:s,tooltip:c}},M=e=>({inputTokens:e.inputTokens??0,outputTokens:e.outputTokens??0});return e?(0,Y.jsx)(`div`,{className:i?`h-full bg-background`:`fixed inset-0 z-50 bg-background`,children:(0,Y.jsxs)(`div`,{className:`flex h-full flex-col`,children:[!i&&(0,Y.jsxs)(`div`,{className:`flex items-center justify-between border-b p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,Y.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Conversation History`}),n?.type===`thread`&&(0,Y.jsxs)(la,{value:g,onValueChange:w,children:[(0,Y.jsx)(da,{className:`w-48`,children:(0,Y.jsx)(ua,{placeholder:`Select thread`})}),(0,Y.jsx)(ma,{children:r.flatMap(e=>e.threads.map(t=>(0,Y.jsx)(ga,{value:t.threadId,children:ba(t,e.name??e.projectId)},t.threadId)))})]}),(0,Y.jsxs)(la,{value:p,onValueChange:D,children:[(0,Y.jsx)(da,{className:`w-48`,children:(0,Y.jsx)(ua,{placeholder:`Select project`})}),(0,Y.jsxs)(ma,{children:[(0,Y.jsx)(ga,{value:va,children:`All Projects`}),r.map(e=>(0,Y.jsx)(ga,{value:e.projectId,children:e.name??e.projectId},e.projectId))]})]})]}),(0,Y.jsx)(C,{variant:`action`,size:`icon-sm`,onClick:t,children:(0,Y.jsx)(j,{})})]}),a?.messages.length&&a.messages.length>0&&(0,Y.jsxs)(`div`,{className:`flex items-center justify-between border-b p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(C,{variant:`outline`,size:`sm`,onClick:()=>{d>0&&f(d-1)},disabled:d===0,children:(0,Y.jsx)(m,{className:`h-4 w-4 mr-1`})}),(0,Y.jsx)(C,{variant:`outline`,size:`sm`,onClick:()=>{a?.messages&&d<a.messages.length-1&&f(d+1)},disabled:!a||d>=a.messages.length-1,children:(0,Y.jsx)(P,{className:`h-4 w-4 ml-1`})})]}),(0,Y.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[d+1,` of `,a?.messages.length??0,` messages`]})]}),(0,Y.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:s?(0,Y.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Y.jsxs)(`div`,{className:`text-center`,children:[(0,Y.jsx)(T,{className:`h-8 w-8 animate-spin mx-auto mb-2`}),(0,Y.jsx)(`p`,{children:`Loading conversation history...`})]})}):l?(0,Y.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Y.jsxs)(E,{className:`max-w-md`,children:[(0,Y.jsx)(A,{children:(0,Y.jsx)(N,{className:`text-destructive`,children:`Error`})}),(0,Y.jsxs)(b,{children:[(0,Y.jsx)(`p`,{children:l}),(0,Y.jsx)(C,{onClick:t,className:`mt-4`,children:`Close`})]})]})}):a?.messages?.length&&a.messages.length>0?(0,Y.jsx)(S,{className:`h-full`,children:(0,Y.jsx)(`div`,{className:`p-4`,children:(0,Y.jsxs)(jr,{children:[(0,Y.jsx)(Mr,{children:(0,Y.jsxs)(Fr,{children:[(0,Y.jsx)(Z,{children:`Prompt`}),(0,Y.jsx)(Z,{children:`Answer`}),(0,Y.jsx)(Z,{className:`w-24`,children:`Model`}),(0,Y.jsx)(Z,{className:`w-24 text-right`,children:`Duration`}),(0,Y.jsx)(Z,{className:`w-20 text-right`,children:`Input Tokens`}),(0,Y.jsx)(Z,{className:`w-20 text-right`,children:`Output Tokens`}),(0,Y.jsx)(Z,{className:`w-32 text-right`,children:`Timestamp`})]})}),(0,Y.jsx)(Nr,{children:a.messages.map((e,t)=>{let{inputTokens:n,outputTokens:r}=M(e);return(0,Y.jsxs)(Fr,{className:t===d?`bg-muted/50`:``,children:[(0,Y.jsx)(Q,{className:`max-w-md`,children:(0,Y.jsx)(`div`,{className:`text-sm`,children:(0,Y.jsx)(ya,{text:e.request.message})})}),(0,Y.jsx)(Q,{className:`max-w-md`,children:e.response?(0,Y.jsx)(`div`,{className:`text-sm`,children:(0,Y.jsx)(ya,{text:e.response.content})}):(0,Y.jsx)(`span`,{className:`text-muted-foreground italic`,children:`No response`})}),(0,Y.jsx)(Q,{className:`text-sm`,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(te,{className:`h-3 w-3 text-muted-foreground`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.request.model})]})}),(0,Y.jsx)(Q,{className:`text-sm text-right`,children:e.response?(0,Y.jsx)(Er,{children:(0,Y.jsxs)(Dr,{children:[(0,Y.jsx)(Or,{asChild:!0,children:(0,Y.jsx)(`div`,{className:`cursor-help`,children:k(e.timestamp,e.response.completedAt).display})}),(0,Y.jsx)(kr,{children:(0,Y.jsx)(`p`,{children:k(e.timestamp,e.response.completedAt).tooltip})})]})}):(0,Y.jsx)(`span`,{className:`text-muted-foreground italic`,children:`-`})}),(0,Y.jsx)(Q,{className:`text-sm text-muted-foreground text-right`,children:n>0?n.toLocaleString():`-`}),(0,Y.jsx)(Q,{className:`text-sm text-muted-foreground text-right`,children:r>0?r.toLocaleString():`-`}),(0,Y.jsx)(Q,{className:`text-sm text-muted-foreground text-right`,children:O(e.timestamp)})]},e.id)})})]})})}):(0,Y.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Y.jsxs)(E,{className:`max-w-md`,children:[(0,Y.jsx)(A,{children:(0,Y.jsx)(N,{children:`No History`})}),(0,Y.jsxs)(b,{children:[(0,Y.jsx)(`p`,{children:`No conversation history found for this thread.`}),(0,Y.jsx)(C,{onClick:t,className:`mt-4`,children:`Close`})]})]})})})]})}):null}export{hn as _,da as a,kr as c,Bn as d,Fn as f,vn as g,Pn as h,ga as i,Er as l,In as m,la as n,Ar as o,Ln as p,ma as r,Dr as s,Sa as t,Or as u};
|