@deslop/workbench 0.0.401 → 0.0.410

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/{anthropic-DcE0yHBZ.mjs → anthropic-messages--JAnb97W.mjs} +38 -51
  2. package/dist/{azure-openai-responses-ecGypQVA.mjs → azure-openai-responses-g-awH_uA.mjs} +9 -16
  3. package/dist/client/assets/{-workbench-terminal-Af-sz4R6.js → -workbench-terminal-Ne3Ca_Zm.js} +8 -8
  4. package/dist/client/assets/agent-YDhqENQr.js +1 -0
  5. package/dist/client/assets/agent-YvOEbSL4.js +2 -0
  6. package/dist/client/assets/{dialog-CTIcy8Vy.js → dialog-O3wBc7X2.js} +2 -2
  7. package/dist/client/assets/diff-BcPEyFnc.js +223 -0
  8. package/dist/client/assets/diff-CZdOESVK.js +2 -0
  9. package/dist/client/assets/{external-link-BxixiKaa.js → external-link-D8TqDHgo.js} +1 -1
  10. package/dist/client/assets/fallbacks-BYPj1x-T.js +16 -0
  11. package/dist/client/assets/index-DFD32fIK.css +2 -0
  12. package/dist/client/assets/index-k88N8viu.js +10 -0
  13. package/dist/client/assets/{input-DW9ssWUO.js → input-BHj016ES.js} +1 -1
  14. package/dist/client/assets/portless-DbuqdEMA.js +2 -0
  15. package/dist/client/assets/portless-rPZ2tatn.js +1 -0
  16. package/dist/client/assets/{resizable-CZjAW7-J.js → resizable-BlkgaK6V.js} +1 -1
  17. package/dist/client/assets/route-DKK79z62.js +2 -0
  18. package/dist/client/assets/route-DOc4X-Ya.js +45 -0
  19. package/dist/client/assets/{run-CeqkWWtZ.js → run-DVOYYIUX.js} +1 -1
  20. package/dist/client/assets/run-gggwaxnT.js +2 -0
  21. package/dist/client/assets/{sonner-BKURESHO.js → sonner-Bnl1Iat_.js} +1 -1
  22. package/dist/client/assets/state-Cxz4BVk7.js +2 -0
  23. package/dist/client/assets/terminal-Brvez29s.js +2 -0
  24. package/dist/client/assets/{terminal-CcfbU9tU.js → terminal-CYX_Ixg-.js} +1 -1
  25. package/dist/client/assets/{triangle-alert-DLHVemGQ.js → triangle-alert-Ceg_3GX9.js} +1 -1
  26. package/dist/client/index.html +11 -11
  27. package/dist/github-copilot-headers-BB6z1RAk.mjs +23 -0
  28. package/dist/{google-Jzn1v4-q.mjs → google-generative-ai-r4Wb8Eaq.mjs} +15 -20
  29. package/dist/{google-shared-DNNqX1gf.mjs → google-shared-DN1OvwJM.mjs} +4 -4
  30. package/dist/{google-vertex-z0Cbw7eq.mjs → google-vertex-Clcq7cAd.mjs} +15 -20
  31. package/dist/{hash-CScAQ-b_.mjs → hash-wSEYO-QF.mjs} +1 -1
  32. package/dist/headers-SFoLwUHv.mjs +15 -0
  33. package/dist/{mistral-CxEIkz4y.mjs → mistral-conversations-Bnpuiv3e.mjs} +12 -19
  34. package/dist/{openai-codex-responses-7ZUsVcbT.mjs → openai-codex-responses-4Te8RbRb.mjs} +62 -46
  35. package/dist/{openai-completions-CaGFVr3X.mjs → openai-completions-B4nInzTS.mjs} +69 -96
  36. package/dist/{openai-responses-Vjw8-3qm.mjs → openai-responses-GeDULmTh.mjs} +28 -31
  37. package/dist/{openai-responses-shared-DtEshy-7.mjs → openai-responses-shared-CG93Thoy.mjs} +37 -32
  38. package/dist/{openrouter-CZ-H_QwG.mjs → openrouter-images-CgbIytYQ.mjs} +7 -14
  39. package/dist/{sanitize-unicode-BbVojtka.mjs → sanitize-unicode-Ga8nHda1.mjs} +1 -1
  40. package/dist/server.js +32269 -28959
  41. package/dist/{transform-messages-CLmkH5Gu.mjs → transform-messages-D9fZ7fnU.mjs} +2 -2
  42. package/package.json +3 -2
  43. package/dist/client/assets/agent-BnkD1Glf.js +0 -2
  44. package/dist/client/assets/agent-DQPX2IZb.js +0 -1
  45. package/dist/client/assets/diff-MiGOu0DY.js +0 -2
  46. package/dist/client/assets/diff-_Gk9o1mg.js +0 -223
  47. package/dist/client/assets/fallbacks-D21cBTdH.js +0 -16
  48. package/dist/client/assets/index-B2S_w1d1.css +0 -2
  49. package/dist/client/assets/index-DW7dKhgZ.js +0 -10
  50. package/dist/client/assets/portless-3KC81g42.js +0 -2
  51. package/dist/client/assets/portless-CxovsEbp.js +0 -1
  52. package/dist/client/assets/route-DwWgYFyk.js +0 -2
  53. package/dist/client/assets/route-te6-VkZE.js +0 -45
  54. package/dist/client/assets/run-B-qmimXV.js +0 -2
  55. package/dist/client/assets/state-a4d_PikB.js +0 -2
  56. package/dist/client/assets/terminal-BHNxWKc6.js +0 -2
  57. package/dist/github-copilot-headers-P0xZolzq.mjs +0 -39
  58. package/dist/headers-oksLmLNC.mjs +0 -9
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/route-te6-VkZE.js","assets/rolldown-runtime-QTnfLwEv.js","assets/compiler-runtime-CLAvuQ-D.js","assets/fallbacks-D21cBTdH.js","assets/dialog-CTIcy8Vy.js","assets/resizable-CZjAW7-J.js","assets/preload-helper-CjdClQve.js","assets/sonner-BKURESHO.js","assets/triangle-alert-DLHVemGQ.js","assets/state-a4d_PikB.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,r as n}from"./compiler-runtime-CLAvuQ-D.js";import{$s as r,Bs as i,Cc as a,Dc as o,Ec as s,Gs as c,Hs as l,Is as u,Js as d,Ls as f,Nt as p,Oc as m,Qs as h,Sc as g,Tc as _,Xs as v,Zs as y,_c as b,ac as x,bc as S,cc as C,dc as w,ec as T,fc as E,gc as D,hc as O,ic as k,it as A,lc as j,mc as ee,nc as te,oc as ne,pc as re,rc as ie,sc as ae,tc as oe,uc as se,vc as ce,wc as le,xc as ue}from"./fallbacks-D21cBTdH.js";import{t as de}from"./preload-helper-CjdClQve.js";function fe(e){let t=e;return{get(){return t},set(e){t=S(e,t)}}}function pe(e){return{get(){return e()}}}function me(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>M(o,_.get())),x=r(()=>M(s,v.get())),S=r(()=>M(c,y.get())),C=r(()=>_.get()[0]),T=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),E=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),D=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),O=w(64);function k(e){let t=O.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),O.set(e,t)),t}let A={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:T,matchRouteDeps:E,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:D,getRouteMatchStore:k,setMatches:j,setPending:ee,setCached:te};j(e.matches),a?.(A);function j(e){N(e,o,_,n,i)}function ee(e){N(e,s,v,n,i)}function te(e){N(e,c,y,n,i)}return A}function M(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function N(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}ee(n.get(),a)||n.set(a)})}function he(){try{return sessionStorage}catch{return}}var ge=`tsr-scroll-restoration-v1_3`,_e=he();function ve(){try{return JSON.parse(_e?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function ye(){try{_e?.setItem(ge,JSON.stringify(P))}catch{}}var P=ve(),be=`data-scroll-restoration-id`,xe=e=>e.state.__TSR_key||e.href;function Se(e){let t=e.getAttribute(be);if(t)return`[${be}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var F=!1,I=`window`;function L(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Ce(e){let t=[];for(let n of e){if(n===I)continue;let e=L(n);e&&t.push(e)}return t}function we(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||xe,a=new Map,o=(e,t,n)=>{let r=a.get(e)||{};r.scrollX=t,r.scrollY=n,a.set(e,r)},s=e=>{if(!(F||!r.restoring))if(e.target===document)o(I,scrollX,scrollY);else{let t=e.target;o(t,t.scrollLeft,t.scrollTop)}},c=e=>{if(!r.restoring)return;let t=P[e]||={};for(let[e,n]of a)e===I?t[I]=n:e.isConnected&&(t[Se(e)]=n)};n&&!r.restoration&&(r.restoration=!0,F=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,s,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&c(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{c(i(e.stores.resolvedLocation.get()??e.stores.location.get())),ye()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c;if(a.clear(),s||(r.next=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let l=i(t.toLocation),u=t.fromLocation&&i(t.fromLocation);if(r.restoring&&u&&u!==l){let e=P[u];if(e){let t=P[l];for(let n in e){if(n===I){if(s)continue}else{let e=L(n);if(!e||s&&o&&(c??=Ce(o),c.includes(e)))continue}t||=P[l]={},t[n]??=e[n]}}}F=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){let s=rt.get(t.toLocation),u=e&&i&&(s===`PUSH`||s===`REPLACE`),d=r.restoring?P[l]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:r}=d[e];if(e===I){if(u)continue;scrollTo({top:r,left:t,behavior:n}),a=!0}else{let n=L(e);n&&(n.scrollLeft=t,n.scrollTop=r)}}if(!a&&!e){let e={top:0,left:0,behavior:n};if(scrollTo(e),o){c??=Ce(o);for(let t of c)t.scrollTo(e)}}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{F=!1}}))}function Te(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function R(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ee(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=R(r):Array.isArray(t)?t.push(R(r)):n[e]=[t,R(r)]}return n}var De=ke(JSON.parse),Oe=Ae(JSON.stringify,JSON.parse);function ke(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Ee(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Ae(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Te(e,r);return t?`?${t}`:``}}var z=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},je=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),B=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),V=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Me=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},H=(e,t,n)=>{if(!(!d(n)&&!y(n)))throw d(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:d(n)?`redirected`:y(n)?`notFound`:r.status===`pending`?`success`:r.status,context:V(e,t.index),isFetching:!1,error:n})),y(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),d(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Ne=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Pe=(e,t,n)=>{let r=V(e,n);e.updateMatch(t,e=>({...e,context:r}))},U=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,H(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,H(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!d(n)&&!y(n)&&(e.serialError??=n)},Fe=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!B(e,t)&&(n.options.loader||n.options.beforeLoad||Ge(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{z(e)},i);r._nonReactive.pendingTimeout=t}},Ie=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Fe(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&H(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Le=(e,t,n,r)=>{let i=e.router.getMatch(t),o=i._nonReactive.loadPromise;i._nonReactive.loadPromise=O(()=>{o?.resolve(),o=void 0});let{paramsError:s,searchError:c}=i;s&&U(e,n,s),c&&U(e,n,c),Fe(e,t,r,i);let l=new AbortController,u=!1,f=()=>{u||(u=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:l})))},p=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{f(),p()});return}i._nonReactive.beforeLoadPromise=O();let m={...V(e,n,!1),...i.__routeContext},{search:h,params:g,cause:_}=i,v=B(e,t),b={search:h,abortController:l,params:g,preload:v,context:m,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?`preload`:_,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},x=r=>{if(r===void 0){e.router.batch(()=>{f(),p()});return}(d(r)||y(r))&&(f(),U(e,n,r)),e.router.batch(()=>{f(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),p()})},S;try{if(S=r.options.beforeLoad(b),a(S))return f(),S.catch(t=>{U(e,n,t)}).then(x)}catch(t){f(),U(e,n,t)}x(S)},Re=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],o=()=>c(),s=()=>Le(e,n,t,i),c=()=>{if(Ne(e,n))return;let t=Ie(e,n,i);return a(t)?t.then(s):s()};return o()},ze=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Be=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=V(e,r),d=B(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Ve=async(e,t,n,r,i)=>{try{let o=e.router.getMatch(n);try{W(i);let s=i.options.loader,c=typeof s==`function`?s:s?.handler,l=c?.(Be(e,t,n,r,i)),u=!!c&&a(l);if((u||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),c){let t=u?await l:l;H(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let d=o._nonReactive.minPendingPromise;d&&await d,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:V(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let a=t;if(a?.name===`AbortError`){if(o.abortController.signal.aborted){o._nonReactive.loaderPromise?.resolve(),o._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:V(e,r)}));return}let s=o._nonReactive.minPendingPromise;s&&await s,y(t)&&await i.options.notFoundComponent?.preload?.(),H(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){a=t,H(e,e.router.getMatch(n),t)}!d(a)&&!y(a)&&await W(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:a,context:V(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),H(e,r,t)}},He=async(e,t,n)=>{async function r(r,a,c,l,f){let p=Date.now()-a.updatedAt,m=r?f.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:f.options.staleTime??e.router.options.defaultStaleTime??0,h=f.options.shouldReload,g=typeof h==`function`?h(Be(e,t,i,n,f)):h,{status:_,invalid:v}=l,y=p>=m&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=_===`success`&&(v||(g??y)),r&&f.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await Ve(e,t,i,n,f);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){d(t)&&await e.router.navigate(t.options)}})()):_!==`success`||o?await Ve(e,t,i,n,f):Pe(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Ne(e,i)){if(!e.router.getMatch(i))return e.matches[n];Pe(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=B(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&H(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=O(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let f=e.router.getMatch(i);s||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,s||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;let p=s?f.isFetching:!1;return p!==f.isFetching||f.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:p,invalid:!1})),e.router.getMatch(i)):f};async function Ue(e){let t=e,n=[];je(t.router)&&z(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=Re(t,e);a(n)&&await n}catch(e){if(d(e))throw e;if(y(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,o=r&&!t.preload?Me(t,r):void 0,s=r&&t.preload?0:o===void 0?i:Math.min(o+1,i),c,l;for(let e=0;e<s;e++)n.push(He(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(d(e))throw e;y(e)?c??=e:l??=e}if(l!==void 0)throw l}let u=c??(r&&!t.preload?r:void 0),f=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!u&&r&&t.preload)return t.matches;if(u){let e=Me(t,u);e===void 0&&E();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),u.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:u},isFetching:!1})),f=e,await W(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await W(e,[`errorComponent`])}for(let e=0;e<=f;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=ze(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let p=z(t);if(a(p)&&await p,u)throw u;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function We(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function W(e,t=G){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===G?(()=>{if(e._componentsPromise===void 0){let t=We(e,G);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():We(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Ge(e){for(let t of G)if(e.options[t]?.preload)return!0;return!1}var G=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function Ke(e){return{input:({url:t})=>{for(let n of e)t=Je(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Ye(e[n],t);return t}}}function qe(e){let t=ie(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=oe([`/`,t,e.pathname]),e)}}function Je(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Ye(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}var K=`__TSR_index`,Xe=`popstate`,Ze=`beforeunload`;function Qe(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=q(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[K];i=$e(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[K];i=$e(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[K]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function $e(e,t){t||={};let n=nt();return{...t,key:n,__TSR_key:n,[K]:e}}function et(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>q(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=nt();t.history.replaceState({[K]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=q(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[K]-l.state[K],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Qe({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ze,S,{capture:!0}),t.removeEventListener(Xe,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Ze,S,{capture:!0}),t.addEventListener(Xe,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function tt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function q(e,t){let n=tt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=nt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[K]:0,key:a,__TSR_key:a}}}function nt(){return(Math.random()+1).toString(36).substring(7)}function J(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var rt=new WeakMap,it=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,i=this.basepath===void 0,a=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=r(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=et()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=w(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=me(ot(this.latestLocation),e),we(this)}let o=!1,s=this.options.basepath??`/`,c=this.options.rewrite;if(i||n!==s||a!==c){this.basepath=s;let e=[],t=ie(s);t&&t!==`/`&&e.push(qe({basepath:s})),c&&e.push(c),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Ke(e),this.history&&this.updateLatestLocation(),o=!0}o&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=se(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&j(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:D(e).path,external:!1,searchStr:o,search:_(t?.search,i),hash:D(r.slice(1)).path,state:s(t?.state,a)}}let o=new URL(i,this.origin),c=Je(this.rewrite,o),l=this.options.parseSearch(c.search),u=this.options.stringifySearch(l);return c.search=u,{href:c.href.replace(c.origin,``),publicHref:i,pathname:D(c.pathname).path,external:!!this.rewrite&&c.origin!==this.origin,searchStr:u,search:_(t?.search,l),hash:D(c.hash.slice(1)).path,state:s(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>te({base:e,to:t.includes(`//`)?h(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>st({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,c=Object.assign(Object.create(null),r.params),l=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),u=a?this.resolvePathWithBase(l,a):l,d=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?c:Object.assign(c,S(t.params,c)),f=this.routesByPath[k(u)],p;if(f)p=this.getRouteBranch(f);else if(u.includes(`$`))p=[];else{let e=this.getMatchedRoutes(u);p=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(p=[...p,this.options.notFoundRoute])}if(p.length&&ue(d))for(let e of p){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(d,t(d))}catch{}}let m=e.leaveParams?u:D(T({path:u,params:d,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,h=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};p.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,X(t.options.validateSearch,{...e,...h}))}catch{}}),h=e}h=ct({search:h,dest:t,destRoutes:p,_includeValidateSearch:e._includeValidateSearch}),h=_(o,h);let g=this.options.stringifySearch(h),v=t.hash===!0?n.hash:t.hash?S(t.hash,n.hash):void 0,y=v?`#${v}`:``,b=t.state===!0?n.state:t.state?S(t.state,n.state):{};b=s(n.state,b);let x=`${m}${g}${y}`,C,w,E=!1;if(this.rewrite){let e=new URL(x,this.origin),t=Ye(this.rewrite,e);C=e.href.replace(e.origin,``),t.origin===this.origin?w=t.pathname+t.search+t.hash:(w=t.href,E=!0)}else C=ce(x),w=C;return{publicHref:w,href:C,pathname:m,search:h,searchStr:g,state:b,hash:v??``,external:E,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=ne(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,S(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=b(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=k(this.latestLocation.href)===k(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=O(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=q(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Je(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(g(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t?rt.set(this.latestLocation,t):rt.delete(this.latestLocation);let n=this.latestLocation,r=J(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await Ue({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){d(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):y(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(J(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&g(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=W,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await Ue({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(d(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});y(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=C(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!b(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?b(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Oe,parseSearch:e.parseSearch??De,protocolAllowlist:e.protocolAllowlist??re}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=x(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:k(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let c=o?ut(this.options.notFoundMode,a):void 0,l=Array(a.length),u=new Map;for(let e of this.stores.matchStores.values())e.routeId&&u.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=l[n-1],f,p,m;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=X(r.options.validateSearch,{...n})??void 0;f={...n,...e},p={...i,...e},m=void 0}catch(e){let r=e;if(e instanceof Y||(r=new Y(e.message,{cause:e})),t?.throwOnError)throw r;f=n,p={},m=r}}let h=r.options.loaderDeps?.({search:f})??``,g=h?JSON.stringify(h):``,{interpolatedPath:v,usedParams:b}=T({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),x=r.id+v+g,S=this.getMatch(x),C=u.get(r.id),w=S?._strictParams??b,E;if(!S)try{dt(r,w)}catch(e){if(E=y(e)||d(e)?e:new at(e.message,{cause:e}),t?.throwOnError)throw E}Object.assign(i,w);let D=C?`stay`:`enter`,k;if(S)k={...S,cause:D,params:C?.params??i,_strictParams:w,search:_(C?C.search:S.search,f),_strictSearch:p};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Ge(r)?`pending`:`success`;k={id:x,ssr:r.options.ssr,index:n,routeId:r.id,params:C?.params??i,_strictParams:w,pathname:v,updatedAt:Date.now(),search:C?_(C.search,f):f,_strictSearch:p,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:E,__routeContext:void 0,_nonReactive:{loadPromise:O()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:D,loaderDeps:C?s(C.loaderDeps,h):h,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(k.globalNotFound=c===r.id),k.searchError=m;let A=this.getParentContext(o);k.context={...A,...k.__routeContext,...k.__beforeLoadContext},l[n]=k}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?_(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=le(t),i={...e.search};for(let e of t)try{Object.assign(i,X(e.options.validateSearch,i))}catch{}let a=le(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{dt(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},Y=class extends Error{},at=class extends Error{};function ot(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function X(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Y(`Async validation not supported`);if(n.issues)throw new Y(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function st({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=k(e),a,o=ae(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function ct({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return lt(n)(e,t,r??!1)}function lt(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=X(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=S(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function ut(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return v}function dt(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}var Z=e(n(),1),Q=t();function ft(e){let t=e.errorComponent??mt;return(0,Q.jsx)(pt,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?Z.createElement(t,{error:n,reset:r}):e.children})}var pt=class extends Z.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function mt({error:e}){let[t,n]=Z.useState(!1);return(0,Q.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,Q.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,Q.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,Q.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,Q.jsx)(`code`,{children:e.message}):null})}):null]})}function ht(e){let t=m(),n=`not-found-${c(t.stores.location,e=>e.pathname)}-${c(t.stores.status,e=>e)}`;return(0,Q.jsx)(ft,{getResetKey:()=>n,onCatch:(t,n)=>{if(y(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(y(t))return e.fallback?.(t);throw t},children:e.children})}function gt(){return(0,Q.jsx)(`p`,{children:`Not Found`})}function $(e){return(0,Q.jsx)(Q.Fragment,{children:e.children})}function _t(e,t,n){return t.options.notFoundComponent?(0,Q.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,Q.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,Q.jsx)(gt,{})}var vt=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,yt=(e,t)=>e[0]===t[0]&&e[1]===t[1],bt=Z.memo(function({matchId:e}){let t=m(),n=t.stores.matchStores.get(e);n||E();let r=c(t.stores.loadedAt,e=>e),i=c(n,e=>e,vt);return(0,Q.jsx)(xt,{router:t,matchId:e,resetKey:r,matchState:Z.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function xt({router:e,matchId:t,resetKey:n,matchState:r}){let a=e.routesById[r.routeId],s=a.options.pendingComponent??e.options.defaultPendingComponent,c=s?(0,Q.jsx)(s,{}):null,l=a.options.errorComponent??e.options.defaultErrorComponent,u=a.options.onCatch??e.options.defaultOnCatch,d=a.isRoot?a.options.notFoundComponent??e.options.notFoundRoute?.options.component:a.options.notFoundComponent,f=r.ssr===!1||r.ssr===`data-only`,p=(!a.isRoot||a.options.wrapInSuspense||f)&&(a.options.wrapInSuspense??s??(a.options.errorComponent?.preload||f))?Z.Suspense:$,m=l?ft:$,h=d?ht:$;return(0,Q.jsxs)(a.isRoot?a.options.shellComponent??$:$,{children:[(0,Q.jsx)(o.Provider,{value:t,children:(0,Q.jsx)(p,{fallback:c,children:(0,Q.jsx)(m,{getResetKey:()=>n,errorComponent:l||mt,onCatch:(e,t)=>{if(y(e))throw e.routeId??=r.routeId,e;u?.(e,t)},children:(0,Q.jsx)(h,{fallback:e=>{if(e.routeId??=r.routeId,!d||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!a.isRoot)throw e;return Z.createElement(d,e)},children:f||r._displayPending?(0,Q.jsx)(i,{fallback:c,children:(0,Q.jsx)(Ct,{matchId:t})}):(0,Q.jsx)(Ct,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(St,{}),(e.options.scrollRestoration,null)]}):null]})}function St(){let e=m(),t=Z.useRef();return l(()=>{let n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:`onRendered`,...J(e.stores.location.get(),r??n)}),t.current=n},[c(e.stores.resolvedLocation,e=>e?.state.__TSR_key),e]),null}var Ct=Z.memo(function({matchId:e}){let t=m(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||E();let i=c(r,e=>e),a=i.routeId,o=t.routesById[a],s=Z.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),l=Z.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,Q.jsx)(e,{},s):(0,Q.jsx)(wt,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=O();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return y(i.error)||E(),_t(t,o,i.error);if(i.status===`redirected`)throw d(i.error)||E(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return l}),wt=Z.memo(function(){let e=m(),t=Z.useContext(o),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=c(a,e=>[e?.routeId,e?.globalNotFound??!1],yt),i=c(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,s=e.options.defaultPendingComponent?(0,Q.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||E(),_t(e,a,void 0);if(!i)return null;let l=(0,Q.jsx)(bt,{matchId:i});return n===`__root__`?(0,Q.jsx)(Z.Suspense,{fallback:s,children:l}):l}),Tt=f(`/(home)`)({component:u(()=>de(()=>import(`./route-te6-VkZE.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),`component`),validateSearch:p(A({}))});export{ft as a,J as c,$ as i,fe as l,bt as n,mt as o,wt as r,it as s,Tt as t,pe as u};
@@ -1,45 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,r as n,t as r}from"./compiler-runtime-CLAvuQ-D.js";import{A as i,Ao as a,Br as o,Bt as s,Do as c,Gs as l,Ha as u,Hr as d,Ir as f,Kr as p,L as m,M as h,Mo as g,N as _,O as v,Oc as ee,P as y,Po as b,Ps as x,R as S,Rr as te,Ss as ne,Ur as C,Ut as w,Vt as re,Wa as ie,Wr as T,Ws as ae,Wt as oe,Xa as E,Ya as D,_s as se,a as O,do as ce,en as le,fo as ue,j as de,js as k,k as A,ko as fe,lr as pe,mo as me,no as he,r as ge,so as j,yn as _e,z as M,zr as N,zs as ve}from"./fallbacks-D21cBTdH.js";import{r as ye,t as be}from"./route-DwWgYFyk.js";import{C as xe,S as Se,a as Ce,c as P,f as we,i as Te,l as Ee,n as De,o as Oe,r as ke,s as Ae,t as je,u as Me}from"./dialog-CTIcy8Vy.js";import{n as F}from"./sonner-BKURESHO.js";import{n as Ne,r as Pe,t as Fe}from"./resizable-CZjAW7-J.js";import{B as Ie,C as Le,M as Re,N as ze,P as Be,T as Ve,f as He,g as Ue,h as I,i as We,j as Ge,k as L,m as R,p as Ke,s as qe,w as Je,z as Ye}from"./state-a4d_PikB.js";function Xe(e){let t=ee({warn:e?.router===void 0}),n=e?.router||t;return l(n.stores.__store,ae(e,n))}var Ze=x(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Qe=x(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),$e=x(`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`}]]),et=x(`calendar-days`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),tt=x(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),nt=x(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),rt=x(`git-branch-plus`,[[`path`,{d:`M6 3v12`,key:`qpgusn`}],[`path`,{d:`M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`,key:`1d02ji`}],[`path`,{d:`M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`,key:`chk6ph`}],[`path`,{d:`M15 6a9 9 0 0 0-9 9`,key:`or332x`}],[`path`,{d:`M18 15v6`,key:`9wciyi`}],[`path`,{d:`M21 18h-6`,key:`139f0c`}]]),it=x(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),at=x(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),ot=x(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),st=x(`memory-stick`,[[`path`,{d:`M12 12v-2`,key:`fwoke6`}],[`path`,{d:`M12 18v-2`,key:`qj6yno`}],[`path`,{d:`M16 12v-2`,key:`heuere`}],[`path`,{d:`M16 18v-2`,key:`s1ct0w`}],[`path`,{d:`M2 11h1.5`,key:`15p63e`}],[`path`,{d:`M20 18v-2`,key:`12ehxp`}],[`path`,{d:`M20.5 11H22`,key:`khsy7a`}],[`path`,{d:`M4 18v-2`,key:`1c3oqr`}],[`path`,{d:`M8 12v-2`,key:`1mwtfd`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`rect`,{x:`2`,y:`6`,width:`20`,height:`10`,rx:`2`,key:`1qcswk`}]]),ct=x(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),lt=x(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ut=x(`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`}]]),dt=x(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ft=x(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),pt=x(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),mt=x(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ht=x(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),z=e(n(),1),B=r(),V=t(),gt=[`claude`,`codex`];function _t(e){return e>=90?`text-destructive`:e>=75?`text-amber-500`:`text-foreground`}function vt(e){let t=(0,B.c)(16),n;if(t[0]!==e.icon||t[1]!==e.window.resetsAt||t[2]!==e.window.utilization){let r=k(fe(e.window.resetsAt),c(le)),i;t[4]===e.icon?i=t[5]:(i=(0,V.jsx)(`span`,{className:`text-muted-foreground flex shrink-0 items-center [&_svg]:size-2.5`,children:e.icon}),t[4]=e.icon,t[5]=i);let a;t[6]===e.window.utilization?a=t[7]:(a=_t(e.window.utilization),t[6]=e.window.utilization,t[7]=a);let o;t[8]===e.window.utilization?o=t[9]:(o=Math.round(e.window.utilization),t[8]=e.window.utilization,t[9]=o);let s;t[10]!==a||t[11]!==o?(s=(0,V.jsxs)(`span`,{className:a,children:[o,`%`]}),t[10]=a,t[11]=o,t[12]=s):s=t[12];let l;t[13]!==i||t[14]!==s?(l=(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[i,s]}),t[13]=i,t[14]=s,t[15]=l):l=t[15],n=(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center justify-between gap-1.5 px-2.5`,children:[l,b(r)&&(0,V.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate`,title:`resets ${y(r.value)}`,children:_(r.value)})]}),t[0]=e.icon,t[1]=e.window.resetsAt,t[2]=e.window.utilization,t[3]=n}else n=t[3];return n}function yt(e){let t=(0,B.c)(14),n=e.compact===!0?`flex min-w-0 flex-1 items-center justify-center gap-1 px-1.5`:`flex min-w-0 flex-1 items-center gap-1.5 px-2.5`,r=e.title,i;t[0]===e.icon?i=t[1]:(i=(0,V.jsx)(`span`,{className:`text-muted-foreground flex shrink-0 items-center [&_svg]:size-2.5`,children:e.icon}),t[0]=e.icon,t[1]=i);let a;t[2]===e.utilization?a=t[3]:(a=_t(e.utilization),t[2]=e.utilization,t[3]=a);let o;t[4]===e.utilization?o=t[5]:(o=Math.round(e.utilization),t[4]=e.utilization,t[5]=o);let s;t[6]!==a||t[7]!==o?(s=(0,V.jsxs)(`span`,{className:a,children:[o,`%`]}),t[6]=a,t[7]=o,t[8]=s):s=t[8];let c;return t[9]!==e.title||t[10]!==n||t[11]!==i||t[12]!==s?(c=(0,V.jsxs)(`span`,{className:n,title:r,children:[i,s]}),t[9]=e.title,t[10]=n,t[11]=i,t[12]=s,t[13]=c):c=t[13],c}function bt(){let e=(0,B.c)(32),t=Re(qe);if(Ye(t)){let n;e[0]===t.cause?n=e[1]:(n=h(t.cause),e[0]=t.cause,e[1]=n);let r;e[2]===t.cause?r=e[3]:(r=h(t.cause),e[2]=t.cause,e[3]=r);let i;return e[4]!==n||e[5]!==r?(i=(0,V.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center truncate px-2.5`,title:n,children:r}),e[4]=n,e[5]=r,e[6]=i):i=e[6],i}if(!Ie(t)){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`span`,{className:`text-muted-foreground flex flex-1 items-center px-2.5`,children:`…`}),e[7]=t):t=e[7],t}let n;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(nt,{}),e[8]=n):n=e[8];let r;e[9]===t.value.cpuUtilization?r=e[10]:(r=Math.round(t.value.cpuUtilization),e[9]=t.value.cpuUtilization,e[10]=r);let i=`CPU ${r}%`,a;e[11]!==i||e[12]!==t.value.cpuUtilization?(a=(0,V.jsx)(yt,{compact:!0,icon:n,title:i,utilization:t.value.cpuUtilization}),e[11]=i,e[12]=t.value.cpuUtilization,e[13]=a):a=e[13];let o;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,V.jsx)(st,{}),e[14]=o):o=e[14];let s;e[15]===t.value.memoryUtilization?s=e[16]:(s=Math.round(t.value.memoryUtilization),e[15]=t.value.memoryUtilization,e[16]=s);let c=`System memory ${s}%`,l;e[17]!==c||e[18]!==t.value.memoryUtilization?(l=(0,V.jsx)(yt,{compact:!0,icon:o,title:c,utilization:t.value.memoryUtilization}),e[17]=c,e[18]=t.value.memoryUtilization,e[19]=l):l=e[19];let u;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,V.jsx)(ft,{}),e[20]=u):u=e[20];let d;e[21]===t.value.nodeProcess.heapUsedBytes?d=e[22]:(d=de(t.value.nodeProcess.heapUsedBytes),e[21]=t.value.nodeProcess.heapUsedBytes,e[22]=d);let f;e[23]===t.value.nodeProcess.heapLimitBytes?f=e[24]:(f=de(t.value.nodeProcess.heapLimitBytes),e[23]=t.value.nodeProcess.heapLimitBytes,e[24]=f);let p=`Node heap ${d} / ${f}`,m;e[25]!==p||e[26]!==t.value.nodeProcess.heapUtilization?(m=(0,V.jsx)(yt,{compact:!0,icon:u,title:p,utilization:t.value.nodeProcess.heapUtilization}),e[25]=p,e[26]=t.value.nodeProcess.heapUtilization,e[27]=m):m=e[27];let g;return e[28]!==m||e[29]!==a||e[30]!==l?(g=(0,V.jsxs)(V.Fragment,{children:[a,l,m]}),e[28]=m,e[29]=a,e[30]=l,e[31]=g):g=e[31],g}function xt(e){let t=(0,B.c)(19),n;t[0]===e.layer?n=t[1]:(n=He(e.layer),t[0]=e.layer,t[1]=n);let r=Re(n);if(Ye(r)){let e;t[2]===r.cause?e=t[3]:(e=h(r.cause),t[2]=r.cause,t[3]=e);let n;t[4]===r.cause?n=t[5]:(n=h(r.cause),t[4]=r.cause,t[5]=n);let i;return t[6]!==e||t[7]!==n?(i=(0,V.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center truncate px-2.5`,title:e,children:n}),t[6]=e,t[7]=n,t[8]=i):i=t[8],i}if(!Ie(r)){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`span`,{className:`text-muted-foreground flex flex-1 items-center px-2.5`,children:`…`}),t[9]=e):e=t[9],e}let i;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,V.jsx)(tt,{}),t[10]=i):i=t[10];let a;t[11]===r.value.fiveHour?a=t[12]:(a=(0,V.jsx)(vt,{icon:i,window:r.value.fiveHour}),t[11]=r.value.fiveHour,t[12]=a);let o;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,V.jsx)(et,{}),t[13]=o):o=t[13];let s;t[14]===r.value.weekly?s=t[15]:(s=(0,V.jsx)(vt,{icon:o,window:r.value.weekly}),t[14]=r.value.weekly,t[15]=s);let c;return t[16]!==a||t[17]!==s?(c=(0,V.jsxs)(V.Fragment,{children:[a,s]}),t[16]=a,t[17]=s,t[18]=c):c=t[18],c}function St(){let e=(0,B.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsxs)(`div`,{className:`flex shrink-0 flex-col divide-y border-t font-mono text-[11px]`,children:[(0,V.jsxs)(`div`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:[(0,V.jsx)(`span`,{className:`flex w-8 shrink-0 items-center justify-center`,children:(0,V.jsx)(Qe,{className:`text-muted-foreground size-3`})}),(0,V.jsx)(bt,{})]}),gt.map(Ct)]}),e[0]=t):t=e[0],t}function Ct(e){return(0,V.jsxs)(`div`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:[(0,V.jsx)(`span`,{className:`flex w-8 shrink-0 items-center justify-center`,children:(0,V.jsx)(Me,{layer:e})}),(0,V.jsx)(xt,{layer:e})]},e)}var wt=1,Tt=.9,Et=.8,Dt=.17,Ot=.1,kt=.999,At=.9999,jt=.99,Mt=/[\\\/_+.#"@\[\(\{&]/,Nt=/[\\\/_+.#"@\[\(\{&]/g,Pt=/[\s-]/,Ft=/[\s-]/g;function It(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?wt:jt;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=It(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=wt:Mt.test(e.charAt(l-1))?(d*=Et,p=e.slice(i,l-1).match(Nt),p&&i>0&&(d*=kt**+p.length)):Pt.test(e.charAt(l-1))?(d*=Tt,m=e.slice(i,l-1).match(Ft),m&&i>0&&(d*=kt**+m.length)):(d*=Dt,i>0&&(d*=kt**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=At)),(d<Ot&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=It(e,t,n,r,l+1,a+2,o),f*Ot>d&&(d=f*Ot)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Lt(e){return e.toLowerCase().replace(Ft,` `)}function Rt(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,It(e,t,Lt(e),Lt(t),0,0,{})}typeof window<`u`&&window.document&&window.document.createElement;function H(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function zt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function U(...e){return t=>{let n=!1,r=e.map(e=>{let r=zt(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():zt(e[t],null)}}}}function W(...e){return z.useCallback(U(...e),e)}function Bt(e,t){let n=z.createContext(t),r=e=>{let{children:t,...r}=e,i=z.useMemo(()=>r,Object.values(r));return(0,V.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=z.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Vt(e,t=[]){let n=[];function r(t,r){let i=z.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=z.useMemo(()=>o,Object.values(o));return(0,V.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=z.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>z.createContext(e));return function(n){let r=n?.[e]||t;return z.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Ht(i,...t)]}function Ht(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return z.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Ut=globalThis?.document?z.useLayoutEffect:()=>{},Wt=z.useId||(()=>void 0),Gt=0;function G(e){let[t,n]=z.useState(Wt());return Ut(()=>{e||n(e=>e??String(Gt++))},[e]),e||(t?`radix-${t}`:``)}var Kt=z.useInsertionEffect||Ut;function qt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Jt({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=z.useRef(e!==void 0);z.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,z.useCallback(t=>{if(s){let n=Yt(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Jt({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return Kt(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Yt(e){return typeof e==`function`}var Xt=e(ve(),1);function Zt(e){let t=Qt(e),n=z.forwardRef((e,n)=>{let{children:r,...i}=e,a=z.Children.toArray(r),o=a.find(en);if(o){let e=o.props.children,r=a.map(t=>t===o?z.Children.count(e)>1?z.Children.only(null):z.isValidElement(e)?e.props.children:null:t);return(0,V.jsx)(t,{...i,ref:n,children:z.isValidElement(e)?z.cloneElement(e,void 0,r):null})}return(0,V.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Qt(e){let t=z.forwardRef((e,t)=>{let{children:n,...r}=e;if(z.isValidElement(n)){let e=nn(n),i=tn(r,n.props);return n.type!==z.Fragment&&(i.ref=t?U(t,e):e),z.cloneElement(n,i)}return z.Children.count(n)>1?z.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $t=Symbol(`radix.slottable`);function en(e){return z.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===$t}function tn(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function nn(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var K=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Zt(`Primitive.${t}`),r=z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,V.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function rn(e,t){e&&Xt.flushSync(()=>e.dispatchEvent(t))}function an(e){let t=z.useRef(e);return z.useEffect(()=>{t.current=e}),z.useMemo(()=>(...e)=>t.current?.(...e),[])}function on(e,t=globalThis?.document){let n=an(e);z.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var sn=`DismissableLayer`,cn=`dismissableLayer.update`,ln=`dismissableLayer.pointerDownOutside`,un=`dismissableLayer.focusOutside`,dn,fn=z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pn=z.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=z.useContext(fn),[u,d]=z.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=z.useState({}),m=W(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,ee=l.layersWithOutsidePointerEventsDisabled.size>0,y=v>=_,b=gn(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!y||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),x=_n(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return on(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),z.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(dn=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),vn(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=dn)}},[u,f,n,l]),z.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),vn())},[u,l]),z.useEffect(()=>{let e=()=>p({});return document.addEventListener(cn,e),()=>document.removeEventListener(cn,e)},[]),(0,V.jsx)(K.div,{...c,ref:m,style:{pointerEvents:ee?y?`auto`:`none`:void 0,...e.style},onFocusCapture:H(e.onFocusCapture,x.onFocusCapture),onBlurCapture:H(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,b.onPointerDownCapture)})});pn.displayName=sn;var mn=`DismissableLayerBranch`,hn=z.forwardRef((e,t)=>{let n=z.useContext(fn),r=z.useRef(null),i=W(t,r);return z.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,V.jsx)(K.div,{...e,ref:i})});hn.displayName=mn;function gn(e,t=globalThis?.document){let n=an(e),r=z.useRef(!1),i=z.useRef(()=>{});return z.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){yn(ln,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function _n(e,t=globalThis?.document){let n=an(e),r=z.useRef(!1);return z.useEffect(()=>{let e=e=>{e.target&&!r.current&&yn(un,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vn(){let e=new CustomEvent(cn);document.dispatchEvent(e)}function yn(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?rn(i,a):i.dispatchEvent(a)}var bn=`focusScope.autoFocusOnMount`,xn=`focusScope.autoFocusOnUnmount`,Sn={bubbles:!1,cancelable:!0},Cn=`FocusScope`,wn=z.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=z.useState(null),l=an(i),u=an(a),d=z.useRef(null),f=W(t,e=>c(e)),p=z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;z.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:q(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||q(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&q(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),z.useEffect(()=>{if(s){jn.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(bn,Sn);s.addEventListener(bn,l),s.dispatchEvent(t),t.defaultPrevented||(Tn(Pn(Dn(s)),{select:!0}),document.activeElement===e&&q(s))}return()=>{s.removeEventListener(bn,l),setTimeout(()=>{let t=new CustomEvent(xn,Sn);s.addEventListener(xn,u),s.dispatchEvent(t),t.defaultPrevented||q(e??document.body,{select:!0}),s.removeEventListener(xn,u),jn.remove(p)},0)}}},[s,l,u,p]);let m=z.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=En(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&q(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&q(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,V.jsx)(K.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});wn.displayName=Cn;function Tn(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(q(r,{select:t}),document.activeElement!==n)return}function En(e){let t=Dn(e);return[On(t,e),On(t.reverse(),e)]}function Dn(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function On(e,t){for(let n of e)if(!kn(n,{upTo:t}))return n}function kn(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function An(e){return e instanceof HTMLInputElement&&`select`in e}function q(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&An(e)&&t&&e.select()}}var jn=Mn();function Mn(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Nn(e,t),e.unshift(t)},remove(t){e=Nn(e,t),e[0]?.resume()}}}function Nn(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Pn(e){return e.filter(e=>e.tagName!==`A`)}var Fn=`Portal`,In=z.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=z.useState(!1);Ut(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Xt.createPortal((0,V.jsx)(K.div,{...r,ref:t}),o):null});In.displayName=Fn;function Ln(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}var Rn=e=>{let{present:t,children:n}=e,r=zn(t),i=typeof n==`function`?n({present:r.isPresent}):z.Children.only(n),a=W(r.ref,Vn(i));return typeof n==`function`||r.isPresent?z.cloneElement(i,{ref:a}):null};Rn.displayName=`Presence`;function zn(e){let[t,n]=z.useState(),r=z.useRef(null),i=z.useRef(e),a=z.useRef(`none`),[o,s]=Ln(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return z.useEffect(()=>{let e=Bn(r.current);a.current=o===`mounted`?e:`none`},[o]),Ut(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Bn(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Ut(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Bn(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Bn(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:z.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Bn(e){return e?.animationName||`none`}function Vn(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Hn=0;function Un(){z.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Wn()),document.body.insertAdjacentElement(`beforeend`,e[1]??Wn()),Hn++,()=>{Hn===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Hn--}},[])}function Wn(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var J=function(){return J=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},J.apply(this,arguments)};function Gn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Kn(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var qn=`right-scroll-bar-position`,Jn=`width-before-scroll-bar`,Yn=`with-scroll-bars-hidden`,Xn=`--removed-body-scroll-bar-size`;function Zn(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Qn(e,t){var n=(0,z.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var $n=typeof window<`u`?z.useLayoutEffect:z.useEffect,er=new WeakMap;function tr(e,t){var n=Qn(t||null,function(t){return e.forEach(function(e){return Zn(e,t)})});return $n(function(){var t=er.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Zn(e,null)}),i.forEach(function(e){r.has(e)||Zn(e,a)})}er.set(n,e)},[e]),n}function nr(e){return e}function rr(e,t){t===void 0&&(t=nr);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ir(e){e===void 0&&(e={});var t=rr(null);return t.options=J({async:!0,ssr:!1},e),t}var ar=function(e){var t=e.sideCar,n=Gn(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return z.createElement(r,J({},n))};ar.isSideCarExport=!0;function or(e,t){return e.useMedium(t),ar}var sr=ir(),cr=function(){},lr=z.forwardRef(function(e,t){var n=z.useRef(null),r=z.useState({onScrollCapture:cr,onWheelCapture:cr,onTouchMoveCapture:cr}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,ee=e.gapMode,y=Gn(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),b=f,x=tr([n,t]),S=J(J({},y),i);return z.createElement(z.Fragment,null,u&&z.createElement(b,{sideCar:sr,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:ee}),o?z.cloneElement(z.Children.only(s),J(J({},S),{ref:x})):z.createElement(v,J({},S,{className:c,ref:x}),s))});lr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},lr.classNames={fullWidth:Jn,zeroRight:qn};var ur,dr=function(){if(ur)return ur;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function fr(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=dr();return t&&e.setAttribute(`nonce`,t),e}function pr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mr(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var hr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=fr())&&(pr(t,n),mr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},gr=function(){var e=hr();return function(t,n){z.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},_r=function(){var e=gr();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},vr={left:0,top:0,right:0,gap:0},yr=function(e){return parseInt(e||``,10)||0},br=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[yr(n),yr(r),yr(i)]},xr=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return vr;var t=br(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Sr=_r(),Cr=`data-scroll-locked`,wr=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
- .${Yn} {
3
- overflow: hidden ${r};
4
- padding-right: ${s}px ${r};
5
- }
6
- body[${Cr}] {
7
- overflow: hidden ${r};
8
- overscroll-behavior: contain;
9
- ${[t&&`position: relative ${r};`,n===`margin`&&`
10
- padding-left: ${i}px;
11
- padding-top: ${a}px;
12
- padding-right: ${o}px;
13
- margin-left:0;
14
- margin-top:0;
15
- margin-right: ${s}px ${r};
16
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
- }
18
-
19
- .${qn} {
20
- right: ${s}px ${r};
21
- }
22
-
23
- .${Jn} {
24
- margin-right: ${s}px ${r};
25
- }
26
-
27
- .${qn} .${qn} {
28
- right: 0 ${r};
29
- }
30
-
31
- .${Jn} .${Jn} {
32
- margin-right: 0 ${r};
33
- }
34
-
35
- body[${Cr}] {
36
- ${Xn}: ${s}px;
37
- }
38
- `},Tr=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Er=function(){z.useEffect(function(){return document.body.setAttribute(Cr,(Tr()+1).toString()),function(){var e=Tr()-1;e<=0?document.body.removeAttribute(Cr):document.body.setAttribute(Cr,e.toString())}},[])},Dr=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Er();var a=z.useMemo(function(){return xr(i)},[i]);return z.createElement(Sr,{styles:wr(a,!t,i,n?``:`!important`)})},Or=!1;if(typeof window<`u`)try{var kr=Object.defineProperty({},"passive",{get:function(){return Or=!0,!0}});window.addEventListener(`test`,kr,kr),window.removeEventListener(`test`,kr,kr)}catch{Or=!1}var Ar=Or?{passive:!1}:!1,jr=function(e){return e.tagName===`TEXTAREA`},Mr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!jr(e)&&n[t]===`visible`)},Nr=function(e){return Mr(e,`overflowY`)},Pr=function(e){return Mr(e,`overflowX`)},Fr=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Rr(e,r)){var i=zr(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ir=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Lr=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Rr=function(e,t){return e===`v`?Nr(t):Pr(t)},zr=function(e,t){return e===`v`?Ir(t):Lr(t)},Br=function(e,t){return e===`h`&&t===`rtl`?-1:1},Vr=function(e,t,n,r,i){var a=Br(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=zr(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Rr(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Hr=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ur=function(e){return[e.deltaX,e.deltaY]},Wr=function(e){return e&&`current`in e?e.current:e},Gr=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Kr=function(e){return`
39
- .block-interactivity-${e} {pointer-events: none;}
40
- .allow-interactivity-${e} {pointer-events: all;}
41
- `},qr=0,Jr=[];function Yr(e){var t=z.useRef([]),n=z.useRef([0,0]),r=z.useRef(),i=z.useState(qr++)[0],a=z.useState(_r)[0],o=z.useRef(e);z.useEffect(function(){o.current=e},[e]),z.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Kn([e.lockRef.current],(e.shards||[]).map(Wr),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=z.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Hr(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Fr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Fr(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Vr(h,t,e,h===`h`?s:c,!0)},[]),c=z.useCallback(function(e){var n=e;if(!(!Jr.length||Jr[Jr.length-1]!==a)){var r=`deltaY`in n?Ur(n):Hr(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Gr(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Wr).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=z.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Xr(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=z.useCallback(function(e){n.current=Hr(e),r.current=void 0},[]),d=z.useCallback(function(t){l(t.type,Ur(t),t.target,s(t,e.lockRef.current))},[]),f=z.useCallback(function(t){l(t.type,Hr(t),t.target,s(t,e.lockRef.current))},[]);z.useEffect(function(){return Jr.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Ar),document.addEventListener(`touchmove`,c,Ar),document.addEventListener(`touchstart`,u,Ar),function(){Jr=Jr.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Ar),document.removeEventListener(`touchmove`,c,Ar),document.removeEventListener(`touchstart`,u,Ar)}},[]);var p=e.removeScrollBar,m=e.inert;return z.createElement(z.Fragment,null,m?z.createElement(a,{styles:Kr(i)}):null,p?z.createElement(Dr,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Xr(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Zr=or(sr,Yr),Qr=z.forwardRef(function(e,t){return z.createElement(lr,J({},e,{ref:t,sideCar:Zr}))});Qr.classNames=lr.classNames;var $r=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},ei=new WeakMap,ti=new WeakMap,ni={},ri=0,ii=function(e){return e&&(e.host||ii(e.parentNode))},ai=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ii(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},oi=function(e,t,n,r){var i=ai(t,Array.isArray(e)?e:[e]);ni[n]||(ni[n]=new WeakMap);var a=ni[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(ei.get(e)||0)+1,l=(a.get(e)||0)+1;ei.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ti.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),ri++,function(){o.forEach(function(e){var t=ei.get(e)-1,i=a.get(e)-1;ei.set(e,t),a.set(e,i),t||(ti.has(e)||e.removeAttribute(r),ti.delete(e)),i||e.removeAttribute(n)}),ri--,ri||(ei=new WeakMap,ei=new WeakMap,ti=new WeakMap,ni={})}},si=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||$r(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),oi(r,i,n,`aria-hidden`)):function(){return null}},ci=`Dialog`,[li,ui]=Vt(ci),[di,Y]=li(ci),fi=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=z.useRef(null),c=z.useRef(null),[l,u]=qt({prop:r,defaultProp:i??!1,onChange:a,caller:ci});return(0,V.jsx)(di,{scope:t,triggerRef:s,contentRef:c,contentId:G(),titleId:G(),descriptionId:G(),open:l,onOpenChange:u,onOpenToggle:z.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};fi.displayName=ci;var pi=`DialogTrigger`,mi=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(pi,n),a=W(t,i.triggerRef);return(0,V.jsx)(K.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ni(i.open),...r,ref:a,onClick:H(e.onClick,i.onOpenToggle)})});mi.displayName=pi;var hi=`DialogPortal`,[gi,_i]=li(hi,{forceMount:void 0}),vi=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Y(hi,t);return(0,V.jsx)(gi,{scope:t,forceMount:n,children:z.Children.map(r,e=>(0,V.jsx)(Rn,{present:n||a.open,children:(0,V.jsx)(In,{asChild:!0,container:i,children:e})}))})};vi.displayName=hi;var yi=`DialogOverlay`,bi=z.forwardRef((e,t)=>{let n=_i(yi,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Y(yi,e.__scopeDialog);return a.modal?(0,V.jsx)(Rn,{present:r||a.open,children:(0,V.jsx)(Si,{...i,ref:t})}):null});bi.displayName=yi;var xi=Zt(`DialogOverlay.RemoveScroll`),Si=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(yi,n);return(0,V.jsx)(Qr,{as:xi,allowPinchZoom:!0,shards:[i.contentRef],children:(0,V.jsx)(K.div,{"data-state":Ni(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),X=`DialogContent`,Ci=z.forwardRef((e,t)=>{let n=_i(X,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Y(X,e.__scopeDialog);return(0,V.jsx)(Rn,{present:r||a.open,children:a.modal?(0,V.jsx)(wi,{...i,ref:t}):(0,V.jsx)(Ti,{...i,ref:t})})});Ci.displayName=X;var wi=z.forwardRef((e,t)=>{let n=Y(X,e.__scopeDialog),r=z.useRef(null),i=W(t,n.contentRef,r);return z.useEffect(()=>{let e=r.current;if(e)return si(e)},[]),(0,V.jsx)(Ei,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:H(e.onFocusOutside,e=>e.preventDefault())})}),Ti=z.forwardRef((e,t)=>{let n=Y(X,e.__scopeDialog),r=z.useRef(!1),i=z.useRef(!1);return(0,V.jsx)(Ei,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Ei=z.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Y(X,n),c=z.useRef(null),l=W(t,c);return Un(),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(wn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,V.jsx)(pn,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Ni(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Li,{titleId:s.titleId}),(0,V.jsx)(zi,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Di=`DialogTitle`,Oi=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(Di,n);return(0,V.jsx)(K.h2,{id:i.titleId,...r,ref:t})});Oi.displayName=Di;var ki=`DialogDescription`,Ai=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(ki,n);return(0,V.jsx)(K.p,{id:i.descriptionId,...r,ref:t})});Ai.displayName=ki;var ji=`DialogClose`,Mi=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(ji,n);return(0,V.jsx)(K.button,{type:`button`,...r,ref:t,onClick:H(e.onClick,()=>i.onOpenChange(!1))})});Mi.displayName=ji;function Ni(e){return e?`open`:`closed`}var Pi=`DialogTitleWarning`,[Fi,Ii]=Bt(Pi,{contentName:X,titleName:Di,docsSlug:`dialog`}),Li=({titleId:e})=>{let t=Ii(Pi),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
42
-
43
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
-
45
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return z.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ri=`DialogDescriptionWarning`,zi=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ii(Ri).contentName}}.`;return z.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Bi=fi,Vi=vi,Hi=bi,Ui=Ci,Wi=Symbol.for(`react.lazy`),Gi=z.use;function Ki(e){return typeof e==`object`&&!!e&&`then`in e}function qi(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Wi&&`_payload`in e&&Ki(e._payload)}function Ji(e){let t=Yi(e),n=z.forwardRef((e,n)=>{let{children:r,...i}=e;qi(r)&&typeof Gi==`function`&&(r=Gi(r._payload));let a=z.Children.toArray(r),o=a.find(Zi);if(o){let e=o.props.children,r=a.map(t=>t===o?z.Children.count(e)>1?z.Children.only(null):z.isValidElement(e)?e.props.children:null:t);return(0,V.jsx)(t,{...i,ref:n,children:z.isValidElement(e)?z.cloneElement(e,void 0,r):null})}return(0,V.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Yi(e){let t=z.forwardRef((e,t)=>{let{children:n,...r}=e;if(qi(n)&&typeof Gi==`function`&&(n=Gi(n._payload)),z.isValidElement(n)){let e=$i(n),i=Qi(r,n.props);return n.type!==z.Fragment&&(i.ref=t?U(t,e):e),z.cloneElement(n,i)}return z.Children.count(n)>1?z.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xi=Symbol(`radix.slottable`);function Zi(e){return z.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Xi}function Qi(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function $i(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Z=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ji(`Primitive.${t}`),r=z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,V.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ea=`[cmdk-group=""]`,ta=`[cmdk-group-items=""]`,na=`[cmdk-group-heading=""]`,ra=`[cmdk-item=""]`,ia=`${ra}:not([aria-disabled="true"])`,aa=`cmdk-item-select`,oa=`data-value`,sa=(e,t,n)=>Rt(e,t,n),ca=z.createContext(void 0),la=()=>z.useContext(ca),ua=z.createContext(void 0),da=()=>z.useContext(ua),fa=z.createContext(void 0),pa=z.forwardRef((e,t)=>{let n=Ea(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Ea(()=>new Set),i=Ea(()=>new Map),a=Ea(()=>new Map),o=Ea(()=>new Set),s=Ta(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=G(),ee=G(),y=G(),b=z.useRef(null),x=Oa();Q(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,S.emit()}},[u]),Q(()=>{x(6,ie)},[]);let S=z.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)re(),C(),x(1,w);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(y);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(x(7,()=>{n.current.selectedItemId=T()?.id,S.emit()}),r||x(5,ie),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}S.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),te=z.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,ne(t,r)),x(2,()=>{C(),S.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),x(3,()=>{re(),C(),n.current.value||w(),S.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=T();x(4,()=>{re(),t?.getAttribute(`id`)===e&&w(),S.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:y,labelId:ee,listInnerRef:b}),[]);function ne(e,t){let r=s.current?.filter??sa;return e?r(e,n.current.search,t):0}function C(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=b.current;ae().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(ta);t?t.appendChild(e.parentElement===t?e:e.closest(`${ta} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${ta} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=b.current?.querySelector(`${ea}[${oa}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function w(){let e=ae().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(oa);S.setState(`value`,e||void 0)}function re(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=ne(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function ie(){var e;let t=T();t&&(t.parentElement?.firstChild===t&&((e=t.closest(ea)?.querySelector(na))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function T(){return b.current?.querySelector(`${ra}[aria-selected="true"]`)}function ae(){return Array.from(b.current?.querySelectorAll(ia)||[])}function oe(e){let t=ae()[e];t&&S.setState(`value`,t.getAttribute(oa))}function E(e){var t;let n=T(),r=ae(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&S.setState(`value`,a.getAttribute(oa))}function D(e){let t=T()?.closest(ea),n;for(;t&&!n;)t=e>0?Ca(t,ea):wa(t,ea),n=t?.querySelector(ia);n?S.setState(`value`,n.getAttribute(oa)):E(e)}let se=()=>oe(ae().length-1),O=e=>{e.preventDefault(),e.metaKey?se():e.altKey?D(1):E(1)},ce=e=>{e.preventDefault(),e.metaKey?oe(0):e.altKey?D(-1):E(-1)};return z.createElement(Z.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&O(e);break;case`ArrowDown`:O(e);break;case`p`:case`k`:g&&e.ctrlKey&&ce(e);break;case`ArrowUp`:ce(e);break;case`Home`:e.preventDefault(),oe(0);break;case`End`:e.preventDefault(),se();break;case`Enter`:{e.preventDefault();let t=T();if(t){let e=new Event(aa);t.dispatchEvent(e)}}}}},z.createElement(`label`,{"cmdk-label":``,htmlFor:te.inputId,id:te.labelId,style:ja},c),Aa(e,e=>z.createElement(ua.Provider,{value:S},z.createElement(ca.Provider,{value:te},e))))}),ma=z.forwardRef((e,t)=>{let n=G(),r=z.useRef(null),i=z.useContext(fa),a=la(),o=Ta(e),s=o.current?.forceMount??i?.forceMount;Q(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Da(n,r,[e.value,e.children,r],e.keywords),l=da(),u=$(e=>e.value&&e.value===c.current),d=$(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);z.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(aa,f),()=>t.removeEventListener(aa,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...ee}=e;return z.createElement(Z.div,{ref:U(r,t),...ee,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),ha=z.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=G(),s=z.useRef(null),c=z.useRef(null),l=G(),u=la(),d=$(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Q(()=>u.group(o),[]),Da(o,s,[e.value,e.heading,c]);let f=z.useMemo(()=>({id:o,forceMount:i}),[i]);return z.createElement(Z.div,{ref:U(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&z.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),Aa(e,e=>z.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},z.createElement(fa.Provider,{value:f},e))))}),ga=z.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=z.useRef(null),a=$(e=>!e.search);return!n&&!a?null:z.createElement(Z.div,{ref:U(i,t),...r,"cmdk-separator":``,role:`separator`})}),_a=z.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=da(),o=$(e=>e.search),s=$(e=>e.selectedItemId),c=la();return z.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),z.createElement(Z.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),va=z.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=z.useRef(null),o=z.useRef(null),s=$(e=>e.selectedItemId),c=la();return z.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),z.createElement(Z.div,{ref:U(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Aa(e,e=>z.createElement(`div`,{ref:U(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),ya=z.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return z.createElement(Bi,{open:n,onOpenChange:r},z.createElement(Vi,{container:o},z.createElement(Hi,{"cmdk-overlay":``,className:i}),z.createElement(Ui,{"aria-label":e.label,"cmdk-dialog":``,className:a},z.createElement(pa,{ref:t,...s}))))}),ba=z.forwardRef((e,t)=>$(e=>e.filtered.count===0)?z.createElement(Z.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),xa=z.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return z.createElement(Z.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Aa(e,e=>z.createElement(`div`,{"aria-hidden":!0},e)))}),Sa=Object.assign(pa,{List:va,Item:ma,Input:_a,Group:ha,Separator:ga,Dialog:ya,Empty:ba,Loading:xa});function Ca(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function wa(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Ta(e){let t=z.useRef(e);return Q(()=>{t.current=e}),t}var Q=typeof window>`u`?z.useEffect:z.useLayoutEffect;function Ea(e){let t=z.useRef();return t.current===void 0&&(t.current=e()),t}function $(e){let t=da(),n=()=>e(t.snapshot());return z.useSyncExternalStore(t.subscribe,n,n)}function Da(e,t,n,r=[]){let i=z.useRef(),a=la();return Q(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(oa,s),i.current=s}),i}var Oa=()=>{let[e,t]=z.useState(),n=Ea(()=>new Map);return Q(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function ka(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Aa({asChild:e,children:t},n){return e&&z.isValidElement(t)?z.cloneElement(ka(t),{ref:t.ref},n(t.props.children)):n(t)}var ja={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Ma(e){let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`group/input-group border-input has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot][aria-invalid=true]]:border-destructive has-disabled:bg-input/50 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-8 w-full min-w-0 items-center rounded-none border transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-1 has-[[data-slot][aria-invalid=true]]:ring-1 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,V.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}var Na=v(`text-muted-foreground h-auto gap-2 py-1.5 font-normal group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-none [&>svg:not([class*='size-'])]:size-3 flex cursor-text items-center justify-center select-none`,{variants:{align:{"inline-start":`pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem] order-first`,"inline-end":`pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem] order-last`,"block-start":`px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start`,"block-end":`px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start`}},defaultVariants:{align:`inline-start`}});function Pa(e){let t=(0,B.c)(11),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({className:n,align:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let o=a===void 0?`inline-start`:a,s;t[4]!==o||t[5]!==n?(s=i(Na({align:o}),n),t[4]=o,t[5]=n,t[6]=s):s=t[6];let c;return t[7]!==o||t[8]!==r||t[9]!==s?(c=(0,V.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":o,className:s,onClick:Fa,...r}),t[7]=o,t[8]=r,t[9]=s,t[10]=c):c=t[10],c}function Fa(e){e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()}v(`gap-2 font-normal shadow-none flex items-center`,{variants:{size:{xs:`h-6 gap-1 rounded-none px-1.5 [&>svg:not([class*='size-'])]:size-3`,sm:``,"icon-xs":`size-6 rounded-none p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function Ia(e){let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`bg-popover text-popover-foreground flex size-full flex-col overflow-hidden rounded-none`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,V.jsx)(Sa,{"data-slot":`command`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function La(e){let t=(0,B.c)(24),n,r,a,o,s,c;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],c=t[6]):({title:o,description:s,children:n,className:r,showCloseButton:c,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s,t[6]=c);let l=o===void 0?`Command Palette`:o,u=s===void 0?`Search for a command to run...`:s,d=c===void 0?!1:c,f;t[7]===r?f=t[8]:(f=i(`top-1/3 translate-y-0 overflow-hidden rounded-none p-0`,r),t[7]=r,t[8]=f);let p;t[9]===l?p=t[10]:(p=(0,V.jsx)(Oe,{children:l}),t[9]=l,t[10]=p);let m;t[11]===u?m=t[12]:(m=(0,V.jsx)(ke,{children:u}),t[11]=u,t[12]=m);let h;t[13]!==p||t[14]!==m?(h=(0,V.jsxs)(Ce,{className:`sr-only`,children:[p,m]}),t[13]=p,t[14]=m,t[15]=h):h=t[15];let g;t[16]!==n||t[17]!==d||t[18]!==f||t[19]!==h?(g=(0,V.jsxs)(De,{className:f,showCloseButton:d,children:[h,n]}),t[16]=n,t[17]=d,t[18]=f,t[19]=h,t[20]=g):g=t[20];let _;return t[21]!==a||t[22]!==g?(_=(0,V.jsx)(je,{...a,children:g}),t[21]=a,t[22]=g,t[23]=_):_=t[23],_}function Ra(e){let t=(0,B.c)(11),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`w-full font-normal outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,n),t[3]=n,t[4]=a);let o;t[5]!==r||t[6]!==a?(o=(0,V.jsx)(Sa.Input,{"data-slot":`command-input`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7];let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(Pa,{children:(0,V.jsx)(dt,{className:`size-3 shrink-0 opacity-50`})}),t[8]=s):s=t[8];let c;return t[9]===o?c=t[10]:(c=(0,V.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`border-b pb-0`,children:(0,V.jsxs)(Ma,{className:`border-input/30 bg-input/30 h-8 border-none shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[o,s]})}),t[9]=o,t[10]=c),c}function za(e){let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`no-scrollbar max-h-72 scroll-py-0 overflow-x-hidden overflow-y-auto outline-none`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,V.jsx)(Sa.List,{"data-slot":`command-list`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ba(e){let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`py-6 text-center font-normal`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,V.jsx)(Sa.Empty,{"data-slot":`command-empty`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Va(e){let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden font-normal **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:font-normal`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,V.jsx)(Sa.Group,{"data-slot":`command-group`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ha(e){let t=(0,B.c)(11),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({className:r,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let o;t[4]===r?o=t[5]:(o=i(`group/command-item data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-none px-2 py-2 font-normal outline-hidden select-none in-data-[slot=dialog-content]:rounded-none! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3`,r),t[4]=r,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(Se,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`}),t[6]=s):s=t[6];let c;return t[7]!==n||t[8]!==a||t[9]!==o?(c=(0,V.jsxs)(Sa.Item,{"data-slot":`command-item`,className:o,...a,children:[n,s]}),t[7]=n,t[8]=a,t[9]=o,t[10]=c):c=t[10],c}function Ua(e){let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-muted-foreground group-data-selected/command-item:text-foreground ml-auto font-normal tracking-widest`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,V.jsx)(`span`,{"data-slot":`command-shortcut`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}var Wa=ze(e=>Be(R.runtime.atom(_e(R,t=>N(e)?t(`projects.branches`,{cwd:e}):pe(Ue.make({branches:[],defaultBranch:`main`}))),{initialValue:Ue.make({branches:[],defaultBranch:`main`})})));function Ga(){let e=(0,B.c)(24),t=be.useNavigate(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={select:Ka},e[0]=n):n=e[0];let r=Xe(n),i;e[1]===r.activeWorktreeId?i=e[2]:(i=We(r.activeWorktreeId),e[1]=r.activeWorktreeId,e[2]=i);let a=Ge(i),o,s,c,l,u;e[3]===t?(o=e[4],s=e[5],c=e[6],l=e[7],u=e[8]):(o=e=>{(0,z.startTransition)(()=>{t({params:{worktree:Ke(e)},to:`/$worktree/diff`})})},s=e=>{(0,z.startTransition)(()=>{t({params:{worktree:Ke(e)},to:`/$worktree/terminal`})})},c=(e,n)=>{(0,z.startTransition)(()=>{t({params:{worktree:Ke(e)},search:{origin:n},to:`/$worktree/portless`})})},l=(e,n)=>{(0,z.startTransition)(()=>{t({params:{worktree:Ke(e)},search:{agentId:n},to:`/$worktree/agent`})})},u=(e,n,r)=>{(0,z.startTransition)(()=>{t({params:{worktree:Ke(e)},search:{inactive:r,sessionId:n},to:`/$worktree/run`})})},e[3]=t,e[4]=o,e[5]=s,e[6]=c,e[7]=l,e[8]=u);let d;e[9]!==a.value.activeProject||e[10]!==a.value.activeWorktree||e[11]!==a.value.agentProfiles||e[12]!==a.value.projects||e[13]!==r.activeView||e[14]!==o||e[15]!==s||e[16]!==c||e[17]!==l||e[18]!==u?(d=(0,V.jsx)(Ne,{defaultSize:`22%`,minSize:`16%`,maxSize:`34%`,children:(0,V.jsx)(go,{activeProject:a.value.activeProject,activeWorktree:a.value.activeWorktree,activeView:r.activeView,agentProfiles:a.value.agentProfiles,projects:a.value.projects,selectWorktree:o,selectTerminal:s,selectPortless:c,selectAgent:l,selectRun:u})}),e[9]=a.value.activeProject,e[10]=a.value.activeWorktree,e[11]=a.value.agentProfiles,e[12]=a.value.projects,e[13]=r.activeView,e[14]=o,e[15]=s,e[16]=c,e[17]=l,e[18]=u,e[19]=d):d=e[19];let f;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,V.jsx)(Fe,{}),e[20]=f):f=e[20];let p;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,V.jsx)(Ne,{defaultSize:`86%`,minSize:`60%`,children:(0,V.jsx)(`div`,{className:`flex h-full min-h-0 flex-col`,children:(0,V.jsx)(ye,{})})}),e[21]=p):p=e[21];let m;return e[22]===d?m=e[23]:(m=(0,V.jsx)(`div`,{className:`bg-background h-full min-h-0 flex-1 overflow-hidden`,children:(0,V.jsxs)(Pe,{orientation:`horizontal`,className:`h-full min-h-0 overflow-hidden`,children:[d,f,p]})}),e[22]=d,e[23]=m),m}function Ka(e){return{activeView:k(S(e.location.pathname),M(f(`/terminal`),Za),M(f(`/portless`),Xa),M(f(`/run`),Ya),M(f(`/agent`),Ja),m(qa)),activeWorktreeId:C(`/`)(e.location.pathname)[1]}}function qa(){return`diff`}function Ja(){return`agent`}function Ya(){return`run`}function Xa(){return`portless`}function Za(){return`terminal`}function Qa(e){return k(C(`/`)(e),ce,E(e=>N(e)&&e!==`.`),a(()=>e))}function $a(e){let t=T(`/home/`)(e)?k(C(`/`)(e),me(3),he(`/`)):void 0;return se(t)&&T(`${t}/`)(e)?`~/${d(o(t)+1)(e)}`:Qa(e)}function eo(e){let t=(0,B.c)(4);if(e.root){let n=e.dirty?`text-amber-500`:`text-current`,r;return t[0]===n?r=t[1]:(r=(0,V.jsx)(ct,{className:n}),t[0]=n,t[1]=r),r}let n=e.dirty?`text-amber-500`:`text-current`,r;return t[2]===n?r=t[3]:(r=(0,V.jsx)(pt,{className:n}),t[2]=n,t[3]=r),r}function to(e,t){return{cwd:e,sessionId:t.sessionId}}function no(e){return{cwd:e.script.cwd,sessionId:e.script.sessionId}}function ro(e){return N(p(e))&&!/\s/u.test(e)}function io(e){return[...e].toSorted((e,t)=>e.taskId.localeCompare(t.taskId))}function ao(e){return[...e].toSorted((e,t)=>e.script.taskId.localeCompare(t.script.taskId))}function oo(e){let t=(0,B.c)(10),n=(0,z.useState)(!1),r,i;if(t[0]!==n||t[1]!==e.cwd||t[2]!==e.runStatuses||t[3]!==e.scripts||t[4]!==e.selectRun){i=Symbol.for(`react.early_return_sentinel`);bb0:{let a=io(e.scripts);if(a.length===0){i=null;break bb0}let o;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,V.jsx)(xe,{}),t[7]=o):o=t[7];let s;t[8]===n?s=t[9]:(s=(0,V.jsx)(P,{icon:o,selected:!1,onClick:()=>{n[1](so)},children:`scripts`}),t[8]=n,t[9]=s),r=(0,V.jsxs)(`li`,{className:`w-full min-w-0`,children:[s,n[0]&&(0,V.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:a.map(t=>(0,V.jsx)(z.Suspense,{fallback:(0,V.jsx)(ge,{}),children:(0,V.jsx)(co,{cwd:e.cwd,run:t,status:e.runStatuses[t.sessionId]??{state:`idle`,title:``},selectRun:e.selectRun})},t.sessionId))})]})}t[0]=n,t[1]=e.cwd,t[2]=e.runStatuses,t[3]=e.scripts,t[4]=e.selectRun,t[5]=r,t[6]=i}else r=t[5],i=t[6];return i===Symbol.for(`react.early_return_sentinel`)?r:i}function so(e){return!e}function co(e){let t=to(e.cwd,e.run),n=L(R.mutation(`terminal.restart`),{mode:`promise`}),r=L(R.mutation(`terminal.stop`),{mode:`promise`}),i=(0,z.useState)(!1);async function a(){if(!i[0]){i[1](!0);try{await(I(e.status.state)&&e.status.state!==`idle`?r({payload:t}):n({payload:t}))}catch(e){F.error(h(e))}finally{i[1](!1)}}}return(0,V.jsx)(`li`,{className:`w-full min-w-0`,children:(0,V.jsx)(P,{actions:(0,V.jsx)(`span`,{className:`flex h-full items-center justify-end`,children:(0,V.jsx)(O,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:i[0],onClick:e=>{e.stopPropagation(),a()},title:I(e.status.state)&&e.status.state!==`idle`?`Stop ${e.run.taskId}`:`Start ${e.run.taskId}`,children:k(S({active:I(e.status.state)&&e.status.state!==`idle`,pending:i[0]}),M({pending:!0},()=>(0,V.jsx)(A,{className:`size-2.5 border opacity-60`})),M({active:!0},()=>(0,V.jsx)(pt,{className:`size-3`})),m(()=>(0,V.jsx)(lt,{className:`size-3`})))})}),icon:(0,V.jsx)(we,{state:e.status.state}),selected:!1,title:e.run.command,onClick:()=>{e.selectRun(e.cwd,e.run.sessionId,e.status.state===`idle`)},children:e.run.taskId})})}function lo(e){let t=(0,B.c)(8),n;t[0]===e.runs?n=t[1]:(n=ao(e.runs),t[0]=e.runs,t[1]=n);let r=n;if(r.length===0)return null;let i;return t[2]!==e.cwd||t[3]!==e.runStatuses||t[4]!==e.selectPortless||t[5]!==e.selectRun||t[6]!==r?(i=(0,V.jsx)(uo,{cwd:e.cwd,runs:r,runStatuses:e.runStatuses,selectPortless:e.selectPortless,selectRun:e.selectRun}),t[2]=e.cwd,t[3]=e.runStatuses,t[4]=e.selectPortless,t[5]=e.selectRun,t[6]=r,t[7]=i):i=t[7],i}function uo(e){let t=(0,z.useState)(!0),n=L(R.mutation(`terminal.restart`),{mode:`promise`}),r=L(R.mutation(`terminal.stop`),{mode:`promise`}),i=(0,z.useState)(!1);async function a(){if(!i[0]){i[1](!0);try{for(let t of e.runs){let i=no(t);ue(e.runs,t=>I(e.runStatuses[t.script.sessionId]?.state??`idle`)&&e.runStatuses[t.script.sessionId]?.state!==`idle`)?await r({payload:i}):await n({payload:i})}}catch(e){F.error(h(e))}finally{i[1](!1)}}}return(0,V.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,V.jsx)(P,{actions:(0,V.jsx)(O,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:i[0],onClick:e=>{e.stopPropagation(),a()},title:ue(e.runs,t=>I(e.runStatuses[t.script.sessionId]?.state??`idle`)&&e.runStatuses[t.script.sessionId]?.state!==`idle`)?`Stop deslop`:`Start deslop`,children:k(S({active:ue(e.runs,t=>I(e.runStatuses[t.script.sessionId]?.state??`idle`)&&e.runStatuses[t.script.sessionId]?.state!==`idle`),pending:i[0]}),M({pending:!0},()=>(0,V.jsx)(A,{className:`size-2.5 border opacity-60`})),M({active:!0},()=>(0,V.jsx)(pt,{className:`size-3`})),m(()=>(0,V.jsx)(lt,{className:`size-3`})))}),icon:(0,V.jsx)(at,{}),selected:!1,onClick:()=>{t[1](e=>!e)},children:`deslop`}),t[0]&&(0,V.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:j(e.runs,t=>(0,V.jsx)(z.Suspense,{fallback:(0,V.jsx)(ge,{}),children:(0,V.jsx)(fo,{run:t,status:e.runStatuses[t.script.sessionId]??{state:`idle`,title:``},selectPortless:e.selectPortless,selectRun:e.selectRun})},t.script.sessionId))})]})}function fo(e){let t=(0,B.c)(16),n;t[0]===e?n=t[1]:(n=t=>{t.stopPropagation(),e.selectPortless(e.run.script.cwd,e.run.origin.origin)},t[0]=e,t[1]=n);let r=`Open ${e.run.script.taskId} preview`,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,V.jsx)(at,{className:`size-3`}),t[2]=i):i=t[2];let a;t[3]!==n||t[4]!==r?(a=(0,V.jsx)(O,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,onClick:n,title:r,children:i}),t[3]=n,t[4]=r,t[5]=a):a=t[5];let o;t[6]===e.status.state?o=t[7]:(o=(0,V.jsx)(we,{state:e.status.state}),t[6]=e.status.state,t[7]=o);let s=e.run.script.command??e.run.script.taskId,c;t[8]===e?c=t[9]:(c=()=>{e.selectRun(e.run.script.cwd,e.run.script.sessionId,e.status.state===`idle`)},t[8]=e,t[9]=c);let l;return t[10]!==e.run.script.taskId||t[11]!==a||t[12]!==o||t[13]!==s||t[14]!==c?(l=(0,V.jsx)(`li`,{className:`w-full min-w-0`,children:(0,V.jsx)(P,{actions:a,icon:o,selected:!1,title:s,onClick:c,children:e.run.script.taskId})}),t[10]=e.run.script.taskId,t[11]=a,t[12]=o,t[13]=s,t[14]=c,t[15]=l):l=t[15],l}function po(e){let t=(0,B.c)(17),n;t[0]===e?n=t[1]:(n=t=>{t.stopPropagation(),e.onStop()},t[0]=e,t[1]=n);let r=`Stop ${e.session.label}`,i;t[2]===e.stopping?i=t[3]:(i=e.stopping?(0,V.jsx)(A,{className:`size-2.5 border opacity-60`}):(0,V.jsx)(pt,{className:`size-3`}),t[2]=e.stopping,t[3]=i);let a;t[4]!==e.stopping||t[5]!==n||t[6]!==r||t[7]!==i?(a=(0,V.jsx)(O,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:e.stopping,onClick:n,title:r,children:i}),t[4]=e.stopping,t[5]=n,t[6]=r,t[7]=i,t[8]=a):a=t[8];let o;t[9]===e.session.state.state?o=t[10]:(o=(0,V.jsx)(we,{state:e.session.state.state}),t[9]=e.session.state.state,t[10]=o);let s=e.session.state.title?`Title: ${e.session.state.title}`:e.session.label,c=e.session.state.title===``?e.session.label:e.session.state.title,l;return t[11]!==e.onSelect||t[12]!==a||t[13]!==o||t[14]!==s||t[15]!==c?(l=(0,V.jsx)(`li`,{className:`w-full min-w-0`,children:(0,V.jsx)(P,{actions:a,icon:o,selected:!1,title:s,onClick:e.onSelect,children:c})}),t[11]=e.onSelect,t[12]=a,t[13]=o,t[14]=s,t[15]=c,t[16]=l):l=t[16],l}function mo(e){let t=L(R.mutation(`agents.create`),{mode:`promise`}),n=L(R.mutation(`agents.remove`),{mode:`promise`}),r=(0,z.useState)(()=>re()),i=(0,z.useState)(()=>re());async function a(n){if(!w(r[0],n.id)){r[1](e=>s(e,n.id));try{let r=await t({payload:{cwd:e.cwd,profileId:n.id}});e.selectAgent(e.cwd,r.uuid)}catch(e){F.error(h(e))}finally{r[1](e=>oe(e,n.id))}}}async function o(t){if(!w(i[0],t.uuid)){i[1](e=>s(e,t.uuid));try{await n({payload:{cwd:e.cwd,uuid:t.uuid}})}catch(e){F.error(h(e))}finally{i[1](e=>oe(e,t.uuid))}}}return(0,V.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,V.jsx)(P,{icon:(0,V.jsx)($e,{}),selected:!1,children:`agents`}),(0,V.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:j(e.profiles,t=>{let n=k(e.sessions,D(e=>e.profileId===t.id));return(0,V.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,V.jsx)(P,{actions:(0,V.jsx)(O,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:w(r[0],t.id),onClick:e=>{e.stopPropagation(),a(t)},title:`Start ${t.label}`,children:w(r[0],t.id)?(0,V.jsx)(A,{className:`size-2.5 border opacity-60`}):(0,V.jsx)(lt,{className:`size-3`})}),icon:(0,V.jsx)(Me,{layer:t.icon}),selected:!1,children:t.label}),n.length>0&&(0,V.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:j(n,t=>(0,V.jsx)(po,{session:t,onSelect:()=>{e.selectAgent(e.cwd,t.uuid)},onStop:()=>{o(t)},stopping:w(i[0],t.uuid)},t.uuid))})]},t.id)})})]})}function ho(e){return k(e.agents,ue(e=>I(e.state.state)&&e.state.state!==`idle`))}function go(e){let t=L(R.mutation(`projects.fix`),{mode:`promise`}),n=L(R.mutation(`projects.createWorktree`),{mode:`promise`}),r=L(R.mutation(`projects.deleteWorktree`),{mode:`promise`}),[i,a]=(0,z.useState)(()=>({actionsOpen:!1,branch:``,createWorktreeProjectRoot:e.activeProject?.repository.root,creatingBranch:``,deleteDialogOpen:!1,deletingWorktree:!1,filterActiveAgents:!1,fixingProject:``})),o=k(e.projects,E(e=>e.repository.root===i.createWorktreeProjectRoot),g)??e.activeProject,s=Ge(Wa(o?.repository.root??``)),c=k(s.value.branches,D(e=>e.type===`local`),j(e=>e.name)),l=k(s.value.branches,D(e=>N(e.name)),D(e=>e.type===`local`||!u(c,e.name)),ie((e,t)=>e.name===t.name&&e.type===t.type&&e.remote===t.remote),D(e=>!k(o?.worktrees??[],j(e=>e.branch??``),D(N),u(e.name)))),d=p(i.branch),f=k(l,ue(e=>e.name===d));async function _(t){let r=t?.name??d;if(te(r)||N(i.creatingBranch))return;if(ne(t)&&!ro(r)){F.error(`Branch names cannot contain spaces.`);return}let s=ne(t)?Je.make({}):S(t).pipe(M({type:`local`},()=>Le.make({})),m(e=>Ve.make({remote:e.remote??`origin`})));a(e=>({...e,creatingBranch:r}));try{let t=await n({payload:{branch:r,cwd:(o??e.activeProject)?.repository.root??``,source:s}});a(e=>({...e,actionsOpen:!1,branch:``})),e.selectWorktree(t)}catch(e){F.error(h(e))}finally{a(e=>({...e,creatingBranch:``}))}}async function v(){if(!(!e.activeWorktree||i.deletingWorktree)){a(e=>({...e,deletingWorktree:!0}));try{await r({payload:{cwd:e.activeWorktree.root}}),a(e=>({...e,deleteDialogOpen:!1}))}catch(e){F.error(h(e))}finally{a(e=>({...e,deletingWorktree:!1}))}}}async function ee(e){a(t=>({...t,fixingProject:e}));try{await t({payload:{cwd:e}})}catch(e){F.error(h(e))}finally{a(e=>({...e,fixingProject:``}))}}return(0,V.jsxs)(`div`,{className:`flex h-full flex-col border-r`,children:[(0,V.jsxs)(`div`,{className:`grid h-8 grid-cols-[minmax(0,1fr)_auto] items-center border-b`,children:[(0,V.jsx)(O,{type:`button`,variant:`ghost`,size:`sm`,className:`text-muted-foreground hover:text-foreground flex h-full w-full min-w-0 justify-start px-3 text-left`,onClick:()=>{e.activeWorktree&&navigator.clipboard.writeText(e.activeWorktree.root)},children:(0,V.jsx)(`span`,{className:`min-w-0 truncate`,children:e.activeWorktree?$a(e.activeWorktree.root):`No worktree selected`})}),(0,V.jsxs)(`span`,{className:`flex items-center`,children:[(0,V.jsx)(O,{type:`button`,variant:`ghost`,size:`icon`,"aria-pressed":i.filterActiveAgents,"aria-label":i.filterActiveAgents?`Showing active agent worktrees`:`Showing all worktrees`,className:i.filterActiveAgents?`bg-muted text-foreground h-8 w-8`:`h-8 w-8`,onClick:()=>{a(e=>({...e,filterActiveAgents:!e.filterActiveAgents}))},title:i.filterActiveAgents?`Show all worktrees`:`Show active agent worktrees`,children:i.filterActiveAgents?(0,V.jsx)($e,{className:`size-3`}):(0,V.jsx)(ot,{className:`size-3`})}),e.activeWorktree&&e.activeWorktree.root!==e.activeProject?.repository.root&&(0,V.jsx)(O,{type:`button`,variant:`destructive`,size:`icon`,className:`h-8 w-8`,disabled:i.deletingWorktree,onClick:()=>{a(e=>({...e,deleteDialogOpen:!0}))},title:`Delete worktree`,children:i.deletingWorktree?(0,V.jsx)(A,{className:`size-2.5 border opacity-60`}):(0,V.jsx)(ht,{className:`size-3`})})]})]}),(0,V.jsx)(je,{open:i.deleteDialogOpen,onOpenChange:e=>{a(t=>({...t,deleteDialogOpen:e}))},children:(0,V.jsxs)(De,{showCloseButton:!i.deletingWorktree,children:[(0,V.jsxs)(Ce,{children:[(0,V.jsx)(Oe,{children:`Delete worktree`}),(0,V.jsx)(ke,{children:e.activeWorktree?`Delete ${e.activeWorktree.branch??Qa(e.activeWorktree.root)}?`:`No worktree selected.`})]}),(0,V.jsxs)(Te,{children:[(0,V.jsx)(O,{type:`button`,variant:`outline`,disabled:i.deletingWorktree,onClick:()=>{a(e=>({...e,deleteDialogOpen:!1}))},children:`Cancel`}),(0,V.jsxs)(O,{type:`button`,variant:`destructive`,disabled:!e.activeWorktree||i.deletingWorktree,onClick:()=>{v(),a(e=>({...e,actionsOpen:!1}))},children:[i.deletingWorktree?(0,V.jsx)(A,{className:`size-2.5 border opacity-60`}):(0,V.jsx)(ht,{className:`size-3`}),`Delete`]})]})]})}),(0,V.jsx)(La,{open:i.actionsOpen,onOpenChange:e=>{a(t=>({...t,actionsOpen:e}))},title:`Create worktree`,description:`Create or open a worktree branch.`,className:`sm:max-w-2xl`,children:(0,V.jsxs)(Ia,{onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&a(e=>({...e,actionsOpen:!1}))},children:[(0,V.jsx)(Ra,{placeholder:`Find or create branch in ${o?Qa(o.repository.root):`workspace`}...`,value:i.branch,onValueChange:e=>{a(t=>({...t,branch:e}))},onKeyDown:e=>{e.key===`Enter`&&N(d)&&o&&(e.preventDefault(),_(k(l,E(e=>e.name===d),g)))}}),(0,V.jsxs)(za,{children:[(0,V.jsx)(Ba,{children:N(d)&&!ro(d)?`Branch names cannot contain spaces.`:`No matching branch.`}),o&&(0,V.jsxs)(Va,{children:[N(d)&&ro(d)&&!f&&(0,V.jsxs)(Ha,{value:d,disabled:N(i.creatingBranch),onSelect:()=>{_()},children:[i.creatingBranch===d?(0,V.jsx)(A,{className:`size-2.5 border opacity-60`}):(0,V.jsx)(rt,{}),(0,V.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Create `,d]}),(0,V.jsxs)(Ua,{children:[`origin/`,s.value.defaultBranch]})]}),j(l,e=>{let t=i.creatingBranch===e.name?(0,V.jsx)(A,{className:`size-2.5 border opacity-60`}):S(e.type).pipe(M(`local`,()=>(0,V.jsx)(it,{})),m(()=>(0,V.jsx)(at,{})));return(0,V.jsxs)(Ha,{value:e.name,onSelect:()=>{a(t=>({...t,branch:e.name})),_(e)},children:[t,(0,V.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,V.jsx)(Ua,{children:e.type})]},`${e.type}:${e.remote??``}:${e.name}`)})]})]})]})}),(0,V.jsx)(Ae,{className:`min-h-0 flex-1 overflow-y-auto px-0 py-1`,children:(0,V.jsx)(Ee,{children:j(e.projects,t=>{let n=i.filterActiveAgents?k(t.worktrees,D(ho)):t.worktrees;if(n.length===0)return null;let r=g(E(n,e=>e.root===t.repository.root))??n[0];return(0,V.jsxs)(`li`,{className:`min-w-0 py-1 first:pt-0`,children:[(0,V.jsxs)(`div`,{className:`text-foreground grid h-7 w-full min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2 px-3 pr-2 text-left font-normal hover:bg-transparent`,children:[(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,V.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center [&_svg]:size-3`,children:(0,V.jsx)(Ze,{})}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,V.jsx)(`button`,{type:`button`,className:`tree-label flex min-w-0 items-center gap-1.5 text-left`,onClick:()=>{r&&e.selectWorktree(r.root)},children:(0,V.jsx)(`span`,{className:`min-w-0 truncate`,children:Qa(t.repository.root)})})})]}),(0,V.jsxs)(`span`,{className:`flex items-center`,children:[(0,V.jsx)(O,{variant:`ghost`,size:`icon-xs`,className:`h-5 w-5 rounded-none opacity-70 hover:opacity-100`,disabled:i.fixingProject===t.repository.root,onClick:e=>{e.stopPropagation(),ee(t.repository.root)},title:`Fix repo state`,children:i.fixingProject===t.repository.root?(0,V.jsx)(A,{className:`size-2.5 border opacity-60`}):(0,V.jsx)(ut,{className:`size-3`})}),(0,V.jsx)(O,{variant:`ghost`,size:`icon-xs`,className:`h-5 w-5 rounded-none opacity-70 hover:opacity-100`,onClick:e=>{e.stopPropagation(),a(e=>({...e,actionsOpen:!0,branch:``,createWorktreeProjectRoot:t.repository.root}))},title:`Create worktree`,children:(0,V.jsx)(rt,{className:`size-3`})})]})]}),(0,V.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:j(n,n=>(0,V.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,V.jsx)(P,{icon:(0,V.jsx)(eo,{dirty:!1,root:n.root===t.repository.root}),selected:e.activeView===`diff`&&e.activeWorktree?.root===n.root,onClick:()=>{e.selectWorktree(n.root)},children:n.branch??Qa(n.root)},n.root),(0,V.jsxs)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:[(0,V.jsx)(z.Suspense,{fallback:(0,V.jsx)(ge,{}),children:(0,V.jsx)(mo,{cwd:n.root,profiles:e.agentProfiles,sessions:n.agents,selectAgent:e.selectAgent})}),(0,V.jsx)(`li`,{className:`w-full min-w-0`,children:(0,V.jsx)(P,{icon:(0,V.jsx)(mt,{}),selected:e.activeView===`terminal`&&e.activeWorktree?.root===n.root,onClick:()=>{e.selectTerminal(n.root)},children:`terminal`})}),(0,V.jsx)(z.Suspense,{fallback:(0,V.jsx)(ge,{}),children:(0,V.jsx)(lo,{cwd:n.root,runStatuses:n.runStatuses,runs:n.portlessRuns,selectPortless:e.selectPortless,selectRun:e.selectRun})}),(0,V.jsx)(z.Suspense,{fallback:(0,V.jsx)(ge,{}),children:(0,V.jsx)(oo,{cwd:n.root,runStatuses:n.runStatuses,scripts:n.scriptRuns,selectRun:e.selectRun})})]})]},n.root))})]},t.repository.gitDirectory)})})}),(0,V.jsx)(St,{})]})}export{Ga as component};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/run-CeqkWWtZ.js","assets/compiler-runtime-CLAvuQ-D.js","assets/rolldown-runtime-QTnfLwEv.js","assets/fallbacks-D21cBTdH.js","assets/state-a4d_PikB.js","assets/-workbench-terminal-Af-sz4R6.js"])))=>i.map(i=>d[i]);
2
- import{Is as e,Ls as t,Nt as n,V as r,it as i,kt as a,rt as o}from"./fallbacks-D21cBTdH.js";import{t as s}from"./preload-helper-CjdClQve.js";var c=t(`/(home)/$worktree/run`)({component:e(()=>s(()=>import(`./run-CeqkWWtZ.js`),__vite__mapDeps([0,1,2,3,4,5])),`component`),validateSearch:n(i({inactive:a(r),sessionId:o}))});export{c as t};