@deslop/workbench 0.0.401 → 0.0.407
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{anthropic-DcE0yHBZ.mjs → anthropic-messages--JAnb97W.mjs} +38 -51
- package/dist/{azure-openai-responses-ecGypQVA.mjs → azure-openai-responses-g-awH_uA.mjs} +9 -16
- package/dist/client/assets/{-workbench-terminal-Af-sz4R6.js → -workbench-terminal-C3m5o50g.js} +8 -8
- package/dist/client/assets/agent-BXm8Dnfe.js +2 -0
- package/dist/client/assets/agent-DWi_bAGy.js +1 -0
- package/dist/client/assets/{dialog-CTIcy8Vy.js → dialog-CpMhdP-y.js} +1 -1
- package/dist/client/assets/{diff-MiGOu0DY.js → diff-BDdajfz3.js} +2 -2
- package/dist/client/assets/{diff-_Gk9o1mg.js → diff-mRZ3PeyD.js} +9 -9
- package/dist/client/assets/{external-link-BxixiKaa.js → external-link-Bw3Ptvfw.js} +1 -1
- package/dist/client/assets/{fallbacks-D21cBTdH.js → fallbacks-f8E4aL2c.js} +3 -3
- package/dist/client/assets/{index-DW7dKhgZ.js → index-D53pFEJY.js} +1 -1
- package/dist/client/assets/index-YmJ_EbaF.css +2 -0
- package/dist/client/assets/{input-DW9ssWUO.js → input-BVvU6Eiy.js} +1 -1
- package/dist/client/assets/portless-BYTEgoik.js +1 -0
- package/dist/client/assets/portless-Cke08ZHX.js +2 -0
- package/dist/client/assets/{resizable-CZjAW7-J.js → resizable-CYsJ6Kg2.js} +1 -1
- package/dist/client/assets/{route-DwWgYFyk.js → route-BzHtbTaZ.js} +2 -2
- package/dist/client/assets/route-DD4r__Zm.js +45 -0
- package/dist/client/assets/{run-CeqkWWtZ.js → run-C8QYJmux.js} +1 -1
- package/dist/client/assets/run-CW5YhyWI.js +2 -0
- package/dist/client/assets/{sonner-BKURESHO.js → sonner-CrB5PaMX.js} +1 -1
- package/dist/client/assets/state-CvX-YRlC.js +2 -0
- package/dist/client/assets/terminal-DJzGIrES.js +2 -0
- package/dist/client/assets/{terminal-CcfbU9tU.js → terminal-Dj-VWVHI.js} +1 -1
- package/dist/client/assets/{triangle-alert-DLHVemGQ.js → triangle-alert-llGGn6BK.js} +1 -1
- package/dist/client/index.html +11 -11
- package/dist/github-copilot-headers-BB6z1RAk.mjs +23 -0
- package/dist/{google-Jzn1v4-q.mjs → google-generative-ai-r4Wb8Eaq.mjs} +15 -20
- package/dist/{google-shared-DNNqX1gf.mjs → google-shared-DN1OvwJM.mjs} +4 -4
- package/dist/{google-vertex-z0Cbw7eq.mjs → google-vertex-Clcq7cAd.mjs} +15 -20
- package/dist/{hash-CScAQ-b_.mjs → hash-wSEYO-QF.mjs} +1 -1
- package/dist/headers-SFoLwUHv.mjs +15 -0
- package/dist/{mistral-CxEIkz4y.mjs → mistral-conversations-Bnpuiv3e.mjs} +12 -19
- package/dist/{openai-codex-responses-7ZUsVcbT.mjs → openai-codex-responses-4Te8RbRb.mjs} +62 -46
- package/dist/{openai-completions-CaGFVr3X.mjs → openai-completions-B4nInzTS.mjs} +69 -96
- package/dist/{openai-responses-Vjw8-3qm.mjs → openai-responses-GeDULmTh.mjs} +28 -31
- package/dist/{openai-responses-shared-DtEshy-7.mjs → openai-responses-shared-CG93Thoy.mjs} +37 -32
- package/dist/{openrouter-CZ-H_QwG.mjs → openrouter-images-CgbIytYQ.mjs} +7 -14
- package/dist/{sanitize-unicode-BbVojtka.mjs → sanitize-unicode-Ga8nHda1.mjs} +1 -1
- package/dist/server.js +27722 -24346
- package/dist/{transform-messages-CLmkH5Gu.mjs → transform-messages-D9fZ7fnU.mjs} +2 -2
- package/package.json +3 -2
- package/dist/client/assets/agent-BnkD1Glf.js +0 -2
- package/dist/client/assets/agent-DQPX2IZb.js +0 -1
- package/dist/client/assets/index-B2S_w1d1.css +0 -2
- package/dist/client/assets/portless-3KC81g42.js +0 -2
- package/dist/client/assets/portless-CxovsEbp.js +0 -1
- package/dist/client/assets/route-te6-VkZE.js +0 -45
- package/dist/client/assets/run-B-qmimXV.js +0 -2
- package/dist/client/assets/state-a4d_PikB.js +0 -2
- package/dist/client/assets/terminal-BHNxWKc6.js +0 -2
- package/dist/github-copilot-headers-P0xZolzq.mjs +0 -39
- package/dist/headers-oksLmLNC.mjs +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/route-
|
|
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
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/route-DD4r__Zm.js","assets/rolldown-runtime-QTnfLwEv.js","assets/compiler-runtime-CLAvuQ-D.js","assets/fallbacks-f8E4aL2c.js","assets/dialog-CpMhdP-y.js","assets/resizable-CYsJ6Kg2.js","assets/preload-helper-CjdClQve.js","assets/sonner-CrB5PaMX.js","assets/triangle-alert-llGGn6BK.js","assets/state-CvX-YRlC.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-f8E4aL2c.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-DD4r__Zm.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};
|
|
@@ -0,0 +1,45 @@
|
|
|
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 te,Po as y,Ps as b,R as x,Rr as ne,Ss as re,Ur as ie,Ut as S,Vt as ae,Wa as oe,Wr as C,Ws as se,Wt as ce,Xa as w,Ya as T,_s as le,a as E,do as ue,en as de,fo as fe,j as D,js as O,k,ko as pe,lr as me,mo as he,no as ge,r as _e,so as A,yn as ve,z as j,zr as M,zs as ye}from"./fallbacks-f8E4aL2c.js";import{r as be,t as xe}from"./route-BzHtbTaZ.js";import{C as Se,S as Ce,a as we,c as N,f as Te,i as Ee,l as De,n as Oe,o as ke,r as Ae,s as je,t as Me,u as Ne}from"./dialog-CpMhdP-y.js";import{n as P}from"./sonner-CrB5PaMX.js";import{n as Pe,r as Fe,t as Ie}from"./resizable-CYsJ6Kg2.js";import{A as F,B as Le,E as Re,F as ze,M as Be,P as Ve,T as He,V as Ue,_ as We,f as Ge,g as I,h as L,i as Ke,m as qe,p as Je,s as Ye,w as Xe}from"./state-CvX-YRlC.js";function Ze(e){let t=ee({warn:e?.router===void 0}),n=e?.router||t;return l(n.stores.__store,se(e,n))}var Qe=b(`badge-check`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),$e=b(`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`}]]),et=b(`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`}]]),tt=b(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),nt=b(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),rt=b(`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`}]]),it=b(`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`}]]),at=b(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ot=b(`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`}]]),st=b(`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`}]]),ct=b(`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`}]]),lt=b(`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`}]]),ut=b(`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`}]]),dt=b(`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`}]]),ft=b(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),pt=b(`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`}]]),mt=b(`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`}]]),ht=b(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),gt=b(`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`}]]),_t=b(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),vt=b(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),yt=b(`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`}]]),R=e(n(),1),z=r(),B=t(),bt=[`codex`,`claude`];function xt(e){return e>=90?`text-destructive`:e>=75?`text-amber-500`:`text-foreground`}function St(e){let t=(0,z.c)(16),n;if(t[0]!==e.icon||t[1]!==e.window.resetsAt||t[2]!==e.window.utilization){let r=O(pe(e.window.resetsAt),c(de)),i;t[4]===e.icon?i=t[5]:(i=(0,B.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=xt(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,B.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,B.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,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center justify-between gap-1.5 px-2.5`,children:[l,y(r)&&(0,B.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate`,title:`resets ${te(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 Ct(e){let t=(0,z.c)(11),n;t[0]===e.layer?n=t[1]:(n=Je(e.layer),t[0]=e.layer,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={includeFailure:!0},t[2]=r):r=t[2];let i=Be(n,r);if(Le(i)){let e;t[3]===i.cause?e=t[4]:(e=D(i.cause),t[3]=i.cause,t[4]=e);let n;return t[5]===e?n=t[6]:(n=(0,B.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center truncate px-2.5`,title:e,children:`—`}),t[5]=e,t[6]=n),n}if(!Ue(i)){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(`span`,{className:`text-muted-foreground flex flex-1 items-center px-2.5`,children:`…`}),t[7]=e):e=t[7],e}let a;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,B.jsx)(`span`,{className:`text-muted-foreground flex shrink-0 items-center [&_svg]:size-2.5`,children:(0,B.jsx)(Qe,{})}),t[8]=a):a=t[8];let o;return t[9]===i.value?o=t[10]:(o=(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center justify-center gap-1.5 px-2.5`,children:[a,(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:i.value})]}),t[9]=i.value,t[10]=o),o}function wt(e){let t=(0,z.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,B.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=xt(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,B.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,B.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 Tt(){let e=(0,z.c)(31),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={includeFailure:!0},e[0]=t):t=e[0];let n=Be(Ye,t);if(Le(n)){let t;e[1]===n.cause?t=e[2]:(t=D(n.cause),e[1]=n.cause,e[2]=t);let r;e[3]===n.cause?r=e[4]:(r=D(n.cause),e[3]=n.cause,e[4]=r);let i;return e[5]!==t||e[6]!==r?(i=(0,B.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center truncate px-2.5`,title:t,children:r}),e[5]=t,e[6]=r,e[7]=i):i=e[7],i}if(!Ue(n)){let t;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsx)(`span`,{className:`text-muted-foreground flex flex-1 items-center px-2.5`,children:`…`}),e[8]=t):t=e[8],t}let r;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,B.jsx)(ot,{}),e[9]=r):r=e[9];let i;e[10]===n.value.cpu?i=e[11]:(i=Math.round(n.value.cpu),e[10]=n.value.cpu,e[11]=i);let a=`CPU ${i}%`,o;e[12]!==a||e[13]!==n.value.cpu?(o=(0,B.jsx)(wt,{compact:!0,icon:r,title:a,utilization:n.value.cpu}),e[12]=a,e[13]=n.value.cpu,e[14]=o):o=e[14];let s;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,B.jsx)(dt,{}),e[15]=s):s=e[15];let c;e[16]===n.value.memory?c=e[17]:(c=Math.round(n.value.memory),e[16]=n.value.memory,e[17]=c);let l=`System memory ${c}%`,u;e[18]!==l||e[19]!==n.value.memory?(u=(0,B.jsx)(wt,{compact:!0,icon:s,title:l,utilization:n.value.memory}),e[18]=l,e[19]=n.value.memory,e[20]=u):u=e[20];let d;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,B.jsx)(gt,{}),e[21]=d):d=e[21];let f;e[22]===n.value.nodeHeap?f=e[23]:(f=Math.round(n.value.nodeHeap),e[22]=n.value.nodeHeap,e[23]=f);let p=`Node heap ${f}%`,m;e[24]!==p||e[25]!==n.value.nodeHeap?(m=(0,B.jsx)(wt,{compact:!0,icon:d,title:p,utilization:n.value.nodeHeap}),e[24]=p,e[25]=n.value.nodeHeap,e[26]=m):m=e[26];let h;return e[27]!==m||e[28]!==o||e[29]!==u?(h=(0,B.jsxs)(B.Fragment,{children:[o,u,m]}),e[27]=m,e[28]=o,e[29]=u,e[30]=h):h=e[30],h}function Et(e){let t=(0,z.c)(23),n;t[0]===e.layer?n=t[1]:(n=Ge(e.layer),t[0]=e.layer,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={includeFailure:!0},t[2]=r):r=t[2];let i=Be(n,r);if(Le(i)){let e;t[3]===i.cause?e=t[4]:(e=D(i.cause),t[3]=i.cause,t[4]=e);let n;t[5]===i.cause?n=t[6]:(n=D(i.cause),t[5]=i.cause,t[6]=n);let r;return t[7]!==e||t[8]!==n?(r=(0,B.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center truncate px-2.5`,title:e,children:n}),t[7]=e,t[8]=n,t[9]=r):r=t[9],r}if(!Ue(i)){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(`span`,{className:`text-muted-foreground flex flex-1 items-center px-2.5`,children:`…`}),t[10]=e):e=t[10],e}let a;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,B.jsx)(at,{}),t[11]=a):a=t[11];let o;t[12]===i.value.fiveHour?o=t[13]:(o=(0,B.jsx)(St,{icon:a,window:i.value.fiveHour}),t[12]=i.value.fiveHour,t[13]=o);let s;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,B.jsx)(it,{}),t[14]=s):s=t[14];let c;t[15]===i.value.weekly?c=t[16]:(c=(0,B.jsx)(St,{icon:s,window:i.value.weekly}),t[15]=i.value.weekly,t[16]=c);let l;t[17]===e.layer?l=t[18]:(l=(0,B.jsx)(Ct,{layer:e.layer}),t[17]=e.layer,t[18]=l);let u;return t[19]!==o||t[20]!==c||t[21]!==l?(u=(0,B.jsxs)(B.Fragment,{children:[o,c,l]}),t[19]=o,t[20]=c,t[21]=l,t[22]=u):u=t[22],u}function Dt(e){let t=(0,z.c)(7),n;t[0]===e.icon?n=t[1]:(n=le(e.icon)&&(0,B.jsx)(`span`,{className:`text-muted-foreground flex shrink-0 items-center [&_svg]:size-2.5`,children:e.icon}),t[0]=e.icon,t[1]=n);let r;t[2]===e.value?r=t[3]:(r=(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:e.value}),t[2]=e.value,t[3]=r);let i;return t[4]!==n||t[5]!==r?(i=(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center justify-center gap-1 px-2.5`,children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6],i}function Ot(e){let t=(0,z.c)(29),n;t[0]===e.layer?n=t[1]:(n=Ge(e.layer),t[0]=e.layer,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={includeFailure:!0},t[2]=r):r=t[2];let i=Be(n,r);if(Le(i)){let e;t[3]===i.cause?e=t[4]:(e=D(i.cause),t[3]=i.cause,t[4]=e);let n;t[5]===i.cause?n=t[6]:(n=D(i.cause),t[5]=i.cause,t[6]=n);let r;return t[7]!==e||t[8]!==n?(r=(0,B.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center truncate px-2.5`,title:e,children:n}),t[7]=e,t[8]=n,t[9]=r):r=t[9],r}if(!Ue(i)){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(`span`,{className:`text-muted-foreground flex flex-1 items-center px-2.5`,children:`…`}),t[10]=e):e=t[10],e}let a;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,B.jsx)(tt,{}),t[11]=a):a=t[11];let o;t[12]===i.value.tokens.input?o=t[13]:(o=h(i.value.tokens.input),t[12]=i.value.tokens.input,t[13]=o);let s;t[14]===o?s=t[15]:(s=(0,B.jsx)(Dt,{icon:a,value:o}),t[14]=o,t[15]=s);let c;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,B.jsx)(nt,{}),t[16]=c):c=t[16];let l;t[17]===i.value.tokens.output?l=t[18]:(l=h(i.value.tokens.output),t[17]=i.value.tokens.output,t[18]=l);let u;t[19]===l?u=t[20]:(u=(0,B.jsx)(Dt,{icon:c,value:l}),t[19]=l,t[20]=u);let d;t[21]===i.value.tokens.cached?d=t[22]:(d=h(i.value.tokens.cached),t[21]=i.value.tokens.cached,t[22]=d);let f;t[23]===d?f=t[24]:(f=(0,B.jsx)(Dt,{value:d}),t[23]=d,t[24]=f);let p;return t[25]!==s||t[26]!==u||t[27]!==f?(p=(0,B.jsxs)(B.Fragment,{children:[s,u,f]}),t[25]=s,t[26]=u,t[27]=f,t[28]=p):p=t[28],p}function V(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center px-2.5`,children:`…`}),e[0]=t):t=e[0],t}function kt(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-col divide-y border-t font-mono text-[11px]`,children:[(0,B.jsxs)(`div`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:[(0,B.jsx)(`span`,{className:`flex w-8 shrink-0 items-center justify-center`,children:(0,B.jsx)(et,{className:`text-muted-foreground size-3`})}),(0,B.jsx)(V,{}),(0,B.jsx)(V,{}),(0,B.jsx)(V,{})]}),bt.map(At)]}),e[0]=t):t=e[0],t}function At(e){return(0,B.jsxs)(`div`,{className:`flex h-14 min-w-0 items-stretch divide-x`,children:[(0,B.jsx)(`span`,{className:`flex w-8 shrink-0 items-center justify-center`,children:(0,B.jsx)(Ne,{layer:e})}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col divide-y`,children:[(0,B.jsxs)(`span`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:[(0,B.jsx)(V,{}),(0,B.jsx)(V,{}),(0,B.jsx)(V,{})]}),(0,B.jsxs)(`span`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:[(0,B.jsx)(V,{}),(0,B.jsx)(V,{}),(0,B.jsx)(V,{})]})]})]},e)}function jt(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-col divide-y border-t font-mono text-[11px]`,children:[(0,B.jsxs)(`div`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:[(0,B.jsx)(`span`,{className:`flex w-8 shrink-0 items-center justify-center`,children:(0,B.jsx)(et,{className:`text-muted-foreground size-3`})}),(0,B.jsx)(Tt,{})]}),bt.map(Mt)]}),e[0]=t):t=e[0],t}function Mt(e){return(0,B.jsxs)(`div`,{className:`flex h-14 min-w-0 items-stretch divide-x`,children:[(0,B.jsx)(`span`,{className:`flex w-8 shrink-0 items-center justify-center`,children:(0,B.jsx)(Ne,{layer:e})}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col divide-y`,children:[(0,B.jsx)(`span`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:(0,B.jsx)(Et,{layer:e})}),(0,B.jsx)(`span`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:(0,B.jsx)(Ot,{layer:e})})]})]},e)}var Nt=1,Pt=.9,Ft=.8,It=.17,Lt=.1,Rt=.999,zt=.9999,Bt=.99,Vt=/[\\\/_+.#"@\[\(\{&]/,Ht=/[\\\/_+.#"@\[\(\{&]/g,Ut=/[\s-]/,Wt=/[\s-]/g;function Gt(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Nt:Bt;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=Gt(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Nt:Vt.test(e.charAt(l-1))?(d*=Ft,p=e.slice(i,l-1).match(Ht),p&&i>0&&(d*=Rt**+p.length)):Ut.test(e.charAt(l-1))?(d*=Pt,m=e.slice(i,l-1).match(Wt),m&&i>0&&(d*=Rt**+m.length)):(d*=It,i>0&&(d*=Rt**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=zt)),(d<Lt&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Gt(e,t,n,r,l+1,a+2,o),f*Lt>d&&(d=f*Lt)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Kt(e){return e.toLowerCase().replace(Wt,` `)}function qt(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Gt(e,t,Kt(e),Kt(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 Jt(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=Jt(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():Jt(e[t],null)}}}}function W(...e){return R.useCallback(U(...e),e)}function Yt(e,t){let n=R.createContext(t),r=e=>{let{children:t,...r}=e,i=R.useMemo(()=>r,Object.values(r));return(0,B.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=R.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Xt(e,t=[]){let n=[];function r(t,r){let i=R.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=R.useMemo(()=>o,Object.values(o));return(0,B.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=R.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=>R.createContext(e));return function(n){let r=n?.[e]||t;return R.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Zt(i,...t)]}function Zt(...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 R.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Qt=globalThis?.document?R.useLayoutEffect:()=>{},$t=R.useId||(()=>void 0),en=0;function G(e){let[t,n]=R.useState($t());return Qt(()=>{e||n(e=>e??String(en++))},[e]),e||(t?`radix-${t}`:``)}var tn=R.useInsertionEffect||Qt;function nn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=rn({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=R.useRef(e!==void 0);R.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,R.useCallback(t=>{if(s){let n=an(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function rn({defaultProp:e,onChange:t}){let[n,r]=R.useState(e),i=R.useRef(n),a=R.useRef(t);return tn(()=>{a.current=t},[t]),R.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function an(e){return typeof e==`function`}var on=e(ye(),1);function sn(e){let t=cn(e),n=R.forwardRef((e,n)=>{let{children:r,...i}=e,a=R.Children.toArray(r),o=a.find(un);if(o){let e=o.props.children,r=a.map(t=>t===o?R.Children.count(e)>1?R.Children.only(null):R.isValidElement(e)?e.props.children:null:t);return(0,B.jsx)(t,{...i,ref:n,children:R.isValidElement(e)?R.cloneElement(e,void 0,r):null})}return(0,B.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function cn(e){let t=R.forwardRef((e,t)=>{let{children:n,...r}=e;if(R.isValidElement(n)){let e=fn(n),i=dn(r,n.props);return n.type!==R.Fragment&&(i.ref=t?U(t,e):e),R.cloneElement(n,i)}return R.Children.count(n)>1?R.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ln=Symbol(`radix.slottable`);function un(e){return R.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ln}function dn(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 fn(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=sn(`Primitive.${t}`),r=R.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function pn(e,t){e&&on.flushSync(()=>e.dispatchEvent(t))}function mn(e){let t=R.useRef(e);return R.useEffect(()=>{t.current=e}),R.useMemo(()=>(...e)=>t.current?.(...e),[])}function hn(e,t=globalThis?.document){let n=mn(e);R.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 gn=`DismissableLayer`,_n=`dismissableLayer.update`,vn=`dismissableLayer.pointerDownOutside`,yn=`dismissableLayer.focusOutside`,bn,xn=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sn=R.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=R.useContext(xn),[u,d]=R.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=R.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,te=v>=_,y=Tn(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!te||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),b=En(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return hn(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),R.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(bn=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Dn(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=bn)}},[u,f,n,l]),R.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Dn())},[u,l]),R.useEffect(()=>{let e=()=>p({});return document.addEventListener(_n,e),()=>document.removeEventListener(_n,e)},[]),(0,B.jsx)(K.div,{...c,ref:m,style:{pointerEvents:ee?te?`auto`:`none`:void 0,...e.style},onFocusCapture:H(e.onFocusCapture,b.onFocusCapture),onBlurCapture:H(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,y.onPointerDownCapture)})});Sn.displayName=gn;var Cn=`DismissableLayerBranch`,wn=R.forwardRef((e,t)=>{let n=R.useContext(xn),r=R.useRef(null),i=W(t,r);return R.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,B.jsx)(K.div,{...e,ref:i})});wn.displayName=Cn;function Tn(e,t=globalThis?.document){let n=mn(e),r=R.useRef(!1),i=R.useRef(()=>{});return R.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){On(vn,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 En(e,t=globalThis?.document){let n=mn(e),r=R.useRef(!1);return R.useEffect(()=>{let e=e=>{e.target&&!r.current&&On(yn,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 Dn(){let e=new CustomEvent(_n);document.dispatchEvent(e)}function On(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?pn(i,a):i.dispatchEvent(a)}var kn=`focusScope.autoFocusOnMount`,An=`focusScope.autoFocusOnUnmount`,jn={bubbles:!1,cancelable:!0},Mn=`FocusScope`,Nn=R.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=R.useState(null),l=mn(i),u=mn(a),d=R.useRef(null),f=W(t,e=>c(e)),p=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.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]),R.useEffect(()=>{if(s){Bn.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(kn,jn);s.addEventListener(kn,l),s.dispatchEvent(t),t.defaultPrevented||(Pn(Un(In(s)),{select:!0}),document.activeElement===e&&q(s))}return()=>{s.removeEventListener(kn,l),setTimeout(()=>{let t=new CustomEvent(An,jn);s.addEventListener(An,u),s.dispatchEvent(t),t.defaultPrevented||q(e??document.body,{select:!0}),s.removeEventListener(An,u),Bn.remove(p)},0)}}},[s,l,u,p]);let m=R.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]=Fn(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,B.jsx)(K.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Nn.displayName=Mn;function Pn(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(q(r,{select:t}),document.activeElement!==n)return}function Fn(e){let t=In(e);return[Ln(t,e),Ln(t.reverse(),e)]}function In(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 Ln(e,t){for(let n of e)if(!Rn(n,{upTo:t}))return n}function Rn(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 zn(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&&zn(e)&&t&&e.select()}}var Bn=Vn();function Vn(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Hn(e,t),e.unshift(t)},remove(t){e=Hn(e,t),e[0]?.resume()}}}function Hn(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Un(e){return e.filter(e=>e.tagName!==`A`)}var Wn=`Portal`,Gn=R.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=R.useState(!1);Qt(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?on.createPortal((0,B.jsx)(K.div,{...r,ref:t}),o):null});Gn.displayName=Wn;function Kn(e,t){return R.useReducer((e,n)=>t[e][n]??e,e)}var qn=e=>{let{present:t,children:n}=e,r=Jn(t),i=typeof n==`function`?n({present:r.isPresent}):R.Children.only(n),a=W(r.ref,Xn(i));return typeof n==`function`||r.isPresent?R.cloneElement(i,{ref:a}):null};qn.displayName=`Presence`;function Jn(e){let[t,n]=R.useState(),r=R.useRef(null),i=R.useRef(e),a=R.useRef(`none`),[o,s]=Kn(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return R.useEffect(()=>{let e=Yn(r.current);a.current=o===`mounted`?e:`none`},[o]),Qt(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Yn(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Qt(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Yn(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=Yn(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:R.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Yn(e){return e?.animationName||`none`}function Xn(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 Zn=0;function Qn(){R.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??$n()),document.body.insertAdjacentElement(`beforeend`,e[1]??$n()),Zn++,()=>{Zn===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Zn--}},[])}function $n(){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 er(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 tr(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 nr=`right-scroll-bar-position`,rr=`width-before-scroll-bar`,ir=`with-scroll-bars-hidden`,ar=`--removed-body-scroll-bar-size`;function or(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function sr(e,t){var n=(0,R.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 cr=typeof window<`u`?R.useLayoutEffect:R.useEffect,lr=new WeakMap;function ur(e,t){var n=sr(t||null,function(t){return e.forEach(function(e){return or(e,t)})});return cr(function(){var t=lr.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||or(e,null)}),i.forEach(function(e){r.has(e)||or(e,a)})}lr.set(n,e)},[e]),n}function dr(e){return e}function fr(e,t){t===void 0&&(t=dr);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 pr(e){e===void 0&&(e={});var t=fr(null);return t.options=J({async:!0,ssr:!1},e),t}var mr=function(e){var t=e.sideCar,n=er(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 R.createElement(r,J({},n))};mr.isSideCarExport=!0;function hr(e,t){return e.useMedium(t),mr}var gr=pr(),_r=function(){},vr=R.forwardRef(function(e,t){var n=R.useRef(null),r=R.useState({onScrollCapture:_r,onWheelCapture:_r,onTouchMoveCapture:_r}),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,te=er(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),y=f,b=ur([n,t]),x=J(J({},te),i);return R.createElement(R.Fragment,null,u&&R.createElement(y,{sideCar:gr,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:ee}),o?R.cloneElement(R.Children.only(s),J(J({},x),{ref:b})):R.createElement(v,J({},x,{className:c,ref:b}),s))});vr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},vr.classNames={fullWidth:rr,zeroRight:nr};var yr,br=function(){if(yr)return yr;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function xr(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=br();return t&&e.setAttribute(`nonce`,t),e}function Sr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Cr(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var wr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=xr())&&(Sr(t,n),Cr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Tr=function(){var e=wr();return function(t,n){R.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Er=function(){var e=Tr();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Dr={left:0,top:0,right:0,gap:0},Or=function(e){return parseInt(e||``,10)||0},kr=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[Or(n),Or(r),Or(i)]},Ar=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Dr;var t=kr(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])}},jr=Er(),Mr=`data-scroll-locked`,Nr=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
|
+
.${ir} {
|
|
3
|
+
overflow: hidden ${r};
|
|
4
|
+
padding-right: ${s}px ${r};
|
|
5
|
+
}
|
|
6
|
+
body[${Mr}] {
|
|
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
|
+
.${nr} {
|
|
20
|
+
right: ${s}px ${r};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.${rr} {
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.${nr} .${nr} {
|
|
28
|
+
right: 0 ${r};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.${rr} .${rr} {
|
|
32
|
+
margin-right: 0 ${r};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[${Mr}] {
|
|
36
|
+
${ar}: ${s}px;
|
|
37
|
+
}
|
|
38
|
+
`},Pr=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Fr=function(){R.useEffect(function(){return document.body.setAttribute(Mr,(Pr()+1).toString()),function(){var e=Pr()-1;e<=0?document.body.removeAttribute(Mr):document.body.setAttribute(Mr,e.toString())}},[])},Ir=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Fr();var a=R.useMemo(function(){return Ar(i)},[i]);return R.createElement(jr,{styles:Nr(a,!t,i,n?``:`!important`)})},Lr=!1;if(typeof window<`u`)try{var Rr=Object.defineProperty({},"passive",{get:function(){return Lr=!0,!0}});window.addEventListener(`test`,Rr,Rr),window.removeEventListener(`test`,Rr,Rr)}catch{Lr=!1}var zr=Lr?{passive:!1}:!1,Br=function(e){return e.tagName===`TEXTAREA`},Vr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Br(e)&&n[t]===`visible`)},Hr=function(e){return Vr(e,`overflowY`)},Ur=function(e){return Vr(e,`overflowX`)},Wr=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),qr(e,r)){var i=Jr(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Gr=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Kr=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},qr=function(e,t){return e===`v`?Hr(t):Ur(t)},Jr=function(e,t){return e===`v`?Gr(t):Kr(t)},Yr=function(e,t){return e===`h`&&t===`rtl`?-1:1},Xr=function(e,t,n,r,i){var a=Yr(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=Jr(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&qr(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},Zr=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qr=function(e){return[e.deltaX,e.deltaY]},$r=function(e){return e&&`current`in e?e.current:e},ei=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ti=function(e){return`
|
|
39
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
+
`},ni=0,ri=[];function ii(e){var t=R.useRef([]),n=R.useRef([0,0]),r=R.useRef(),i=R.useState(ni++)[0],a=R.useState(Er)[0],o=R.useRef(e);R.useEffect(function(){o.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=tr([e.lockRef.current],(e.shards||[]).map($r),!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=R.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Zr(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=Wr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Wr(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 Xr(h,t,e,h===`h`?s:c,!0)},[]),c=R.useCallback(function(e){var n=e;if(!(!ri.length||ri[ri.length-1]!==a)){var r=`deltaY`in n?Qr(n):Zr(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&ei(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map($r).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=R.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ai(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=R.useCallback(function(e){n.current=Zr(e),r.current=void 0},[]),d=R.useCallback(function(t){l(t.type,Qr(t),t.target,s(t,e.lockRef.current))},[]),f=R.useCallback(function(t){l(t.type,Zr(t),t.target,s(t,e.lockRef.current))},[]);R.useEffect(function(){return ri.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,zr),document.addEventListener(`touchmove`,c,zr),document.addEventListener(`touchstart`,u,zr),function(){ri=ri.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,zr),document.removeEventListener(`touchmove`,c,zr),document.removeEventListener(`touchstart`,u,zr)}},[]);var p=e.removeScrollBar,m=e.inert;return R.createElement(R.Fragment,null,m?R.createElement(a,{styles:ti(i)}):null,p?R.createElement(Ir,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ai(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var oi=hr(gr,ii),si=R.forwardRef(function(e,t){return R.createElement(vr,J({},e,{ref:t,sideCar:oi}))});si.classNames=vr.classNames;var ci=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},li=new WeakMap,ui=new WeakMap,di={},fi=0,pi=function(e){return e&&(e.host||pi(e.parentNode))},mi=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=pi(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})},hi=function(e,t,n,r){var i=mi(t,Array.isArray(e)?e:[e]);di[n]||(di[n]=new WeakMap);var a=di[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=(li.get(e)||0)+1,l=(a.get(e)||0)+1;li.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ui.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(),fi++,function(){o.forEach(function(e){var t=li.get(e)-1,i=a.get(e)-1;li.set(e,t),a.set(e,i),t||(ui.has(e)||e.removeAttribute(r),ui.delete(e)),i||e.removeAttribute(n)}),fi--,fi||(li=new WeakMap,li=new WeakMap,ui=new WeakMap,di={})}},gi=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ci(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),hi(r,i,n,`aria-hidden`)):function(){return null}},_i=`Dialog`,[vi,yi]=Xt(_i),[bi,Y]=vi(_i),xi=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=R.useRef(null),c=R.useRef(null),[l,u]=nn({prop:r,defaultProp:i??!1,onChange:a,caller:_i});return(0,B.jsx)(bi,{scope:t,triggerRef:s,contentRef:c,contentId:G(),titleId:G(),descriptionId:G(),open:l,onOpenChange:u,onOpenToggle:R.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};xi.displayName=_i;var Si=`DialogTrigger`,Ci=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(Si,n),a=W(t,i.triggerRef);return(0,B.jsx)(K.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Hi(i.open),...r,ref:a,onClick:H(e.onClick,i.onOpenToggle)})});Ci.displayName=Si;var wi=`DialogPortal`,[Ti,Ei]=vi(wi,{forceMount:void 0}),Di=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Y(wi,t);return(0,B.jsx)(Ti,{scope:t,forceMount:n,children:R.Children.map(r,e=>(0,B.jsx)(qn,{present:n||a.open,children:(0,B.jsx)(Gn,{asChild:!0,container:i,children:e})}))})};Di.displayName=wi;var Oi=`DialogOverlay`,ki=R.forwardRef((e,t)=>{let n=Ei(Oi,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Y(Oi,e.__scopeDialog);return a.modal?(0,B.jsx)(qn,{present:r||a.open,children:(0,B.jsx)(ji,{...i,ref:t})}):null});ki.displayName=Oi;var Ai=sn(`DialogOverlay.RemoveScroll`),ji=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(Oi,n);return(0,B.jsx)(si,{as:Ai,allowPinchZoom:!0,shards:[i.contentRef],children:(0,B.jsx)(K.div,{"data-state":Hi(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),X=`DialogContent`,Mi=R.forwardRef((e,t)=>{let n=Ei(X,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Y(X,e.__scopeDialog);return(0,B.jsx)(qn,{present:r||a.open,children:a.modal?(0,B.jsx)(Ni,{...i,ref:t}):(0,B.jsx)(Pi,{...i,ref:t})})});Mi.displayName=X;var Ni=R.forwardRef((e,t)=>{let n=Y(X,e.__scopeDialog),r=R.useRef(null),i=W(t,n.contentRef,r);return R.useEffect(()=>{let e=r.current;if(e)return gi(e)},[]),(0,B.jsx)(Fi,{...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())})}),Pi=R.forwardRef((e,t)=>{let n=Y(X,e.__scopeDialog),r=R.useRef(!1),i=R.useRef(!1);return(0,B.jsx)(Fi,{...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()}})}),Fi=R.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Y(X,n),c=R.useRef(null),l=W(t,c);return Qn(),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Nn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,B.jsx)(Sn,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Hi(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ki,{titleId:s.titleId}),(0,B.jsx)(Ji,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Ii=`DialogTitle`,Li=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(Ii,n);return(0,B.jsx)(K.h2,{id:i.titleId,...r,ref:t})});Li.displayName=Ii;var Ri=`DialogDescription`,zi=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(Ri,n);return(0,B.jsx)(K.p,{id:i.descriptionId,...r,ref:t})});zi.displayName=Ri;var Bi=`DialogClose`,Vi=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(Bi,n);return(0,B.jsx)(K.button,{type:`button`,...r,ref:t,onClick:H(e.onClick,()=>i.onOpenChange(!1))})});Vi.displayName=Bi;function Hi(e){return e?`open`:`closed`}var Ui=`DialogTitleWarning`,[Wi,Gi]=Yt(Ui,{contentName:X,titleName:Ii,docsSlug:`dialog`}),Ki=({titleId:e})=>{let t=Gi(Ui),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 R.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},qi=`DialogDescriptionWarning`,Ji=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gi(qi).contentName}}.`;return R.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Yi=xi,Xi=Di,Zi=ki,Qi=Mi,$i=Symbol.for(`react.lazy`),ea=R.use;function ta(e){return typeof e==`object`&&!!e&&`then`in e}function na(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===$i&&`_payload`in e&&ta(e._payload)}function ra(e){let t=ia(e),n=R.forwardRef((e,n)=>{let{children:r,...i}=e;na(r)&&typeof ea==`function`&&(r=ea(r._payload));let a=R.Children.toArray(r),o=a.find(oa);if(o){let e=o.props.children,r=a.map(t=>t===o?R.Children.count(e)>1?R.Children.only(null):R.isValidElement(e)?e.props.children:null:t);return(0,B.jsx)(t,{...i,ref:n,children:R.isValidElement(e)?R.cloneElement(e,void 0,r):null})}return(0,B.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function ia(e){let t=R.forwardRef((e,t)=>{let{children:n,...r}=e;if(na(n)&&typeof ea==`function`&&(n=ea(n._payload)),R.isValidElement(n)){let e=ca(n),i=sa(r,n.props);return n.type!==R.Fragment&&(i.ref=t?U(t,e):e),R.cloneElement(n,i)}return R.Children.count(n)>1?R.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var aa=Symbol(`radix.slottable`);function oa(e){return R.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===aa}function sa(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 ca(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=ra(`Primitive.${t}`),r=R.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),la=`[cmdk-group=""]`,ua=`[cmdk-group-items=""]`,da=`[cmdk-group-heading=""]`,fa=`[cmdk-item=""]`,pa=`${fa}:not([aria-disabled="true"])`,ma=`cmdk-item-select`,ha=`data-value`,ga=(e,t,n)=>qt(e,t,n),_a=R.createContext(void 0),va=()=>R.useContext(_a),ya=R.createContext(void 0),ba=()=>R.useContext(ya),xa=R.createContext(void 0),Sa=R.forwardRef((e,t)=>{let n=Fa(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Fa(()=>new Set),i=Fa(()=>new Map),a=Fa(()=>new Map),o=Fa(()=>new Set),s=Pa(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(),te=G(),y=R.useRef(null),b=La();Q(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,x.emit()}},[u]),Q(()=>{b(6,oe)},[]);let x=R.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`)ae(),ie(),b(1,S);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(te);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(b(7,()=>{n.current.selectedItemId=C()?.id,x.emit()}),r||b(5,oe),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}x.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),ne=R.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,re(t,r)),b(2,()=>{ie(),x.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]))),b(3,()=>{ae(),ie(),n.current.value||S(),x.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=C();b(4,()=>{ae(),t?.getAttribute(`id`)===e&&S(),x.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:te,labelId:ee,listInnerRef:y}),[]);function re(e,t){let r=s.current?.filter??ga;return e?r(e,n.current.search,t):0}function ie(){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=y.current;se().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(ua);t?t.appendChild(e.parentElement===t?e:e.closest(`${ua} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${ua} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=y.current?.querySelector(`${la}[${ha}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function S(){let e=se().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(ha);x.setState(`value`,e||void 0)}function ae(){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=re(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 oe(){var e;let t=C();t&&(t.parentElement?.firstChild===t&&((e=t.closest(la)?.querySelector(da))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function C(){return y.current?.querySelector(`${fa}[aria-selected="true"]`)}function se(){return Array.from(y.current?.querySelectorAll(pa)||[])}function ce(e){let t=se()[e];t&&x.setState(`value`,t.getAttribute(ha))}function w(e){var t;let n=C(),r=se(),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&&x.setState(`value`,a.getAttribute(ha))}function T(e){let t=C()?.closest(la),n;for(;t&&!n;)t=e>0?Ma(t,la):Na(t,la),n=t?.querySelector(pa);n?x.setState(`value`,n.getAttribute(ha)):w(e)}let le=()=>ce(se().length-1),E=e=>{e.preventDefault(),e.metaKey?le():e.altKey?T(1):w(1)},ue=e=>{e.preventDefault(),e.metaKey?ce(0):e.altKey?T(-1):w(-1)};return R.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&&E(e);break;case`ArrowDown`:E(e);break;case`p`:case`k`:g&&e.ctrlKey&&ue(e);break;case`ArrowUp`:ue(e);break;case`Home`:e.preventDefault(),ce(0);break;case`End`:e.preventDefault(),le();break;case`Enter`:{e.preventDefault();let t=C();if(t){let e=new Event(ma);t.dispatchEvent(e)}}}}},R.createElement(`label`,{"cmdk-label":``,htmlFor:ne.inputId,id:ne.labelId,style:Ba},c),za(e,e=>R.createElement(ya.Provider,{value:x},R.createElement(_a.Provider,{value:ne},e))))}),Ca=R.forwardRef((e,t)=>{let n=G(),r=R.useRef(null),i=R.useContext(xa),a=va(),o=Pa(e),s=o.current?.forceMount??i?.forceMount;Q(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Ia(n,r,[e.value,e.children,r],e.keywords),l=ba(),u=$(e=>e.value&&e.value===c.current),d=$(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);R.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(ma,f),()=>t.removeEventListener(ma,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 R.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)}),wa=R.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=G(),s=R.useRef(null),c=R.useRef(null),l=G(),u=va(),d=$(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Q(()=>u.group(o),[]),Ia(o,s,[e.value,e.heading,c]);let f=R.useMemo(()=>({id:o,forceMount:i}),[i]);return R.createElement(Z.div,{ref:U(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&R.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),za(e,e=>R.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},R.createElement(xa.Provider,{value:f},e))))}),Ta=R.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=R.useRef(null),a=$(e=>!e.search);return!n&&!a?null:R.createElement(Z.div,{ref:U(i,t),...r,"cmdk-separator":``,role:`separator`})}),Ea=R.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=ba(),o=$(e=>e.search),s=$(e=>e.selectedItemId),c=va();return R.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),R.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)}})}),Da=R.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=R.useRef(null),o=R.useRef(null),s=$(e=>e.selectedItemId),c=va();return R.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)}}},[]),R.createElement(Z.div,{ref:U(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},za(e,e=>R.createElement(`div`,{ref:U(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Oa=R.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return R.createElement(Yi,{open:n,onOpenChange:r},R.createElement(Xi,{container:o},R.createElement(Zi,{"cmdk-overlay":``,className:i}),R.createElement(Qi,{"aria-label":e.label,"cmdk-dialog":``,className:a},R.createElement(Sa,{ref:t,...s}))))}),ka=R.forwardRef((e,t)=>$(e=>e.filtered.count===0)?R.createElement(Z.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Aa=R.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return R.createElement(Z.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},za(e,e=>R.createElement(`div`,{"aria-hidden":!0},e)))}),ja=Object.assign(Sa,{List:Da,Item:Ca,Input:Ea,Group:wa,Separator:Ta,Dialog:Oa,Empty:ka,Loading:Aa});function Ma(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Na(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Pa(e){let t=R.useRef(e);return Q(()=>{t.current=e}),t}var Q=typeof window>`u`?R.useEffect:R.useLayoutEffect;function Fa(e){let t=R.useRef();return t.current===void 0&&(t.current=e()),t}function $(e){let t=ba(),n=()=>e(t.snapshot());return R.useSyncExternalStore(t.subscribe,n,n)}function Ia(e,t,n,r=[]){let i=R.useRef(),a=va();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(ha,s),i.current=s}),i}var La=()=>{let[e,t]=R.useState(),n=Fa(()=>new Map);return Q(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Ra(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function za({asChild:e,children:t},n){return e&&R.isValidElement(t)?R.cloneElement(Ra(t),{ref:t.ref},n(t.props.children)):n(t)}var Ba={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Va(e){let t=(0,z.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,B.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 Ha=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 Ua(e){let t=(0,z.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(Ha({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,B.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":o,className:s,onClick:Wa,...r}),t[7]=o,t[8]=r,t[9]=s,t[10]=c):c=t[10],c}function Wa(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 Ga(e){let t=(0,z.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,B.jsx)(ja,{"data-slot":`command`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ka(e){let t=(0,z.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,B.jsx)(ke,{children:l}),t[9]=l,t[10]=p);let m;t[11]===u?m=t[12]:(m=(0,B.jsx)(Ae,{children:u}),t[11]=u,t[12]=m);let h;t[13]!==p||t[14]!==m?(h=(0,B.jsxs)(we,{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,B.jsxs)(Oe,{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,B.jsx)(Me,{...a,children:g}),t[21]=a,t[22]=g,t[23]=_):_=t[23],_}function qa(e){let t=(0,z.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,B.jsx)(ja.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,B.jsx)(Ua,{children:(0,B.jsx)(ht,{className:`size-3 shrink-0 opacity-50`})}),t[8]=s):s=t[8];let c;return t[9]===o?c=t[10]:(c=(0,B.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`border-b pb-0`,children:(0,B.jsxs)(Va,{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 Ja(e){let t=(0,z.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,B.jsx)(ja.List,{"data-slot":`command-list`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ya(e){let t=(0,z.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,B.jsx)(ja.Empty,{"data-slot":`command-empty`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Xa(e){let t=(0,z.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,B.jsx)(ja.Group,{"data-slot":`command-group`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Za(e){let t=(0,z.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,B.jsx)(Ce,{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,B.jsxs)(ja.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 Qa(e){let t=(0,z.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,B.jsx)(`span`,{"data-slot":`command-shortcut`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}var $a=Ve(e=>ze(L.runtime.atom(ve(L,t=>M(e)?t(`projects.branches`,{cwd:e}):me(We.make({branches:[],defaultBranch:`main`}))),{initialValue:We.make({branches:[],defaultBranch:`main`})})));function eo(){let e=(0,z.c)(24),t=xe.useNavigate(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={select:to},e[0]=n):n=e[0];let r=Ze(n),i;e[1]===r.activeWorktreeId?i=e[2]:(i=Ke(r.activeWorktreeId),e[1]=r.activeWorktreeId,e[2]=i);let a=Be(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,R.startTransition)(()=>{t({params:{worktree:qe(e)},to:`/$worktree/diff`})})},s=e=>{(0,R.startTransition)(()=>{t({params:{worktree:qe(e)},to:`/$worktree/terminal`})})},c=(e,n)=>{(0,R.startTransition)(()=>{t({params:{worktree:qe(e)},search:{origin:n},to:`/$worktree/portless`})})},l=(e,n)=>{(0,R.startTransition)(()=>{t({params:{worktree:qe(e)},search:{agentId:n},to:`/$worktree/agent`})})},u=(e,n,r)=>{(0,R.startTransition)(()=>{t({params:{worktree:qe(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,B.jsx)(Pe,{defaultSize:`26%`,minSize:`20%`,maxSize:`38%`,children:(0,B.jsx)(Eo,{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,B.jsx)(Ie,{}),e[20]=f):f=e[20];let p;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,B.jsx)(Pe,{defaultSize:`86%`,minSize:`60%`,children:(0,B.jsx)(`div`,{className:`flex h-full min-h-0 flex-col`,children:(0,B.jsx)(be,{})})}),e[21]=p):p=e[21];let m;return e[22]===d?m=e[23]:(m=(0,B.jsx)(`div`,{className:`bg-background h-full min-h-0 flex-1 overflow-hidden`,children:(0,B.jsxs)(Fe,{orientation:`horizontal`,className:`h-full min-h-0 overflow-hidden`,children:[d,f,p]})}),e[22]=d,e[23]=m),m}function to(e){return{activeView:O(x(e.location.pathname),j(f(`/terminal`),oo),j(f(`/portless`),ao),j(f(`/run`),io),j(f(`/agent`),ro),m(no)),activeWorktreeId:ie(`/`)(e.location.pathname)[1]??``}}function no(){return`diff`}function ro(){return`agent`}function io(){return`run`}function ao(){return`portless`}function oo(){return`terminal`}function so(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(kt,{}),children:(0,B.jsx)(jt,{})}),e[0]=t):t=e[0],t}function co(e){return O(ie(`/`)(e),ue,w(e=>M(e)&&e!==`.`),a(()=>e))}function lo(e){let t=C(`/home/`)(e)?O(ie(`/`)(e),he(3),ge(`/`)):void 0;return le(t)&&C(`${t}/`)(e)?`~/${d(o(t)+1)(e)}`:co(e)}function uo(e){let t=(0,z.c)(4);if(e.root){let n=e.dirty?`text-amber-500`:`text-current`,r;return t[0]===n?r=t[1]:(r=(0,B.jsx)(ft,{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,B.jsx)(_t,{className:n}),t[2]=n,t[3]=r),r}function fo(e,t){return{cwd:e,sessionId:t.sessionId}}function po(e){return{cwd:e.script.cwd,sessionId:e.script.sessionId}}function mo(e){return M(p(e))&&!/\s/u.test(e)}function ho(e){return[...e].toSorted((e,t)=>e.taskId.localeCompare(t.taskId))}function go(e){return[...e].toSorted((e,t)=>e.script.taskId.localeCompare(t.script.taskId))}function _o(e){let t=(0,z.c)(10),n=(0,R.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=ho(e.scripts);if(a.length===0){i=null;break bb0}let o;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,B.jsx)(Se,{}),t[7]=o):o=t[7];let s;t[8]===n?s=t[9]:(s=(0,B.jsx)(N,{icon:o,selected:!1,onClick:()=>{n[1](vo)},children:`scripts`}),t[8]=n,t[9]=s),r=(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[s,n[0]&&(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:a.map(t=>(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(_e,{}),children:(0,B.jsx)(yo,{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 vo(e){return!e}function yo(e){let t=fo(e.cwd,e.run),n=F(L.mutation(`terminal.restart`),{mode:`promise`}),r=F(L.mutation(`terminal.stop`),{mode:`promise`}),i=(0,R.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){P.error(D(e))}finally{i[1](!1)}}}return(0,B.jsx)(`li`,{className:`w-full min-w-0`,children:(0,B.jsx)(N,{actions:(0,B.jsx)(`span`,{className:`flex h-full items-center justify-end`,children:(0,B.jsx)(E,{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:O(x({active:I(e.status.state)&&e.status.state!==`idle`,pending:i[0]}),j({pending:!0},()=>(0,B.jsx)(k,{className:`size-2.5 border opacity-60`})),j({active:!0},()=>(0,B.jsx)(_t,{className:`size-3`})),m(()=>(0,B.jsx)(pt,{className:`size-3`})))})}),icon:(0,B.jsx)(Te,{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 bo(e){let t=(0,z.c)(8),n;t[0]===e.runs?n=t[1]:(n=go(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,B.jsx)(xo,{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 xo(e){let t=(0,R.useState)(!0),n=F(L.mutation(`terminal.restart`),{mode:`promise`}),r=F(L.mutation(`terminal.stop`),{mode:`promise`}),i=(0,R.useState)(!1);async function a(){if(!i[0]){i[1](!0);try{for(let t of e.runs){let i=po(t);fe(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){P.error(D(e))}finally{i[1](!1)}}}return(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,B.jsx)(N,{actions:(0,B.jsx)(E,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:i[0],onClick:e=>{e.stopPropagation(),a()},title:fe(e.runs,t=>I(e.runStatuses[t.script.sessionId]?.state??`idle`)&&e.runStatuses[t.script.sessionId]?.state!==`idle`)?`Stop deslop`:`Start deslop`,children:O(x({active:fe(e.runs,t=>I(e.runStatuses[t.script.sessionId]?.state??`idle`)&&e.runStatuses[t.script.sessionId]?.state!==`idle`),pending:i[0]}),j({pending:!0},()=>(0,B.jsx)(k,{className:`size-2.5 border opacity-60`})),j({active:!0},()=>(0,B.jsx)(_t,{className:`size-3`})),m(()=>(0,B.jsx)(pt,{className:`size-3`})))}),icon:(0,B.jsx)(lt,{}),selected:!1,onClick:()=>{t[1](e=>!e)},children:`deslop`}),t[0]&&(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:A(e.runs,t=>(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(_e,{}),children:(0,B.jsx)(So,{run:t,status:e.runStatuses[t.script.sessionId]??{state:`idle`,title:``},selectPortless:e.selectPortless,selectRun:e.selectRun})},t.script.sessionId))})]})}function So(e){let t=(0,z.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,B.jsx)(lt,{className:`size-3`}),t[2]=i):i=t[2];let a;t[3]!==n||t[4]!==r?(a=(0,B.jsx)(E,{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,B.jsx)(Te,{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,B.jsx)(`li`,{className:`w-full min-w-0`,children:(0,B.jsx)(N,{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 Co(e){let t=(0,z.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,B.jsx)(k,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(_t,{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,B.jsx)(E,{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,B.jsx)(Te,{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,B.jsx)(`li`,{className:`w-full min-w-0`,children:(0,B.jsx)(N,{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 wo(e){let t=F(L.mutation(`agents.create`),{mode:`promise`}),n=F(L.mutation(`agents.remove`),{mode:`promise`}),r=(0,R.useState)(()=>ae()),i=(0,R.useState)(()=>ae());async function a(n){if(!S(r[0],n.id)){r[1](e=>s(e,n.id));try{let r=await t({payload:{cwd:e.cwd,provider:n.id}});e.selectAgent(e.cwd,r.uuid)}catch(e){P.error(D(e))}finally{r[1](e=>ce(e,n.id))}}}async function o(t){if(!S(i[0],t.uuid)){i[1](e=>s(e,t.uuid));try{await n({payload:{cwd:e.cwd,uuid:t.uuid}})}catch(e){P.error(D(e))}finally{i[1](e=>ce(e,t.uuid))}}}return(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,B.jsx)(N,{icon:(0,B.jsx)(rt,{}),selected:!1,children:`agents`}),(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:A(e.profiles,t=>{let n=O(e.sessions,T(e=>e.profileId===t.id));return(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,B.jsx)(N,{actions:(0,B.jsx)(E,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:S(r[0],t.id),onClick:e=>{e.stopPropagation(),a(t)},title:`Start ${t.label}`,children:S(r[0],t.id)?(0,B.jsx)(k,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(pt,{className:`size-3`})}),icon:(0,B.jsx)(Ne,{layer:t.icon}),selected:!1,children:t.label}),n.length>0&&(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:A(n,t=>(0,B.jsx)(Co,{session:t,onSelect:()=>{e.selectAgent(e.cwd,t.uuid)},onStop:()=>{o(t)},stopping:S(i[0],t.uuid)},t.uuid))})]},t.id)})})]})}function To(e){return O(e.agents,fe(e=>I(e.state.state)&&e.state.state!==`idle`))}function Eo(e){let t=F(L.mutation(`projects.fix`),{mode:`promise`}),n=F(L.mutation(`projects.createWorktree`),{mode:`promise`}),r=F(L.mutation(`projects.deleteWorktree`),{mode:`promise`}),[i,a]=(0,R.useState)(()=>({actionsOpen:!1,branch:``,createWorktreeProjectRoot:e.activeProject?.repository.root,creatingBranch:``,deleteDialogOpen:!1,deletingWorktree:!1,filterActiveAgents:!1,fixingProject:``})),o=O(e.projects,w(e=>e.repository.root===i.createWorktreeProjectRoot),g)??e.activeProject,s=Be($a(o?.repository.root??``)),c=O(s.value.branches,T(e=>e.type===`local`),A(e=>e.name)),l=O(s.value.branches,T(e=>M(e.name)),T(e=>e.type===`local`||!u(c,e.name)),oe((e,t)=>e.name===t.name&&e.type===t.type&&e.remote===t.remote),T(e=>!O(o?.worktrees??[],A(e=>e.branch??``),T(M),u(e.name)))),d=p(i.branch),f=O(l,fe(e=>e.name===d));async function h(t){let r=t?.name??d;if(ne(r)||M(i.creatingBranch))return;if(re(t)&&!mo(r)){P.error(`Branch names cannot contain spaces.`);return}let s=re(t)?He.make({}):x(t).pipe(j({type:`local`},()=>Xe.make({})),m(e=>Re.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){P.error(D(e))}finally{a(e=>({...e,creatingBranch:``}))}}async function _(){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){P.error(D(e))}finally{a(e=>({...e,deletingWorktree:!1}))}}}async function v(e){a(t=>({...t,fixingProject:e}));try{await t({payload:{cwd:e}})}catch(e){P.error(D(e))}finally{a(e=>({...e,fixingProject:``}))}}return(0,B.jsxs)(`div`,{className:`flex h-full flex-col border-r`,children:[(0,B.jsxs)(`div`,{className:`grid h-8 grid-cols-[minmax(0,1fr)_auto] items-center border-b`,children:[(0,B.jsx)(E,{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,B.jsx)(`span`,{className:`min-w-0 truncate`,children:e.activeWorktree?lo(e.activeWorktree.root):`No worktree selected`})}),(0,B.jsxs)(`span`,{className:`flex items-center`,children:[(0,B.jsx)(E,{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,B.jsx)(rt,{className:`size-3`}):(0,B.jsx)(ut,{className:`size-3`})}),e.activeWorktree&&e.activeWorktree.root!==e.activeProject?.repository.root&&(0,B.jsx)(E,{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,B.jsx)(k,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(yt,{className:`size-3`})})]})]}),(0,B.jsx)(Me,{open:i.deleteDialogOpen,onOpenChange:e=>{a(t=>({...t,deleteDialogOpen:e}))},children:(0,B.jsxs)(Oe,{showCloseButton:!i.deletingWorktree,children:[(0,B.jsxs)(we,{children:[(0,B.jsx)(ke,{children:`Delete worktree`}),(0,B.jsx)(Ae,{children:e.activeWorktree?`Delete ${e.activeWorktree.branch??co(e.activeWorktree.root)}?`:`No worktree selected.`})]}),(0,B.jsxs)(Ee,{children:[(0,B.jsx)(E,{type:`button`,variant:`outline`,disabled:i.deletingWorktree,onClick:()=>{a(e=>({...e,deleteDialogOpen:!1}))},children:`Cancel`}),(0,B.jsxs)(E,{type:`button`,variant:`destructive`,disabled:!e.activeWorktree||i.deletingWorktree,onClick:()=>{_(),a(e=>({...e,actionsOpen:!1}))},children:[i.deletingWorktree?(0,B.jsx)(k,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(yt,{className:`size-3`}),`Delete`]})]})]})}),(0,B.jsx)(Ka,{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,B.jsxs)(Ga,{onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&a(e=>({...e,actionsOpen:!1}))},children:[(0,B.jsx)(qa,{placeholder:`Find or create branch in ${o?co(o.repository.root):`workspace`}...`,value:i.branch,onValueChange:e=>{a(t=>({...t,branch:e}))},onKeyDown:e=>{e.key===`Enter`&&M(d)&&o&&(e.preventDefault(),h(O(l,w(e=>e.name===d),g)))}}),(0,B.jsxs)(Ja,{children:[(0,B.jsx)(Ya,{children:M(d)&&!mo(d)?`Branch names cannot contain spaces.`:`No matching branch.`}),o&&(0,B.jsxs)(Xa,{children:[M(d)&&mo(d)&&!f&&(0,B.jsxs)(Za,{value:d,disabled:M(i.creatingBranch),onSelect:()=>{h()},children:[i.creatingBranch===d?(0,B.jsx)(k,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(st,{}),(0,B.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Create `,d]}),(0,B.jsxs)(Qa,{children:[`origin/`,s.value.defaultBranch]})]}),A(l,e=>{let t=i.creatingBranch===e.name?(0,B.jsx)(k,{className:`size-2.5 border opacity-60`}):x(e.type).pipe(j(`local`,()=>(0,B.jsx)(ct,{})),m(()=>(0,B.jsx)(lt,{})));return(0,B.jsxs)(Za,{value:e.name,onSelect:()=>{a(t=>({...t,branch:e.name})),h(e)},children:[t,(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,B.jsx)(Qa,{children:e.type})]},`${e.type}:${e.remote??``}:${e.name}`)})]})]})]})}),(0,B.jsx)(je,{className:`min-h-0 flex-1 overflow-y-auto px-0 py-1`,children:(0,B.jsx)(De,{children:A(e.projects,t=>{let n=i.filterActiveAgents?O(t.worktrees,T(To)):t.worktrees;if(n.length===0)return null;let r=g(w(n,e=>e.root===t.repository.root))??n[0];return(0,B.jsxs)(`li`,{className:`min-w-0 py-1 first:pt-0`,children:[(0,B.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,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center [&_svg]:size-3`,children:(0,B.jsx)($e,{})}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,B.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,B.jsx)(`span`,{className:`min-w-0 truncate`,children:co(t.repository.root)})})})]}),(0,B.jsxs)(`span`,{className:`flex items-center`,children:[(0,B.jsx)(E,{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(),v(t.repository.root)},title:`Fix repo state`,children:i.fixingProject===t.repository.root?(0,B.jsx)(k,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(mt,{className:`size-3`})}),(0,B.jsx)(E,{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,B.jsx)(st,{className:`size-3`})})]})]}),(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:A(n,n=>(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,B.jsx)(N,{icon:(0,B.jsx)(uo,{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??co(n.root)},n.root),(0,B.jsxs)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:[(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(_e,{}),children:(0,B.jsx)(wo,{cwd:n.root,profiles:e.agentProfiles,sessions:n.agents,selectAgent:e.selectAgent})}),(0,B.jsx)(`li`,{className:`w-full min-w-0`,children:(0,B.jsx)(N,{icon:(0,B.jsx)(vt,{}),selected:e.activeView===`terminal`&&e.activeWorktree?.root===n.root,onClick:()=>{e.selectTerminal(n.root)},children:`terminal`})}),(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(_e,{}),children:(0,B.jsx)(bo,{cwd:n.root,runStatuses:n.runStatuses,runs:n.portlessRuns,selectPortless:e.selectPortless,selectRun:e.selectRun})}),(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(_e,{}),children:(0,B.jsx)(_o,{cwd:n.root,runStatuses:n.runStatuses,scripts:n.scriptRuns,selectRun:e.selectRun})})]})]},n.root))})]},t.repository.gitDirectory)})})}),(0,B.jsx)(so,{})]})}export{eo as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./compiler-runtime-CLAvuQ-D.js";import{n}from"./fallbacks-
|
|
1
|
+
import{n as e,t}from"./compiler-runtime-CLAvuQ-D.js";import{n}from"./fallbacks-f8E4aL2c.js";import{M as r,r as i}from"./state-CvX-YRlC.js";import{t as a}from"./run-CW5YhyWI.js";import{t as o}from"./-workbench-terminal-C3m5o50g.js";var s=t(),c=e();function l(){let e=(0,s.c)(9),t=a.useParams(),l=a.useSearch(),u;e[0]===t.worktree?u=e[1]:(u=i(t.worktree),e[0]=t.worktree,e[1]=u);let d=r(u);if(!d.value.activeWorktree)return;if(l.inactive===!0){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsx)(`div`,{className:`bg-background h-full min-h-0 min-w-0 p-2`,children:(0,c.jsx)(n,{message:`This script has not been started yet. Use the play button to start it.`})}),e[2]=t):t=e[2],t}let f;e[3]!==d.value.activeWorktree.root||e[4]!==l.sessionId?(f={cwd:d.value.activeWorktree.root,sessionId:l.sessionId},e[3]=d.value.activeWorktree.root,e[4]=l.sessionId,e[5]=f):f=e[5];let p;return e[6]!==l.sessionId||e[7]!==f?(p=(0,c.jsx)(`div`,{className:`bg-background h-full min-h-0 min-w-0`,children:(0,c.jsx)(o,{session:f},l.sessionId)}),e[6]=l.sessionId,e[7]=f,e[8]=p):p=e[8],p}export{l as component};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/run-C8QYJmux.js","assets/compiler-runtime-CLAvuQ-D.js","assets/rolldown-runtime-QTnfLwEv.js","assets/fallbacks-f8E4aL2c.js","assets/state-CvX-YRlC.js","assets/-workbench-terminal-C3m5o50g.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-f8E4aL2c.js";import{t as s}from"./preload-helper-CjdClQve.js";var c=t(`/(home)/$worktree/run`)({component:e(()=>s(()=>import(`./run-C8QYJmux.js`),__vite__mapDeps([0,1,2,3,4,5])),`component`),validateSearch:n(i({inactive:a(r),sessionId:o}))});export{c as t};
|