tarsk 0.5.49 → 0.5.51
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/README.md +85 -3
- package/dist/index.js +10869 -8554
- package/dist/public/assets/{account-view-DxHV7OtO.js → account-view-CGokQA1o.js} +1 -1
- package/dist/public/assets/api-BRrGio-B.js +1 -0
- package/dist/public/assets/browser-tab-B3BybVD0.js +1 -0
- package/dist/public/assets/commit-dialog-BLzHl6oN.js +1 -0
- package/dist/public/assets/context-menu-yKNgVtVk.js +1 -0
- package/dist/public/assets/create-repo-dialog-DHFloJc3.js +1 -0
- package/dist/public/assets/{dialogs-config-BEazgV7k.js → dialogs-config-BF_RyK5j.js} +14 -14
- package/dist/public/assets/diff-view-DONeogdk.js +3 -0
- package/dist/public/assets/explorer-tab-view-C1Dex751.js +2 -0
- package/dist/public/assets/{explorer-tree-CiPMm5ck.js → explorer-tree-BmsrsMXJ.js} +1 -1
- package/dist/public/assets/explorer-view-1fAca9It.js +1 -0
- package/dist/public/assets/git-history-dialog-DXsSt3e0.js +1 -0
- package/dist/public/assets/git-ops-button-Cj3j4bvy.js +2 -0
- package/dist/public/assets/history-view-COEFPP2U.js +9 -0
- package/dist/public/assets/index-Dsj5zHdU.js +73 -0
- package/dist/public/assets/index-DzUALYN4.css +1 -0
- package/dist/public/assets/mcp-server-card-3bFOnHFO.js +1 -0
- package/dist/public/assets/merged-pr-dialog-C5vgSXwq.js +1 -0
- package/dist/public/assets/model-star-rating-GWRgO9pY.js +1 -0
- package/dist/public/assets/onboarding-B_n7I3ri.js +1 -0
- package/dist/public/assets/project-settings-view-DsVEiQM_.js +1 -0
- package/dist/public/assets/providers-list-view-BT5XZP-F.js +1 -0
- package/dist/public/assets/pull-request-dialog-BO_7fALs.js +1 -0
- package/dist/public/assets/pull-with-changes-dialog-DQSC-HUH.js +1 -0
- package/dist/public/assets/push-before-pr-dialog-B9evx_c7.js +1 -0
- package/dist/public/assets/radio-group-CNuRXtN5.js +1 -0
- package/dist/public/assets/react-vendor-D-z0br-z.js +16 -0
- package/dist/public/assets/settings-general-view-BaTUBgdM.js +1 -0
- package/dist/public/assets/settings-instructions-view-Bit7tYRh.js +1 -0
- package/dist/public/assets/settings-list-Cc_0YmxB.js +1 -0
- package/dist/public/assets/settings-mcp-servers-view-BcuuyWhI.js +5 -0
- package/dist/public/assets/{settings-models-skeleton-Cse6L-Nd.js → settings-models-skeleton-BfIx9XDs.js} +1 -1
- package/dist/public/assets/{settings-models-view-BAxf3eJq.js → settings-models-view-CNFB1Iqn.js} +1 -1
- package/dist/public/assets/settings-rules-view-BvelCH4j.js +8 -0
- package/dist/public/assets/settings-skills-view-DV-cA6cj.js +3 -0
- package/dist/public/assets/settings-slash-commands-view-CKxQnzse.js +1 -0
- package/dist/public/assets/settings-subagents-view-DAl5Db-p.js +2 -0
- package/dist/public/assets/{settings-system-prompt-view-B1vc2cgC.js → settings-system-prompt-view-BdwsxqMo.js} +1 -1
- package/dist/public/assets/settings-view-BxiazdKG.js +2 -0
- package/dist/public/assets/{skeleton-6mGMglV0.js → skeleton-DJZ5x6e0.js} +1 -1
- package/dist/public/assets/{slug-utils-BT1eqWhW.js → slug-utils-D4uxO5qv.js} +1 -1
- package/dist/public/assets/{tabs-iUSYYupj.js → tabs-TGCt-ze0.js} +1 -1
- package/dist/public/assets/{terminal-panel-DIpnKR-N.js → terminal-panel-Bh_CKydu.js} +2 -2
- package/dist/public/assets/todos-view-DDSSplmi.js +17 -0
- package/dist/public/assets/{ui-components-kSaUEA_X.js → ui-components-JEH8JAJ7.js} +1 -1
- package/dist/public/assets/{use-deferred-search-DGJskNBr.js → use-deferred-search-BZg7Bt7W.js} +1 -1
- package/dist/public/assets/{utils-CECQ_-6N.js → utils-H-1x3dmp.js} +1 -1
- package/dist/public/assets/{vosk-speech-CgILeNJR.js → vosk-speech-FJiKHPe4.js} +2 -2
- package/dist/public/assets/{web-DGalafxk.js → web-B4cuelyi.js} +1 -1
- package/dist/public/assets/{web-BD1sqxMq.js → web-CQpWcSn8.js} +1 -1
- package/dist/public/assets/{web-BWAZk7ug.js → web-Cq4yC7dg.js} +1 -1
- package/dist/public/assets/{web-Dt5YgbhM.js → web-DOZOaJlj.js} +1 -1
- package/dist/public/index.html +8 -8
- package/package.json +1 -1
- package/dist/public/assets/api-Dhzdgb40.js +0 -1
- package/dist/public/assets/browser-tab-qhf-xKwZ.js +0 -1
- package/dist/public/assets/commit-dialog-DcVXFOBP.js +0 -1
- package/dist/public/assets/context-menu-PIC-g8wy.js +0 -1
- package/dist/public/assets/create-repo-dialog-CsjpTBPU.js +0 -1
- package/dist/public/assets/diff-view-CGEl0YbC.js +0 -3
- package/dist/public/assets/explorer-tab-view--ib_BjId.js +0 -2
- package/dist/public/assets/explorer-view-odyQutTO.js +0 -1
- package/dist/public/assets/git-history-dialog-qUZ7Qsp4.js +0 -1
- package/dist/public/assets/git-ops-button-Bced-_39.js +0 -2
- package/dist/public/assets/history-view-BMVTxWTg.js +0 -9
- package/dist/public/assets/index-C7FLshNp.css +0 -1
- package/dist/public/assets/index-_SOdLUMq.js +0 -73
- package/dist/public/assets/mcp-server-card-ChdAZekt.js +0 -1
- package/dist/public/assets/merged-pr-dialog-DAXqT4Xe.js +0 -1
- package/dist/public/assets/model-star-rating-BzpXBjSo.js +0 -1
- package/dist/public/assets/onboarding-Bi5MieW-.js +0 -1
- package/dist/public/assets/project-settings-view-CHV6lJG4.js +0 -1
- package/dist/public/assets/providers-list-view-Dgid2Wui.js +0 -1
- package/dist/public/assets/pull-request-dialog-BFgRF5AH.js +0 -1
- package/dist/public/assets/pull-with-changes-dialog-oGP-j8Yw.js +0 -1
- package/dist/public/assets/push-before-pr-dialog-BQ0QC6Qu.js +0 -1
- package/dist/public/assets/radio-group-n9qyUxmu.js +0 -1
- package/dist/public/assets/react-vendor-iDwBzcYF.js +0 -16
- package/dist/public/assets/settings-general-view-Vwi9J6Tn.js +0 -1
- package/dist/public/assets/settings-instructions-view-8YIr0PO3.js +0 -1
- package/dist/public/assets/settings-list-owWkHWxE.js +0 -1
- package/dist/public/assets/settings-mcp-servers-view-CCXW_uet.js +0 -5
- package/dist/public/assets/settings-rules-view-D3KLTKVZ.js +0 -8
- package/dist/public/assets/settings-skills-view-DaqOna-w.js +0 -3
- package/dist/public/assets/settings-slash-commands-view-CN8_DTYX.js +0 -1
- package/dist/public/assets/settings-subagents-view-BIejA-ck.js +0 -2
- package/dist/public/assets/settings-view-DLBIkYoA.js +0 -2
- package/dist/public/assets/todos-view-BK6i_oPT.js +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e}from"./index-
|
|
1
|
+
import{p as e}from"./index-Dsj5zHdU.js";var t=class extends e{constructor(){super(),this.handleVisibilityChange=()=>{let e={isActive:document.hidden!==!0};this.notifyListeners(`appStateChange`,e),document.hidden?this.notifyListeners(`pause`,null):this.notifyListeners(`resume`,null)},document.addEventListener(`visibilitychange`,this.handleVisibilityChange,!1)}exitApp(){throw this.unimplemented(`Not implemented on web.`)}async getInfo(){throw this.unimplemented(`Not implemented on web.`)}async getLaunchUrl(){return{url:``}}async getState(){return{isActive:document.hidden!==!0}}async minimizeApp(){throw this.unimplemented(`Not implemented on web.`)}async toggleBackButtonHandler(){throw this.unimplemented(`Not implemented on web.`)}async getAppLanguage(){return{value:navigator.language.split(`-`)[0].toLowerCase()}}};export{t as AppWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e}from"./index-
|
|
1
|
+
import{p as e}from"./index-Dsj5zHdU.js";var t=class extends e{constructor(){super(...arguments),this.wakeLock=null,this._isSupported=typeof navigator<`u`&&`wakeLock`in navigator,this.handleVisibilityChange=()=>{document.visibilityState===`visible`&&this.keepAwake()}}async keepAwake(){this._isSupported||this.throwUnsupportedError(),this.wakeLock&&await this.allowSleep(),this.wakeLock=await navigator.wakeLock.request(`screen`),document.addEventListener(`visibilitychange`,this.handleVisibilityChange),document.addEventListener(`fullscreenchange`,this.handleVisibilityChange)}async allowSleep(){var e;this._isSupported||this.throwUnsupportedError(),(e=this.wakeLock)==null||e.release(),this.wakeLock=null,document.removeEventListener(`visibilitychange`,this.handleVisibilityChange),document.removeEventListener(`fullscreenchange`,this.handleVisibilityChange)}async isSupported(){return{isSupported:this._isSupported}}async isKeptAwake(){return this._isSupported||this.throwUnsupportedError(),{isKeptAwake:!!this.wakeLock}}throwUnsupportedError(){throw this.unavailable(`Screen Wake Lock API not available in this browser.`)}};export{t as KeepAwakeWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,p as n,r}from"./index-
|
|
1
|
+
import{a as e,i as t,p as n,r}from"./index-Dsj5zHdU.js";var i=class extends n{async stopAndHideScanner(){console.log(window.OSBarcodeWebScanner),window.OSBarcodeWebScanner&&(await window.OSBarcodeWebScanner.stop(),window.OSBarcodeWebScanner=null),document.getElementById(`cap-os-barcode-scanner-container-dialog`).style.display=`none`}buildScannerElement(){if(document.getElementById(`cap-os-barcode-scanner-container`)){document.getElementById(`cap-os-barcode-scanner-container`).className=`scanner-container-display`;return}let e=document.body.appendChild(document.createElement(`div`));e.id=`cap-os-barcode-scanner-container`;let t=document.createElement(`div`);t.id=`cap-os-barcode-scanner-container-dialog`,t.className=`scanner-dialog`;let n=document.createElement(`div`);n.className=`scanner-dialog-inner`;let r=document.createElement(`span`);r.id=`cap-os-barcode-scanner-close-button`,r.className=`close-button`,r.innerHTML=`×`,n.appendChild(r);let i=document.createElement(`p`);i.innerHTML=` `,n.appendChild(i);let a=document.createElement(`div`);a.className=`scanner-container-full-width`,a.id=`cap-os-barcode-scanner-container-scanner`,n.appendChild(a),t.appendChild(n),e.appendChild(t)}async scanBarcode(n){return this.buildScannerElement(),document.getElementById(`cap-os-barcode-scanner-container-dialog`).style.display=`block`,new Promise((i,a)=>{let o={facingMode:n.cameraDirection===1?`environment`:`user`,hasScannerButton:!1,scanButton:n.scanButton===void 0?!1:n.scanButton,showScanLine:!1,scanInstructions:n.scanInstructions?n.scanInstructions:``,orientation:n.scanOrientation?n.scanOrientation:r.PORTRAIT,showCameraSelection:n.web?.showCameraSelection?n.web.showCameraSelection:!1,typeHint:n.hint===17?void 0:n.hint,scannerFPS:n.web?.scannerFPS?n.web.scannerFPS:50},s=!1,c=document.getElementById(`cap-os-barcode-scanner-close-button`);c&&(c.onclick=async()=>{s||(s=!0,await this.stopAndHideScanner(),a(Error(`Couldn’t scan because the process was cancelled.`)))});let l=document.getElementById(`cap-os-barcode-scanner-container-scanner`);if(!l)throw Error(`Scanner Element is required for web`);window.OSBarcodeWebScanner=new e(l.id,{formatsToSupport:o.typeHint===void 0?void 0:[o.typeHint],verbose:void 0});let u={fps:o.scannerFPS,qrbox:l.getBoundingClientRect().width*(9/16)-10,aspectRatio:16/9,videoConstraints:{focusMode:`continuous`,height:{min:576,ideal:1920},deviceId:void 0,facingMode:o.facingMode}};window.OSBarcodeWebScanner.start({facingMode:o.facingMode},u,(e,n)=>{this.stopAndHideScanner(),i({ScanResult:e,format:n.result.format?.format??t.ALL})},e=>{[`NotFoundException`,`No barcode or QR code detected`,`No MultiFormat Readers were able to detect the code`].find(t=>e.indexOf(t)!==-1)||(this.stopAndHideScanner(),console.error(`[Scanner Web Error] ${e}`),a(e))})})}};export{i as CapacitorBarcodeScannerWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,p as t,s as n}from"./index-
|
|
1
|
+
import{o as e,p as t,s as n}from"./index-Dsj5zHdU.js";var r=class extends t{constructor(){super(...arguments),this.selectionStarted=!1}async impact(e){let t=this.patternForImpact(e?.style);this.vibrateWithPattern(t)}async notification(e){let t=this.patternForNotification(e?.type);this.vibrateWithPattern(t)}async vibrate(e){let t=e?.duration||300;this.vibrateWithPattern([t])}async selectionStart(){this.selectionStarted=!0}async selectionChanged(){this.selectionStarted&&this.vibrateWithPattern([70])}async selectionEnd(){this.selectionStarted=!1}patternForImpact(t=e.Heavy){return t===e.Medium?[43]:t===e.Light?[20]:[61]}patternForNotification(e=n.Success){return e===n.Warning?[30,40,30,50,60]:e===n.Error?[27,45,50]:[35,65,21]}vibrateWithPattern(e){if(navigator.vibrate)navigator.vibrate(e);else throw this.unavailable(`Browser does not support the vibrate API`)}};export{r as HapticsWeb};
|
package/dist/public/index.html
CHANGED
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
<meta name="apple-mobile-web-app-title" content="Tarsk" />
|
|
23
23
|
|
|
24
24
|
<title>Tarsk</title>
|
|
25
|
-
<script type="module" crossorigin src="/assets/index-
|
|
25
|
+
<script type="module" crossorigin src="/assets/index-Dsj5zHdU.js"></script>
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-aKtaBQYM.js">
|
|
27
27
|
<link rel="modulepreload" crossorigin href="/assets/monaco-CZnIWXyV.js">
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/dialogs-config-
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/history-view-
|
|
30
|
-
<link rel="modulepreload" crossorigin href="/assets/onboarding-
|
|
31
|
-
<link rel="modulepreload" crossorigin href="/assets/vosk-speech-
|
|
32
|
-
<link rel="modulepreload" crossorigin href="/assets/react-vendor-
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/utils-
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/dialogs-config-BF_RyK5j.js">
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/history-view-COEFPP2U.js">
|
|
30
|
+
<link rel="modulepreload" crossorigin href="/assets/onboarding-B_n7I3ri.js">
|
|
31
|
+
<link rel="modulepreload" crossorigin href="/assets/vosk-speech-FJiKHPe4.js">
|
|
32
|
+
<link rel="modulepreload" crossorigin href="/assets/react-vendor-D-z0br-z.js">
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/assets/utils-H-1x3dmp.js">
|
|
34
34
|
<link rel="stylesheet" crossorigin href="/assets/monaco-Br_kD0ds.css">
|
|
35
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
35
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DzUALYN4.css">
|
|
36
36
|
</head>
|
|
37
37
|
<body class="font-sans antialiased">
|
|
38
38
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$n as e,Jn as t,Kn as n,Qn as r,Xn as i,Zn as a,qn as o}from"./dialogs-config-BEazgV7k.js";async function s(e,n,r=!1){return t(`api/threads/${o(e)}/explorer?path=${encodeURIComponent(n)}&recursive=${r}`)}async function c(e,n){return t(`api/threads/${o(e)}/ai-file?path=${encodeURIComponent(n)}`)}async function l(t,n,r){return e(`api/threads/${o(t)}/ai-file`,{path:n,content:r})}async function u(e,t){return n(`api/threads/${o(e)}/explorer?path=${encodeURIComponent(t)}`)}async function d(e,t,n){return a(`api/threads/${o(e)}/explorer`,{path:t,newName:n})}async function f(e,t,n){return r(`api/threads/${o(e)}/explorer/file`,{dirPath:t,name:n})}async function p(e,t){return i(`api/threads/${o(e)}/explorer/media?path=${encodeURIComponent(t)}`)}async function m(e,t,n){return r(`api/threads/${o(e)}/explorer/folder`,{dirPath:t,name:n})}async function h(e,t){return r(`api/threads/${o(e)}/explorer/open`,{path:t})}export{c as a,d as c,p as i,l,m as n,s as o,u as r,h as s,f as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Fo as t,Fr as n,Ha as r,Ir as i,Mi as a,Na as o,Nr as s,Pr as c,Wn as l,Xi as u,in as d,ka as f,ls as p,os as m,qr as h,ro as g,ss as _}from"./dialogs-config-BEazgV7k.js";import{R as v,_ as y,b,j as x,m as S,n as C}from"./index-_SOdLUMq.js";var w=_(),T=e(p(),1),E=m();function D(e){let t=e.trim();return t?(!t.startsWith(`http://`)&&!t.startsWith(`https://`)&&(t=`http://${t}`),t):``}function O(e){return e?e.querySelector(`electrobun-webview`):null}function k(e){e.webviewId!=null&&(e.toggleHidden(!0),e.togglePassthrough(!0))}function A(e){e.webviewId!=null&&(e.toggleHidden(!1),e.togglePassthrough(!1),e.syncDimensions(!0))}function j(e,t){let n=!1,r=0;function i(){if(!n){if(e.webviewId==null){r=requestAnimationFrame(i);return}t&&e.getAttribute(`src`)!==t&&e.loadURL(t),A(e)}}return r=requestAnimationFrame(i),function(){n=!0,cancelAnimationFrame(r)}}function M(e){let t=(0,w.c)(9),{onClick:n,label:r,children:a,isActive:o}=e,l=`p-1.5 rounded transition-colors ${o!==void 0&&o?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground hover:bg-background/50`}`,u;t[0]!==a||t[1]!==n||t[2]!==l?(u=(0,E.jsx)(i,{asChild:!0,children:(0,E.jsx)(`button`,{type:`button`,onClick:n,className:l,children:a})}),t[0]=a,t[1]=n,t[2]=l,t[3]=u):u=t[3];let d;t[4]===r?d=t[5]:(d=(0,E.jsx)(c,{children:r}),t[4]=r,t[5]=d);let f;return t[6]!==u||t[7]!==d?(f=(0,E.jsxs)(s,{children:[u,d]}),t[6]=u,t[7]=d,t[8]=f):f=t[8],f}function N(){let{activeMainTab:e}=x(),{devServerUrl:i}=b(),{browserResetTrigger:s,browserDeviceMode:c,setBrowserDeviceMode:p}=C(),m=v(e=>e.selectedProjectId),_=v(e=>e.projects).find(e=>e.projectId===m),[w,N]=(0,T.useState)(``),[P,F]=(0,T.useState)(``),[I,L]=(0,T.useState)(``),[R,z]=(0,T.useState)(c),B=(0,T.useRef)(null),V=(0,T.useRef)(I),H=(0,T.useRef)(null),U=(0,T.useRef)(null),W=l(),G=S(),K=W&&e===`browser`&&!!P,[q,J]=(0,T.useState)(K);V.current=I,(0,T.useEffect)(()=>{z(c)},[c]);function Y(e){z(e),p(e)}function X(){return B.current??O(U.current)}(0,T.useLayoutEffect)(()=>{if(!W)return;if(K){J(!0);return}let e=X();e&&k(e);let t=requestAnimationFrame(()=>{J(!1)});return function(){cancelAnimationFrame(t)}},[K,W,P]),(0,T.useEffect)(()=>{F(``),L(``),N(``);let e=B.current;e&&(e.src=``),H.current&&(H.current.src=``)},[s]),(0,T.useEffect)(()=>{if(!i)return;let e=D(i);N(e),F(e),L(e)},[i]);let Z=(0,T.useCallback)(e=>{B.current=e,e&&j(e,V.current)},[]);(0,T.useLayoutEffect)(()=>{if(!W||!q)return;let e=X();!e||e.webviewId==null||A(e)},[q,W,P,R]),(0,T.useEffect)(()=>{let e=X();if(!(!W||!e||!I||!q))return j(e,I)},[I,W,P,q]),(0,T.useEffect)(()=>{let e=X();if(!W||!e||!q)return;function t(e){let t=typeof e.detail==`string`?e.detail:P;t&&(F(t),L(``),N(t))}function n(e){let t=typeof e.detail==`string`?e.detail:P;t&&(F(t),N(t))}function r(e){let t=e.detail,n=typeof t==`string`?t:typeof t==`object`&&t&&`url`in t?String(t.url):``;n&&d(n)}return e.on(`did-navigate`,t),e.on(`did-navigate-in-page`,n),e.on(`new-window-open`,r),function(){e.off(`did-navigate`,t),e.off(`did-navigate-in-page`,n),e.off(`new-window-open`,r)}},[P,W,q]);function Q(e){let t=D(e);t&&(N(t),F(t),L(t))}function ee(e){e.key===`Enter`&&Q(w)}function te(){if(W){let e=X();e&&e.reload();return}let e=H.current;if(!e)return;let t=e.src;e.src=``,requestAnimationFrame(()=>{e.src=t})}let $={desktop:{width:`100%`,height:`100%`},tablet:{width:`768px`,height:`1024px`},mobile:{width:`375px`,height:`667px`}}[R];function ne(){return W?q?(0,T.createElement)(`electrobun-webview`,{ref:Z,src:P,preload:G,renderer:`native`,className:`block h-full w-full bg-background`}):null:(0,E.jsx)(`iframe`,{ref:H,src:P,className:`h-full w-full border-none`,title:`Browser`})}return(0,E.jsx)(n,{children:(0,E.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,E.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border px-3 py-2`,children:[(0,E.jsx)(h,{type:`text`,value:w,onChange:e=>N(e.target.value),onKeyDown:ee,placeholder:`Enter URL...`,className:a(`flex-1 rounded-full bg-muted font-mono`),spellCheck:!1}),P&&(0,E.jsx)(M,{onClick:te,label:`Refresh page`,children:(0,E.jsx)(r,{size:15})}),P&&(0,E.jsxs)(`div`,{className:`flex items-center rounded-md bg-muted p-0.5`,children:[(0,E.jsx)(M,{onClick:()=>Y(`desktop`),label:`Desktop view`,isActive:R===`desktop`,children:(0,E.jsx)(g,{size:15})}),(0,E.jsx)(M,{onClick:()=>Y(`tablet`),label:`Tablet view`,isActive:R===`tablet`,children:(0,E.jsx)(f,{size:15})}),(0,E.jsx)(M,{onClick:()=>Y(`mobile`),label:`Mobile view`,isActive:R===`mobile`,children:(0,E.jsx)(o,{size:15})})]}),P&&(0,E.jsx)(M,{onClick:()=>void d(P),label:`Open in external browser`,children:(0,E.jsx)(t,{size:15})})]}),P?(0,E.jsx)(`div`,{ref:U,className:`flex min-h-0 flex-1 items-center justify-center bg-background`,children:(0,E.jsx)(`div`,{className:`overflow-hidden border border-border bg-background shadow-sm ${R===`desktop`?`h-full w-full rounded-none border-0 shadow-none`:`rounded-lg`}`,style:{width:$.width,height:$.height,maxWidth:`100%`,maxHeight:`100%`},children:ne()})}):(0,E.jsx)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-6 text-muted-foreground`,children:m&&_?.runCommand?(0,E.jsx)(y,{projectId:m,runCommand:_.runCommand,large:!0}):(0,E.jsx)(`p`,{className:u.body,children:`Enter a URL to browse`})})]})})}export{N as BrowserTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$r as e,Ai as t,Fr as n,Gr as r,Ir as i,Jr as a,Ma as o,Nr as s,Pr as c,Qr as l,Xi as u,Xr as d,Zr as f,ei as p,os as m,ss as h,uo as g}from"./dialogs-config-BEazgV7k.js";import{a as _}from"./onboarding-Bi5MieW-.js";import{I as v}from"./index-_SOdLUMq.js";var y=h(),b=m();function x(m){let h=(0,y.c)(47),{open:x,onOpenChange:S,commitMessage:C,onCommitMessageChange:w,autoGenerateCommitMessage:T,onAutoGenerateChange:E,isGeneratingMessage:D,isLoading:O,onGenerateMessage:k,onCommit:A,currentBranch:j}=m,M;h[0]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,b.jsx)(p,{children:`Commit Changes`}),h[0]=M):M=h[0];let N;h[1]===j?N=h[2]:(N=(0,b.jsxs)(e,{children:[M,(0,b.jsxs)(f,{children:[`Enter a commit message for your changes on branch `,j]})]}),h[1]=j,h[2]=N);let P;h[3]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,b.jsx)(r,{htmlFor:`commit-message`,children:`Commit Message`}),h[3]=P):P=h[3];let F;h[4]===w?F=h[5]:(F=e=>w(e.target.value),h[4]=w,h[5]=F);let I;h[6]!==C||h[7]!==F?(I=(0,b.jsx)(v,{id:`commit-message`,placeholder:`Enter commit message...`,value:C,onChange:F,className:`pr-10 h-full min-h-[14rem] resize-none`}),h[6]=C,h[7]=F,h[8]=I):I=h[8];let L=D||O,R;h[9]===D?R=h[10]:(R=D?(0,b.jsx)(g,{className:`h-3.5 w-3.5 animate-spin`}):(0,b.jsx)(o,{className:`h-3.5 w-3.5`}),h[9]=D,h[10]=R);let z;h[11]!==k||h[12]!==L||h[13]!==R?(z=(0,b.jsx)(i,{asChild:!0,children:(0,b.jsx)(t,{type:`button`,variant:`ghost`,size:`icon`,className:`absolute top-2 right-2 h-6 w-6`,onClick:k,disabled:L,children:R})}),h[11]=k,h[12]=L,h[13]=R,h[14]=z):z=h[14];let B=D?`Generating commit message...`:`Generate commit message with AI`,V;h[15]===B?V=h[16]:(V=(0,b.jsx)(c,{children:B}),h[15]=B,h[16]=V);let H;h[17]!==V||h[18]!==z?(H=(0,b.jsx)(n,{children:(0,b.jsxs)(s,{children:[z,V]})}),h[17]=V,h[18]=z,h[19]=H):H=h[19];let U;h[20]!==H||h[21]!==I?(U=(0,b.jsx)(`div`,{className:`grid gap-4 py-4 flex-1 min-h-0`,children:(0,b.jsxs)(`div`,{className:`grid gap-2 flex-1 min-h-0`,children:[P,(0,b.jsxs)(`div`,{className:`relative flex-1 min-h-0`,children:[I,H]})]})}),h[20]=H,h[21]=I,h[22]=U):U=h[22];let W;h[23]===E?W=h[24]:(W=e=>E(e===!0),h[23]=E,h[24]=W);let G;h[25]!==T||h[26]!==W?(G=(0,b.jsx)(_,{id:`auto-generate`,checked:T,onCheckedChange:W}),h[25]=T,h[26]=W,h[27]=G):G=h[27];let K;h[28]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,b.jsx)(r,{htmlFor:`auto-generate`,className:u.labelNormal,children:`Auto generate commit messages`}),h[28]=K):K=h[28];let q;h[29]===G?q=h[30]:(q=(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[G,K]}),h[29]=G,h[30]=q);let J;h[31]!==C||h[32]!==O?(J=O||!C.trim(),h[31]=C,h[32]=O,h[33]=J):J=h[33];let Y=O?`Committing...`:`Commit`,X;h[34]!==A||h[35]!==J||h[36]!==Y?(X=(0,b.jsx)(l,{children:(0,b.jsx)(t,{onClick:A,disabled:J,children:Y})}),h[34]=A,h[35]=J,h[36]=Y,h[37]=X):X=h[37];let Z;h[38]!==U||h[39]!==q||h[40]!==X||h[41]!==N?(Z=(0,b.jsxs)(d,{className:`flex max-w-2xl flex-col max-md:top-[max(1rem,env(safe-area-inset-top,0px))] max-md:max-h-[calc(100dvh-2rem)] max-md:translate-y-0 max-md:overflow-y-auto max-md:data-[state=closed]:slide-out-to-top max-md:data-[state=open]:slide-in-from-top max-md:data-[state=closed]:slide-out-to-left-0 max-md:data-[state=open]:slide-in-from-left-0 max-md:data-[state=closed]:zoom-out-100 max-md:data-[state=open]:zoom-in-100 md:h-[min(36rem,85dvh)]`,children:[N,U,q,X]}),h[38]=U,h[39]=q,h[40]=X,h[41]=N,h[42]=Z):Z=h[42];let Q;return h[43]!==S||h[44]!==x||h[45]!==Z?(Q=(0,b.jsx)(a,{open:x,onOpenChange:S,children:Z}),h[43]=S,h[44]=x,h[45]=Z,h[46]=Q):Q=h[46],Q}export{x as CommitDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ho as t,Jo as n,Mi as r,Xi as i,Zo as a,ls as o,os as s,ss as c}from"./dialogs-config-BEazgV7k.js";import{A as l,C as u,D as d,E as f,O as p,S as m,T as h,b as g,j as _,k as v,w as y,x as b}from"./react-vendor-iDwBzcYF.js";var x=c(),S=e(o(),1),C=s(),w=d,T=_,E=S.forwardRef((e,t)=>{let a=(0,x.c)(14),o,s,c,u;a[0]===e?(o=a[1],s=a[2],c=a[3],u=a[4]):({className:s,inset:c,children:o,...u}=e,a[0]=e,a[1]=o,a[2]=s,a[3]=c,a[4]=u);let d;a[5]!==s||a[6]!==c?(d=r(r(i.body,`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`),c&&`pl-8`,s),a[5]=s,a[6]=c,a[7]=d):d=a[7];let f;a[8]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,C.jsx)(n,{className:`ml-auto h-4 w-4`}),a[8]=f):f=a[8];let p;return a[9]!==o||a[10]!==u||a[11]!==t||a[12]!==d?(p=(0,C.jsxs)(l,{ref:t,className:d,...u,children:[o,f]}),a[9]=o,a[10]=u,a[11]=t,a[12]=d,a[13]=p):p=a[13],p});E.displayName=l.displayName;var D=S.forwardRef((e,t)=>{let n=(0,x.c)(9),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=r(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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`,i),n[3]=i,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,C.jsx)(v,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});D.displayName=v.displayName;var O=S.forwardRef((e,t)=>{let n=(0,x.c)(9),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=r(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 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`,i),n[3]=i,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,C.jsx)(h,{children:(0,C.jsx)(b,{ref:t,className:o,...a})}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});O.displayName=b.displayName;var k=S.forwardRef((e,t)=>{let n=(0,x.c)(11),a,o,s;n[0]===e?(a=n[1],o=n[2],s=n[3]):({className:a,inset:o,...s}=e,n[0]=e,n[1]=a,n[2]=o,n[3]=s);let c;n[4]!==a||n[5]!==o?(c=r(r(i.body,`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`),o&&`pl-8`,a),n[4]=a,n[5]=o,n[6]=c):c=n[6];let l;return n[7]!==s||n[8]!==t||n[9]!==c?(l=(0,C.jsx)(m,{ref:t,className:c,...s}),n[7]=s,n[8]=t,n[9]=c,n[10]=l):l=n[10],l});k.displayName=m.displayName;var A=S.forwardRef((e,t)=>{let n=(0,x.c)(14),o,s,c,l;n[0]===e?(o=n[1],s=n[2],c=n[3],l=n[4]):({className:c,children:s,checked:o,...l}=e,n[0]=e,n[1]=o,n[2]=s,n[3]=c,n[4]=l);let d;n[5]===c?d=n[6]:(d=r(r(i.body,`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`),c),n[5]=c,n[6]=d);let f;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,C.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,C.jsx)(u,{children:(0,C.jsx)(a,{className:`h-4 w-4`})})}),n[7]=f):f=n[7];let p;return n[8]!==o||n[9]!==s||n[10]!==l||n[11]!==t||n[12]!==d?(p=(0,C.jsxs)(g,{ref:t,className:d,checked:o,...l,children:[f,s]}),n[8]=o,n[9]=s,n[10]=l,n[11]=t,n[12]=d,n[13]=p):p=n[13],p});A.displayName=g.displayName;var j=S.forwardRef((e,n)=>{let a=(0,x.c)(12),o,s,c;a[0]===e?(o=a[1],s=a[2],c=a[3]):({className:s,children:o,...c}=e,a[0]=e,a[1]=o,a[2]=s,a[3]=c);let l;a[4]===s?l=a[5]:(l=r(r(i.body,`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`),s),a[4]=s,a[5]=l);let d;a[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,C.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,C.jsx)(u,{children:(0,C.jsx)(t,{className:`h-2 w-2 fill-current`})})}),a[6]=d):d=a[6];let p;return a[7]!==o||a[8]!==c||a[9]!==n||a[10]!==l?(p=(0,C.jsxs)(f,{ref:n,className:l,...c,children:[d,o]}),a[7]=o,a[8]=c,a[9]=n,a[10]=l,a[11]=p):p=a[11],p});j.displayName=f.displayName;var M=S.forwardRef((e,t)=>{let n=(0,x.c)(11),a,o,s;n[0]===e?(a=n[1],o=n[2],s=n[3]):({className:a,inset:o,...s}=e,n[0]=e,n[1]=a,n[2]=o,n[3]=s);let c;n[4]!==a||n[5]!==o?(c=r(r(i.body,`px-2 py-1.5 font-semibold text-foreground`),o&&`pl-8`,a),n[4]=a,n[5]=o,n[6]=c):c=n[6];let l;return n[7]!==s||n[8]!==t||n[9]!==c?(l=(0,C.jsx)(y,{ref:t,className:c,...s}),n[7]=s,n[8]=t,n[9]=c,n[10]=l):l=n[10],l});M.displayName=y.displayName;var N=S.forwardRef((e,t)=>{let n=(0,x.c)(9),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=r(`-mx-1 my-1 h-px bg-border`,i),n[3]=i,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,C.jsx)(p,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});N.displayName=p.displayName;var P=e=>{let t=(0,x.c)(8),n,a;t[0]===e?(n=t[1],a=t[2]):({className:n,...a}=e,t[0]=e,t[1]=n,t[2]=a);let o;t[3]===n?o=t[4]:(o=r(i.compact,`ml-auto tracking-widest text-muted-foreground`,n),t[3]=n,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s=(0,C.jsx)(`span`,{className:o,...a}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s};P.displayName=`ContextMenuShortcut`;export{T as a,N as i,O as n,k as r,w as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$r as e,Ai as t,Gr as n,Jr as r,Qr as i,Xi as a,Xr as o,Zr as s,ei as c,os as l,qr as u,ss as d}from"./dialogs-config-BEazgV7k.js";import{a as f}from"./onboarding-Bi5MieW-.js";import{I as p}from"./index-_SOdLUMq.js";var m=d(),h=l();function g(l){let d=(0,m.c)(48),{open:g,onOpenChange:_,repoName:v,onRepoNameChange:y,repoDescription:b,onRepoDescriptionChange:x,isPrivateRepo:S,onPrivateRepoChange:C,isLoading:w,onCreateRepo:T}=l,E;d[0]!==_||d[1]!==x||d[2]!==y?(E=e=>{e||(y(``),x(``)),_(e)},d[0]=_,d[1]=x,d[2]=y,d[3]=E):E=d[3];let D;d[4]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,h.jsxs)(e,{children:[(0,h.jsx)(c,{children:`Create GitHub Repository`}),(0,h.jsx)(s,{children:`Create a new GitHub repository and push your local repository`})]}),d[4]=D):D=d[4];let O;d[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,h.jsx)(n,{htmlFor:`repo-name`,children:`Repository Name (optional)`}),d[5]=O):O=d[5];let k;d[6]===y?k=d[7]:(k=e=>y(e.target.value),d[6]=y,d[7]=k);let A;d[8]!==v||d[9]!==k?(A=(0,h.jsxs)(`div`,{className:`grid gap-2`,children:[O,(0,h.jsx)(u,{id:`repo-name`,placeholder:`Leave empty to use current folder name`,value:v,onChange:k})]}),d[8]=v,d[9]=k,d[10]=A):A=d[10];let j;d[11]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,h.jsx)(n,{htmlFor:`repo-description`,children:`Description (optional)`}),d[11]=j):j=d[11];let M;d[12]===x?M=d[13]:(M=e=>x(e.target.value),d[12]=x,d[13]=M);let N;d[14]!==b||d[15]!==M?(N=(0,h.jsxs)(`div`,{className:`grid gap-2`,children:[j,(0,h.jsx)(p,{id:`repo-description`,placeholder:`Enter repository description...`,value:b,onChange:M,rows:3})]}),d[14]=b,d[15]=M,d[16]=N):N=d[16];let P;d[17]===C?P=d[18]:(P=e=>C(e===!0),d[17]=C,d[18]=P);let F;d[19]!==S||d[20]!==P?(F=(0,h.jsx)(f,{id:`repo-private`,checked:S,onCheckedChange:P}),d[19]=S,d[20]=P,d[21]=F):F=d[21];let I;d[22]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,h.jsx)(n,{htmlFor:`repo-private`,className:a.labelNormal,children:`Private repository`}),d[22]=I):I=d[22];let L;d[23]===F?L=d[24]:(L=(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[F,I]}),d[23]=F,d[24]=L);let R;d[25]!==L||d[26]!==A||d[27]!==N?(R=(0,h.jsxs)(`div`,{className:`grid gap-4 py-4`,children:[A,N,L]}),d[25]=L,d[26]=A,d[27]=N,d[28]=R):R=d[28];let z;d[29]===_?z=d[30]:(z=()=>_(!1),d[29]=_,d[30]=z);let B;d[31]!==w||d[32]!==z?(B=(0,h.jsx)(t,{variant:`outline`,onClick:z,disabled:w,children:`Cancel`}),d[31]=w,d[32]=z,d[33]=B):B=d[33];let V=w?`Creating...`:`Create & Push`,H;d[34]!==w||d[35]!==T||d[36]!==V?(H=(0,h.jsx)(t,{onClick:T,disabled:w,children:V}),d[34]=w,d[35]=T,d[36]=V,d[37]=H):H=d[37];let U;d[38]!==B||d[39]!==H?(U=(0,h.jsxs)(i,{children:[B,H]}),d[38]=B,d[39]=H,d[40]=U):U=d[40];let W;d[41]!==R||d[42]!==U?(W=(0,h.jsxs)(o,{children:[D,R,U]}),d[41]=R,d[42]=U,d[43]=W):W=d[43];let G;return d[44]!==g||d[45]!==E||d[46]!==W?(G=(0,h.jsx)(r,{open:g,onOpenChange:E,children:W}),d[44]=g,d[45]=E,d[46]=W,d[47]=G):G=d[47],G}export{g as CreateRepoDialog};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$ as t,$r as n,Ai as r,Do as i,Ft as a,Hn as o,Ir as s,Jo as c,Jr as l,K as u,Mi as d,Nr as f,Pr as p,Qr as m,To as h,Ua as g,Xi as _,Xr as v,Xt as y,Yo as b,ao as x,c as S,ei as C,eo as w,lo as T,ls as E,lt as D,os as O,so as k,ss as A,st as j,to as ee,wo as M,ya as N}from"./dialogs-config-BEazgV7k.js";import{N as P}from"./react-vendor-iDwBzcYF.js";import{t as F}from"./monaco-CZnIWXyV.js";import{I,a as te,l as L,n as R,o as ne}from"./history-view-BMVTxWTg.js";import{d as re}from"./onboarding-Bi5MieW-.js";import{n as ie}from"./utils-CECQ_-6N.js";import{B as ae,F as oe,I as se,L as ce,R as le,c as ue,d as de,f as fe,l as z,u as pe,y as me}from"./index-_SOdLUMq.js";import{a as B,n as he,r as ge,t as _e}from"./context-menu-PIC-g8wy.js";var V=e(E(),1),H=A(),U=O();function W(e){let t=(0,H.c)(20),{children:n,title:r,subtitle:i,headerAction:a,footer:o}=e,s;t[0]===r?s=t[1]:(s=r&&(0,U.jsx)(`span`,{className:_.sectionTitle,children:r}),t[0]=r,t[1]=s);let c;t[2]===s?c=t[3]:(c=(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:s}),t[2]=s,t[3]=c);let l;t[4]===a?l=t[5]:(l=a&&(0,U.jsx)(`div`,{className:`flex items-center gap-2 ml-auto`,children:a}),t[4]=a,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]!==i||t[10]!==u?(d=(0,U.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 border-b border-sidebar-border px-4 py-6`,children:[u,i]}),t[9]=i,t[10]=u,t[11]=d):d=t[11];let f;t[12]===n?f=t[13]:(f=(0,U.jsx)(S,{className:`min-h-0 flex-1`,children:n}),t[12]=n,t[13]=f);let p;t[14]===o?p=t[15]:(p=o&&(0,U.jsx)(`div`,{className:`border-t border-sidebar-border`,children:o}),t[14]=o,t[15]=p);let m;return t[16]!==d||t[17]!==f||t[18]!==p?(m=(0,U.jsxs)(`div`,{className:`flex h-full min-h-0 w-full flex-col`,children:[d,f,p]}),t[16]=d,t[17]=f,t[18]=p,t[19]=m):m=t[19],m}function ve(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 G={added:`text-green-500`,deleted:`text-red-500`,untracked:`text-green-500`,renamed:`text-blue-500`,modified:`text-orange-500`},ye={added:`A`,deleted:`D`,untracked:`U`,renamed:`R`,modified:`M`};function K(e){return d(d(_.compact,`status-badge font-mono font-semibold`),G[e]??`text-orange-500`)}function be(e){return ye[e]??`M`}var q=I(e=>(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsxs)(`span`,{className:e.v0,children:[e.v1,` file`,e.v2]}),(0,U.jsxs)(`span`,{className:e.v3,children:[`+`,e.v4]}),(0,U.jsxs)(`span`,{className:e.v5,children:[`-`,e.v6]})]}),{name:`JSX_stats_1`,portals:[`v1`,`v2`,`v4`,`v6`]}),xe=I(e=>e.v0,{name:`DiffTree_1`,portals:[`v0`]}),J=I(e=>e.v0,{name:`DiffTree_2`,portals:[`v0`]}),Se=I(e=>e.v0,{name:`DiffTree_3`,portals:[`v0`]}),Ce=function(e){let t=(0,H.c)(32),{treeData:n,files:r,error:a,selectedFileIndex:o,onFileSelect:s,onRevertFile:l}=e,u;t[0]===r?u=t[1]:(u=r.reduce(Y,0),t[0]=r,t[1]=u);let f=u,p;t[2]===r?p=t[3]:(p=r.reduce(Oe,0),t[2]=r,t[3]=p);let m=p,v;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(v=d(_.compact,`text-muted-foreground`),t[4]=v):v=t[4];let y=r.length,b=r.length===1?``:`s`,x;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(x=d(_.compact,`text-green-500`),t[5]=x):x=t[5];let S;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=d(_.compact,`text-red-500`),t[6]=S):S=t[6];let C;t[7]!==r.length||t[8]!==b||t[9]!==f||t[10]!==m?(C=(0,U.jsx)(q,{v0:v,v1:y,v2:b,v3:x,v4:f,v5:S,v6:m}),t[7]=r.length,t[8]=b,t[9]=f,t[10]=m,t[11]=C):C=t[11];let w=C;if(a){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=d(_.compact,`text-destructive text-center`),t[12]=e):e=t[12];let n;t[13]===a?n=t[14]:(n=(0,U.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-4 pt-7 pb-2`,children:(0,U.jsx)(`p`,{className:e,children:a})}),t[13]=a,t[14]=n);let r;return t[15]!==w||t[16]!==n?(r=(0,U.jsx)(xe,{v0:(0,U.jsx)(W,{title:`Review Changes`,subtitle:w,children:n})}),t[15]=w,t[16]=n,t[17]=r):r=t[17],r}if(r.length===0){let e;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,U.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-4 pt-7 pb-2`,children:(0,U.jsx)(`p`,{className:d(_.compact,_.bodyMuted,`text-center`),children:`No changes to review`})}),t[18]=e):e=t[18];let n;return t[19]===w?n=t[20]:(n=(0,U.jsx)(J,{v0:(0,U.jsx)(W,{title:`Review Changes`,subtitle:w,children:e})}),t[19]=w,t[20]=n),n}let T;t[21]!==r||t[22]!==s||t[23]!==l||t[24]!==o?(T=(e,t)=>{let{isOpen:n,toggle:a}=t,u=!!e.children,f=(0,U.jsxs)(re,{onClick:()=>{u?a():e.fileIndex!==void 0&&s(e.fileIndex)},selected:!u&&e.fileIndex===o,className:`gap-1.5`,children:[u?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(c,{className:d(`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform`,n&&`rotate-90`)}),n?(0,U.jsx)(h,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}):(0,U.jsx)(M,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`})]}):(0,U.jsx)(i,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`truncate flex-1 min-w-0`,children:e.name}),!u&&e.status&&(0,U.jsx)(`span`,{className:K(e.status),children:be(e.status)})]});return u?f:(0,U.jsxs)(_e,{children:[(0,U.jsx)(B,{asChild:!0,children:(0,U.jsx)(`div`,{children:f})}),(0,U.jsx)(he,{children:(0,U.jsxs)(ge,{onClick:()=>{e.fileIndex!==void 0&&l?.(r[e.fileIndex])},children:[(0,U.jsx)(g,{className:`mr-2 h-3.5 w-3.5`}),`Revert Change`]})})]})},t[21]=r,t[22]=s,t[23]=l,t[24]=o,t[25]=T):T=t[25];let E;t[26]!==T||t[27]!==n?(E=(0,U.jsx)(`div`,{className:`px-1 pt-3 pb-2`,children:(0,U.jsx)(oe,{nodes:n,defaultOpen:!0,resetKey:n,indent:16,childContainerClassName:`ml-4 border-l border-sidebar-border pl-2`,renderNode:T})}),t[26]=T,t[27]=n,t[28]=E):E=t[28];let D;return t[29]!==w||t[30]!==E?(D=(0,U.jsx)(Se,{v0:(0,U.jsx)(W,{title:`Review Changes`,subtitle:w,children:E})}),t[29]=w,t[30]=E,t[31]=D):D=t[31],D};function we(e){return e.type===`add`}function Te(e,t){return e+t.changes.filter(we).length}function Y(e,t){return e+t.hunks.reduce(Te,0)}function Ee(e){return e.type===`delete`}function De(e,t){return e+t.changes.filter(Ee).length}function Oe(e,t){return e+t.hunks.reduce(De,0)}var ke=I(e=>(0,U.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,U.jsx)(`div`,{className:e.v0,children:e.v1}),(0,U.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-4 overflow-auto bg-background`,children:(0,U.jsx)(`img`,{src:e.v2,alt:e.v3,className:`max-w-full max-h-full object-contain`})})]}),{name:`DiffImageSingle_1`,portals:[`v1`]}),X=function(e){let t=(0,H.c)(5),{threadId:n,filePath:r,version:i,label:a}=e,o=Z(n,r,i),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=d(_.caption,`px-3 py-1.5 border-b text-muted-foreground bg-muted/30`),t[0]=s):s=t[0];let c=`${a} - ${r}`,l;return t[1]!==a||t[2]!==o||t[3]!==c?(l=(0,U.jsx)(ke,{v0:s,v1:a,v2:o,v3:c}),t[1]=a,t[2]=o,t[3]=c,t[4]=l):l=t[4],l};function Ae(e,t,n){return`git-media:${e}:${t}:${n}`}function Z(e,t,n){let r=(0,H.c)(13),i;r[0]!==t||r[1]!==e||r[2]!==n?(i=Ae(e,t,n),r[0]=t,r[1]=e,r[2]=n,r[3]=i):i=r[3];let a;r[4]!==t||r[5]!==e||r[6]!==n?(a=()=>D(e,t,n),r[4]=t,r[5]=e,r[6]=n,r[7]=a):a=r[7];let o=te(i,a),s;r[8]===o?s=r[9]:(s=URL.createObjectURL(o),r[8]=o,r[9]=s);let c=s,l,u;return r[10]===c?(l=r[11],u=r[12]):(l=()=>()=>{URL.revokeObjectURL(c)},u=[c],r[10]=c,r[11]=l,r[12]=u),(0,V.useEffect)(l,u),c}function je(e){let t=(0,H.c)(23),{threadId:n,file:r}=e,i=r.status===`modified`||r.status===`deleted`||r.status===`renamed`,a=r.status===`modified`||r.status===`added`||r.status===`untracked`||r.status===`renamed`;if(i&&a){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,U.jsx)(L,{label:`Loading before...`}),t[0]=e):e=t[0];let i=r.status===`renamed`&&r.oldPath?r.oldPath:r.path,a;t[1]!==i||t[2]!==n?(a=(0,U.jsx)(`div`,{className:`flex-1 border-r border-border`,children:(0,U.jsx)(V.Suspense,{fallback:e,children:(0,U.jsx)(X,{threadId:n,filePath:i,version:`old`,label:`Before`})})}),t[1]=i,t[2]=n,t[3]=a):a=t[3];let o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,U.jsx)(L,{label:`Loading after...`}),t[4]=o):o=t[4];let s;t[5]!==r.path||t[6]!==n?(s=(0,U.jsx)(`div`,{className:`flex-1`,children:(0,U.jsx)(V.Suspense,{fallback:o,children:(0,U.jsx)(X,{threadId:n,filePath:r.path,version:`new`,label:`After`})})}),t[5]=r.path,t[6]=n,t[7]=s):s=t[7];let c;return t[8]!==a||t[9]!==s?(c=(0,U.jsxs)(`div`,{className:`flex h-full`,children:[a,s]}),t[8]=a,t[9]=s,t[10]=c):c=t[10],c}let o=a?`new`:`old`,s=a?`Added`:`Deleted`,c;t[11]===s?c=t[12]:(c=s.toLowerCase(),t[11]=s,t[12]=c);let l=`Loading ${c} image...`,u;t[13]===l?u=t[14]:(u=(0,U.jsx)(L,{label:l}),t[13]=l,t[14]=u);let d;t[15]!==r.path||t[16]!==s||t[17]!==n||t[18]!==o?(d=(0,U.jsx)(X,{threadId:n,filePath:r.path,version:o,label:s}),t[15]=r.path,t[16]=s,t[17]=n,t[18]=o,t[19]=d):d=t[19];let f;return t[20]!==u||t[21]!==d?(f=(0,U.jsx)(`div`,{className:`flex h-full flex-col`,children:(0,U.jsx)(V.Suspense,{fallback:u,children:d})}),t[20]=u,t[21]=d,t[22]=f):f=t[22],f}function Me(e){let t=(0,H.c)(4),{isOpen:n}=e,r=(n===void 0?!0:n)&&`ml-[-40px]`,i;t[0]===r?i=t[1]:(i=d(`z-10 shrink-0`,r),t[0]=r,t[1]=i);let a;return t[2]===i?a=t[3]:(a=(0,U.jsx)(z,{withHandle:!0,className:i}),t[2]=i,t[3]=a),a}function Ne(e){let t=(0,H.c)(36),{open:i,lineNumber:a,lineContent:o,initialComment:s,isEditing:c,onSave:u,onDelete:f,onClose:p}=e,[h,g]=(0,V.useState)((s===void 0?``:s)??``),y;t[0]!==u||t[1]!==h?(y=()=>{h.trim()&&u(h.trim())},t[0]=u,t[1]=h,t[2]=y):y=t[2];let b=y,x;t[3]===b?x=t[4]:(x=e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),b())},t[3]=b,t[4]=x);let S=x,w;t[5]===p?w=t[6]:(w=e=>{e||p()},t[5]=p,t[6]=w);let T;t[7]===a?T=t[8]:(T=(0,U.jsx)(n,{children:(0,U.jsxs)(C,{children:[`Comment on line `,a]})}),t[7]=a,t[8]=T);let E;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(E=d(_.compact,`font-mono rounded bg-muted px-3 py-2 text-muted-foreground overflow-x-auto whitespace-pre`),t[9]=E):E=t[9];let D=o||` `,O;t[10]===D?O=t[11]:(O=(0,U.jsx)(`div`,{className:E,children:D}),t[10]=D,t[11]=O);let k;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>g(e.target.value),t[12]=k):k=t[12];let A;t[13]!==S||t[14]!==h?(A=(0,U.jsx)(se,{autoFocus:!0,placeholder:`Add a comment... (Cmd+Enter to save)`,value:h,onChange:k,onKeyDown:S,rows:12,className:`resize-none text-base`}),t[13]=S,t[14]=h,t[15]=A):A=t[15];let j;t[16]!==c||t[17]!==f?(j=c&&f&&(0,U.jsx)(r,{variant:`destructive`,size:`sm`,onClick:f,className:`mr-auto`,children:`Delete`}),t[16]=c,t[17]=f,t[18]=j):j=t[18];let ee;t[19]===h?ee=t[20]:(ee=h.trim(),t[19]=h,t[20]=ee);let M=!ee,N;t[21]!==b||t[22]!==M?(N=(0,U.jsx)(r,{size:`sm`,onClick:b,disabled:M,children:`Save`}),t[21]=b,t[22]=M,t[23]=N):N=t[23];let P;t[24]!==j||t[25]!==N?(P=(0,U.jsxs)(m,{className:`gap-2 sm:gap-0`,children:[j,N]}),t[24]=j,t[25]=N,t[26]=P):P=t[26];let F;t[27]!==A||t[28]!==P||t[29]!==T||t[30]!==O?(F=(0,U.jsxs)(v,{className:`max-w-2xl`,children:[T,O,A,P]}),t[27]=A,t[28]=P,t[29]=T,t[30]=O,t[31]=F):F=t[31];let I;return t[32]!==i||t[33]!==F||t[34]!==w?(I=(0,U.jsx)(l,{open:i,onOpenChange:w,children:F}),t[32]=i,t[33]=F,t[34]=w,t[35]=I):I=t[35],I}var Pe=I(e=>e.v0,{name:`ReviewLoadingFallback_1`,portals:[`v0`]}),Fe=I(e=>(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,U.jsxs)(`div`,{className:`space-y-4 text-center`,children:[(0,U.jsx)(`p`,{className:e.v0,children:`Loading review changes is taking longer than expected.`}),e.v1]})}),{name:`ReviewLoadingFallback_2`,portals:[`v1`]}),Ie=function(e){let t=(0,H.c)(5),{onRetry:n}=e,[i,a]=(0,V.useState)(!1),o,s;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{let e=window.setTimeout(()=>{a(!0)},15e3);return()=>{window.clearTimeout(e)}},s=[],t[0]=o,t[1]=s):(o=t[0],s=t[1]),(0,V.useEffect)(o,s),!i){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,U.jsx)(Pe,{v0:(0,U.jsx)(L,{label:`Loading review changes...`})}),t[2]=e):e=t[2],e}let c;return t[3]===n?c=t[4]:(c=(0,U.jsx)(Fe,{v0:_.bodyMuted,v1:(0,U.jsx)(r,{variant:`outline`,onClick:n,children:`Retry`})}),t[3]=n,t[4]=c),c};function Le(e,t){return`git-diff:${e}:${t}`}function Q(){return Error(`Loading review changes timed out. Please try again.`)}async function Re(e,t=15e3){return Promise.race([j(e),new Promise((e,n)=>{window.setTimeout(()=>n(Q()),t)})])}function ze({threadId:e,onExit:n,loadVersion:i}){let l=te(Le(e,i),()=>Re(e)),m=ce(),h=le(e=>e.diffComments),g=le(e=>e.projectModelSelections),{resolvedTheme:v}=ie(),S=me(),[C,E]=(0,V.useState)(l.files||[]),[D,O]=(0,V.useState)(null),[A,M]=(0,V.useState)(0),[I,L]=(0,V.useState)(!1),[R,ne]=(0,V.useState)(!1),[re,oe]=(0,V.useState)(!1),[se,z]=(0,V.useState)(!0),B=(0,V.useRef)(null);(0,V.useEffect)(()=>{z(!0)},[e]);let he=(0,V.useCallback)(e=>{M(e),S&&z(!1)},[S]),ge=(0,V.useCallback)(()=>{z(!0)},[]),_e=S&&!se,H=(0,V.useMemo)(()=>h[e]??[],[h,e]),W=(0,V.useCallback)(t=>{let n=h[e]??[],r=typeof t==`function`?t(n):t;m({type:ae.SetDiffComments,threadId:e,comments:r})},[m,e,h]),[G,ye]=(0,V.useState)(null),[K,be]=(0,V.useState)(null),[q,xe]=(0,V.useState)(null),J=(0,V.useRef)(null),Se=(0,V.useRef)(H),we=(0,V.useRef)(G),Te=(0,V.useRef)({isFullView:I,selectedFileIndex:A,files:C}),Y=(0,V.useRef)({original:[],modified:[]}),Ee=(0,V.useRef)(!0);(0,V.useEffect)(()=>{Se.current=H},[H]),(0,V.useEffect)(()=>{we.current=G},[G]),(0,V.useEffect)(()=>{Te.current={isFullView:I,selectedFileIndex:A,files:C}},[I,A,C]);let De=(0,V.useCallback)(()=>{B.current&&(R?B.current.expand():B.current.collapse())},[R]),Oe=(0,V.useCallback)(async()=>{if(e){O(null);try{E((await j(e)).files||[]),M(0)}catch(e){O(e instanceof Error?e.message:`Failed to load diff`)}}},[e]),ke=(0,V.useCallback)(async t=>{try{await y(e,t.path),await Oe()}catch(e){O(e instanceof Error?e.message:`Failed to revert file`)}},[e,Oe]),X=(0,V.useRef)(!1);(0,V.useEffect)(()=>{if((h[e]??[]).length>0){X.current=!0;return}a(e).then(t=>{t.diffComments&&t.diffComments.length>0&&m({type:ae.SetDiffComments,threadId:e,comments:t.diffComments}),X.current=!0}).catch(()=>{X.current=!0})},[e]),(0,V.useEffect)(()=>{X.current&&o(e,{diffComments:H}).catch(()=>{})},[e,H]);let Ae=(0,V.useMemo)(()=>ve(C),[C]),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}},Pe=(e,t,n)=>e.split(`
|
|
2
|
-
`).slice(t-1,n).join(`
|
|
3
|
-
`),Fe=e=>{let t=Z(e);return t?t.startLine<=1:!0},Ie=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=C[A],ze=Q?.isBinary??!1,Be=Q?I?Q.oldContent:(()=>{let e=Z(Q);return e?Pe(Q.oldContent,e.startLine,e.endLine):Q.oldContent})():``,Ve=Q?I?Q.newContent:(()=>{let e=Z(Q);return e?Pe(Q.newContent,e.startLine,e.endLine):Q.newContent})():``,$=(0,V.useCallback)(()=>{if(!Ee.current)return;let e=J.current;if(!e)return;let{isFullView:t,selectedFileIndex:n,files:r}=Te.current,i=Se.current,a=we.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),l=new Set(c.map(e=>s?e.lineNumber-s.startLine+1:e.lineNumber)),u=e.getModel()?.getLineCount()??0,d=[];for(let e=1;e<=u;e++)l.has(e)||d.push({range:{startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1},options:{isWholeLine:!0,glyphMarginClassName:`diff-gutter-add-comment`,glyphMarginHoverMessage:{value:`$(add) Click to add a comment`},stickiness:F.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}});let f=c.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`,glyphMarginClassName:n?`diff-comment-glyph-active`:`diff-comment-glyph`,glyphMarginHoverMessage:{value:e.comment},stickiness:F.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}}).filter(e=>e!==null);d.push(...f);let p=r===`original`?Y.current.original:Y.current.modified,m=e.deltaDecorations(p,d);r===`original`?Y.current.original=m:Y.current.modified=m};s(e.getOriginalEditor(),`original`),s(e.getModifiedEditor(),`modified`)},[]);(0,V.useEffect)(()=>{$()},[$,H,G,A,I,Q]),(0,V.useEffect)(()=>()=>{J.current=null,Y.current={original:[],modified:[]}},[A]),(0,V.useEffect)(()=>()=>{Ee.current=!1,J.current&&=(J.current.getOriginalEditor().getModel()?.dispose(),J.current.getModifiedEditor().getModel()?.dispose(),J.current.dispose(),null),Y.current={original:[],modified:[]}},[]);let He=(0,V.useCallback)(e=>{J.current=e;let t=e=>e===F.MouseTargetType.GUTTER_GLYPH_MARGIN||e===F.MouseTargetType.GUTTER_LINE_NUMBERS||e===F.MouseTargetType.GUTTER_LINE_DECORATIONS||e===F.MouseTargetType.GUTTER_VIEW_ZONE,n=(e,n)=>{e.onMouseDown(r=>{if(!r.target?.position||!t(r.target.type))return;let i=r.target.position.lineNumber,{isFullView:a,selectedFileIndex:o,files:s}=Te.current,c=s[o];if(!c)return;let l=a?null:Z(c),u=l?l.startLine+i-1:i,d=e.getModel()?.getLineContent(i)??``,f=Se.current.find(e=>e.fileIndex===o&&e.lineNumber===u&&e.side===n);f?xe(f):be({lineNumber:u,lineContent:d,side:n})})};n(e.getOriginalEditor(),`original`),n(e.getModifiedEditor(),`modified`),setTimeout(()=>{J.current===e&&$()},150)},[$]),Ue=(0,V.useCallback)(e=>{if(K&&Q){let t={id:`comment-${Date.now()}`,filePath:Q.path,fileIndex:A,lineNumber:K.lineNumber,lineContent:K.lineContent,comment:e,side:K.side};W(e=>[...e,t]),be(null)}else q&&(W(t=>t.map(t=>t.id===q.id?{...t,comment:e}:t)),xe(null))},[K,q,Q,A,W]),We=(0,V.useCallback)(()=>{q&&(W(e=>e.filter(e=>e.id!==q.id)),xe(null))},[q,W]),Ge=(0,V.useCallback)(e=>{if(H.length===0)return;let t=(e%H.length+H.length)%H.length,n=H[t];ye(t),M(n.fileIndex),S&&z(!1),setTimeout(()=>{let e=J.current;if(!e)return;let t=C[n.fileIndex];if(!t)return;let r=I?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)},[H,C,I,$,S]),Ke=(0,V.useCallback)(()=>{Ge((G??0)-1)},[Ge,G]),qe=(0,V.useCallback)(()=>{Ge((G??-1)+1)},[Ge,G]),Je=(0,V.useCallback)(async()=>{let r=g[e];if(!r)try{let e=await t(),n=Object.values(e).flat();if(n.length>0)r=n[0];else{console.error(`No models available to process comments`);return}}catch(e){console.error(`Failed to load models:`,e);return}let i=r.id,a=r.provider;try{let{prompt:t}=await u(e,H);W([]),m({type:ae.SetPendingChatMessage,message:{threadId:e,message:t,model:i,provider:a}}),n()}catch(e){console.error(`Failed to fix comments:`,e),typeof window<`u`&&window.alert(`Failed to process comments. Please try again.`)}},[H,g,m,e,n,W]),Ye={readOnly:!0,renderSideBySide:!S,ignoreTrimWhitespace:!1,renderOverviewRuler:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},folding:!1,glyphMargin:!0,lineNumbers:Q&&(I||Fe(Q))?`on`:`off`,diffWordWrap:`on`,originalEditable:!1,automaticLayout:!0},Xe=(0,U.jsx)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-1 flex-col overflow-hidden`,children:(0,U.jsx)(Ce,{treeData:Ae,files:C,error:D,selectedFileIndex:A,onFileSelect:he,onRevertFile:ke})}),Ze=(0,U.jsxs)(`div`,{className:`diff-editor-panel flex h-full min-h-0 w-full min-w-0 flex-1 flex-col overflow-hidden bg-transparent`,children:[(0,U.jsxs)(ue,{className:d(`bg-transparent`,R&&`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,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_e?(0,U.jsxs)(r,{variant:`ghost`,size:`icon`,className:`h-8 w-8 text-muted-foreground shrink-0`,onClick:ge,children:[(0,U.jsx)(w,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Show file tree`})]}):(0,U.jsxs)(r,{variant:`ghost`,size:`icon`,className:`h-8 w-8 text-muted-foreground shrink-0`,onClick:De,children:[R?(0,U.jsx)(w,{className:`h-4 w-4`}):(0,U.jsx)(ee,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Toggle file tree`})]}),(0,U.jsx)(`span`,{className:d(_.label,`text-foreground`),children:Q?Q.path:`Review Changes`})]}),(0,U.jsxs)(`div`,{className:d(`flex items-center gap-2`,R&&`ml-0`,!R&&`ml-auto`,`md:ml-auto`),children:[!ze&&(0,U.jsx)(r,{variant:`ghost`,size:`sm`,onClick:()=>L(e=>!e),disabled:!Q,className:d(_.compact,`h-8 gap-1 px-2`),children:I?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(x,{className:`h-3 w-3`}),` Show changes only`]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(T,{className:`h-3 w-3`}),` Show full file`]})}),H.length>0&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(f,{children:[(0,U.jsx)(s,{asChild:!0,children:(0,U.jsx)(r,{variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-full`,onClick:Ke,disabled:(G??0)===0,children:(0,U.jsx)(b,{className:`h-3 w-3`})})}),(0,U.jsx)(p,{children:`Previous comment`})]}),(0,U.jsx)(`span`,{className:d(_.caption,`whitespace-nowrap`),children:H.length===1?`1 Comment`:`Comment ${(G??0)+1} of ${H.length}`}),(0,U.jsxs)(f,{children:[(0,U.jsx)(s,{asChild:!0,children:(0,U.jsx)(r,{variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-full`,onClick:qe,disabled:(G??0)===H.length-1,children:(0,U.jsx)(c,{className:`h-3 w-3`})})}),(0,U.jsx)(p,{children:`Next comment`})]})]}),H.length>0&&(0,U.jsxs)(f,{children:[(0,U.jsx)(s,{asChild:!0,children:(0,U.jsxs)(r,{size:`sm`,onClick:Je,className:d(_.compact,`h-8 gap-1 px-3 bg-foreground text-background hover:bg-foreground/90`),children:[(0,U.jsx)(k,{className:`h-3 w-3`}),`Fix all comments`]})}),(0,U.jsx)(p,{children:`Send all comments to Tarsk for resolution`})]})]})]}),(0,U.jsxs)(`div`,{className:`flex-1 bg-transparent relative`,children:[ze&&Q?(0,U.jsx)(je,{threadId:e,file:Q}):(0,U.jsx)(P,{height:`100%`,language:Ie(Q?.path||``),original:Be,modified:Ve,theme:v===`dark`?`vs-dark`:`vs-light`,onMount:He,options:Ye},`diff-${A}`),(0,U.jsxs)(`div`,{className:`pointer-events-none absolute bottom-4 right-4 z-20 flex flex-col items-end gap-3`,children:[re&&(0,U.jsxs)(`div`,{className:`pointer-events-auto w-[min(100%,48rem)] rounded-2xl bg-background/50 p-4 backdrop-blur-md`,children:[(0,U.jsx)(`div`,{className:`mb-3 flex items-center justify-end`,children:(0,U.jsxs)(r,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>oe(!1),children:[(0,U.jsx)(N,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close chat`})]})}),(0,U.jsx)(fe,{})]}),!re&&(0,U.jsxs)(f,{children:[(0,U.jsx)(s,{asChild:!0,children:(0,U.jsxs)(r,{size:`icon`,className:`pointer-events-auto h-12 w-12 rounded-full shadow-lg`,onClick:()=>oe(!0),children:[(0,U.jsx)(k,{className:`h-5 w-5`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Open review chat`})]})}),(0,U.jsx)(p,{children:`Chat about this diff`})]})]})]})]});return(0,U.jsxs)(`div`,{className:`diff-view-root flex h-full min-h-0 w-full flex-col`,children:[(0,U.jsx)(`div`,{className:`diff-body flex min-h-0 w-full flex-1 overflow-hidden`,children:S?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:d(`flex min-h-0 w-full min-w-0 flex-1 flex-col overflow-hidden`,!se&&`hidden`),children:Xe}),(0,U.jsx)(`div`,{className:d(`flex min-h-0 w-full min-w-0 flex-1 flex-col overflow-hidden`,se&&`hidden`),children:Ze})]}):(0,U.jsxs)(de,{direction:`horizontal`,children:[(0,U.jsx)(pe,{ref:B,defaultSize:25,minSize:12,maxSize:40,collapsible:!0,collapsedSize:0,onCollapse:()=>ne(!0),onExpand:()=>ne(!1),className:`border-r border-transparent`,children:Xe}),(0,U.jsx)(Me,{isOpen:!R}),(0,U.jsx)(pe,{className:`overflow-hidden border-l border-border bg-transparent`,children:Ze})]})}),(0,U.jsx)(Ne,{open:K!==null||q!==null,lineNumber:q?.lineNumber??K?.lineNumber??0,lineContent:q?.lineContent??K?.lineContent??``,initialComment:q?.comment,isEditing:q!==null,onSave:Ue,onDelete:We,onClose:()=>{be(null),xe(null)}},`${q?.id??``}-${K?.lineNumber??``}-${K?.side??``}`)]})}function Be(e){let t=(0,H.c)(22),[n,r]=(0,V.useState)(0),[i,a]=(0,V.useState)(0),o=(0,V.useRef)(0),s;t[0]===e.threadId?s=t[1]:(s=()=>{r(t=>(ne(Le(e.threadId,t)),t+1)),a($)},t[0]=e.threadId,t[1]=s);let c=s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{a(0),r(0),o.current=0},t[2]=l):l=t[2];let u;t[3]===e.threadId?u=t[4]:(u=[e.threadId],t[3]=e.threadId,t[4]=u),(0,V.useEffect)(l,u);let d,f;t[5]!==e.refreshTrigger||t[6]!==e.threadId?(d=()=>{!e.refreshTrigger||e.refreshTrigger<=o.current||(o.current=e.refreshTrigger,r(t=>(ne(Le(e.threadId,t)),t+1)),a(Ve))},f=[e.refreshTrigger,e.threadId],t[5]=e.refreshTrigger,t[6]=e.threadId,t[7]=d,t[8]=f):(d=t[7],f=t[8]),(0,V.useEffect)(d,f);let p=`${e.threadId}:${i}`,m;t[9]===c?m=t[10]:(m=(0,U.jsx)(Ie,{onRetry:c}),t[9]=c,t[10]=m);let h=`${e.threadId}:${n}`,g;t[11]!==n||t[12]!==e||t[13]!==h?(g=(0,U.jsx)(ze,{...e,loadVersion:n},h),t[11]=n,t[12]=e,t[13]=h,t[14]=g):g=t[14];let _;t[15]!==m||t[16]!==g?(_=(0,U.jsx)(V.Suspense,{fallback:m,children:g}),t[15]=m,t[16]=g,t[17]=_):_=t[17];let v;return t[18]!==c||t[19]!==p||t[20]!==_?(v=(0,U.jsx)(R,{fallbackTitle:`Failed to load review changes`,onRetry:c,children:_},p),t[18]=c,t[19]=p,t[20]=_,t[21]=v):v=t[21],v}function Ve(e){return e+1}function $(e){return e+1}export{Be as DiffView,Be as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/explorer-tree-CiPMm5ck.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-_SOdLUMq.js","assets/monaco-CZnIWXyV.js","assets/monaco-Br_kD0ds.css","assets/history-view-BMVTxWTg.js","assets/dialogs-config-BEazgV7k.js","assets/onboarding-Bi5MieW-.js","assets/vosk-speech-CgILeNJR.js","assets/react-vendor-iDwBzcYF.js","assets/utils-CECQ_-6N.js","assets/index-C7FLshNp.css","assets/api-Dhzdgb40.js","assets/context-menu-PIC-g8wy.js","assets/ui-components-kSaUEA_X.js","assets/explorer-view-odyQutTO.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Mi as t,Xi as n,c as r,ls as i,os as a,ss as o}from"./dialogs-config-BEazgV7k.js";import{r as s}from"./monaco-CZnIWXyV.js";import{l as c,u as l}from"./history-view-BMVTxWTg.js";import{A as u,R as d,d as f,l as p,u as m,y as h}from"./index-_SOdLUMq.js";var g=o(),_=e(i(),1),v=a(),y=(0,_.lazy)(()=>s(()=>import(`./explorer-tree-CiPMm5ck.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),b=(0,_.lazy)(()=>s(()=>import(`./explorer-view-odyQutTO.js`),__vite__mapDeps([15,1,2,3,4,5,6,7,8,9,10,11,12])));function x(){let e=(0,g.c)(49),i=d(S),a=h(),[o,s]=(0,_.useState)(null),[x,C]=(0,_.useState)(!0),{pendingExplorerPath:w,setPendingExplorerPath:T,explorerClearPath:E,setExplorerClearPath:D}=u(),O;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>{C(!0)},e[0]=O):O=e[0];let k;e[1]===i?k=e[2]:(k=[i],e[1]=i,e[2]=k),(0,_.useEffect)(O,k);let A;e[3]===a?A=e[4]:(A=e=>{s(e),a&&C(!1)},e[3]=a,e[4]=A);let j=A,M;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>{C(!0)},e[5]=M):M=e[5];let N=M,P;e[6]===a?P=e[7]:(P=e=>{s(e),a&&C(!1)},e[6]=a,e[7]=P);let F=P,I,L;e[8]!==a||e[9]!==w||e[10]!==T?(I=()=>{w&&(s({name:w.split(`/`).pop()??w,path:w,type:`file`}),a&&C(!1),T(null))},L=[a,w,T],e[8]=a,e[9]=w,e[10]=T,e[11]=I,e[12]=L):(I=e[11],L=e[12]),(0,_.useEffect)(I,L);let R,z;e[13]!==E||e[14]!==a||e[15]!==o||e[16]!==D?(R=()=>{E&&(o&&(o.path===E||o.path.startsWith(E+`/`))&&(s(null),a&&C(!0)),D(null))},z=[E,a,o,D],e[13]=E,e[14]=a,e[15]=o,e[16]=D,e[17]=R,e[18]=z):(R=e[17],z=e[18]),(0,_.useEffect)(R,z);let B;e[19]!==j||e[20]!==o?.path||e[21]!==i?(B=(0,v.jsx)(r,{className:`h-full`,children:i?(0,v.jsx)(_.Suspense,{fallback:(0,v.jsx)(l,{}),children:(0,v.jsx)(y,{threadId:i,selectedPath:o?.path??null,onNodeSelect:j})}):(0,v.jsx)(`p`,{className:t(n.caption,`px-3 py-4 text-center`),children:`No thread selected.`})}),e[19]=j,e[20]=o?.path,e[21]=i,e[22]=B):B=e[22];let V=B,H;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,v.jsx)(c,{}),e[23]=H):H=e[23];let U=a&&!x,W;e[24]!==F||e[25]!==o||e[26]!==U?(W=(0,v.jsx)(_.Suspense,{fallback:H,children:(0,v.jsx)(b,{selectedFile:o,showTreeBackButton:U,onShowTree:N,onFileCreated:F})}),e[24]=F,e[25]=o,e[26]=U,e[27]=W):W=e[27];let G=W;if(a){let n=!x&&`hidden`,r;e[28]===n?r=e[29]:(r=t(`flex-1 min-h-0 overflow-hidden`,n),e[28]=n,e[29]=r);let i;e[30]!==V||e[31]!==r?(i=(0,v.jsx)(`div`,{className:r,children:V}),e[30]=V,e[31]=r,e[32]=i):i=e[32];let a=x&&`hidden`,o;e[33]===a?o=e[34]:(o=t(`flex-1 min-h-0 overflow-hidden`,a),e[33]=a,e[34]=o);let s;e[35]!==G||e[36]!==o?(s=(0,v.jsx)(`div`,{className:o,children:G}),e[35]=G,e[36]=o,e[37]=s):s=e[37];let c;return e[38]!==i||e[39]!==s?(c=(0,v.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[i,s]}),e[38]=i,e[39]=s,e[40]=c):c=e[40],c}let K;e[41]===V?K=e[42]:(K=(0,v.jsx)(m,{defaultSize:25,minSize:15,maxSize:50,className:`overflow-hidden border-r border-border`,children:V}),e[41]=V,e[42]=K);let q;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,v.jsx)(p,{withHandle:!0}),e[43]=q):q=e[43];let J;e[44]===G?J=e[45]:(J=(0,v.jsx)(m,{className:`overflow-hidden`,children:G}),e[44]=G,e[45]=J);let Y;return e[46]!==K||e[47]!==J?(Y=(0,v.jsx)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:(0,v.jsxs)(f,{direction:`horizontal`,className:`flex-1 overflow-hidden`,children:[K,q,J]})}),e[46]=K,e[47]=J,e[48]=Y):Y=e[48],Y}function S(e){return e.selectedThreadId}export{x as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ai as t,Bo as n,Hi as r,Mi as i,Mo as a,Oo as o,Vi as s,Xi as c,Zo as l,at as ee,eo as u,ko as d,ls as f,os as p,qa as m,ss as h,uo as te}from"./dialogs-config-BEazgV7k.js";import{M as ne}from"./react-vendor-iDwBzcYF.js";import{I as g,a as _,l as v,n as y,o as b}from"./history-view-BMVTxWTg.js";import{n as x}from"./utils-CECQ_-6N.js";import{A as S,C,E as w,M as re,P as T,R as ie,S as ae,c as oe,x as se}from"./index-_SOdLUMq.js";import{a as E,i as D,l as O,o as k,s as A,t as ce}from"./api-Dhzdgb40.js";var j=h(),M=p(),N=e(f(),1),P=g(e=>(0,M.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center`,children:[e.v0,(0,M.jsx)(`p`,{className:e.v1,children:`Select a thread to browse its files`})]}),{name:`ExplorerView_1`,portals:[`v0`]}),F=g(e=>(0,M.jsxs)(`div`,{className:`flex flex-col h-full`,children:[e.v0,(0,M.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:(0,M.jsx)(`div`,{className:`h-full relative overflow-hidden`,children:e.v1})}),e.v2]}),{name:`ExplorerView_2`,portals:[`v0`,`v1`,`v2`]}),I=function({selectedFile:e,showTreeBackButton:r=!1,onShowTree:a,onFileCreated:o}){let{resolvedTheme:f}=x(),p=ie(e=>e.selectedThreadId),{triggerExplorerRefresh:h}=S(),g=(0,N.useRef)(null),_=(0,N.useRef)(null),E=(0,N.useRef)(!1),D=(0,N.useRef)(!0),[k,j]=(0,N.useState)(null),[I,W]=(0,N.useState)(!1),[K,q]=(0,N.useState)(`edit`),[ue,de]=(0,N.useState)(0),[J,fe]=(0,N.useState)(null),[Y,X]=(0,N.useState)(!1);(0,N.useEffect)(()=>{p&&ee(p).then(fe).catch(()=>{})},[p]);let pe=async()=>{if(!(!J||Y)){X(!0);try{await navigator.clipboard.writeText(J),T({title:`Copied`,description:`Repository folder path copied to clipboard.`})}catch{T({title:`Error`,description:`Failed to copy path to clipboard.`,variant:`destructive`})}finally{X(!1)}}},me=async()=>{if(p)try{await A(p,`.`)}catch{T({title:`Error`,description:`Failed to open repository folder.`,variant:`destructive`})}},he=(0,N.useCallback)(async e=>{if(p)try{let t=await R(p,e);await ce(p,``,t);let n={name:t,path:t,type:`file`};_.current=t,E.current=!0,o?.(n),h(),T({title:`Created`,description:`${t} created successfully.`})}catch{T({title:`Error`,description:`Failed to create file.`,variant:`destructive`})}},[p,o,h]),Z=e?s(e.path,e.name):null,Q=e?.type===`file`&&p&&!Z?e:null,$=k?.content??``,ge=k?.original??``,_e=Q?`${p}:${Q.path}:${ue}`:null;(0,N.useEffect)(()=>()=>{g.current&&=(g.current.getModel()?.dispose(),g.current.dispose(),null)},[]),(0,N.useEffect)(()=>{if(e?.type===`file`?_.current===e.path?(_.current=null,q(`edit`)):q(z(e.path)?`view`:`edit`):q(`edit`),D.current){D.current=!1;return}j(null)},[e?.path,p]);async function ve(){if(!(!p||!e)){W(!0);try{await O(p,e.path,$),j({content:$,original:$}),T({title:`Saved`,description:`${e.name} saved successfully.`})}catch(e){T({title:`Error`,description:e instanceof Error?e.message:`Failed to save file`,variant:`destructive`})}finally{W(!1)}}}function ye(){!p||!Q||(b(V(p,Q.path)),j(null),de(e=>e+1))}return p?(0,M.jsx)(F,{v0:(0,M.jsxs)(oe,{className:`justify-between`,children:[(0,M.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[r&&a?(0,M.jsxs)(t,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground electrobun-webkit-app-region-no-drag`,onClick:a,children:[(0,M.jsx)(u,{className:`h-4 w-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`Show file tree`})]}):null,(0,M.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,M.jsx)(`span`,{className:i(c.label,`truncate text-foreground`),children:e?e.name:`Select a file to edit`}),(0,M.jsx)(`span`,{className:i(c.compact,`truncate text-muted-foreground`),children:e?e.path:`Browse and edit repository files`})]})]}),(0,M.jsxs)(`div`,{className:`flex gap-2`,children:[Q&&k?(0,M.jsxs)(M.Fragment,{children:[z(Q.path)?(0,M.jsxs)(`div`,{className:`flex rounded-full border border-input bg-background p-0.5`,children:[(0,M.jsx)(t,{size:`sm`,variant:K===`view`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>q(`view`),children:`View`}),(0,M.jsx)(t,{size:`sm`,variant:K===`edit`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>q(`edit`),children:`Edit`})]}):null,(0,M.jsxs)(t,{size:`sm`,onClick:()=>void ve(),disabled:I||!$||$===ge,children:[I?(0,M.jsx)(te,{className:`h-4 w-4 animate-spin`}):null,`Save`]})]}):null,e?null:(0,M.jsxs)(se,{children:[(0,M.jsx)(w,{asChild:!0,children:(0,M.jsxs)(t,{size:`sm`,className:`gap-1.5`,children:[(0,M.jsx)(m,{className:`h-3.5 w-3.5`}),`New file`]})}),(0,M.jsx)(ae,{align:`end`,children:L.map(({label:e,ext:t,icon:n})=>(0,M.jsxs)(C,{onSelect:()=>void he(t),children:[(0,M.jsx)(n,{className:`h-4 w-4`}),e]},t))})]})]})]}),v1:Q?(0,M.jsxs)(y,{fallbackTitle:`Failed to load file`,onRetry:ye,children:[(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(v,{}),children:(0,M.jsx)(H,{threadId:p,path:Q.path,onContentReady:j},_e??void 0)}),k?z(Q.path)&&K===`view`?(0,M.jsx)(`div`,{className:`h-full overflow-auto p-6`,children:(0,M.jsx)(re,{content:$,enableMermaid:!0})}):(0,M.jsx)(ne,{height:`100%`,language:B(Q.path),value:$,onChange:e=>j(t=>t&&{...t,content:e??``}),onMount:e=>{g.current=e,E.current&&(E.current=!1,e.focus())},theme:f===`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,M.jsx)(v,{})]}):e?.type===`file`&&Z===`image`?(0,M.jsx)(y,{fallbackTitle:`Failed to load image`,onRetry:()=>{!p||!e||b(U(p,e.path))},children:(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(v,{}),children:(0,M.jsx)(G,{threadId:p,path:e.path,alt:e.name})})}):e?.type===`file`&&Z===`video`?(0,M.jsx)(y,{fallbackTitle:`Failed to load video`,onRetry:()=>{!p||!e||b(U(p,e.path))},children:(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(v,{}),children:(0,M.jsx)(le,{threadId:p,path:e.path})})}):(0,M.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center p-8`,children:[(0,M.jsx)(`h2`,{className:i(c.pageTitle,`text-foreground`),children:`File Explorer`}),(0,M.jsx)(`p`,{className:i(c.pageSubtitle),children:`Browse and edit files`})]}),v2:e?null:(0,M.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 px-4 py-2`,children:J?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{type:`button`,onClick:()=>void me(),className:i(c.compact,`min-w-0 flex-1 truncate text-left font-mono text-muted-foreground hover:text-foreground hover:underline`),title:J,children:J}),(0,M.jsxs)(t,{variant:`ghost`,size:`icon`,className:`h-7 w-7 shrink-0`,onClick:()=>void pe(),disabled:Y,children:[Y?(0,M.jsx)(l,{className:`h-3.5 w-3.5`}):(0,M.jsx)(n,{className:`h-3.5 w-3.5`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`Copy path`})]})]}):(0,M.jsx)(`p`,{className:i(c.compact,`text-muted-foreground/50 italic`),children:`Loading path...`})})}):(0,M.jsx)(P,{v0:(0,M.jsx)(d,{className:`h-8 w-8 text-muted-foreground`}),v1:c.bodyMuted})},L=[{label:`Markdown`,ext:`md`,icon:d},{label:`TypeScript`,ext:`ts`,icon:a},{label:`Text`,ext:`txt`,icon:o}];async function R(e,t){try{let n=await k(e,``),r=new Set(n.entries.map(e=>e.name)),i=`untitled`,a=`${i}.${t}`,o=2;for(;r.has(a);)a=`${i}${o}.${t}`,o++;return a}catch{return`untitled.${t}`}}function z(e){return r(e)===`md`}function B(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`}[r(e)]??`plaintext`}function V(e,t){return`explorer-file:${e}:${t}`}function H(e){let t=(0,j.c)(10),{threadId:n,path:r,onContentReady:i}=e,a;t[0]!==r||t[1]!==n?(a=V(n,r),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;t[3]!==r||t[4]!==n?(o=()=>E(n,r),t[3]=r,t[4]=n,t[5]=o):o=t[5];let s=_(a,o),c,l;return t[6]!==i||t[7]!==s.content?(c=()=>{i({content:s.content,original:s.content})},l=[i,s.content],t[6]=i,t[7]=s.content,t[8]=c,t[9]=l):(c=t[8],l=t[9]),(0,N.useLayoutEffect)(c,l),null}function U(e,t){return`explorer-media:${e}:${t}`}function W(e,t){let n=(0,j.c)(11),r;n[0]!==t||n[1]!==e?(r=U(e,t),n[0]=t,n[1]=e,n[2]=r):r=n[2];let i;n[3]!==t||n[4]!==e?(i=()=>D(e,t),n[3]=t,n[4]=e,n[5]=i):i=n[5];let a=_(r,i),o;n[6]===a?o=n[7]:(o=URL.createObjectURL(a),n[6]=a,n[7]=o);let s=o,c,l;return n[8]===s?(c=n[9],l=n[10]):(c=()=>()=>{URL.revokeObjectURL(s)},l=[s],n[8]=s,n[9]=c,n[10]=l),(0,N.useEffect)(c,l),s}function G(e){let t=(0,j.c)(3),{threadId:n,path:r,alt:i}=e,a=W(n,r),o;return t[0]!==i||t[1]!==a?(o=(0,M.jsx)(`div`,{className:`flex items-center justify-center h-full p-4 overflow-auto`,children:(0,M.jsx)(`img`,{src:a,alt:i,className:`max-w-full max-h-full object-contain`})}),t[0]=i,t[1]=a,t[2]=o):o=t[2],o}function le(e){let t=(0,j.c)(2),{threadId:n,path:r}=e,i=W(n,r),a;return t[0]===i?a=t[1]:(a=(0,M.jsx)(`div`,{className:`flex items-center justify-center h-full p-4`,children:(0,M.jsx)(`video`,{src:i,controls:!0,className:`max-w-full max-h-full`})}),t[0]=i,t[1]=a),a}export{I as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$r as e,Ai as t,Jr as n,Mi as r,Qr as i,Xi as a,Xr as o,Zr as s,ei as c,os as l,ss as u,uo as d}from"./dialogs-config-BEazgV7k.js";var f=u(),p=l();function m(l){let u=(0,f.c)(28),{open:m,onOpenChange:g,commits:_,displayedCommits:v,isLoadingMore:y,onScroll:b,currentBranch:x}=l,S;u[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,p.jsx)(c,{children:`Commit History`}),u[0]=S):S=u[0];let C;u[1]===x?C=u[2]:(C=(0,p.jsxs)(e,{children:[S,(0,p.jsxs)(s,{children:[`Recent commits on branch `,x]})]}),u[1]=x,u[2]=C);let w;u[3]===v?w=u[4]:(w=v.length>0?v.map(h):(0,p.jsx)(`p`,{className:r(a.bodyMuted,`text-center py-8`),children:`No commits found`}),u[3]=v,u[4]=w);let T;u[5]===y?T=u[6]:(T=y&&(0,p.jsx)(`div`,{className:`p-3 text-center`,children:(0,p.jsx)(d,{className:`h-4 w-4 animate-spin inline`})}),u[5]=y,u[6]=T);let E;u[7]!==_.length||u[8]!==v.length||u[9]!==y?(E=v.length<_.length&&!y&&(0,p.jsx)(`div`,{className:r(a.caption,`p-3 text-center`),children:`Scroll to load more`}),u[7]=_.length,u[8]=v.length,u[9]=y,u[10]=E):E=u[10];let D;u[11]!==w||u[12]!==T||u[13]!==E?(D=(0,p.jsxs)(`div`,{className:`divide-y`,children:[w,T,E]}),u[11]=w,u[12]=T,u[13]=E,u[14]=D):D=u[14];let O;u[15]!==b||u[16]!==D?(O=(0,p.jsx)(`div`,{className:`flex-1 overflow-y-auto border rounded-lg`,onScroll:b,children:D}),u[15]=b,u[16]=D,u[17]=O):O=u[17];let k;u[18]===g?k=u[19]:(k=(0,p.jsx)(i,{children:(0,p.jsx)(t,{onClick:()=>g(!1),children:`Close`})}),u[18]=g,u[19]=k);let A;u[20]!==C||u[21]!==O||u[22]!==k?(A=(0,p.jsxs)(o,{className:`max-w-2xl max-h-[80vh] flex flex-col`,children:[C,O,k]}),u[20]=C,u[21]=O,u[22]=k,u[23]=A):A=u[23];let j;return u[24]!==g||u[25]!==m||u[26]!==A?(j=(0,p.jsx)(n,{open:m,onOpenChange:g,children:A}),u[24]=g,u[25]=m,u[26]=A,u[27]=j):j=u[27],j}function h(e){return(0,p.jsxs)(`div`,{className:`p-3 hover:bg-muted/50 transition-colors`,children:[(0,p.jsx)(`p`,{className:r(a.label,`break-words`),children:e.message}),(0,p.jsxs)(`p`,{className:r(a.bodyMuted,`mt-1`),children:[(0,p.jsx)(`span`,{className:a.mono,children:e.hash.substring(0,7)}),` •`,` `,e.author,` • `,new Date(e.date).toLocaleDateString()]})]},e.hash)}export{m as GitHistoryDialog};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/commit-dialog-DcVXFOBP.js","assets/index-_SOdLUMq.js","assets/rolldown-runtime-aKtaBQYM.js","assets/monaco-CZnIWXyV.js","assets/monaco-Br_kD0ds.css","assets/history-view-BMVTxWTg.js","assets/dialogs-config-BEazgV7k.js","assets/onboarding-Bi5MieW-.js","assets/vosk-speech-CgILeNJR.js","assets/react-vendor-iDwBzcYF.js","assets/utils-CECQ_-6N.js","assets/index-C7FLshNp.css","assets/pull-request-dialog-BFgRF5AH.js","assets/create-repo-dialog-CsjpTBPU.js","assets/git-history-dialog-qUZ7Qsp4.js","assets/push-before-pr-dialog-BQ0QC6Qu.js","assets/pull-with-changes-dialog-oGP-j8Yw.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ai as t,C as n,Ca as r,Et as i,Fo as a,Fr as o,Ga as ee,Gt as te,Hn as s,Ht as c,Io as ne,Ir as l,Jt as re,Mi as ie,Nr as u,Pr as d,So as f,Wt as ae,Xi as p,Xo as m,Y as h,Zt as g,bo as _,ct as oe,dt as se,ho as ce,in as v,is as y,ls as b,ns as le,oa as ue,os as x,q as S,qt as de,ss as C,tn as fe,uo as w,va as pe,yo as me}from"./dialogs-config-BEazgV7k.js";import{r as T}from"./monaco-CZnIWXyV.js";import{B as E,C as D,E as he,L as ge,P as O,R as _e,S as ve,T as ye,g as be,h as xe,v as Se,w as Ce,x as we}from"./index-_SOdLUMq.js";var k=e(b(),1),A=x();function j(e){return!e.hasChanges&&e.defaultBranchBehind>0}function M(e){return e.prExists&&e.prState===`OPEN`&&!e.hasChanges&&!e.hasUnpushedCommits}function N(e){return e.hasUnpushedCommits&&e.prExists}function Te(e,t){return t?`Creating PR...`:e.hasChanges?`Commit`:N(e)?`Update PR`:M(e)?`Open PR`:e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges?`Create PR`:j(e)?`Sync`:`Commit`}function Ee(e,t,n=!1){return t||n?(0,A.jsx)(w,{className:`h-3.5 w-3.5 animate-spin`}):e.hasChanges?(0,A.jsx)(f,{className:`h-3.5 w-3.5`}):M(e)?(0,A.jsx)(a,{className:`h-3.5 w-3.5`}):j(e)?(0,A.jsx)(y,{className:`h-3.5 w-3.5`}):(0,A.jsx)(_,{className:`h-3.5 w-3.5`})}function De(e){if(e.hasChanges)return e.changedFilesCount>0?`Commit ${e.changedFilesCount} changed file${e.changedFilesCount===1?``:`s`}`:`No changes to commit`;if(N(e))return`Update pull request with unpushed commits`;if(M(e))return`View pull request in GitHub`;if(e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges)return`Create pull request for committed changes`;if(j(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 Oe(e,t,n=!1){return t||n?!0:M(e)||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges||j(e)?!1:!e.hasChanges&&!e.hasUnpushedCommits}function ke(e){return e.hasChanges||M(e)||N(e)||j(e)||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges}var Ae=C();function je(e){let n=(0,Ae.c)(103),{branchStatus:i,remoteUrl:te,hasRemoteBranch:s,hasUnpushedCommits:c,canCreateRepo:re,repoUrl:f,isRefreshing:ae,isBrandState:h,hasChanges:g,defaultBranch:oe,defaultBranchAhead:se,defaultBranchBehind:v,gitUser:b,isDirectCommitMode:ue,autoGenerateCommitMessage:x,isLoading:S,isLoadingHistory:de,isQuickCommitting:C,onFetch:fe,onPull:T,onPush:E,onOpenHistory:ge,onCreatePR:O,onCreateRepo:_e,onViewInGitHub:be,onQuickCommit:xe,onSyncWithDefault:Se,onOpenChange:k,layout:j}=e,M=j===void 0?`bar`:j,N=!!oe&&!!te&&v>0,Te=!g&&!S,Ee=M===`bar`&&`w-8 rounded-l-none`,De=M===`menu`&&`w-full justify-start gap-2 rounded-md`,Oe=h&&M===`bar`&&` border-transparent bg-brand text-brand-foreground hover:bg-brand/90 hover:text-brand-foreground`,ke;n[0]!==Ee||n[1]!==De||n[2]!==Oe?(ke=ie(`h-8 px-1`,Ee,De,Oe),n[0]=Ee,n[1]=De,n[2]=Oe,n[3]=ke):ke=n[3];let je;n[4]===ae?je=n[5]:(je=ae?(0,A.jsx)(w,{className:`h-3.5 w-3.5 animate-spin`}):(0,A.jsx)(m,{className:`h-3.5 w-3.5`}),n[4]=ae,n[5]=je);let P;n[6]===M?P=n[7]:(P=M===`menu`&&(0,A.jsx)(`span`,{children:`More git actions`}),n[6]=M,n[7]=P);let F;n[8]!==S||n[9]!==ke||n[10]!==je||n[11]!==P?(F=(0,A.jsx)(he,{asChild:!0,children:(0,A.jsxs)(t,{variant:`outline`,size:`sm`,className:ke,disabled:S,children:[je,P]})}),n[8]=S,n[9]=ke,n[10]=je,n[11]=P,n[12]=F):F=n[12];let Me;n[13]!==i||n[14]!==te?(Me=i===`Behind`&&(0,A.jsxs)(`div`,{className:ie(p.compact,`px-2 py-1 text-amber-600`),children:[`Branch is behind `,te?`origin`:`remote`]}),n[13]=i,n[14]=te,n[15]=Me):Me=n[15];let Ne;n[16]===b?Ne=n[17]:(Ne=b&&(0,A.jsxs)(`div`,{className:ie(p.compact,`px-2 py-1 text-muted-foreground`),children:[(0,A.jsx)(`span`,{className:`font-medium`,children:`User:`}),` `,b]}),n[16]=b,n[17]=Ne);let Pe;n[18]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,A.jsx)(Ce,{}),n[18]=Pe):Pe=n[18];let Fe;n[19]!==Te||n[20]!==oe||n[21]!==se||n[22]!==v||n[23]!==g||n[24]!==Se||n[25]!==N?(Fe=N&&(0,A.jsx)(o,{children:(0,A.jsxs)(u,{children:[(0,A.jsx)(l,{asChild:!0,children:(0,A.jsxs)(D,{onClick:()=>{Te&&Se()},className:Te?``:`opacity-50 cursor-not-allowed`,children:[(0,A.jsx)(ee,{className:`h-3.5 w-3.5 mr-2`}),`Sync with `,oe,(0,A.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 pl-3 text-xs tabular-nums text-muted-foreground`,children:[se>0&&(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,A.jsx)(le,{className:`h-3 w-3`}),se]}),v>0&&(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,A.jsx)(y,{className:`h-3 w-3`}),v]})]})]})}),(0,A.jsx)(d,{side:`right`,children:g?`Commit or stash changes before syncing with the default branch`:`Pull latest changes from origin/${oe} onto your current branch`})]})}),n[19]=Te,n[20]=oe,n[21]=se,n[22]=v,n[23]=g,n[24]=Se,n[25]=N,n[26]=Fe):Fe=n[26];let Ie;n[27]!==x||n[28]!==g||n[29]!==S||n[30]!==C||n[31]!==xe?(Ie=g&&x&&(0,A.jsx)(o,{children:(0,A.jsxs)(u,{children:[(0,A.jsx)(l,{asChild:!0,children:(0,A.jsxs)(D,{onClick:xe,disabled:S||C,children:[C?(0,A.jsx)(w,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,A.jsx)(pe,{className:`h-3.5 w-3.5 mr-2`}),`Quick Commit`,(0,A.jsx)(ye,{children:`⌘⇧C`})]})}),(0,A.jsx)(d,{side:`right`,children:`Generate the commit message and commit`})]})}),n[27]=x,n[28]=g,n[29]=S,n[30]=C,n[31]=xe,n[32]=Ie):Ie=n[32];let Le;n[33]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,A.jsx)(ne,{className:`h-3.5 w-3.5 mr-2`}),n[33]=Le):Le=n[33];let I;n[34]!==S||n[35]!==fe?(I=(0,A.jsx)(l,{asChild:!0,children:(0,A.jsxs)(D,{onClick:fe,disabled:S,children:[Le,`Fetch`]})}),n[34]=S,n[35]=fe,n[36]=I):I=n[36];let L;n[37]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,A.jsx)(d,{side:`right`,children:`Download latest information from remote without merging changes`}),n[37]=L):L=n[37];let R;n[38]===I?R=n[39]:(R=(0,A.jsx)(o,{children:(0,A.jsxs)(u,{children:[I,L]})}),n[38]=I,n[39]=R);let z;n[40]!==s||n[41]!==S||n[42]!==T?(z=()=>{s&&!S&&T()},n[40]=s,n[41]=S,n[42]=T,n[43]=z):z=n[43];let Re=!s||S?`opacity-50 cursor-not-allowed`:``,ze;n[44]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,A.jsx)(y,{className:`h-3.5 w-3.5 mr-2`}),n[44]=ze):ze=n[44];let B;n[45]!==z||n[46]!==Re?(B=(0,A.jsx)(l,{asChild:!0,children:(0,A.jsxs)(D,{onClick:z,className:Re,children:[ze,`Pull`]})}),n[45]=z,n[46]=Re,n[47]=B):B=n[47];let Be=s?`Pull latest changes from remote`:`No remote branch to pull from`,V;n[48]===Be?V=n[49]:(V=(0,A.jsx)(d,{side:`right`,children:Be}),n[48]=Be,n[49]=V);let H;n[50]!==B||n[51]!==V?(H=(0,A.jsx)(o,{children:(0,A.jsxs)(u,{children:[B,V]})}),n[50]=B,n[51]=V,n[52]=H):H=n[52];let U;n[53]!==s||n[54]!==S||n[55]!==E?(U=!s&&(0,A.jsx)(o,{children:(0,A.jsxs)(u,{children:[(0,A.jsx)(l,{asChild:!0,children:(0,A.jsxs)(D,{onClick:E,disabled:S,children:[(0,A.jsx)(r,{className:`h-3.5 w-3.5 mr-2`}),`Push Branch to Remote`]})}),(0,A.jsx)(d,{side:`right`,children:`Create remote branch and push local commits`})]})}),n[53]=s,n[54]=S,n[55]=E,n[56]=U):U=n[56];let W;n[57]!==c||n[58]!==S||n[59]!==E?(W=()=>{c&&!S&&E()},n[57]=c,n[58]=S,n[59]=E,n[60]=W):W=n[60];let Ve=!c||S?`opacity-50 cursor-not-allowed`:``,He;n[61]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,A.jsx)(r,{className:`h-3.5 w-3.5 mr-2`}),n[61]=He):He=n[61];let Ue;n[62]!==W||n[63]!==Ve?(Ue=(0,A.jsx)(l,{asChild:!0,children:(0,A.jsxs)(D,{onClick:W,className:Ve,children:[He,`Push Commits`]})}),n[62]=W,n[63]=Ve,n[64]=Ue):Ue=n[64];let We=c?S?`Push in progress...`:`Push your uncommitted commits to the remote branch`:`No commits to push - your branch is up to date with remote`,Ge;n[65]===We?Ge=n[66]:(Ge=(0,A.jsx)(d,{side:`right`,children:We}),n[65]=We,n[66]=Ge);let Ke;n[67]!==Ue||n[68]!==Ge?(Ke=(0,A.jsx)(o,{children:(0,A.jsxs)(u,{children:[Ue,Ge]})}),n[67]=Ue,n[68]=Ge,n[69]=Ke):Ke=n[69];let qe=S||de,G;n[70]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,A.jsx)(ce,{className:`h-3.5 w-3.5 mr-2`}),n[70]=G):G=n[70];let Je;n[71]!==ge||n[72]!==qe?(Je=(0,A.jsxs)(D,{onClick:ge,disabled:qe,children:[G,`History`]}),n[71]=ge,n[72]=qe,n[73]=Je):Je=n[73];let K;n[74]!==ue||n[75]!==S||n[76]!==O?(K=!ue&&(0,A.jsxs)(D,{onClick:O,disabled:S,children:[(0,A.jsx)(_,{className:`h-3.5 w-3.5 mr-2`}),`Create Pull Request`,(0,A.jsx)(ye,{children:`⌘⇧P`})]}),n[74]=ue,n[75]=S,n[76]=O,n[77]=K):K=n[77];let q;n[78]!==re||n[79]!==S||n[80]!==_e?(q=re&&(0,A.jsxs)(D,{onClick:_e,disabled:S,children:[(0,A.jsx)(me,{className:`h-3.5 w-3.5 mr-2`}),`Create Repo`]}),n[78]=re,n[79]=S,n[80]=_e,n[81]=q):q=n[81];let J;n[82]!==S||n[83]!==be||n[84]!==f?(J=f&&(0,A.jsxs)(D,{onClick:be,disabled:S,children:[(0,A.jsx)(a,{className:`h-3.5 w-3.5 mr-2`}),`View in GitHub`]}),n[82]=S,n[83]=be,n[84]=f,n[85]=J):J=n[85];let Y;n[86]!==Ne||n[87]!==Fe||n[88]!==Ie||n[89]!==R||n[90]!==H||n[91]!==U||n[92]!==Ke||n[93]!==Je||n[94]!==K||n[95]!==q||n[96]!==J||n[97]!==Me?(Y=(0,A.jsxs)(ve,{align:`end`,children:[Me,Ne,Pe,Fe,Ie,R,H,U,Ke,Je,K,q,J]}),n[86]=Ne,n[87]=Fe,n[88]=Ie,n[89]=R,n[90]=H,n[91]=U,n[92]=Ke,n[93]=Je,n[94]=K,n[95]=q,n[96]=J,n[97]=Me,n[98]=Y):Y=n[98];let X;return n[99]!==k||n[100]!==Y||n[101]!==F?(X=(0,A.jsxs)(we,{onOpenChange:k,children:[F,Y]}),n[99]=k,n[100]=Y,n[101]=F,n[102]=X):X=n[102],X}function P(e){return e?!0:(O({title:`Error`,description:`No thread selected`,variant:`destructive`}),!1)}function F(e){let t=e.split(`/`);return t.length>=2?{provider:t[0],model:t.slice(1).join(`/`)}:{provider:void 0,model:e}}function Me(e,t,n){let[r,i]=(0,k.useState)(!1),[a,o]=(0,k.useState)(!1),ee=()=>n?.id?n.provider?{provider:n.provider,model:n.id}:F(n.id):{provider:void 0,model:void 0};return{isGeneratingMessage:r,isGeneratingPRInfo:a,generateCommitMessageWithAI:(0,k.useCallback)(async()=>{if(!e)return null;try{i(!0);let{provider:t,model:n}=ee();return await S(e,n,t)}catch(e){return console.error(`Failed to generate commit message:`,e),O({title:`Error`,description:e instanceof Error?e.message:`Failed to generate commit message`,variant:`destructive`}),null}finally{i(!1)}},[e,n]),generatePRInfoWithAI:(0,k.useCallback)(async()=>{if(!e)return null;try{o(!0);let{provider:t,model:n}=ee();return await h(e,n,t)}catch(e){return console.error(`Failed to generate PR info:`,e),O({title:`Error`,description:e instanceof Error?e.message:`Failed to generate PR info`,variant:`destructive`}),null}finally{o(!1)}},[e,n])}}var Ne=(0,k.lazy)(()=>T(()=>import(`./commit-dialog-DcVXFOBP.js`).then(e=>({default:e.CommitDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),Pe=(0,k.lazy)(()=>T(()=>import(`./pull-request-dialog-BFgRF5AH.js`).then(e=>({default:e.PullRequestDialog})),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]))),Fe=(0,k.lazy)(()=>T(()=>import(`./create-repo-dialog-CsjpTBPU.js`).then(e=>({default:e.CreateRepoDialog})),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11]))),Ie=(0,k.lazy)(()=>T(()=>import(`./git-history-dialog-qUZ7Qsp4.js`).then(e=>({default:e.GitHistoryDialog})),__vite__mapDeps([14,6,2]))),Le=(0,k.lazy)(()=>T(()=>import(`./push-before-pr-dialog-BQ0QC6Qu.js`).then(e=>({default:e.PushBeforePRDialog})),__vite__mapDeps([15,6,2]))),I=(0,k.lazy)(()=>T(()=>import(`./pull-with-changes-dialog-oGP-j8Yw.js`).then(e=>({default:e.PullWithChangesDialog})),__vite__mapDeps([16,5,2,6])));function L(){return null}async function R(e,t,n,r){r&&(await s(e,{title:r}),n({type:E.UpdateThreadTitle,projectId:t,threadId:e,title:r}))}function z({projectId:e,threadId:r,layout:a=`bar`}){let ee=ge(),s=_e(e=>e.projectModelSelections[r]),ne=_e(t=>t.projects.find(t=>t.projectId===e)),[f,p]=(0,k.useState)(!1),[m,h]=(0,k.useState)(!1),[_,ce]=(0,k.useState)(!1),[y,b]=(0,k.useState)(!1),[le,x]=(0,k.useState)(``),[S,C]=(0,k.useState)(``),[w,pe]=(0,k.useState)(``),[me,T]=(0,k.useState)(!1),[D,he]=(0,k.useState)(null),ve=(0,k.useRef)(!1),ye=(0,k.useRef)(!1),Ce=(0,k.useRef)(S),we=(0,k.useRef)(w);Ce.current=S,we.current=w;let[j,M]=(0,k.useState)(!1),[N,Ae]=(0,k.useState)([]),[F,z]=(0,k.useState)(!1),[Re,ze]=(0,k.useState)([]),[B,Be]=(0,k.useState)(!1),[V,H]=(0,k.useState)(!1),[U,W]=(0,k.useState)(``),[Ve,He]=(0,k.useState)(``),[Ue,We]=(0,k.useState)(``),[Ge,Ke]=(0,k.useState)(!1),[qe,G]=(0,k.useState)(!1),[Je,K]=(0,k.useState)(!1),q=(0,k.useRef)(!1),J=Se(),{fetchUnifiedStatus:Y}=J,X=Me(r,e,s),Z=(0,k.useRef)(null),Ye=(0,k.useRef)(()=>{}),Xe=(0,k.useRef)(()=>{});(0,k.useEffect)(()=>()=>{Z.current!==null&&(clearInterval(Z.current),Z.current=null)},[]);async function Q(){fe();let e=await i();ee({type:E.SetProjects,projects:e.projects})}let[$,Ze]=(0,k.useState)(()=>xe()),Qe=ne?.commitMethod===ue.Direct;(0,k.useEffect)(()=>{V&&ne?.name&&!U&&W(ne.name)},[V,ne?.name,U]),(0,k.useEffect)(()=>{be($)},[$]);function $e(){Ge||(Ke(!0),se().then(e=>We(e)).catch(()=>{}))}(0,k.useEffect)(()=>{if(!_){ye.current=!1;return}if(_&&$.autoGenerateCommitMessage&&!le.trim()&&r&&!ye.current){ye.current=!0;async function e(){let e=await X.generateCommitMessageWithAI();e&&x(e)}e()}},[_,$.autoGenerateCommitMessage,r,X.generateCommitMessageWithAI,le]),(0,k.useEffect)(()=>{if(!y){ve.current=!1;return}if(y&&$.autoGeneratePRInfo&&!Ce.current.trim()&&!we.current.trim()&&r&&!ve.current){ve.current=!0;async function e(){let e=await X.generatePRInfoWithAI();e&&(C(e.title),pe(e.description),O({title:`Success`,description:`PR title and description generated`}))}e()}},[y,$.autoGeneratePRInfo,r,X.generatePRInfoWithAI]),Ye.current=rt,Xe.current=()=>b(!0),(0,k.useEffect)(()=>{function e(e){let t=e.key.toLowerCase();if((e.metaKey||e.ctrlKey)&&e.shiftKey&&!e.altKey){if(t===`c`){J.hasChanges&&$.autoGenerateCommitMessage&&!f&&(e.preventDefault(),Ye.current());return}t===`p`&&J.commitsAheadOfDefault&&!J.prExists&&!J.hasChanges&&!f&&!Qe&&(e.preventDefault(),Xe.current())}}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[J.commitsAheadOfDefault,J.hasChanges,J.prExists,$.autoGenerateCommitMessage,f,Qe]),(0,k.useEffect)(()=>{m&&J.prExists&&J.prState===`OPEN`&&h(!1)},[J.prExists,J.prState,m]),(0,k.useEffect)(()=>{if(!m)return;let e=setTimeout(()=>{h(!1)},15e3);return()=>clearTimeout(e)},[m]),(0,k.useEffect)(()=>{let e=J.prExists&&J.prState===`OPEN`&&!J.hasChanges&&!J.hasUnpushedCommits;e&&!q.current&&Q(),q.current=e},[J.hasChanges,J.hasUnpushedCommits,J.prExists,J.prState]);async function et(){if(le.trim()&&P(r))try{p(!0),await c(r,le),x(``),ce(!1),await J.fetchUnifiedStatus(!0),Q(),O({title:`Changes committed successfully`,description:`Your changes have been committed to '${J.currentBranch}'.`}),Je&&(K(!1),await st())}catch(e){console.error(`Failed to commit:`,e),O({title:`Commit failed`,description:e instanceof Error?e.message:`Failed to commit changes`,variant:`destructive`})}finally{p(!1)}}async function tt(){if(J.hasChanges){ce(!0);return}if(J.hasUnpushedCommits&&J.prExists){await at();return}if(J.prExists&&J.prState===`OPEN`&&!J.hasChanges&&!J.hasUnpushedCommits){J.prUrl&&await v(J.prUrl);return}if(J.commitsAheadOfDefault&&!J.prExists&&!J.hasChanges){b(!0);return}if(J.defaultBranchBehind>0){await ut();return}}async function nt(){let e=await X.generateCommitMessageWithAI();e&&x(e)}async function rt(){if(P(r))try{p(!0);let e=await X.generateCommitMessageWithAI();if(!e){O({title:`Quick Commit failed`,description:`Could not generate commit message`,variant:`destructive`});return}await c(r,e),await J.fetchUnifiedStatus(!0),Q(),O({title:`Changes committed successfully`,description:`Committed: ${e}`})}catch(e){console.error(`Quick commit failed:`,e),O({title:`Quick Commit failed`,description:e instanceof Error?e.message:`Failed to commit changes`,variant:`destructive`})}finally{p(!1)}}async function it(){if(P(r))try{p(!0),await te(r),await J.fetchUnifiedStatus()}catch(e){console.error(`Failed to fetch:`,e)}finally{p(!1)}}async function at(){if(P(r))try{p(!0),await re(r),await J.fetchUnifiedStatus(!0),Q(),J.hasRemoteBranch?O({title:`Branch pushed successfully`,description:`Your branch '${J.currentBranch}' has been pushed to the remote.`}):O({title:`Push completed`,description:`Changes have been pushed successfully.`})}catch(e){console.error(`Failed to push:`,e),O({title:`Push failed`,description:e instanceof Error?e.message:`Failed to push to remote`,variant:`destructive`})}finally{p(!1)}}async function ot(){if(P(r)){if(J.hasChanges){G(!0);return}await st()}}async function st(){try{p(!0),await de(r),await J.fetchUnifiedStatus(!0),Q(),O({title:`Pull successful`,description:`Latest changes have been pulled from remote.`})}catch(e){console.error(`Failed to pull:`,e),O({title:`Pull failed`,description:e instanceof Error?e.message:`Failed to pull from remote`,variant:`destructive`})}finally{p(!1)}}function ct(){G(!1),K(!0),ce(!0)}async function lt(){G(!1),await st()}async function ut(){if(P(r))try{p(!0),await g(r),await J.fetchUnifiedStatus(!0),Q(),O({title:`Branch synced successfully`,description:`Your branch '${J.currentBranch}' has been synced with the latest changes`})}catch(e){console.error(`[sync] ✗ Failed to sync branch:`,e),O({title:`Sync failed`,description:e instanceof Error?e.message:`Failed to sync with default branch`,variant:`destructive`})}finally{p(!1)}}async function dt(){if(P(r))try{p(!0),h(!0);let t=await ae(r,S,w);await R(r,e,ee,t.title??S),t.prUrl&&await v(t.prUrl),C(``),pe(``),b(!1),await J.fetchUnifiedStatus(!0),Q();let n=0;Z.current!==null&&clearInterval(Z.current),Z.current=setInterval(async()=>{if(n++,n>=6){Z.current!==null&&(clearInterval(Z.current),Z.current=null);return}await J.fetchUnifiedStatus(!0)},2e3)}catch(e){console.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`)?(b(!1),mt({title:S,description:w})):(h(!1),O({title:`Create PR Failed`,description:t,variant:`destructive`}))}finally{p(!1)}}async function ft(){if(P(r))try{p(!0);let e=await n(r,U,Ve,$.privateRepositoryDefault);e.repoUrl&&setTimeout(()=>{v(e.repoUrl)},3e3),W(``),He(``),H(!1),await J.fetchUnifiedStatus(),Q()}catch(e){console.error(`Failed to create repo:`,e)}finally{p(!1)}}async function pt(){let e=await X.generatePRInfoWithAI();e&&(C(e.title),pe(e.description),O({title:`Success`,description:`PR title and description generated`}))}async function mt(t){let n=t??D;if(!(!r||!n))try{p(!0),h(!0);try{await re(r)}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`)){O({title:`Syncing branch before push`,description:`Your branch is behind remote. Pulling latest changes first...`});try{await g(r),await re(r)}catch{throw e}}else throw e}let t=await ae(r,n.title,n.description);await R(r,e,ee,t.title??n.title),t.prUrl&&await v(t.prUrl),C(``),pe(``),he(null),T(!1),await J.fetchUnifiedStatus(!0),Q();let i=0;Z.current!==null&&clearInterval(Z.current),Z.current=setInterval(async()=>{if(i++,i>=6){Z.current!==null&&(clearInterval(Z.current),Z.current=null);return}await J.fetchUnifiedStatus(!0)},2e3)}catch(e){console.error(`Failed to push and create PR:`,e);let t=e instanceof Error?e.message:`Failed to push and create PR`;h(!1),O({title:`Push & Create PR Failed`,description:t,variant:`destructive`})}finally{p(!1)}}async function ht(){if(P(r))try{z(!0);let e=await oe(r,100);Ae(e),ze(e.slice(0,10)),M(!0)}catch(e){console.error(`Failed to fetch git history:`,e)}finally{z(!1)}}function gt(){B||(Be(!0),setTimeout(()=>{let e=Re.length+10;ze(N.slice(0,e)),Be(!1)},300))}function _t(e){let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight<100&&Re.length<N.length&&!B&>()}let vt=ke(J);function yt(){J.repoUrl&&v(J.repoUrl)}function bt(){T(!1),he(null)}return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:ie(`flex items-center gap-0`,a===`menu`&&`w-full flex-col gap-1 [&_button]:w-full [&_button]:justify-start`),children:[(0,A.jsx)(o,{children:(0,A.jsxs)(u,{children:[(0,A.jsx)(l,{asChild:!0,children:(0,A.jsxs)(t,{variant:`outline`,size:`sm`,className:ie(`h-8 gap-1.5`,a===`bar`&&`rounded-r-none border-r-0`,a===`menu`&&`rounded-md border`,vt&&` border-transparent bg-brand text-brand-foreground hover:bg-brand/90 hover:text-brand-foreground`),disabled:Oe(J,f,m),onClick:tt,children:[Ee(J,m,f),Te(J,m)]})}),(0,A.jsx)(d,{children:De(J)})]})}),(0,A.jsx)(je,{branchStatus:J.status,remoteUrl:J.remoteUrl,hasRemoteBranch:J.hasRemoteBranch,hasUnpushedCommits:J.hasUnpushedCommits,canCreateRepo:J.canCreateRepo,repoUrl:J.repoUrl,isRefreshing:J.isRefreshing,isBrandState:vt,hasChanges:J.hasChanges,defaultBranch:J.defaultBranch??null,defaultBranchAhead:J.defaultBranchAhead,defaultBranchBehind:J.defaultBranchBehind,gitUser:Ue,isDirectCommitMode:Qe,autoGenerateCommitMessage:$.autoGenerateCommitMessage,isLoading:f||m,isLoadingHistory:F,isQuickCommitting:X.isGeneratingMessage&&f,onFetch:()=>void it(),onPull:()=>void ot(),onPush:()=>void at(),onOpenHistory:()=>void ht(),onCreatePR:()=>b(!0),onCreateRepo:()=>H(!0),onViewInGitHub:yt,onQuickCommit:()=>void rt(),onSyncWithDefault:()=>void ut(),onOpenChange:e=>{e&&($e(),Y(!0))},layout:a})]}),_&&(0,A.jsx)(k.Suspense,{fallback:(0,A.jsx)(L,{}),children:(0,A.jsx)(Ne,{open:_,onOpenChange:ce,commitMessage:le,onCommitMessageChange:x,autoGenerateCommitMessage:$.autoGenerateCommitMessage,onAutoGenerateChange:e=>Ze(t=>({...t,autoGenerateCommitMessage:e})),isGeneratingMessage:X.isGeneratingMessage,isLoading:f,onGenerateMessage:nt,onCommit:et,currentBranch:J.currentBranch})}),y&&(0,A.jsx)(k.Suspense,{fallback:(0,A.jsx)(L,{}),children:(0,A.jsx)(Pe,{open:y,onOpenChange:b,prTitle:S,onPrTitleChange:C,prDescription:w,onPrDescriptionChange:pe,isGeneratingPRInfo:X.isGeneratingPRInfo,isLoading:f,onGeneratePRInfo:pt,onCreatePR:dt,currentBranch:J.currentBranch,autoGeneratePRInfo:$.autoGeneratePRInfo,onAutoGeneratePRInfoChange:e=>Ze(t=>({...t,autoGeneratePRInfo:e}))})}),me&&(0,A.jsx)(k.Suspense,{fallback:(0,A.jsx)(L,{}),children:(0,A.jsx)(Le,{open:me,onOpenChange:T,isLoading:f,onPushAndCreatePR:mt,onCancel:bt})}),V&&(0,A.jsx)(k.Suspense,{fallback:(0,A.jsx)(L,{}),children:(0,A.jsx)(Fe,{open:V,onOpenChange:H,repoName:U,onRepoNameChange:W,repoDescription:Ve,onRepoDescriptionChange:He,isPrivateRepo:$.privateRepositoryDefault,onPrivateRepoChange:e=>Ze(t=>({...t,privateRepositoryDefault:e})),isLoading:f,onCreateRepo:ft})}),j&&(0,A.jsx)(k.Suspense,{fallback:(0,A.jsx)(L,{}),children:(0,A.jsx)(Ie,{open:j,onOpenChange:M,commits:N,displayedCommits:Re,isLoadingMore:B,onScroll:_t,currentBranch:J.currentBranch})}),qe&&(0,A.jsx)(k.Suspense,{fallback:(0,A.jsx)(L,{}),children:(0,A.jsx)(I,{open:qe,onOpenChange:G,onCommitFirst:ct,onStashAndPull:lt,onCancel:()=>G(!1),isLoading:f})})]})}export{z as GitOpsButton};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{Ai as n,Br as r,Ci as i,Di as a,Ea as o,Ei as s,Fr as c,Hr as l,Ir as u,Jo as d,Lr as f,Mi as p,Nr as m,Oi as h,Pr as g,Ti as _,Ur as v,Vr as y,Xi as b,Xo as x,Yi as S,Yo as C,Zo as w,_ as T,ai as E,bi as D,c as O,ci as k,cs as A,di as j,fi as M,ga as N,gi as P,hi as F,ii as ee,ji as te,ki as I,l as L,li as R,ls as ne,ni as re,oi as ie,os as ae,ot as oe,pi as se,qo as ce,ri as le,s as ue,si as de,ss as fe,ti as pe,u as me,ui as he,uo as ge,vi as _e,wi as ve,xi as z,ya as ye,zo as be,zr as xe}from"./dialogs-config-BEazgV7k.js";var B=fe(),Se=Object,Ce=Map,we=Set,Te=we.prototype.has,Ee=we.prototype.add,De=Ce.prototype.has,Oe=Ce.prototype.get,ke=Ce.prototype.set,Ae=1,je=2,Me=4,Ne=8,Pe=16,Fe=32,V=`__t`,Ie=`__p`,Le=`__e`,Re=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ze=`http://www.w3.org/1999/xlink`,Be=`http://www.w3.org/2000/xmlns/`,Ve=120,He=new we([`href`,`list`,`form`,`tabIndex`,`download`]),Ue=new we([`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`isindex`,`keygen`,`link`,`menuitem`,`meta`,`nextid`,`param`,`source`,`track`,`wbr`]);if(typeof window>`u`)throw Error(`See http://million.dev/docs/install to install the compiler.`);var H=document;H.createElement(`template`);var We=H.createElement(`template`),Ge=We.content,Ke=H.createElementNS(`http://www.w3.org/2000/svg`,`svg`),U=Node.prototype,qe=Element.prototype,Je=CharacterData.prototype,Ye=Se.getOwnPropertyDescriptor,Xe=U.insertBefore,Ze=U.cloneNode,Qe=U.replaceChild,$e=qe.remove,et=U.addEventListener,tt=qe.removeAttribute,nt=qe.setAttribute,rt=qe.setAttributeNS,it=Ye(U,`textContent`).set,at=Ye(U,`firstChild`).get,ot=Ye(U,`nextSibling`).get,st=Ye(Je,`data`).set,ct=(e,t)=>{let n=t?Ke:We;return n.innerHTML=e,(t?Ke:Ge).firstChild};H[Le]=new we;var lt=(e,t,n)=>{let r=t.toLowerCase(),i=!1;r.endsWith(`capture`)&&(r=r.slice(0,-7),i=!0);let a=`$$${r}`;Te.call(H[Le],r)||(et.call(H,r,e=>{let t=e.target;for(;t;){let n=t[a];n&&(Se.defineProperty(e,`currentTarget`,{configurable:!0,get(){return t}}),n(e)),t=t.parentNode}},{capture:i}),Ee.call(H[Le],r));let o=t=>{t?`key`in t&&t.key===e[a]?.key||(e[a]=t):e[a]=null};return o(n),o},ut=(e,t)=>{let n=at.call(e);if(t)for(let e=0;e<t&&n;++e)n=ot.call(n);return n},dt=new WeakSet,ft=e=>{if(dt.has(e))return;e.nodeType===8&&e.parentNode?.removeChild(e);let t=at.call(e);for(;t;)ft(t),t=t.nextSibling;dt.add(e)},pt=(e,t,n)=>{let r=H.createTextNode(t),i=ut(e,n);return Xe.call(e,r,i),r},mt=(e,t)=>{st.call(e,t)},ht=(e,t,n)=>{typeof n!=`number`||Re.test(t)?e.style[t]=n:typeof n==`string`?e.style.cssText=n:t.startsWith(`-`)?e.style.setProperty(t,String(n)):n==null?e.style[t]=``:e.style[t]=`${String(n)}px`},gt=(e,t,n)=>{t=t.replace(/xlink(?:H|:h)/,`h`).replace(/sName$/,`s`),t.startsWith(`xmlns`)?rt.call(e,Be,t,String(n)):t.startsWith(`xlink`)&&rt.call(e,ze,`href`,String(n))},_t=(e,t,n)=>{let r=n==null;if(n=r?``:n,t in e&&e[t]!==void 0&&e[t]!==null&&!(e instanceof SVGElement)&&Te.call(He,t))try{e[t]=n}catch{}else !r&&n!==``&&(n!==!1||t.includes(`-`))?nt.call(e,t,String(n)):tt.call(e,t);let i=e instanceof HTMLInputElement,a=e instanceof HTMLSelectElement,o=e instanceof HTMLTextAreaElement;t===`value`&&(i||a||o)&&(nt.call(e,t,String(n)),e.value=n)},vt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]);function yt(e){return vt.get(e)||e}var bt=Object.defineProperty,xt=(e,t,n)=>t in e?bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W=(e,t,n)=>(xt(e,typeof t==`symbol`?t:t+``,n),n),St=class{constructor(){W(this,`r`),W(this,`e`),W(this,`l`),W(this,`g`),W(this,`_u`),W(this,`_t`),W(this,`d`),W(this,`k`),W(this,`c`)}},Ct=(e,t=[],n=[])=>{if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`bigint`||e===!0)return String(e);if(e==null||e===!1)return``;if(typeof e==`object`&&`$`in e)return t.push({p:n,e:[{t:Ae,n:null,v:null,h:e.$,i:0,l:null,p:null,b:null}],i:[]}),`<slot/>`;let r=``,i=``,a={p:n,e:[],i:[]};for(let t in e.props){let n=e.props[t];if(t===`key`||t===`ref`||t===`children`)continue;let i=yt(t);if(i&&(t=i),t===`className`&&(t=`class`),t.startsWith(`on`)){`$`in n?a.e.push({t:Me,n:t.slice(2),v:null,h:n.$,i:null,l:null,p:null,b:null}):a.i.push({t:Me,n:t.slice(2),v:null,h:null,i:null,l:n,p:null,b:null});continue}if(n){if(typeof n==`object`&&`$`in n){t===`style`?a.e.push({t:Ne,n:t,v:null,h:n.$,i:null,l:null,p:null,b:null}):t.charCodeAt(0)===Ve?a.e.push({t:Pe,n:t,v:null,h:n.$,i:null,l:null,p:null,b:null}):a.e.push({t:je,n:t,v:null,h:n.$,i:null,l:null,p:null,b:null});continue}if(t===`style`&&typeof n==`object`){let e=``;for(let t in n){if(typeof n[t]==`object`){a.e.push({t:Ne,n:t,v:null,h:n[t].$,i:null,l:null,p:null,b:null});continue}let r=``;for(let e=0,n=t.length;e<n;++e){let n=t.charCodeAt(e);n<97?r+=`-${String.fromCharCode(n+32)}`:r+=t[e]}e+=`${r}:${String(n[t])};`}r+=` style="${e}"`;continue}r+=` ${t}="${String(n)}"`}}if(Te.call(Ue,e.type))return a.e.length&&t.push(a),`<${e.type}${r} />`;let o=!1;for(let r=0,s=e.props.children?.length||0,c=0;r<s;++r){let s=e.props.children?.[r];if(s==null||s===!1)continue;if(typeof s==`object`&&`$`in s){a.e.push({t:Ae,n:null,v:null,h:s.$,i:r,l:null,p:null,b:null});continue}if(s instanceof St){a.i.push({t:Fe,n:null,v:null,h:null,i:r,l:null,p:null,b:s});continue}if(typeof s==`string`||typeof s==`number`||typeof s==`bigint`){let e=typeof s==`number`||typeof s==`bigint`?String(s):s;if(o){a.i.push({t:Ae,n:null,v:e,h:null,i:r,l:null,p:null,b:null});continue}o=!0,i+=e,c++;continue}o=!1;let l=n.slice();l.push(c++),i+=Ct(s,t,l)}return(a.i.length||a.e.length)&&t.push(a),`<${e.type}${r}>${i}</${e.type}>`},wt=Object.defineProperty,Tt=(e,t,n)=>t in e?wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Et=(e,t,n)=>(Tt(e,typeof t==`symbol`?t:t+``,n),n),Dt=e=>new Ot(e),Ot=class extends St{constructor(e){super(),Et(this,`b`),this.b=e}v(){}p(e){let t=this.b,n=e.b,r=t.length,i=n.length,a=this.t();if(this===e||i===0&&r===0)return a;if(this.b=n,i===0)return Mt.call(this),a;if(r===0)return At.call(e,a),a;let o=0,s=0,c=r-1,l=i-1,u=t[0],d=n[0],f=t[c],p=n[l],m;for(;o<=c&&s<=l;){if(!u){u=t[++o];continue}if(!f){f=t[--c];continue}let e=u.k,r=d.k;if(e===r){Bt.call(u,d),n[s]=u,u=t[++o],d=n[++s];continue}let i=f.k,h=p.k;if(i===h){Bt.call(f,p),n[l]=f,f=t[--c],p=n[--l];continue}if(e===h){Bt.call(u,p),n[l]=u;let e=n[l+1];Vt.call(u,e,e?.l||null),u=t[++o],p=n[--l];continue}if(i===r){Bt.call(f,d),n[s]=f;let e=t[o];Vt.call(f,e,e?.l||null),f=t[--c],d=n[++s];continue}if(!m){m=new Ce;for(let e=o;e<=c;e++)ke.call(m,t[e].k,e)}let g=m.get(r);if(g===void 0)zt.call(d,a,u.l||null);else{let e=t[g];Vt.call(e,u,null),Bt.call(e,d),n[s]=e,t[g]=null}d=n[++s]}if(o<=c||s<=l)if(o>c){let e=n[l+1];for(let t=s;t<=l;++t)zt.call(n[t],a,e?e.l:null)}else for(let e=o;e<=c;++e)Ht.call(t[e]);return a}m(e,t=null){if(this._t)return this._t;for(let n=0,r=this.b.length;n<r;++n){let r=this.b[n];zt.call(r,e,t)}return this._t=e,e}x(){let e=this.t();if(e)it.call(e,``);else for(let e=0,t=this.b.length;e<t;++e)Ht.call(this.b[e]);this.b=[]}u(){return!0}s(){return this.b.map(e=>e.s()).join(``)}t(){return this._t||=this.b[0].t(),this._t}},kt=Ot.prototype,At=kt.m,jt=kt.p,Mt=kt.x,Nt=new Proxy({},{get(e,t){return{$:t}}}),Pt=(e,t,n,r)=>{let i=e(Nt),a=[],o=ct(Ct(t?t(i):i,a),r);return ft(o),(e,t,r)=>new It(o,a,e,t??e?.key??null,r??n??null,null)},Ft=(e,t)=>{if((`b`in e||`b`in t)&&jt.call(e,t),e.l||zt.call(e,void 0,null,null),e.k&&e.k===t.k||e.r===t.r)return Bt.call(e,t);let n=zt.call(t,e.t(),e.l,null);return Ht.call(e),e.k=t.k,n},It=class extends St{constructor(e,t,n,r,i,a){super(),this.r=e,this.d=n,this.e=t,this.k=r,this.c=Array(t.length),i?this._u=i:this._u=null,a?this.g=a:this.g=null}m(e,t=null,n){if(this.l)return this.l;let r=n??Ze.call(this.r,!0),i=this.g?.(r);i&&(this.c=i);for(let e=0,t=this.e.length;e<t;++e){let t=this.e[e],a=i?.[e]??Lt(t.p,r,this.c,e);for(let e=0,r=t.e.length;e<r;++e){let i=t.e[e],o=this.d[i.h];if(i.t&Ae){if(o instanceof St){let e=ut(a,i.i);n?o.m(a,e,e):o.m(a,e);continue}if(a[V]||(a[V]=Array(r)),o&&typeof o==`object`&&`foreign`in o){if(n){let e=ut(a,i.i);o.reset(e)}let t=o.current;a[V][e]=t,n||Xe.call(a,t,ut(a,i.i));continue}if(n){a[V][e]=ut(a,i.i);continue}a[V][e]=pt(a,o==null||o===!1?``:String(o),i.i)}else if(i.t&Me){let e=lt(a,i.n,o);a[Ie+i.n]=e}else if(i.t&je)_t(a,i.n,o);else if(i.t&Ne)if(typeof o==`string`||typeof o==`number`)ht(a,i.n,o);else for(let e in o)ht(a,e,o[e]);else gt(a,i.n,o)}let o=t.i?.length;if(o)for(let e=0;e<o;++e){let r=t.i[e];if(r.t&Ae)r.v&&!n&&pt(a,r.v,r.i);else if(r.t&Me)lt(a,r.n,r.l);else{let e=ut(a,r.i);n?r.b.m(a,e,e):r.b.m(a,e)}}}return e&&!n&&Xe.call(e,r,t),this.l=r,r}p(e){let t=this.l;if(!e.d)return t;let n=this.d;if(!Ut.call(this,n,e.d))return t;this.d=e.d;for(let r=0,i=this.e.length;r<i;++r){let i=this.e[r],a=this.c[r]??Lt(i.p,t,this.c,r);for(let t=0,o=i.e.length;t<o;++t){let o=i.e[t],s=n[o.h],c=e.d[o.h];if(c!==s){if(o.t&Me){a[Ie+o.n](c);continue}if(o.t&Ae){if(s instanceof St){let n=e.e?.[r]?.e[t],i=e.d[n.h];s.p(i);continue}if(c&&typeof c==`object`&&`foreign`in c){let e=a[V][t];if(c.unstable&&s!==c){let n=c.current;a[V][t]=n,Qe.call(a,n,e)}else c.current=e;continue}mt(a[V][t],c==null||c===!1?``:String(c))}else if(o.t&je)_t(a,o.n,c);else if(o.t&Ne)if(typeof c==`string`||typeof c==`number`)ht(a,o.n,c);else for(let e in c)c[e]!==s[e]&&ht(a,e,c[e]);else gt(a,o.n,c)}}}return t}v(e=null,t=null){Xe.call(this.t(),this.l,e?e.l:t)}x(){$e.call(this.l),this.l=null}u(e,t){return this._u?this._u(e,t):!0}s(){return String(this.l?.outerHTML)}t(){return this._t||=this.l?.parentElement,this._t}},Lt=(e,t,n,r)=>{let i=e.length;if(!i)return t;let a=n&&r!==void 0;if(a&&n[r])return n[r];for(let n=0;n<i;++n){let r=e[n];t=ut(t,r)}return a&&(n[r]=t),t},Rt=It.prototype,zt=Rt.m,Bt=Rt.p,Vt=Rt.v,Ht=Rt.x,Ut=Rt.u,G=e(ne(),1),Wt={noSlot:!1},Gt=e(A(),1),Kt=`slot`,qt=({effect:e,deps:t})=>((0,G.useEffect)(e,t||[]),null),K=new Map,Jt=(0,G.createContext)(!1),Yt=(e,t,n)=>{let r={ref:t},i=0;for(let t in e){let a=e[t];if((0,G.isValidElement)(a)||Array.isArray(a)&&a.length&&(0,G.isValidElement)(a[0])){r[t]=Zt(a,!1,n,i++);continue}r[t]=e[t]}return r},Xt=(e,t)=>(0,G.createElement)(Kt,{suppressHydrationWarning:!0,id:t},e),Zt=(e,t,n,r,i)=>{let a=n?.[r]?.current,o=(0,G.isValidElement)(e)&&typeof e.type==`function`&&`_c`in e.type,s=o&&e.type._c;if(typeof window>`u`)return o?s?e:Xt(Xt(e),i):Xt(e,i);if(s){let t=e.type(e.props);if(K.has(t.type)){let e=K.get(t.type);if(typeof e==`function`)return e(t.props)}}let c=a??(i?document.getElementById(i):null)??document.createElement(`slot`),l={foreign:!0,current:c,portal:(0,Gt.createPortal)((0,G.createElement)(G.Fragment,{children:e}),c,i),reset:e=>{e.childNodes.forEach(t=>e.removeChild(t))},unstable:t};return n&&(n[r]=l),l},Qt=e=>{if(typeof e!=`object`||!e||!(`type`in e))return typeof e==`number`?String(e):e;let t=e.type;if(typeof t==`function`)return Qt(t(e.props??{}));if(typeof t==`object`&&`$`in t)return t;let n={...e.props};return`css`in n&&`__EMOTION_TYPE_PLEASE_DO_NOT_USE__`in n&&(n.style=n.css.styles,t=n.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,delete n.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,delete n.css),e.props?.children!=null&&(n.children=$t(e.props.children).map(e=>Qt(e))),{type:t,props:n}},$t=e=>{if(e==null)return[];if(typeof e==`object`&&`type`in e&&e.type===G.Fragment)return $t(e.props.children);if(!Array.isArray(e)||typeof e==`object`&&`$`in e)return[e];let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;++e)n.push(...$t(t[e]));return n},en=typeof window>`u`?G.useEffect:G.useLayoutEffect;function tn(e,t,n){if(!e||t(e))return e;let r=n?e.return:e.child;for(;r;){let e=tn(r,t,n);if(e)return e;r=n?null:r.sibling}}function nn(){let e=(0,G.useRef)();return(0,G.useState)(()=>{let t=Function.prototype.bind;Function.prototype.bind=function(n,r){return n===null&&typeof r?.type==`function`&&(e.current=r,Function.prototype.bind=t),t.apply(this,arguments)}}),e.current}function rn(e){let t=nn(),n=(0,G.useRef)({el:null,depth:0});return en(()=>{n.current.el=tn(t,t=>(n.current.depth++,typeof t.type==`string`&&(e===void 0||t.type===e)),!0)?.stateNode},[t]),n}function an(){let e=nn(),t=(0,G.useRef)({el:null,depth:0});return en(()=>{t.current.el=tn(e,e=>(t.current.depth++,e.stateNode?.containerInfo!=null),!0)?.stateNode.containerInfo},[e]),t}var on=(e,t={})=>{let n=t?.experimental_noSlot??Wt.noSlot,r=t?.block,i=t?.svg?`g`:Kt;e&&(r=Pt(e,Qt,t?.shouldUpdate,t?.svg));let a=(e,a)=>{let o=an(),s=rn(),c=e._hmr,l=(0,G.useRef)(null),u=(0,G.useRef)(null),d=(0,G.useRef)([]);e=Yt(e,a,d.current),u.current?.(e);let f=(0,G.useCallback)(()=>{if(!l.current&&!n)return;let i=r(e,e.key);return c&&l.current?.textContent&&(l.current.textContent=``),n&&(l.current=s.current?.el??o.current?.el,(e.scoped||s.current&&o.current&&s.current.depth>o.current.depth)&&(l.current=o.current.el),l.current.childNodes.length&&console.error(Error(`\`experimental_options.noSlot\` does not support having siblings at the moment.
|
|
2
|
-
The block element should be the only child of the \`${Ze.call(l.current).outerHTML}\` element.
|
|
3
|
-
To avoid this error, \`experimental_options.noSlot\` should be false`))),(u.current===null||c)&&(zt.call(i,l.current,null),u.current=e=>{Ft(i,r(e,e.key,t?.shouldUpdate))}),()=>{Ht.call(i)}},[]),p=(0,G.useMemo)(()=>n?null:(0,G.createElement)(t?.as??i,{ref:l}),[]),m=d.current.length,h=Array(m);for(let e=0;e<m;++e)h[e]=d.current[e]?.portal;return(0,G.createElement)(G.Fragment,{},p,(0,G.createElement)(qt,{effect:f,deps:c?[c]:[]}),h)};return De.call(K,a)||ke.call(K,a,on),t?.name&&(e&&(e.displayName=`Million(Render(${t.name}))`),a.displayName=`Million(Block(${t.name}))`),a};(0,G.memo)(({each:e,children:t,memo:n,svg:r,as:i,...a})=>{let o=(0,G.useRef)(null),[s]=(0,G.useState)(()=>({current:Array(e.length)})),c=(0,G.useRef)(null),l=(0,G.useRef)({each:null,children:null,mounted:!1}),[,u]=(0,G.useState)(!1);if(c.current&&(e!==l.current.each||!n)){let r=sn(e,t,l,s,n);jt.call(c.current,Dt(r))}let d=(0,G.createElement)(G.Fragment,null,(0,G.createElement)(i??(r?`g`:`slot`),{...a,ref:o}),...s.current.map(e=>e.portal));return(0,G.useEffect)(()=>{!o.current||c.current||l.current.mounted||(c.current=Dt(sn(e,t,l,s,n)),De.call(K,d)||ke.call(K,d,c.current),At.call(c.current,o.current),l.current.mounted=!0,u(!0))},[o.current]),d});var sn=(e,t,n,r,i)=>{let a=Array(e.length),o=n.current;for(let n=0,s=e.length;n<s;++n){if(i&&o.each&&o.each[n]===e[n]){a[n]=o.children?.[n];continue}let s=t(e[n],n);if(De.call(K,s.type)){o.block||=Oe.call(K,s.type),a[n]=o.block(s.props,r,n);continue}if(typeof s.type==`function`&&`_c`in s.type){let e=s.type(s.props);if(De.call(K,e.type)){let t=Oe.call(K,e.type);if(typeof t==`function`){a[n]=t(e.props);continue}}}let c=Pt(e=>e?.scope),l=(e,t,n)=>c({scope:Zt((0,G.createElement)(s.type,e),!1,t.current,n)},s.key?String(s.key):void 0);ke.call(K,s.type,l),o.block=l,a[n]=l(s.props,r,n)}return o.each=e,o.children=a,a};function cn(e,t){return e===t||e!==e&&t!==t}function ln(e,t){for(let n in e)if(!cn(e[n],t[n]))return!0;return!1}function un(e,{portals:t,...n}){let r=`CompiledBlock(Inner(${n.name}))`,i=on(t=>e(t),{...n,scoped:void 0,name:r,shouldUpdate:ln}),a=t?.length||0,o=t&&a>0?e=>{let n=(0,G.useContext)(Jt),[r]=(0,G.useState)(()=>[]),o={...e,scoped:n};for(let e=0;e<a;e++){let n=t[e];o[n]=Zt(o[n],!1,r,e)}let s=[];for(let e=0,t=r.length;e<t;e++)s[e]=r[e].portal;return(0,G.createElement)(G.Fragment,null,(0,G.createElement)(i,o),s)}:e=>(0,G.createElement)(i,e);return n.name&&(o.displayName=`Million(CompiledBlock(Outer(${n.name})))`),o}typeof window<`u`&&(window.__MILLION_DATA__={version:`3.1.11`});var q=ae(),dn=`AlertDialog`,[fn,pn]=h(dn,[he]),J=he(),mn=e=>{let{__scopeAlertDialog:t,...n}=e,r=J(t);return(0,q.jsx)(ie,{...r,...n,modal:!0})};mn.displayName=dn;var hn=`AlertDialogTrigger`,gn=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(k,{...i,...r,ref:t})});gn.displayName=hn;var _n=`AlertDialogPortal`,vn=e=>{let{__scopeAlertDialog:t,...n}=e,r=J(t);return(0,q.jsx)(E,{...r,...n})};vn.displayName=_n;var yn=`AlertDialogOverlay`,bn=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(ee,{...i,...r,ref:t})});bn.displayName=yn;var xn=`AlertDialogContent`,[Sn,Cn]=fn(xn),wn=ve(`AlertDialogContent`),Tn=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=J(n),o=G.useRef(null),s=N(t,o),c=G.useRef(null);return(0,q.jsx)(R,{contentName:xn,titleName:En,docsSlug:`alert-dialog`,children:(0,q.jsx)(Sn,{scope:n,cancelRef:c,children:(0,q.jsxs)(re,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:I(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,q.jsx)(wn,{children:r}),(0,q.jsx)(Pn,{contentRef:o})]})})})});Tn.displayName=xn;var En=`AlertDialogTitle`,Dn=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(de,{...i,...r,ref:t})});Dn.displayName=En;var On=`AlertDialogDescription`,kn=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(le,{...i,...r,ref:t})});kn.displayName=On;var An=`AlertDialogAction`,jn=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(pe,{...i,...r,ref:t})});jn.displayName=An;var Mn=`AlertDialogCancel`,Nn=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Cn(Mn,n),a=J(n),o=N(t,i);return(0,q.jsx)(pe,{...a,...r,ref:o})});Nn.displayName=Mn;var Pn=({contentRef:e})=>{let t=`\`${xn}\` requires a description for the component to be accessible for screen reader users.
|
|
4
|
-
|
|
5
|
-
You can add a description to the \`${xn}\` by passing a \`${On}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
6
|
-
|
|
7
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${xn}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
8
|
-
|
|
9
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return G.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},Fn=mn,In=vn,Ln=bn,Rn=Tn,zn=jn,Bn=Nn,Vn=Dn,Hn=kn,Un=Fn,Wn=In,Gn=G.forwardRef((e,t)=>{let n=(0,B.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=p(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Ln,{className:a,...i,ref:t}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Gn.displayName=Ln.displayName;var Kn=G.forwardRef((e,t)=>{let n=(0,B.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]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,q.jsx)(Gn,{}),n[3]=a):a=n[3];let o;n[4]===r?o=n[5]:(o=p(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==t||n[8]!==o?(s=(0,q.jsxs)(Wn,{children:[a,(0,q.jsx)(Rn,{ref:t,className:o,...i})]}),n[6]=i,n[7]=t,n[8]=o,n[9]=s):s=n[9],s});Kn.displayName=Rn.displayName;var qn=e=>{let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=p(`flex flex-col space-y-2 text-center sm:text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,q.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};qn.displayName=`AlertDialogHeader`;var Jn=e=>{let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=p(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,q.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};Jn.displayName=`AlertDialogFooter`;var Yn=G.forwardRef((e,t)=>{let n=(0,B.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=p(b.dialogTitle,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Vn,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Yn.displayName=Vn.displayName;var Xn=G.forwardRef((e,t)=>{let n=(0,B.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=p(b.dialogDescription,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Hn,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Xn.displayName=Hn.displayName;var Zn=G.forwardRef((e,t)=>{let n=(0,B.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=p(te(),r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(zn,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Zn.displayName=zn.displayName;var Qn=G.forwardRef((e,t)=>{let n=(0,B.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=p(te({variant:`outline`}),`mt-2 sm:mt-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Bn,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Qn.displayName=Bn.displayName;var $n=un(e=>(0,q.jsxs)(`div`,{className:e.v0,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{className:e.v1,children:e.v2}),e.v3]}),e.v4]}),{name:`PageHeader_1`,portals:[`v2`,`v3`,`v4`]}),er=function(e){let t=(0,B.c)(12),{title:n,description:r,action:i,className:a,titleClassName:o}=e,s;t[0]===a?s=t[1]:(s=p(`flex items-center justify-between mb-6`,a),t[0]=a,t[1]=s);let c;t[2]===o?c=t[3]:(c=p(b.pageTitle,o),t[2]=o,t[3]=c);let l;t[4]===r?l=t[5]:(l=r?(0,q.jsx)(`p`,{className:b.pageSubtitle,children:r}):null,t[4]=r,t[5]=l);let u;return t[6]!==i||t[7]!==s||t[8]!==c||t[9]!==l||t[10]!==n?(u=(0,q.jsx)($n,{v0:s,v1:c,v2:n,v3:l,v4:i}),t[6]=i,t[7]=s,t[8]=c,t[9]=l,t[10]=n,t[11]=u):u=t[11],u};function tr(e){let t=(0,B.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=p(S.settingsPage,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function nr(e){let t=(0,B.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=p(S.accountPage,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function rr(e){let t=(0,B.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=p(S.formPage,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function ir(e){let t=(0,B.c)(5),{title:n,className:r}=e,i;t[0]===r?i=t[1]:(i=p(b.sectionTitle,`mb-3`,r),t[0]=r,t[1]=i);let a;return t[2]!==i||t[3]!==n?(a=(0,q.jsx)(`h2`,{className:i,children:n}),t[2]=i,t[3]=n,t[4]=a):a=t[4],a}function ar(e){let t=(0,B.c)(6),{children:n,variant:r,className:i}=e,a=r===void 0?`info`:r,o;t[0]!==i||t[1]!==a?(o=p(a===`hint`?b.hintBanner:a===`success`?p(b.body,`text-green-700 bg-green-50 dark:text-green-400 dark:bg-green-950/30 rounded-md px-3 py-2 mb-4`):a===`error`?p(b.error,`bg-destructive/10 rounded-md px-3 py-2 mb-4`):b.infoBanner,i),t[0]=i,t[1]=a,t[2]=o):o=t[2];let s;return t[3]!==n||t[4]!==o?(s=(0,q.jsx)(`div`,{className:o,children:n}),t[3]=n,t[4]=o,t[5]=s):s=t[5],s}function or(e){let t=(0,B.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=p(`flex-1 overflow-auto`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function sr(e){let t=(0,B.c)(10),{children:n,title:r,action:i}=e,a;t[0]===r?a=t[1]:(a=r?(0,q.jsx)(`h2`,{className:p(b.emptyStateTitle,`mb-2`),children:r}):null,t[0]=r,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,q.jsx)(`p`,{className:b.bodyMuted,children:n}),t[2]=n,t[3]=o);let s;t[4]===i?s=t[5]:(s=i?(0,q.jsx)(`div`,{className:`mt-4`,children:i}):null,t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,q.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,q.jsxs)(`div`,{className:`text-center`,children:[a,o,s]})}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function cr(e){let t=(0,B.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=p(`h-full flex flex-col overflow-hidden`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function lr(e){let t=(0,B.c)(14),{title:n,description:r,action:i,children:a,className:o}=e,s;t[0]===n?s=t[1]:(s=(0,q.jsx)(ir,{title:n,className:`mb-1`}),t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c=r?(0,q.jsx)(`p`,{className:b.bodyMuted,children:r}):null,t[2]=r,t[3]=c);let l;t[4]!==s||t[5]!==c?(l=(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[s,c]}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]!==i||t[8]!==l?(u=(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4 mb-3`,children:[l,i]}),t[7]=i,t[8]=l,t[9]=u):u=t[9];let d;return t[10]!==a||t[11]!==o||t[12]!==u?(d=(0,q.jsxs)(`div`,{className:o,children:[u,a]}),t[10]=a,t[11]=o,t[12]=u,t[13]=d):d=t[13],d}function ur(e){let t=G.useRef({value:e,previous:e});return G.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var dr=[` `,`Enter`,`ArrowUp`,`ArrowDown`],fr=[` `,`Enter`],pr=`Select`,[mr,hr,gr]=ue(pr),[_r,vr]=h(pr,[gr,v]),yr=v(),[br,Y]=_r(pr),[xr,Sr]=_r(pr),Cr=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:m,required:h,form:g}=e,v=yr(t),[y,b]=G.useState(null),[x,S]=G.useState(null),[C,w]=G.useState(!1),T=me(d),[E,D]=_({prop:r,defaultProp:i??!1,onChange:a,caller:pr}),[O,k]=_({prop:o,defaultProp:c,onChange:u,caller:pr}),A=G.useRef(null),j=y?g||!!y.closest(`form`):!0,[M,N]=G.useState(new Set),P=Array.from(M).map(e=>e.props.value).join(`;`);return(0,q.jsx)(l,{...v,children:(0,q.jsxs)(br,{required:h,scope:t,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:s(),value:O,onValueChange:k,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:A,disabled:m,children:[(0,q.jsx)(mr.Provider,{scope:t,children:(0,q.jsx)(xr,{scope:e.__scopeSelect,onNativeOptionAdd:G.useCallback(e=>{N(t=>new Set(t).add(e))},[]),onNativeOptionRemove:G.useCallback(e=>{N(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),j?(0,q.jsxs)(gi,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:O,onChange:e=>k(e.target.value),disabled:m,form:g,children:[O===void 0?(0,q.jsx)(`option`,{value:``}):null,Array.from(M)]},P):null]})})};Cr.displayName=pr;var wr=`SelectTrigger`,Tr=G.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=yr(n),o=Y(wr,n),s=o.disabled||r,c=N(t,o.onTriggerChange),l=hr(n),u=G.useRef(`touch`),[d,f,p]=vi(e=>{let t=l().filter(e=>!e.disabled),n=yi(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,q.jsx)(xe,{asChild:!0,...a,children:(0,q.jsx)(z.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:s,"data-disabled":s?``:void 0,"data-placeholder":_i(o.value)?``:void 0,...i,ref:c,onClick:I(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:I(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:I(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&dr.includes(e.key)&&(m(),e.preventDefault())})})})});Tr.displayName=wr;var Er=`SelectValue`,Dr=G.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:o,placeholder:s=``,...c}=e,l=Y(Er,n),{onValueNodeHasChildrenChange:u}=l,d=o!==void 0,f=N(t,l.onValueNodeChange);return a(()=>{u(d)},[u,d]),(0,q.jsx)(z.span,{...c,ref:f,style:{pointerEvents:`none`},children:_i(l.value)?(0,q.jsx)(q.Fragment,{children:s}):o})});Dr.displayName=Er;var Or=`SelectIcon`,kr=G.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,q.jsx)(z.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});kr.displayName=Or;var Ar=`SelectPortal`,jr=e=>(0,q.jsx)(F,{asChild:!0,...e});jr.displayName=Ar;var Mr=`SelectContent`,Nr=G.forwardRef((e,t)=>{let n=Y(Mr,e.__scopeSelect),[r,i]=G.useState();if(a(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?Gt.createPortal((0,q.jsx)(Pr,{scope:e.__scopeSelect,children:(0,q.jsx)(mr.Slot,{scope:e.__scopeSelect,children:(0,q.jsx)(`div`,{children:e.children})})}),t):null}return(0,q.jsx)(Lr,{...e,ref:t})});Nr.displayName=Mr;var X=10,[Pr,Z]=_r(Mr),Fr=`SelectContentImpl`,Ir=i(`SelectContent.RemoveScroll`),Lr=G.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=Y(Mr,n),[y,b]=G.useState(null),[x,S]=G.useState(null),C=N(t,e=>b(e)),[w,T]=G.useState(null),[E,D]=G.useState(null),O=hr(n),[k,A]=G.useState(!1),F=G.useRef(!1);G.useEffect(()=>{if(y)return j(y)},[y]),se();let ee=G.useCallback(e=>{let[t,...n]=O().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&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),te=G.useCallback(()=>ee([w,y]),[ee,w,y]);G.useEffect(()=>{k&&te()},[k,te]);let{onOpenChange:L,triggerPointerDownPosRef:R}=v;G.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(R.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(R.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||L(!1),document.removeEventListener(`pointermove`,t),R.current=null};return R.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,L,R]),G.useEffect(()=>{let e=()=>L(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[L]);let[ne,re]=vi(e=>{let t=O().filter(e=>!e.disabled),n=yi(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ie=G.useCallback((e,t,n)=>{let r=!F.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(F.current=!0))},[v.value]),ae=G.useCallback(()=>y?.focus(),[y]),oe=G.useCallback((e,t,n)=>{let r=!F.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),ce=r===`popper`?Vr:zr,le=ce===Vr?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,q.jsx)(Pr,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ie,selectedItem:w,onItemLeave:ae,itemTextRefCallback:oe,focusSelectedItem:te,selectedItemText:E,position:r,isPositioned:k,searchRef:ne,children:(0,q.jsx)(M,{as:Ir,allowPinchZoom:!0,children:(0,q.jsx)(P,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:I(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,q.jsx)(_e,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,q.jsx)(ce,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...le,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:I(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&re(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().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(()=>ee(t)),e.preventDefault()}})})})})})})});Lr.displayName=Fr;var Rr=`SelectItemAlignedPosition`,zr=G.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,o=Y(Mr,n),s=Z(Mr,n),[c,l]=G.useState(null),[u,d]=G.useState(null),f=N(t,e=>d(e)),p=hr(n),m=G.useRef(!1),h=G.useRef(!0),{viewport:g,selectedItem:_,selectedItemText:v,focusSelectedItem:y}=s,b=G.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&u&&g&&_&&v){let e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(o.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-X,d=L(a,[X,Math.max(X,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-X,d=L(a,[X,Math.max(X,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=p(),s=window.innerHeight-X*2,l=g.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+h+l+b+y,S=Math.min(_.offsetHeight*5,x),C=window.getComputedStyle(g),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-X,D=s-E,O=_.offsetHeight/2,k=_.offsetTop+O,A=f+h+k,j=x-A;if(A<=E){let e=a.length>0&&_===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=u.clientHeight-g.offsetTop-g.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);c.style.height=n+`px`}else{let e=a.length>0&&_===a[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+g.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,g.scrollTop=A-E+g.offsetTop}c.style.margin=`${X}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,c,u,g,_,v,o.dir,r]);a(()=>b(),[b]);let[x,S]=G.useState();return a(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]),(0,q.jsx)(Hr,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:G.useCallback(e=>{e&&h.current===!0&&(b(),y?.(),h.current=!1)},[b,y]),children:(0,q.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,q.jsx)(z.div,{...i,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});zr.displayName=Rr;var Br=`SelectPopperPosition`,Vr=G.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=X,...a}=e,o=yr(n);return(0,q.jsx)(y,{...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)`}})});Vr.displayName=Br;var[Hr,Ur]=_r(Mr,{}),Wr=`SelectViewport`,Gr=G.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Z(Wr,n),o=Ur(Wr,n),s=N(t,a.onViewportChange),c=G.useRef(0);return(0,q.jsxs)(q.Fragment,{children:[(0,q.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,q.jsx)(mr.Slot,{scope:n,children:(0,q.jsx)(z.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:I(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-X*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`)}}}c.current=t.scrollTop})})})]})});Gr.displayName=Wr;var Kr=`SelectGroup`,[qr,Jr]=_r(Kr),Yr=G.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=s();return(0,q.jsx)(qr,{scope:n,id:i,children:(0,q.jsx)(z.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Yr.displayName=Kr;var Xr=`SelectLabel`,Zr=G.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Jr(Xr,n);return(0,q.jsx)(z.div,{id:i.id,...r,ref:t})});Zr.displayName=Xr;var Qr=`SelectItem`,[$r,ei]=_r(Qr),ti=G.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,c=Y(Qr,n),l=Z(Qr,n),u=c.value===r,[d,f]=G.useState(a??``),[p,m]=G.useState(!1),h=N(t,e=>l.itemRefCallback?.(e,r,i)),g=s(),_=G.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,q.jsx)($r,{scope:n,value:r,disabled:i,textId:g,isSelected:u,onItemTextChange:G.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:(0,q.jsx)(mr.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:(0,q.jsx)(z.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:I(o.onFocus,()=>m(!0)),onBlur:I(o.onBlur,()=>m(!1)),onClick:I(o.onClick,()=>{_.current!==`mouse`&&v()}),onPointerUp:I(o.onPointerUp,()=>{_.current===`mouse`&&v()}),onPointerDown:I(o.onPointerDown,e=>{_.current=e.pointerType}),onPointerMove:I(o.onPointerMove,e=>{_.current=e.pointerType,i?l.onItemLeave?.():_.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:I(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:I(o.onKeyDown,e=>{l.searchRef?.current!==``&&e.key===` `||(fr.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})});ti.displayName=Qr;var ni=`SelectItemText`,ri=G.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...o}=e,s=Y(ni,n),c=Z(ni,n),l=ei(ni,n),u=Sr(ni,n),[d,f]=G.useState(null),p=N(t,e=>f(e),l.onItemTextChange,e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),m=d?.textContent,h=G.useMemo(()=>(0,q.jsx)(`option`,{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=u;return a(()=>(g(h),()=>_(h)),[g,_,h]),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z.span,{id:l.textId,...o,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Gt.createPortal(o.children,s.valueNode):null]})});ri.displayName=ni;var ii=`SelectItemIndicator`,ai=G.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return ei(ii,n).isSelected?(0,q.jsx)(z.span,{"aria-hidden":!0,...r,ref:t}):null});ai.displayName=ii;var oi=`SelectScrollUpButton`,si=G.forwardRef((e,t)=>{let n=Z(oi,e.__scopeSelect),r=Ur(oi,e.__scopeSelect),[i,o]=G.useState(!1),s=N(t,r.onScrollButtonChange);return a(()=>{if(n.viewport&&n.isPositioned){let e=function(){o(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,q.jsx)(ui,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});si.displayName=oi;var ci=`SelectScrollDownButton`,li=G.forwardRef((e,t)=>{let n=Z(ci,e.__scopeSelect),r=Ur(ci,e.__scopeSelect),[i,o]=G.useState(!1),s=N(t,r.onScrollButtonChange);return a(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;o(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,q.jsx)(ui,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});li.displayName=ci;var ui=G.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Z(`SelectScrollButton`,n),s=G.useRef(null),c=hr(n),l=G.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return G.useEffect(()=>()=>l(),[l]),a(()=>{c().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[c]),(0,q.jsx)(z.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:I(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:I(i.onPointerMove,()=>{o.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:I(i.onPointerLeave,()=>{l()})})}),di=`SelectSeparator`,fi=G.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,q.jsx)(z.div,{"aria-hidden":!0,...r,ref:t})});fi.displayName=di;var pi=`SelectArrow`,mi=G.forwardRef((e,t)=>{let{__scopeSelect:n,...i}=e,a=yr(n),o=Y(pi,n),s=Z(pi,n);return o.open&&s.position===`popper`?(0,q.jsx)(r,{...a,...i,ref:t}):null});mi.displayName=pi;var hi=`SelectBubbleInput`,gi=G.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=G.useRef(null),a=N(r,i),o=ur(t);return G.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,q.jsx)(z.select,{...n,style:{...f,...n.style},ref:a,defaultValue:t})});gi.displayName=hi;function _i(e){return e===``||e===void 0}function vi(e){let t=D(e),n=G.useRef(``),r=G.useRef(0),i=G.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]),a=G.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return G.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function yi(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=bi(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 bi(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xi=Cr,Si=Tr,Ci=Dr,wi=kr,Ti=jr,Ei=Nr,Di=Gr,Oi=Zr,ki=ti,Ai=ri,ji=ai,Mi=si,Ni=li,Pi=fi,Fi=xi,Ii=Ci,Li=G.forwardRef((e,t)=>{let n=(0,B.c)(12),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=p(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-base 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`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsx)(wi,{asChild:!0,children:(0,q.jsx)(x,{className:`h-4 w-4 opacity-50`})}),n[6]=s):s=n[6];let c;return n[7]!==r||n[8]!==a||n[9]!==t||n[10]!==o?(c=(0,q.jsxs)(Si,{ref:t,className:o,...a,children:[r,s]}),n[7]=r,n[8]=a,n[9]=t,n[10]=o,n[11]=c):c=n[11],c});Li.displayName=Si.displayName;var Ri=G.forwardRef((e,t)=>{let n=(0,B.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=p(`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,q.jsx)(ce,{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,q.jsx)(Mi,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});Ri.displayName=Mi.displayName;var zi=G.forwardRef((e,t)=>{let n=(0,B.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=p(`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,q.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,q.jsx)(Ni,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});zi.displayName=Ni.displayName;var Bi=G.forwardRef((e,t)=>{let n=(0,B.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=p(`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,q.jsx)(Ri,{}),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=p(`p-1`,d),n[9]=d,n[10]=f);let m;n[11]!==r||n[12]!==f?(m=(0,q.jsx)(Di,{className:f,children:r}),n[11]=r,n[12]=f,n[13]=m):m=n[13];let h;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,q.jsx)(zi,{}),n[14]=h):h=n[14];let g;return n[15]!==s||n[16]!==a||n[17]!==t||n[18]!==l||n[19]!==m?(g=(0,q.jsx)(Ti,{children:(0,q.jsxs)(Ei,{ref:t,className:l,position:s,...a,children:[u,m,h]})}),n[15]=s,n[16]=a,n[17]=t,n[18]=l,n[19]=m,n[20]=g):g=n[20],g});Bi.displayName=Ei.displayName;var Vi=G.forwardRef((e,t)=>{let n=(0,B.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=p(`py-1.5 pl-8 pr-2 text-base font-semibold`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Oi,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Vi.displayName=Oi.displayName;var Hi=G.forwardRef((e,t)=>{let n=(0,B.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=p(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-base 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,q.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,q.jsx)(ji,{children:(0,q.jsx)(w,{className:`h-4 w-4`})})}),n[6]=s):s=n[6];let c;n[7]===r?c=n[8]:(c=(0,q.jsx)(Ai,{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,q.jsxs)(ki,{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});Hi.displayName=ki.displayName;var Ui=G.forwardRef((e,t)=>{let n=(0,B.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=p(`-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,q.jsx)(Pi,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ui.displayName=Pi.displayName;function Wi(e){let t=(0,B.c)(14),{className:n,label:r,size:i}=e,a=i===void 0?`md`:i,o=a===`sm`?`h-4 w-4`:a===`lg`?`h-8 w-8`:`h-6 w-6`,s;t[0]===n?s=t[1]:(s=p(`flex h-full items-center justify-center`,n),t[0]=n,t[1]=s);let c;t[2]===o?c=t[3]:(c=p(o,`animate-spin mx-auto text-muted-foreground`),t[2]=o,t[3]=c);let l;t[4]===c?l=t[5]:(l=(0,q.jsx)(ge,{className:c}),t[4]=c,t[5]=l);let u;t[6]===r?u=t[7]:(u=r?(0,q.jsx)(`p`,{className:p(b.bodyMuted,`mt-2`),children:r}):null,t[6]=r,t[7]=u);let d;t[8]!==l||t[9]!==u?(d=(0,q.jsxs)(`div`,{className:`text-center`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f;return t[11]!==s||t[12]!==d?(f=(0,q.jsx)(`div`,{className:s,children:d}),t[11]=s,t[12]=d,t[13]=f):f=t[13],f}function Gi(){let e=(0,B.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,q.jsx)(`div`,{className:`space-y-1 px-2 py-2`,children:[1,2,3].map(Ki)}),e[0]=t):t=e[0],t}function Ki(e){return(0,q.jsx)(`div`,{className:`animate-pulse h-7 bg-muted rounded-full`},e)}function qi(){let e=(0,B.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,q.jsx)(`div`,{className:`animate-pulse h-4 bg-muted rounded mx-4 my-1`}),e[0]=t):t=e[0],t}var Ji=new Map;function Yi(e,t){let n=Ji.get(e);return n||(n={promise:t().catch(t=>{throw Ji.delete(e),t})},Ji.set(e,n)),n.promise}function Xi(e){Ji.delete(e)}function Zi(e){for(let t of Ji.keys())t.startsWith(e)&&Ji.delete(t)}function Qi(e,t){return(0,G.use)(Yi(e,t))}var $i=G.forwardRef((e,t)=>{let n=(0,B.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=p(`w-full caption-bottom`,b.body,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{className:`relative w-full overflow-auto`,children:(0,q.jsx)(`table`,{ref:t,className:a,...i})}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});$i.displayName=`Table`;var ea=G.forwardRef((e,t)=>{let n=(0,B.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=p(`[&_tr]:border-b`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`thead`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ea.displayName=`TableHeader`;var ta=G.forwardRef((e,t)=>{let n=(0,B.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=p(`[&_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,q.jsx)(`tbody`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ta.displayName=`TableBody`;var na=G.forwardRef((e,t)=>{let n=(0,B.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=p(`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,q.jsx)(`tfoot`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});na.displayName=`TableFooter`;var ra=G.forwardRef((e,t)=>{let n=(0,B.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=p(`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,q.jsx)(`tr`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ra.displayName=`TableRow`;var Q=G.forwardRef((e,t)=>{let n=(0,B.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=p(`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,q.jsx)(`th`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Q.displayName=`TableHead`;var $=G.forwardRef((e,t)=>{let n=(0,B.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=p(`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,q.jsx)(`td`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});$.displayName=`TableCell`;var ia=G.forwardRef((e,t)=>{let n=(0,B.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=p(b.caption,`mt-4`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`caption`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ia.displayName=`TableCaption`;var aa=G.forwardRef((e,t)=>{let n=(0,B.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=p(`rounded-lg border bg-card text-card-foreground shadow-sm`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});aa.displayName=`Card`;var oa=G.forwardRef((e,t)=>{let n=(0,B.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=p(`flex flex-col space-y-1.5 p-6`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});oa.displayName=`CardHeader`;var sa=G.forwardRef((e,t)=>{let n=(0,B.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=p(b.sectionTitle,`leading-none tracking-tight`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});sa.displayName=`CardTitle`;var ca=G.forwardRef((e,t)=>{let n=(0,B.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=p(b.bodyMuted,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ca.displayName=`CardDescription`;var la=G.forwardRef((e,t)=>{let n=(0,B.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=p(`p-6 pt-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});la.displayName=`CardContent`;var ua=G.forwardRef((e,t)=>{let n=(0,B.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=p(`flex items-center p-6 pt-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ua.displayName=`CardFooter`;var da=class extends G.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`AsyncErrorBoundary caught an error:`,e,t)}handleRetry=()=>{this.setState({error:null}),this.props.onRetry?.()};render(){let{error:e}=this.state;return e?this.props.renderFallback?this.props.renderFallback(e,this.handleRetry):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,q.jsxs)(aa,{className:`max-w-md`,children:[(0,q.jsx)(oa,{children:(0,q.jsx)(sa,{className:`text-destructive`,children:this.props.fallbackTitle??`Something went wrong`})}),(0,q.jsxs)(la,{className:`space-y-4`,children:[(0,q.jsx)(`p`,{className:b.body,children:e.message}),(0,q.jsx)(n,{variant:`outline`,onClick:this.handleRetry,children:`Retry`})]})]})}):this.props.children}},fa=t({ConversationHistoryView:()=>Sa,default:()=>Sa}),pa=un(e=>(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,q.jsxs)(`div`,{className:`max-w-md text-center space-y-2`,children:[(0,q.jsx)(`h3`,{className:e.v0,children:`No history`}),(0,q.jsx)(`p`,{className:e.v1,children:`No conversation history found for this thread.`})]})}),{name:`ConversationHistoryContent_1`}),ma=un(e=>(0,q.jsxs)(`slot`,{children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between border-b py-3 px-0`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.v0,e.v1]}),(0,q.jsxs)(`div`,{className:e.v2,children:[e.v3,` of `,e.v4,` messages`]})]}),e.v5]}),{name:`ConversationHistoryContent_2`,portals:[`v0`,`v1`,`v3`,`v4`,`v5`]}),ha=function(e){let t=(0,B.c)(39),{scope:r,projects:i,loadVersion:a,currentPromptIndex:o,onPromptIndexChange:s}=e,l;t[0]!==a||t[1]!==r?(l=ba(r,a),t[0]=a,t[1]=r,t[2]=l):l=t[2];let f;t[3]!==i||t[4]!==r?(f=()=>xa(r,i),t[3]=i,t[4]=r,t[5]=f):f=t[5];let h=Qi(l,f),_;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(_=function(e){return new Date(e).toLocaleString()},t[6]=_):_=t[6];let v=_,y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=function(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}},t[7]=y):y=t[7];let x=y,S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(e){return{inputTokens:e.inputTokens??0,outputTokens:e.outputTokens??0}},t[8]=S):S=t[8];let w=S,T;t[9]!==o||t[10]!==h.messages||t[11]!==s?(T=function(){h.messages&&o<h.messages.length-1&&s(o+1)},t[9]=o,t[10]=h.messages,t[11]=s,t[12]=T):T=t[12];let E=T,D;t[13]!==o||t[14]!==s?(D=function(){o>0&&s(o-1)},t[13]=o,t[14]=s,t[15]=D):D=t[15];let k=D;if(!h.messages?.length){let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(pa,{v0:b.emptyStateTitle,v1:b.bodyMuted}),t[16]=e):e=t[16],e}let A=o===0,j;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,q.jsx)(C,{className:`h-4 w-4 mr-1`}),t[17]=j):j=t[17];let M;t[18]!==k||t[19]!==A?(M=(0,q.jsx)(n,{variant:`outline`,size:`sm`,onClick:k,disabled:A,children:j}),t[18]=k,t[19]=A,t[20]=M):M=t[20];let N=o>=h.messages.length-1,P;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,q.jsx)(d,{className:`h-4 w-4 ml-1`}),t[21]=P):P=t[21];let F;t[22]!==E||t[23]!==N?(F=(0,q.jsx)(n,{variant:`outline`,size:`sm`,onClick:E,disabled:N,children:P}),t[22]=E,t[23]=N,t[24]=F):F=t[24];let ee=o+1,te=h.messages.length,I;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,q.jsx)(ea,{children:(0,q.jsxs)(ra,{children:[(0,q.jsx)(Q,{children:`Prompt`}),(0,q.jsx)(Q,{children:`Answer`}),(0,q.jsx)(Q,{className:`w-24`,children:`Model`}),(0,q.jsx)(Q,{className:`w-24 text-right`,children:`Duration`}),(0,q.jsx)(Q,{className:`w-20 text-right`,children:`Input Tokens`}),(0,q.jsx)(Q,{className:`w-20 text-right`,children:`Output Tokens`}),(0,q.jsx)(Q,{className:`w-32 text-right`,children:`Timestamp`})]})}),t[25]=I):I=t[25];let L;if(t[26]!==o||t[27]!==h.messages){let e;t[29]===o?e=t[30]:(e=(e,t)=>{let{inputTokens:n,outputTokens:r}=w(e);return(0,q.jsxs)(ra,{className:t===o?`bg-muted/50`:``,children:[(0,q.jsx)($,{className:`max-w-md`,children:(0,q.jsx)(`div`,{className:b.body,children:(0,q.jsx)(_a,{text:e.request.message})})}),(0,q.jsx)($,{className:`max-w-md`,children:e.response?(0,q.jsx)(`div`,{className:b.body,children:(0,q.jsx)(_a,{text:e.response.content})}):(0,q.jsx)(`span`,{className:p(b.bodyMuted,`italic`),children:`No response`})}),(0,q.jsx)($,{children:(0,q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(be,{className:`h-3 w-3 text-muted-foreground`}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:e.request.model})]})}),(0,q.jsx)($,{className:p(b.caption,`text-right`),children:e.response?(0,q.jsx)(c,{children:(0,q.jsxs)(m,{children:[(0,q.jsx)(u,{asChild:!0,children:(0,q.jsx)(`div`,{className:`cursor-help`,children:x(e.timestamp,e.response.completedAt).display})}),(0,q.jsx)(g,{children:(0,q.jsx)(`p`,{children:x(e.timestamp,e.response.completedAt).tooltip})})]})}):(0,q.jsx)(`span`,{className:`text-muted-foreground italic`,children:`-`})}),(0,q.jsx)($,{className:p(b.bodyMuted,`text-right`),children:n>0?n.toLocaleString():`-`}),(0,q.jsx)($,{className:p(b.bodyMuted,`text-right`),children:r>0?r.toLocaleString():`-`}),(0,q.jsx)($,{className:p(b.bodyMuted,`text-right`),children:v(e.timestamp)})]},e.id)},t[29]=o,t[30]=e),L=h.messages.map(e),t[26]=o,t[27]=h.messages,t[28]=L}else L=t[28];let R;t[31]===L?R=t[32]:(R=(0,q.jsx)(O,{className:`h-full`,children:(0,q.jsx)(`div`,{className:`py-4`,children:(0,q.jsxs)($i,{children:[I,(0,q.jsx)(ta,{children:L})]})})}),t[31]=L,t[32]=R);let ne;return t[33]!==h.messages.length||t[34]!==M||t[35]!==F||t[36]!==ee||t[37]!==R?(ne=(0,q.jsx)(ma,{v0:M,v1:F,v2:b.bodyMuted,v3:ee,v4:te,v5:R}),t[33]=h.messages.length,t[34]=M,t[35]=F,t[36]=ee,t[37]=R,t[38]=ne):ne=t[38],ne},ga=`__ALL_PROJECTS__`;function _a(e){let t=(0,B.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,q.jsx)(q.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,q.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,q.jsxs)(q.Fragment,{children:[a,o]}),t[6]=a,t[7]=s),s}function va(e,t){let n=`${t} - `,r=e.title??e.threadId;return r.startsWith(n)?r.slice(n.length):r}async function ya(e){let t=[],n=new Set,r=``;for(let i of e)try{let e=await oe(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 ba(e,t){return e.type===`thread`?`conversation-history:thread:${e.threadId}:${t}`:e.type===`project`?`conversation-history:project:${e.projectId}:${t}`:`conversation-history:all:${t}`}async function xa(e,t){if(e.type===`thread`)return await oe(e.threadId);if(e.type===`project`){let n=t.find(t=>t.projectId===e.projectId);if(!n||n.threads.length===0)return{threadId:e.projectId,messages:[],lastUpdated:new Date().toISOString(),conversationIds:[]};let r=await ya(n.threads);return{threadId:e.projectId,...r}}return{threadId:ga,...await ya(t.flatMap(e=>e.threads))}}var Sa=(0,G.memo)(function({isOpen:e,onClose:t,initialFilter:r,projects:i,inline:a}){let[s,c]=(0,G.useState)(0),[l,u]=(0,G.useState)(``),[d,f]=(0,G.useState)(``),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(0),[y,x]=(0,G.useState)(null),[S,C]=(0,G.useState)(null),w=(0,G.useMemo)(()=>d?{type:`thread`,threadId:d}:l===ga?{type:`all`}:l?{type:`project`,projectId:l}:null,[l,d]),E=w?ba(w,_):null;(0,G.useEffect)(()=>{e&&r?r.type===`thread`?(f(r.id),u(``),c(0)):r.type===`project`&&(u(r.id),f(``),c(0)):e&&!r?(u(ga),f(``),c(0)):e||(f(``),u(``),c(0),C(null),x(null))},[e,r]);let D=e=>{f(e),u(``),c(0),x(null),C(null)},O=e=>{u(e),f(``),c(0),x(null),C(null)},k=(0,G.useCallback)(()=>{if(d){let e=i.flatMap(e=>e.threads).find(e=>e.threadId===d),t=i.find(e=>e.threads.some(e=>e.threadId===d)),n=e?va(e,t?.name??t?.projectId??``):d;return{options:{threadId:d},title:`Clear Thread History`,description:`Permanently delete all conversation history for "${n}"? This cannot be undone.`}}if(l&&l!==ga){let e=i.find(e=>e.projectId===l)?.name??l;return{options:{projectId:l},title:`Clear Project History`,description:`Permanently delete all conversation history for "${e}"? This cannot be undone.`}}return{options:void 0,title:`Clear All History`,description:`Permanently delete all conversation history across every project and thread? This cannot be undone.`}},[i,l,d]),A=(0,G.useCallback)(async()=>{let e=k();g(!0),C(null);try{await T(e.options),E&&Xi(E),x(E),c(0),m(!1)}catch(e){C(e instanceof Error?e.message:`Failed to clear conversation history`)}finally{g(!1)}},[k,E]);function j(){w&&Xi(ba(w,_)),v(e=>e+1),x(null),C(null)}let M=k();if(!e)return null;let N=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Fi,{value:l,onValueChange:O,children:[(0,q.jsx)(Li,{className:`w-48`,children:(0,q.jsx)(Ii,{placeholder:`Select project`})}),(0,q.jsxs)(Bi,{children:[(0,q.jsx)(Hi,{value:ga,children:`All Projects`}),i.map(e=>(0,q.jsx)(Hi,{value:e.projectId,children:e.name??e.projectId},e.projectId))]})]}),(0,q.jsxs)(Fi,{value:d,onValueChange:D,children:[(0,q.jsx)(Li,{className:`w-48`,children:(0,q.jsx)(Ii,{placeholder:`Select thread`})}),(0,q.jsx)(Bi,{children:i.flatMap(e=>e.threads.map(t=>(0,q.jsx)(Hi,{value:t.threadId,children:va(t,e.name??e.projectId)},t.threadId)))})]}),(0,q.jsxs)(n,{variant:`outline`,size:`sm`,onClick:()=>m(!0),disabled:h,children:[(0,q.jsx)(o,{className:`h-4 w-4 mr-2`}),`Clear`]})]}),P=(0,q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,q.jsx)(`div`,{className:a?void 0:`border-b px-6 py-4`,children:(0,q.jsx)(er,{title:`History`,description:a?`View and browse conversation history across projects and threads.`:void 0,action:(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[N,a?null:(0,q.jsx)(n,{variant:`action`,size:`icon-sm`,onClick:t,children:(0,q.jsx)(ye,{})})]})})}),(0,q.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:S?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,q.jsxs)(aa,{className:`max-w-md`,children:[(0,q.jsx)(oa,{children:(0,q.jsx)(sa,{className:`text-destructive`,children:`Error`})}),(0,q.jsxs)(la,{className:`space-y-4`,children:[(0,q.jsx)(`p`,{children:S}),(0,q.jsx)(n,{onClick:()=>C(null),children:`Dismiss`})]})]})}):y&&y===E?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,q.jsxs)(`div`,{className:`max-w-md text-center space-y-2`,children:[(0,q.jsx)(`h3`,{className:b.emptyStateTitle,children:`No history`}),(0,q.jsx)(`p`,{className:b.bodyMuted,children:`No conversation history found for this thread.`})]})}):w?(0,q.jsx)(da,{fallbackTitle:`Failed to load conversation history`,onRetry:j,children:(0,q.jsx)(G.Suspense,{fallback:(0,q.jsx)(Wi,{label:`Loading conversation history...`,size:`lg`}),children:(0,q.jsx)(ha,{scope:w,projects:i,loadVersion:_,currentPromptIndex:s,onPromptIndexChange:c},E??void 0)})}):(0,q.jsx)(Wi,{label:`Loading conversation history...`,size:`lg`})})]});return(0,q.jsxs)(q.Fragment,{children:[a?(0,q.jsx)(or,{children:(0,q.jsx)(tr,{className:`max-w-none w-full h-full flex flex-col min-h-0`,children:P})}):(0,q.jsx)(`div`,{className:`fixed inset-0 z-50 bg-background`,children:P}),(0,q.jsx)(Un,{open:p,onOpenChange:m,children:(0,q.jsxs)(Kn,{children:[(0,q.jsxs)(qn,{children:[(0,q.jsx)(Yn,{children:M.title}),(0,q.jsx)(Xn,{children:M.description})]}),(0,q.jsxs)(Jn,{children:[(0,q.jsx)(Qn,{disabled:h,children:`Cancel`}),(0,q.jsx)(Zn,{onClick:e=>{e.preventDefault(),A()},disabled:h,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:h?`Clearing...`:`Clear`})]})]})})]})});export{Qn as A,ir as C,or as D,tr as E,Yn as F,un as I,Xn as M,Jn as N,Un as O,qn as P,er as S,sr as T,ur as _,Qi as a,lr as b,qi as c,Fi as d,Bi as f,Ii as g,Li as h,la as i,Kn as j,Zn as k,Wi as l,Ui as m,da as n,Xi as o,Hi as p,aa as r,Zi as s,fa as t,Gi as u,nr as v,cr as w,ar as x,rr as y};
|