tarsk 0.5.62 → 0.5.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/index.js +1380 -785
  2. package/dist/public/assets/{account-view-D2h4wMCJ.js → account-view-DPMOlh3s.js} +1 -1
  3. package/dist/public/assets/{alert-dialog-BpJafkQ6.js → alert-dialog-tR8jdoK3.js} +1 -1
  4. package/dist/public/assets/{api-DkhEo8tW.js → api-D3kM9pkY.js} +1 -1
  5. package/dist/public/assets/{async-error-boundary-DR57nNXL.js → async-error-boundary-D2YxNX8i.js} +1 -1
  6. package/dist/public/assets/{browser-tab-B15D-jTw.js → browser-tab-DBH__fWh.js} +2 -2
  7. package/dist/public/assets/{chat-dock-context-4ZMIlxAn.js → chat-dock-context-DX0woD8r.js} +1 -1
  8. package/dist/public/assets/{commit-dialog-CQH8QaWp.js → commit-dialog-vGBCFWUk.js} +1 -1
  9. package/dist/public/assets/{commit-method-fields-DYBEHZAP.js → commit-method-fields-CENlG_Jk.js} +1 -1
  10. package/dist/public/assets/{context-menu-cv7nzOcn.js → context-menu-D6nrl6uV.js} +1 -1
  11. package/dist/public/assets/{conversation-history-view-BnhR9dL8.js → conversation-history-view-D_Umzlgd.js} +1 -1
  12. package/dist/public/assets/{create-project-dialog-DCehjzue.js → create-project-dialog-IjrZazJK.js} +1 -1
  13. package/dist/public/assets/{create-repo-dialog-CVYlw8JI.js → create-repo-dialog-LRokjKAU.js} +1 -1
  14. package/dist/public/assets/{delete-confirm-dialog-DoRgqETX.js → delete-confirm-dialog-Tv1Y9rIn.js} +1 -1
  15. package/dist/public/assets/diff-view-BzR1KSU4.js +4 -0
  16. package/dist/public/assets/explorer-tab-view-BtQAqAoR.js +2 -0
  17. package/dist/public/assets/explorer-tree-gTgMdTOW.js +1 -0
  18. package/dist/public/assets/{explorer-view-B5nGnzAV.js → explorer-view-DhR2CWcz.js} +2 -2
  19. package/dist/public/assets/{git-history-dialog-De7D-B_f.js → git-history-dialog-Do8XlsHv.js} +1 -1
  20. package/dist/public/assets/git-ops-button-BIOoGOW9.js +2 -0
  21. package/dist/public/assets/index-BdDEzAzX.js +3307 -0
  22. package/dist/public/assets/index-zilB0ZSo.css +1 -0
  23. package/dist/public/assets/{mcp-server-card-DofWLHvo.js → mcp-server-card-9_PXQg51.js} +1 -1
  24. package/dist/public/assets/{merged-pr-dialog-CLaSLBzZ.js → merged-pr-dialog-U1CBegRj.js} +1 -1
  25. package/dist/public/assets/{model-list-controls-CRnIzfdp.js → model-list-controls-DGHp3GfD.js} +1 -1
  26. package/dist/public/assets/{monaco-setup-VhLB0diG.js → monaco-setup-Xkv0hjl5.js} +1 -1
  27. package/dist/public/assets/onboarding-_okRJRpU.js +46 -0
  28. package/dist/public/assets/{project-env-vars-view-wQPOiCa_.js → project-env-vars-view-CSk-mKm9.js} +1 -1
  29. package/dist/public/assets/{project-model-aliases-view-CMEFOKJj.js → project-model-aliases-view-D6gdA6SJ.js} +1 -1
  30. package/dist/public/assets/project-settings-view-soRLv3YG.js +1 -0
  31. package/dist/public/assets/{project-tools-view-C7rQgJBp.js → project-tools-view-Bm1kgBnS.js} +1 -1
  32. package/dist/public/assets/providers-list-view-C8euNoea.js +1 -0
  33. package/dist/public/assets/pull-request-dialog-Cy-OBkM4.js +1 -0
  34. package/dist/public/assets/{pull-with-changes-dialog-BIkrgGiK.js → pull-with-changes-dialog-p3MYq6XE.js} +1 -1
  35. package/dist/public/assets/{push-before-pr-dialog-CMGZ4nuF.js → push-before-pr-dialog-DHehHLoc.js} +1 -1
  36. package/dist/public/assets/{react-vendor-DgnPMVt4.js → react-vendor-DM3Nejio.js} +1 -1
  37. package/dist/public/assets/{settings-general-view-W0AXfWxp.js → settings-general-view-B9oGXpm4.js} +1 -1
  38. package/dist/public/assets/{settings-instructions-view-Dd3mwKFL.js → settings-instructions-view-Dgiq0-Fz.js} +1 -1
  39. package/dist/public/assets/{settings-list-Cyr7e0Le.js → settings-list-CdCYY9x_.js} +1 -1
  40. package/dist/public/assets/{settings-logs-view-CGbS3tw4.js → settings-logs-view-BCAw_cxd.js} +1 -1
  41. package/dist/public/assets/settings-mcp-servers-view-Br5owe39.js +5 -0
  42. package/dist/public/assets/settings-models-view--e7dI-H6.js +1 -0
  43. package/dist/public/assets/{settings-rules-view-BnOeQFrJ.js → settings-rules-view-DD0_kkS8.js} +1 -1
  44. package/dist/public/assets/{settings-skills-view-BvvWBK7C.js → settings-skills-view-DDIvFArL.js} +1 -1
  45. package/dist/public/assets/{settings-slack-view-CnCzVPQp.js → settings-slack-view-C0yGN7-a.js} +1 -1
  46. package/dist/public/assets/{settings-slash-commands-view-Ds7RbQGD.js → settings-slash-commands-view-B-Ehi4Vm.js} +1 -1
  47. package/dist/public/assets/{settings-statistics-view-BI6827hL.js → settings-statistics-view-BFsn_ndY.js} +1 -1
  48. package/dist/public/assets/{settings-storage-view-Dp1y_kDe.js → settings-storage-view-3J7APTHD.js} +1 -1
  49. package/dist/public/assets/{settings-subagents-view-Cco1I1-K.js → settings-subagents-view-YFveKNiL.js} +1 -1
  50. package/dist/public/assets/{settings-system-prompt-view-DZKKUgRY.js → settings-system-prompt-view-BR4bBXdt.js} +1 -1
  51. package/dist/public/assets/settings-view-Cg3qC1kg.js +2 -0
  52. package/dist/public/assets/{slug-utils-DVB1L0_r.js → slug-utils-DN3CLvnc.js} +1 -1
  53. package/dist/public/assets/tasks-view-COnDzVI9.js +2 -0
  54. package/dist/public/assets/{terminal-panel-B5SzvdGO.js → terminal-panel-rUTBECZC.js} +1 -1
  55. package/dist/public/assets/{ui-components-CuWavb_S.js → ui-components-BLrzr-Yo.js} +1 -1
  56. package/dist/public/assets/{use-active-dock-panel-instance-CKEkba2q.js → use-active-dock-panel-instance-HODVGwTg.js} +1 -1
  57. package/dist/public/assets/{use-installed-ai-files-CTaDJ775.js → use-installed-ai-files-D_mfpPto.js} +1 -1
  58. package/dist/public/assets/{web-Du8iyq0K.js → web-BGcPHAdQ.js} +1 -1
  59. package/dist/public/assets/{web-CaXKZtWk.js → web-D6UAh7QL.js} +1 -1
  60. package/dist/public/assets/{web-BNUbWWwf.js → web-DMLNawO_.js} +1 -1
  61. package/dist/public/assets/{web-CHZVpVHH.js → web-D_jEgLdF.js} +1 -1
  62. package/dist/public/index.html +7 -7
  63. package/dist/recommended-models.txt +11 -11
  64. package/package.json +2 -1
  65. package/dist/public/assets/diff-view-B1xi9U57.js +0 -4
  66. package/dist/public/assets/explorer-tab-view-DssrHe9f.js +0 -2
  67. package/dist/public/assets/explorer-tree-B2SnBNoL.js +0 -1
  68. package/dist/public/assets/git-ops-button-DJYzg_I5.js +0 -2
  69. package/dist/public/assets/index-3N_2bBI0.css +0 -1
  70. package/dist/public/assets/index-cAZJlfDA.js +0 -3307
  71. package/dist/public/assets/onboarding-Dy7KG3M5.js +0 -46
  72. package/dist/public/assets/project-settings-view-BeKBKcaZ.js +0 -1
  73. package/dist/public/assets/providers-list-view-DqSw6lqh.js +0 -1
  74. package/dist/public/assets/pull-request-dialog-CX10DwW3.js +0 -1
  75. package/dist/public/assets/settings-mcp-servers-view-C3IkdzkJ.js +0 -5
  76. package/dist/public/assets/settings-models-view-DV2YF3YN.js +0 -1
  77. package/dist/public/assets/settings-view-Ckzg0maK.js +0 -2
  78. package/dist/public/assets/tasks-view-tS75bdWk.js +0 -2
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/commit-dialog-vGBCFWUk.js","assets/index-BdDEzAzX.js","assets/rolldown-runtime-aKtaBQYM.js","assets/monaco-D1hpqXQ0.js","assets/monaco-BQve5vfS.css","assets/api-D3kM9pkY.js","assets/onboarding-_okRJRpU.js","assets/interactive-WtOIgeV4.js","assets/alert-dialog-tR8jdoK3.js","assets/react-vendor-DM3Nejio.js","assets/use-toast-BFQ85Ly5.js","assets/chat-dock-context-DX0woD8r.js","assets/store-CSyJjyNs.js","assets/explorer-tab-context-8bs_tiCO.js","assets/main-tab-context-DHeKIUsf.js","assets/use-suspense-resource-rX-GqyWi.js","assets/local-tool-blocks-DlqmJ7__.js","assets/ndjson-stream-DeGpE5o5.js","assets/thread-tool-blocks-BfowiaTH.js","assets/utils-Rlf65JHq.js","assets/index-zilB0ZSo.css","assets/pull-request-dialog-Cy-OBkM4.js","assets/create-repo-dialog-LRokjKAU.js","assets/git-history-dialog-Do8XlsHv.js","assets/push-before-pr-dialog-DHehHLoc.js","assets/pull-with-changes-dialog-p3MYq6XE.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ci as t,Ct as n,Fr as r,G as i,Jn as a,Ot as o,Qt as s,Ti as c,_ as l,d as u,dn as d,ei as f,en as p,i as m,jt as h,kt as g,mt as _,wi as v,wn as y,xn as b}from"./interactive-WtOIgeV4.js";import{$i as x,Ct as S,Fr as C,Gi as w,Ki as T,Mr as E,Oi as D,St as O,Tt as ee,Yi as k,Zi as A,Zn as j,ea as M,f as te,fr as N,ia as P,na as ne,oa as F,qi as I,ra as re,ta as L,wo as ie,wt as R}from"./onboarding-_okRJRpU.js";import{l as z}from"./monaco-D1hpqXQ0.js";import{n as ae,q as B,r as oe}from"./store-CSyJjyNs.js";import{t as V}from"./use-toast-BFQ85Ly5.js";import{Et as se,F as ce,I as le,L as ue,Mt as de,Nt as fe,Ot as pe,R as me,Y as H,a as he,jt as ge,kt as U,o as _e,s as ve,wt as ye,xt as be,z as xe}from"./index-BdDEzAzX.js";var Se=v(),W=e(c(),1),G=t();function K(e){return!e.hasChanges&&e.defaultBranchBehind>0}function q(e){return e.prExists&&e.prState===`OPEN`&&!e.hasChanges&&!e.hasUnpushedCommits}function J(e){return e.hasUnpushedCommits&&e.prExists}function Ce(e,t){return t?`Creating PR`:e.hasChanges?`Commit`:J(e)?`Update PR`:q(e)?`Open PR`:e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges?`Create PR`:K(e)?`Sync`:`Commit`}function we(e,t,n=!1){return t||n||e.hasChanges||J(e)||q(e)||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges||!e.hasChanges&&!e.hasUnpushedCommits&&!K(e)?null:K(e)?(0,G.jsx)(y,{className:`h-3.5 w-3.5`}):(0,G.jsx)(g,{className:`h-3.5 w-3.5`})}function Te(e){if(e.hasChanges)return e.changedFilesCount>0?`Commit ${e.changedFilesCount} changed file${e.changedFilesCount===1?``:`s`}`:`No changes to commit`;if(J(e))return`Update pull request with unpushed commits`;if(q(e))return`View pull request in GitHub`;if(e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges)return`Create pull request for committed changes`;if(K(e)){let t=e.defaultBranch??`main`,n=`${e.defaultBranchBehind} commit${e.defaultBranchBehind===1?``:`s`} behind origin/${t}`,r=e.defaultBranchAhead>0?`, ${e.defaultBranchAhead} commit${e.defaultBranchAhead===1?``:`s`} ahead`:``;return e.currentBranch===e.defaultBranch?`Your branch is ${n}${r}. Click to pull the latest changes.`:`Your branch "${e.currentBranch}" is ${n}${r}. Click to rebase onto the latest ${t}.`}return`No actions available`}function Ee(e,t,n=!1){return t||n?!0:q(e)||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges||K(e)?!1:!e.hasChanges&&!e.hasUnpushedCommits}function De(e){return e.hasChanges||q(e)||J(e)||K(e)||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges}function Oe(e){let t=(0,Se.c)(104),{branchStatus:a,remoteUrl:c,hasRemoteBranch:f,hasUnpushedCommits:h,canCreateRepo:v,repoUrl:x,isRefreshing:C,isCreatingPR:w,hasChanges:T,commitsAheadOfDefault:E,prExists:D,defaultBranch:k,defaultBranchAhead:A,defaultBranchBehind:j,gitUser:M,isDirectCommitMode:te,autoGenerateCommitMessage:N,isLoading:P,isLoadingHistory:ne,isQuickCommitting:F,onFetch:I,onPull:re,onPush:L,onOpenHistory:z,onCreatePR:ae,onCreateRepo:B,onViewInGitHub:oe,onQuickCommit:V,onSyncWithDefault:ce,onOpenChange:le,open:ue,layout:me}=e,H=w===void 0?!1:w,he=me===void 0?`bar`:me,_e=!!k&&!!c&&j>0,ve=!T&&!P,ye;t[0]!==H||t[1]!==C?(ye=H||C?(0,G.jsx)(_,{className:`h-4 w-4 shrink-0 animate-spin`}):(0,G.jsx)(d,{className:`h-4 w-4 shrink-0`}),t[0]=H,t[1]=C,t[2]=ye):ye=t[2];let be=ye,W;t[3]!==H||t[4]!==P||t[5]!==C||t[6]!==he||t[7]!==be?(W=(0,G.jsx)(fe,{asChild:!0,children:he===`sidebar`?(0,G.jsx)(ie,{variant:`ghost`,size:`icon-sm`,className:`shrink-0 text-muted-foreground`,disabled:P||H,"aria-label":`Git Ops`,children:be}):he===`bar`?(0,G.jsx)(`button`,{type:`button`,className:`flex h-full shrink-0 items-center rounded-r-full pr-3 pl-0.5 disabled:opacity-50`,disabled:P||H,"aria-label":`Git Ops`,children:H||C?(0,G.jsx)(_,{className:m(xe,`animate-spin`)}):(0,G.jsx)(d,{className:xe})}):(0,G.jsxs)(ie,{variant:`outline`,size:`sm`,className:`h-8 w-full justify-start gap-2 rounded-md px-1`,disabled:P||H,children:[(0,G.jsx)(`span`,{children:`Git Ops`}),H||C?(0,G.jsx)(_,{className:`h-3.5 w-3.5 animate-spin`}):(0,G.jsx)(d,{className:`h-3.5 w-3.5`})]})}),t[3]=H,t[4]=P,t[5]=C,t[6]=he,t[7]=be,t[8]=W):W=t[8];let K=he===`sidebar`?`start`:`end`,q;t[9]!==a||t[10]!==c?(q=a===`Behind`&&(0,G.jsxs)(`div`,{className:m(r.compact,`px-2 py-1 text-amber-600`),children:[`Branch is behind `,c?`origin`:`remote`]}),t[9]=a,t[10]=c,t[11]=q):q=t[11];let J;t[12]===M?J=t[13]:(J=M&&(0,G.jsxs)(`div`,{className:m(r.compact,`px-2 py-1 text-muted-foreground`),children:[(0,G.jsx)(`span`,{className:`font-medium`,children:`User:`}),` `,M]}),t[12]=M,t[13]=J);let Ce;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,G.jsx)(ge,{}),t[14]=Ce):Ce=t[14];let we;t[15]!==ve||t[16]!==k||t[17]!==A||t[18]!==j||t[19]!==T||t[20]!==ce||t[21]!==_e?(we=_e&&(0,G.jsx)(R,{children:(0,G.jsxs)(O,{children:[(0,G.jsx)(ee,{asChild:!0,children:(0,G.jsxs)(U,{onClick:()=>{ve&&ce()},className:ve?``:`opacity-50 cursor-not-allowed`,children:[(0,G.jsx)(i,{className:`h-3.5 w-3.5 mr-2`}),`Sync with `,k,(0,G.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 pl-3 text-xs tabular-nums text-muted-foreground`,children:[A>0&&(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,G.jsx)(b,{className:`h-3 w-3`}),A]}),j>0&&(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,G.jsx)(y,{className:`h-3 w-3`}),j]})]})]})}),(0,G.jsx)(S,{side:`right`,children:T?`Commit or stash changes before syncing with the default branch`:`Pull latest changes from origin/${k} onto your current branch`})]})}),t[15]=ve,t[16]=k,t[17]=A,t[18]=j,t[19]=T,t[20]=ce,t[21]=_e,t[22]=we):we=t[22];let Te;t[23]!==N||t[24]!==T||t[25]!==P||t[26]!==F||t[27]!==V?(Te=T&&N&&(0,G.jsx)(R,{children:(0,G.jsxs)(O,{children:[(0,G.jsx)(ee,{asChild:!0,children:(0,G.jsxs)(U,{onClick:V,disabled:P||F,children:[F?(0,G.jsx)(_,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,G.jsx)(u,{className:`h-3.5 w-3.5 mr-2`}),`Quick Commit`,(0,G.jsx)(de,{children:`⌘⇧C`})]})}),(0,G.jsx)(S,{side:`right`,children:`Generate the commit message and commit`})]})}),t[23]=N,t[24]=T,t[25]=P,t[26]=F,t[27]=V,t[28]=Te):Te=t[28];let Ee;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,G.jsx)(p,{className:`h-3.5 w-3.5 mr-2`}),t[29]=Ee):Ee=t[29];let De;t[30]!==P||t[31]!==I?(De=(0,G.jsx)(ee,{asChild:!0,children:(0,G.jsxs)(U,{onClick:I,disabled:P,children:[Ee,`Fetch`]})}),t[30]=P,t[31]=I,t[32]=De):De=t[32];let Oe;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,G.jsx)(S,{side:`right`,children:`Download latest information from remote without merging changes`}),t[33]=Oe):Oe=t[33];let Y;t[34]===De?Y=t[35]:(Y=(0,G.jsx)(R,{children:(0,G.jsxs)(O,{children:[De,Oe]})}),t[34]=De,t[35]=Y);let X;t[36]!==f||t[37]!==P||t[38]!==re?(X=()=>{f&&!P&&re()},t[36]=f,t[37]=P,t[38]=re,t[39]=X):X=t[39];let ke=!f||P?`opacity-50 cursor-not-allowed`:``,Ae;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,G.jsx)(y,{className:`h-3.5 w-3.5 mr-2`}),t[40]=Ae):Ae=t[40];let je;t[41]!==X||t[42]!==ke?(je=(0,G.jsx)(ee,{asChild:!0,children:(0,G.jsxs)(U,{onClick:X,className:ke,children:[Ae,`Pull`]})}),t[41]=X,t[42]=ke,t[43]=je):je=t[43];let Me=f?`Pull latest changes from remote`:`No remote branch to pull from`,Z;t[44]===Me?Z=t[45]:(Z=(0,G.jsx)(S,{side:`right`,children:Me}),t[44]=Me,t[45]=Z);let Ne;t[46]!==je||t[47]!==Z?(Ne=(0,G.jsx)(R,{children:(0,G.jsxs)(O,{children:[je,Z]})}),t[46]=je,t[47]=Z,t[48]=Ne):Ne=t[48];let Pe;t[49]!==f||t[50]!==P||t[51]!==L?(Pe=!f&&(0,G.jsx)(R,{children:(0,G.jsxs)(O,{children:[(0,G.jsx)(ee,{asChild:!0,children:(0,G.jsxs)(U,{onClick:L,disabled:P,children:[(0,G.jsx)(l,{className:`h-3.5 w-3.5 mr-2`}),`Push Branch to Remote`]})}),(0,G.jsx)(S,{side:`right`,children:`Create remote branch and push local commits`})]})}),t[49]=f,t[50]=P,t[51]=L,t[52]=Pe):Pe=t[52];let Fe;t[53]!==h||t[54]!==P||t[55]!==L?(Fe=()=>{h&&!P&&L()},t[53]=h,t[54]=P,t[55]=L,t[56]=Fe):Fe=t[56];let Ie=!h||P?`opacity-50 cursor-not-allowed`:``,Q;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,G.jsx)(l,{className:`h-3.5 w-3.5 mr-2`}),t[57]=Q):Q=t[57];let Le;t[58]!==Fe||t[59]!==Ie?(Le=(0,G.jsx)(ee,{asChild:!0,children:(0,G.jsxs)(U,{onClick:Fe,className:Ie,children:[Q,`Push Commits`]})}),t[58]=Fe,t[59]=Ie,t[60]=Le):Le=t[60];let Re=h?P?`Push in progress...`:`Push your uncommitted commits to the remote branch`:`No commits to push - your branch is up to date with remote`,ze;t[61]===Re?ze=t[62]:(ze=(0,G.jsx)(S,{side:`right`,children:Re}),t[61]=Re,t[62]=ze);let Be;t[63]!==Le||t[64]!==ze?(Be=(0,G.jsx)(R,{children:(0,G.jsxs)(O,{children:[Le,ze]})}),t[63]=Le,t[64]=ze,t[65]=Be):Be=t[65];let $=P||ne,Ve;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,G.jsx)(n,{className:`h-3.5 w-3.5 mr-2`}),t[66]=Ve):Ve=t[66];let He;t[67]!==z||t[68]!==$?(He=(0,G.jsxs)(U,{onClick:z,disabled:$,children:[Ve,`History`]}),t[67]=z,t[68]=$,t[69]=He):He=t[69];let Ue;t[70]!==E||t[71]!==T||t[72]!==te||t[73]!==P||t[74]!==ae||t[75]!==D?(Ue=!te&&E&&!D&&!T&&(0,G.jsxs)(U,{onClick:ae,disabled:P,children:[(0,G.jsx)(g,{className:`h-3.5 w-3.5 mr-2`}),`Create Pull Request`,(0,G.jsx)(de,{children:`⌘⇧P`})]}),t[70]=E,t[71]=T,t[72]=te,t[73]=P,t[74]=ae,t[75]=D,t[76]=Ue):Ue=t[76];let We;t[77]!==v||t[78]!==P||t[79]!==B?(We=v&&(0,G.jsxs)(U,{onClick:B,disabled:P,children:[(0,G.jsx)(o,{className:`h-3.5 w-3.5 mr-2`}),`Create Repo`]}),t[77]=v,t[78]=P,t[79]=B,t[80]=We):We=t[80];let Ge;t[81]!==P||t[82]!==oe||t[83]!==x?(Ge=x&&(0,G.jsxs)(U,{onClick:oe,disabled:P,children:[(0,G.jsx)(s,{className:`h-3.5 w-3.5 mr-2`}),`View in GitHub`,(0,G.jsx)(de,{children:`⌘⇧G`})]}),t[81]=P,t[82]=oe,t[83]=x,t[84]=Ge):Ge=t[84];let Ke;t[85]!==Te||t[86]!==Y||t[87]!==Ne||t[88]!==Pe||t[89]!==Be||t[90]!==He||t[91]!==Ue||t[92]!==We||t[93]!==Ge||t[94]!==K||t[95]!==q||t[96]!==J||t[97]!==we?(Ke=(0,G.jsxs)(pe,{align:K,children:[q,J,Ce,we,Te,Y,Ne,Pe,Be,He,Ue,We,Ge]}),t[85]=Te,t[86]=Y,t[87]=Ne,t[88]=Pe,t[89]=Be,t[90]=He,t[91]=Ue,t[92]=We,t[93]=Ge,t[94]=K,t[95]=q,t[96]=J,t[97]=we,t[98]=Ke):Ke=t[98];let qe;return t[99]!==le||t[100]!==ue||t[101]!==Ke||t[102]!==W?(qe=(0,G.jsxs)(se,{open:ue,onOpenChange:le,children:[W,Ke]}),t[99]=le,t[100]=ue,t[101]=Ke,t[102]=W,t[103]=qe):qe=t[103],qe}var Y=(0,W.lazy)(()=>z(()=>import(`./commit-dialog-vGBCFWUk.js`).then(e=>({default:e.CommitDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),X=(0,W.lazy)(()=>z(()=>import(`./pull-request-dialog-Cy-OBkM4.js`).then(e=>({default:e.PullRequestDialog})),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),ke=(0,W.lazy)(()=>z(()=>import(`./create-repo-dialog-LRokjKAU.js`).then(e=>({default:e.CreateRepoDialog})),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),Ae=(0,W.lazy)(()=>z(()=>import(`./git-history-dialog-Do8XlsHv.js`).then(e=>({default:e.GitHistoryDialog})),__vite__mapDeps([23,6,2,7]))),je=(0,W.lazy)(()=>z(()=>import(`./push-before-pr-dialog-DHehHLoc.js`).then(e=>({default:e.PushBeforePRDialog})),__vite__mapDeps([24,6,2,7]))),Me=(0,W.lazy)(()=>z(()=>import(`./pull-with-changes-dialog-p3MYq6XE.js`).then(e=>({default:e.PullWithChangesDialog})),__vite__mapDeps([25,6,2,7])));function Z(){return null}function Ne(e){let t=(0,Se.c)(67),{isLoading:n,currentBranch:r,commit:i,pullRequest:a,pushBeforePR:o,createRepo:s,history:c,pullWithChanges:l}=e,u;t[0]!==i.autoGenerate||t[1]!==i.isGenerating||t[2]!==i.isOpen||t[3]!==i.message||t[4]!==i.onAutoGenerateChange||t[5]!==i.onCommit||t[6]!==i.onGenerateMessage||t[7]!==i.onMessageChange||t[8]!==i.onOpenChange||t[9]!==r||t[10]!==n?(u=i.isOpen&&(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(Z,{}),children:(0,G.jsx)(Y,{open:i.isOpen,onOpenChange:i.onOpenChange,commitMessage:i.message,onCommitMessageChange:i.onMessageChange,autoGenerateCommitMessage:i.autoGenerate,onAutoGenerateChange:i.onAutoGenerateChange,isGeneratingMessage:i.isGenerating,isLoading:n,onGenerateMessage:i.onGenerateMessage,onCommit:i.onCommit,currentBranch:r})}),t[0]=i.autoGenerate,t[1]=i.isGenerating,t[2]=i.isOpen,t[3]=i.message,t[4]=i.onAutoGenerateChange,t[5]=i.onCommit,t[6]=i.onGenerateMessage,t[7]=i.onMessageChange,t[8]=i.onOpenChange,t[9]=r,t[10]=n,t[11]=u):u=t[11];let d;t[12]!==r||t[13]!==n||t[14]!==a.autoGenerate||t[15]!==a.createBranchAfterPR||t[16]!==a.description||t[17]!==a.isGeneratingInfo||t[18]!==a.isOpen||t[19]!==a.onAutoGenerateChange||t[20]!==a.onCreateBranchAfterPRChange||t[21]!==a.onCreatePR||t[22]!==a.onDescriptionChange||t[23]!==a.onGenerateInfo||t[24]!==a.onOpenChange||t[25]!==a.onTitleChange||t[26]!==a.title?(d=a.isOpen&&(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(Z,{}),children:(0,G.jsx)(X,{open:a.isOpen,onOpenChange:a.onOpenChange,prTitle:a.title,onPrTitleChange:a.onTitleChange,prDescription:a.description,onPrDescriptionChange:a.onDescriptionChange,isGeneratingPRInfo:a.isGeneratingInfo,isLoading:n,onGeneratePRInfo:a.onGenerateInfo,onCreatePR:a.onCreatePR,currentBranch:r,autoGeneratePRInfo:a.autoGenerate,onAutoGeneratePRInfoChange:a.onAutoGenerateChange,createBranchAfterPR:a.createBranchAfterPR,onCreateBranchAfterPRChange:a.onCreateBranchAfterPRChange})}),t[12]=r,t[13]=n,t[14]=a.autoGenerate,t[15]=a.createBranchAfterPR,t[16]=a.description,t[17]=a.isGeneratingInfo,t[18]=a.isOpen,t[19]=a.onAutoGenerateChange,t[20]=a.onCreateBranchAfterPRChange,t[21]=a.onCreatePR,t[22]=a.onDescriptionChange,t[23]=a.onGenerateInfo,t[24]=a.onOpenChange,t[25]=a.onTitleChange,t[26]=a.title,t[27]=d):d=t[27];let f;t[28]!==n||t[29]!==o.isOpen||t[30]!==o.onCancel||t[31]!==o.onOpenChange||t[32]!==o.onPushAndCreatePR?(f=o.isOpen&&(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(Z,{}),children:(0,G.jsx)(je,{open:o.isOpen,onOpenChange:o.onOpenChange,isLoading:n,onPushAndCreatePR:o.onPushAndCreatePR,onCancel:o.onCancel})}),t[28]=n,t[29]=o.isOpen,t[30]=o.onCancel,t[31]=o.onOpenChange,t[32]=o.onPushAndCreatePR,t[33]=f):f=t[33];let p;t[34]!==s.description||t[35]!==s.isOpen||t[36]!==s.isPrivate||t[37]!==s.name||t[38]!==s.onCreateRepo||t[39]!==s.onDescriptionChange||t[40]!==s.onNameChange||t[41]!==s.onOpenChange||t[42]!==s.onPrivateChange||t[43]!==n?(p=s.isOpen&&(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(Z,{}),children:(0,G.jsx)(ke,{open:s.isOpen,onOpenChange:s.onOpenChange,repoName:s.name,onRepoNameChange:s.onNameChange,repoDescription:s.description,onRepoDescriptionChange:s.onDescriptionChange,isPrivateRepo:s.isPrivate,onPrivateRepoChange:s.onPrivateChange,isLoading:n,onCreateRepo:s.onCreateRepo})}),t[34]=s.description,t[35]=s.isOpen,t[36]=s.isPrivate,t[37]=s.name,t[38]=s.onCreateRepo,t[39]=s.onDescriptionChange,t[40]=s.onNameChange,t[41]=s.onOpenChange,t[42]=s.onPrivateChange,t[43]=n,t[44]=p):p=t[44];let m;t[45]!==r||t[46]!==c.commits||t[47]!==c.displayedCommits||t[48]!==c.isLoadingMore||t[49]!==c.isOpen||t[50]!==c.onOpenChange||t[51]!==c.onScroll?(m=c.isOpen&&(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(Z,{}),children:(0,G.jsx)(Ae,{open:c.isOpen,onOpenChange:c.onOpenChange,commits:c.commits,displayedCommits:c.displayedCommits,isLoadingMore:c.isLoadingMore,onScroll:c.onScroll,currentBranch:r})}),t[45]=r,t[46]=c.commits,t[47]=c.displayedCommits,t[48]=c.isLoadingMore,t[49]=c.isOpen,t[50]=c.onOpenChange,t[51]=c.onScroll,t[52]=m):m=t[52];let h;t[53]!==n||t[54]!==l.isOpen||t[55]!==l.onCancel||t[56]!==l.onCommitFirst||t[57]!==l.onOpenChange||t[58]!==l.onStashAndPull?(h=l.isOpen&&(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(Z,{}),children:(0,G.jsx)(Me,{open:l.isOpen,onOpenChange:l.onOpenChange,onCommitFirst:l.onCommitFirst,onStashAndPull:l.onStashAndPull,onCancel:l.onCancel,isLoading:n})}),t[53]=n,t[54]=l.isOpen,t[55]=l.onCancel,t[56]=l.onCommitFirst,t[57]=l.onOpenChange,t[58]=l.onStashAndPull,t[59]=h):h=t[59];let g;return t[60]!==u||t[61]!==d||t[62]!==f||t[63]!==p||t[64]!==m||t[65]!==h?(g=(0,G.jsxs)(G.Fragment,{children:[u,d,f,p,m,h]}),t[60]=u,t[61]=d,t[62]=f,t[63]=p,t[64]=m,t[65]=h,t[66]=g):g=t[66],g}function Pe(e){let t=e.split(`/`);return t.length>=2?{provider:t[0],model:t.slice(1).join(`/`)}:{provider:void 0,model:e}}var Fe=a(`app.use-ai-generation.hook`);function Ie(e,t,n){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(!1),s=()=>n?.id?n.provider?{provider:n.provider,model:n.id}:Pe(n.id):{provider:void 0,model:void 0};return{isGeneratingMessage:r,isGeneratingPRInfo:a,generateCommitMessageWithAI:(0,W.useCallback)(async()=>{if(!e)return null;try{i(!0);let{provider:t,model:n}=s();return await T(e,n,t)}catch(e){return Fe.error(`Failed to generate commit message:`,e),V({title:`Error`,description:e instanceof Error?e.message:`Failed to generate commit message`,variant:`destructive`}),null}finally{i(!1)}},[e,n]),generatePRInfoWithAI:(0,W.useCallback)(async()=>{if(!e)return null;try{o(!0);let{provider:t,model:n}=s();return await I(e,n,t)}catch(e){return Fe.error(`Failed to generate PR info:`,e),V({title:`Error`,description:e instanceof Error?e.message:`Failed to generate PR info`,variant:`destructive`}),null}finally{o(!1)}},[e,n])}}function Q(e){return e?!0:(V({title:`Error`,description:`No thread selected`,variant:`destructive`}),!1)}async function Le(e,t,n,r){r&&(await D(e,{title:r}),n({type:B.UpdateThreadTitle,projectId:t,threadId:e,title:r}))}var Re=2e3,ze=6;function Be(e,t){let n=0;e.current!==null&&clearInterval(e.current),e.current=setInterval(async()=>{if(n++,n>=ze){e.current!==null&&(clearInterval(e.current),e.current=null);return}await t(!0)},Re)}var $=a(`app.git-ops-button.ui`),Ve=10;function He(e){let{projectId:t,threadId:n,projectName:r,dispatch:i,aiGeneration:a,unifiedGitStatus:o}=e,[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(!1),[d,f]=(0,W.useState)(!1),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(``),[_,v]=(0,W.useState)(``),[y,b]=(0,W.useState)(``),[S,T]=(0,W.useState)(!1),[D,O]=(0,W.useState)(null),ee=(0,W.useRef)(!1),te=(0,W.useRef)(!1),I=(0,W.useRef)(_),ie=(0,W.useRef)(y);I.current=_,ie.current=y;let[R,z]=(0,W.useState)(!1),[ae,oe]=(0,W.useState)([]),[se,ce]=(0,W.useState)(!1),[le,ue]=(0,W.useState)([]),[de,fe]=(0,W.useState)(!1),[pe,me]=(0,W.useState)(!1),[H,ge]=(0,W.useState)(``),[U,ye]=(0,W.useState)(``),[be,xe]=(0,W.useState)(``),[Se,G]=(0,W.useState)(!1),[K,q]=(0,W.useState)(!1),[J,Ce]=(0,W.useState)(!1),[we,Te]=(0,W.useState)(!1),[Ee,De]=(0,W.useState)(null),Oe=(0,W.useRef)(!1),Y=(0,W.useRef)(null);(0,W.useEffect)(()=>()=>{Y.current!==null&&(clearInterval(Y.current),Y.current=null)},[]);async function X(){E();let e=await N();i({type:B.SetProjects,projects:e.projects,cloneRootPath:e.cloneRootPath})}async function ke(e){if(Ae.createBranchAfterPR)try{let t=await M(n,e);e&&De(e),V({title:`New branch created`,description:e?`Created new branch "${t.branchName}" from PR branch "${e}"`:`Created new branch "${t.branchName}" from the latest default branch`}),await o.fetchUnifiedStatus(!0),X()}catch(e){$.error(`Failed to create new branch after PR:`,e),V({title:`Failed to create new branch`,description:e instanceof Error?e.message:`Unknown error occurred`,variant:`destructive`})}}let[Ae,je]=(0,W.useState)(()=>_e());(0,W.useEffect)(()=>{pe&&r&&!H&&ge(r)},[pe,r,H]),(0,W.useEffect)(()=>{ve(Ae)},[Ae]);function Me(){Se||(G(!0),j().then(e=>xe(e)).catch(()=>{}))}function Z(e){Te(e),e&&(Me(),o.fetchUnifiedStatus(!0))}(0,W.useEffect)(()=>{l&&o.prExists&&o.prState===`OPEN`&&u(!1)},[o.prExists,o.prState,l]),(0,W.useEffect)(()=>{if(!l)return;let e=setTimeout(()=>{u(!1)},15e3);return()=>clearTimeout(e)},[l]),(0,W.useEffect)(()=>{let e=o.prExists&&o.prState===`OPEN`&&!o.hasChanges&&!o.hasUnpushedCommits;e&&!Oe.current&&X(),Oe.current=e},[o.hasChanges,o.hasUnpushedCommits,o.prExists,o.prState]);async function Ne(){if(h.trim()&&Q(n))try{c(!0),await x(n,h),g(``),f(!1),await o.fetchUnifiedStatus(!0),X(),V({title:`Changes committed successfully`,description:`Your changes have been committed to '${o.currentBranch}'.`}),J&&(Ce(!1),await We())}catch(e){$.error(`Failed to commit:`,e),V({title:`Commit failed`,description:e instanceof Error?e.message:`Failed to commit changes`,variant:`destructive`})}finally{c(!1)}}async function Pe(){if(!Q(n))return;let e=o.prUrl;if(!e)try{e=(await A(n)).url}catch(e){$.error(`Failed to fetch pull request URL:`,e),V({title:`Could not open pull request`,description:e instanceof Error?e.message:`Failed to fetch pull request URL`,variant:`destructive`});return}if(!e){V({title:`Could not open pull request`,description:`Pull request URL is unavailable. Try refreshing git status.`,variant:`destructive`});return}try{await C(e)}catch(e){$.error(`Failed to open pull request:`,e),V({title:`Could not open pull request`,description:e instanceof Error?e.message:`Failed to open URL in browser`,variant:`destructive`})}}async function Fe(){if(o.hasChanges){f(!0);return}if(o.hasUnpushedCommits&&o.prExists){let e=o.prState;try{e=(await A(n)).state??e}catch(e){$.warn(`Could not refresh pull request state before update:`,e)}if(e===`MERGED`){he();return}await He();return}if(o.prExists&&o.prState===`OPEN`&&!o.hasChanges&&!o.hasUnpushedCommits){await Pe();return}if(o.commitsAheadOfDefault&&!o.prExists&&!o.hasChanges){m(!0);return}if(o.defaultBranchBehind>0){await qe();return}}async function Ie(){let e=await a.generateCommitMessageWithAI();e&&g(e)}async function Re(){if(Q(n))try{c(!0);let e=await a.generateCommitMessageWithAI();if(!e){V({title:`Quick Commit failed`,description:`Could not generate commit message`,variant:`destructive`});return}await x(n,e),await o.fetchUnifiedStatus(!0),X(),V({title:`Changes committed successfully`,description:`Committed: ${e}`})}catch(e){$.error(`Quick commit failed:`,e),V({title:`Quick Commit failed`,description:e instanceof Error?e.message:`Failed to commit changes`,variant:`destructive`})}finally{c(!1)}}async function ze(){if(Q(n))try{c(!0),await ne(n),await o.fetchUnifiedStatus()}catch(e){$.error(`Failed to fetch:`,e)}finally{c(!1)}}async function He(){if(Q(n))try{c(!0),await P(n),await o.fetchUnifiedStatus(!0),X(),o.hasRemoteBranch?V({title:`Branch pushed successfully`,description:`Your branch '${o.currentBranch}' has been pushed to the remote.`}):V({title:`Push completed`,description:`Changes have been pushed successfully.`})}catch(e){$.error(`Failed to push:`,e),V({title:`Push failed`,description:e instanceof Error?e.message:`Failed to push to remote`,variant:`destructive`})}finally{c(!1)}}async function Ue(){if(Q(n)){if(o.hasChanges){q(!0);return}await We()}}async function We(){try{c(!0),await re(n),await o.fetchUnifiedStatus(!0),X(),V({title:`Pull successful`,description:`Latest changes have been pulled from remote.`})}catch(e){$.error(`Failed to pull:`,e),V({title:`Pull failed`,description:e instanceof Error?e.message:`Failed to pull from remote`,variant:`destructive`})}finally{c(!1)}}function Ge(){q(!1),Ce(!0),f(!0)}async function Ke(){q(!1),await We()}async function qe(){if(Q(n))try{c(!0),await F(n),await o.fetchUnifiedStatus(!0),X(),V({title:`Branch synced successfully`,description:`Your branch '${o.currentBranch}' has been synced with the latest changes`})}catch(e){$.error(`[sync] ✗ Failed to sync branch:`,e),V({title:`Sync failed`,description:e instanceof Error?e.message:`Failed to sync with default branch`,variant:`destructive`})}finally{c(!1)}}async function Je(){if(Q(n))try{c(!0),u(!0);let e=await L(n,_,y,Ee??void 0);await Le(n,t,i,e.title??_),e.prUrl&&await C(e.prUrl),v(``),b(``),m(!1),await o.fetchUnifiedStatus(!0),X(),await ke(e.branchName),Be(Y,o.fetchUnifiedStatus)}catch(e){$.error(`Failed to create PR:`,e);let t=e instanceof Error?e.message:`Failed to create PR`;t.includes(`push the current branch`)||t.includes(`--head flag`)?(m(!1),Ze({title:_,description:y})):(u(!1),V({title:`Create PR Failed`,description:t,variant:`destructive`}))}finally{c(!1)}}async function Ye(){if(Q(n))try{c(!0);let e=await w(n,H,U,Ae.privateRepositoryDefault);e.repoUrl&&setTimeout(()=>{C(e.repoUrl)},3e3),ge(``),ye(``),me(!1),await o.fetchUnifiedStatus(),X()}catch(e){$.error(`Failed to create repo:`,e)}finally{c(!1)}}async function Xe(){let e=await a.generatePRInfoWithAI();e&&(v(e.title),b(e.description),V({title:`Success`,description:`PR title and description generated`}))}async function Ze(e){let r=e??D;if(!(!n||!r))try{c(!0),u(!0);try{await P(n)}catch(e){let t=e?.message??``;if(t.includes(`non-fast-forward`)||t.includes(`Updates were rejected because the tip of your current branch is behind`)){V({title:`Syncing branch before push`,description:`Your branch is behind remote. Pulling latest changes first...`});try{await F(n),await P(n)}catch{throw e}}else throw e}let e=await L(n,r.title,r.description,Ee??void 0);await Le(n,t,i,e.title??r.title),e.prUrl&&await C(e.prUrl),v(``),b(``),O(null),T(!1),await o.fetchUnifiedStatus(!0),X(),await ke(e.branchName),Be(Y,o.fetchUnifiedStatus)}catch(e){$.error(`Failed to push and create PR:`,e);let t=e instanceof Error?e.message:`Failed to push and create PR`;u(!1),V({title:`Push & Create PR Failed`,description:t,variant:`destructive`})}finally{c(!1)}}async function Qe(){if(Q(n))try{ce(!0);let e=await k(n,100);oe(e),ue(e.slice(0,Ve)),z(!0)}catch(e){$.error(`Failed to fetch git history:`,e)}finally{ce(!1)}}function $e(){de||(fe(!0),setTimeout(()=>{let e=le.length+Ve;ue(ae.slice(0,e)),fe(!1)},300))}function et(e){let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight<100&&le.length<ae.length&&!de&&$e()}function tt(){o.repoUrl&&C(o.repoUrl)}function nt(){T(!1),O(null)}return{isLoading:s,isCreatingPR:l,isCommitDialogOpen:d,setIsCommitDialogOpen:f,isPRDialogOpen:p,setIsPRDialogOpen:m,commitMessage:h,setCommitMessage:g,prTitle:_,setPrTitle:v,prDescription:y,setPrDescription:b,isPushBeforePRDialogOpen:S,setIsPushBeforePRDialogOpen:T,prGenerationRef:ee,commitGenerationRef:te,prTitleRef:I,prDescriptionRef:ie,isHistoryDialogOpen:R,setIsHistoryDialogOpen:z,commits:ae,displayedCommits:le,isLoadingHistory:se,isLoadingMore:de,isRepoDialogOpen:pe,setIsRepoDialogOpen:me,repoName:H,setRepoName:ge,repoDescription:U,setRepoDescription:ye,gitUser:be,isPullWithChangesDialogOpen:K,setIsPullWithChangesDialogOpen:q,isGitOpsMenuOpen:we,userPrefs:Ae,setUserPrefsState:je,handleGitOpsMenuOpenChange:Z,handleCommit:Ne,handleOpenPullRequest:Pe,handleMainButtonClick:Fe,handleGenerateCommitMessage:Ie,handleQuickCommit:Re,handleFetch:ze,handlePush:He,handlePull:Ue,handleSyncBranch:qe,handleCreatePR:Je,handleCreateRepo:Ye,handleGeneratePRInfo:Xe,handlePushAndCreatePR:Ze,handleOpenHistory:Qe,handleScroll:et,handleViewInGitHub:tt,handleCancelPushBeforePR:nt,handleCommitFirstAndPull:Ge,handleStashAndPull:Ke}}function Ue(e){let t=(0,Se.c)(29),{threadId:n,aiGeneration:r,isCommitDialogOpen:i,commitMessage:a,setCommitMessage:o,autoGenerateCommitMessage:s,commitGenerationRef:c,isPRDialogOpen:l,prTitleRef:u,prDescriptionRef:d,setPrTitle:f,setPrDescription:p,autoGeneratePRInfo:m,prGenerationRef:h}=e,g;t[0]!==r||t[1]!==s||t[2]!==c||t[3]!==a||t[4]!==i||t[5]!==o||t[6]!==n?(g=()=>{if(!i){c.current=!1;return}i&&s&&!a.trim()&&n&&!c.current&&(c.current=!0,(async function(){let e=await r.generateCommitMessageWithAI();e&&o(e)})())},t[0]=r,t[1]=s,t[2]=c,t[3]=a,t[4]=i,t[5]=o,t[6]=n,t[7]=g):g=t[7];let _;t[8]!==r.generateCommitMessageWithAI||t[9]!==s||t[10]!==a||t[11]!==i||t[12]!==n?(_=[i,s,n,r.generateCommitMessageWithAI,a],t[8]=r.generateCommitMessageWithAI,t[9]=s,t[10]=a,t[11]=i,t[12]=n,t[13]=_):_=t[13],(0,W.useEffect)(g,_);let v;t[14]!==r||t[15]!==m||t[16]!==l||t[17]!==d||t[18]!==h||t[19]!==u||t[20]!==p||t[21]!==f||t[22]!==n?(v=()=>{if(!l){h.current=!1;return}l&&m&&!u.current.trim()&&!d.current.trim()&&n&&!h.current&&(h.current=!0,(async function(){let e=await r.generatePRInfoWithAI();e&&(f(e.title),p(e.description))})())},t[14]=r,t[15]=m,t[16]=l,t[17]=d,t[18]=h,t[19]=u,t[20]=p,t[21]=f,t[22]=n,t[23]=v):v=t[23];let y;t[24]!==r.generatePRInfoWithAI||t[25]!==m||t[26]!==l||t[27]!==n?(y=[l,m,n,r.generatePRInfoWithAI],t[24]=r.generatePRInfoWithAI,t[25]=m,t[26]=l,t[27]=n,t[28]=y):y=t[28],(0,W.useEffect)(v,y)}function We(e){let{unifiedGitStatus:t,autoGenerateCommitMessage:n,isLoading:r,isCreatingPR:i,isDirectCommitMode:a,onQuickCommit:o,onCreatePR:s,onViewInGitHub:c,onOpenGitOpsMenu:l}=e,u=(0,W.useRef)(o),d=(0,W.useRef)(s),f=(0,W.useRef)(c),p=(0,W.useRef)(l);u.current=o,d.current=s,f.current=c,p.current=l,(0,W.useEffect)(()=>{function e(e){let o=e.key.toLowerCase();if((e.metaKey||e.ctrlKey)&&e.shiftKey&&!e.altKey){if(o===`c`){t.hasChanges&&n&&!r&&(e.preventDefault(),u.current());return}if(o===`p`){t.commitsAheadOfDefault&&!t.prExists&&!t.hasChanges&&!r&&!a&&(e.preventDefault(),d.current());return}if(o===`g`){t.repoUrl&&!r&&(e.preventDefault(),f.current());return}o===`b`&&!r&&!i&&(e.preventDefault(),p.current())}}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t.commitsAheadOfDefault,t.hasChanges,t.prExists,t.repoUrl,n,r,i,a])}function Ge(e){let t=(0,Se.c)(173),{projectId:n,threadId:i,layout:a}=e,o=a===void 0?`bar`:a,s=ae(),c=H(),l;t[0]===i?l=t[1]:(l=e=>e.projectModelSelections[i],t[0]=i,t[1]=l);let u=oe(l),d;t[2]===n?d=t[3]:(d=e=>e.projects.find(e=>e.projectId===n),t[2]=n,t[3]=d);let p=oe(d),g=ye(),_=Ie(i,n,u),v=p?.commitMethod===f.Direct,y=p?.name,b;t[4]!==_||t[5]!==s||t[6]!==n||t[7]!==y||t[8]!==i||t[9]!==g?(b={projectId:n,threadId:i,projectName:y,dispatch:s,aiGeneration:_,unifiedGitStatus:g},t[4]=_,t[5]=s,t[6]=n,t[7]=y,t[8]=i,t[9]=g,t[10]=b):b=t[10];let x=He(b),C;t[11]!==x.commitGenerationRef||t[12]!==x.commitMessage||t[13]!==x.isCommitDialogOpen||t[14]!==x.isPRDialogOpen||t[15]!==x.prDescriptionRef||t[16]!==x.prGenerationRef||t[17]!==x.prTitleRef||t[18]!==x.setCommitMessage||t[19]!==x.setPrDescription||t[20]!==x.setPrTitle||t[21]!==x.userPrefs.autoGenerateCommitMessage||t[22]!==x.userPrefs.autoGeneratePRInfo||t[23]!==_||t[24]!==i?(C={threadId:i,aiGeneration:_,isCommitDialogOpen:x.isCommitDialogOpen,commitMessage:x.commitMessage,setCommitMessage:x.setCommitMessage,autoGenerateCommitMessage:x.userPrefs.autoGenerateCommitMessage,commitGenerationRef:x.commitGenerationRef,isPRDialogOpen:x.isPRDialogOpen,prTitleRef:x.prTitleRef,prDescriptionRef:x.prDescriptionRef,setPrTitle:x.setPrTitle,setPrDescription:x.setPrDescription,autoGeneratePRInfo:x.userPrefs.autoGeneratePRInfo,prGenerationRef:x.prGenerationRef},t[11]=x.commitGenerationRef,t[12]=x.commitMessage,t[13]=x.isCommitDialogOpen,t[14]=x.isPRDialogOpen,t[15]=x.prDescriptionRef,t[16]=x.prGenerationRef,t[17]=x.prTitleRef,t[18]=x.setCommitMessage,t[19]=x.setPrDescription,t[20]=x.setPrTitle,t[21]=x.userPrefs.autoGenerateCommitMessage,t[22]=x.userPrefs.autoGeneratePRInfo,t[23]=_,t[24]=i,t[25]=C):C=t[25],Ue(C);let w;t[26]===x?w=t[27]:(w=()=>x.setIsPRDialogOpen(!0),t[26]=x,t[27]=w);let T;t[28]===x?T=t[29]:(T=()=>{x.isLoading||x.isCreatingPR||x.handleGitOpsMenuOpenChange(!0)},t[28]=x,t[29]=T);let E;t[30]!==x.handleQuickCommit||t[31]!==x.handleViewInGitHub||t[32]!==x.isCreatingPR||t[33]!==x.isLoading||t[34]!==x.userPrefs.autoGenerateCommitMessage||t[35]!==v||t[36]!==w||t[37]!==T||t[38]!==g?(E={unifiedGitStatus:g,autoGenerateCommitMessage:x.userPrefs.autoGenerateCommitMessage,isLoading:x.isLoading,isCreatingPR:x.isCreatingPR,isDirectCommitMode:v,onQuickCommit:x.handleQuickCommit,onCreatePR:w,onViewInGitHub:x.handleViewInGitHub,onOpenGitOpsMenu:T},t[30]=x.handleQuickCommit,t[31]=x.handleViewInGitHub,t[32]=x.isCreatingPR,t[33]=x.isLoading,t[34]=x.userPrefs.autoGenerateCommitMessage,t[35]=v,t[36]=w,t[37]=T,t[38]=g,t[39]=E):E=t[39],We(E);let D;if(t[40]!==x||t[41]!==_.isGeneratingMessage||t[42]!==v||t[43]!==o||t[44]!==c||t[45]!==g){let e=De(g),n=Ee(g,x.isLoading,x.isCreatingPR),i=x.isLoading||x.isCreatingPR,a=n&&!i,s;t[47]!==x.isCreatingPR||t[48]!==g?(s=Ce(g,x.isCreatingPR),t[47]=x.isCreatingPR,t[48]=g,t[49]=s):s=t[49];let l=s,u;t[50]!==x.isCreatingPR||t[51]!==x.isLoading||t[52]!==g?(u=x.isCreatingPR?(0,G.jsx)(be,{size:`sm`}):we(g,x.isCreatingPR,x.isLoading)??(0,G.jsx)(h,{className:`h-4 w-4 shrink-0`}),t[50]=x.isCreatingPR,t[51]=x.isLoading,t[52]=g,t[53]=u):u=t[53];let d=u,f=c&&!e?me:ce,p=g.defaultBranch??null,y=_.isGeneratingMessage&&x.isLoading,b,C,w,T,E,k;t[54]===x?(b=t[55],C=t[56],w=t[57],T=t[58],E=t[59],k=t[60]):(b=()=>void x.handleFetch(),C=()=>void x.handlePull(),w=()=>void x.handlePush(),T=()=>void x.handleOpenHistory(),E=()=>x.setIsPRDialogOpen(!0),k=()=>x.setIsRepoDialogOpen(!0),t[54]=x,t[55]=b,t[56]=C,t[57]=w,t[58]=T,t[59]=E,t[60]=k);let A,j;t[61]===x?(A=t[62],j=t[63]):(A=()=>void x.handleQuickCommit(),j=()=>void x.handleSyncBranch(),t[61]=x,t[62]=A,t[63]=j);let M;t[64]!==x.gitUser||t[65]!==x.handleGitOpsMenuOpenChange||t[66]!==x.handleViewInGitHub||t[67]!==x.isCreatingPR||t[68]!==x.isGitOpsMenuOpen||t[69]!==x.isLoading||t[70]!==x.isLoadingHistory||t[71]!==x.userPrefs.autoGenerateCommitMessage||t[72]!==v||t[73]!==o||t[74]!==p||t[75]!==y||t[76]!==b||t[77]!==C||t[78]!==w||t[79]!==T||t[80]!==E||t[81]!==k||t[82]!==A||t[83]!==j||t[84]!==g.canCreateRepo||t[85]!==g.commitsAheadOfDefault||t[86]!==g.defaultBranchAhead||t[87]!==g.defaultBranchBehind||t[88]!==g.hasChanges||t[89]!==g.hasRemoteBranch||t[90]!==g.hasUnpushedCommits||t[91]!==g.isRefreshing||t[92]!==g.prExists||t[93]!==g.remoteUrl||t[94]!==g.repoUrl||t[95]!==g.status?(M=(0,G.jsx)(Oe,{branchStatus:g.status,remoteUrl:g.remoteUrl,hasRemoteBranch:g.hasRemoteBranch,hasUnpushedCommits:g.hasUnpushedCommits,canCreateRepo:g.canCreateRepo,repoUrl:g.repoUrl,isRefreshing:g.isRefreshing,isCreatingPR:x.isCreatingPR,hasChanges:g.hasChanges,commitsAheadOfDefault:g.commitsAheadOfDefault,prExists:g.prExists,defaultBranch:p,defaultBranchAhead:g.defaultBranchAhead,defaultBranchBehind:g.defaultBranchBehind,gitUser:x.gitUser,isDirectCommitMode:v,autoGenerateCommitMessage:x.userPrefs.autoGenerateCommitMessage,isLoading:x.isLoading,isLoadingHistory:x.isLoadingHistory,isQuickCommitting:y,onFetch:b,onPull:C,onPush:w,onOpenHistory:T,onCreatePR:E,onCreateRepo:k,onViewInGitHub:x.handleViewInGitHub,onQuickCommit:A,onSyncWithDefault:j,open:x.isGitOpsMenuOpen,onOpenChange:x.handleGitOpsMenuOpenChange,layout:o}),t[64]=x.gitUser,t[65]=x.handleGitOpsMenuOpenChange,t[66]=x.handleViewInGitHub,t[67]=x.isCreatingPR,t[68]=x.isGitOpsMenuOpen,t[69]=x.isLoading,t[70]=x.isLoadingHistory,t[71]=x.userPrefs.autoGenerateCommitMessage,t[72]=v,t[73]=o,t[74]=p,t[75]=y,t[76]=b,t[77]=C,t[78]=w,t[79]=T,t[80]=E,t[81]=k,t[82]=A,t[83]=j,t[84]=g.canCreateRepo,t[85]=g.commitsAheadOfDefault,t[86]=g.defaultBranchAhead,t[87]=g.defaultBranchBehind,t[88]=g.hasChanges,t[89]=g.hasRemoteBranch,t[90]=g.hasUnpushedCommits,t[91]=g.isRefreshing,t[92]=g.prExists,t[93]=g.remoteUrl,t[94]=g.repoUrl,t[95]=g.status,t[96]=M):M=t[96];let N=M;D=o===`sidebar`?(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 items-center`,children:[(0,G.jsx)(R,{children:(0,G.jsxs)(O,{children:[(0,G.jsx)(ee,{asChild:!0,children:(0,G.jsx)(te,{asChild:!0,className:`min-w-0 flex-1`,children:(0,G.jsx)(`button`,{type:`button`,className:m(`min-w-0 w-full justify-start`,e&&`border-transparent bg-brand !text-white hover:bg-brand/90 hover:!text-white dark:bg-brand dark:hover:bg-brand/90`,e&&a&&`cursor-default opacity-50 hover:bg-brand hover:!text-white`,!e&&a&&`cursor-default`),disabled:i,"aria-disabled":n,onClick:n?void 0:x.handleMainButtonClick,children:(0,G.jsxs)(`span`,{className:m(`flex min-w-0 flex-1 items-center gap-2`,!e&&a&&`text-muted-foreground opacity-50`,e&&`font-medium text-white`),children:[d,(0,G.jsx)(`span`,{className:m(r.body,`truncate`),children:l})]})})})}),(0,G.jsx)(S,{side:`right`,children:Te(g)})]})}),N]}):o===`bar`?(0,G.jsxs)(`div`,{className:m(f,ue,le,`group min-w-0 gap-0 px-0`,e&&`border-transparent bg-brand !text-white hover:bg-brand/90 hover:!text-white dark:bg-brand dark:hover:bg-brand/90`,e&&a&&`cursor-default opacity-50 hover:bg-brand hover:!text-white`),children:[(0,G.jsx)(R,{children:(0,G.jsxs)(O,{children:[(0,G.jsx)(ee,{asChild:!0,children:(0,G.jsx)(`button`,{type:`button`,className:m(r.compact,`flex min-w-0 flex-1 items-center gap-1.5 rounded-l-full pl-3 pr-0.5 disabled:opacity-50`,a&&`cursor-default`,e&&`text-white`),disabled:i,"aria-disabled":n,onClick:n?void 0:x.handleMainButtonClick,children:(0,G.jsxs)(`span`,{className:m(`inline-flex min-w-0 items-center gap-1.5 truncate`,e&&`font-medium`,!e&&a&&`opacity-50`),children:[d,(0,G.jsx)(`span`,{className:`truncate`,children:l})]})})}),(0,G.jsx)(S,{side:`top`,children:Te(g)})]})}),N]}):(0,G.jsxs)(`div`,{className:m(`flex w-full flex-col gap-1 items-stretch [&_button]:w-full [&_button]:justify-start`),children:[(0,G.jsx)(R,{children:(0,G.jsxs)(O,{children:[(0,G.jsx)(ee,{asChild:!0,children:(0,G.jsx)(ie,{variant:`outline`,size:`sm`,className:m(`h-8 gap-1.5 rounded-md border`,e&&`border-transparent bg-brand !text-white hover:bg-brand/90 hover:!text-white dark:bg-brand dark:hover:bg-brand/90`,a&&`cursor-default hover:bg-background hover:text-foreground`),disabled:i,"aria-disabled":n,onClick:n?void 0:x.handleMainButtonClick,children:(0,G.jsxs)(`span`,{className:m(`inline-flex items-center gap-1.5`,e&&`text-white`,a&&!e&&`text-muted-foreground opacity-50`,a&&e&&`opacity-50`),children:[d,l]})})}),(0,G.jsx)(S,{children:Te(g)})]})}),N]}),t[40]=x,t[41]=_.isGeneratingMessage,t[42]=v,t[43]=o,t[44]=c,t[45]=g,t[46]=D}else D=t[46];let k;t[97]===x?k=t[98]:(k=e=>x.setUserPrefsState(t=>({...t,autoGenerateCommitMessage:e})),t[97]=x,t[98]=k);let A;t[99]!==x.commitMessage||t[100]!==x.handleCommit||t[101]!==x.handleGenerateCommitMessage||t[102]!==x.isCommitDialogOpen||t[103]!==x.setCommitMessage||t[104]!==x.setIsCommitDialogOpen||t[105]!==x.userPrefs.autoGenerateCommitMessage||t[106]!==_.isGeneratingMessage||t[107]!==k?(A={isOpen:x.isCommitDialogOpen,onOpenChange:x.setIsCommitDialogOpen,message:x.commitMessage,onMessageChange:x.setCommitMessage,autoGenerate:x.userPrefs.autoGenerateCommitMessage,onAutoGenerateChange:k,isGenerating:_.isGeneratingMessage,onGenerateMessage:x.handleGenerateCommitMessage,onCommit:x.handleCommit},t[99]=x.commitMessage,t[100]=x.handleCommit,t[101]=x.handleGenerateCommitMessage,t[102]=x.isCommitDialogOpen,t[103]=x.setCommitMessage,t[104]=x.setIsCommitDialogOpen,t[105]=x.userPrefs.autoGenerateCommitMessage,t[106]=_.isGeneratingMessage,t[107]=k,t[108]=A):A=t[108];let j;t[109]===x?j=t[110]:(j=e=>x.setUserPrefsState(t=>({...t,autoGeneratePRInfo:e})),t[109]=x,t[110]=j);let M;t[111]===x?M=t[112]:(M=e=>x.setUserPrefsState(t=>({...t,createBranchAfterPR:e})),t[111]=x,t[112]=M);let N;t[113]!==x.handleCreatePR||t[114]!==x.handleGeneratePRInfo||t[115]!==x.isPRDialogOpen||t[116]!==x.prDescription||t[117]!==x.prTitle||t[118]!==x.setIsPRDialogOpen||t[119]!==x.setPrDescription||t[120]!==x.setPrTitle||t[121]!==x.userPrefs.autoGeneratePRInfo||t[122]!==x.userPrefs.createBranchAfterPR||t[123]!==_.isGeneratingPRInfo||t[124]!==j||t[125]!==M?(N={isOpen:x.isPRDialogOpen,onOpenChange:x.setIsPRDialogOpen,title:x.prTitle,onTitleChange:x.setPrTitle,description:x.prDescription,onDescriptionChange:x.setPrDescription,isGeneratingInfo:_.isGeneratingPRInfo,onGenerateInfo:x.handleGeneratePRInfo,onCreatePR:x.handleCreatePR,autoGenerate:x.userPrefs.autoGeneratePRInfo,onAutoGenerateChange:j,createBranchAfterPR:x.userPrefs.createBranchAfterPR,onCreateBranchAfterPRChange:M},t[113]=x.handleCreatePR,t[114]=x.handleGeneratePRInfo,t[115]=x.isPRDialogOpen,t[116]=x.prDescription,t[117]=x.prTitle,t[118]=x.setIsPRDialogOpen,t[119]=x.setPrDescription,t[120]=x.setPrTitle,t[121]=x.userPrefs.autoGeneratePRInfo,t[122]=x.userPrefs.createBranchAfterPR,t[123]=_.isGeneratingPRInfo,t[124]=j,t[125]=M,t[126]=N):N=t[126];let P;t[127]===x?P=t[128]:(P=()=>x.handlePushAndCreatePR(),t[127]=x,t[128]=P);let ne;t[129]!==x.handleCancelPushBeforePR||t[130]!==x.isPushBeforePRDialogOpen||t[131]!==x.setIsPushBeforePRDialogOpen||t[132]!==P?(ne={isOpen:x.isPushBeforePRDialogOpen,onOpenChange:x.setIsPushBeforePRDialogOpen,onPushAndCreatePR:P,onCancel:x.handleCancelPushBeforePR},t[129]=x.handleCancelPushBeforePR,t[130]=x.isPushBeforePRDialogOpen,t[131]=x.setIsPushBeforePRDialogOpen,t[132]=P,t[133]=ne):ne=t[133];let F;t[134]===x?F=t[135]:(F=e=>x.setUserPrefsState(t=>({...t,privateRepositoryDefault:e})),t[134]=x,t[135]=F);let I;t[136]!==x.handleCreateRepo||t[137]!==x.isRepoDialogOpen||t[138]!==x.repoDescription||t[139]!==x.repoName||t[140]!==x.setIsRepoDialogOpen||t[141]!==x.setRepoDescription||t[142]!==x.setRepoName||t[143]!==x.userPrefs.privateRepositoryDefault||t[144]!==F?(I={isOpen:x.isRepoDialogOpen,onOpenChange:x.setIsRepoDialogOpen,name:x.repoName,onNameChange:x.setRepoName,description:x.repoDescription,onDescriptionChange:x.setRepoDescription,isPrivate:x.userPrefs.privateRepositoryDefault,onPrivateChange:F,onCreateRepo:x.handleCreateRepo},t[136]=x.handleCreateRepo,t[137]=x.isRepoDialogOpen,t[138]=x.repoDescription,t[139]=x.repoName,t[140]=x.setIsRepoDialogOpen,t[141]=x.setRepoDescription,t[142]=x.setRepoName,t[143]=x.userPrefs.privateRepositoryDefault,t[144]=F,t[145]=I):I=t[145];let re;t[146]!==x.commits||t[147]!==x.displayedCommits||t[148]!==x.handleScroll||t[149]!==x.isHistoryDialogOpen||t[150]!==x.isLoadingMore||t[151]!==x.setIsHistoryDialogOpen?(re={isOpen:x.isHistoryDialogOpen,onOpenChange:x.setIsHistoryDialogOpen,commits:x.commits,displayedCommits:x.displayedCommits,isLoadingMore:x.isLoadingMore,onScroll:x.handleScroll},t[146]=x.commits,t[147]=x.displayedCommits,t[148]=x.handleScroll,t[149]=x.isHistoryDialogOpen,t[150]=x.isLoadingMore,t[151]=x.setIsHistoryDialogOpen,t[152]=re):re=t[152];let L;t[153]===x?L=t[154]:(L=()=>x.setIsPullWithChangesDialogOpen(!1),t[153]=x,t[154]=L);let z;t[155]!==x.handleCommitFirstAndPull||t[156]!==x.handleStashAndPull||t[157]!==x.isPullWithChangesDialogOpen||t[158]!==x.setIsPullWithChangesDialogOpen||t[159]!==L?(z={isOpen:x.isPullWithChangesDialogOpen,onOpenChange:x.setIsPullWithChangesDialogOpen,onCommitFirst:x.handleCommitFirstAndPull,onStashAndPull:x.handleStashAndPull,onCancel:L},t[155]=x.handleCommitFirstAndPull,t[156]=x.handleStashAndPull,t[157]=x.isPullWithChangesDialogOpen,t[158]=x.setIsPullWithChangesDialogOpen,t[159]=L,t[160]=z):z=t[160];let B;t[161]!==x.isLoading||t[162]!==A||t[163]!==N||t[164]!==ne||t[165]!==I||t[166]!==re||t[167]!==z||t[168]!==g.currentBranch?(B=(0,G.jsx)(Ne,{isLoading:x.isLoading,currentBranch:g.currentBranch,commit:A,pullRequest:N,pushBeforePR:ne,createRepo:I,history:re,pullWithChanges:z}),t[161]=x.isLoading,t[162]=A,t[163]=N,t[164]=ne,t[165]=I,t[166]=re,t[167]=z,t[168]=g.currentBranch,t[169]=B):B=t[169];let V;return t[170]!==D||t[171]!==B?(V=(0,G.jsxs)(G.Fragment,{children:[D,B]}),t[170]=D,t[171]=B,t[172]=V):V=t[172],V}export{Ge as GitOpsButton};