@puddle-code/cli 0.3.4 → 0.3.7
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/CHANGELOG.md +4 -10
- package/dist/host-control.mjs +28 -13
- package/dist/index.js +34 -16
- package/dist/public/assets/App-3pe09sB2.js +2 -0
- package/dist/public/assets/Dashboard-D9xlDbdg.js +1 -0
- package/dist/public/assets/{EditorTabClose-DNWGZZN8.js → EditorTabClose-CXw4HBAH.js} +1 -1
- package/dist/public/assets/LazyTerminal-Bw2e95Rk.js +2 -0
- package/dist/public/assets/{ModelRefcount-CJK-g5rf.js → ModelRefcount-CnZh2UXX.js} +1 -1
- package/dist/public/assets/NewProjectDialog-C3INf-Ll.js +1 -0
- package/dist/public/assets/PaneEditorBody-CpAHfSEe.js +302 -0
- package/dist/public/assets/{PdfViewer-BY5xRKk1.js → PdfViewer-CfWAV5F2.js} +1 -1
- package/dist/public/assets/SettingsDialog-DYHZOJul.js +8 -0
- package/dist/public/assets/{Terminal-CqjwbNAI.js → Terminal-DehlgjA9.js} +4 -4
- package/dist/public/assets/Workspace-CfqiBKYr.js +20 -0
- package/dist/public/assets/auth-B4b-NPwe.js +64 -0
- package/dist/public/assets/{buffer-store-BAQjeFXg.js → buffer-store-DI-PLEdj.js} +1 -1
- package/dist/public/assets/context-menu-BEfTGRZA.js +1 -0
- package/dist/public/assets/{copy-Df7qIcX6.js → copy-DD43yC2P.js} +1 -1
- package/dist/public/assets/{disclosure-C2uTs3Vm.js → disclosure-BQ-uiP85.js} +1 -1
- package/dist/public/assets/dist-Cg-J2BAP.js +1 -0
- package/dist/public/assets/{dist-Cl5AP2As.js → dist-Rswij5M_.js} +1 -1
- package/dist/public/assets/{errors-BiS6nBXL.js → errors-C-GJcBJ-.js} +1 -1
- package/dist/public/assets/index-CjRY8Crm.css +2 -0
- package/dist/public/assets/{index-CW1P_8TN.js → index-fldNIah5.js} +3 -3
- package/dist/public/assets/input-Dx89yXF4.js +1 -0
- package/dist/public/assets/{markdown-mermaid-JPAETK2Y.js → markdown-mermaid-CxLp87MP.js} +1 -1
- package/dist/public/assets/media-refresh-store-WCjZVi4Y.js +1 -0
- package/dist/public/assets/notification-delivery-Cmpcrn_p.js +1 -0
- package/dist/public/assets/popover-CTPDNtFu.js +1 -0
- package/dist/public/assets/{project-abbrev-Bz8ZEwrb.js → project-abbrev-DhiE8lDE.js} +1 -1
- package/dist/public/assets/{protocol-support-CJIxbQCB.js → protocol-support-Q_1mBit9.js} +1 -1
- package/dist/public/assets/{scroll-restoration-r--43sOx.js → scroll-restoration-hslkZdX5.js} +1 -1
- package/dist/public/assets/select-iSqC2X51.js +1 -0
- package/dist/public/assets/{selection-actions-C2udLSyj.js → selection-actions-DmuKya-K.js} +1 -1
- package/dist/public/assets/switch-CeNFnG6w.js +1 -0
- package/dist/public/assets/use-ui-state-xScqhALU.js +1 -0
- package/dist/public/assets/{ws-B1kcYo2j.js → ws-CT7jDKHs.js} +1 -1
- package/dist/public/index.html +3 -3
- package/dist/pudl.js +29 -14
- package/package.json +1 -1
- package/dist/public/assets/App-CwV0Dizo.js +0 -2
- package/dist/public/assets/Dashboard-fA7E3Mr1.js +0 -1
- package/dist/public/assets/LazyTerminal-CAvxgexS.js +0 -2
- package/dist/public/assets/NewProjectDialog-eDAOcbIM.js +0 -1
- package/dist/public/assets/PaneEditorBody-Cxn0s84L.js +0 -302
- package/dist/public/assets/SettingsDialog-Sd6i7Plz.js +0 -8
- package/dist/public/assets/Workspace-C-M1AjMn.js +0 -20
- package/dist/public/assets/auth-cjbSLnao.js +0 -73
- package/dist/public/assets/context-menu-DVUv5Z6a.js +0 -1
- package/dist/public/assets/dist-B67qxih2.js +0 -1
- package/dist/public/assets/index-XBWIhnuP.css +0 -2
- package/dist/public/assets/media-refresh-store-CHnqDJWI.js +0 -1
- package/dist/public/assets/notification-delivery-Lz-hnQG7.js +0 -1
- package/dist/public/assets/popover-C-BfSLgw.js +0 -1
- package/dist/public/assets/recipes-K5GH3Kht.js +0 -1
- package/dist/public/assets/select-YFIOZ3zx.js +0 -1
- package/dist/public/assets/switch-DwMO1AUH.js +0 -1
- package/dist/public/assets/use-ui-state-Crvfdw4F.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{i as r}from"./auth-cjbSLnao.js";import{i}from"./dist-Cl5AP2As.js";var a=n(),o=e(t(),1);function s(){return window.puddleDesktop}function c(){let[e,t]=(0,o.useState)({fullScreen:!1,animate:!1});return(0,o.useEffect)(()=>{let e=s();if(!e)return;let n=!0;e.isFullScreen?.()?.then(e=>{n&&t({fullScreen:e,animate:!1})});let r=e.onFullScreenChange?.(e=>t({fullScreen:e,animate:!0}));return()=>{n=!1,r?.()}},[]),e}var l=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},u=new class extends l{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},d={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},f=new class{#e=d;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function p(e){setTimeout(e,0)}var m=typeof window>`u`||`Deno`in globalThis;function h(){}function g(e,t){return typeof e==`function`?e(t):e}function _(e){return typeof e==`number`&&e>=0&&e!==1/0}function v(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return typeof e==`function`?e(t):e}function b(e,t){return typeof e==`function`?e(t):e}function x(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==C(o,t.options))return!1}else if(!T(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function S(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(w(t.options.mutationKey)!==w(a))return!1}else if(!T(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function C(e,t){return(t?.queryKeyHashFn||w)(e)}function w(e){return JSON.stringify(e,(e,t)=>D(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function T(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>T(e[n],t[n])):!1}var ee=Object.prototype.hasOwnProperty;function te(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ne(e)&&ne(t);if(!r&&!(D(e)&&D(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=te(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function E(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ne(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function D(e){if(!re(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!re(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function re(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return new Promise(t=>{f.setTimeout(t,e)})}function O(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:te(e,t)}function ae(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function oe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var k=Symbol();function se(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===k?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function A(e,t){return typeof e==`function`?e(...t):!!e}function ce(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var j=(()=>{let e=()=>m;return{isServer(){return e()},setIsServer(t){e=t}}})();function M(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var le=p;function ue(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=le,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var N=ue(),P=new class extends l{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function de(e){return Math.min(1e3*2**e,3e4)}function fe(e){return(e??`online`)!==`online`||P.isOnline()}var F=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function I(e){let t=!1,n=0,r,i=M(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new F(t);p(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>u.isFocused()&&(e.networkMode===`always`||P.isOnline())&&e.canRun(),d=()=>fe(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(j.isServer()?0:3),o=e.retryDelay??de,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ie(s).then(()=>l()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:d,start:()=>(d()?h():m().then(h),i)}}var pe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_(this.gcTime)&&(this.#e=f.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(j.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(f.clearTimeout(this.#e),this.#e=void 0)}};function me(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ce(e,()=>t.signal,()=>n=!0)},u=se(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?oe:ae;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?he:L,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:L(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function L(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function he(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function ge(e,t){return t?L(e,t)!=null:!1}function _e(e,t){return!t||!e.getPreviousPageParam?!1:he(e,t)!=null}var ve=class extends pe{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=xe(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=xe(this.options);e.data!==void 0&&(this.setState(be(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=O(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(h).catch(h):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>b(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===k||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>y(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!v(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=se(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?me(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=I({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof F&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof F){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ye(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...be(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),N.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ye(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:fe(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function be(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function xe(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Se=class extends l{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=M(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),we(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return R(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return R(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof b(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!E(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&z(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||y(this.options.staleTime,this.#t)!==y(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Te(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(h)),t}#g(){this.#b();let e=y(this.options.staleTime,this.#t);if(j.isServer()||this.#r.isStale||!_(e))return;let t=v(this.#r.dataUpdatedAt,e)+1;this.#d=f.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(j.isServer()||b(this.options.enabled,this.#t)===!1||!_(this.#p)||this.#p===0)&&(this.#f=f.setInterval(()=>{(this.options.refetchIntervalInBackground||u.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(f.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(f.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&we(e,t),o=i&&z(e,n,t,r);(a||o)&&(l={...l,...ye(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=O(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=O(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&x,isStale:B(e,t),refetch:this.refetch,promise:this.#o,isEnabled:b(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{let e=this.#o=S.promise=M();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!E(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){N.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ce(e,t){return b(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&b(t.retryOnMount,e)===!1)}function we(e,t){return Ce(e,t)||e.state.data!==void 0&&R(e,t,t.refetchOnMount)}function R(e,t,n){if(b(t.enabled,e)!==!1&&y(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&B(e,t)}return!1}function z(e,t,n,r){return(e!==t||b(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&B(e,n)}function B(e,t){return b(t.enabled,e)!==!1&&e.isStaleByTime(y(t.staleTime,e))}function Te(e,t){return!E(e.getCurrentResult(),t)}var Ee=class extends pe{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||V(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=I({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),N.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function V(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var De=class extends l{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),E(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&w(t.mutationKey)!==w(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??V();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){N.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Oe=o.createContext(void 0),H=e=>{let t=o.useContext(Oe);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ke=({client:e,children:t})=>(o.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,a.jsx)(Oe.Provider,{value:e,children:t})),Ae=o.createContext(!1),je=()=>o.useContext(Ae);Ae.Provider;function Me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ne=o.createContext(Me()),Pe=()=>o.useContext(Ne),Fe=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?A(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ie=e=>{o.useEffect(()=>{e.clearReset()},[e])},Le=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||A(n,[e.error,r])),Re=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ze=(e,t)=>e.isLoading&&e.isFetching&&!t,Be=(e,t)=>e?.suspense&&t.isPending,Ve=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function He(e,t,n){let r=je(),i=Pe(),a=H(n),s=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(s);let c=a.getQueryCache().get(s.queryHash),l=e.subscribed!==!1;s._optimisticResults=r?`isRestoring`:l?`optimistic`:void 0,Re(s),Fe(s,i,c),Ie(i);let u=!a.getQueryCache().get(s.queryHash),[d]=o.useState(()=>new t(a,s)),f=d.getOptimisticResult(s),p=!r&&l;if(o.useSyncExternalStore(o.useCallback(e=>{let t=p?d.subscribe(N.batchCalls(e)):h;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),o.useEffect(()=>{d.setOptions(s)},[s,d]),Be(s,f))throw Ve(s,d,i);if(Le({result:f,errorResetBoundary:i,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(s,f),s.experimental_prefetchInRender&&!j.isServer()&&ze(f,r)&&(u?Ve(s,d,i):c?.promise)?.catch(h).finally(()=>{d.updateResult()}),s.notifyOnChangeProps?f:d.trackResult(f)}function U(e,t){return He(e,Se,t)}function W(e,t){let n=H(t),[r]=o.useState(()=>new De(n,e));o.useEffect(()=>{r.setOptions(e)},[r,e]);let i=o.useSyncExternalStore(o.useCallback(e=>r.subscribe(N.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=o.useCallback((e,t)=>{r.mutate(e,t).catch(h)},[r]);if(i.error&&A(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Ue=12,G=typeof document<`u`?document.hasFocus():!0;typeof window<`u`&&(window.addEventListener(`focus`,()=>{G=!0}),window.addEventListener(`blur`,()=>{G=!1}),u.setEventListener(e=>{let t=()=>e(void 0);return window.addEventListener(`visibilitychange`,t,!1),window.addEventListener(`focus`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}}));function K(e){return()=>G?e:e*Ue}function We(){return U({queryKey:[`profiles`],queryFn:()=>i(`GET`,`/api/profiles`)})}function Ge(e){return U({queryKey:[`profile-settings`,e],queryFn:()=>i(`GET`,`/api/profiles/${e}/settings`),enabled:e!==void 0})}function Ke(e){return U({queryKey:[`accounts`,e],queryFn:()=>i(`GET`,`/api/accounts?profile=${e}`),enabled:e!==void 0})}function qe(e){return U({queryKey:[`account-usage`,e],queryFn:()=>i(`GET`,`/api/accounts/${e}/usage`),enabled:e!==void 0,staleTime:15e3})}function Je(){return U({queryKey:[`repos`],queryFn:()=>i(`GET`,`/api/repos`)})}function Ye(e,t=!0){return U({queryKey:[`projects`,e??`all`],queryFn:()=>i(`GET`,e===void 0?`/api/projects`:`/api/projects?profile=${e}`),enabled:t})}function Xe(e){return U({queryKey:[`project`,e],queryFn:()=>i(`GET`,`/api/projects/${e}`),enabled:e!==void 0,placeholderData:e=>e})}function Ze(e){return i(`POST`,`/api/projects/${e}/conversations/refresh`)}function Qe(e){return U({queryKey:[`sessions`,e],queryFn:()=>i(`GET`,`/api/sessions?project=${e}`),enabled:e!==void 0})}var $e={queryKey:[`sessions`,`all`],queryFn:()=>i(`GET`,`/api/sessions`)};function et(e=!0){return U({...$e,enabled:e})}function tt(e){return e.fetchQuery($e)}function nt(){return U({queryKey:[`config`],queryFn:()=>i(`GET`,`/api/config`)})}function rt(e){return U({queryKey:[`repo-branches`,e],queryFn:()=>i(`GET`,`/api/repos/${e}/branches`),enabled:e!==void 0,staleTime:3e4})}function it(e,t=1e4){return U({queryKey:[`repo-worktrees`,e],queryFn:()=>i(`GET`,`/api/repos/${e}/worktrees`),enabled:e!==void 0,staleTime:t})}function at(e,t){let n=H();return W({mutationFn:t=>i(`DELETE`,`/api/repos/${e}/worktrees?path=${encodeURIComponent(t)}`),onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function ot(e,t){let n=H();return W({mutationFn:({name:t,confirm:n})=>{let r=new URLSearchParams({name:t});return n&&r.set(`confirm`,`1`),i(`DELETE`,`/api/repos/${e}/branches?${r.toString()}`)},onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function st(e){return U({queryKey:[`fs-dirs`,e],queryFn:()=>i(`GET`,`/api/fs/dirs?prefix=${encodeURIComponent(e)}`),enabled:e.startsWith(`/`)||e.startsWith(`~`),placeholderData:e=>e,staleTime:1e4})}function ct(){return U({queryKey:[`version`],queryFn:()=>i(`GET`,`/api/version`),staleTime:1/0})}function lt(){return U({queryKey:[`host`],queryFn:()=>i(`GET`,`/api/host`),staleTime:1/0})}function ut(e){return e?e.displayName||e.hostname:void 0}function dt(){return U({queryKey:[`agents`],queryFn:()=>i(`GET`,`/api/agents`),staleTime:3e4,refetchOnWindowFocus:!0})}function ft(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/profiles`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function pt(e){let t=H();return W({mutationFn:t=>i(`PATCH`,`/api/profiles/${e}/settings`,t),onSuccess:n=>t.setQueryData([`profile-settings`,e],n)})}function mt(){let e=H();return W({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/profiles/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function ht(){let e=H();return W({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/accounts/${e}`,t),onSuccess:t=>{e.invalidateQueries({queryKey:[`accounts`,t.profile_id]}),e.invalidateQueries({queryKey:[`account-usage`,t.id]})}})}function gt(){let e=H();return W({mutationFn:e=>i(`DELETE`,`/api/profiles/${e}`),onSuccess:()=>e.clear()})}function _t(){let e=H();return W({mutationFn:e=>i(`DELETE`,`/api/accounts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`accounts`]})})}function vt(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/accounts`,e),onSuccess:t=>void e.invalidateQueries({queryKey:[`accounts`,t.profile_id]})})}function yt(){return W({mutationFn:e=>i(`POST`,`/api/accounts/${e}/login`)})}function bt(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/repos`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function xt(){let e=H();return W({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/repos/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function St(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/repos/${e}/fetch`),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function Ct(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/projects`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function wt(){let e=H();return W({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/projects/${e}`,t),onSuccess:t=>{e.setQueryData([`project`,t.id],e=>e&&{...e,project:t}),e.invalidateQueries({queryKey:[`projects`]})}})}function Tt(e,t){return U({queryKey:[`scratchpad`,e,t??`none`],queryFn:()=>i(`GET`,`/api/scratchpad?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function Et(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/scratchpad`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Dt(){let e=H();return W({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/scratchpad/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Ot(){let e=H();return W({mutationFn:e=>i(`DELETE`,`/api/scratchpad/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function kt(e,t){return U({queryKey:[`layouts`,e,t??`none`],queryFn:()=>i(`GET`,`/api/layouts?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function At(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/layouts`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function jt(){let e=H();return W({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/layouts/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Mt(){let e=H();return W({mutationFn:e=>i(`DELETE`,`/api/layouts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function q(e,t){e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`project`,t.project_id]})}function Nt(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/sessions`,e),onSuccess:t=>q(e,t)})}function Pt(e){let t=H();return W({mutationFn:t=>i(`POST`,`/api/sessions/${t}/${e}`),onSuccess:e=>q(t,e)})}function Ft(){let e=H();return W({mutationFn:({sessionId:e,accountId:t})=>i(`POST`,`/api/sessions/${e}/migrate`,{account_id:t}),onSuccess:t=>q(e,t)})}function It(){let e=H();return W({mutationFn:({sessionId:e,accountId:t})=>i(`POST`,`/api/sessions/${e}/handoff`,{account_id:t}),onSuccess:(t,{sessionId:n})=>{q(e,t),e.invalidateQueries({queryKey:[`session`,n]})}})}function Lt(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/sessions/${e}/archive`),onSuccess:t=>q(e,t)})}function Rt(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/sessions/${e}/unarchive`),onSuccess:t=>q(e,t)})}function zt(){let e=H();return W({mutationFn:({sessionId:e,title:t})=>i(`PATCH`,`/api/sessions/${e}`,{title:t}),onSuccess:t=>q(e,t)})}function Bt(){let e=H();return W({mutationFn:e=>i(`PATCH`,`/api/config`,e),onSuccess:(t,n)=>{e.setQueryData([`config`],t),`displayName`in n&&e.invalidateQueries({queryKey:[`host`]})}})}async function Vt(e){try{return await i(`GET`,`/api/profiles/${e}/state`)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`no_state`)return null;throw e}}function Ht(e,t){return i(`PUT`,`/api/profiles/${e}/state`,{ui_state:t})}function Ut(e,t){return U({queryKey:[`ports`,e],queryFn:()=>i(`GET`,`/api/sessions/${e}/ports`),enabled:e!==void 0&&t,refetchInterval:K(5e3),refetchIntervalInBackground:!1})}function Wt(e,t){return U({queryKey:[`session-env`,e],queryFn:()=>i(`GET`,`/api/sessions/${e}/env`),enabled:e!==void 0&&t,refetchInterval:K(5e3),refetchIntervalInBackground:!1})}function Gt(){let e=H();return W({mutationFn:e=>i(`DELETE`,`/api/sessions/${e}/env`),onSuccess:(t,n)=>{e.setQueryData([`session-env`,n],{vars:[]})}})}var J=r(`puddle.profile-id`);function Kt(){let e=(0,o.useSyncExternalStore)(J.subscribe,J.get);return e!==null&&/^[0-9a-f]{10}$/.test(e)?e:null}function qt(e){window.location.pathname!==`/`&&window.history.replaceState(null,``,`/`),J.set(e)}var Jt=[`Layout & tabs`,`Editor`,`Left sidebar`,`Right sidebar`],Y=[{id:`palette.toggle`,label:`Command palette`,group:`Layout & tabs`,defaultBinding:`meta+KeyK`},{id:`tab.close`,label:`Close current tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyW`,desktopBinding:`meta+KeyW`},{id:`tab.reopen`,label:`Reopen last closed tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyT`,desktopBinding:`shift+meta+KeyT`},{id:`tab.newUntitled`,label:`New untitled file`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyN`,desktopBinding:`meta+KeyN`},{id:`tab.next`,label:`Next tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketRight`,desktopBinding:`ctrl+Tab`},{id:`tab.prev`,label:`Previous tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketLeft`,desktopBinding:`ctrl+shift+Tab`},{id:`window.close`,label:`Close window`,group:`Layout & tabs`,defaultBinding:`meta+KeyW`,desktopBinding:`shift+meta+KeyW`},{id:`sidebar.left`,label:`Toggle left sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Comma`,desktopBinding:`meta+KeyB`},{id:`sidebar.right`,label:`Toggle right sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Period`,desktopBinding:`shift+meta+KeyB`},{id:`editor.save`,label:`Save`,group:`Editor`,defaultBinding:`meta+KeyS`,editor:!0},{id:`editor.wordWrap`,label:`Toggle word wrap`,group:`Editor`,defaultBinding:`alt+KeyZ`,editor:!0},{id:`nav.files`,label:`Open Files`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyE`},{id:`nav.search`,label:`Open Search`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyF`},{id:`nav.changes`,label:`Open Changes`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyV`},{id:`nav.worktrees`,label:`Open Worktrees`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyB`},{id:`session.newAgent`,label:`New agent`,group:`Right sidebar`,defaultBinding:`ctrl+alt+Backquote`,desktopBinding:`meta+KeyT`},{id:`session.newTerminal`,label:`New terminal`,group:`Right sidebar`,defaultBinding:`ctrl+Backquote`},{id:`scratchpad.toggle`,label:`Toggle Scratchpad`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyS`},{id:`layouts.toggle`,label:`Toggle Layouts`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyL`}],Yt=new Map(Y.map(e=>[e.id,e])),Xt=typeof window<`u`&&s()!==void 0;function Zt(e,t=Xt){return t&&e.desktopBinding?e.desktopBinding:e.defaultBinding}function Qt(e){let t=e.code;if(!t||/^(Control|Alt|Shift|Meta)(Left|Right)$/.test(t))return null;let n=[];return e.ctrlKey&&n.push(`ctrl`),e.altKey&&n.push(`alt`),e.shiftKey&&n.push(`shift`),e.metaKey&&n.push(`meta`),n.length===0?null:(n.push(t),n.join(`+`))}var $t={ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`},en={Comma:`,`,Period:`.`,Backquote:"`",Slash:`/`,Backslash:`\\`,Minus:`-`,Equal:`=`,Space:`␣`,Enter:`↵`,Escape:`Esc`,Tab:`⇥`,BracketLeft:`[`,BracketRight:`]`};function tn(e){return e.startsWith(`Key`)?e.slice(3):e.startsWith(`Digit`)?e.slice(5):en[e]??e}function nn(e){if(!e)return`—`;let t=e.split(`+`),n=t.pop()??``;return t.map(e=>$t[e]??e).join(``)+tn(n)}var X=new Map;function rn(e,t){return X.set(e,t),()=>{X.get(e)===t&&X.delete(e)}}var an=e=>X.get(e),on=e=>Yt.get(e);function sn(e,t){return e.id===`editor.save`||t&&e.editor!==!0}var cn={},Z=new Set,Q=ln();function ln(){let e={};for(let t of Y)e[t.id]=cn[t.id]||Zt(t);return e}function un(e){cn=e??{},Q=ln(),Z.forEach(e=>e())}var dn=e=>Q[e]??``;function fn(e){for(let[t,n]of Object.entries(Q))if(n===e)return t}function pn(e){return nn(mn()[e]??``)}function mn(){return(0,o.useSyncExternalStore)(e=>(Z.add(e),()=>Z.delete(e)),()=>Q)}function $(e,t,n){return!e||e.major>t||e.major===t&&e.minor>=n}var hn=e=>e!==void 0&&$(e,21,3),gn=e=>e!==void 0&&$(e,24,5);function _n(e){return $(e,17,1)}function vn(e){return $(e,17,3)}var yn=e=>e!==void 0&&$(e,24,4),bn=e=>$(e,10,3),xn=e=>$(e,12,3),Sn=e=>$(e,12,4),Cn=e=>$(e,15,3),wn=e=>e!==void 0&&$(e,16,3),Tn=e=>$(e,16,4),En=e=>$(e,14,1),Dn=e=>e!==void 0&&$(e,24,6);export{gt as $,u as $t,tt as A,Rt as At,Gt as B,ge as Bt,rn as C,it as Ct,J as D,Wt as Dt,pn as E,Pt as Et,qe as F,ke as Ft,Ct as G,w as Gt,vt as H,P as Ht,Ke as I,H as It,Nt as J,x as Jt,bt as K,C as Kt,dt as L,Ee as Lt,ut as M,W as Mt,Ht as N,U as Nt,qt as O,Ut as Ot,Ze as P,He as Pt,Mt as Q,k as Qt,et as R,Se as Rt,sn as S,rt as St,Zt as T,Tt,At as U,N as Ut,nt as V,_e as Vt,ft as W,g as Wt,_t as X,T as Xt,ct as Y,h as Yt,ot as Z,y as Zt,Qt as _,We as _t,wn as a,kt as at,an as b,at as bt,hn as c,ht as ct,gn as d,mt as dt,l as en,Ot as et,Cn as f,pt as ft,fn as g,Ge as gt,Jt as h,Dt as ht,_n as i,lt as it,Vt as j,K as jt,Kt as k,Qe as kt,Tn as l,Bt as lt,Y as m,xt as mt,yn as n,c as nn,St as nt,En as o,yt as ot,bn as p,wt as pt,Et as q,S as qt,vn as r,It as rt,Sn as s,Ft as st,xn as t,s as tn,st as tt,Dn as u,jt as ut,nn as v,Xe as vt,un as w,Je as wt,dn as x,zt as xt,on as y,Ye as yt,Lt as z,ve as zt};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{i as r}from"./auth-B4b-NPwe.js";import{i}from"./dist-Rswij5M_.js";var a=n(),o=e(t(),1);function s(){return window.puddleDesktop}function c(){let[e,t]=(0,o.useState)({fullScreen:!1,animate:!1});return(0,o.useEffect)(()=>{let e=s();if(!e)return;let n=!0;e.isFullScreen?.()?.then(e=>{n&&t({fullScreen:e,animate:!1})});let r=e.onFullScreenChange?.(e=>t({fullScreen:e,animate:!0}));return()=>{n=!1,r?.()}},[]),e}var l=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},u=new class extends l{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},d={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},f=new class{#e=d;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function p(e){setTimeout(e,0)}var m=typeof window>`u`||`Deno`in globalThis;function h(){}function g(e,t){return typeof e==`function`?e(t):e}function _(e){return typeof e==`number`&&e>=0&&e!==1/0}function v(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return typeof e==`function`?e(t):e}function b(e,t){return typeof e==`function`?e(t):e}function x(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==C(o,t.options))return!1}else if(!T(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function S(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(w(t.options.mutationKey)!==w(a))return!1}else if(!T(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function C(e,t){return(t?.queryKeyHashFn||w)(e)}function w(e){return JSON.stringify(e,(e,t)=>D(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function T(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>T(e[n],t[n])):!1}var ee=Object.prototype.hasOwnProperty;function te(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ne(e)&&ne(t);if(!r&&!(D(e)&&D(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=te(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function E(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ne(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function D(e){if(!re(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!re(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function re(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return new Promise(t=>{f.setTimeout(t,e)})}function O(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:te(e,t)}function ae(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function oe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var k=Symbol();function se(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===k?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function A(e,t){return typeof e==`function`?e(...t):!!e}function ce(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var j=(()=>{let e=()=>m;return{isServer(){return e()},setIsServer(t){e=t}}})();function M(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var le=p;function ue(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=le,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var N=ue(),P=new class extends l{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function de(e){return Math.min(1e3*2**e,3e4)}function fe(e){return(e??`online`)!==`online`||P.isOnline()}var F=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function I(e){let t=!1,n=0,r,i=M(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new F(t);p(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>u.isFocused()&&(e.networkMode===`always`||P.isOnline())&&e.canRun(),d=()=>fe(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(j.isServer()?0:3),o=e.retryDelay??de,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ie(s).then(()=>l()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:d,start:()=>(d()?h():m().then(h),i)}}var pe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_(this.gcTime)&&(this.#e=f.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(j.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(f.clearTimeout(this.#e),this.#e=void 0)}};function me(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ce(e,()=>t.signal,()=>n=!0)},u=se(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?oe:ae;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?he:L,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:L(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function L(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function he(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function ge(e,t){return t?L(e,t)!=null:!1}function _e(e,t){return!t||!e.getPreviousPageParam?!1:he(e,t)!=null}var ve=class extends pe{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=xe(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=xe(this.options);e.data!==void 0&&(this.setState(be(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=O(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(h).catch(h):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>b(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===k||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>y(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!v(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=se(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?me(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=I({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof F&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof F){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ye(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...be(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),N.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ye(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:fe(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function be(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function xe(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Se=class extends l{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=M(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),we(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return R(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return R(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof b(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!E(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&z(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||y(this.options.staleTime,this.#t)!==y(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Te(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(h)),t}#g(){this.#b();let e=y(this.options.staleTime,this.#t);if(j.isServer()||this.#r.isStale||!_(e))return;let t=v(this.#r.dataUpdatedAt,e)+1;this.#d=f.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(j.isServer()||b(this.options.enabled,this.#t)===!1||!_(this.#p)||this.#p===0)&&(this.#f=f.setInterval(()=>{(this.options.refetchIntervalInBackground||u.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(f.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(f.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&we(e,t),o=i&&z(e,n,t,r);(a||o)&&(l={...l,...ye(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=O(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=O(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&x,isStale:B(e,t),refetch:this.refetch,promise:this.#o,isEnabled:b(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{let e=this.#o=S.promise=M();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!E(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){N.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ce(e,t){return b(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&b(t.retryOnMount,e)===!1)}function we(e,t){return Ce(e,t)||e.state.data!==void 0&&R(e,t,t.refetchOnMount)}function R(e,t,n){if(b(t.enabled,e)!==!1&&y(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&B(e,t)}return!1}function z(e,t,n,r){return(e!==t||b(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&B(e,n)}function B(e,t){return b(t.enabled,e)!==!1&&e.isStaleByTime(y(t.staleTime,e))}function Te(e,t){return!E(e.getCurrentResult(),t)}var Ee=class extends pe{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||V(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=I({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),N.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function V(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var De=class extends l{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),E(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&w(t.mutationKey)!==w(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??V();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){N.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Oe=o.createContext(void 0),H=e=>{let t=o.useContext(Oe);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ke=({client:e,children:t})=>(o.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,a.jsx)(Oe.Provider,{value:e,children:t})),Ae=o.createContext(!1),je=()=>o.useContext(Ae);Ae.Provider;function Me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ne=o.createContext(Me()),Pe=()=>o.useContext(Ne),Fe=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?A(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ie=e=>{o.useEffect(()=>{e.clearReset()},[e])},Le=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||A(n,[e.error,r])),Re=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ze=(e,t)=>e.isLoading&&e.isFetching&&!t,Be=(e,t)=>e?.suspense&&t.isPending,Ve=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function He(e,t,n){let r=je(),i=Pe(),a=H(n),s=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(s);let c=a.getQueryCache().get(s.queryHash),l=e.subscribed!==!1;s._optimisticResults=r?`isRestoring`:l?`optimistic`:void 0,Re(s),Fe(s,i,c),Ie(i);let u=!a.getQueryCache().get(s.queryHash),[d]=o.useState(()=>new t(a,s)),f=d.getOptimisticResult(s),p=!r&&l;if(o.useSyncExternalStore(o.useCallback(e=>{let t=p?d.subscribe(N.batchCalls(e)):h;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),o.useEffect(()=>{d.setOptions(s)},[s,d]),Be(s,f))throw Ve(s,d,i);if(Le({result:f,errorResetBoundary:i,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(s,f),s.experimental_prefetchInRender&&!j.isServer()&&ze(f,r)&&(u?Ve(s,d,i):c?.promise)?.catch(h).finally(()=>{d.updateResult()}),s.notifyOnChangeProps?f:d.trackResult(f)}function U(e,t){return He(e,Se,t)}function W(e,t){let n=H(t),[r]=o.useState(()=>new De(n,e));o.useEffect(()=>{r.setOptions(e)},[r,e]);let i=o.useSyncExternalStore(o.useCallback(e=>r.subscribe(N.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=o.useCallback((e,t)=>{r.mutate(e,t).catch(h)},[r]);if(i.error&&A(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Ue=12,G=typeof document<`u`?document.hasFocus():!0;typeof window<`u`&&(window.addEventListener(`focus`,()=>{G=!0}),window.addEventListener(`blur`,()=>{G=!1}),u.setEventListener(e=>{let t=()=>e(void 0);return window.addEventListener(`visibilitychange`,t,!1),window.addEventListener(`focus`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}}));function K(e){return()=>G?e:e*Ue}function We(){return U({queryKey:[`profiles`],queryFn:()=>i(`GET`,`/api/profiles`)})}function Ge(e){return U({queryKey:[`profile-settings`,e],queryFn:()=>i(`GET`,`/api/profiles/${e}/settings`),enabled:e!==void 0})}function Ke(e){return U({queryKey:[`accounts`,e],queryFn:()=>i(`GET`,`/api/accounts?profile=${e}`),enabled:e!==void 0})}function qe(e){return U({queryKey:[`account-usage`,e],queryFn:()=>i(`GET`,`/api/accounts/${e}/usage`),enabled:e!==void 0,staleTime:15e3})}function Je(){return U({queryKey:[`repos`],queryFn:()=>i(`GET`,`/api/repos`)})}function Ye(e,t=!0){return U({queryKey:[`projects`,e??`all`],queryFn:()=>i(`GET`,e===void 0?`/api/projects`:`/api/projects?profile=${e}`),enabled:t})}function Xe(e){return U({queryKey:[`project`,e],queryFn:()=>i(`GET`,`/api/projects/${e}`),enabled:e!==void 0,placeholderData:e=>e})}function Ze(e){return i(`POST`,`/api/projects/${e}/conversations/refresh`)}function Qe(e){return U({queryKey:[`sessions`,e],queryFn:()=>i(`GET`,`/api/sessions?project=${e}`),enabled:e!==void 0})}var $e={queryKey:[`sessions`,`all`],queryFn:()=>i(`GET`,`/api/sessions`)};function et(e=!0){return U({...$e,enabled:e})}function tt(e){return e.fetchQuery($e)}function nt(){return U({queryKey:[`config`],queryFn:()=>i(`GET`,`/api/config`)})}function rt(e){return U({queryKey:[`repo-branches`,e],queryFn:()=>i(`GET`,`/api/repos/${e}/branches`),enabled:e!==void 0,staleTime:3e4})}function it(e,t=1e4){return U({queryKey:[`repo-worktrees`,e],queryFn:()=>i(`GET`,`/api/repos/${e}/worktrees`),enabled:e!==void 0,staleTime:t})}function at(e,t){let n=H();return W({mutationFn:t=>i(`DELETE`,`/api/repos/${e}/worktrees?path=${encodeURIComponent(t)}`),onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function ot(e,t){let n=H();return W({mutationFn:({name:t,confirm:n})=>{let r=new URLSearchParams({name:t});return n&&r.set(`confirm`,`1`),i(`DELETE`,`/api/repos/${e}/branches?${r.toString()}`)},onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function st(e){return U({queryKey:[`fs-dirs`,e],queryFn:()=>i(`GET`,`/api/fs/dirs?prefix=${encodeURIComponent(e)}`),enabled:e.startsWith(`/`)||e.startsWith(`~`),placeholderData:e=>e,staleTime:1e4})}function ct(){return U({queryKey:[`version`],queryFn:()=>i(`GET`,`/api/version`),staleTime:1/0})}function lt(){return U({queryKey:[`host`],queryFn:()=>i(`GET`,`/api/host`),staleTime:1/0})}function ut(e){return e?e.displayName||e.hostname:void 0}function dt(){return U({queryKey:[`agents`],queryFn:()=>i(`GET`,`/api/agents`),staleTime:3e4,refetchOnWindowFocus:!0})}function ft(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/profiles`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function pt(e){let t=H();return W({mutationFn:t=>i(`PATCH`,`/api/profiles/${e}/settings`,t),onSuccess:n=>t.setQueryData([`profile-settings`,e],n)})}function mt(){let e=H();return W({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/profiles/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function ht(){let e=H();return W({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/accounts/${e}`,t),onSuccess:t=>{e.invalidateQueries({queryKey:[`accounts`,t.profile_id]}),e.invalidateQueries({queryKey:[`account-usage`,t.id]})}})}function gt(){let e=H();return W({mutationFn:e=>i(`DELETE`,`/api/profiles/${e}`),onSuccess:()=>e.clear()})}function _t(){let e=H();return W({mutationFn:e=>i(`DELETE`,`/api/accounts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`accounts`]})})}function vt(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/accounts`,e),onSuccess:t=>void e.invalidateQueries({queryKey:[`accounts`,t.profile_id]})})}function yt(){return W({mutationFn:e=>i(`POST`,`/api/accounts/${e}/login`)})}function bt(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/repos`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function xt(){let e=H();return W({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/repos/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function St(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/repos/${e}/fetch`),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function Ct(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/projects`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function wt(){let e=H();return W({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/projects/${e}`,t),onSuccess:t=>{e.setQueryData([`project`,t.id],e=>e&&{...e,project:t}),e.invalidateQueries({queryKey:[`projects`]})}})}function Tt(e,t){return U({queryKey:[`scratchpad`,e,t??`none`],queryFn:()=>i(`GET`,`/api/scratchpad?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function Et(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/scratchpad`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Dt(){let e=H();return W({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/scratchpad/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Ot(){let e=H();return W({mutationFn:e=>i(`DELETE`,`/api/scratchpad/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function kt(e,t){return U({queryKey:[`layouts`,e,t??`none`],queryFn:()=>i(`GET`,`/api/layouts?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function At(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/layouts`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function jt(){let e=H();return W({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/layouts/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Mt(){let e=H();return W({mutationFn:e=>i(`DELETE`,`/api/layouts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function q(e,t){e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`project`,t.project_id]})}function Nt(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/sessions`,e),onSuccess:t=>q(e,t)})}function Pt(e){let t=H();return W({mutationFn:t=>i(`POST`,`/api/sessions/${t}/${e}`),onSuccess:e=>q(t,e)})}function Ft(){let e=H();return W({mutationFn:({sessionId:e,accountId:t})=>i(`POST`,`/api/sessions/${e}/migrate`,{account_id:t}),onSuccess:t=>q(e,t)})}function It(){let e=H();return W({mutationFn:({sessionId:e,accountId:t})=>i(`POST`,`/api/sessions/${e}/handoff`,{account_id:t}),onSuccess:(t,{sessionId:n})=>{q(e,t),e.invalidateQueries({queryKey:[`session`,n]})}})}function Lt(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/sessions/${e}/archive`),onSuccess:t=>q(e,t)})}function Rt(){let e=H();return W({mutationFn:e=>i(`POST`,`/api/sessions/${e}/unarchive`),onSuccess:t=>q(e,t)})}function zt(){let e=H();return W({mutationFn:({sessionId:e,title:t})=>i(`PATCH`,`/api/sessions/${e}`,{title:t}),onSuccess:t=>q(e,t)})}function Bt(){let e=H();return W({mutationFn:e=>i(`PATCH`,`/api/config`,e),onSuccess:(t,n)=>{e.setQueryData([`config`],t),`displayName`in n&&e.invalidateQueries({queryKey:[`host`]})}})}async function Vt(e){try{return await i(`GET`,`/api/profiles/${e}/state`)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`no_state`)return null;throw e}}function Ht(e,t){return i(`PUT`,`/api/profiles/${e}/state`,{ui_state:t})}function Ut(e,t){return U({queryKey:[`ports`,e],queryFn:()=>i(`GET`,`/api/sessions/${e}/ports`),enabled:e!==void 0&&t,refetchInterval:K(5e3),refetchIntervalInBackground:!1})}function Wt(e,t){return U({queryKey:[`session-env`,e],queryFn:()=>i(`GET`,`/api/sessions/${e}/env`),enabled:e!==void 0&&t,refetchInterval:K(5e3),refetchIntervalInBackground:!1})}function Gt(){let e=H();return W({mutationFn:e=>i(`DELETE`,`/api/sessions/${e}/env`),onSuccess:(t,n)=>{e.setQueryData([`session-env`,n],{vars:[]})}})}var J=r(`puddle.profile-id`);function Kt(){let e=(0,o.useSyncExternalStore)(J.subscribe,J.get);return e!==null&&/^[0-9a-f]{10}$/.test(e)?e:null}function qt(e){window.location.pathname!==`/`&&window.history.replaceState(null,``,`/`),J.set(e)}var Jt=[`Layout & tabs`,`Editor`,`Left sidebar`,`Right sidebar`],Y=[{id:`palette.toggle`,label:`Command palette`,group:`Layout & tabs`,defaultBinding:`meta+KeyK`},{id:`tab.close`,label:`Close current tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyW`,desktopBinding:`meta+KeyW`},{id:`tab.reopen`,label:`Reopen last closed tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyT`,desktopBinding:`shift+meta+KeyT`},{id:`tab.newUntitled`,label:`New untitled file`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyN`,desktopBinding:`meta+KeyN`},{id:`tab.next`,label:`Next tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketRight`,desktopBinding:`ctrl+Tab`},{id:`tab.prev`,label:`Previous tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketLeft`,desktopBinding:`ctrl+shift+Tab`},{id:`window.close`,label:`Close window`,group:`Layout & tabs`,defaultBinding:`meta+KeyW`,desktopBinding:`shift+meta+KeyW`},{id:`sidebar.left`,label:`Toggle left sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Comma`,desktopBinding:`meta+KeyB`},{id:`sidebar.right`,label:`Toggle right sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Period`,desktopBinding:`shift+meta+KeyB`},{id:`editor.save`,label:`Save`,group:`Editor`,defaultBinding:`meta+KeyS`,editor:!0},{id:`editor.wordWrap`,label:`Toggle word wrap`,group:`Editor`,defaultBinding:`alt+KeyZ`,editor:!0},{id:`nav.files`,label:`Open Files`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyE`},{id:`nav.search`,label:`Open Search`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyF`},{id:`nav.changes`,label:`Open Changes`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyV`},{id:`nav.worktrees`,label:`Open Worktrees`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyB`},{id:`session.newAgent`,label:`New agent`,group:`Right sidebar`,defaultBinding:`ctrl+alt+Backquote`,desktopBinding:`meta+KeyT`},{id:`session.newTerminal`,label:`New terminal`,group:`Right sidebar`,defaultBinding:`ctrl+Backquote`},{id:`scratchpad.toggle`,label:`Toggle Scratchpad`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyS`},{id:`layouts.toggle`,label:`Toggle Layouts`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyL`}],Yt=new Map(Y.map(e=>[e.id,e])),Xt=typeof window<`u`&&s()!==void 0;function Zt(e,t=Xt){return t&&e.desktopBinding?e.desktopBinding:e.defaultBinding}function Qt(e){let t=e.code;if(!t||/^(Control|Alt|Shift|Meta)(Left|Right)$/.test(t))return null;let n=[];return e.ctrlKey&&n.push(`ctrl`),e.altKey&&n.push(`alt`),e.shiftKey&&n.push(`shift`),e.metaKey&&n.push(`meta`),n.length===0?null:(n.push(t),n.join(`+`))}var $t={ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`},en={Comma:`,`,Period:`.`,Backquote:"`",Slash:`/`,Backslash:`\\`,Minus:`-`,Equal:`=`,Space:`␣`,Enter:`↵`,Escape:`Esc`,Tab:`⇥`,BracketLeft:`[`,BracketRight:`]`};function tn(e){return e.startsWith(`Key`)?e.slice(3):e.startsWith(`Digit`)?e.slice(5):en[e]??e}function nn(e){if(!e)return`—`;let t=e.split(`+`),n=t.pop()??``;return t.map(e=>$t[e]??e).join(``)+tn(n)}var X=new Map;function rn(e,t){return X.set(e,t),()=>{X.get(e)===t&&X.delete(e)}}var an=e=>X.get(e),on=e=>Yt.get(e);function sn(e,t){return e.id===`editor.save`||t&&e.editor!==!0}var cn={},Z=new Set,Q=ln();function ln(){let e={};for(let t of Y)e[t.id]=cn[t.id]||Zt(t);return e}function un(e){cn=e??{},Q=ln(),Z.forEach(e=>e())}var dn=e=>Q[e]??``;function fn(e){for(let[t,n]of Object.entries(Q))if(n===e)return t}function pn(e){return nn(mn()[e]??``)}function mn(){return(0,o.useSyncExternalStore)(e=>(Z.add(e),()=>Z.delete(e)),()=>Q)}function $(e,t,n){return!e||e.major>t||e.major===t&&e.minor>=n}var hn=e=>e!==void 0&&$(e,21,3),gn=e=>e!==void 0&&$(e,24,5);function _n(e){return $(e,17,1)}function vn(e){return $(e,17,3)}var yn=e=>e!==void 0&&$(e,24,4),bn=e=>$(e,10,3),xn=e=>$(e,12,3),Sn=e=>$(e,12,4),Cn=e=>$(e,15,3),wn=e=>e!==void 0&&$(e,16,3),Tn=e=>$(e,16,4),En=e=>$(e,14,1),Dn=e=>e!==void 0&&$(e,24,6),On=e=>e!==void 0&&$(e,25,1);export{Mt as $,k as $t,Kt as A,Qe as At,Lt as B,ve as Bt,sn as C,rt as Ct,pn as D,Pt as Dt,Zt as E,Tt as Et,Ze as F,He as Ft,ft as G,g as Gt,nt as H,_e as Ht,qe as I,ke as It,Et as J,S as Jt,Ct as K,w as Kt,Ke as L,H as Lt,Vt as M,K as Mt,ut as N,W as Nt,J as O,Wt as Ot,Ht as P,U as Pt,ot as Q,y as Qt,dt as R,Ee as Rt,dn as S,zt as St,un as T,Je as Tt,vt as U,P as Ut,Gt as V,ge as Vt,At as W,N as Wt,ct as X,h as Xt,Nt as Y,x as Yt,_t as Z,T as Zt,fn as _,Ge as _t,wn as a,lt as at,on as b,Ye as bt,hn as c,Ft as ct,Dn as d,jt as dt,u as en,gt as et,gn as f,mt as ft,Jt as g,Dt as gt,Y as h,xt as ht,_n as i,It as it,tt as j,Rt as jt,qt as k,Ut as kt,Tn as l,ht as lt,bn as m,wt as mt,yn as n,s as nn,st as nt,En as o,kt as ot,Cn as p,pt,bt as q,C as qt,vn as r,c as rn,St as rt,Sn as s,yt as st,xn as t,l as tn,Ot as tt,On as u,Bt as ut,Qt as v,We as vt,rn as w,it as wt,an as x,at as xt,nn as y,Xe as yt,et as z,Se as zt};
|
package/dist/public/assets/{scroll-restoration-r--43sOx.js → scroll-restoration-hslkZdX5.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{a as n}from"./auth-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{a as n}from"./auth-B4b-NPwe.js";var r=e(t(),1),i=(0,r.createContext)(``);function a(e,t){let a=(0,r.useContext)(i);return n(JSON.stringify([a,e,t]))}var o=class{limit;entries=new Map;constructor(e=500){this.limit=e}get(e){let t=this.entries.get(e);return t!==void 0&&(this.entries.delete(e),this.entries.set(e,t)),t}set(e,t){for(this.entries.delete(e),this.entries.set(e,t);this.entries.size>this.limit;){let e=this.entries.keys().next().value;if(e===void 0)break;this.entries.delete(e)}}},s=new o;function c(e,t,n,r=()=>!0){let i=s.get(n),a=-1,o=-1,c=()=>({height:Math.max(0,e.scrollHeight-e.clientHeight),width:Math.max(0,e.scrollWidth-e.clientWidth)}),l=()=>{!r()||!e.clientHeight||!e.clientWidth||({height:a,width:o}=c(),i&&(e.scrollTop=i.height?i.top/i.height*a:0,e.scrollLeft=i.width?i.left/i.width*o:0))},u=()=>{if(!r()||!e.clientHeight||!e.clientWidth)return;let t=c();({height:a,width:o}=t),i={top:e.scrollTop,left:e.scrollLeft,...t},s.set(n,i)},d=()=>{if(!r()||!e.clientHeight||!e.clientWidth)return;let t=c();if(t.height!==a||t.width!==o){l();return}u()};l(),e.addEventListener(`scroll`,d,{passive:!0});let f=new ResizeObserver(l);f.observe(e),f.observe(t);let p=new MutationObserver(l);return p.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-scroll-ready`]}),{capture:u,dispose:()=>{d(),e.removeEventListener(`scroll`,d),f.disconnect(),p.disconnect()}}}export{a as i,o as n,i as r,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{n,t as r}from"./jsx-runtime-ffCh33zF.js";import{a as i,c as a,f as o,g as s,h as c,i as l,l as u,n as d,o as f,p,r as m,s as h,t as g,u as _}from"./es2015-CrC2hHeB.js";import{a as v,c as y,n as b}from"./x-DCpy1q13.js";import{a as x,c as S,d as C,l as w,o as T,r as E,s as D,u as O}from"./input-Dx89yXF4.js";import{a as k,t as A}from"./dist-BCwJL3w9.js";import{t as j}from"./createLucideIcon-DyMAgLa3.js";import{t as ee}from"./chevron-down--sjpQEHH.js";import{n as te,t as ne}from"./dist-DmyIHyF9.js";var M=j(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),N=e(t(),1),P=e(n(),1);function F(e,[t,n]){return Math.min(n,Math.max(t,e))}var I=r(),L=[` `,`Enter`,`ArrowUp`,`ArrowDown`],R=[` `,`Enter`],z=`Select`,[B,V,H]=te(z),[U,re]=c(z,[H,C]),W=C(),[ie,G]=U(z),[ae,K]=U(z),oe=`SelectProvider`;function se(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:c,defaultValue:l,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:m,required:h,form:g,internal_do_not_use_render:_}=e,v=W(t),[y,b]=N.useState(null),[x,S]=N.useState(null),[C,w]=N.useState(!1),T=ne(d),[E,D]=i({prop:r,defaultProp:o??!1,onChange:s,caller:z}),[k,A]=i({prop:c,defaultProp:l,onChange:u,caller:z}),j=N.useRef(null),ee=N.useRef(k);N.useEffect(()=>{let e=g?y?.ownerDocument.getElementById(g):y?.form;if(e instanceof HTMLFormElement){let t=()=>A(ee.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[g,y,A]);let te=!y||!!g||!!y.closest(`form`),[M,P]=N.useState(new Set),F=a(),L=Array.from(M).map(e=>e.props.value).join(`;`),R=N.useCallback(e=>{P(t=>new Set(t).add(e))},[]),V=N.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),H={required:h,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:F,value:k,onValueChange:A,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:j,disabled:m,name:f,autoComplete:p,form:g,nativeOptions:M,nativeSelectKey:L,isFormControl:te};return(0,I.jsx)(O,{...v,children:(0,I.jsx)(ie,{scope:t,...H,children:(0,I.jsx)(B.Provider,{scope:t,children:(0,I.jsx)(ae,{scope:t,onNativeOptionAdd:R,onNativeOptionRemove:V,children:tt(_)?_(H):n})})})})}se.displayName=oe;var ce=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,I.jsx)(se,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,I.jsxs)(I.Fragment,{children:[n,e?(0,I.jsx)(et,{__scopeSelect:t}):null]})})};ce.displayName=z;var le=`SelectTrigger`,ue=N.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=W(n),o=G(le,n),c=o.disabled||r,l=y(t,o.onTriggerChange),u=V(n),d=N.useRef(`touch`),[f,m,h]=nt(e=>{let t=u().filter(e=>!e.disabled),n=rt(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),g=e=>{c||(o.onOpenChange(!0),h()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,I.jsx)(D,{asChild:!0,...a,children:(0,I.jsx)(p.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":$(o.value)?``:void 0,...i,ref:l,onClick:s(i.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&g(e)}),onPointerDown:s(i.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:s(i.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&L.includes(e.key)&&(g(),e.preventDefault())})})})});ue.displayName=le;var de=`SelectValue`,fe=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=G(de,n),{onValueNodeHasChildrenChange:l}=c,d=a!==void 0,f=y(t,c.onValueNodeChange);u(()=>{l(d)},[l,d]);let m=$(c.value);return(0,I.jsx)(p.span,{...s,asChild:!m&&s.asChild,ref:f,style:{pointerEvents:`none`},children:(0,I.jsx)(N.Fragment,{children:m?o:a},m?`placeholder`:`value`)})});fe.displayName=de;var pe=`SelectIcon`,me=N.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(p.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});me.displayName=pe;var he=`SelectPortal`,[ge,_e]=U(he,{forceMount:void 0}),ve=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,I.jsx)(ge,{scope:e.__scopeSelect,forceMount:n,children:(0,I.jsx)(h,{asChild:!0,...r})})};ve.displayName=he;var q=`SelectContent`,ye=N.forwardRef((e,t)=>{let n=_e(q,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=G(q,e.__scopeSelect),[o,s]=N.useState();return u(()=>{s(new DocumentFragment)},[]),(0,I.jsx)(f,{present:r||a.open,children:({present:e})=>e?(0,I.jsx)(we,{...i,ref:t}):(0,I.jsx)(be,{...i,fragment:o})})});ye.displayName=q;var be=N.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?P.createPortal((0,I.jsx)(xe,{scope:n,children:(0,I.jsx)(B.Slot,{scope:n,children:(0,I.jsx)(`div`,{ref:t,children:r})})}),i):null});be.displayName=`SelectContentFragment`;var J=10,[xe,Y]=U(q),Se=`SelectContentImpl`,Ce=v(`SelectContent.RemoveScroll`),we=N.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:c,sideOffset:u,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:v,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C,...w}=e,T=G(q,n),[E,D]=N.useState(null),[O,k]=N.useState(null),A=y(t,D),[j,ee]=N.useState(null),[te,ne]=N.useState(null),M=V(n),[P,F]=N.useState(!1),L=N.useRef(!1);N.useEffect(()=>{if(E)return g(E)},[E]),m();let R=N.useCallback(e=>{let[t,...n]=M().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&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[M,O]),z=N.useCallback(()=>R([j,E]),[R,j,E]);N.useEffect(()=>{P&&z()},[P,z]);let{onOpenChange:B,triggerPointerDownPosRef:H}=T;N.useEffect(()=>{if(E){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(H.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(E)||B(!1),document.removeEventListener(`pointermove`,t),H.current=null};return H.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,B,H]),N.useEffect(()=>{let e=()=>B(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[B]);let[U,re]=nt(e=>{let t=M().filter(e=>!e.disabled),n=rt(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),W=N.useCallback((e,t,n)=>{let r=!L.current&&!n;(T.value!==void 0&&T.value===t||r)&&(ee(e),r&&(L.current=!0))},[T.value]),ie=N.useCallback(()=>E?.focus(),[E]),ae=N.useCallback((e,t,n)=>{let r=!L.current&&!n;(T.value!==void 0&&T.value===t||r)&&ne(e)},[T.value]),K=r===`popper`?X:Ee,oe=K===X?{side:c,sideOffset:u,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:v,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C}:{};return(0,I.jsx)(xe,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:W,selectedItem:j,onItemLeave:ie,itemTextRefCallback:ae,focusSelectedItem:z,selectedItemText:te,position:r,isPositioned:P,searchRef:U,children:(0,I.jsx)(d,{as:Ce,allowPinchZoom:!0,children:(0,I.jsx)(l,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:s(i,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(_,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,I.jsx)(K,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...oe,onPlaced:()=>F(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:s(w.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=M().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(()=>R(t)),e.preventDefault()}})})})})})})});we.displayName=Se;var Te=`SelectItemAlignedPosition`,Ee=N.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=G(q,n),o=Y(q,n),[s,c]=N.useState(null),[l,d]=N.useState(null),f=y(t,d),m=V(n),h=N.useRef(!1),g=N.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:b,focusSelectedItem:x}=o,S=N.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&_&&v&&b){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-J,d=F(a,[J,Math.max(J,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-J,d=F(a,[J,Math.max(J,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=m(),c=window.innerHeight-J*2,u=_.scrollHeight,d=window.getComputedStyle(l),f=parseInt(d.borderTopWidth,10),p=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),y=parseInt(d.paddingBottom,10),x=f+p+u+y+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-J,D=c-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}s.style.margin=`${J}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,a.trigger,a.valueNode,s,l,_,v,b,a.dir,r]);u(()=>S(),[S]);let[C,w]=N.useState();return u(()=>{l&&w(window.getComputedStyle(l).zIndex)},[l]),(0,I.jsx)(Oe,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:N.useCallback(e=>{e&&g.current===!0&&(S(),x?.(),g.current=!1)},[S,x]),children:(0,I.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,I.jsx)(p.div,{...i,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});Ee.displayName=Te;var De=`SelectPopperPosition`,X=N.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=J,...a}=e,o=W(n);return(0,I.jsx)(w,{...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)`}})});X.displayName=De;var[Oe,ke]=U(q,{}),Ae=`SelectViewport`,je=N.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Y(Ae,n),o=ke(Ae,n),c=y(t,a.onViewportChange),l=N.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.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,I.jsx)(B.Slot,{scope:n,children:(0,I.jsx)(p.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:s(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-J*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})});je.displayName=Ae;var Me=`SelectGroup`,[Ne,Pe]=U(Me),Fe=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=a();return(0,I.jsx)(Ne,{scope:n,id:i,children:(0,I.jsx)(p.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Fe.displayName=Me;var Ie=`SelectLabel`,Le=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Pe(Ie,n);return(0,I.jsx)(p.div,{id:i.id,...r,ref:t})});Le.displayName=Ie;var Z=`SelectItem`,[Re,ze]=U(Z),Be=N.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:c,...l}=e,u=G(Z,n),d=Y(Z,n),f=u.value===r,[m,h]=N.useState(c??``),[g,_]=N.useState(!1),v=y(t,o(e=>d.itemRefCallback?.(e,r,i))),b=a(),x=N.useRef(`touch`),S=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};return(0,I.jsx)(Re,{scope:n,value:r,disabled:i,textId:b,isSelected:f,onItemTextChange:N.useCallback(e=>{h(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(B.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:(0,I.jsx)(p.div,{role:`option`,"aria-labelledby":b,"data-highlighted":g?``:void 0,"aria-selected":f&&g,"data-state":f?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...l,ref:v,onFocus:s(l.onFocus,()=>_(!0)),onBlur:s(l.onBlur,()=>_(!1)),onClick:s(l.onClick,()=>{x.current!==`mouse`&&S()}),onPointerUp:s(l.onPointerUp,()=>{x.current===`mouse`&&S()}),onPointerDown:s(l.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:s(l.onPointerMove,e=>{x.current=e.pointerType,i?d.onItemLeave?.():x.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:s(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:s(l.onKeyDown,e=>{i||e.target!==e.currentTarget||d.searchRef?.current!==``&&e.key===` `||(R.includes(e.key)&&S(),e.key===` `&&e.preventDefault())})})})})});Be.displayName=Z;var Q=`SelectItemText`,Ve=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,s=G(Q,n),c=Y(Q,n),l=ze(Q,n),d=K(Q,n),[f,m]=N.useState(null),h=o(e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),g=y(t,m,l.onItemTextChange,h),_=f?.textContent,v=N.useMemo(()=>(0,I.jsx)(`option`,{value:l.value,disabled:l.disabled,children:_},l.value),[l.disabled,l.value,_]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=d;return u(()=>(b(v),()=>x(v)),[b,x,v]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(p.span,{id:l.textId,...a,ref:g}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!$(s.value)?P.createPortal(a.children,s.valueNode):null]})});Ve.displayName=Q;var He=`SelectItemIndicator`,Ue=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return ze(He,n).isSelected?(0,I.jsx)(p.span,{"aria-hidden":!0,...r,ref:t}):null});Ue.displayName=He;var We=`SelectScrollUpButton`,Ge=N.forwardRef((e,t)=>{let n=Y(We,e.__scopeSelect),r=ke(We,e.__scopeSelect),[i,a]=N.useState(!1),o=y(t,r.onScrollButtonChange);return u(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(Je,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ge.displayName=We;var Ke=`SelectScrollDownButton`,qe=N.forwardRef((e,t)=>{let n=Y(Ke,e.__scopeSelect),r=ke(Ke,e.__scopeSelect),[i,a]=N.useState(!1),o=y(t,r.onScrollButtonChange);return u(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(Je,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});qe.displayName=Ke;var Je=N.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Y(`SelectScrollButton`,n),o=N.useRef(null),c=V(n),l=N.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return N.useEffect(()=>()=>l(),[l]),u(()=>{c().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[c]),(0,I.jsx)(p.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:s(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:s(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:s(i.onPointerLeave,()=>{l()})})}),Ye=`SelectSeparator`,Xe=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,I.jsx)(p.div,{"aria-hidden":!0,...r,ref:t})});Xe.displayName=Ye;var Ze=`SelectArrow`,Qe=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=W(n);return Y(Ze,n).position===`popper`?(0,I.jsx)(S,{...i,...r,ref:t}):null});Qe.displayName=Ze;var $e=`SelectBubbleInput`,et=N.forwardRef(({__scopeSelect:e,...t},n)=>{let r=G($e,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,m=N.useRef(null),h=y(n,m),g=i??``,_=A(g),v=Array.from(d).some(e=>(e.props.value??``)===``);return N.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(_!==g&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[_,g]),(0,I.jsxs)(p.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...k,...t.style},ref:h,defaultValue:g,children:[$(i)&&!v?(0,I.jsx)(`option`,{value:``}):null,Array.from(d)]},f)});et.displayName=$e;function tt(e){return typeof e==`function`}function $(e){return e===``||e===void 0}function nt(e){let t=o(e),n=N.useRef(``),r=N.useRef(0),i=N.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=N.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function rt(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=it(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 it(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var at=ce,ot=fe;function st({className:e,children:t,...n}){return(0,I.jsxs)(ue,{className:b(`flex h-8 w-full cursor-pointer items-center justify-between gap-2 px-2.5 [&>span]:truncate`,E,e),...n,children:[t,(0,I.jsx)(me,{asChild:!0,children:(0,I.jsx)(ee,{className:`size-3.5 shrink-0 text-fg-muted`})})]})}function ct({className:e,children:t,position:n=`popper`,...r}){return(0,I.jsx)(ve,{children:(0,I.jsx)(ye,{position:n,sideOffset:4,className:b(`z-50 max-h-72 min-w-[var(--radix-select-trigger-width)] max-w-[var(--radix-select-content-available-width)] overflow-y-auto rounded-md bg-elevated p-1 shadow-xl`,e),...r,children:(0,I.jsx)(je,{children:t})})})}function lt({className:e,children:t,detail:n,...r}){return(0,I.jsxs)(Be,{className:b(T,x,`py-1.5 pl-7 pr-2`,e),...r,children:[(0,I.jsx)(`span`,{className:`absolute left-2 flex size-3.5 items-center justify-center`,children:(0,I.jsx)(Ue,{children:(0,I.jsx)(M,{className:`size-3.5`})})}),(0,I.jsx)(Ve,{children:t}),n]})}export{ot as a,st as i,ct as n,M as o,lt as r,at as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{C as r,H as i,R as a,a as o,c as s,m as c,o as l,s as u,w as d}from"./auth-cjbSLnao.js";import{d as f}from"./index-CW1P_8TN.js";import{i as p,n as m}from"./dist-Cl5AP2As.js";import{t as h}from"./copy-Df7qIcX6.js";import{t as g}from"./x-DCpy1q13.js";import{t as _}from"./button-Chvl9hcE.js";import{t as v}from"./createLucideIcon-DyMAgLa3.js";import{t as y}from"./ws-B1kcYo2j.js";var b=v(`clipboard-paste`,[[`path`,{d:`M11 14h10`,key:`1w8e9d`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v1.344`,key:`1e62lh`}],[`path`,{d:`m17 18 4-4-4-4`,key:`z2g111`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113`,key:`bjbb7m`}],[`rect`,{x:`8`,y:`2`,width:`8`,height:`4`,rx:`1`,key:`ublpy`}]]),x=v(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);function ee(){return f.get()}var S=32,C=2048;function w(e,t,n){let r=e.getLine(t);if(!r)return null;let i=e.getNullCell(),a=``,o=[];for(let s=0;s<Math.min(n,r.length);s++){if(!r.getCell(s,i)||i.getWidth()===0)continue;if(s===n-1&&i.getChars()===``){let n=e.getLine(t+1);if(n?.isWrapped&&n.getCell(0)?.getWidth()===2)continue}let c=i.getChars()||` `;a+=c;for(let e=0;e<c.length;e++)o.push({row:t,col:s})}return{text:a,cells:o,isWrapped:r.isWrapped}}function te(e,t,n){return{...e,text:e.text.slice(t,n),cells:e.cells.slice(t,n)}}function T(e,t,n,r,i){if(t<0||n<1)return[];let a=Math.max(0,t-S+1),o=new Map;for(let r=a;r<t+S;r++){let t=w(e,r,n);if(!t)break;o.set(r,t)}let s=new Set,c=[];for(let l of[!0,!1])for(let u=a;u<=t;u++){if(o.get(u)?.isWrapped&&u>a)continue;let d=``,f=[];for(let a=u;a<u+S;a++){let p=o.get(a);if(!p)break;let m=o.get(a-1);if(a>u&&!p.isWrapped&&!(l&&m&&i(m,p,n,d)))break;let h=o.get(a+1),g=te(p,a>u&&!p.isWrapped?p.text.length-p.text.trimStart().length:0,h?.isWrapped?p.text.length:p.text.trimEnd().length);if(d.length+g.text.length>C)break;if(d+=g.text,f.push(...g.cells),!(a<t))for(let n of r(d)){let r=f[n.start],i=f[n.end-1];if(!r||!i||r.row>t||i.row<t)continue;let a=`${d.slice(n.start,n.end)}\0${r.row}:${r.col}-${i.row}:${i.col}`;if(s.has(a))continue;s.add(a);let o=e.getLine(i.row)?.getCell(i.col)?.getWidth()??1;c.push({candidate:n,start:r,end:{row:i.row,col:i.col+Math.max(1,o)-1},text:d.slice(n.start,n.end)})}}}return c.sort((e,t)=>t.text.length-e.text.length)}var ne=r.options.join(`,`),E=u.imageBytes,re=20*1024*1024;async function ie(e,t,n){n?.throwIfAborted();let i=r.safeParse(e.type);if(!i.success)throw Error(`Choose a PNG, JPEG, GIF or WebP image.`);if(e.size===0)throw Error(`This image is empty.`);if(e.size>re)throw Error(`Choose an image smaller than 20 MiB.`);if(!t||e.size<=E)return{blob:e,mime:i.data,resized:!1};if(i.data===`image/gif`)throw Error(`Choose a GIF no larger than 4 MiB for remote access.`);let a=await createImageBitmap(e);try{n?.throwIfAborted();let e=document.createElement(`canvas`),t=e.getContext(`2d`);if(!t)throw Error(`Could not prepare this image.`);let o=i.data===`image/jpeg`?`image/jpeg`:`image/webp`,s=Math.min(1,2048/Math.max(a.width,a.height));for(let i=0;i<8;i++){e.width=Math.max(1,Math.round(a.width*s)),e.height=Math.max(1,Math.round(a.height*s)),t.drawImage(a,0,0,e.width,e.height);for(let t of[.85,.7,.55]){let i=await new Promise(n=>e.toBlob(n,o,t));if(n?.throwIfAborted(),i&&i.size<=E)return{blob:i,mime:r.parse(i.type),resized:!0}}s*=.75}throw Error(`This image is too large to attach remotely. Choose a smaller image.`)}finally{a.close()}}var D=new WeakSet,ae=Math.floor((c.requestBytes-1024)*3/4);async function oe(e,t,n,r,o,c,l){let f=e.generation,p=()=>{if(c?.throwIfAborted(),o(),e.generation!==f)throw Error(`The connection changed; the image upload was interrupted.`)};if(p(),!n.size||n.size>u.imageBytes)throw Error(`The prepared image must be no larger than 4 MiB.`);if(D.has(e))throw Error(`An image upload is already in progress.`);D.add(e);let m=crypto.randomUUID(),h=`/api/worktrees/${t}/paste-upload`,g=!1,_=!1,v=async(t,n,r)=>{p();let a=await e.request(t,n,r,c),o=await a.json();if(p(),!a.ok){let e=i.safeParse(o);throw Error(e.success?e.data.error.message:`The image upload failed.`)}return o},y=e=>v(`POST`,h,e),b=async e=>{let t=new Uint8Array(await e.arrayBuffer());return p(),btoa(Array.from(t,e=>String.fromCharCode(e)).join(``))};try{let e=a.parse(await v(`GET`,`/api/version`));if(l?.(0,n.size),!e.remote_image_uploads){if(n.size>ae)throw Error(`Update the host connector to upload images larger than 191 KiB.`);let e=await b(n),i=d.parse(await v(`POST`,`/api/worktrees/${t}/paste`,{mime:r,data:e}));return l?.(n.size,n.size),i}if(g=!0,s.parse(await y({action:`start`,upload:m,mime:r,size:n.size})).received!==0)throw Error(`Invalid image upload acknowledgement.`);for(let e=0;e<n.size;e+=u.chunkBytes){let t=n.slice(e,e+u.chunkBytes),r=await b(t),i=s.parse(await y({action:`chunk`,upload:m,offset:e,data:r}));if(i.received!==e+t.size)throw Error(`Invalid image upload acknowledgement.`);l?.(i.received,n.size)}let i=d.parse(await y({action:`finish`,upload:m}));return _=!0,i}finally{if(g&&!_&&e.generation===f)try{o(),e.request(`POST`,h,{action:`cancel`,upload:m}).catch(()=>{})}catch{}D.delete(e)}}function O(e,t,n){if(t.startsWith(`login-`)||t===`home`)return!1;let r=Array.from(e.clipboardData?.items??[]);if(r.some(e=>e.type===`text/plain`))return!1;let i=r.find(e=>e.kind===`file`&&e.type.startsWith(`image/`));if(!i)return!1;let a=i.getAsFile();return a?(k(a,t,n).then(({resized:e})=>{e&&m(`Image resized for remote access`)}).catch(e=>{m.error(e instanceof Error?`Image paste failed: ${e.message}`:`Image paste failed`)}),!0):!1}async function k(e,t,n,r={}){if(t.startsWith(`login-`)||t===`home`)throw Error(`Open a project terminal to attach an image.`);let i=l(),a=i?.generation,o=()=>{if(l()!==i||i?.generation!==a||!y.isConnected())throw Error(`The terminal connection changed; the image was not inserted.`)};r.signal?.throwIfAborted(),o(),r.onProgress?.({stage:`preparing`});let{blob:s,mime:c,resized:u}=await ie(e,i!==null,r.signal);o();let f=i?await oe(i,t,s,c,o,r.signal,(e,t)=>r.onProgress?.(e===t?{stage:`saving`}:{stage:`uploading`,received:e,total:t})):await(async()=>{let e=await se(s);return o(),r.signal?.throwIfAborted(),d.parse(await p(`POST`,`/api/worktrees/${t}/paste`,{mime:c,data:e}))})();return r.signal?.throwIfAborted(),o(),r.onProgress?.({stage:`inserting`}),r.insert?r.insert(`${f.path} `):i?await i.input(t,n,`${f.path} `):y.write(t,n,`${f.path} `),{resized:u}}function se(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).replace(/^data:[^,]*,/,``)),r.onerror=()=>n(r.error??Error(`could not read the clipboard image`)),r.readAsDataURL(e)})}var A=/(?:^|[\s"'`([<])((?:(?:\/|\.{1,2}\/|~\/)(?:[\w.+@~-]+\/)*[\w.+@~-]+|(?:[\w.+@~-]+\/)+[\w.+@~-]*|[\w.+@~-]+\.[A-Za-z]\w{0,11}))(?::(\d{1,6})(?::(\d{1,6}))?)?/dg,ce=new Set([`.`,`,`,`;`,`:`,`)`,`]`,`'`,`"`]);function j(e){let t=[],n=new RegExp(A.source,A.flags),r;for(;r=n.exec(e);){let e=r.indices,n=r[1];if(!e?.[1]||n===void 0)continue;let i=e[1][0],a=e[1][1],o=n;for(o.startsWith(`@`)&&(o=o.slice(1),i++);o.length>0&&ce.has(o[o.length-1]);)o=o.slice(0,-1),a--;if(o.length===0)continue;let s=r[2]===void 0?void 0:Number.parseInt(r[2],10),c=r[3]===void 0?void 0:Number.parseInt(r[3],10),l=c!==void 0&&e[3]?e[3][1]:s!==void 0&&e[2]?e[2][1]:a;t.push({path:o,line:s,column:c,start:i,end:l})}return t}function le(e,t,n){let r=e.text.trimEnd(),i=t.text.trimStart();if(!/[\w.+@~/:-]$/.test(r)||!/^[\w.+@~:-]/.test(i)||/^(?:~\/|\.{1,2}\/)/.test(i))return!1;let a=e.cells[r.length-1];return r.endsWith(`/`)||a!==void 0&&a.col>=n-9}function ue(e,t,n){return T(e,t,n,j,le)}function de(e,t){return e.kind===`file`&&e.root!==void 0&&e.root!==t?e.root:null}var fe=class{fetcher;now;positiveTtlMs;negativeTtlMs;maxEntries;maxConcurrent;entries=new Map;inflight=new Map;inUse=0;waiters=[];constructor(e){this.fetcher=e.fetcher,this.now=e.now??Date.now,this.positiveTtlMs=e.positiveTtlMs??15e3,this.negativeTtlMs=e.negativeTtlMs??5e3,this.maxEntries=e.maxEntries??500,this.maxConcurrent=e.maxConcurrent??4}resolve(e,t,n){let r=`${e}\0${t}`,i=this.entries.get(r);if(i){if(this.now()<i.expiresAt)return Promise.resolve(i.value);this.entries.delete(r)}let a=this.inflight.get(r);if(a)return a;let o=this.withSlot(()=>this.fetcher(e,t,n)).then(e=>(this.store(r,e),e)).finally(()=>{this.inflight.delete(r)});return this.inflight.set(r,o),o}store(e,t){let n=t?this.positiveTtlMs:this.negativeTtlMs;for(this.entries.set(e,{value:t,expiresAt:this.now()+n});this.entries.size>this.maxEntries;){let e=this.entries.keys().next().value;if(e===void 0)break;this.entries.delete(e)}}async withSlot(e){this.inUse>=this.maxConcurrent&&await new Promise(e=>this.waiters.push(e)),this.inUse++;try{return await e()}finally{this.inUse--,this.waiters.shift()?.()}}};async function M(e,t,n,r){let i=new URLSearchParams({path:t});return n!==void 0&&i.set(`line`,String(n)),r!==void 0&&i.set(`root`,r),p(`GET`,`/api/worktrees/${e}/resolve?${i}`)}function N(e,t,n){let r=e.kind??`file`;return{kind:r,path:e.path,...e.root===void 0?{}:{root:e.root},...e.relative_path===void 0?{}:{relativePath:e.relative_path},...r===`file`&&t!==void 0?{line:Math.max(1,t)}:{},...r===`file`&&n!==void 0?{column:n}:{}}}async function pe(e,t,n){return N(await M(e,t,n?.line,n?.root),n?.line,n?.column)}async function P(e,t,n){try{return await M(e,t,n)}catch{return null}}function F(e,t,n){let r=new fe({fetcher:P});return e.registerLinkProvider({provideLinks(i,a){let o=e.buffer.active,s=ue(o,i-1,e.cols);if(s.length===0){a(void 0);return}Promise.all(s.map(async({candidate:e,start:i,end:a,text:o})=>{let s=await r.resolve(t,e.path,e.line);return s?{range:{start:{x:i.col+1,y:i.row+1},end:{x:a.col+1,y:a.row+1}},text:o,decorations:{underline:!0,pointerCursor:!0},activate:t=>{!t.metaKey&&!t.ctrlKey||n(N(s,e.line,e.column))}}:null})).then(e=>{let t=e.filter(e=>e!==null);a(t.length>0?t:void 0)})}})}var I=e(t(),1),L={ctrl:1,alt:2,shift:4},R=/^(?:\[[ABCD]|O[ABCD]|\[1;([2-8])[ABCD])$/,z=e=>e.startsWith(`\x1B`)?R.exec(e.slice(1)):null;function B(e){return!e.startsWith(`\x1B`)||e===`\x1B`||z(e)!==null||e===`\x1B[Z`}function me(e,t){if(!t)return e;let n=(t&L.ctrl)!==0,r=(t&L.alt)!==0,i=(t&L.shift)!==0,a=!!i|(r?2:0)|(n?4:0),o=z(e);if(o)return`\x1b[1;${1+(a|(o[1]?Number(o[1])-1:0))}${e.slice(-1)}`;if(!B(e))return e;if(e===` `||e===`\x1B[Z`)return i||e===`\x1B[Z`?`\x1B[Z`:` `;if(e===`\r`&&i)return`\x1b[13;${1+a}u`;if(i&&e.length===1){let t="`1234567890-=[]\\;',./".indexOf(e);t===-1?/[a-z]/.test(e)&&(e=e.toUpperCase()):e=`~!@#$%^&*()_+{}|:"<>?`[t]}if(n&&e.length===1){let t=e.toUpperCase().charCodeAt(0);t>=64&&t<=95?e=String.fromCharCode(t-64):e===` `?e=`\0`:e===`?`&&(e=``)}return r?`\x1b${e}`:e}function he(e){return e.length===3&&(e.startsWith(`\x1B[`)||e.startsWith(`\x1BO`))&&`ABCD`.includes(e[2])}var V=new Map,H=new Map,U=new Map,W=new Map,G=new Set,K=e=>(G.add(e),()=>{G.delete(e)}),q=()=>{for(let e of G)e()},J=(e,t)=>o(JSON.stringify([e,t]));function ge(e,t){return(0,I.useSyncExternalStore)(K,()=>V.has(J(e,t)))}function _e(e,t,n,r,i){let a=J(e,t);return V.set(a,n),r&&H.set(a,r),i?U.set(a,i):U.delete(a),q(),()=>{V.get(a)===n&&(V.delete(a),H.delete(a),U.delete(a),W.delete(a),q())}}function Y(e,t){H.get(J(e,t))?.()}function ve(e,t){return(0,I.useSyncExternalStore)(K,()=>W.get(J(e,t))??0)}function X(e,t,n){let r=J(e,t);W.set(r,(W.get(r)??0)^n),q()}function Z(e,t,n){let r=J(e,t),i=W.get(r)??0;return!i||!B(n)?n:(W.delete(r),q(),me(n,i))}async function ye(e,t,n,r=!1){let i=J(e,t),a=V.get(i);if(!a)throw Error(`Wait for the terminal to attach; nothing was sent`);let o=r?`${a(n)}\r`:Z(e,t,n);!r&&he(o)&&U.get(i)?.()&&(o=`\x1bO${o.slice(-1)}`),await Q(e,t,o)}async function be(e,t,n){let r=J(e,t),i=V.get(r),a=l(),o=a?.generation;if(!i||!n()||!y.isConnected())throw Error(`Wait for the terminal to attach; nothing was pasted.`);let s;try{let n=navigator.clipboard.readText();Y(e,t),s=await n}catch{throw Error(`Could not read the clipboard. Allow clipboard access or use your keyboard’s Paste action.`)}if(!n()||V.get(r)!==i||l()!==a||a?.generation!==o||!y.isConnected())throw Error(`The terminal changed; nothing was pasted. Try again in the active terminal.`);s&&await Q(e,t,i(s))}async function Q(e,t,n){let r=l();if(r)await r.input(e,t,n);else{if(!y.isConnected())throw Error(`Terminal is disconnected; nothing was sent`);y.write(e,t,n)}}var $=n();function xe({text:e,label:t,clear:n,paste:r}){let[i,a]=(0,I.useState)(!1);return(0,$.jsxs)(`div`,{role:`toolbar`,"aria-label":t,onPointerDown:e=>e.preventDefault(),className:`absolute right-2 top-2 z-20 flex gap-1 rounded-md bg-elevated p-1 shadow-lg`,children:[(0,$.jsxs)(_,{variant:`ghost`,size:`sm`,disabled:!e||i,onClick:async()=>{try{await navigator.clipboard.writeText(e),n()}catch{m.error(`Could not copy the selection. Try again.`)}},children:[(0,$.jsx)(h,{}),` Copy`]}),r&&(0,$.jsxs)(_,{variant:`ghost`,size:`sm`,disabled:i,onClick:async()=>{if(!i){a(!0);try{await r(),n()}catch(e){m.error(e instanceof Error?e.message:`Could not paste. Try again.`)}finally{a(!1)}}},children:[(0,$.jsx)(b,{}),` Paste`]}),(0,$.jsx)(_,{variant:`ghost`,size:`icon`,"aria-label":`Clear selection`,disabled:i,onClick:n,children:(0,$.jsx)(g,{})})]})}export{T as _,_e as a,x as b,ge as c,de as d,F as f,ne as g,k as h,be as i,ve as l,O as m,Z as n,ye as o,pe as p,Y as r,X as s,xe as t,L as u,w as v,ee as y};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{C as r,H as i,R as a,a as o,c as s,m as c,o as l,s as u,w as d}from"./auth-B4b-NPwe.js";import{d as f}from"./index-fldNIah5.js";import{i as p,n as m}from"./dist-Rswij5M_.js";import{t as h}from"./copy-DD43yC2P.js";import{t as g}from"./x-DCpy1q13.js";import{t as _}from"./button-Chvl9hcE.js";import{t as v}from"./createLucideIcon-DyMAgLa3.js";import{t as y}from"./ws-CT7jDKHs.js";var b=v(`clipboard-paste`,[[`path`,{d:`M11 14h10`,key:`1w8e9d`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v1.344`,key:`1e62lh`}],[`path`,{d:`m17 18 4-4-4-4`,key:`z2g111`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113`,key:`bjbb7m`}],[`rect`,{x:`8`,y:`2`,width:`8`,height:`4`,rx:`1`,key:`ublpy`}]]),x=v(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);function ee(){return f.get()}var S=32,C=2048;function w(e,t,n){let r=e.getLine(t);if(!r)return null;let i=e.getNullCell(),a=``,o=[];for(let s=0;s<Math.min(n,r.length);s++){if(!r.getCell(s,i)||i.getWidth()===0)continue;if(s===n-1&&i.getChars()===``){let n=e.getLine(t+1);if(n?.isWrapped&&n.getCell(0)?.getWidth()===2)continue}let c=i.getChars()||` `;a+=c;for(let e=0;e<c.length;e++)o.push({row:t,col:s})}return{text:a,cells:o,isWrapped:r.isWrapped}}function te(e,t,n){return{...e,text:e.text.slice(t,n),cells:e.cells.slice(t,n)}}function T(e,t,n,r,i){if(t<0||n<1)return[];let a=Math.max(0,t-S+1),o=new Map;for(let r=a;r<t+S;r++){let t=w(e,r,n);if(!t)break;o.set(r,t)}let s=new Set,c=[];for(let l of[!0,!1])for(let u=a;u<=t;u++){if(o.get(u)?.isWrapped&&u>a)continue;let d=``,f=[];for(let a=u;a<u+S;a++){let p=o.get(a);if(!p)break;let m=o.get(a-1);if(a>u&&!p.isWrapped&&!(l&&m&&i(m,p,n,d)))break;let h=o.get(a+1),g=te(p,a>u&&!p.isWrapped?p.text.length-p.text.trimStart().length:0,h?.isWrapped?p.text.length:p.text.trimEnd().length);if(d.length+g.text.length>C)break;if(d+=g.text,f.push(...g.cells),!(a<t))for(let n of r(d)){let r=f[n.start],i=f[n.end-1];if(!r||!i||r.row>t||i.row<t)continue;let a=`${d.slice(n.start,n.end)}\0${r.row}:${r.col}-${i.row}:${i.col}`;if(s.has(a))continue;s.add(a);let o=e.getLine(i.row)?.getCell(i.col)?.getWidth()??1;c.push({candidate:n,start:r,end:{row:i.row,col:i.col+Math.max(1,o)-1},text:d.slice(n.start,n.end)})}}}return c.sort((e,t)=>t.text.length-e.text.length)}var ne=r.options.join(`,`),E=u.imageBytes,re=20*1024*1024;async function ie(e,t,n){n?.throwIfAborted();let i=r.safeParse(e.type);if(!i.success)throw Error(`Choose a PNG, JPEG, GIF or WebP image.`);if(e.size===0)throw Error(`This image is empty.`);if(e.size>re)throw Error(`Choose an image smaller than 20 MiB.`);if(!t||e.size<=E)return{blob:e,mime:i.data,resized:!1};if(i.data===`image/gif`)throw Error(`Choose a GIF no larger than 4 MiB for remote access.`);let a=await createImageBitmap(e);try{n?.throwIfAborted();let e=document.createElement(`canvas`),t=e.getContext(`2d`);if(!t)throw Error(`Could not prepare this image.`);let o=i.data===`image/jpeg`?`image/jpeg`:`image/webp`,s=Math.min(1,2048/Math.max(a.width,a.height));for(let i=0;i<8;i++){e.width=Math.max(1,Math.round(a.width*s)),e.height=Math.max(1,Math.round(a.height*s)),t.drawImage(a,0,0,e.width,e.height);for(let t of[.85,.7,.55]){let i=await new Promise(n=>e.toBlob(n,o,t));if(n?.throwIfAborted(),i&&i.size<=E)return{blob:i,mime:r.parse(i.type),resized:!0}}s*=.75}throw Error(`This image is too large to attach remotely. Choose a smaller image.`)}finally{a.close()}}var D=new WeakSet,ae=Math.floor((c.requestBytes-1024)*3/4);async function oe(e,t,n,r,o,c,l){let f=e.generation,p=()=>{if(c?.throwIfAborted(),o(),e.generation!==f)throw Error(`The connection changed; the image upload was interrupted.`)};if(p(),!n.size||n.size>u.imageBytes)throw Error(`The prepared image must be no larger than 4 MiB.`);if(D.has(e))throw Error(`An image upload is already in progress.`);D.add(e);let m=crypto.randomUUID(),h=`/api/worktrees/${t}/paste-upload`,g=!1,_=!1,v=async(t,n,r)=>{p();let a=await e.request(t,n,r,c),o=await a.json();if(p(),!a.ok){let e=i.safeParse(o);throw Error(e.success?e.data.error.message:`The image upload failed.`)}return o},y=e=>v(`POST`,h,e),b=async e=>{let t=new Uint8Array(await e.arrayBuffer());return p(),btoa(Array.from(t,e=>String.fromCharCode(e)).join(``))};try{let e=a.parse(await v(`GET`,`/api/version`));if(l?.(0,n.size),!e.remote_image_uploads){if(n.size>ae)throw Error(`Update the host connector to upload images larger than 191 KiB.`);let e=await b(n),i=d.parse(await v(`POST`,`/api/worktrees/${t}/paste`,{mime:r,data:e}));return l?.(n.size,n.size),i}if(g=!0,s.parse(await y({action:`start`,upload:m,mime:r,size:n.size})).received!==0)throw Error(`Invalid image upload acknowledgement.`);for(let e=0;e<n.size;e+=u.chunkBytes){let t=n.slice(e,e+u.chunkBytes),r=await b(t),i=s.parse(await y({action:`chunk`,upload:m,offset:e,data:r}));if(i.received!==e+t.size)throw Error(`Invalid image upload acknowledgement.`);l?.(i.received,n.size)}let i=d.parse(await y({action:`finish`,upload:m}));return _=!0,i}finally{if(g&&!_&&e.generation===f)try{o(),e.request(`POST`,h,{action:`cancel`,upload:m}).catch(()=>{})}catch{}D.delete(e)}}function O(e,t,n){if(t.startsWith(`login-`)||t===`home`)return!1;let r=Array.from(e.clipboardData?.items??[]);if(r.some(e=>e.type===`text/plain`))return!1;let i=r.find(e=>e.kind===`file`&&e.type.startsWith(`image/`));if(!i)return!1;let a=i.getAsFile();return a?(k(a,t,n).then(({resized:e})=>{e&&m(`Image resized for remote access`)}).catch(e=>{m.error(e instanceof Error?`Image paste failed: ${e.message}`:`Image paste failed`)}),!0):!1}async function k(e,t,n,r={}){if(t.startsWith(`login-`)||t===`home`)throw Error(`Open a project terminal to attach an image.`);let i=l(),a=i?.generation,o=()=>{if(l()!==i||i?.generation!==a||!y.isConnected())throw Error(`The terminal connection changed; the image was not inserted.`)};r.signal?.throwIfAborted(),o(),r.onProgress?.({stage:`preparing`});let{blob:s,mime:c,resized:u}=await ie(e,i!==null,r.signal);o();let f=i?await oe(i,t,s,c,o,r.signal,(e,t)=>r.onProgress?.(e===t?{stage:`saving`}:{stage:`uploading`,received:e,total:t})):await(async()=>{let e=await se(s);return o(),r.signal?.throwIfAborted(),d.parse(await p(`POST`,`/api/worktrees/${t}/paste`,{mime:c,data:e}))})();return r.signal?.throwIfAborted(),o(),r.onProgress?.({stage:`inserting`}),r.insert?r.insert(`${f.path} `):i?await i.input(t,n,`${f.path} `):y.write(t,n,`${f.path} `),{resized:u}}function se(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).replace(/^data:[^,]*,/,``)),r.onerror=()=>n(r.error??Error(`could not read the clipboard image`)),r.readAsDataURL(e)})}var A=/(?:^|[\s"'`([<])((?:(?:\/|\.{1,2}\/|~\/)(?:[\w.+@~-]+\/)*[\w.+@~-]+|(?:[\w.+@~-]+\/)+[\w.+@~-]*|[\w.+@~-]+\.[A-Za-z]\w{0,11}))(?::(\d{1,6})(?::(\d{1,6}))?)?/dg,ce=new Set([`.`,`,`,`;`,`:`,`)`,`]`,`'`,`"`]);function j(e){let t=[],n=new RegExp(A.source,A.flags),r;for(;r=n.exec(e);){let e=r.indices,n=r[1];if(!e?.[1]||n===void 0)continue;let i=e[1][0],a=e[1][1],o=n;for(o.startsWith(`@`)&&(o=o.slice(1),i++);o.length>0&&ce.has(o[o.length-1]);)o=o.slice(0,-1),a--;if(o.length===0)continue;let s=r[2]===void 0?void 0:Number.parseInt(r[2],10),c=r[3]===void 0?void 0:Number.parseInt(r[3],10),l=c!==void 0&&e[3]?e[3][1]:s!==void 0&&e[2]?e[2][1]:a;t.push({path:o,line:s,column:c,start:i,end:l})}return t}function le(e,t,n){let r=e.text.trimEnd(),i=t.text.trimStart();if(!/[\w.+@~/:-]$/.test(r)||!/^[\w.+@~:-]/.test(i)||/^(?:~\/|\.{1,2}\/)/.test(i))return!1;let a=e.cells[r.length-1];return r.endsWith(`/`)||a!==void 0&&a.col>=n-9}function ue(e,t,n){return T(e,t,n,j,le)}function de(e,t){return e.kind===`file`&&e.root!==void 0&&e.root!==t?e.root:null}var fe=class{fetcher;now;positiveTtlMs;negativeTtlMs;maxEntries;maxConcurrent;entries=new Map;inflight=new Map;inUse=0;waiters=[];constructor(e){this.fetcher=e.fetcher,this.now=e.now??Date.now,this.positiveTtlMs=e.positiveTtlMs??15e3,this.negativeTtlMs=e.negativeTtlMs??5e3,this.maxEntries=e.maxEntries??500,this.maxConcurrent=e.maxConcurrent??4}resolve(e,t,n){let r=`${e}\0${t}`,i=this.entries.get(r);if(i){if(this.now()<i.expiresAt)return Promise.resolve(i.value);this.entries.delete(r)}let a=this.inflight.get(r);if(a)return a;let o=this.withSlot(()=>this.fetcher(e,t,n)).then(e=>(this.store(r,e),e)).finally(()=>{this.inflight.delete(r)});return this.inflight.set(r,o),o}store(e,t){let n=t?this.positiveTtlMs:this.negativeTtlMs;for(this.entries.set(e,{value:t,expiresAt:this.now()+n});this.entries.size>this.maxEntries;){let e=this.entries.keys().next().value;if(e===void 0)break;this.entries.delete(e)}}async withSlot(e){this.inUse>=this.maxConcurrent&&await new Promise(e=>this.waiters.push(e)),this.inUse++;try{return await e()}finally{this.inUse--,this.waiters.shift()?.()}}};async function M(e,t,n,r){let i=new URLSearchParams({path:t});return n!==void 0&&i.set(`line`,String(n)),r!==void 0&&i.set(`root`,r),p(`GET`,`/api/worktrees/${e}/resolve?${i}`)}function N(e,t,n){let r=e.kind??`file`;return{kind:r,path:e.path,...e.root===void 0?{}:{root:e.root},...e.relative_path===void 0?{}:{relativePath:e.relative_path},...r===`file`&&t!==void 0?{line:Math.max(1,t)}:{},...r===`file`&&n!==void 0?{column:n}:{}}}async function pe(e,t,n){return N(await M(e,t,n?.line,n?.root),n?.line,n?.column)}async function P(e,t,n){try{return await M(e,t,n)}catch{return null}}function F(e,t,n){let r=new fe({fetcher:P});return e.registerLinkProvider({provideLinks(i,a){let o=e.buffer.active,s=ue(o,i-1,e.cols);if(s.length===0){a(void 0);return}Promise.all(s.map(async({candidate:e,start:i,end:a,text:o})=>{let s=await r.resolve(t,e.path,e.line);return s?{range:{start:{x:i.col+1,y:i.row+1},end:{x:a.col+1,y:a.row+1}},text:o,decorations:{underline:!0,pointerCursor:!0},activate:t=>{!t.metaKey&&!t.ctrlKey||n(N(s,e.line,e.column))}}:null})).then(e=>{let t=e.filter(e=>e!==null);a(t.length>0?t:void 0)})}})}var I=e(t(),1),L={ctrl:1,alt:2,shift:4},R=/^(?:\[[ABCD]|O[ABCD]|\[1;([2-8])[ABCD])$/,z=e=>e.startsWith(`\x1B`)?R.exec(e.slice(1)):null;function B(e){return!e.startsWith(`\x1B`)||e===`\x1B`||z(e)!==null||e===`\x1B[Z`}function me(e,t){if(!t)return e;let n=(t&L.ctrl)!==0,r=(t&L.alt)!==0,i=(t&L.shift)!==0,a=!!i|(r?2:0)|(n?4:0),o=z(e);if(o)return`\x1b[1;${1+(a|(o[1]?Number(o[1])-1:0))}${e.slice(-1)}`;if(!B(e))return e;if(e===` `||e===`\x1B[Z`)return i||e===`\x1B[Z`?`\x1B[Z`:` `;if(e===`\r`&&i)return`\x1b[13;${1+a}u`;if(i&&e.length===1){let t="`1234567890-=[]\\;',./".indexOf(e);t===-1?/[a-z]/.test(e)&&(e=e.toUpperCase()):e=`~!@#$%^&*()_+{}|:"<>?`[t]}if(n&&e.length===1){let t=e.toUpperCase().charCodeAt(0);t>=64&&t<=95?e=String.fromCharCode(t-64):e===` `?e=`\0`:e===`?`&&(e=``)}return r?`\x1b${e}`:e}function he(e){return e.length===3&&(e.startsWith(`\x1B[`)||e.startsWith(`\x1BO`))&&`ABCD`.includes(e[2])}var V=new Map,H=new Map,U=new Map,W=new Map,G=new Set,K=e=>(G.add(e),()=>{G.delete(e)}),q=()=>{for(let e of G)e()},J=(e,t)=>o(JSON.stringify([e,t]));function ge(e,t){return(0,I.useSyncExternalStore)(K,()=>V.has(J(e,t)))}function _e(e,t,n,r,i){let a=J(e,t);return V.set(a,n),r&&H.set(a,r),i?U.set(a,i):U.delete(a),q(),()=>{V.get(a)===n&&(V.delete(a),H.delete(a),U.delete(a),W.delete(a),q())}}function Y(e,t){H.get(J(e,t))?.()}function ve(e,t){return(0,I.useSyncExternalStore)(K,()=>W.get(J(e,t))??0)}function X(e,t,n){let r=J(e,t);W.set(r,(W.get(r)??0)^n),q()}function Z(e,t,n){let r=J(e,t),i=W.get(r)??0;return!i||!B(n)?n:(W.delete(r),q(),me(n,i))}async function ye(e,t,n,r=!1){let i=J(e,t),a=V.get(i);if(!a)throw Error(`Wait for the terminal to attach; nothing was sent`);let o=r?`${a(n)}\r`:Z(e,t,n);!r&&he(o)&&U.get(i)?.()&&(o=`\x1bO${o.slice(-1)}`),await Q(e,t,o)}async function be(e,t,n){let r=J(e,t),i=V.get(r),a=l(),o=a?.generation;if(!i||!n()||!y.isConnected())throw Error(`Wait for the terminal to attach; nothing was pasted.`);let s;try{let n=navigator.clipboard.readText();Y(e,t),s=await n}catch{throw Error(`Could not read the clipboard. Allow clipboard access or use your keyboard’s Paste action.`)}if(!n()||V.get(r)!==i||l()!==a||a?.generation!==o||!y.isConnected())throw Error(`The terminal changed; nothing was pasted. Try again in the active terminal.`);s&&await Q(e,t,i(s))}async function Q(e,t,n){let r=l();if(r)await r.input(e,t,n);else{if(!y.isConnected())throw Error(`Terminal is disconnected; nothing was sent`);y.write(e,t,n)}}var $=n();function xe({text:e,label:t,clear:n,paste:r}){let[i,a]=(0,I.useState)(!1);return(0,$.jsxs)(`div`,{role:`toolbar`,"aria-label":t,onPointerDown:e=>e.preventDefault(),className:`absolute right-2 top-2 z-20 flex gap-1 rounded-md bg-elevated p-1 shadow-lg`,children:[(0,$.jsxs)(_,{variant:`ghost`,size:`sm`,disabled:!e||i,onClick:async()=>{try{await navigator.clipboard.writeText(e),n()}catch{m.error(`Could not copy the selection. Try again.`)}},children:[(0,$.jsx)(h,{}),` Copy`]}),r&&(0,$.jsxs)(_,{variant:`ghost`,size:`sm`,disabled:i,onClick:async()=>{if(!i){a(!0);try{await r(),n()}catch(e){m.error(e instanceof Error?e.message:`Could not paste. Try again.`)}finally{a(!1)}}},children:[(0,$.jsx)(b,{}),` Paste`]}),(0,$.jsx)(_,{variant:`ghost`,size:`icon`,"aria-label":`Clear selection`,disabled:i,onClick:n,children:(0,$.jsx)(g,{})})]})}export{T as _,_e as a,x as b,ge as c,de as d,F as f,ne as g,k as h,be as i,ve as l,O as m,Z as n,ye as o,pe as p,Y as r,X as s,xe as t,L as u,w as v,ee as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{F as r}from"./auth-B4b-NPwe.js";import{a as i,g as a,h as o,p as s}from"./es2015-CrC2hHeB.js";import{c,n as l}from"./x-DCpy1q13.js";import{f as u}from"./input-Dx89yXF4.js";import{t as d}from"./dist-BCwJL3w9.js";import{t as f}from"./createLucideIcon-DyMAgLa3.js";var p=f(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),m=f(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),h=f(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),g=f(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),_=f(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),v=e(t(),1),y=new Set;function b(e){let t=/^#settings\/([\w-]+)$/.exec(e);return t?t[1]:null}var x=b(window.location.hash);function S(){let e=x?`#settings/${x}`:``;window.location.hash!==e&&history.replaceState(null,``,window.location.pathname+window.location.search+e)}function C(e){if(e!==x){x=e;for(let e of y)e()}queueMicrotask(S)}window.addEventListener(`hashchange`,()=>C(b(window.location.hash))),window.addEventListener(`popstate`,()=>C(b(window.location.hash)));function w(){return(0,v.useSyncExternalStore)(e=>(y.add(e),()=>{y.delete(e)}),()=>x)}function T(e=`appearance`){C(e)}function E(){C(null)}function D(e){return e.title??e.agent_title??e.osc_title??e.id.slice(0,8)}var O=` — `;function k(e){return e.replace(/\/+$/,``).split(`/`).pop()??``}function A(e){return{name:D(e),title:e.title??``,agentName:e.agent_title??``,sequence:e.osc_title??``,branch:e.branch,cwd:k(e.worktree_path),id:e.id.slice(0,8),status:e.status,agent:e.agent_type??``}}function j(e,t){let n=t&&t.length>0?t:r,i=A(e),a=[];for(let e of n.split(/(\$\{[a-zA-Z]+\})/)){if(e===``)continue;let t=/^\$\{([a-zA-Z]+)\}$/.exec(e)?.[1];t===void 0?a.push({text:e,sep:!1}):t===`separator`?a.push({text:O,sep:!0}):a.push({text:i[t]??e,sep:!1})}let o=[];a.forEach((e,t)=>{if(!e.sep){o.push(e.text);return}let n=o.join(``).trim().length>0,r=a.slice(t+1).some(e=>!e.sep&&e.text.trim().length>0);n&&r&&o.push(e.text)});let s=o.join(``).trim();return s.length>0?s:e.id.slice(0,8)}var M=n(),N=`Switch`,[P,F]=o(N),[I,L]=P(N);function R(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:a,disabled:o,form:s,name:c,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=i({prop:n,defaultProp:a??!1,onChange:l,caller:N}),[h,g]=v.useState(null),[_,y]=v.useState(null),b={checked:p,setChecked:m,disabled:o,control:h,setControl:g,name:c,form:s,value:d,hasConsumerStoppedPropagationRef:v.useRef(!1),required:u,defaultChecked:a,isFormControl:!h||!!s||!!h.closest(`form`),bubbleInput:_,setBubbleInput:y};return(0,M.jsx)(I,{scope:t,...b,children:K(f)?f(b):r})}var z=`SwitchTrigger`,B=v.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{let{control:i,form:o,value:l,disabled:u,checked:d,required:f,setControl:p,setChecked:m,hasConsumerStoppedPropagationRef:h,isFormControl:g,bubbleInput:_}=L(z,e),y=c(r,p),b=v.useRef(d);return v.useEffect(()=>{let e=o?i?.ownerDocument.getElementById(o):i?.form;if(e instanceof HTMLFormElement){let t=()=>m(b.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,o,m]),(0,M.jsx)(s.button,{type:`button`,role:`switch`,"aria-checked":d,"aria-required":f,"data-state":q(d),"data-disabled":u?``:void 0,disabled:u,value:l,...n,ref:y,onClick:a(t,e=>{m(e=>!e),_&&g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})})});B.displayName=z;var V=v.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,M.jsx)(R,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(B,{...d,ref:t,__scopeSwitch:n}),e&&(0,M.jsx)(G,{__scopeSwitch:n})]})})});V.displayName=N;var H=`SwitchThumb`,U=v.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=L(H,n);return(0,M.jsx)(s.span,{"data-state":q(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});U.displayName=H;var W=`SwitchBubbleInput`,G=v.forwardRef(({__scopeSwitch:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:l,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=L(W,e),y=c(n,_),b=d(a),x=u(r);v.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(b!==a&&n){let t=new Event(`click`,{bubbles:r});n.call(e,a),e.dispatchEvent(t)}},[g,b,a,i]);let S=v.useRef(a);return(0,M.jsx)(s.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??S.current,required:l,disabled:f,name:p,value:m,form:h,...t,tabIndex:-1,ref:y,style:{...t.style,...x,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});G.displayName=W;function K(e){return typeof e==`function`}function q(e){return e?`checked`:`unchecked`}function J({className:e,...t}){return(0,M.jsx)(V,{className:l(`peer group/switch inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,M.jsx)(`span`,{className:`pointer-events-none inline-flex h-5 w-9 shrink-0 items-center rounded-full bg-border transition-colors group-hover/switch:bg-border/70 group-data-[state=checked]/switch:bg-action`,children:(0,M.jsx)(U,{className:`block size-4 rounded-full bg-ground shadow-sm transition-transform data-[state=checked]:translate-x-[1.125rem] data-[state=unchecked]:translate-x-0.5`})})})}export{w as a,h as c,T as i,m as l,j as n,_ as o,E as r,g as s,J as t,p as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{O as r}from"./auth-B4b-NPwe.js";import{A as i,M as a,P as o,_t as s}from"./protocol-support-Q_1mBit9.js";import{a as c,c as l,g as u,h as d,o as f,p,s as ee,u as m}from"./es2015-CrC2hHeB.js";import{c as h,n as g,o as _}from"./x-DCpy1q13.js";import{c as v,d as y,l as te,s as b,u as ne}from"./input-Dx89yXF4.js";import{i as x}from"./dist-BCwJL3w9.js";import{t as S}from"./createLucideIcon-DyMAgLa3.js";import{n as re,s as ie}from"./switch-CeNFnG6w.js";import{a as C,n as ae,o as w}from"./preview-kind-CJ9RTgbs.js";import{t as oe}from"./debounce-B9DrqirV.js";var T=e(t(),1),E=n(),[D,se]=d(`Tooltip`,[y]),O=y(),ce=`TooltipProvider`,le=700,k=`tooltip.open`,[ue,A]=D(ce),de=e=>{let{__scopeTooltip:t,delayDuration:n=le,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=T.useRef(!0),s=T.useRef(!1),c=T.useRef(0);return T.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,E.jsx)(ue,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:T.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:T.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:T.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};de.displayName=ce;var j=`Tooltip`,[fe,M]=D(j),pe=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,u=A(j,e.__scopeTooltip),d=O(t),[f,p]=T.useState(null),ee=l(),m=T.useRef(0),h=o??u.disableHoverableContent,g=s??u.delayDuration,_=T.useRef(!1),[v,y]=c({prop:r,defaultProp:i??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(k))):u.onClose(),a?.(e)},caller:j}),te=T.useMemo(()=>v?_.current?`delayed-open`:`instant-open`:`closed`,[v]),b=T.useCallback(()=>{window.clearTimeout(m.current),m.current=0,_.current=!1,y(!0)},[y]),x=T.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),S=T.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{_.current=!0,y(!0),m.current=0},g)},[g,y]);return T.useEffect(()=>()=>{m.current&&=(window.clearTimeout(m.current),0)},[]),(0,E.jsx)(ne,{...d,children:(0,E.jsx)(fe,{scope:t,contentId:ee,open:v,stateAttribute:te,trigger:f,onTriggerChange:p,onTriggerEnter:T.useCallback(()=>{u.isOpenDelayedRef.current?S():b()},[u.isOpenDelayedRef,S,b]),onTriggerLeave:T.useCallback(()=>{h?x():(window.clearTimeout(m.current),m.current=0)},[x,h]),onOpen:b,onClose:x,disableHoverableContent:h,children:n})})};pe.displayName=j;var N=`TooltipTrigger`,me=T.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=M(N,n),a=A(N,n),o=O(n),s=h(t,T.useRef(null),i.onTriggerChange),c=T.useRef(!1),l=T.useRef(!1),d=T.useCallback(()=>c.current=!1,[]);return T.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,E.jsx)(b,{asChild:!0,...o,children:(0,E.jsx)(p.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:u(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:u(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:u(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:u(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:u(e.onBlur,i.onClose),onClick:u(e.onClick,i.onClose)})})});me.displayName=N;var P=`TooltipPortal`,[he,ge]=D(P,{forceMount:void 0}),_e=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=M(P,t);return(0,E.jsx)(he,{scope:t,forceMount:n,children:(0,E.jsx)(f,{present:n||a.open,children:(0,E.jsx)(ee,{asChild:!0,container:i,children:r})})})};_e.displayName=P;var F=`TooltipContent`,ve=T.forwardRef((e,t)=>{let n=ge(F,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=M(F,e.__scopeTooltip);return(0,E.jsx)(f,{present:r||o.open,children:o.disableHoverableContent?(0,E.jsx)(Ce,{side:i,...a,ref:t}):(0,E.jsx)(ye,{side:i,...a,ref:t})})}),ye=T.forwardRef((e,t)=>{let n=M(F,e.__scopeTooltip),r=A(F,e.__scopeTooltip),i=T.useRef(null),a=h(t,i),[o,s]=T.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=T.useCallback(()=>{s(null),d(!1)},[d]),p=T.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=De(r,Ee(r,n.getBoundingClientRect())),a=Oe(t.getBoundingClientRect()),o=Ae([...i,...a]);s(o),d(!0)},[d]);return T.useEffect(()=>()=>f(),[f]),T.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),T.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!ke(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,E.jsx)(Ce,{...e,ref:a})}),[be,xe]=D(j,{isInside:!1}),Se=_(`TooltipContent`),Ce=T.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=M(F,n),l=O(n),{onClose:u}=c;return T.useEffect(()=>(document.addEventListener(k,u),()=>document.removeEventListener(k,u)),[u]),T.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,E.jsx)(m,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,E.jsxs)(te,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,E.jsx)(Se,{children:r}),(0,E.jsx)(be,{scope:n,isInside:!0,children:(0,E.jsx)(x,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});ve.displayName=F;var we=`TooltipArrow`,Te=T.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=O(n);return xe(we,n).isInside?null:(0,E.jsx)(v,{...i,...r,ref:t})});Te.displayName=we;function Ee(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function De(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Oe(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ke(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Ae(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),je(t)}function je(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Me=de,Ne=pe,Pe=me,Fe=_e,Ie=ve,Le=Me,Re=Ne,ze=Pe;function Be({className:e,sideOffset:t=4,...n}){return(0,E.jsx)(Fe,{children:(0,E.jsx)(Ie,{sideOffset:t,className:g(`z-50 overflow-hidden rounded-md bg-elevated px-2 py-1 text-xs text-fg shadow-lg`,e),...n})})}var Ve=S(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);function He({initial:e,maxLength:t,className:n,onCommit:r,onCancel:i}){let[a,o]=(0,T.useState)(e);return(0,E.jsx)(`input`,{autoFocus:!0,value:a,maxLength:t,onFocus:e=>e.currentTarget.select(),onChange:e=>o(e.target.value),onBlur:()=>r(a),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?r(a):e.key===`Escape`&&i()},className:g(`bg-transparent outline-none`,n)})}function Ue(e){return{onClick:e=>{e.detail===2&&e.preventDefault()},onDoubleClick:t=>{t.preventDefault(),e()}}}var I=null;function We(e){return I=e,()=>{I===e&&(I=null)}}function Ge(){I?.()}var L=null;function Ke(e){return L=e,()=>{L===e&&(L=null)}}async function qe(e){if(!L)throw Error(`Open a project before opening a path.`);await L(e)}function Je(){let e=s(i()??void 0).data?.tabTitleTemplate;return(0,T.useCallback)(t=>re(t,e),[e])}var Ye=(0,T.createContext)({open:()=>void 0,handler:null,setHandler:()=>void 0});function Xe({children:e}){let[t,n]=(0,T.useState)(null),r=(0,T.useCallback)(e=>n(()=>e),[]),i=(0,T.useCallback)(e=>t?.(e),[t]),a=(0,T.useMemo)(()=>({open:i,handler:t,setHandler:r}),[i,t,r]);return(0,E.jsx)(Ye.Provider,{value:a,children:e})}function Ze(){return(0,T.useContext)(Ye)}function Qe({className:e,strokeScale:t=1}){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.8*t,strokeLinecap:`round`,"aria-hidden":!0,children:[(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`22`,y2:`12`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17`,y2:`20.66`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`7`,y2:`20.66`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`2`,y2:`12`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`7`,y2:`3.34`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17`,y2:`3.34`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17.63`,y2:`15.25`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`18.5`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6.37`,y2:`15.25`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6.37`,y2:`8.75`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`5.5`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17.63`,y2:`8.75`})]})}function $e({className:e,strokeScale:t=1}){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.6*t,"aria-hidden":!0,children:[(0,E.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`}),(0,E.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`,transform:`rotate(60 12 12)`}),(0,E.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`,transform:`rotate(120 12 12)`})]})}function et({className:e,strokeScale:t=1}){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.8*t,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,E.jsx)(`path`,{d:`M8 4H4v16h4`}),(0,E.jsx)(`path`,{d:`M16 4h4v16h-4`}),(0,E.jsx)(`rect`,{x:`10.5`,y:`10.5`,width:`3`,height:`3`,fill:`currentColor`,stroke:`none`})]})}function tt({className:e}){return(0,E.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`currentColor`,"aria-hidden":!0,children:(0,E.jsx)(`path`,{d:`M12 1.5c0 5.8 4.7 10.5 10.5 10.5C16.7 12 12 16.7 12 22.5 12 16.7 7.3 12 1.5 12 7.3 12 12 7.3 12 1.5Z`})})}function nt({type:e,className:t,strokeScale:n=1}){switch(e){case`claude-code`:return(0,E.jsx)(Qe,{className:t,strokeScale:n});case`codex`:return(0,E.jsx)($e,{className:t,strokeScale:n});case`opencode`:return(0,E.jsx)(et,{className:t,strokeScale:n});case`gemini-cli`:return(0,E.jsx)(tt,{className:t});default:return(0,E.jsx)(ie,{className:t,strokeWidth:2*n})}}var R=new Set,z=!1,rt=null;function it(){for(let e of R)e()}function at(e){return R.add(e),()=>R.delete(e)}function ot(e){z!==e&&(z=e,it())}function st(){ot(!z)}function ct(){return(0,T.useSyncExternalStore)(at,()=>z)}function lt(e){rt=e,it()}function ut(){return(0,T.useSyncExternalStore)(at,()=>rt)}function B(){return crypto.randomUUID()}function V(e){return e.type===`terminal`?`term:${e.session}`:`editor:${C(e.tab)}`}function H(e,t){return V(e)===V(t)}function dt(e){return e.type===`terminal`}function ft(e){return e.type===`editor`&&(e.tab.view===`linked`||e.tab.view===`locked`)}function U(e=[],t){let n=e.map(V),r=t&&n.includes(t)?t:n.length>0?n[0]:null;return{kind:`leaf`,id:B(),tabs:e,activeKey:r,previewKey:null}}function W(e,t,n){return{kind:`split`,id:B(),direction:e,children:t,sizes:n??t.map(()=>100/Math.max(1,t.length))}}function G(e,t){if(e.kind===`leaf`)return e.id===t?e:null;for(let n of e.children){let e=G(n,t);if(e)return e}return null}function K(e,t){if(e.kind===`leaf`)return e.tabs.some(e=>V(e)===t)?e:null;for(let n of e.children){let e=K(n,t);if(e)return e}return null}function q(e){return e.kind===`leaf`?[e]:e.children.flatMap(q)}function J(e){return q(e).flatMap(e=>e.tabs)}function pt(e){return e.kind===`leaf`?[e.id]:[e.id,...e.children.flatMap(pt)]}function mt(e){let t=pt(e);return new Set(t).size!==t.length}function ht(e){return e.kind===`leaf`?{...e,id:B()}:{...e,id:B(),children:e.children.map(ht)}}function gt(e){if(!mt(e))return e;let t=new Set,n=e=>{let r=t.has(e.id)?B():e.id;return t.add(r),e.kind===`leaf`?{...e,id:r}:{...e,id:r,children:e.children.map(n)}};return n(e)}function _t(e){let t=e.tabs.map(V),n=e.activeKey&&t.includes(e.activeKey)?e.activeKey:t[0]??null,r=e.previewKey&&t.includes(e.previewKey)?e.previewKey:null;return n===e.activeKey&&r===(e.previewKey??null)?e:{...e,activeKey:n,previewKey:r}}function Y(e){if(e.kind===`leaf`)return _t(e);let t=e.children.map(Y),n=[],r=[];t.forEach((t,i)=>{let a=e.sizes[i]??1;if(t.kind===`split`&&t.direction===e.direction){let e=t.sizes.reduce((e,t)=>e+t,0)||t.children.length;t.children.forEach((i,o)=>{n.push(i),r.push(a*(t.sizes[o]??1)/e)})}else n.push(t),r.push(a)});let i=[],a=[];return n.forEach((e,t)=>{e.kind===`leaf`&&e.tabs.length===0||(i.push(e),a.push(r[t]??1))}),i.length===0?U([]):i.length===1?i[0]:{...e,children:i,sizes:a}}function X(e,t,n){return e.kind===`leaf`?e.id===t?n(e):e:{...e,children:e.children.map(e=>X(e,t,n))}}function vt(e,t,n){return X(e,t,e=>{if(!e.tabs.some(e=>V(e)===n))return e;let t=e.tabs.filter(e=>V(e)!==n),r=e.activeKey===n?yt(e,n):e.activeKey;return{...e,tabs:t,activeKey:r}})}function yt(e,t){let n=e.tabs.findIndex(e=>V(e)===t);if(n===-1)return e.activeKey;let r=e.tabs.filter(e=>V(e)!==t);return r.length===0?null:V(r[Math.min(n,r.length-1)])}function bt(e,t,n){let r=e.tabs.filter(e=>!H(e,t)),i=n===void 0?r.length:Math.max(0,Math.min(n,r.length)),a=[...r.slice(0,i),t,...r.slice(i)];return{...e,tabs:a,activeKey:V(t)}}function xt(e,t,n,r){let i=n===`left`||n===`right`?`row`:`col`,a=n===`left`||n===`top`;return Y(X(e,t,e=>{let t=U([r]);return W(i,a?[t,e]:[e,t],[50,50])}))}function St(e,t){let{ref:n,toLeafId:r,edge:i}=t,a=V(n),o=t.copy===!0&&!dt(n),s=t.index;if(i===`center`&&s!==void 0){let t=G(e,r)?.tabs.findIndex(e=>V(e)===a)??-1;t!==-1&&t<s&&--s}let c=o?e:vt(e,t.fromLeafId,a);if(i===`center`){let e=X(c,r,e=>bt(e,n,s));return!G(e,r)&&!K(e,a)?Z(Y(Ct(e,n)),a):Z(Y(e),a)}return G(c,r)?Z(xt(c,r,i,n),a):Y(U([n]))}function Ct(e,t){let n=q(e)[0];return n?X(e,n.id,e=>bt(e,t)):U([t])}function wt(e,t,n){return Y(X(e,t,e=>e.tabs.some(e=>V(e)===n)?{...e,tabs:e.tabs.filter(e=>V(e)!==n),activeKey:e.activeKey===n?yt(e,n):e.activeKey}:e))}function Tt(e,t,n){let r=V(n);return Y(X(e,t,e=>{let t=e.previewKey===r?null:e.previewKey;return e.tabs.some(e=>H(e,n))?{...e,activeKey:r,previewKey:t}:{...e,tabs:[...e.tabs,n],activeKey:r,previewKey:t}}))}function Et(e,t,n){let r=V(n);return Y(X(e,t,e=>e.tabs.some(e=>V(e)===r)?{...e,tabs:e.tabs.map(e=>V(e)===r?n:e),previewKey:e.previewKey===r?null:e.previewKey}:{...e,tabs:[...e.tabs,n]}))}function Dt(e,t,n){let r=V(n);return X(e,t,e=>({...e,tabs:e.tabs.map(e=>V(e)===r?n:e)}))}function Ot(e,t,n){let r=C(t),i=e=>e.kind===`split`?{...e,children:e.children.map(i)}:{...e,tabs:e.tabs.map(e=>e.type===`editor`&&C(e.tab)===r?{...e,tab:{...e.tab,compile_mode:n}}:e)};return i(e)}function kt(e,t){return e.type!==`editor`||t.type!==`editor`||e.tab.view!==`preview`||t.tab.view!==void 0||ae(t.tab.path)===null?t:{...t,tab:{...t.tab,view:`preview`}}}function At(e,t,n){let r=V(n);return Y(X(e,t,e=>{if(e.tabs.some(e=>H(e,n)))return{...e,activeKey:r};let t=e.previewKey?e.tabs.findIndex(t=>V(t)===e.previewKey):-1,i=t>=0?e.tabs[t]:void 0,a=i!==void 0&&!dt(i)&&!ft(i),o=a?kt(i,n):n,s=a?e.tabs.map((e,n)=>n===t?o:e):[...e.tabs,o];return{...e,tabs:s,activeKey:r,previewKey:r}}))}function Z(e,t){let n=e=>e.kind===`leaf`?e.previewKey===t?{...e,previewKey:null}:e:{...e,children:e.children.map(n)};return n(e)}function jt(e,t,n,r){return X(e,t,e=>{let t=e.tabs.findIndex(e=>e.type===`editor`&&V(e)===n),i=t>=0?e.tabs[t]:void 0;if(i===void 0||i.type!==`editor`)return e;let a={...i,tab:{...i.tab,view:r}},o=V(a);if(o===n)return{...e,tabs:e.tabs.map((e,n)=>n===t?a:e)};let s=e.tabs.some((e,n)=>n!==t&&V(e)===o),c=s?e.tabs.filter((e,n)=>n!==t):e.tabs.map((e,n)=>n===t?a:e);return{...e,tabs:c,activeKey:e.activeKey===n?o:e.activeKey,previewKey:e.previewKey===n?s?null:o:e.previewKey??null}})}function Mt(e,t){let n=w(e);return n!==`commit`&&n!==`untitled`&&e.session===t.session&&e.path===t.path&&e.root===t.root}function Nt(e,t,n){if(n===t.path)return e;let r=!1,i=e=>{if(e.kind===`split`){let t=e.children.map(i);return t.some((t,n)=>t!==e.children[n])?{...e,children:t}:e}let a=new Map,o=!1,s=e.tabs.map(e=>{if(e.type!==`editor`||!Mt(e.tab,t))return e;let r={...e,tab:{...e.tab,path:n}};return a.set(V(e),V(r)),o=!0,r});if(!o)return e;r=!0;let c=e.activeKey,l=e.previewKey??null;return{...e,tabs:s,activeKey:c===null?null:a.get(c)??c,previewKey:l===null?null:a.get(l)??l}},a=i(e);return r?a:e}function Pt(e){if(e.type!==`editor`)return null;let t=e.tab,n=w(t);return n!==`file`&&n!==`external`||t.view===`linked`||t.view===`locked`||ae(t.path)===null?null:t}function Ft(e,t){let n=Pt(t);if(!n)return e;let r=!1,i=e=>{if(e.kind===`split`)return{...e,children:e.children.map(i)};let t=!1,a=e.tabs.map(e=>{if(e.type!==`editor`||!ft(e))return e;let r=e.tab;return r.session===n.session&&r.path===n.path&&(r.root??``)===(n.root??``)&&w(r)===w(n)?e:(t=!0,{type:`editor`,tab:{session:n.session,path:n.path,...n.kind===void 0?{}:{kind:n.kind},...n.root===void 0?{}:{root:n.root},view:r.view}})});return t?(r=!0,{...e,tabs:a}):e},a=i(e);return r?a:e}function It(e,t){return e.session===t.session&&e.path===t.path&&(e.root??``)===(t.root??``)&&w(e)===w(t)}function Lt(e,t,n){let r=q(e).flatMap(e=>e.tabs.flatMap(n=>n.type!==`editor`||n.tab.view===`linked`||n.tab.view===`locked`||!It(n.tab,t)?[]:[{leafId:e.id,ref:n}]));return r.find(({leafId:e})=>e===n)??r.find(({ref:e})=>(e.tab.view??`source`)===`source`)??r[0]??null}function Rt(e,t,n){return X(e,t,e=>e.tabs.some(e=>V(e)===n)?{...e,activeKey:n}:e)}function zt(e,t,n){function r(e){return e.kind===`leaf`?e:e.id===t&&n.length===e.children.length?{...e,children:e.children.map(r),sizes:[...n]}:{...e,children:e.children.map(r)}}return r(e)}function Bt(e){let t=e.type===`terminal`?e.session:e.tab.session;return t===`00000000-0000-0000-0000-000000000000`?null:t}function Vt(e){return t=>{let n=Bt(t);return n===null||e.has(n)}}function Q(e,t){let n=e=>e.kind===`leaf`?{...e,tabs:e.tabs.filter(t)}:{...e,children:e.children.map(n)};return Y(n(e))}function Ht(e){let t=new Set,n=[];for(let r of e){let e=Y(Q(r,e=>!t.has(V(e)))),i=J(e);if(i.length!==0){for(let e of i)t.add(V(e));n.push(e)}}return n.length===0?U([]):gt(n.length===1?n[0]:Y(W(`row`,n)))}function Ut(e){let t=e.editor_tabs.map(e=>({type:`editor`,tab:e})),n=e.session_tabs.map(e=>({type:`terminal`,session:e})),r=e.active_editor_tab?V({type:`editor`,tab:e.active_editor_tab}):null,i=e.active_session?`term:${e.active_session}`:null;if(t.length===0&&n.length===0)return U([]);if(t.length===0)return U(n,i);if(n.length===0)return U(t,r);let a=e.layout,o=typeof a.editor==`number`?a.editor:40,s=typeof a.session==`number`?a.session:60;return Y(W(`col`,[U(t,r),U(n,i)],[o,s]))}function Wt(e){return JSON.stringify(Gt(e))}function Gt(e){return e===null?null:e.kind===`leaf`?e.tabs.length===0?null:{t:e.tabs.map(V)}:{d:e.direction,s:e.sizes.map(e=>Math.round(e*10)/10),c:e.children.map(Gt)}}var Kt=new Set,$=!1,qt=null;function Jt(){for(let e of Kt)e()}function Yt(e){return Kt.add(e),()=>Kt.delete(e)}function Xt(e){$!==e&&($=e,Jt())}function Zt(){Xt(!$)}function Qt(){return(0,T.useSyncExternalStore)(Yt,()=>$)}function $t(e){qt=e,Jt()}function en(){return(0,T.useSyncExternalStore)(Yt,()=>qt)}var tn={layout_tree:null,active_session:null,layout_ref:null};function nn(e){return e.type===`terminal`?e.session:e.tab.session}function rn(e,t){let n=new Set;for(let[r,i]of Object.entries(e))if(!(r===t||!i.layout_tree))for(let e of J(i.layout_tree))e.type===`terminal`&&n.add(e.session);return[...n]}function an(e,t){let n=e.project_layouts[t];return{...e,layout_tree:n?.layout_tree??null,active_session:n?.active_session??null,layout_ref:n?.layout_ref??null,session_tabs:[],editor_tabs:[],active_editor_tab:null}}function on(e,t,n){return n?{loaded:e.loaded,snapshot:an(e.snapshot,t),current:()=>an(e.current(),t),update(n){let r={},i={...n};if(`layout_tree`in n&&(r.layout_tree=n.layout_tree??null,delete i.layout_tree),`active_session`in n&&(r.active_session=n.active_session??null,delete i.active_session),`layout_ref`in n&&(r.layout_ref=n.layout_ref??null,delete i.layout_ref),Object.keys(r).length>0){let n=e.current().project_layouts;i.project_layouts={...n,[t]:{...n[t]??tn,...r}}}Object.keys(i).length>0&&e.update(i)}}:e}function sn(e,t,n,r){let i=e.layout_tree??Ut(e),a={};for(let o of t)a[o]={layout_tree:ht(Q(i,e=>{let i=nn(e);return i===`00000000-0000-0000-0000-000000000000`?o===(r??t[0]):n.get(i)===o})),active_session:e.active_session!==null&&n.get(e.active_session)===o?e.active_session:null,layout_ref:null};return{layout_mode:`project`,project_layouts:a}}function cn(e,t,n={}){return{...e,...t,...n}}function ln(e,t,n){let r=t.layout_tree?Q(t.layout_tree,e=>{let t=nn(e);return t===`00000000-0000-0000-0000-000000000000`||n.alive.has(t)}):null,i=t.active_session!==null&&n.alive.has(t.active_session)?t.active_session:null;if(t.scope===`profile`)return{projectBased:!1,patch:{layout_mode:`profile`,layout_tree:r,active_session:i,layout_ref:t.id}};let a=t.project_id??n.currentProject??n.projectIds[0]??``,o={layout_tree:r,active_session:i,layout_ref:t.id};if((e.layout_mode??`profile`)===`project`)return{projectBased:!0,patch:{project_layouts:{...e.project_layouts,[a]:o}}};let s=sn(e,n.projectIds,n.sessionProject,a);return{projectBased:!0,patch:{...s,project_layouts:cn(s.project_layouts??{},e.project_layouts,{[a]:o})}}}function un(e,t){let n=e.project_layouts,r=[...t.filter(e=>e in n),...Object.keys(n).filter(e=>!t.includes(e))].map(e=>n[e]);return{layout_mode:`profile`,project_layouts:{},layout_tree:Ht(r.map(e=>e.layout_tree).filter(e=>e!==null)),active_session:r.map(e=>e.active_session).find(e=>e!==null)??null,layout_ref:null}}var dn=2e3,fn=r.parse({});function pn(e){return`puddle.ws.${e}`}function mn(e){if(e===null)return{kind:`absent`};try{return{kind:`present`,snapshot:r.parse(JSON.parse(e))}}catch{return{kind:`corrupt`}}}function hn(){let e=i(),[t,n]=(0,T.useState)(!1),[r,s]=(0,T.useState)(fn),c=(0,T.useRef)(r);c.current=r;let l=(0,T.useRef)(null),u=(0,T.useMemo)(()=>oe((e,t)=>{o(e,t).catch(e=>console.warn(`ui-state save failed: ${e.message}`))},dn),[]);return(0,T.useEffect)(()=>{if(e===null){l.current=null;return}let t=pn(e);l.current=t;let r=!1;n(!1),s(fn);let i;try{i=mn(sessionStorage.getItem(t)),i.kind===`corrupt`&&sessionStorage.removeItem(t)}catch(e){console.warn(`ui-state read failed: ${e.message}`),i={kind:`absent`}}return i.kind===`present`?(s(i.snapshot),n(!0)):a(e).then(e=>{r||(e&&s(e.ui_state),n(!0))}).catch(e=>{console.warn(`ui-state load failed: ${e.message}`),r||n(!0)}),()=>{r=!0,u.flush()}},[e,u]),{loaded:t,snapshot:r,current:()=>c.current,update(t){if(e===null)return;let n={...c.current,...t};c.current=n,s(n);let r=l.current??pn(e);u(e,n);try{sessionStorage.setItem(r,JSON.stringify(n))}catch(e){console.warn(`ui-state write failed: ${e.message}`)}}}}export{We as $,At as A,Dt as B,St as C,K as D,Rt as E,Ft as F,ct as G,ot as H,Ot as I,Ze as J,nt as K,jt as L,Q as M,Nt as N,Pt as O,zt as P,Ge as Q,Lt as R,gt as S,J as T,st as U,lt as V,ut as W,qe as X,Je as Y,Ke as Z,Tt as _,cn as a,Le as at,Ut as b,sn as c,Xt as d,He as et,Zt as f,Et as g,Wt as h,ln as i,Be as it,Z as j,U as k,un as l,Qt as m,hn as n,Ve as nt,rn as o,ze as ot,en as p,Xe as q,pn as r,Re as rt,on as s,mn as t,Ue as tt,$t as u,q as v,G as w,wt as x,Vt as y,V as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t,r as n}from"./auth-
|
|
1
|
+
import{n as e,o as t,r as n}from"./auth-B4b-NPwe.js";import{n as r}from"./dist-Rswij5M_.js";var i=500,a=1e4;function o(e,t){return`${e} ${t}`}var s=new class{ws=null;open=!1;backoff=i;reconnectTimer=null;theme=null;terminals=new Map;notificationListeners=new Set;statusListeners=new Set;renameListeners=new Set;accountListeners=new Set;switchListeners=new Set;sessionsChangedListeners=new Set;connectionListeners=new Set;shellWaiters=new Map;attach(e,t,n,r,i){let a={session:e,term:t,cols:n,rows:r,handlers:i};return this.terminals.set(o(e,t),a),this.ensureConnected(),this.open&&this.send({t:`attach`,session:e,term:t,cols:n,rows:r}),()=>this.detach(e,t)}detach(e,t){this.terminals.delete(o(e,t))&&this.open&&this.send({t:`detach`,session:e,term:t})}write(e,t,n){this.open&&this.send({t:`stdin`,session:e,term:t,data:n})}resize(e,t,n,r){let i=this.terminals.get(o(e,t));i&&(i.cols=n,i.rows=r),this.open&&this.send({t:`resize`,session:e,term:t,cols:n,rows:r})}spawnShell(e){return this.ensureConnected(),this.open?new Promise((t,n)=>{let r=this.shellWaiters.get(e)??[];r.push({resolve:t,reject:n}),this.shellWaiters.set(e,r),this.open&&this.send({t:`spawn-shell`,session:e})}):Promise.reject(Error(`Connection is unavailable`))}killShell(e,t){this.open&&this.send({t:`kill-shell`,session:e,term:t})}onStatus(e){return this.statusListeners.add(e),this.ensureConnected(),()=>this.statusListeners.delete(e)}onAgentNotification(e){return this.notificationListeners.add(e),this.ensureConnected(),()=>this.notificationListeners.delete(e)}onRenamed(e){return this.renameListeners.add(e),this.ensureConnected(),()=>this.renameListeners.delete(e)}onAccount(e){return this.accountListeners.add(e),this.ensureConnected(),()=>this.accountListeners.delete(e)}onSessionSwitched(e){return this.switchListeners.add(e),this.ensureConnected(),()=>this.switchListeners.delete(e)}onSessionsChanged(e){return this.sessionsChangedListeners.add(e),this.ensureConnected(),()=>this.sessionsChangedListeners.delete(e)}onConnectionChange(e){return this.connectionListeners.add(e),()=>this.connectionListeners.delete(e)}isConnected(){return this.open}reportTheme(e,t){this.theme&&this.theme.fg===e&&this.theme.bg===t||(this.theme={fg:e,bg:t},this.open&&this.send({t:`theme`,fg:e,bg:t}))}reset(){this.ws?.close()}switchHost(){let e=this.ws;this.ws=null,this.open=!1,this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.terminals.clear();for(let e of this.shellWaiters.values())for(let t of e)t.reject(Error(`Host changed`));this.shellWaiters.clear(),e?.close();for(let e of this.connectionListeners)e(!1)}ensureConnected(){this.ws||this.reconnectTimer||this.connect()}connect(){let r=n.get(),a=t();if(!r&&!a)return;let o=window.location.protocol===`https:`?`wss`:`ws`,s=a?a.socket():new WebSocket(`${o}://${window.location.host}/ws`);this.ws=s,s.addEventListener(`open`,()=>{if(this.ws!==s){s.close();return}a||s.send(JSON.stringify({t:`auth`,token:r}))}),s.addEventListener(`message`,e=>{if(this.ws!==s)return;let t;try{t=JSON.parse(String(e.data))}catch{return}if(t.t===`authenticated`){if(this.open)return;this.open=!0,this.backoff=i,this.send({t:`subscribe-status`}),this.theme&&this.send({t:`theme`,...this.theme});for(let{session:e,term:t,cols:n,rows:r}of this.terminals.values())this.send({t:`attach`,session:e,term:t,cols:n,rows:r});for(let e of this.connectionListeners)e(!0)}else this.open&&this.handle(t)}),s.addEventListener(`close`,t=>{if(this.ws!==s)return;let n=this.open;this.open=!1,this.ws=null;for(let e of this.shellWaiters.values())for(let t of e)t.reject(Error(`Connection lost; operation outcome is unknown`));if(this.shellWaiters.clear(),n)for(let e of this.connectionListeners)e(!1);if(t.code===4401&&t.reason===`browser_rejected`){e();return}this.scheduleReconnect()})}scheduleReconnect(){this.reconnectTimer||this.terminals.size===0&&this.statusListeners.size===0&&this.notificationListeners.size===0&&this.renameListeners.size===0&&this.accountListeners.size===0&&this.switchListeners.size===0&&this.sessionsChangedListeners.size===0||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},this.backoff),this.backoff=Math.min(this.backoff*2,a))}send(e){this.open&&this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}handle(e){switch(e.t){case`agent-notification`:for(let t of this.notificationListeners)t(e);break;case`replay`:case`output`:this.terminals.get(o(e.session,e.term))?.handlers.onData(e.data,e.t);break;case`exit`:this.terminals.get(o(e.session,e.term))?.handlers.onExit?.(e.code);break;case`status`:for(let t of this.statusListeners)t({session:e.session,status:e.status,last_activity_at:e.last_activity_at});break;case`renamed`:for(let t of this.renameListeners)t({session:e.session,title:e.title,agent_title:e.agent_title,osc_title:e.osc_title});break;case`account`:for(let t of this.accountListeners)t({account_id:e.account_id,profile_id:e.profile_id,logged_in:e.logged_in});break;case`session-switched`:for(let t of this.switchListeners)t(e);break;case`sessions-changed`:for(let t of this.sessionsChangedListeners)t(e);break;case`shell-spawned`:{let t=this.shellWaiters.get(e.session)?.shift();t&&t.resolve(e.term);break}case`notice`:(e.level===`warning`?r.warning:r.error)(e.title,{...e.detail===void 0?{}:{description:e.detail},duration:12e3});break;case`error`:r.error(`Connection error`,{description:e.message});break}}};export{s as t};
|
package/dist/public/index.html
CHANGED
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
// Storage disabled or unreadable: the module's own init still runs.
|
|
48
48
|
}
|
|
49
49
|
</script>
|
|
50
|
-
<script type="module" crossorigin src="/assets/index-
|
|
50
|
+
<script type="module" crossorigin src="/assets/index-fldNIah5.js"></script>
|
|
51
51
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
|
|
52
52
|
<link rel="modulepreload" crossorigin href="/assets/react-CZI7_Jkm.js">
|
|
53
53
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-ffCh33zF.js">
|
|
54
|
-
<link rel="modulepreload" crossorigin href="/assets/auth-
|
|
54
|
+
<link rel="modulepreload" crossorigin href="/assets/auth-B4b-NPwe.js">
|
|
55
55
|
<link rel="modulepreload" crossorigin href="/assets/client-settings-CwqpIric.js">
|
|
56
56
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
|
|
57
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
57
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CjRY8Crm.css">
|
|
58
58
|
</head>
|
|
59
59
|
<body>
|
|
60
60
|
<div id="root"></div>
|
package/dist/pudl.js
CHANGED
|
@@ -14,7 +14,7 @@ import { parseArgs } from "node:util";
|
|
|
14
14
|
import { setTimeout as delay } from "node:timers/promises";
|
|
15
15
|
|
|
16
16
|
// ../shared/src/protocol.ts
|
|
17
|
-
var PROTOCOL_VERSION = { major:
|
|
17
|
+
var PROTOCOL_VERSION = { major: 25, minor: 1 };
|
|
18
18
|
|
|
19
19
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
20
20
|
var external_exports = {};
|
|
@@ -14689,16 +14689,7 @@ var hostInfoSchema = external_exports.object({
|
|
|
14689
14689
|
// ../shared/src/api/profiles.ts
|
|
14690
14690
|
var fsSafeName = external_exports.string().min(1).max(64).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/, "letters, digits, dot, underscore and hyphen only");
|
|
14691
14691
|
var RULES_TOKEN = "{{rules}}";
|
|
14692
|
-
var DEFAULT_ONBOARDING_TEMPLATE = `
|
|
14693
|
-
|
|
14694
|
-
1. Standing setup rules for this repository (user-authored):
|
|
14695
|
-
${RULES_TOKEN}
|
|
14696
|
-
|
|
14697
|
-
2. Inspect the codebase for setup requirements (README, CONTRIBUTING, lockfiles, .tool-versions, pyproject.toml, package.json, \u2026).
|
|
14698
|
-
3. Apply what the rules above settle without asking. Ask the user about anything they leave open, stating trade-offs where relevant (e.g. a symlinked .venv saves gigabytes per worktree, but parallel sessions then share mutable dependency state).
|
|
14699
|
-
4. If the user states a standing rule for all future worktrees ("always\u2026", "never\u2026", "from now on\u2026"), write the complete updated rules to \`.puddle/onboarding-notes.md\` in this worktree \u2014 full replacement, user-owned prose; record their decision, don't invent policy.
|
|
14700
|
-
|
|
14701
|
-
Then proceed with the task below (or await instructions if none is given).`;
|
|
14692
|
+
var DEFAULT_ONBOARDING_TEMPLATE = `This is a freshly created git worktree for this task. Before starting, set up the environment as appropriate by reading any setup rules (see below) and inspecting the codebase. If the user states a rule for all future worktrees, write the complete updated rules to \`.puddle/onboarding-notes.md\` in this worktree. Setup rules:${RULES_TOKEN}`;
|
|
14702
14693
|
var PROFILE_ICON_COLOURS = [
|
|
14703
14694
|
"navy",
|
|
14704
14695
|
"gold",
|
|
@@ -15220,7 +15211,9 @@ var compilationProviderSchema = external_exports.object({
|
|
|
15220
15211
|
executor: external_exports.string().min(1).nullable(),
|
|
15221
15212
|
eager: external_exports.boolean(),
|
|
15222
15213
|
/** Omitted by older providers, whose action remains compilation. */
|
|
15223
|
-
action: external_exports.enum(["compile", "run"]).optional()
|
|
15214
|
+
action: external_exports.enum(["compile", "run"]).optional(),
|
|
15215
|
+
/** Runs always launch a terminal, including any compilation step (25.0). */
|
|
15216
|
+
terminal: external_exports.boolean().optional()
|
|
15224
15217
|
});
|
|
15225
15218
|
var compilationCapabilitiesResponseSchema = external_exports.object({
|
|
15226
15219
|
providers: external_exports.array(compilationProviderSchema)
|
|
@@ -15266,6 +15259,8 @@ var compilationRunResponseSchema = external_exports.object({
|
|
|
15266
15259
|
/** The provider-resolved entry point (for LaTeX, the root TeX document). */
|
|
15267
15260
|
source: compilationFileTargetSchema,
|
|
15268
15261
|
artifacts: external_exports.array(compilationArtifactSchema),
|
|
15262
|
+
/** Newly launched terminal placement; success means launched, not programme completion. */
|
|
15263
|
+
terminal: sessionSchema.optional(),
|
|
15269
15264
|
/** Provider-owned navigation format available for the artifacts, if any. */
|
|
15270
15265
|
navigation: external_exports.object({ kind: external_exports.string().min(1) }).optional()
|
|
15271
15266
|
});
|
|
@@ -15501,17 +15496,37 @@ var notebookKernelsResponseSchema = external_exports.object({
|
|
|
15501
15496
|
error: external_exports.string().optional()
|
|
15502
15497
|
});
|
|
15503
15498
|
var notebookKernelRequestSchema = external_exports.object({ source: compilationFileTargetSchema });
|
|
15499
|
+
var pythonPathSchema = external_exports.string().trim().min(1).max(4096).refine((path) => !path.includes("\0"));
|
|
15500
|
+
var notebookEnvironmentSchema = external_exports.object({
|
|
15501
|
+
python: pythonPathSchema,
|
|
15502
|
+
label: external_exports.string(),
|
|
15503
|
+
ipykernel: external_exports.boolean(),
|
|
15504
|
+
nbconvert: external_exports.boolean(),
|
|
15505
|
+
error: external_exports.string().optional()
|
|
15506
|
+
});
|
|
15507
|
+
var notebookEnvironmentsResponseSchema = external_exports.object({
|
|
15508
|
+
environments: external_exports.array(notebookEnvironmentSchema)
|
|
15509
|
+
});
|
|
15504
15510
|
var notebookKernelStatusSchema = external_exports.object({
|
|
15505
15511
|
state: external_exports.enum(["stopped", "starting", "idle", "busy", "dead"]),
|
|
15506
15512
|
kernel: external_exports.string().nullable(),
|
|
15507
|
-
error: external_exports.string().optional()
|
|
15513
|
+
error: external_exports.string().optional(),
|
|
15514
|
+
environment: notebookEnvironmentSchema.optional()
|
|
15508
15515
|
});
|
|
15509
15516
|
var notebookKernelActionSchema = external_exports.discriminatedUnion("action", [
|
|
15510
15517
|
notebookKernelRequestSchema.extend({
|
|
15511
15518
|
action: external_exports.literal("select"),
|
|
15512
15519
|
kernel: external_exports.string().min(1).max(256)
|
|
15513
15520
|
}),
|
|
15514
|
-
notebookKernelRequestSchema.extend({ action: external_exports.enum(["interrupt", "restart", "shutdown"]) })
|
|
15521
|
+
notebookKernelRequestSchema.extend({ action: external_exports.enum(["interrupt", "restart", "shutdown"]) }),
|
|
15522
|
+
notebookKernelRequestSchema.extend({
|
|
15523
|
+
action: external_exports.literal("select-python"),
|
|
15524
|
+
python: pythonPathSchema
|
|
15525
|
+
}),
|
|
15526
|
+
notebookKernelRequestSchema.extend({
|
|
15527
|
+
action: external_exports.literal("install-python"),
|
|
15528
|
+
python: pythonPathSchema
|
|
15529
|
+
})
|
|
15515
15530
|
]);
|
|
15516
15531
|
|
|
15517
15532
|
// ../shared/src/api/latex.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puddle-code/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "puddle \u2014 self-hosted orchestrator for CLI coding agents: serves the cockpit UI and connects it to local or SSH hosts.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/PerceptronV/puddle-code#readme",
|