@jean2/client 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +17 -61
  2. package/dist/apple-touch-icon.png +0 -0
  3. package/dist/assets/ServerContext-DwL_fyZz.js +1 -0
  4. package/dist/assets/SessionContent-BtiY3mu_.js +11 -0
  5. package/dist/assets/SessionMenuButton-bQK4n-kR.js +9 -0
  6. package/dist/assets/SessionMenuButton-kHJ-D0s7.css +1 -0
  7. package/dist/assets/{ThemeProvider-Da23NPAS.js → ThemeProvider-ewislekS.js} +1 -1
  8. package/dist/assets/{_serverId-DXVl_AFQ.js → _serverId-C48-o6-u.js} +1 -1
  9. package/dist/assets/_serverId-D3aDURKI.js +11 -0
  10. package/dist/assets/_sessionId-CGhGqBYc.js +1 -0
  11. package/dist/assets/_sessionId-CvDJrnJN.js +1 -0
  12. package/dist/assets/add-server-CP5wqpVh.js +1 -0
  13. package/dist/assets/alert-DgtoQIaS.js +31 -0
  14. package/dist/assets/{archive-pL5uw9sg.js → archive-CJqmerPG.js} +1 -1
  15. package/dist/assets/arrow-left-CVfrLbQ4.js +1 -0
  16. package/dist/assets/badge-D8GOF5_2.js +1 -0
  17. package/dist/assets/button-BCE1SnDM.js +45 -0
  18. package/dist/assets/{confirmation-dialog-CFCxzDEX.js → confirmation-dialog-jz6z4bio.js} +1 -1
  19. package/dist/assets/{dialog-BNCh4KEM.js → dialog-B-f8lUpV.js} +1 -1
  20. package/dist/assets/http-namespace-DWmi6fC5.js +1 -0
  21. package/dist/assets/index-BtLxCr26.css +2 -0
  22. package/dist/assets/index-DJCUk1OY.js +10 -0
  23. package/dist/assets/mutation-BEKt1T6j.js +1 -0
  24. package/dist/assets/overview-dKJbdHqg.js +1 -0
  25. package/dist/assets/platform-C9rqh4_A.js +1 -0
  26. package/dist/assets/popover-CVyjoKPS.js +1 -0
  27. package/dist/assets/queries-BTzP-7g4.js +1 -0
  28. package/dist/assets/{react-dom-DHWV5rS5.js → react-dom-CZubyneS.js} +1 -1
  29. package/dist/assets/{refresh-cw-BYRFQSBp.js → refresh-cw-DJ3pEikS.js} +1 -1
  30. package/dist/assets/routes-g7_8LIaN.js +1 -0
  31. package/dist/assets/sidebar-lTmDketj.js +1 -0
  32. package/dist/assets/{triangle-alert-Bil68MLf.js → triangle-alert-C32xrDjH.js} +1 -1
  33. package/dist/assets/useNavigate-D0TSLH_-.js +1 -0
  34. package/dist/assets/workspace-CQqKn4Z3.js +1 -0
  35. package/dist/cli.mjs +21 -9
  36. package/dist/favicon.ico +0 -0
  37. package/dist/icon-192.png +0 -0
  38. package/dist/icon-512.png +0 -0
  39. package/dist/index.html +14 -15
  40. package/dist/manifest.webmanifest +1 -0
  41. package/dist/registerSW.js +1 -0
  42. package/dist/sw.js +1 -0
  43. package/dist/workbox-6829fd8d.js +1 -0
  44. package/package.json +1 -1
  45. package/dist/assets/ServerContext-CH3cYgM3.js +0 -1
  46. package/dist/assets/SessionContent-CMU2K0ZO.js +0 -9
  47. package/dist/assets/SessionMenuButton-B9RQW_iM.css +0 -1
  48. package/dist/assets/SessionMenuButton-vkh7M4zW.js +0 -9
  49. package/dist/assets/_serverId-BCYw0-Oi.js +0 -12
  50. package/dist/assets/_sessionId-B6Q1fh9D.js +0 -1
  51. package/dist/assets/_sessionId-DErHwuR_.js +0 -1
  52. package/dist/assets/add-server-BdiLp0YW.js +0 -1
  53. package/dist/assets/alert-BsN6ZzaK.js +0 -31
  54. package/dist/assets/arrow-left-DSvwF2mY.js +0 -1
  55. package/dist/assets/badge-Cjebg6Sp.js +0 -1
  56. package/dist/assets/button--1wnt03c.js +0 -45
  57. package/dist/assets/classPrivateFieldGet2-BGlEuFdn.js +0 -1
  58. package/dist/assets/core-BYcrozIP.js +0 -1
  59. package/dist/assets/dist-js-s36UjyQ4.js +0 -1
  60. package/dist/assets/event-Crr43Eih.js +0 -1
  61. package/dist/assets/index-BPY3JRFs.css +0 -2
  62. package/dist/assets/index-DFZki7uV.js +0 -10
  63. package/dist/assets/mutation-CAoDu7x3.js +0 -1
  64. package/dist/assets/overview-BqXC_X43.js +0 -1
  65. package/dist/assets/platform-BOMKRNFM.js +0 -1
  66. package/dist/assets/popover-C8mm1NWm.js +0 -1
  67. package/dist/assets/preload-helper-eKqpTzup.js +0 -1
  68. package/dist/assets/queries-CFdMXU0x.js +0 -1
  69. package/dist/assets/routes-cgaNpRxR.js +0 -1
  70. package/dist/assets/sidebar-C-dZ1XFl.js +0 -1
  71. package/dist/assets/src-DMBD0Xgc.js +0 -1
  72. package/dist/assets/useNavigate-Ckup4lZi.js +0 -1
  73. package/dist/assets/workspace-CdMsk_3x.js +0 -1
  74. /package/dist/assets/{createLucideIcon-CuVT3KNW.js → createLucideIcon-mdFRYmiK.js} +0 -0
  75. /package/dist/assets/{overview-C91MPxfo.js → overview-B_ZDrH1J.js} +0 -0
  76. /package/dist/assets/{useRouter-C67ywEA3.js → useRouter-C_VHQC31.js} +0 -0
  77. /package/dist/assets/{workspace-84xYPx6s.js → workspace-_n12Hx4o.js} +0 -0
@@ -1 +0,0 @@
1
- import{i as e,n as t,o as n,r}from"./compiler-runtime-DZXZ41-q.js";import{a as i,i as a,n as o,r as s,t as c}from"./classPrivateFieldGet2-BGlEuFdn.js";import{l}from"./ServerContext-CH3cYgM3.js";import{t as u}from"./useRouter-C67ywEA3.js";var d=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},f,p,m,h=new(f=new WeakMap,p=new WeakMap,m=new WeakMap,class extends d{constructor(){super(),a(this,f,void 0),a(this,p,void 0),a(this,m,void 0),o(m,this,e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}})}onSubscribe(){c(p,this)||this.setEventListener(c(m,this))}onUnsubscribe(){if(!this.hasListeners()){var e;(e=c(p,this))==null||e.call(this),o(p,this,void 0)}}setEventListener(e){var t;o(m,this,e),(t=c(p,this))==null||t.call(this),o(p,this,e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()}))}setFocused(e){c(f,this)!==e&&(o(f,this,e),this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return typeof c(f,this)==`boolean`?c(f,this):((e=globalThis.document)==null?void 0:e.visibilityState)!==`hidden`}}),g,_,v={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},y=new(g=new WeakMap,_=new WeakMap,class{constructor(){a(this,g,v),a(this,_,!1)}setTimeoutProvider(e){o(g,this,e)}setTimeout(e,t){return c(g,this).setTimeout(e,t)}clearTimeout(e){c(g,this).clearTimeout(e)}setInterval(e,t){return c(g,this).setInterval(e,t)}clearInterval(e){c(g,this).clearInterval(e)}});function b(e){setTimeout(e,0)}var x=typeof window>`u`||`Deno`in globalThis;function S(){}function C(e,t){return typeof e==`function`?e(t):e}function w(e){return typeof e==`number`&&e>=0&&e!==1/0}function T(e,t){return Math.max(e+(t||0)-Date.now(),0)}function E(e,t){return typeof e==`function`?e(t):e}function D(e,t){return typeof e==`function`?e(t):e}function O(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==A(o,t.options))return!1}else if(!M(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function k(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(j(t.options.mutationKey)!==j(a))return!1}else if(!M(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function A(e,t){return((t==null?void 0:t.queryKeyHashFn)||j)(e)}function j(e){return JSON.stringify(e,(e,t)=>re(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function M(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>M(e[n],t[n])):!1}var N=Object.prototype.hasOwnProperty;function ee(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ne(e)&&ne(t);if(!r&&!(re(e)&&re(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:N.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ee(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function te(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ne(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function re(e){if(!ie(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ie(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ie(e){return Object.prototype.toString.call(e)===`[object Object]`}function ae(e){return new Promise(t=>{y.setTimeout(t,e)})}function oe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ee(e,t)}function se(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ce(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var le=Symbol();function ue(e,t){return!e.queryFn&&t!=null&&t.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===le?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function de(e,t){return typeof e==`function`?e(...t):!!e}function fe(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i!=null||(i=t()),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var pe=(()=>{let e=()=>x;return{isServer(){return e()},setIsServer(t){e=t}}})();function me(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var he=b;function ge(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=he,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var _e=ge(),ve,P,ye,be=new(ve=new WeakMap,P=new WeakMap,ye=new WeakMap,class extends d{constructor(){super(),a(this,ve,!0),a(this,P,void 0),a(this,ye,void 0),o(ye,this,e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}})}onSubscribe(){c(P,this)||this.setEventListener(c(ye,this))}onUnsubscribe(){if(!this.hasListeners()){var e;(e=c(P,this))==null||e.call(this),o(P,this,void 0)}}setEventListener(e){var t;o(ye,this,e),(t=c(P,this))==null||t.call(this),o(P,this,e(this.setOnline.bind(this)))}setOnline(e){c(ve,this)!==e&&(o(ve,this,e),this.listeners.forEach(t=>{t(e)}))}isOnline(){return c(ve,this)}});function xe(e){return Math.min(1e3*2**e,3e4)}function Se(e){return(e==null?`online`:e)===`online`?be.isOnline():!0}var Ce=class extends Error{constructor(e){super(`CancelledError`),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function we(e){let t=!1,n=0,r,i=me(),a=()=>i.status!==`pending`,o=t=>{if(!a()){var n;let r=new Ce(t);f(r),(n=e.onCancel)==null||n.call(e,r)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>h.isFocused()&&(e.networkMode===`always`||be.isOnline())&&e.canRun(),u=()=>Se(e.networkMode)&&e.canRun(),d=e=>{a()||(r==null||r(),i.resolve(e))},f=e=>{a()||(r==null||r(),i.reject(e))},p=()=>new Promise(t=>{var n;r=e=>{(a()||l())&&t(e)},(n=e.onPause)==null||n.call(e)}).then(()=>{if(r=void 0,!a()){var t;(t=e.onContinue)==null||t.call(e)}}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i==null?e.fn():i}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{var i,o,s;if(a())return;let c=(i=e.retry)==null?pe.isServer()?0:3:i,u=(o=e.retryDelay)==null?xe:o,d=typeof u==`function`?u(n,r):u,h=c===!0||typeof c==`number`&&n<c||typeof c==`function`&&c(n,r);if(t||!h){f(r);return}n++,(s=e.onFail)==null||s.call(e,n,r),ae(d).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Te,Ee=(Te=new WeakMap,class{constructor(){a(this,Te,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w(this.gcTime)&&o(Te,this,y.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e==null?pe.isServer()?1/0:300*1e3:e)}clearGcTimeout(){c(Te,this)!==void 0&&(y.clearTimeout(c(Te,this)),o(Te,this,void 0))}});function De(e){return{onFetch:(t,n)=>{var r,i,a;let o=t.options,s=(r=t.fetchOptions)==null||(r=r.meta)==null||(r=r.fetchMore)==null?void 0:r.direction,c=((i=t.state.data)==null?void 0:i.pages)||[],l=((a=t.state.data)==null?void 0:a.pageParams)||[],u={pages:[],pageParams:[]},d=0,f=async()=>{let n=!1,r=e=>{fe(e,()=>t.signal,()=>n=!0)},i=ue(t.options,t.fetchOptions),a=async(e,a,o)=>{if(n)return Promise.reject(t.signal.reason);if(a==null&&e.pages.length)return Promise.resolve(e);let s=await i((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:a,direction:o?`backward`:`forward`,meta:t.options.meta};return r(e),e})()),{maxPages:c}=t.options,l=o?ce:se;return{pages:l(e.pages,s,c),pageParams:l(e.pageParams,a,c)}};if(s&&c.length){let e=s===`backward`,t=e?ke:Oe,n={pages:c,pageParams:l};u=await a(n,t(o,n),e)}else{let t=e==null?c.length:e;do{var f;let e=d===0?(f=l[0])==null?o.initialPageParam:f:Oe(o,u);if(d>0&&e==null)break;u=await a(u,e),d++}while(d<t)}return u};t.options.persister?t.fetchFn=()=>{var e,r;return(e=(r=t.options).persister)==null?void 0:e.call(r,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=f}}}function Oe(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ke(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function Ae(e,t){i(e,t),t.add(e)}var je,Me,Ne,F,Pe,I,Fe,Ie,L,Le=(je=new WeakMap,Me=new WeakMap,Ne=new WeakMap,F=new WeakMap,Pe=new WeakMap,I=new WeakMap,Fe=new WeakMap,Ie=new WeakMap,L=new WeakSet,class extends Ee{constructor(e){var t;super(),Ae(this,L),a(this,je,void 0),a(this,Me,void 0),a(this,Ne,void 0),a(this,F,void 0),a(this,Pe,void 0),a(this,I,void 0),a(this,Fe,void 0),a(this,Ie,void 0),o(Ie,this,!1),o(Fe,this,e.defaultOptions),this.setOptions(e.options),this.observers=[],o(Pe,this,e.client),o(F,this,c(Pe,this).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,o(Me,this,Ve(this.options)),this.state=(t=e.state)==null?c(Me,this):t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return c(je,this)}get promise(){var e;return(e=c(I,this))==null?void 0:e.promise}setOptions(e){if(this.options={...c(Fe,this),...e},e!=null&&e._type&&o(je,this,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ve(this.options);e.data!==void 0&&(this.setState(Be(e.data,e.dataUpdatedAt)),o(Me,this,e))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&c(F,this).remove(this)}setData(e,t){let n=oe(this.state.data,e,this.options);return s(L,this,R).call(this,{data:n,type:`success`,dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),n}setState(e){s(L,this,R).call(this,{type:`setState`,state:e})}cancel(e){var t,n;let r=(t=c(I,this))==null?void 0:t.promise;return(n=c(I,this))==null||n.cancel(e),r?r.then(S).catch(S):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return c(Me,this)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>D(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===le||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>E(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!T(this.state.dataUpdatedAt,e)}onFocus(){var e;let t=this.observers.find(e=>e.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(e=c(I,this))==null||e.continue()}onOnline(){var e;let t=this.observers.find(e=>e.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(e=c(I,this))==null||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),c(F,this).notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(c(I,this)&&(c(Ie,this)||s(L,this,Re).call(this)?c(I,this).cancel({revert:!0}):c(I,this).cancelRetry()),this.scheduleGc()),c(F,this).notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||s(L,this,R).call(this,{type:`invalidate`})}async fetch(e,t){var n,r;if(this.state.fetchStatus!==`idle`&&((n=c(I,this))==null?void 0:n.status())!==`rejected`){if(this.state.data!==void 0&&t!=null&&t.cancelRefetch)this.cancel({silent:!0});else if(c(I,this))return c(I,this).continueRetry(),c(I,this).promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let i=new AbortController,a=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(o(Ie,this,!0),i.signal)})},l=()=>{let e=ue(this.options,t),n=(()=>{let e={client:c(Pe,this),queryKey:this.queryKey,meta:this.meta};return a(e),e})();return o(Ie,this,!1),this.options.persister?this.options.persister(e,n,this):e(n)},u=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:c(Pe,this),state:this.state,fetchFn:l};return a(e),e})(),d=c(je,this)===`infinite`?De(this.options.pages):this.options.behavior;if(d==null||d.onFetch(u,this),o(Ne,this,this.state),this.state.fetchStatus===`idle`||this.state.fetchMeta!==((r=u.fetchOptions)==null?void 0:r.meta)){var f;s(L,this,R).call(this,{type:`fetch`,meta:(f=u.fetchOptions)==null?void 0:f.meta})}o(I,this,we({initialPromise:t==null?void 0:t.initialPromise,fn:u.fetchFn,onCancel:e=>{e instanceof Ce&&e.revert&&this.setState({...c(Ne,this),fetchStatus:`idle`}),i.abort()},onFail:(e,t)=>{s(L,this,R).call(this,{type:`failed`,failureCount:e,error:t})},onPause:()=>{s(L,this,R).call(this,{type:`pause`})},onContinue:()=>{s(L,this,R).call(this,{type:`continue`})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{var p,m,h,g;let e=await c(I,this).start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),(p=(m=c(F,this).config).onSuccess)==null||p.call(m,e,this),(h=(g=c(F,this).config).onSettled)==null||h.call(g,e,this.state.error,this),e}catch(e){var _,v,y,b;if(e instanceof Ce){if(e.silent)return c(I,this).promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw s(L,this,R).call(this,{type:`error`,error:e}),(_=(v=c(F,this).config).onError)==null||_.call(v,e,this),(y=(b=c(F,this).config).onSettled)==null||y.call(b,this.state.data,e,this),e}finally{this.scheduleGc()}}});function Re(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}function R(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:var n;return{...t,...ze(t.data,this.options),fetchMeta:(n=e.meta)==null?null:n};case`success`:let r={...t,...Be(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return o(Ne,this,e.manual?r:void 0),r;case`error`:let i=e.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),_e.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),c(F,this).notify({query:this,type:`updated`,action:e})})}function ze(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Se(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Be(e,t){return{data:e,dataUpdatedAt:t==null?Date.now():t,error:null,isInvalidated:!1,status:`success`}}function Ve(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r==null?Date.now():r:0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var z=n(r(),1),B=t(),He=z.createContext(void 0),Ue=e=>{let t=z.useContext(He);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},We=({client:e,children:t})=>(z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,B.jsx)(He.Provider,{value:e,children:t}));function Ge(e){return e[e.length-1]}function Ke(e){return typeof e==`function`}function V(e,t){return Ke(e)?e(t):e}var qe=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,Ye=()=>Object.create(null),Xe=(e,t)=>H(e,t,Ye);function H(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=et(e)&&et(i);if(!a&&!(Qe(e)&&Qe(i)))return i;let o=a?e:Ze(e);if(!o)return i;let s=a?i:Ze(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:qe.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=H(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function Ze(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!Je.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!Je.call(e,t))return!1;r.push(t)}return r}function Qe(e){if(!$e(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!$e(n)||!n.hasOwnProperty(`isPrototypeOf`))}function $e(e){return Object.prototype.toString.call(e)===`[object Object]`}function et(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function U(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!U(e[r],t[r],n))return!1;return!0}if(Qe(e)&&Qe(t)){var r;let i=(r=n==null?void 0:n.ignoreUndefined)==null?!0:r;if(n!=null&&n.partial){for(let r in t)if((!i||t[r]!==void 0)&&!U(e[r],t[r],n))return!1;return!0}let a=0;if(!i)a=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&a++;let o=0;for(let r in t)if((!i||t[r]!==void 0)&&(o++,o>a||!U(e[r],t[r],n)))return!1;return a===o}return!1}function tt(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e==null||e(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function nt(e){return typeof(e==null?void 0:e.message)==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function rt(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function it(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function at(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return it(t)}var ot=[`http:`,`https:`,`mailto:`,`tel:`];function st(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ct(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=at(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=at(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function lt(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ut(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function W(){throw Error(`Invariant failed`)}function dt(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||(n=e),t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var G=4,ft=5;function pt(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function mt(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=pt(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function ht(e,t,n,r,i,a,o){o==null||o(n);let s=r;{var c,l,u,d,f,p,m,h,g;let r=(c=n.fullPath)==null?n.from:c,o=r.length,te=(l=(u=n.options)==null?void 0:u.caseSensitive)==null?e:l,ne=!!(!((d=n.options)==null||(d=d.params)==null)&&d.parse&&!((f=n.options)==null||(f=f.skipRouteOnParseError)==null)&&f.params);for(;s<o;){let e=mt(r,s,t),o,c=s,l=e[5];switch(s=l+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(te){var _;let e=(_=i.static)==null?void 0:_.get(t);if(e)o=e;else{var v,y;(v=i).static!=null||(v.static=new Map);let e=q((y=n.fullPath)==null?n.from:y);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{var b;let e=t.toLowerCase(),r=(b=i.staticInsensitive)==null?void 0:b.get(e);if(r)o=r;else{var x,S;(x=i).staticInsensitive!=null||(x.staticInsensitive=new Map);let t=q((S=n.fullPath)==null?n.from:S);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{var C;let t=r.substring(c,e[1]),s=r.substring(e[4],l),u=te&&!!(t||s),d=t?u?t:t.toLowerCase():void 0,f=s?u?s:s.toLowerCase():void 0,p=!ne&&((C=i.dynamic)==null?void 0:C.find(e=>!e.skipOnParamError&&e.caseSensitive===u&&e.prefix===d&&e.suffix===f));if(p)o=p;else{var w,T;let e=_t(1,(w=n.fullPath)==null?n.from:w,u,d,f);o=e,e.depth=a,e.parent=i,(T=i).dynamic!=null||(T.dynamic=[]),i.dynamic.push(e)}break}case 3:{var E;let t=r.substring(c,e[1]),s=r.substring(e[4],l),u=te&&!!(t||s),d=t?u?t:t.toLowerCase():void 0,f=s?u?s:s.toLowerCase():void 0,p=!ne&&((E=i.optional)==null?void 0:E.find(e=>!e.skipOnParamError&&e.caseSensitive===u&&e.prefix===d&&e.suffix===f));if(p)o=p;else{var D,O;let e=_t(3,(D=n.fullPath)==null?n.from:D,u,d,f);o=e,e.parent=i,e.depth=a,(O=i).optional!=null||(O.optional=[]),i.optional.push(e)}break}case 2:{var k,A;let t=r.substring(c,e[1]),s=r.substring(e[4],l),u=te&&!!(t||s),d=t?u?t:t.toLowerCase():void 0,f=s?u?s:s.toLowerCase():void 0,p=_t(2,(k=n.fullPath)==null?n.from:k,u,d,f);o=p,p.parent=i,p.depth=a,(A=i).wildcard!=null||(A.wildcard=[]),i.wildcard.push(p)}}i=o}if(ne&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){var j,M;let e=q((j=n.fullPath)==null?n.from:j);e.kind=ft,e.parent=i,a++,e.depth=a,(M=i).pathless!=null||(M.pathless=[]),i.pathless.push(e),i=e}let re=(n.path||!n.children)&&!n.isRoot;if(re&&r.endsWith(`/`)){var N;let e=q((N=n.fullPath)==null?n.from:N);e.kind=G,e.parent=i,a++,e.depth=a,i.index=e,i=e}if(i.parse=(p=(m=n.options)==null||(m=m.params)==null?void 0:m.parse)==null?null:p,i.skipOnParamError=ne,i.parsingPriority=(h=(g=n.options)==null||(g=g.skipRouteOnParseError)==null?void 0:g.priority)==null?0:h,re&&!i.route){var ee;i.route=n,i.fullPath=(ee=n.fullPath)==null?n.from:ee}}if(n.children)for(let r of n.children)ht(e,t,r,s,i,a,o)}function gt(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function K(e){var t,n,r;if(e.pathless)for(let t of e.pathless)K(t);if(e.static)for(let t of e.static.values())K(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())K(t);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(gt);for(let t of e.dynamic)K(t)}if((n=e.optional)!=null&&n.length){e.optional.sort(gt);for(let t of e.optional)K(t)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(gt);for(let t of e.wildcard)K(t)}}function q(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function _t(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function vt(e,t){let n=q(`/`),r=new Uint16Array(6);for(let t of e)ht(!1,r,t,1,n,0);K(n),t.masksTree=n,t.flatCache=dt(1e3)}function yt(e,t){e||(e=`/`);let n=t.flatCache.get(e);if(n)return n;let r=wt(e,t.masksTree);return t.flatCache.set(e,r),r}function bt(e,t,n,r,i){e||(e=`/`),r||(r=`/`);let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=q(`/`),ht(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),wt(r,o,n)}function xt(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||(e=`/`);let a;try{a=wt(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Et(a.route)),t.matchCache.set(r,a),a}function St(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Ct(e,t=!1,n){let r=q(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return ht(t,i,e,1,r,0,e=>{if(n==null||n(e,s),e.id in a&&W(),a[e.id]=e,s!==0&&e.path){let t=St(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),K(r),{processedTree:{segmentTree:r,singleCache:dt(1e3),matchCache:dt(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function wt(e,t,n=!1){let r=e.split(`/`),i=Ot(e,r,t,n);if(!i)return null;let[a]=Tt(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function Tt(e,t,n){var r,i,a,o,s,c,l,u;let d=Dt(n.node),f=null,p=Object.create(null),m=(r=(i=n.extract)==null?void 0:i.part)==null?0:r,h=(a=(o=n.extract)==null?void 0:o.node)==null?0:a,g=(s=(c=n.extract)==null?void 0:c.path)==null?0:s,_=(l=(u=n.extract)==null?void 0:u.segment)==null?0:l;for(;h<d.length;m++,h++,g++,_++){let r=d[h];if(r.kind===G)break;if(r.kind===ft){_--,m--,g--;continue}let i=t[m],a=g;if(i&&(g+=i.length),r.kind===1){var v,y;f!=null||(f=n.node.fullPath.split(`/`));let e=f[_],t=(v=(y=r.prefix)==null?void 0:y.length)==null?0:v;if(e.charCodeAt(t)===123){var b,x;let n=(b=(x=r.suffix)==null?void 0:x.length)==null?0:b,a=e.substring(t+2,e.length-n-1),o=i.substring(t,i.length-n);p[a]=decodeURIComponent(o)}else{let t=e.substring(1);p[t]=decodeURIComponent(i)}}else if(r.kind===3){var S,C,w,T;if(n.skipped&1<<h){m--,g=a-1;continue}f!=null||(f=n.node.fullPath.split(`/`));let e=f[_],t=(S=(C=r.prefix)==null?void 0:C.length)==null?0:S,o=(w=(T=r.suffix)==null?void 0:T.length)==null?0:w,s=e.substring(t+3,e.length-o-1),c=r.suffix||r.prefix?i.substring(t,i.length-o):i;c&&(p[s]=decodeURIComponent(c))}else if(r.kind===2){var E,D,O,k;let t=r,n=e.substring(a+((E=(D=t.prefix)==null?void 0:D.length)==null?0:E),e.length-((O=(k=t.suffix)==null?void 0:k.length)==null?0:O)),i=decodeURIComponent(n);p[`*`]=i,p._splat=i;break}}return n.rawParams&&Object.assign(p,n.rawParams),[p,{part:m,node:h,path:g,segment:_}]}function Et(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Dt(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Ot(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!Ge(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:h,skipped:g,depth:_,statics:v,dynamics:y,optionals:b}=n,{extract:x,rawParams:S,parsedParams:C}=n;if(i.skipOnParamError){if(!kt(e,t,n))continue;S=n.rawParams,x=n.extract,C=n.parsedParams}r&&i.route&&i.kind!==G&&At(l,n)&&(l=n);let w=h===o;if(w&&(i.route&&!a&&At(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let T=w?void 0:t[h],E;if(w&&i.index){let n={node:i.index,index:h,skipped:g,depth:_+1,statics:v,dynamics:y,optionals:b,extract:x,rawParams:S,parsedParams:C},r=!0;if(i.index.skipOnParamError&&(kt(e,t,n)||(r=!1)),r){if(v===o&&!y&&!b&&!g)return n;At(u,n)&&(u=n)}}if(i.wildcard&&At(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r){var d;if(w||!(n.caseSensitive?T:(d=E)==null?E=T.toLowerCase():d).startsWith(r))continue}if(i){if(w)continue;let e=t.slice(h).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:g,depth:_,statics:v,dynamics:y,optionals:b,extract:x,rawParams:S,parsedParams:C};if(!(n.skipOnParamError&&!kt(e,t,a))){c=a;break}}if(i.optional){let e=g|1<<_,t=_+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:h,skipped:e,depth:t,statics:v,dynamics:y,optionals:b,extract:x,rawParams:S,parsedParams:C})}if(!w)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){var f;let e=n.caseSensitive?T:(f=E)==null?E=T.toLowerCase():f;if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:h+1,skipped:g,depth:t,statics:v,dynamics:y,optionals:b+1,extract:x,rawParams:S,parsedParams:C})}}if(!w&&i.dynamic&&T)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){var p;let e=t.caseSensitive?T:(p=E)==null?E=T.toLowerCase():p;if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:h+1,skipped:g,depth:_+1,statics:v,dynamics:y+1,optionals:b,extract:x,rawParams:S,parsedParams:C})}if(!w&&i.staticInsensitive){var m;let e=i.staticInsensitive.get((m=E)==null?E=T.toLowerCase():m);e&&s.push({node:e,index:h+1,skipped:g,depth:_+1,statics:v+1,dynamics:y,optionals:b,extract:x,rawParams:S,parsedParams:C})}if(!w&&i.static){let e=i.static.get(T);e&&s.push({node:e,index:h+1,skipped:g,depth:_+1,statics:v+1,dynamics:y,optionals:b,extract:x,rawParams:S,parsedParams:C})}if(i.pathless){let e=_+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:h,skipped:g,depth:e,statics:v,dynamics:y,optionals:b,extract:x,rawParams:S,parsedParams:C})}}}if(u&&c)return At(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){var h;let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return(h=l).rawParams!=null||(h.rawParams=Object.create(null)),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function kt(e,t,n){try{let[r,i]=Tt(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function At(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===G)>(e.node.kind===G)||t.node.kind===G==(e.node.kind===G)&&t.depth>e.depth))):!0}function jt(e){return Mt(e.filter(e=>e!==void 0).join(`/`))}function Mt(e){return e.replace(/\/{2,}/g,`/`)}function Nt(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Pt(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Ft(e){return Pt(Nt(e))}function It(e,t){return e!=null&&e.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Lt(e,t,n){return It(e,n)===It(t,n)}function Rt({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&Ge(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(Ge(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=mt(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=Mt(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function zt(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>{var n;return(n=t.get(e))==null?e:n})}function Bt(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ht(e,n)).join(`/`):Ht(r,n):r}function Vt({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=mt(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let f=c[0];if(f===0){l+=`/`+e.substring(r,o);continue}if(f===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Bt(`_splat`,t,n);l+=`/`+u+f+d;continue}if(f===1){var u;let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let d=e.substring(r,c[1]),f=e.substring(c[4],o),p=(u=Bt(s,t,n))==null?`undefined`:u;l+=`/`+d+p+f;continue}if(f===3){var d;let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),f=e.substring(c[4],o),p=(d=Bt(i,t,n))==null?``:d;l+=`/`+u+p+f;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Ht(e,t){var n;let r=encodeURIComponent(e);return(n=t==null?void 0:t(r))==null?r:n}function J(e){return!!(e!=null&&e.isNotFound)}function Ut(){try{return typeof window<`u`&&typeof window.sessionStorage==`object`?window.sessionStorage:void 0}catch{return}}var Wt=`tsr-scroll-restoration-v1_3`;function Gt(){let e=Ut();if(!e)return null;let t={};try{let n=JSON.parse(e.getItem(`tsr-scroll-restoration-v1_3`)||`{}`);Qe(n)&&(t=n)}catch{}return{get state(){return t},set:e=>{t=V(e,t)||t},persist:()=>{try{e.setItem(Wt,JSON.stringify(t))}catch{}}}}var Kt=Gt(),qt=e=>e.state.__TSR_key||e.href;function Jt(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var Yt=!1,Xt=`window`,Zt=`data-scroll-restoration-id`;function Qt(e,t){var n;if(!Kt)return;let r=Kt;if((n=t==null?e.options.scrollRestoration:t)!=null&&n&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!r)return;e.isScrollRestorationSetup=!0,Yt=!1;let i=e.options.getScrollRestorationKey||qt,a=new Map;window.history.scrollRestoration=`manual`;let o=t=>{if(!(Yt||!e.isScrollRestoring))if(t.target===document||t.target===window)a.set(Xt,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{let e=t.target;a.set(e,{scrollX:e.scrollLeft||0,scrollY:e.scrollTop||0})}},s=t=>{var n;if(!e.isScrollRestoring||!t||a.size===0||!r)return;let i=(n=r.state)[t]||(n[t]={});for(let[e,t]of a){let n;if(e===Xt)n=Xt;else if(e.isConnected){let t=e.getAttribute(Zt);n=t?`[${Zt}="${t}"]`:Jt(e)}n&&(i[n]=t)}};document.addEventListener(`scroll`,o,!0),e.subscribe(`onBeforeLoad`,e=>{s(e.fromLocation?i(e.fromLocation):void 0),a.clear()}),window.addEventListener(`pagehide`,()=>{var t;s(i((t=e.stores.resolvedLocation.state)==null?e.stores.location.state:t)),r.persist()}),e.subscribe(`onRendered`,t=>{let n=i(t.toLocation),o=e.options.scrollRestorationBehavior,s=e.options.scrollToTopSelectors;if(a.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))){Yt=!0;try{let t=e.isScrollRestoring?r.state[n]:void 0,i=!1;if(t)for(let e in t){let n=t[e];if(!Qe(n))continue;let{scrollX:r,scrollY:a}=n;if(!(!Number.isFinite(r)||!Number.isFinite(a))){if(e===Xt)window.scrollTo({top:a,left:r,behavior:o}),i=!0;else if(e){let t;try{t=document.querySelector(e)}catch{continue}t&&(t.scrollLeft=r,t.scrollTop=a,i=!0)}}}if(!i){let t=e.history.location.hash.slice(1);if(t){var c,l;let e=(c=(l=window.history.state)==null?void 0:l.__hashScrollIntoViewOptions)==null?!0:c;if(e){let n=document.getElementById(t);n&&n.scrollIntoView(e)}}else{let e={top:0,left:0,behavior:o};if(window.scrollTo(e),s)for(let t of s){if(t===Xt)continue;let n=typeof t==`function`?t():document.querySelector(t);n&&n.scrollTo(e)}}}}finally{Yt=!1}e.isScrollRestoring&&r.set(e=>(e[n]||(e[n]={}),e))}})}function $t(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 en(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function tn(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]=en(r):Array.isArray(t)?t.push(en(r)):n[e]=[t,en(r)]}return n}var nn=an(JSON.parse),rn=on(JSON.stringify,JSON.parse);function an(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=tn(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function on(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=$t(e,r);return t?`?${t}`:``}}var sn=`__root__`;function cn(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Y(e){return e instanceof Response&&!!e.options}function ln(e){return{input:({url:t})=>{for(let n of e)t=dn(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=fn(e[n],t);return t}}}function un(e){let t=Ft(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=jt([`/`,t,e.pathname]),e)}}function dn(e,t){var n;let r=e==null||(n=e.input)==null?void 0:n.call(e,{url:t});if(r){if(typeof r==`string`)return new URL(r);if(r instanceof URL)return r}return t}function fn(e,t){var n;let r=e==null||(n=e.output)==null?void 0:n.call(e,{url:t});if(r){if(typeof r==`string`)return new URL(r);if(r instanceof URL)return r}return t}function pn(e){let t=e;return{get state(){return t},setState(e){t=e(t)}}}function mn(e){return{get state(){return e()}}}function hn(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(()=>gn(o,_.state)),x=r(()=>gn(s,v.state)),S=r(()=>gn(c,y.state)),C=r(()=>_.state[0]),w=r(()=>_.state.some(e=>{var t;return((t=o.get(e))==null?void 0:t.state.status)===`pending`})),T=r(()=>{var e;return{locationHref:p.state.href,resolvedLocationHref:(e=m.state)==null?void 0:e.href,status:l.state}}),E=r(()=>({status:l.state,loadedAt:u.state,isLoading:d.state,isTransitioning:f.state,matches:b.state,location:p.state,resolvedLocation:m.state,statusCode:h.state,redirect:g.state})),D=dt(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.state;for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.state}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingMatchesId:v,cachedMatchesId:y,activeMatchesSnapshot:b,pendingMatchesSnapshot:x,cachedMatchesSnapshot:S,firstMatchId:C,hasPendingMatches:w,matchRouteReactivity:T,activeMatchStoresById:o,pendingMatchStoresById:s,cachedMatchStoresById:c,__store:E,getMatchStoreByRouteId:O,setActiveMatches:A,setPendingMatches:j,setCachedMatches:M};A(e.matches),a==null||a(k);function A(e){_n(e,o,_,n,i)}function j(e){_n(e,s,v,n,i)}function M(e){_n(e,c,y,n,i)}return k}function gn(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.state)}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.state!==n&&e.setState(()=>n)}ut(n.state,a)||n.setState(()=>a)})}var vn=e=>{if(!e.rendered){var t;return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)}},yn=e=>e.stores.matchesId.state.some(t=>{var n;return(n=e.stores.activeMatchStoresById.get(t))==null?void 0:n.state._forcePending}),bn=(e,t)=>!!(e.preload&&!e.router.stores.activeMatchStoresById.has(t)),xn=(e,t,n=!0)=>{var r;let i={...(r=e.router.options.context)==null?{}:r},a=n?t:t-1;for(let t=0;t<=a;t++){let n=e.matches[t];if(!n)continue;let r=e.router.getMatch(n.id);r&&Object.assign(i,r.__routeContext,r.__beforeLoadContext)}return i},Sn=(e,t)=>{var n;if(!e.matches.length)return;let r=t.routeId,i=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),a=i>=0?i:0,o=r?e.matches.findIndex(e=>e.routeId===r):(n=e.firstBadMatchIndex)==null?e.matches.length-1:n;o<0&&(o=a);for(let t=o;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return r?o:a},X=(e,t,n)=>{if(!(!Y(n)&&!J(n))){if(Y(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){var r,i,a;(r=t._nonReactive.beforeLoadPromise)==null||r.resolve(),(i=t._nonReactive.loaderPromise)==null||i.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Y(n)?`redirected`:r.status===`pending`?`success`:r.status,context:xn(e,t.index),isFetching:!1,error:n})),J(n)&&!n.routeId&&(n.routeId=t.routeId),(a=t._nonReactive.loadPromise)==null||a.resolve()}throw Y(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n}},Cn=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},wn=(e,t,n)=>{let r=xn(e,n);e.updateMatch(t,e=>({...e,context:r}))},Tn=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex!=null||(e.firstBadMatchIndex=t),X(e,e.router.getMatch(i),n);try{var s,c;(s=(c=o.options).onError)==null||s.call(c,n)}catch(t){n=t,X(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>{var t,r;return(t=e._nonReactive.beforeLoadPromise)==null||t.resolve(),e._nonReactive.beforeLoadPromise=void 0,(r=e._nonReactive.loadPromise)==null||r.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!Y(n)&&!J(n)&&(e.serialError!=null||(e.serialError=n))},En=(e,t,n,r)=>{var i,a,o;if(r._nonReactive.pendingTimeout!==void 0)return;let s=(i=n.options.pendingMs)==null?e.router.options.defaultPendingMs:i;if(e.onReady&&!bn(e,t)&&(n.options.loader||n.options.beforeLoad||Ln(n))&&typeof s==`number`&&s!==1/0&&((a=n.options.pendingComponent)==null?(o=e.router.options)!=null&&o.defaultPendingComponent:a)){let t=setTimeout(()=>{vn(e)},s);r._nonReactive.pendingTimeout=t}},Dn=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;En(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&X(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},On=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=tt(()=>{a==null||a.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Tn(e,n,o,`PARSE_PARAMS`),s&&Tn(e,n,s,`VALIDATE_SEARCH`),En(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{var n;(n=i._nonReactive.beforeLoadPromise)==null||n.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=tt();let f={...xn(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=bn(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(Y(r)||J(r))&&(u(),Tn(e,n,r,`BEFORE_LOAD`)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),rt(y))return u(),y.catch(t=>{Tn(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),Tn(e,n,t,`BEFORE_LOAD`)}v(y)},kn=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>On(e,n,t,i),s=()=>{if(Cn(e,n))return;let t=Dn(e,n,i);return rt(t)?t.then(o):o()};return a()},An=(e,t,n)=>{var r,i,a,o,s,c;let l=e.router.getMatch(t);if(!l||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let u={ssr:e.router.options.ssr,matches:e.matches,match:l,params:l.params,loaderData:l.loaderData};return Promise.all([(r=(i=n.options).head)==null?void 0:r.call(i,u),(a=(o=n.options).scripts)==null?void 0:a.call(o,u),(s=(c=n.options).headers)==null?void 0:s.call(c,u)]).then(([e,t,n])=>({meta:e==null?void 0:e.meta,links:e==null?void 0:e.links,headScripts:e==null?void 0:e.scripts,headers:n,scripts:t,styles:e==null?void 0:e.styles}))},jn=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=xn(e,r),d=bn(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}},Mn=async(e,t,n,r,i)=>{try{let u=e.router.getMatch(n);try{In(i);let a=i.options.loader,o=typeof a==`function`?a:a==null?void 0:a.handler,s=o==null?void 0:o(jn(e,t,n,r,i)),c=!!o&&rt(s);if((c||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||u._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),o){let t=c?await s:s;X(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let l=u._nonReactive.minPendingPromise;l&&await l,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:xn(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){var a,o;let d=t;if((d==null?void 0:d.name)===`AbortError`){if(u.abortController.signal.aborted){var s;(s=u._nonReactive.loaderPromise)==null||s.resolve(),u._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:xn(e,r)}));return}let f=u._nonReactive.minPendingPromise;f&&await f,J(t)&&await((a=i.options.notFoundComponent)==null||(o=a.preload)==null?void 0:o.call(a)),X(e,e.router.getMatch(n),t);try{var c,l;(c=(l=i.options).onError)==null||c.call(l,t)}catch(t){d=t,X(e,e.router.getMatch(n),t)}!Y(d)&&!J(d)&&await In(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:d,context:xn(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),X(e,r,t)}},Nn=async(e,t,n)=>{var r;async function i(r,i,o,l,u){var f,p,m,h;let g=Date.now()-i.updatedAt,_=r?(f=(p=u.options.preloadStaleTime)==null?e.router.options.defaultPreloadStaleTime:p)==null?3e4:f:(m=(h=u.options.staleTime)==null?e.router.options.defaultStaleTime:h)==null?0:m,v=u.options.shouldReload,y=typeof v==`function`?v(jn(e,t,a,n,u)):v,{status:b,invalid:x}=l,S=g>=_&&(!!e.forceStaleReload||l.cause===`enter`||o!==void 0&&o!==l.id);s=b===`success`&&(x||(y==null?S:y)),r&&u.options.preload===!1||(s&&!e.sync&&d?(c=!0,(async()=>{try{var r,i;await Mn(e,t,a,n,u);let o=e.router.getMatch(a);(r=o._nonReactive.loaderPromise)==null||r.resolve(),(i=o._nonReactive.loadPromise)==null||i.resolve(),o._nonReactive.loaderPromise=void 0,o._nonReactive.loadPromise=void 0}catch(t){Y(t)&&await e.router.navigate(t.options)}})()):b!==`success`||s?await Mn(e,t,a,n,u):wn(e,a,n))}let{id:a,routeId:o}=e.matches[n],s=!1,c=!1,l=e.router.looseRoutesById[o],u=l.options.loader,d=((r=typeof u==`function`||u==null?void 0:u.staleReloadMode)==null?e.router.options.defaultStaleReloadMode:r)!==`blocking`;if(Cn(e,a)){if(!e.router.getMatch(a))return e.matches[n];wn(e,a,n)}else{var f,p;let t=e.router.getMatch(a),r=e.router.stores.matchesId.state[n],s=((f=r&&e.router.stores.activeMatchStoresById.get(r)||null)==null?void 0:f.routeId)===o?r:(p=e.router.stores.activeMatchesSnapshot.state.find(e=>e.routeId===o))==null?void 0:p.id,c=bn(e,a);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&d)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(a),r=n._nonReactive.error||n.error;r&&X(e,n,r),n.status===`pending`&&await i(c,t,s,n,l)}else{let n=c&&!e.router.stores.activeMatchStoresById.has(a),r=e.router.getMatch(a);r._nonReactive.loaderPromise=tt(),n!==r.preload&&e.updateMatch(a,e=>({...e,preload:n})),await i(c,t,s,r,l)}}let m=e.router.getMatch(a);if(!c){var h,g;(h=m._nonReactive.loaderPromise)==null||h.resolve(),(g=m._nonReactive.loadPromise)==null||g.resolve(),m._nonReactive.loadPromise=void 0}clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,c||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;let _=c?m.isFetching:!1;return _!==m.isFetching||m.invalid!==!1?(e.updateMatch(a,e=>({...e,isFetching:_,invalid:!1})),e.router.getMatch(a)):m};async function Pn(e){var t,n;let r=e,i=[];yn(r.router)&&vn(r);let a;for(let e=0;e<r.matches.length;e++){try{let t=kn(r,e);rt(t)&&await t}catch(e){if(Y(e))throw e;if(J(e))a=e;else if(!r.preload)throw e;break}if(r.serialError||r.firstBadMatchIndex!=null)break}let o=(t=r.firstBadMatchIndex)==null?r.matches.length:t,s=a&&!r.preload?Sn(r,a):void 0,c=a&&r.preload?0:s===void 0?o:Math.min(s+1,o),l,u;for(let e=0;e<c;e++)i.push(Nn(r,i,e));try{await Promise.all(i)}catch{let e=await Promise.allSettled(i);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(Y(e))throw e;J(e)?l!=null||(l=e):u!=null||(u=e)}if(u!==void 0)throw u}let d=(n=l)==null?a&&!r.preload?a:void 0:n,f=r.firstBadMatchIndex===void 0?r.matches.length-1:r.firstBadMatchIndex;if(!d&&a&&r.preload)return r.matches;if(d){var p;let e=Sn(r,d);e===void 0&&W();let t=r.matches[e],n=r.router.looseRoutesById[t.routeId],i=(p=r.router.options)==null?void 0:p.defaultNotFoundComponent;!n.options.notFoundComponent&&i&&(n.options.notFoundComponent=i),d.routeId=t.routeId;let a=t.routeId===r.router.routeTree.id;r.updateMatch(t.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:d},isFetching:!1})),f=e,await In(n,[`notFoundComponent`])}else if(!r.preload){let e=r.matches[0];if(!e.globalNotFound){var m;(m=r.router.getMatch(e.id))!=null&&m.globalNotFound&&r.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}}if(r.serialError&&r.firstBadMatchIndex!==void 0){let e=r.router.looseRoutesById[r.matches[r.firstBadMatchIndex].routeId];await In(e,[`errorComponent`])}for(let e=0;e<=f;e++){let{id:t,routeId:n}=r.matches[e],i=r.router.looseRoutesById[n];try{let e=An(r,t,i);if(e){let n=await e;r.updateMatch(t,e=>({...e,...n}))}}catch(e){console.error(`Error executing head for route ${n}:`,e)}}let h=vn(r);if(rt(h)&&await h,d)throw d;if(r.serialError&&!r.preload&&!r.onReady)throw r.serialError;return r.matches}function Fn(e,t){let n=t.map(t=>{var n,r;return(n=e.options[t])==null||(r=n.preload)==null?void 0:r.call(n)}).filter(Boolean);if(n.length!==0)return Promise.all(n)}function In(e,t=Rn){!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===Rn?(()=>{if(e._componentsPromise===void 0){let t=Fn(e,Rn);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Fn(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Ln(e){var t;for(let n of Rn)if((t=e.options[n])!=null&&t.preload)return!0;return!1}var Rn=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],Z=`__TSR_index`,zn=`popstate`,Bn=`beforeunload`;function Vn(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{var i;(i=e.notifyOnIndexChange)==null||i?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{var a,o,s;if((a=r==null?void 0:r.ignoreBlocker)!=null&&a){n();return}let c=(o=(s=e.getBlockers)==null?void 0:s.call(e))==null?[]:o,l=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&c.length&&l)for(let n of c){let r=Kn(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){var u;(u=e.onBlocked)==null||u.call(e);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[Z];i=Hn(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[Z];i=Hn(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:()=>{var n;e.back((n=t==null?void 0:t.ignoreBlocker)==null?!1:n),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{var n;e.forward((n=t==null?void 0:t.ignoreBlocker)==null?!1:n),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Z]!==0,createHref:t=>e.createHref(t),block:t=>{var n,r;if(!e.setBlockers)return()=>{};let i=(n=(r=e.getBlockers)==null?void 0:r.call(e))==null?[]:n;return e.setBlockers([...i,t]),()=>{var n,r,i;let a=(n=(r=e.getBlockers)==null?void 0:r.call(e))==null?[]:n;(i=e.setBlockers)==null||i.call(e,a.filter(e=>e!==t))}},flush:()=>{var t;return(t=e.flush)==null?void 0:t.call(e)},destroy:()=>{var t;return(t=e.destroy)==null?void 0:t.call(e)},notify:r}}function Hn(e,t){t||(t={});let n=qn();return{...t,key:n,__TSR_key:n,[Z]:e}}function Un(e){var t,n,r,i,a;let o=(t=e==null?void 0:e.window)==null?typeof document<`u`?window:void 0:t,s=o.history.pushState,c=o.history.replaceState,l=[],u=()=>l,d=e=>l=e,f=(n=e==null?void 0:e.createHref)==null?(e=>e):n,p=(r=e==null?void 0:e.parseLocation)==null?(()=>Kn(`${o.location.pathname}${o.location.search}${o.location.hash}`,o.history.state)):r;if(!((i=o.history.state)!=null&&i.__TSR_key)&&!((a=o.history.state)!=null&&a.key)){let e=qn();o.history.replaceState({[Z]:0,key:e,__TSR_key:e},``)}let m=p(),h,g=!1,_=!1,v=!1,y=!1,b=()=>m,x,S,C=()=>{x&&(O._ignoreSubscribers=!0,(x.isPush?o.history.pushState:o.history.replaceState)(x.state,``,x.href),O._ignoreSubscribers=!1,x=void 0,S=void 0,h=void 0)},w=(e,t,n)=>{let r=f(t);S||(h=m),m=Kn(t,n),x={href:r,state:n,isPush:(x==null?void 0:x.isPush)||e===`push`},S||(S=Promise.resolve().then(()=>C()))},T=e=>{m=p(),O.notify({type:e})},E=async()=>{if(_){_=!1;return}let e=p(),t=e.state[Z]-m.state[Z],n=t===1,r=t===-1,i=!n&&!r||g;g=!1;let a=i?`GO`:r?`BACK`:`FORWARD`,s=i?{type:`GO`,index:t}:{type:r?`BACK`:`FORWARD`};if(v)v=!1;else{let t=u();if(typeof document<`u`&&t.length){for(let n of t)if(await n.blockerFn({currentLocation:m,nextLocation:e,action:a})){_=!0,o.history.go(1),O.notify(s);return}}}m=p(),O.notify(s)},D=e=>{if(y){y=!1;return}let t=!1,n=u();if(typeof document<`u`&&n.length)for(let e of n){var r;let n=(r=e.enableBeforeUnload)==null?!0:r;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},O=Vn({getLocation:b,getLength:()=>o.history.length,pushState:(e,t)=>w(`push`,e,t),replaceState:(e,t)=>w(`replace`,e,t),back:e=>(e&&(v=!0),y=!0,o.history.back()),forward:e=>{e&&(v=!0),y=!0,o.history.forward()},go:e=>{g=!0,o.history.go(e)},createHref:e=>f(e),flush:C,destroy:()=>{o.history.pushState=s,o.history.replaceState=c,o.removeEventListener(Bn,D,{capture:!0}),o.removeEventListener(zn,E)},onBlocked:()=>{h&&m!==h&&(m=h)},getBlockers:u,setBlockers:d,notifyOnIndexChange:!1});return o.addEventListener(Bn,D,{capture:!0}),o.addEventListener(zn,E),o.history.pushState=function(...e){let t=s.apply(o.history,e);return O._ignoreSubscribers||T(`PUSH`),t},o.history.replaceState=function(...e){let t=c.apply(o.history,e);return O._ignoreSubscribers||T(`REPLACE`),t},O}function Wn(e){var t;let n=(t=e==null?void 0:e.window)==null?typeof document<`u`?window:void 0:t;return Un({window:n,parseLocation:()=>{var e;let t=n.location.hash.split(`#`).slice(1),r=(e=t[0])==null?`/`:e,i=n.location.search,a=t.slice(1);return Kn(`${r}${i}${a.length===0?``:`#${a.join(`#`)}`}`,n.history.state)},createHref:e=>`${n.location.pathname}${n.location.search}#${e}`})}function Gn(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Kn(e,t){let n=Gn(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=qn();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||{[Z]:0,key:a,__TSR_key:a}}}function qn(){return(Math.random()+1).toString(36).substring(7)}function Jn(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:(n==null?void 0:n.pathname)!==r.pathname,hrefChanged:(n==null?void 0:n.href)!==r.href,hashChanged:(n==null?void 0:n.hash)!==r.hash}}var Yn=class{constructor(e,t){var n,r,i,a,o;this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{var t,n,r,i,a,o;let s=this.options,c=(t=(n=this.basepath)==null?s==null?void 0:s.basepath:n)==null?`/`:t,l=this.basepath===void 0,u=s==null?void 0:s.rewrite;if(this.options={...s,...e},this.isServer=(r=this.options.isServer)==null?typeof document>`u`:r,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=zt(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Un()),this.origin=this.options.origin,this.origin||((i=window)!=null&&i.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=dt(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=hn(Qn(this.latestLocation),e),Qt(this)}let d=!1,f=(a=this.options.basepath)==null?`/`:a,p=this.options.rewrite;if(l||c!==f||u!==p){this.basepath=f;let e=[],t=Ft(f);t&&t!==`/`&&e.push(un({basepath:f})),p&&e.push(p),this.rewrite=e.length===0?void 0:e.length===1?e[0]:ln(e),this.history&&this.updateLatestLocation(),d=!0}d&&this.stores&&this.stores.location.setState(()=>this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof((o=window.CSS)==null?void 0:o.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=Ct(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&vt(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:ct(e).path,external:!1,searchStr:o,search:Xe(t==null?void 0:t.search,i),hash:ct(r.slice(1)).path,state:H(t==null?void 0:t.state,a)}}let o=new URL(i,this.origin),s=dn(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:ct(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:Xe(t==null?void 0:t.search,c),hash:ct(s.hash.slice(1)).path,state:H(t==null?void 0: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)=>Rt({base:e,to:Mt(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=>er({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.pendingMatchesId.state.forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.state.forEach(e=>{var t;if(this.stores.pendingMatchStoresById.has(e))return;let n=(t=this.stores.activeMatchStoresById.get(e))==null?void 0:t.state;n&&(n.status===`pending`||n.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{var n,r,i;let a=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,o=this.matchRoutesLightweight(a);t.from;let s=t.unsafeRelative===`path`?a.pathname:(n=t.from)==null?o.fullPath:n,c=this.resolvePathWithBase(s,`.`),l=o.search,u=Object.assign(Object.create(null),o.params),d=t.to?this.resolvePathWithBase(c,`${t.to}`):this.resolvePathWithBase(c,`.`),f=t.params===!1||t.params===null?Object.create(null):((r=t.params)==null?!0:r)===!0?u:Object.assign(u,V(t.params,u)),p=this.getMatchedRoutes(d),m=p.matchedRoutes;if((!p.foundRoute||p.foundRoute.path!==`/`&&p.routeParams[`**`])&&this.options.notFoundRoute&&(m=[...m,this.options.notFoundRoute]),Object.keys(f).length>0)for(let e of m){var h,g;let t=(h=(g=e.options.params)==null?void 0:g.stringify)==null?e.options.stringifyParams:h;if(t)try{Object.assign(f,t(f))}catch{}}let _=e.leaveParams?d:ct(Vt({path:d,params:f,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,v=l;if(e._includeValidateSearch&&(i=this.options.search)!=null&&i.strict){let e={};m.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,$n(t.options.validateSearch,{...e,...v}))}catch{}}),v=e}v=tr({search:v,dest:t,destRoutes:m,_includeValidateSearch:e._includeValidateSearch}),v=Xe(l,v);let y=this.options.stringifySearch(v),b=t.hash===!0?a.hash:t.hash?V(t.hash,a.hash):void 0,x=b?`#${b}`:``,S=t.state===!0?a.state:t.state?V(t.state,a.state):{};S=H(a.state,S);let C=`${_}${y}${x}`,w,T,E=!1;if(this.rewrite){let e=new URL(C,this.origin),t=fn(this.rewrite,e);w=e.href.replace(e.origin,``),t.origin===this.origin?T=t.pathname+t.search+t.hash:(T=t.href,E=!0)}else w=lt(C),T=w;return{publicHref:T,href:w,pathname:_,search:v,searchStr:y,state:S,hash:b==null?``:b,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=yt(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==null?!0:s)===!0?n:Object.assign(n,V(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})=>{var r;let i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=U(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=Pt(this.latestLocation.href)===Pt(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=tt(()=>{o==null||o.resolve(),o=void 0}),a&&i())this.load();else{var s;let{maskedLocation:r,hashScrollIntoView:i,...a}=n;if(r){var c,l;a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(c=(l=a.unmaskOnReload)==null?this.options.unmaskOnReload:l)!=null&&c&&(a.state.__tempKey=this.tempLocationKey)}a.state.__hashScrollIntoViewOptions=(s=i==null?this.options.defaultHashScrollIntoView:i)==null?!0:s,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=(r=n.resetScroll)==null?!0:r,this.history.subscribers.size||this.load(),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=Kn(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=dn(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){var o,s;let t=this.buildLocation({to:e,...i});n=(o=n)==null?t.publicHref:o,r=(s=r)==null?t.publicHref:s}let t=!a&&r?r:n;if(st(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){var c,l,u;let e=(c=(l=(u=this.history).getBlockers)==null?void 0:l.call(u))==null?[]:c;for(let t of e)if(t!=null&&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.cachedMatchesSnapshot.state.filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.setState(()=>`pending`),this.stores.statusCode.setState(()=>200),this.stores.isLoading.setState(()=>!0),this.stores.location.setState(()=>this.latestLocation),this.stores.setPendingMatches(e),this.stores.setCachedMatches(t)})},this.load=async e=>{var t;let n,r,i,a=(t=this.stores.resolvedLocation.state)==null?this.stores.location.state:t;for(i=new Promise(t=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.stores.resolvedLocation.state,r=Jn(t,n);this.stores.redirect.state||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await Pn({router:this,sync:e==null?void 0:e.sync,forceStaleReload:a.href===t.href,matches:this.stores.pendingMatchesSnapshot.state,location:t,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.pendingMatchesSnapshot.state,a=i.length,o=this.stores.activeMatchesSnapshot.state;e=a?o.filter(e=>!this.stores.pendingMatchStoresById.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStoresById.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.activeMatchStoresById.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.setState(()=>!1),this.stores.loadedAt.setState(()=>Date.now()),a&&(this.stores.setActiveMatches(i),this.stores.setPendingMatches([]),this.stores.setCachedMatches([...this.stores.cachedMatchesSnapshot.state,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,o]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]]){var i,a;if(e)for(let t of e)(i=(a=this.looseRoutesById[t.routeId].options)[o])==null||i.call(a,t)}})})}})}catch(e){Y(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):J(e)&&(r=e);let t=n?n.status:r?404:this.stores.activeMatchesSnapshot.state.some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.setState(()=>t),this.stores.redirect.setState(()=>n)})}if(this.latestLoadPromise===i){var o;(o=this.commitLocationPromise)==null||o.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0}t()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.activeMatchesSnapshot.state.some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.setState(()=>o)},this.startViewTransition=e=>{var t;let n=(t=this.shouldViewTransition)==null?this.options.defaultViewTransition:t;if(this.shouldViewTransition=void 0,n&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let t;if(typeof n==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.state,a=typeof n.types==`function`?n.types(Jn(r,i)):n.types;if(a===!1){e();return}t={update:e,types:a}}else t=e;document.startViewTransition(t)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStoresById.get(e);if(n){n.setState(t);return}let r=this.stores.activeMatchStoresById.get(e);if(r){r.setState(t);return}let i=this.stores.cachedMatchStoresById.get(e);if(i){let n=t(i.state);n.status===`redirected`?this.stores.cachedMatchStoresById.delete(e)&&this.stores.cachedMatchesId.setState(t=>t.filter(t=>t!==e)):i.setState(()=>n)}})},this.getMatch=e=>{var t,n,r,i,a;return(t=(n=(r=this.stores.cachedMatchStoresById.get(e))==null?void 0:r.state)==null?(i=this.stores.pendingMatchStoresById.get(e))==null?void 0:i.state:n)==null?(a=this.stores.activeMatchStoresById.get(e))==null?void 0:a.state:t},this.invalidate=e=>{let t=t=>{var n,r;return(n=e==null||(r=e.filter)==null?void 0:r.call(e,t))==null||n?{...t,invalid:!0,...e!=null&&e.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t};return this.batch(()=>{this.stores.setActiveMatches(this.stores.activeMatchesSnapshot.state.map(t)),this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.map(t)),this.stores.setPendingMatches(this.stores.pendingMatchesSnapshot.state.map(t))}),this.shouldViewTransition=!1,this.load({sync:e==null?void 0:e.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){var n;let t=(n=e.options._builtLocation)==null?this.buildLocation(e.options):n,r=this.getParsedLocationHref(t);e.options.href=r,e.headers.set(`Location`,r)}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&&st(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==null?void 0:e.filter;t===void 0?this.stores.setCachedMatches([]):this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{var n,r,i;let a=this.looseRoutesById[t.routeId];if(!a.options.loader)return!0;let o=(n=t.preload?(r=a.options.preloadGcTime)==null?this.options.defaultPreloadGcTime:r:(i=a.options.gcTime)==null?this.options.defaultGcTime:i)==null?300*1e3:n;return t.status===`error`?!0:e-t.updatedAt>=o}})},this.loadRouteChunk=In,this.preloadRoute=async e=>{var t;let n=(t=e._builtLocation)==null?this.buildLocation(e):t,r=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:e}),i=new Set([...this.stores.matchesId.state,...this.stores.pendingMatchesId.state]),a=new Set([...i,...this.stores.cachedMatchesId.state]),o=r.filter(e=>!a.has(e.id));if(o.length){let e=this.stores.cachedMatchesSnapshot.state;this.stores.setCachedMatches([...e,...o])}try{return r=await Pn({router:this,matches:r,location:n,preload:!0,updateMatch:(e,t)=>{i.has(e)?r=r.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),r}catch(e){if(Y(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:n});J(e)||console.error(e);return}},this.matchRoute=(e,t)=>{var n,r,i;let a={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},o=this.buildLocation(a);if(t!=null&&t.pending&&this.stores.status.state!==`pending`)return!1;let s=((t==null?void 0:t.pending)===void 0?!this.stores.isLoading.state:t.pending)?this.latestLocation:this.stores.resolvedLocation.state||this.stores.location.state,c=bt(o.pathname,(n=t==null?void 0:t.caseSensitive)==null?!1:n,(r=t==null?void 0:t.fuzzy)==null?!1:r,s.pathname,this.processedTree);return!c||e.params&&!U(c.rawParams,e.params,{partial:!0})?!1:(i=t==null?void 0:t.includeSearch)==null||i?U(s.search,o.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.stores.activeMatchesSnapshot.state.some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:(n=e.caseSensitive)==null?!1:n,notFoundMode:(r=e.notFoundMode)==null?`fuzzy`:r,stringifySearch:(i=e.stringifySearch)==null?rn:i,parseSearch:(a=e.parseSearch)==null?nn:a,protocolAllowlist:(o=e.protocolAllowlist)==null?ot:o}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.state}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)}get looseRoutesById(){return this.routesById}getParentContext(e){var t,n,r;return e!=null&&e.id?(n=(r=e.context)==null?this.options.context:r)==null?void 0:n:(t=this.options.context)==null?void 0:t}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:Pt(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?rr(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map;for(let e of this.stores.activeMatchStoresById.values())e.routeId&&u.set(e.routeId,e.state);for(let n=0;n<o.length;n++){var d,f,p,m,h;let r=o[n],s=l[n-1],b,x,S;{var g,_;let n=(g=s==null?void 0:s.search)==null?e.search:g,i=(_=s==null?void 0:s._strictSearch)==null?void 0:_;try{var v;let e=(v=$n(r.options.validateSearch,{...n}))==null?void 0:v;b={...n,...e},x={...i,...e},S=void 0}catch(e){let r=e;if(e instanceof Xn||(r=new Xn(e.message,{cause:e})),t!=null&&t.throwOnError)throw r;b=n,x={},S=r}}let C=(d=(f=(p=r.options).loaderDeps)==null?void 0:f.call(p,{search:b}))==null?``:d,w=C?JSON.stringify(C):``,{interpolatedPath:T,usedParams:E}=Vt({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),D=r.id+T+w,O=this.getMatch(D),k=u.get(r.id),A=(m=O==null?void 0:O._strictParams)==null?E:m,j;if(!O)try{ir(r,E,a,A)}catch(e){if(j=J(e)||Y(e)?e:new Zn(e.message,{cause:e}),t!=null&&t.throwOnError)throw j}Object.assign(i,A);let M=k?`stay`:`enter`,N;if(O)N={...O,cause:M,params:(h=k==null?void 0:k.params)==null?i:h,_strictParams:A,search:Xe(k?k.search:O.search,b),_strictSearch:x};else{var y;let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Ln(r)?`pending`:`success`;N={id:D,ssr:r.options.ssr,index:n,routeId:r.id,params:(y=k==null?void 0:k.params)==null?i:y,_strictParams:A,pathname:T,updatedAt:Date.now(),search:k?Xe(k.search,b):b,_strictSearch:x,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:j,__routeContext:void 0,_nonReactive:{loadPromise:tt()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:M,loaderDeps:k?H(k.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t!=null&&t.preload||(N.globalNotFound=c===r.id),N.searchError=S;let ee=this.getParentContext(s);N.context={...ee,...N.__routeContext,...N.__beforeLoadContext},l[n]=N}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?Xe(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){var b;let t={deps:n.loaderDeps,params:n.params,context:a==null?{}: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=(b=r.options.context(t))==null?void 0:b}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){var t;let{matchedRoutes:n,routeParams:r,parsedParams:i}=this.getMatchedRoutes(e.pathname),a=Ge(n),o={...e.search};for(let e of n)try{Object.assign(o,$n(e.options.validateSearch,o))}catch{}let s=Ge(this.stores.matchesId.state),c=s&&((t=this.stores.activeMatchStoresById.get(s))==null?void 0:t.state),l=c&&c.routeId===a.id&&c.pathname===e.pathname,u;if(l)u=c.params;else{let e=Object.assign(Object.create(null),r);for(let t of n)try{ir(t,r,i==null?{}:i,e)}catch{}u=e}return{matchedRoutes:n,fullPath:a.fullPath,search:o,params:u}}},Xn=class extends Error{},Zn=class extends Error{};function Qn(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function $n(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Xn(`Async validation not supported`);if(n.issues)throw new Xn(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 er({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=Pt(e),a,o,s=xt(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign(Object.create(null),s.parsedParams)),{matchedRoutes:(s==null?void 0:s.branch)||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function tr({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return nr(n)(e,t,r==null?!1:r)}function nr(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let r of e){if(`search`in r.options){var n;(n=r.options.search)!=null&&n.middlewares&&t.middlewares.push(...r.options.search.middlewares)}else (r.options.preSearchFilters||r.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let n=e;`preSearchFilters`in r.options&&r.options.preSearchFilters&&(n=r.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(n);return`postSearchFilters`in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((e,t)=>t(e),i):i});r.options.validateSearch&&t.middlewares.push(({search:e,next:n})=>{let i=n(e);if(!t._includeValidateSearch)return i;try{var a;return{...i,...(a=$n(r.options.validateSearch,i))==null?void 0:a}}catch{return i}})}t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:V(n.search,e):{}});let r=(e,t,n)=>{if(e>=n.length)return t;let i=n[e];return i({search:t,next:t=>r(e+1,t,n)})};return function(e,n,i){return t.dest=n,t._includeValidateSearch=i,r(0,e,t.middlewares)}}function rr(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 sn}function ir(e,t,n,r){var i,a;let o=(i=(a=e.options.params)==null?void 0:a.parse)==null?e.options.parseParams:i;if(o)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=o(r);Object.assign(r,e)}}function ar(e){var t;let n=(t=e.errorComponent)==null?sr:t;return(0,B.jsx)(or,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:t,reset:r})=>t?z.createElement(n,{error:t,reset:r}):e.children})}var or=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 sr({error:e}){let[t,n]=z.useState(!1);return(0,B.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,B.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,B.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,B.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,B.jsx)(`div`,{children:(0,B.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,B.jsx)(`code`,{children:e.message}):null})}):null]})}function cr({children:e,fallback:t=null}){return lr()?(0,B.jsx)(z.Fragment,{children:e}):(0,B.jsx)(z.Fragment,{children:t})}function lr(){return z.useSyncExternalStore(ur,()=>!0,()=>!1)}function ur(){return()=>{}}var dr=z.createContext(void 0),fr=z.createContext(void 0),pr=e((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),mr=e(((e,t)=>{t.exports=pr()})),hr=e((e=>{var t=r(),n=mr();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),gr=e(((e,t)=>{t.exports=hr()}))();function _r(e,t){return e===t}function Q(e,t,n=_r){let r=(0,z.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,z.useCallback)(()=>e==null?void 0:e.get(),[e]);return(0,gr.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var vr={state:void 0,get:()=>void 0,subscribe:()=>()=>{}};function yr(e){var t;let n=u(),r=z.useContext(e.from?fr:dr),i=(t=e.from)==null?r:t,a=i?e.from?n.stores.getMatchStoreByRouteId(i):n.stores.activeMatchStoresById.get(i):void 0,o=z.useRef(void 0);return Q(a==null?vr:a,t=>{var r,i;if(((r=e.shouldThrow)==null||r)&&!t&&W(),t===void 0)return;let a=e.select?e.select(t):t;if((i=e.structuralSharing)==null?n.options.defaultStructuralSharing:i){let e=H(o.current,a);return o.current=e,e}return a})}function br(e){return yr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function xr(e){let t=u(),n=`not-found-${Q(t.stores.location,e=>e.pathname)}-${Q(t.stores.status,e=>e)}`;return(0,B.jsx)(ar,{getResetKey:()=>n,onCatch:(t,n)=>{var r;if(J(t))(r=e.onCatch)==null||r.call(e,t,n);else throw t},errorComponent:({error:t})=>{var n;if(J(t))return(n=e.fallback)==null?void 0:n.call(e,t);throw t},children:e.children})}function Sr(){return(0,B.jsx)(`p`,{children:`Not Found`})}function Cr(e){return(0,B.jsx)(B.Fragment,{children:e.children})}function wr(e,t,n){return t.options.notFoundComponent?(0,B.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,B.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,B.jsx)(Sr,{})}var Tr=z.memo(function({matchId:e}){let t=u(),n=t.stores.activeMatchStoresById.get(e);n||W();let r=Q(t.stores.loadedAt,e=>e),i=Q(n,e=>e);return(0,B.jsx)(Er,{router:t,matchId:e,resetKey:r,matchState:z.useMemo(()=>{var e;let n=i.routeId,r=(e=t.routesById[n].parentRoute)==null?void 0:e.id;return{routeId:n,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:r}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function Er({router:e,matchId:t,resetKey:n,matchState:r}){var i,a,o,s,c,l,u,d,f;let p=e.routesById[r.routeId],m=(i=p.options.pendingComponent)==null?e.options.defaultPendingComponent:i,h=m?(0,B.jsx)(m,{}):null,g=(a=p.options.errorComponent)==null?e.options.defaultErrorComponent:a,_=(o=p.options.onCatch)==null?e.options.defaultOnCatch:o,v=p.isRoot?(s=p.options.notFoundComponent)==null?(c=e.options.notFoundRoute)==null?void 0:c.options.component:s:p.options.notFoundComponent,y=r.ssr===!1||r.ssr===`data-only`,b=(!p.isRoot||p.options.wrapInSuspense||y)&&((l=(u=p.options.wrapInSuspense)==null?m:u)==null?(d=p.options.errorComponent)!=null&&d.preload||y:l)?z.Suspense:Cr,x=g?ar:Cr,S=v?xr:Cr;return(0,B.jsxs)(p.isRoot?(f=p.options.shellComponent)==null?Cr:f:Cr,{children:[(0,B.jsx)(dr.Provider,{value:t,children:(0,B.jsx)(b,{fallback:h,children:(0,B.jsx)(x,{getResetKey:()=>n,errorComponent:g||sr,onCatch:(e,t)=>{if(J(e))throw e.routeId!=null||(e.routeId=r.routeId),e;_==null||_(e,t)},children:(0,B.jsx)(S,{fallback:e=>{if(e.routeId!=null||(e.routeId=r.routeId),!v||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!p.isRoot)throw e;return z.createElement(v,e)},children:y||r._displayPending?(0,B.jsx)(cr,{fallback:h,children:(0,B.jsx)(Or,{matchId:t})}):(0,B.jsx)(Or,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Dr,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function Dr({resetKey:e}){let t=u(),n=z.useRef(void 0);return l(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...Jn(t.stores.location.state,t.stores.resolvedLocation.state)}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var Or=z.memo(function({matchId:e}){let t=u(),n=(e,n)=>{var r,i;return(r=(i=t.getMatch(e.id))==null?void 0:i._nonReactive[n])==null?e._nonReactive[n]:r},r=t.stores.activeMatchStoresById.get(e);r||W();let i=Q(r,e=>e),a=i.routeId,o=t.routesById[a],s=z.useMemo(()=>{var e,n;let r=(e=(n=t.routesById[a].options.remountDeps)==null?t.options.defaultRemountDeps:n)==null?void 0:e({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return r?JSON.stringify(r):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=z.useMemo(()=>{var e;let n=(e=o.options.component)==null?t.options.defaultComponent:e;return n?(0,B.jsx)(n,{},s):(0,B.jsx)(kr,{})},[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`){var l;let e=(l=o.options.pendingMinMs)==null?t.options.defaultPendingMinMs:l;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=tt();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return J(i.error)||W(),wr(t,o,i.error);if(i.status===`redirected`)throw Y(i.error)||W(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),kr=z.memo(function(){let e=u(),t=z.useContext(dr),n,r=!1,i;{let a=t?e.stores.activeMatchStoresById.get(t):void 0;[n,r]=Q(a,e=>{var t;return[e==null?void 0:e.routeId,(t=e==null?void 0:e.globalNotFound)==null?!1:t]}),i=Q(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,B.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||W(),wr(e,a,void 0);if(!i)return null;let s=(0,B.jsx)(Tr,{matchId:i});return n===`__root__`?(0,B.jsx)(z.Suspense,{fallback:o,children:s}):s}),$=null;function Ar(){return $||(typeof window>`u`?($=`unknown`,$):window.__JEAN2_ELECTRON__?($=`electron`,$):`__TAURI_INTERNALS__`in window||`__TAURI__`in window?($=`tauri-mobile`,$):($=`web`,$))}function jr(){return Ar()===`electron`}function Mr(){return Ar()===`tauri-mobile`}function Nr(){return typeof navigator>`u`?!1:/Win/i.test(navigator.platform||navigator.userAgent)}export{D as $,st as A,be as B,jt as C,W as D,Pt as E,Le as F,j as G,me as H,ze as I,k as J,A as K,Ae as L,H as M,We as N,U as O,Ue as P,oe as Q,Ee as R,Lt as S,Nt as T,pe as U,_e as V,C as W,S as X,O as Y,M as Z,Wn as _,Tr as a,y as at,cn as b,br as c,dr as d,E as et,lr as f,Jn as g,Yn as h,Nr as i,T as it,nt as j,V as k,yr as l,sr as m,jr as n,de as nt,kr as o,h as ot,ar as p,w as q,Mr as r,le as rt,Cr as s,d as st,Ar as t,te as tt,Q as u,pn as v,It as w,sn as x,mn as y,we as z};
@@ -1 +0,0 @@
1
- import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{F as i,I as a,J as o,L as s,R as c,z as l}from"./badge-Cjebg6Sp.js";import{t as u}from"./createLucideIcon-CuVT3KNW.js";import{A as d,C as f,O as p,T as m,_ as ee,b as h,c as g,f as _,g as v,h as te,j as y,l as b,m as x,n as S,o as C,p as ne,r as w,u as T,w as E,x as D,y as O}from"./button--1wnt03c.js";import"./dialog-BNCh4KEM.js";var k=u(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),A=u(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),j=t(n(),1),M=e(),N=`Popover`,[P,re]=E(N,[l]),F=l(),[I,L]=P(N),ie=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=F(t),l=j.useRef(null),[u,d]=j.useState(!1),[f,p]=D({prop:r,defaultProp:i==null?!1:i,onChange:a,caller:N});return(0,M.jsx)(c,{...s,children:(0,M.jsx)(I,{scope:t,contentId:O(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:j.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:j.useCallback(()=>d(!0),[]),onCustomAnchorRemove:j.useCallback(()=>d(!1),[]),modal:o,children:n})})};ie.displayName=N;var ae=`PopoverAnchor`,oe=j.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,a=L(ae,n),o=F(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:c}=a;return j.useEffect(()=>(s(),()=>c()),[s,c]),(0,M.jsx)(i,{...o,...r,ref:t})});oe.displayName=ae;var se=`PopoverTrigger`,ce=j.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,a=L(se,n),o=F(n),s=y(t,a.triggerRef),c=(0,M.jsx)(m.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.contentId,"data-state":xe(a.open),...r,ref:s,onClick:f(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:(0,M.jsx)(i,{asChild:!0,...o,children:c})});ce.displayName=se;var R=`PopoverPortal`,[le,ue]=P(R,{forceMount:void 0}),de=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=L(R,t);return(0,M.jsx)(le,{scope:t,forceMount:n,children:(0,M.jsx)(h,{present:n||a.open,children:(0,M.jsx)(te,{asChild:!0,container:i,children:r})})})};de.displayName=R;var z=`PopoverContent`,fe=j.forwardRef((e,t)=>{let n=ue(z,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=L(z,e.__scopePopover);return(0,M.jsx)(h,{present:r||a.open,children:a.modal?(0,M.jsx)(me,{...i,ref:t}):(0,M.jsx)(he,{...i,ref:t})})});fe.displayName=z;var pe=p(`PopoverContent.RemoveScroll`),me=j.forwardRef((e,t)=>{let n=L(z,e.__scopePopover),r=j.useRef(null),i=y(t,r),a=j.useRef(!1);return j.useEffect(()=>{let e=r.current;if(e)return _(e)},[]),(0,M.jsx)(ne,{as:pe,allowPinchZoom:!0,children:(0,M.jsx)(ge,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:f(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),a.current||(t=n.triggerRef.current)==null||t.focus()}),onPointerDownOutside:f(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:f(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),he=j.forwardRef((e,t)=>{let n=L(z,e.__scopePopover),r=j.useRef(!1),i=j.useRef(!1);return(0,M.jsx)(ge,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var a;if((a=e.onCloseAutoFocus)==null||a.call(e,t),!t.defaultPrevented){var o;r.current||(o=n.triggerRef.current)==null||o.focus(),t.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:t=>{var a,o;(a=e.onInteractOutside)==null||a.call(e,t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let s=t.target;(o=n.triggerRef.current)!=null&&o.contains(s)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),ge=j.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=L(z,n),m=F(n);return x(),(0,M.jsx)(v,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,M.jsx)(ee,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:(0,M.jsx)(s,{"data-state":xe(p.open),role:`dialog`,id:p.contentId,...m,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),_e=`PopoverClose`,ve=j.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=L(_e,n);return(0,M.jsx)(m.button,{type:`button`,...r,ref:t,onClick:f(e.onClick,()=>i.onOpenChange(!1))})});ve.displayName=_e;var ye=`PopoverArrow`,be=j.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=F(n);return(0,M.jsx)(a,{...i,...r,ref:t})});be.displayName=ye;function xe(e){return e?`open`:`closed`}var Se=ie,Ce=oe,we=ce,Te=de,Ee=fe,B=r(),De=1,Oe=.9,ke=.8,Ae=.17,V=.1,H=.999,je=.9999,Me=.99,Ne=/[\\\/_+.#"@\[\(\{&]/,Pe=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,Ie=/[\s-]/g;function U(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?De:Me;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=U(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=De:Ne.test(e.charAt(l-1))?(d*=ke,p=e.slice(i,l-1).match(Pe),p&&i>0&&(d*=H**+p.length)):Fe.test(e.charAt(l-1))?(d*=Oe,m=e.slice(i,l-1).match(Ie),m&&i>0&&(d*=H**+m.length)):(d*=Ae,i>0&&(d*=H**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=je)),(d<V&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=U(e,t,n,r,l+1,a+2,o),f*V>d&&(d=f*V)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Le(e){return e.toLowerCase().replace(Ie,` `)}function Re(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,U(e,t,Le(e),Le(t),0,0,{})}var W=`[cmdk-group=""]`,G=`[cmdk-group-items=""]`,ze=`[cmdk-group-heading=""]`,Be=`[cmdk-item=""]`,Ve=`${Be}:not([aria-disabled="true"])`,K=`cmdk-item-select`,q=`data-value`,He=(e,t,n)=>Re(e,t,n),Ue=j.createContext(void 0),J=()=>j.useContext(Ue),We=j.createContext(void 0),Ge=()=>j.useContext(We),Ke=j.createContext(void 0),qe=j.forwardRef((e,t)=>{let n=Z(()=>{var t,n;return{search:``,value:(n=(t=e.value)==null?e.defaultValue:t)==null?``:n,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Z(()=>new Set),i=Z(()=>new Map),a=Z(()=>new Map),o=Z(()=>new Set),s=it(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:ee,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=O(),te=O(),y=O(),b=j.useRef(null),x=ot();X(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,S.emit()}},[u]),X(()=>{x(6,D)},[]);let S=j.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o,c;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)E(),w(),x(1,T);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(y);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(x(7,()=>{var e;n.current.selectedItemId=(e=k())==null?void 0:e.id,S.emit()}),r||x(5,D),((a=s.current)==null?void 0:a.value)!==void 0){let e=t==null?``:t;(c=(o=s.current).onValueChange)==null||c.call(o,e);return}}S.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),C=j.useMemo(()=>({value:(e,t,r)=>{var i;t!==((i=a.current.get(e))==null?void 0:i.value)&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,ne(t,r)),x(2,()=>{w(),S.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),x(3,()=>{E(),w(),n.current.value||T(),S.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=k();x(4,()=>{E(),(t==null?void 0:t.getAttribute(`id`))===e&&T(),S.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:y,labelId:te,listInnerRef:b}),[]);function ne(e,t){var r,i;let a=(i=(r=s.current)==null?void 0:r.filter)==null?He:i;return e?a(e,n.current.search,t):0}function w(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=b.current;A().sort((t,n)=>{var r,i;let a=t.getAttribute(`id`),o=n.getAttribute(`id`);return((r=e.get(o))==null?0:r)-((i=e.get(a))==null?0:i)}).forEach(e=>{let t=e.closest(G);t?t.appendChild(e.parentElement===t?e:e.closest(`${G} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${G} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=(t=b.current)==null?void 0:t.querySelector(`${W}[${q}="${encodeURIComponent(e[0])}"]`);n==null||n.parentElement.appendChild(n)})}function T(){let e=A().find(e=>e.getAttribute(`aria-disabled`)!==`true`),t=e==null?void 0:e.getAttribute(q);S.setState(`value`,t||void 0)}function E(){var e,t,o,c;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let l=0;for(let i of r.current){let r=ne((t=(e=a.current.get(i))==null?void 0:e.value)==null?``:t,(c=(o=a.current.get(i))==null?void 0:o.keywords)==null?[]:c);n.current.filtered.items.set(i,r),r>0&&l++}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=l}function D(){var e,t,n;let r=k();r&&(((e=r.parentElement)==null?void 0:e.firstChild)===r&&((n=(t=r.closest(W))==null?void 0:t.querySelector(ze))==null||n.scrollIntoView({block:`nearest`})),r.scrollIntoView({block:`nearest`}))}function k(){var e;return(e=b.current)==null?void 0:e.querySelector(`${Be}[aria-selected="true"]`)}function A(){var e;return Array.from(((e=b.current)==null?void 0:e.querySelectorAll(Ve))||[])}function M(e){let t=A()[e];t&&S.setState(`value`,t.getAttribute(q))}function N(e){var t;let n=k(),r=A(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&S.setState(`value`,a.getAttribute(q))}function P(e){let t=k(),n=t==null?void 0:t.closest(W),r;for(;n&&!r;)n=e>0?nt(n,W):rt(n,W),r=n==null?void 0:n.querySelector(Ve);r?S.setState(`value`,r.getAttribute(q)):N(e)}let re=()=>M(A().length-1),F=e=>{e.preventDefault(),e.metaKey?re():e.altKey?P(1):N(1)},I=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?P(-1):N(-1)};return j.createElement(m.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&&F(e);break;case`ArrowDown`:F(e);break;case`p`:case`k`:g&&e.ctrlKey&&I(e);break;case`ArrowUp`:I(e);break;case`Home`:e.preventDefault(),M(0);break;case`End`:e.preventDefault(),re();break;case`Enter`:{e.preventDefault();let t=k();if(t){let e=new Event(K);t.dispatchEvent(e)}}}}},j.createElement(`label`,{"cmdk-label":``,htmlFor:C.inputId,id:C.labelId,style:ct},c),$(e,e=>j.createElement(We.Provider,{value:S},j.createElement(Ue.Provider,{value:C},e))))}),Je=j.forwardRef((e,t)=>{var n,r;let i=O(),a=j.useRef(null),o=j.useContext(Ke),s=J(),c=it(e),l=(r=(n=c.current)==null?void 0:n.forceMount)==null?o==null?void 0:o.forceMount:r;X(()=>{if(!l)return s.item(i,o==null?void 0:o.id)},[l]);let u=at(i,a,[e.value,e.children,a],e.keywords),f=Ge(),p=Q(e=>e.value&&e.value===u.current),ee=Q(e=>l||s.filter()===!1?!0:e.search?e.filtered.items.get(i)>0:!0);j.useEffect(()=>{let t=a.current;if(!(!t||e.disabled))return t.addEventListener(K,h),()=>t.removeEventListener(K,h)},[ee,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=c.current).onSelect)==null||t.call(e,u.current)}function g(){f.setState(`value`,u.current,!0)}if(!ee)return null;let{disabled:_,value:v,onSelect:te,forceMount:y,keywords:b,...x}=e;return j.createElement(m.div,{ref:d(a,t),...x,id:i,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||s.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),Ye=j.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=O(),s=j.useRef(null),c=j.useRef(null),l=O(),u=J(),f=Q(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);X(()=>u.group(o),[]),at(o,s,[e.value,e.heading,c]);let p=j.useMemo(()=>({id:o,forceMount:i}),[i]);return j.createElement(m.div,{ref:d(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:f?void 0:!0},n&&j.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),$(e,e=>j.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},j.createElement(Ke.Provider,{value:p},e))))}),Xe=j.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=j.useRef(null),a=Q(e=>!e.search);return!n&&!a?null:j.createElement(m.div,{ref:d(i,t),...r,"cmdk-separator":``,role:`separator`})}),Ze=j.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Ge(),o=Q(e=>e.search),s=Q(e=>e.selectedItemId),c=J();return j.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),j.createElement(m.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==null||n(e.target.value)}})}),Qe=j.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=j.useRef(null),o=j.useRef(null),s=Q(e=>e.selectedItemId),c=J();return j.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)}}},[]),j.createElement(m.div,{ref:d(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},$(e,e=>j.createElement(`div`,{ref:d(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),$e=j.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return j.createElement(T,{open:n,onOpenChange:r},j.createElement(b,{container:o},j.createElement(g,{"cmdk-overlay":``,className:i}),j.createElement(C,{"aria-label":e.label,"cmdk-dialog":``,className:a},j.createElement(qe,{ref:t,...s}))))}),et=j.forwardRef((e,t)=>Q(e=>e.filtered.count===0)?j.createElement(m.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),tt=j.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return j.createElement(m.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},$(e,e=>j.createElement(`div`,{"aria-hidden":!0},e)))}),Y=Object.assign(qe,{List:Qe,Item:Je,Input:Ze,Group:Ye,Separator:Xe,Dialog:$e,Empty:et,Loading:tt});function nt(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function rt(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function it(e){let t=j.useRef(e);return X(()=>{t.current=e}),t}var X=typeof window>`u`?j.useEffect:j.useLayoutEffect;function Z(e){let t=j.useRef();return t.current===void 0&&(t.current=e()),t}function Q(e){let t=Ge(),n=()=>e(t.snapshot());return j.useSyncExternalStore(t.subscribe,n,n)}function at(e,t,n,r=[]){let i=j.useRef(),a=J();return X(()=>{var o;let s=(()=>{var e;for(let t of n){if(typeof t==`string`)return t.trim();if(typeof t==`object`&&`current`in t)return t.current?(e=t.current.textContent)==null?void 0:e.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(q,s),i.current=s}),i}var ot=()=>{let[e,t]=j.useState(),n=Z(()=>new Map);return X(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function st(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function $({asChild:e,children:t},n){return e&&j.isValidElement(t)?j.cloneElement(st(t),{ref:t.ref},n(t.props.children)):n(t)}var ct={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function lt(e){let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=w(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`textarea`,{"data-slot":`textarea`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ut(e){let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=w(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 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 dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 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]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var dt=S(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function ft(e){let t=(0,B.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=w(dt({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,M.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":a,className:o,onClick:pt,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function pt(e){var t;e.target.closest(`button`)||(t=e.currentTarget.parentElement)==null||(t=t.querySelector(`input`))==null||t.focus()}S(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function mt(e){let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=w(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(Y,{"data-slot":`command`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ht(e){let t=(0,B.c)(11),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=w(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,n),t[3]=n,t[4]=i);let a;t[5]!==r||t[6]!==i?(a=(0,M.jsx)(Y.Input,{"data-slot":`command-input`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7];let o;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,M.jsx)(ft,{children:(0,M.jsx)(A,{className:`size-4 shrink-0 opacity-50`})}),t[8]=o):o=t[8];let s;return t[9]===a?s=t[10]:(s=(0,M.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,M.jsxs)(ut,{className:`h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[a,o]})}),t[9]=a,t[10]=s),s}function gt(e){let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=w(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(Y.List,{"data-slot":`command-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function _t(e){let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=w(`py-6 text-center text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(Y.Empty,{"data-slot":`command-empty`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function vt(e){let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=w(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(Y.Group,{"data-slot":`command-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function yt(e){let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=w(`-mx-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(Y.Separator,{"data-slot":`command-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function bt(e){let t=(0,B.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,showCheck:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=a===void 0?!0:a,c;t[5]===r?c=t[6]:(c=w(`group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`,r),t[5]=r,t[6]=c);let l;t[7]===s?l=t[8]:(l=s&&(0,M.jsx)(o,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`}),t[7]=s,t[8]=l);let u;return t[9]!==n||t[10]!==i||t[11]!==c||t[12]!==l?(u=(0,M.jsxs)(Y.Item,{"data-slot":`command-item`,className:c,...i,children:[n,l]}),t[9]=n,t[10]=i,t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function xt(e){let t=(0,B.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,M.jsx)(Se,{"data-slot":`popover`,...n}),t[2]=n,t[3]=r),r}function St(e){let t=(0,B.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,M.jsx)(we,{"data-slot":`popover-trigger`,...n}),t[2]=n,t[3]=r),r}function Ct(e){let t=(0,B.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,align:i,sideOffset:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`center`:i,s=a===void 0?4:a,c;t[5]===n?c=t[6]:(c=w(`z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[5]=n,t[6]=c);let l;return t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(l=(0,M.jsx)(Te,{children:(0,M.jsx)(Ee,{"data-slot":`popover-content`,align:o,sideOffset:s,className:c,...r})}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function wt(e){let t=(0,B.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,M.jsx)(Ce,{"data-slot":`popover-anchor`,...n}),t[2]=n,t[3]=r),r}export{mt as a,ht as c,yt as d,lt as f,St as i,bt as l,k as m,wt as n,_t as o,A as p,Ct as r,vt as s,xt as t,gt as u};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./compiler-runtime-DZXZ41-q.js";import{B as n,F as r,G as i,J as a,K as o,N as s,V as c,W as l,X as u,Y as d,Z as f,et as p,l as m,ot as h,rt as g,st as _}from"./platform-BOMKRNFM.js";import{i as v,n as y,t as b}from"./classPrivateFieldGet2-BGlEuFdn.js";import{t as x}from"./mutation-CAoDu7x3.js";var S,C,w,T=(S=new WeakMap,C=new WeakMap,w=new WeakMap,class extends _{constructor(e={}){super(),v(this,S,void 0),v(this,C,void 0),v(this,w,void 0),this.config=e,y(S,this,new Set),y(C,this,new Map),y(w,this,0)}build(e,t,n){var r;let i=new x({client:e,mutationCache:this,mutationId:y(w,this,(r=b(w,this),++r)),options:e.defaultMutationOptions(t),state:n});return this.add(i),i}add(e){b(S,this).add(e);let t=E(e);if(typeof t==`string`){let n=b(C,this).get(t);n?n.push(e):b(C,this).set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(b(S,this).delete(e)){let t=E(e);if(typeof t==`string`){let n=b(C,this).get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&b(C,this).delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=E(e);if(typeof t==`string`){let n=b(C,this).get(t),r=n==null?void 0:n.find(e=>e.state.status===`pending`);return!r||r===e}else return!0}runNext(e){let t=E(e);if(typeof t==`string`){var n,r;let i=(n=b(C,this).get(t))==null?void 0:n.find(t=>t!==e&&t.state.isPaused);return(r=i==null?void 0:i.continue())==null?Promise.resolve():r}else return Promise.resolve()}clear(){c.batch(()=>{b(S,this).forEach(e=>{this.notify({type:`removed`,mutation:e})}),b(S,this).clear(),b(C,this).clear()})}getAll(){return Array.from(b(S,this))}find(e){let t={exact:!0,...e};return this.getAll().find(e=>a(t,e))}findAll(e={}){return this.getAll().filter(t=>a(e,t))}notify(e){c.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return c.batch(()=>Promise.all(e.map(e=>e.continue().catch(u))))}});function E(e){var t;return(t=e.options.scope)==null?void 0:t.id}var D,O=(D=new WeakMap,class extends _{constructor(e={}){super(),v(this,D,void 0),this.config=e,y(D,this,new Map)}build(e,t,n){var i;let a=t.queryKey,s=(i=t.queryHash)==null?o(a,t):i,c=this.get(s);return c||(c=new r({client:e,queryKey:a,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(a)}),this.add(c)),c}add(e){b(D,this).has(e.queryHash)||(b(D,this).set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=b(D,this).get(e.queryHash);t&&(e.destroy(),t===e&&b(D,this).delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){c.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return b(D,this).get(e)}getAll(){return[...b(D,this).values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>d(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>d(e,t)):t}notify(e){c.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){c.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){c.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}}),k,A,j,M,N,P,F,I,L=(k=new WeakMap,A=new WeakMap,j=new WeakMap,M=new WeakMap,N=new WeakMap,P=new WeakMap,F=new WeakMap,I=new WeakMap,class{constructor(e={}){v(this,k,void 0),v(this,A,void 0),v(this,j,void 0),v(this,M,void 0),v(this,N,void 0),v(this,P,void 0),v(this,F,void 0),v(this,I,void 0),y(k,this,e.queryCache||new O),y(A,this,e.mutationCache||new T),y(j,this,e.defaultOptions||{}),y(M,this,new Map),y(N,this,new Map),y(P,this,0)}mount(){var e;y(P,this,(e=b(P,this),e++,e)),b(P,this)===1&&(y(F,this,h.subscribe(async e=>{e&&(await this.resumePausedMutations(),b(k,this).onFocus())})),y(I,this,n.subscribe(async e=>{e&&(await this.resumePausedMutations(),b(k,this).onOnline())})))}unmount(){var e,t,n;y(P,this,(e=b(P,this),e--,e)),b(P,this)===0&&((t=b(F,this))==null||t.call(this),y(F,this,void 0),(n=b(I,this))==null||n.call(this),y(I,this,void 0))}isFetching(e){return b(k,this).findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return b(A,this).findAll({...e,status:`pending`}).length}getQueryData(e){var t;let n=this.defaultQueryOptions({queryKey:e});return(t=b(k,this).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=b(k,this).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(p(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return b(k,this).findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=b(k,this).get(r.queryHash),a=l(t,i==null?void 0:i.state.data);if(a!==void 0)return b(k,this).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return c.batch(()=>b(k,this).findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){var t;let n=this.defaultQueryOptions({queryKey:e});return(t=b(k,this).get(n.queryHash))==null?void 0:t.state}removeQueries(e){let t=b(k,this);c.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=b(k,this);return c.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=c.batch(()=>b(k,this).findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(u).catch(u)}invalidateQueries(e,t={}){return c.batch(()=>{var n,r;return b(k,this).findAll(e).forEach(e=>{e.invalidate()}),(e==null?void 0:e.refetchType)===`none`?Promise.resolve():this.refetchQueries({...e,type:(n=(r=e==null?void 0:e.refetchType)==null?e==null?void 0:e.type:r)==null?`active`:n},t)})}refetchQueries(e,t={}){var n;let r={...t,cancelRefetch:(n=t.cancelRefetch)==null?!0:n},i=c.batch(()=>b(k,this).findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(u)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(i).then(u)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=b(k,this).build(this,t);return n.isStaleByTime(p(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(u).catch(u)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(u).catch(u)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return n.isOnline()?b(A,this).resumePausedMutations():Promise.resolve()}getQueryCache(){return b(k,this)}getMutationCache(){return b(A,this)}getDefaultOptions(){return b(j,this)}setDefaultOptions(e){y(j,this,e)}setQueryDefaults(e,t){b(M,this).set(i(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...b(M,this).values()],n={};return t.forEach(t=>{f(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){b(N,this).set(i(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...b(N,this).values()],n={};return t.forEach(t=>{f(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...b(j,this).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=o(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===g&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...b(j,this).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){b(k,this).clear(),b(A,this).clear()}}),R=t(),z=e(),B=new L({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:2,refetchOnWindowFocus:!1}}});function V(e){let t=(0,R.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,z.jsx)(s,{client:B,children:n}),t[0]=n,t[1]=r),r}function H(e){return m({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}var U=`modulepreload`,W=function(e,t){return new URL(e,t).href},G={},K=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute(`nonce`));function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=W(t,n),t in G)return;G[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:U,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{B as i,H as n,V as r,K as t};
@@ -1 +0,0 @@
1
- import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{G as i,L as a,P as o,V as s,X as c,nt as l,st as u,tt as d}from"./platform-BOMKRNFM.js";import{i as f,n as p,r as m,t as h}from"./classPrivateFieldGet2-BGlEuFdn.js";import{A as g,S as _}from"./sidebar-C-dZ1XFl.js";import{n as v}from"./mutation-CAoDu7x3.js";import{O as y,V as b}from"./badge-Cjebg6Sp.js";import{t as x}from"./createLucideIcon-CuVT3KNW.js";import{C as S,S as C,T as w,b as T,j as E,r as D,v as O,w as k}from"./button--1wnt03c.js";var A,j,M,N,P,ee=(A=new WeakMap,j=new WeakMap,M=new WeakMap,N=new WeakMap,P=new WeakSet,class extends u{constructor(e,t){super(),a(this,P),f(this,A,void 0),f(this,j,void 0),f(this,M,void 0),f(this,N,void 0),p(A,this,e),this.setOptions(t),this.bindMethods(),m(P,this,F).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;let n=this.options;this.options=h(A,this).defaultMutationOptions(e),d(this.options,n)||h(A,this).getMutationCache().notify({type:`observerOptionsUpdated`,mutation:h(M,this),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&i(n.mutationKey)!==i(this.options.mutationKey)?this.reset():((t=h(M,this))==null?void 0:t.state.status)===`pending`&&h(M,this).setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=h(M,this))==null||e.removeObserver(this)}}onMutationUpdate(e){m(P,this,F).call(this),m(P,this,te).call(this,e)}getCurrentResult(){return h(j,this)}reset(){var e;(e=h(M,this))==null||e.removeObserver(this),p(M,this,void 0),m(P,this,F).call(this),m(P,this,te).call(this)}mutate(e,t){var n;return p(N,this,t),(n=h(M,this))==null||n.removeObserver(this),p(M,this,h(A,this).getMutationCache().build(h(A,this),this.options)),h(M,this).addObserver(this),h(M,this).execute(e)}});function F(){var e,t;let n=(e=(t=h(M,this))==null?void 0:t.state)==null?v():e;p(j,this,{...n,isPending:n.status===`pending`,isSuccess:n.status===`success`,isError:n.status===`error`,isIdle:n.status===`idle`,mutate:this.mutate,reset:this.reset})}function te(e){s.batch(()=>{if(h(N,this)&&this.hasListeners()){let l=h(j,this).variables,u=h(j,this).context,d={client:h(A,this),meta:this.options.meta,mutationKey:this.options.mutationKey};if((e==null?void 0:e.type)===`success`){try{var t,n;(t=(n=h(N,this)).onSuccess)==null||t.call(n,e.data,l,u,d)}catch(e){Promise.reject(e)}try{var r,i;(r=(i=h(N,this)).onSettled)==null||r.call(i,e.data,null,l,u,d)}catch(e){Promise.reject(e)}}else if((e==null?void 0:e.type)===`error`){try{var a,o;(a=(o=h(N,this)).onError)==null||a.call(o,e.error,l,u,d)}catch(e){Promise.reject(e)}try{var s,c;(s=(c=h(N,this)).onSettled)==null||s.call(c,void 0,e.error,l,u,d)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(h(j,this))})})}var I=t(n(),1);function L(e,t){let n=o(t),[r]=I.useState(()=>new ee(n,e));I.useEffect(()=>{r.setOptions(e)},[r,e]);let i=I.useSyncExternalStore(I.useCallback(e=>r.subscribe(s.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=I.useCallback((e,t)=>{r.mutate(e,t).catch(c)},[r]);if(i.error&&l(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var ne=x(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]);function re(e,[t,n]){return Math.min(n,Math.max(t,e))}var R=e();function ie(e,t){return I.useReducer((e,n)=>{let r=t[e][n];return r==null?e:r},e)}var z=`ScrollArea`,[ae,oe]=k(z),[se,B]=ae(z),ce=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=I.useState(null),[l,u]=I.useState(null),[d,f]=I.useState(null),[p,m]=I.useState(null),[h,g]=I.useState(null),[_,v]=I.useState(0),[y,x]=I.useState(0),[S,C]=I.useState(!1),[T,D]=I.useState(!1),O=E(t,e=>c(e)),k=b(i);return(0,R.jsx)(se,{scope:n,type:r,dir:k,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:T,onScrollbarYEnabledChange:D,onCornerWidthChange:v,onCornerHeightChange:x,children:(0,R.jsx)(w.div,{dir:k,...o,ref:O,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})});ce.displayName=z;var le=`ScrollAreaViewport`,ue=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=B(le,n),s=E(t,I.useRef(null),o.onViewportChange);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,R.jsx)(w.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,R.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});ue.displayName=le;var V=`ScrollAreaScrollbar`,de=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=B(V,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return I.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,R.jsx)(fe,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,R.jsx)(pe,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,R.jsx)(me,{...r,ref:t,forceMount:n}):i.type===`always`?(0,R.jsx)(H,{...r,ref:t}):null});de.displayName=V;var fe=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=B(V,e.__scopeScrollArea),[a,o]=I.useState(!1);return I.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,R.jsx)(T,{present:n||a,children:(0,R.jsx)(me,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),pe=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=B(V,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=J(()=>c(`SCROLL_END`),100),[s,c]=ie(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return I.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),I.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,R.jsx)(T,{present:n||s!==`hidden`,children:(0,R.jsx)(H,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:S(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:S(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),me=I.forwardRef((e,t)=>{let n=B(V,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=I.useState(!1),s=e.orientation===`horizontal`,c=J(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return Y(n.viewport,c),Y(n.content,c),(0,R.jsx)(T,{present:r||a,children:(0,R.jsx)(H,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),H=I.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=B(V,e.__scopeScrollArea),a=I.useRef(null),o=I.useRef(0),[s,c]=I.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=Ce(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return we(e,o.current,s,t)}return n===`horizontal`?(0,R.jsx)(he,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=Te(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,R.jsx)(ge,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=Te(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),he=I.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=B(V,e.__scopeScrollArea),[o,s]=I.useState(),c=I.useRef(null),l=E(t,c,a.onScrollbarXChange);return I.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,R.jsx)(ye,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":q(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),De(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:K(o.paddingLeft),paddingEnd:K(o.paddingRight)}})}})}),ge=I.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=B(V,e.__scopeScrollArea),[o,s]=I.useState(),c=I.useRef(null),l=E(t,c,a.onScrollbarYChange);return I.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,R.jsx)(ye,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":q(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),De(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:K(o.paddingTop),paddingEnd:K(o.paddingBottom)}})}})}),[_e,ve]=ae(V),ye=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=B(V,n),[m,h]=I.useState(null),g=E(t,e=>h(e)),_=I.useRef(null),v=I.useRef(``),y=p.viewport,b=r.content-r.viewport,x=O(u),C=O(c),T=J(d,10);function D(e){_.current&&l({x:e.clientX-_.current.left,y:e.clientY-_.current.top})}return I.useEffect(()=>{let e=e=>{let t=e.target;m!=null&&m.contains(t)&&x(e,b)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b,x]),I.useEffect(C,[r,C]),Y(m,T),Y(p.content,T),(0,R.jsx)(_e,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:O(a),onThumbPointerUp:O(o),onThumbPositionChange:C,onThumbPointerDown:O(s),children:(0,R.jsx)(w.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:S(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),D(e))}),onPointerMove:S(e.onPointerMove,D),onPointerUp:S(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),U=`ScrollAreaThumb`,W=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=ve(U,e.__scopeScrollArea);return(0,R.jsx)(T,{present:n||i.hasThumb,children:(0,R.jsx)(be,{ref:t,...r})})}),be=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=B(U,n),o=ve(U,n),{onThumbPositionChange:s}=o,c=E(t,e=>o.onThumbChange(e)),l=I.useRef(void 0),u=J(()=>{l.current&&(l.current(),l.current=void 0)},100);return I.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{u(),l.current||(l.current=Oe(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,R.jsx)(w.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:S(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:S(e.onPointerUp,o.onThumbPointerUp)})});W.displayName=U;var G=`ScrollAreaCorner`,xe=I.forwardRef((e,t)=>{let n=B(G,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,R.jsx)(Se,{...e,ref:t}):null});xe.displayName=G;var Se=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=B(G,n),[a,o]=I.useState(0),[s,c]=I.useState(0),l=!!(a&&s);return Y(i.scrollbarX,()=>{var e;let t=((e=i.scrollbarX)==null?void 0:e.offsetHeight)||0;i.onCornerHeightChange(t),c(t)}),Y(i.scrollbarY,()=>{var e;let t=((e=i.scrollbarY)==null?void 0:e.offsetWidth)||0;i.onCornerWidthChange(t),o(t)}),l?(0,R.jsx)(w.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function K(e){return e?parseInt(e,10):0}function Ce(e,t){let n=e/t;return isNaN(n)?0:n}function q(e){let t=Ce(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function we(e,t,n,r=`ltr`){let i=q(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return Ee([c,l],d)(e)}function Te(e,t,n=`ltr`){let r=q(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=re(e,n===`ltr`?[0,o]:[o*-1,0]);return Ee([0,o],[0,s])(c)}function Ee(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function De(e,t){return e>0&&e<t}var Oe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function J(e,t){let n=O(e),r=I.useRef(0);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),I.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Y(e,t){let n=O(t);C(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var ke=ce,Ae=ue,je=xe,X=r(),Me=I.forwardRef((e,t)=>{let n=(0,X.c)(16),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=D(`relative overflow-hidden`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s={WebkitOverflowScrolling:`touch`},n[6]=s):s=n[6];let c;n[7]!==r||n[8]!==t?(c=(0,R.jsx)(Ae,{ref:t,"data-slot":`scroll-area-viewport`,className:`size-full min-w-0 rounded-[inherit] outline-none`,style:s,children:r}),n[7]=r,n[8]=t,n[9]=c):c=n[9];let l,u;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,R.jsx)(Ne,{}),u=(0,R.jsx)(je,{}),n[10]=l,n[11]=u):(l=n[10],u=n[11]);let d;return n[12]!==a||n[13]!==o||n[14]!==c?(d=(0,R.jsxs)(ke,{"data-slot":`scroll-area`,className:o,...a,children:[c,l,u]}),n[12]=a,n[13]=o,n[14]=c,n[15]=d):d=n[15],d});Me.displayName=`ScrollArea`;function Ne(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,o;t[4]===n?o=t[5]:(o=D(`flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent`,n),t[4]=n,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,R.jsx)(W,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`}),t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==r||t[9]!==o?(c=(0,R.jsx)(de,{"data-slot":`scroll-area-scrollbar`,"data-orientation":a,orientation:a,className:o,...r,children:s}),t[7]=a,t[8]=r,t[9]=o,t[10]=c):c=t[10],c}function Pe(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.tools.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.tools.all,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function Fe(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.tools.listEnvVars(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.tools.envVars,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function Ie(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{key:n,value:r}=t;return e.http.tools.setEnvVar(n,{value:r})},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.tools.envVars})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function Le(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.tools.clearEnvVar(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.tools.envVars})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function Re(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.config.models.get(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.models,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}async function Z(e,t){let n=await e.http.config.models.get(),r=n.providers.flatMap(e=>e.models).filter(e=>{var t;return(t=e.runtimeStatus)==null?void 0:t.usable});y.getState().updateModels(r,n.defaultModel,n.defaultProvider),t.setQueryData(_.config.models,n)}function ze(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.createProvider(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Be(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,body:r}=t;return e.http.config.models.updateProvider(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ve(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.deleteProvider(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function He(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,body:r}=t;return e.http.config.models.createModel(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ue(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,modelId:r,body:i}=t;return e.http.config.models.updateModel(n,r,i)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function We(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,modelId:r}=t;return e.http.config.models.deleteModel(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ge(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.setDefaults(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ke(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.preconfigs.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.preconfigs,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}async function Q(e,t){let n=await e.http.preconfigs.list();y.getState().updatePreconfigs(n.preconfigs),t.setQueryData(_.config.preconfigs,n)}function qe(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.preconfigs.create(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Q(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Je(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{id:n,body:r}=t;return e.http.preconfigs.update(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Q(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ye(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.preconfigs.delete(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Q(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Xe(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.config.prompts.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.prompts,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}async function $(e,t){let n=await e.http.config.prompts.list();y.getState().updatePrompts(n.prompts),t.setQueryData(_.config.prompts,n)}function Ze(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.prompts.create(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&$(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Qe(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{name:n,body:r}=t;return e.http.config.prompts.update(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&$(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function $e(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.prompts.delete(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&$(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function et(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.providers.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.providers.all,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function tt(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.providers.listCredentials(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.providers.credentials,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function nt(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.connect(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.config.providers.all})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function rt(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.disconnect(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.config.providers.all})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function it(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{provider:n,body:r}=t;return e.http.providers.setCredential(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.config.providers.credentials})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function at(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.clearCredential(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.config.providers.credentials})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function ot(e,t){let n=(0,X.c)(9),r;n[0]===t?r=n[1]:(r=_.mcp.status(t==null?``:t),n[0]=t,n[1]=r);let i;n[2]!==e||n[3]!==t?(i=()=>e.http.mcp.getStatus(t),n[2]=e,n[3]=t,n[4]=i):i=n[4];let a=!!e&&!!t,o;return n[5]!==r||n[6]!==i||n[7]!==a?(o={queryKey:r,queryFn:i,enabled:a},n[5]=r,n[6]=i,n[7]=a,n[8]=o):o=n[8],g(o)}function st(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.connect(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=(e,t)=>{let{workspaceId:r}=t;n.invalidateQueries({queryKey:_.mcp.status(r)})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function ct(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.disconnect(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=(e,t)=>{let{workspaceId:r}=t;n.invalidateQueries({queryKey:_.mcp.status(r)})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function lt(e){let t=(0,X.c)(2),n;return t[0]===e?n=t[1]:(n={mutationFn:t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.startAuth(n,r)}},t[0]=e,t[1]=n),L(n)}function ut(e,t,n,r,i){let a=(0,X.c)(13),o;a[0]!==r||a[1]!==n||a[2]!==t?(o=_.files.browse(t==null?``:t,n,r),a[0]=r,a[1]=n,a[2]=t,a[3]=o):o=a[3];let s;a[4]!==r||a[5]!==n||a[6]!==e||a[7]!==t?(s=()=>e.http.files.browse(t,n,r),a[4]=r,a[5]=n,a[6]=e,a[7]=t,a[8]=s):s=a[8];let c=!!e&&!!t&&(i==null?!0:i),l;return a[9]!==o||a[10]!==s||a[11]!==c?(l={queryKey:o,queryFn:s,enabled:c},a[9]=o,a[10]=s,a[11]=c,a[12]=l):l=a[12],g(l)}function dt(e,t,n){let r=(0,X.c)(9),i=n===void 0?!0:n,a;r[0]===t?a=r[1]:(a=_.files.browseFs(t),r[0]=t,r[1]=a);let o;r[2]!==t||r[3]!==e?(o=()=>e.http.files.browseFs(t),r[2]=t,r[3]=e,r[4]=o):o=r[4];let s=!!e&&i,c;return r[5]!==a||r[6]!==o||r[7]!==s?(c={queryKey:a,queryFn:o,enabled:s},r[5]=a,r[6]=o,r[7]=s,r[8]=c):c=r[8],g(c)}function ft(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.files.drives(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.files.drives,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function pt(e,t,n){let r=(0,X.c)(9),i=n===void 0?!0:n,a;r[0]===t?a=r[1]:(a=_.files.parent(t),r[0]=t,r[1]=a);let o;r[2]!==t||r[3]!==e?(o=()=>e.http.files.parent(t),r[2]=t,r[3]=e,r[4]=o):o=r[4];let s=!!e&&i,c;return r[5]!==a||r[6]!==o||r[7]!==s?(c={queryKey:a,queryFn:o,enabled:s},r[5]=a,r[6]=o,r[7]=s,r[8]=c):c=r[8],g(c)}function mt(e,t,n,r){let i=(0,X.c)(11),a=r===void 0?!0:r,o;i[0]!==n||i[1]!==t?(o=_.files.preview(t==null?``:t,n==null?``:n),i[0]=n,i[1]=t,i[2]=o):o=i[2];let s;i[3]!==n||i[4]!==e||i[5]!==t?(s=()=>e.http.files.preview(t,n),i[3]=n,i[4]=e,i[5]=t,i[6]=s):s=i[6];let c=!!e&&!!t&&!!n&&a,l;return i[7]!==o||i[8]!==s||i[9]!==c?(l={queryKey:o,queryFn:s,enabled:c},i[7]=o,i[8]=s,i[9]=c,i[10]=l):l=i[10],g(l)}export{Ue as A,Je as C,Ve as D,We as E,Pe as F,Me as I,ne as L,Le as M,Fe as N,Re as O,Ie as P,Ke as S,ze as T,$e as _,mt as a,qe as b,lt as c,nt as d,rt as f,Ze as g,it as h,pt as i,Be as j,Ge as k,ot as l,et as m,ut as n,st as o,tt as p,ft as r,ct as s,dt as t,at as u,Xe as v,He as w,Ye as x,Qe as y};
@@ -1 +0,0 @@
1
- import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{n as i}from"./ServerContext-CH3cYgM3.js";import{t as a}from"./useNavigate-Ckup4lZi.js";import{F as o,N as s,P as c}from"./button--1wnt03c.js";import{t as l}from"./refresh-cw-BYRFQSBp.js";import{t as u}from"./confirmation-dialog-CFCxzDEX.js";var d=r(),f=t(n(),1);async function p(e,t){try{let n=e.url.startsWith(`https`)?`https`:`http`,r=e.url.replace(/^https?:\/\//,``);return(await fetch(`${n}://${r}/api/info`,{signal:t})).ok?`online`:`offline`}catch{return`offline`}}function m(e){let[t,n]=(0,f.useState)({}),[r,i]=(0,f.useState)(!1),a=(0,f.useCallback)(()=>{if(e.length===0)return;let t=new AbortController;i(!0);let r={};for(let t of e)r[t.id]=`checking`;n(r);let a=e.length;for(let r of e)p(r,t.signal).then(e=>{n(t=>({...t,[r.id]:e})),a--,a===0&&i(!1)});return()=>t.abort()},[e]);return(0,f.useEffect)(()=>a(),[a]),{statuses:t,isChecking:r,refresh:a}}var h=e();function g(e){let t=(0,d.c)(3),{status:n}=e;if(n===`checking`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,h.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-muted-foreground/40 animate-pulse`}),t[0]=e):e=t[0],e}if(n===`online`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,h.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-green-500`}),t[1]=e):e=t[1],e}let r;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,h.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-destructive`}),t[2]=r):r=t[2],r}function _(){var e;let t=(0,d.c)(42),n=a(),{servers:r,removeServer:p}=i(),[_,v]=(0,f.useState)(null),{statuses:y,isChecking:b,refresh:x}=m(r),S;t[0]===n?S=t[1]:(S=e=>{n({to:`/server/$serverId`,params:{serverId:e.id}})},t[0]=n,t[1]=S);let C=S,w;t[2]!==_||t[3]!==p?(w=()=>{_&&(p(_.id),v(null))},t[2]=_,t[3]=p,t[4]=w):w=t[4];let T=w,E;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,h.jsx)(`h1`,{className:`text-2xl font-bold text-foreground`,children:`Select a Server`}),t[5]=E):E=t[5];let D=`w-4 h-4 ${b?`animate-spin`:``}`,O;t[6]===D?O=t[7]:(O=(0,h.jsx)(l,{className:D}),t[6]=D,t[7]=O);let k;t[8]!==b||t[9]!==x||t[10]!==O?(k=(0,h.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[E,(0,h.jsx)(`button`,{onClick:x,disabled:b,className:`p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-50 transition-colors`,title:`Refresh server status`,children:O})]}),t[8]=b,t[9]=x,t[10]=O,t[11]=k):k=t[11];let A;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,h.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:`Choose a saved server or add a new one`}),t[12]=A):A=t[12];let j;t[13]===k?j=t[14]:(j=(0,h.jsxs)(`div`,{className:`px-6 pt-6 pb-4 text-center border-b border-border`,children:[k,A]}),t[13]=k,t[14]=j);let M;if(t[15]!==C||t[16]!==r||t[17]!==y){let e;t[19]!==C||t[20]!==y?(e=e=>{var t;return(0,h.jsxs)(`div`,{className:`group w-full flex items-center gap-4 p-4 bg-background border border-input rounded-lg hover:bg-accent hover:border-ring transition-colors`,children:[(0,h.jsxs)(`button`,{onClick:()=>C(e),className:`flex items-center gap-4 flex-1 min-w-0 text-left`,children:[(0,h.jsx)(`div`,{className:`p-2 bg-primary/10 rounded-lg shrink-0`,children:(0,h.jsx)(c,{className:`w-5 h-5 text-primary`})}),(0,h.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`p`,{className:`font-medium text-foreground truncate`,children:e.name}),(0,h.jsx)(g,{status:(t=y[e.id])==null?`checking`:t})]}),(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground truncate`,children:e.url})]})]}),(0,h.jsx)(`button`,{onClick:t=>{t.stopPropagation(),v(e)},className:`p-2 rounded-md opacity-0 group-hover:opacity-100 hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-all shrink-0`,title:`Remove server`,children:(0,h.jsx)(s,{className:`w-4 h-4`})})]},e.id)},t[19]=C,t[20]=y,t[21]=e):e=t[21],M=r.map(e),t[15]=C,t[16]=r,t[17]=y,t[18]=M}else M=t[18];let N;t[22]===n?N=t[23]:(N=()=>n({to:`/add-server`}),t[22]=n,t[23]=N);let P;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,h.jsx)(`div`,{className:`p-2 bg-primary/10 rounded-lg`,children:(0,h.jsx)(o,{className:`w-5 h-5 text-primary`})}),t[24]=P):P=t[24];let F;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,h.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,h.jsx)(`p`,{className:`font-medium text-muted-foreground`,children:`Add a Server`})}),t[25]=F):F=t[25];let I;t[26]===N?I=t[27]:(I=(0,h.jsxs)(`button`,{onClick:N,className:`w-full flex items-center gap-4 p-4 bg-background border border-dashed border-input rounded-lg hover:bg-accent hover:border-ring transition-colors text-left`,children:[P,F]}),t[26]=N,t[27]=I);let L;t[28]!==I||t[29]!==M?(L=(0,h.jsxs)(`div`,{className:`p-6 space-y-4`,children:[M,I]}),t[28]=I,t[29]=M,t[30]=L):L=t[30];let R;t[31]!==L||t[32]!==j?(R=(0,h.jsxs)(`div`,{className:`bg-card border border-border rounded-xl shadow-2xl overflow-hidden`,children:[j,L]}),t[31]=L,t[32]=j,t[33]=R):R=t[33];let z=_!==null,B;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>{e||v(null)},t[34]=B):B=t[34];let V=`Remove "${(e=_==null?void 0:_.name)==null?``:e}" from your saved servers?`,H;t[35]!==T||t[36]!==z||t[37]!==V?(H=(0,h.jsx)(u,{open:z,onOpenChange:B,title:`Remove Server`,description:V,confirmLabel:`Remove`,onConfirm:T,variant:`destructive`}),t[35]=T,t[36]=z,t[37]=V,t[38]=H):H=t[38];let U;return t[39]!==R||t[40]!==H?(U=(0,h.jsx)(`div`,{className:`w-full h-full flex items-center justify-center bg-background dark:bg-gradient-to-br dark:from-muted dark:via-background dark:to-muted p-4`,children:(0,h.jsxs)(`div`,{className:`w-full max-w-2xl`,children:[R,H]})}),t[39]=R,t[40]=H,t[41]=U):U=t[41],U}export{_ as component};
@@ -1 +0,0 @@
1
- import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{$ as i,H as a,I as o,L as s,P as c,Q as l,U as u,V as d,X as f,at as p,et as m,it as h,n as g,nt as _,ot as v,q as y,st as b,tt as x}from"./platform-BOMKRNFM.js";import{i as S,n as C,r as w,t as T}from"./classPrivateFieldGet2-BGlEuFdn.js";import{Q as E,Z as D,_ as O,b as k,f as A,h as j,j as M,p as N}from"./badge-Cjebg6Sp.js";import"./src-DMBD0Xgc.js";import{t as P}from"./createLucideIcon-CuVT3KNW.js";import{D as ee,M as te,a as ne,c as re,d as ie,l as ae,n as oe,o as se,r as F,s as ce,t as le,u as ue}from"./button--1wnt03c.js";var I,L,de,R,z,B,V,H,fe,U,W,G,K,q,J,Y,pe=(I=new WeakMap,L=new WeakMap,de=new WeakMap,R=new WeakMap,z=new WeakMap,B=new WeakMap,V=new WeakMap,H=new WeakMap,fe=new WeakMap,U=new WeakMap,W=new WeakMap,G=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakMap,Y=new WeakSet,class extends b{constructor(e,t){super(),s(this,Y),S(this,I,void 0),S(this,L,void 0),S(this,de,void 0),S(this,R,void 0),S(this,z,void 0),S(this,B,void 0),S(this,V,void 0),S(this,H,void 0),S(this,fe,void 0),S(this,U,void 0),S(this,W,void 0),S(this,G,void 0),S(this,K,void 0),S(this,q,void 0),S(this,J,new Set),this.options=t,C(I,this,e),C(H,this,null),C(V,this,a()),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(L,this).addObserver(this),we(T(L,this),this.options)?w(Y,this,me).call(this):this.updateResult(),w(Y,this,ve).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Te(T(L,this),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Te(T(L,this),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,w(Y,this,ye).call(this),w(Y,this,be).call(this),T(L,this).removeObserver(this)}setOptions(e){let t=this.options,n=T(L,this);if(this.options=T(I,this).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof i(this.options.enabled,T(L,this))!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);w(Y,this,xe).call(this),T(L,this).setOptions(this.options),t._defaulted&&!x(this.options,t)&&T(I,this).getQueryCache().notify({type:`observerOptionsUpdated`,query:T(L,this),observer:this});let r=this.hasListeners();r&&Ee(T(L,this),n,this.options,t)&&w(Y,this,me).call(this),this.updateResult(),r&&(T(L,this)!==n||i(this.options.enabled,T(L,this))!==i(t.enabled,T(L,this))||m(this.options.staleTime,T(L,this))!==m(t.staleTime,T(L,this)))&&w(Y,this,he).call(this);let a=w(Y,this,ge).call(this);r&&(T(L,this)!==n||i(this.options.enabled,T(L,this))!==i(t.enabled,T(L,this))||a!==T(q,this))&&w(Y,this,_e).call(this,a)}getOptimisticResult(e){let t=T(I,this).getQueryCache().build(T(I,this),e),n=this.createResult(t,e);return Oe(this,n)&&(C(R,this,n),C(B,this,this.options),C(z,this,T(L,this).state)),n}getCurrentResult(){return T(R,this)}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t==null||t(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&T(V,this).status===`pending`&&T(V,this).reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){T(J,this).add(e)}getCurrentQuery(){return T(L,this)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=T(I,this).defaultQueryOptions(e),n=T(I,this).getQueryCache().build(T(I,this),t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){var t;return w(Y,this,me).call(this,{...e,cancelRefetch:(t=e.cancelRefetch)==null?!0:t}).then(()=>(this.updateResult(),T(R,this)))}createResult(e,t){let n=T(L,this),r=this.options,s=T(R,this),c=T(z,this),u=T(B,this),d=e===n?T(de,this):e.state,{state:f}=e,p={...f},m=!1,h;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&we(e,t),s=i&&Ee(e,n,t,r);(a||s)&&(p={...p,...o(f.data,e.options)}),t._optimisticResults===`isRestoring`&&(p.fetchStatus=`idle`)}let{error:g,errorUpdatedAt:_,status:v}=p;h=p.data;let y=!1;if(t.placeholderData!==void 0&&h===void 0&&v===`pending`){let e;if(s!=null&&s.isPlaceholderData&&t.placeholderData===(u==null?void 0:u.placeholderData))e=s.data,y=!0;else{var b;e=typeof t.placeholderData==`function`?t.placeholderData((b=T(W,this))==null?void 0:b.state.data,T(W,this)):t.placeholderData}e!==void 0&&(v=`success`,h=l(s==null?void 0:s.data,e,t),m=!0)}if(t.select&&h!==void 0&&!y)if(s&&h===(c==null?void 0:c.data)&&t.select===T(fe,this))h=T(U,this);else try{C(fe,this,t.select),h=t.select(h),h=l(s==null?void 0:s.data,h,t),C(U,this,h),C(H,this,null)}catch(e){C(H,this,e)}T(H,this)&&(g=T(H,this),h=T(U,this),_=Date.now(),v=`error`);let x=p.fetchStatus===`fetching`,S=v===`pending`,w=v===`error`,E=S&&x,D=h!==void 0,O={status:v,fetchStatus:p.fetchStatus,isPending:S,isSuccess:v===`success`,isError:w,isInitialLoading:E,isLoading:E,data:h,dataUpdatedAt:p.dataUpdatedAt,error:g,errorUpdatedAt:_,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:x,isRefetching:x&&!S,isLoadingError:w&&!D,isPaused:p.fetchStatus===`paused`,isPlaceholderData:m,isRefetchError:w&&D,isStale:De(e,t),refetch:this.refetch,promise:T(V,this),isEnabled:i(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=O.data!==void 0,r=O.status===`error`&&!t,i=e=>{r?e.reject(O.error):t&&e.resolve(O.data)},o=()=>{i(C(V,this,O.promise=a()))},s=T(V,this);switch(s.status){case`pending`:e.queryHash===n.queryHash&&i(s);break;case`fulfilled`:(r||O.data!==s.value)&&o();break;case`rejected`:(!r||O.error!==s.reason)&&o();break}}return O}updateResult(){let e=T(R,this),t=this.createResult(T(L,this),this.options);C(z,this,T(L,this).state),C(B,this,this.options),T(z,this).data!==void 0&&C(W,this,T(L,this)),!x(t,e)&&(C(R,this,t),w(Y,this,Se).call(this,{listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!T(J,this).size)return!0;let r=new Set(n==null?T(J,this):n);return this.options.throwOnError&&r.add(`error`),Object.keys(T(R,this)).some(t=>{let n=t;return T(R,this)[n]!==e[n]&&r.has(n)})})()}))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&w(Y,this,ve).call(this)}});function me(e){w(Y,this,xe).call(this);let t=T(L,this).fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch(f)),t}function he(){w(Y,this,ye).call(this);let e=m(this.options.staleTime,T(L,this));if(u.isServer()||T(R,this).isStale||!y(e))return;let t=h(T(R,this).dataUpdatedAt,e)+1;C(G,this,p.setTimeout(()=>{T(R,this).isStale||this.updateResult()},t))}function ge(){var e;return(e=typeof this.options.refetchInterval==`function`?this.options.refetchInterval(T(L,this)):this.options.refetchInterval)==null?!1:e}function _e(e){w(Y,this,be).call(this),C(q,this,e),!(u.isServer()||i(this.options.enabled,T(L,this))===!1||!y(T(q,this))||T(q,this)===0)&&C(K,this,p.setInterval(()=>{(this.options.refetchIntervalInBackground||v.isFocused())&&w(Y,this,me).call(this)},T(q,this)))}function ve(){w(Y,this,he).call(this),w(Y,this,_e).call(this,w(Y,this,ge).call(this))}function ye(){T(G,this)!==void 0&&(p.clearTimeout(T(G,this)),C(G,this,void 0))}function be(){T(K,this)!==void 0&&(p.clearInterval(T(K,this)),C(K,this,void 0))}function xe(){let e=T(I,this).getQueryCache().build(T(I,this),this.options);if(e===T(L,this))return;let t=T(L,this);C(L,this,e),C(de,this,e.state),this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))}function Se(e){d.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(T(R,this))}),T(I,this).getQueryCache().notify({query:T(L,this),type:`observerResultsUpdated`})})}function Ce(e,t){return i(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&i(t.retryOnMount,e)===!1)}function we(e,t){return Ce(e,t)||e.state.data!==void 0&&Te(e,t,t.refetchOnMount)}function Te(e,t,n){if(i(t.enabled,e)!==!1&&m(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&De(e,t)}return!1}function Ee(e,t,n,r){return(e!==t||i(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&De(e,n)}function De(e,t){return i(t.enabled,e)!==!1&&e.isStaleByTime(m(t.staleTime,e))}function Oe(e,t){return!x(e.getCurrentResult(),t)}var X=e(),Z=t(n(),1),ke=Z.createContext(!1),Ae=()=>Z.useContext(ke);ke.Provider;function je(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Me=Z.createContext(je()),Ne=()=>Z.useContext(Me),Pe=(e,t,n)=>{let r=n!=null&&n.state.error&&typeof e.throwOnError==`function`?_(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Fe=e=>{Z.useEffect(()=>{e.clearReset()},[e])},Ie=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||_(n,[e.error,r])),Le=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e==null?t:e,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Re=(e,t)=>e.isLoading&&e.isFetching&&!t,ze=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Be=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ve(e,t,n){var r,i,a,o;let s=Ae(),l=Ne(),p=c(n),m=p.defaultQueryOptions(e);(r=p.getDefaultOptions().queries)==null||(i=r._experimental_beforeQuery)==null||i.call(r,m);let h=p.getQueryCache().get(m.queryHash);m._optimisticResults=s?`isRestoring`:`optimistic`,Le(m),Pe(m,l,h),Fe(l);let g=!p.getQueryCache().get(m.queryHash),[_]=Z.useState(()=>new t(p,m)),v=_.getOptimisticResult(m),y=!s&&e.subscribed!==!1;if(Z.useSyncExternalStore(Z.useCallback(e=>{let t=y?_.subscribe(d.batchCalls(e)):f;return _.updateResult(),t},[_,y]),()=>_.getCurrentResult(),()=>_.getCurrentResult()),Z.useEffect(()=>{_.setOptions(m)},[m,_]),ze(m,v))throw Be(m,_,l);if(Ie({result:v,errorResetBoundary:l,throwOnError:m.throwOnError,query:h,suspense:m.suspense}))throw v.error;if((a=p.getDefaultOptions().queries)==null||(o=a._experimental_afterQuery)==null||o.call(a,m,v),m.experimental_prefetchInRender&&!u.isServer()&&Re(v,s)){let e=g?Be(m,_,l):h==null?void 0:h.promise;e==null||e.catch(f).finally(()=>{_.updateResult()})}return m.notifyOnChangeProps?v:_.trackResult(v)}function He(e,t){return Ve(e,pe,t)}var Ue=P(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),We=P(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ge=P(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Ke=P(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),qe=5e3,Je=M(e=>({completionState:new Map,setCompletion:(t,n)=>e(e=>{let r=new Map(e.completionState);return r.set(t,n),{completionState:r}}),clearCompletion:t=>e(e=>{let n=new Map(e.completionState);return n.delete(t),{completionState:n}}),clearAllCompletions:()=>e({completionState:new Map})})),Ye=e=>t=>t.completionState.get(e),Xe=qe,Ze={sessions:{all:[`sessions`],byWorkspace:e=>[`sessions`,`workspace`,e],grouped:(e,t)=>[`sessions`,`grouped`,{workspaceIds:[...e].sort(),status:t}]},tools:{all:[`tools`],envVars:[`tools`,`envVars`]},config:{models:[`config`,`models`],preconfigs:[`config`,`preconfigs`],prompts:[`config`,`prompts`],providers:{all:[`providers`],credentials:[`providers`,`credentials`]}},mcp:{status:e=>[`mcp`,`status`,e]},files:{browse:(e,t,n)=>[`files`,`browse`,e,t==null?`.`:t,n],browseFs:e=>[`files`,`browseFs`,e],drives:[`files`,`drives`],parent:e=>[`files`,`parent`,e],preview:(e,t)=>[`files`,`preview`,e,t]},serverInfo:[`serverInfo`]},Q=r();function Qe(e){return E(e)}function $e(e){if(typeof window>`u`)return e;try{let t=localStorage.getItem(D.SESSIONS);if(t===null)return e;let n=JSON.parse(t);return typeof n.width!=`number`||isNaN(n.width)?e:Qe(n.width)}catch{return e}}function et(e){if(!(typeof window>`u`))try{let t=Qe(e);localStorage.setItem(D.SESSIONS,JSON.stringify({width:t}))}catch(e){console.warn(`Error saving sessions panel width:`,e)}}function tt(e){if(typeof window>`u`)return e;try{let t=localStorage.getItem(D.FILES);if(t===null)return e;let n=JSON.parse(t);return typeof n.width!=`number`||isNaN(n.width)?e:Qe(n.width)}catch{return e}}function nt(e){if(!(typeof window>`u`))try{let t=Qe(e);localStorage.setItem(D.FILES,JSON.stringify({width:t}))}catch(e){console.warn(`Error saving files panel width:`,e)}}var rt=()=>$e(256),it=()=>tt(256),$=M(e=>({showFilesPanel:!1,showTerminalPanel:!1,sessionsPanelWidth:rt(),filesPanelWidth:it(),setShowFilesPanel:t=>e({showFilesPanel:t}),setShowTerminalPanel:t=>e({showTerminalPanel:t}),setSessionsPanelWidth:t=>{let n=E(t);et(n),e({sessionsPanelWidth:n})},setFilesPanelWidth:t=>{let n=E(t);nt(n),e({filesPanelWidth:n})}}));function at(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(ue,{"data-slot":`sheet`,...n}),t[2]=n,t[3]=r),r}function ot(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(ae,{"data-slot":`sheet-portal`,...n}),t[2]=n,t[3]=r),r}function st(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(re,{"data-slot":`sheet-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ct(e){let t=(0,Q.c)(24),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:r,children:n,side:o,showCloseButton:s,style:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=o===void 0?`right`:o,l=s===void 0?!0:s,u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,X.jsx)(st,{}),t[7]=u):u=t[7];let d;t[8]===r?d=t[9]:(d=F(`fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,r),t[8]=r,t[9]=d);let f=g()?`90px`:`0px`,p;t[10]===c?p=t[11]:(p=c===`left`||c===`right`?{top:`calc(env(safe-area-inset-top, 0px) + ${f})`,bottom:`env(safe-area-inset-bottom, 0px)`,height:`calc(100vh - env(safe-area-inset-top, 0px) - ${f} - env(safe-area-inset-bottom, 0px))`}:c===`top`?{top:`calc(env(safe-area-inset-top, 0px) + ${f})`}:c===`bottom`?{bottom:`env(safe-area-inset-bottom, 0px)`}:void 0,t[10]=c,t[11]=p);let m=p,h;t[12]!==m||t[13]!==a?(h=m?{...m,...a}:a,t[12]=m,t[13]=a,t[14]=h):h=t[14];let _=h,v;t[15]===l?v=t[16]:(v=l&&(0,X.jsx)(ne,{"data-slot":`sheet-close`,asChild:!0,children:(0,X.jsxs)(le,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,X.jsx)(te,{}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Close`})]})}),t[15]=l,t[16]=v);let y;return t[17]!==n||t[18]!==i||t[19]!==c||t[20]!==d||t[21]!==_||t[22]!==v?(y=(0,X.jsxs)(ot,{children:[u,(0,X.jsxs)(se,{"data-slot":`sheet-content`,"data-side":c,className:d,style:_,...i,children:[n,v]})]}),t[17]=n,t[18]=i,t[19]=c,t[20]=d,t[21]=_,t[22]=v,t[23]=y):y=t[23],y}function lt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex flex-col gap-0.5 p-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{"data-slot":`sheet-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ut(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`text-base font-medium text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(ie,{"data-slot":`sheet-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function dt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`text-sm text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(ce,{"data-slot":`sheet-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var ft=`sidebar_state`,pt=3600*24*7,mt=`16rem`,ht=`18rem`,gt=`3rem`,_t=Z.createContext(null);function vt(){let e=Z.useContext(_t);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function yt(e){var t;let n=(0,Q.c)(35),r,i,a,o,s,c,l,u;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7],u=n[8]):({defaultOpen:u,open:a,onOpenChange:c,className:i,style:l,children:r,panelId:o,...s}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c,n[7]=l,n[8]=u);let d=u===void 0?!0:u,f=k(),[p,m]=Z.useState(!1),[h,g]=Z.useState(d),_=(t=a)==null?h:t,v;n[9]!==_||n[10]!==c?(v=e=>{let t=typeof e==`function`?e(_):e;c?c(t):g(t),document.cookie=`${ft}=${t}; path=/; max-age=${pt}`},n[9]=_,n[10]=c,n[11]=v):v=n[11];let y=v,b;n[12]!==f||n[13]!==y?(b=()=>f?m(xt):y(bt),n[12]=f,n[13]=y,n[14]=b):b=n[14];let x=b,S=_?`expanded`:`collapsed`,C;n[15]!==f||n[16]!==_||n[17]!==p||n[18]!==y||n[19]!==S||n[20]!==x?(C={state:S,open:_,setOpen:y,isMobile:f,openMobile:p,setOpenMobile:m,toggleSidebar:x},n[15]=f,n[16]=_,n[17]=p,n[18]=y,n[19]=S,n[20]=x,n[21]=C):C=n[21];let w=C,T;n[22]===l?T=n[23]:(T={"--sidebar-width":mt,"--sidebar-width-icon":gt,...l},n[22]=l,n[23]=T);let E=T,D;n[24]===i?D=n[25]:(D=F(`overflow-hidden group/sidebar-wrapper flex h-full w-full has-data-[variant=inset]:bg-sidebar`,i),n[24]=i,n[25]=D);let O;n[26]!==r||n[27]!==o||n[28]!==s||n[29]!==E||n[30]!==D?(O=(0,X.jsx)(`div`,{"data-slot":`sidebar-wrapper`,"data-panel-id":o,style:E,className:D,...s,children:r}),n[26]=r,n[27]=o,n[28]=s,n[29]=E,n[30]=D,n[31]=O):O=n[31];let A;return n[32]!==w||n[33]!==O?(A=(0,X.jsx)(_t.Provider,{value:w,children:O}),n[32]=w,n[33]=O,n[34]=A):A=n[34],A}function bt(e){return!e}function xt(e){return!e}function St(e){let t=(0,Q.c)(53),n,r,i,a,o,s,c,l;if(t[0]!==e){let{side:u,variant:d,collapsible:f,className:p,children:m,dir:h,isOpen:g,onOpenChange:_,...v}=e;s=u,c=d,l=f,r=p,n=m,i=h,a=g,o=v,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l}else n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8];let u=s===void 0?`left`:s,d=c===void 0?`sidebar`:c,f=l===void 0?`offcanvas`:l,{isMobile:p,state:m,openMobile:h,setOpenMobile:g}=vt(),_=a===void 0?void 0:a,v=_===void 0?m:_?`expanded`:`collapsed`;if(f===`none`){let e;t[9]===r?e=t[10]:(e=F(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),t[9]=r,t[10]=e);let i;return t[11]!==n||t[12]!==o||t[13]!==e?(i=(0,X.jsx)(`div`,{"data-slot":`sidebar`,className:e,...o,children:n}),t[11]=n,t[12]=o,t[13]=e,t[14]=i):i=t[14],i}if(p){let e;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e={"--sidebar-width":ht},t[15]=e):e=t[15];let r;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsxs)(lt,{className:`sr-only`,children:[(0,X.jsx)(ut,{children:`Sidebar`}),(0,X.jsx)(dt,{children:`Displays the mobile sidebar.`})]}),t[16]=r):r=t[16];let a;t[17]===n?a=t[18]:(a=(0,X.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:n}),t[17]=n,t[18]=a);let s;t[19]!==i||t[20]!==u||t[21]!==a?(s=(0,X.jsxs)(ct,{dir:i,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:e,side:u,children:[r,a]}),t[19]=i,t[20]=u,t[21]=a,t[22]=s):s=t[22];let c;return t[23]!==h||t[24]!==o||t[25]!==g||t[26]!==s?(c=(0,X.jsx)(at,{open:h,onOpenChange:g,...o,children:s}),t[23]=h,t[24]=o,t[25]=g,t[26]=s,t[27]=c):c=t[27],c}let y=v===`collapsed`?f:``,b=_!==void 0&&!_&&`w-0`,x=d===`floating`||d===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,S;t[28]!==b||t[29]!==x?(S=F(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,b,`group-data-[side=right]:rotate-180`,x),t[28]=b,t[29]=x,t[30]=S):S=t[30];let C;t[31]===S?C=t[32]:(C=(0,X.jsx)(`div`,{"data-slot":`sidebar-gap`,className:S}),t[31]=S,t[32]=C);let w=u===`left`&&_!==void 0&&!_&&`left-[calc(var(--sidebar-width)*-1)]`,T=u===`right`&&_!==void 0&&!_&&`right-[calc(var(--sidebar-width)*-1)]`,E=d===`floating`||d===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,D;t[33]!==r||t[34]!==T||t[35]!==E||t[36]!==w?(D=F(`fixed z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,w,T,E,r),t[33]=r,t[34]=T,t[35]=E,t[36]=w,t[37]=D):D=t[37];let O;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(O={top:`calc(var(--header-height, 0px) + env(safe-area-inset-top, 0px))`,bottom:`env(safe-area-inset-bottom, 0px)`,height:`calc(100vh - var(--header-height, 0px) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))`},t[38]=O):O=t[38];let k;t[39]===n?k=t[40]:(k=(0,X.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:n}),t[39]=n,t[40]=k);let A;t[41]!==o||t[42]!==u||t[43]!==D||t[44]!==k?(A=(0,X.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":u,className:D,style:O,...o,children:k}),t[41]=o,t[42]=u,t[43]=D,t[44]=k,t[45]=A):A=t[45];let j;return t[46]!==v||t[47]!==u||t[48]!==A||t[49]!==y||t[50]!==C||t[51]!==d?(j=(0,X.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":v,"data-collapsible":y,"data-variant":d,"data-side":u,"data-slot":`sidebar`,children:[C,A]}),t[46]=v,t[47]=u,t[48]=A,t[49]=y,t[50]=C,t[51]=d,t[52]=j):j=t[52],j}function Ct(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function wt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`mx-2 w-auto bg-sidebar-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(O,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Tt=Z.forwardRef((e,t)=>{let n=(0,Q.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`no-scrollbar flex min-h-0 min-w-0 w-full flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,X.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:a,ref:t,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});function Et(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`relative flex w-full min-w-0 flex-col p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Dt(e){let t=(0,Q.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,asChild:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i!==void 0&&i?ee:`div`,o;t[4]===n?o=t[5]:(o=F(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,X.jsx)(a,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function Ot(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`w-full text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function kt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex w-full min-w-0 flex-col gap-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function At(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var jt=oe(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus:ring-1 focus:ring-inset active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function Mt(e){let t=(0,Q.c)(28),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({asChild:i,isActive:a,variant:o,size:s,tooltip:c,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=i===void 0?!1:i,u=a===void 0?!1:a,d=o===void 0?`default`:o,f=s===void 0?`default`:s,p=l?ee:`button`,{isMobile:m,state:h}=vt(),g;t[8]!==n||t[9]!==f||t[10]!==d?(g=F(jt({variant:d,size:f}),n),t[8]=n,t[9]=f,t[10]=d,t[11]=g):g=t[11];let _;t[12]!==p||t[13]!==u||t[14]!==r||t[15]!==f||t[16]!==g?(_=(0,X.jsx)(p,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":f,"data-active":u,className:g,...r}),t[12]=p,t[13]=u,t[14]=r,t[15]=f,t[16]=g,t[17]=_):_=t[17];let v=_;if(!c)return v;if(typeof c==`string`){let e;t[18]===c?e=t[19]:(e={children:c},t[18]=c,t[19]=e),c=e}let y;t[20]===v?y=t[21]:(y=(0,X.jsx)(j,{asChild:!0,children:v}),t[20]=v,t[21]=y);let b=h!==`collapsed`||m,x;t[22]!==b||t[23]!==c?(x=(0,X.jsx)(N,{side:`right`,align:`center`,hidden:b,...c}),t[22]=b,t[23]=c,t[24]=x):x=t[24];let S;return t[25]!==y||t[26]!==x?(S=(0,X.jsxs)(A,{children:[y,x]}),t[25]=y,t[26]=x,t[27]=S):S=t[27],S}function Nt(e){let t=(0,Q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,asChild:i,showOnHover:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?!1:i,s=a===void 0?!1:a,c=o?ee:`button`,l=s&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0`,u;t[5]!==n||t[6]!==l?(u=F(`absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus:ring-1 focus:ring-inset md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,l,n),t[5]=n,t[6]=l,t[7]=u):u=t[7];let d;return t[8]!==c||t[9]!==r||t[10]!==u?(d=(0,X.jsx)(c,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:u,...r}),t[8]=c,t[9]=r,t[10]=u,t[11]=d):d=t[11],d}function Pt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`ml-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border pl-2.5 py-0.5 group-data-[collapsible=icon]:hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ft(e){let t=(0,Q.c)(29),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({side:a,panelId:r,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=k(),s=$(zt),c=$(Rt),l=$(Lt),u=$(It),d=r===`sessions`?s:l,f=r===`sessions`?c:u,[p,m]=Z.useState(!1),h=Z.useRef(!1),g=Z.useRef(0),_=Z.useRef(0),v=Z.useRef(0),y=Z.useRef(null),b=Z.useRef(null),x;t[5]!==o||t[6]!==r?(x=e=>{if(o)return;e.preventDefault(),e.stopPropagation(),h.current=!0,m(!0),g.current=e.clientX,_.current=v.current,document.body.style.cursor=`ew-resize`,document.body.style.userSelect=`none`;let t=document.querySelector(`[data-panel-id="${r}"]`);y.current=t,t&&(b.current=t.style.getPropertyValue(`--sidebar-width`)||null,t.classList.add(`no-transition`))},t[5]=o,t[6]=r,t[7]=x):x=t[7];let S=x,C,w;t[8]===d?(C=t[9],w=t[10]):(C=()=>{v.current=d},w=[d],t[8]=d,t[9]=C,t[10]=w),Z.useEffect(C,w);let T,D;if(t[11]!==r||t[12]!==f||t[13]!==a?(T=()=>{let e=e=>{if(!h.current)return;let t=a===`left`?e.clientX-g.current:g.current-e.clientX,n=E(_.current+t);v.current=n;let i=y.current||document.querySelector(`[data-panel-id="${r}"]`);i&&(i.style.setProperty(`--sidebar-width`,`${Math.round(n)}px`),y.current=i);let o=document.querySelector(`[data-panel-gap="${r}"]`);o&&(o.style.width=`${Math.round(n)}px`)},t=()=>{if(!h.current)return;h.current=!1,m(!1),document.body.style.cursor=``,document.body.style.userSelect=``;let e=y.current||document.querySelector(`[data-panel-id="${r}"]`);e&&(e.classList.remove(`no-transition`),b.current===null?e.style.removeProperty(`--sidebar-width`):e.style.setProperty(`--sidebar-width`,b.current));let t=document.querySelector(`[data-panel-gap="${r}"]`);t&&(t.classList.add(`no-transition`),t.style.width=`${Math.round(v.current)}px`,requestAnimationFrame(()=>{t==null||t.classList.remove(`no-transition`)})),f(Math.round(v.current))};return document.addEventListener(`mousemove`,e),document.addEventListener(`mouseup`,t),()=>{document.removeEventListener(`mousemove`,e),document.removeEventListener(`mouseup`,t)}},D=[f,a,r],t[11]=r,t[12]=f,t[13]=a,t[14]=T,t[15]=D):(T=t[14],D=t[15]),Z.useEffect(T,D),o)return null;let O=a===`left`?`absolute top-0 right-0`:`absolute top-0 left-0`,A;t[16]!==n||t[17]!==O?(A=F(`z-30 flex h-full w-2 cursor-ew-resize items-center justify-center group/sidebar-resize`,O,n),t[16]=n,t[17]=O,t[18]=A):A=t[18];let j=p?`bg-primary`:`group-active/sidebar-resize:bg-primary`,M;t[19]===j?M=t[20]:(M=F(`h-8 w-0.5 rounded-full transition-colors duration-100`,`bg-transparent group-hover/sidebar-resize:bg-border`,j),t[19]=j,t[20]=M);let N;t[21]===M?N=t[22]:(N=(0,X.jsx)(`div`,{className:M}),t[21]=M,t[22]=N);let P;return t[23]!==S||t[24]!==r||t[25]!==i||t[26]!==A||t[27]!==N?(P=(0,X.jsx)(`div`,{"data-slot":`panel-resize-handle`,"data-panel-id":r,className:A,onMouseDown:S,...i,children:N}),t[23]=S,t[24]=r,t[25]=i,t[26]=A,t[27]=N,t[28]=P):P=t[28],P}function It(e){return e.setFilesPanelWidth}function Lt(e){return e.filesPanelWidth}function Rt(e){return e.setSessionsPanelWidth}function zt(e){return e.sessionsPanelWidth}function Bt(e){let t=(0,Q.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,X.jsx)(Ft,{side:`left`,panelId:`sessions`,className:n,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}export{He as A,Xe as C,Ge as D,Ke as E,We as O,Ze as S,Je as T,at as _,Et as a,ut as b,Ct as c,Mt as d,At as f,vt as g,wt as h,Tt as i,Ue as k,kt as l,yt as m,Bt as n,Ot as o,Pt as p,St as r,Dt as s,Ft as t,Nt as u,ct as v,Ye as w,$ as x,lt as y};
@@ -1 +0,0 @@
1
- function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(t,n){if(e(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function n(n){var r=t(n,`string`);return e(r)==`symbol`?r:r+``}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=class{constructor(){r(this,`listeners`,new Map)}on(e,t){let n=this.listeners.get(e);return n||(n=new Set,this.listeners.set(e,n)),n.add(t),this}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}off(e,t){let n=this.listeners.get(e);return n&&(n.delete(t),n.size===0&&this.listeners.delete(e)),this}emit(e,...t){let n=this.listeners.get(e);if(!n||n.size===0)return!1;for(let r of n)try{r(...t)}catch(t){console.error(`Error in event handler for "${e}":`,t)}return!0}removeAllListeners(e){return e===void 0?this.listeners.clear():this.listeners.delete(e),this}listenerCount(e){var t,n;return(t=(n=this.listeners.get(e))==null?void 0:n.size)==null?0:t}eventNames(){return Array.from(this.listeners.keys())}};function a(e,t){switch(t.type){case`client.registered`:e.emit(`client.registered`,t.client,t.connectionId,t.serverTime);break;case`client.rejected`:e.emit(`client.rejected`,t.code,t.message);break;case`session.created`:e.emit(`session.created`,t.session);break;case`session.resumed`:e.emit(`session.resumed`,t.session,t.messages,t.usage,t.isRunning,t.control);break;case`session.control.updated`:e.emit(`session.control.updated`,t.control,t.reason);break;case`session.action_rejected`:e.emit(`session.action_rejected`,t.sessionId,t.action,t.code,t.message,t.control);break;case`session.closed`:e.emit(`session.closed`,t.sessionId);break;case`session.reopened`:e.emit(`session.reopened`,t.session);break;case`session.deleted`:e.emit(`session.deleted`,t.sessionId);break;case`session.updated`:e.emit(`session.updated`,t.session);break;case`session.renamed`:e.emit(`session.renamed`,t.session);break;case`session.interrupted`:e.emit(`session.interrupted`,t.sessionId,t.result);break;case`session.reverted`:e.emit(`session.reverted`,t.sessionId,t.revertedTo,t.removed);break;case`session.forked`:e.emit(`session.forked`,t.originalSessionId,t.forkedSession,t.messages);break;case`session.state`:e.emit(`session.state`,t.sessionId,t.messages);break;case`message.created`:e.emit(`message.created`,t.message);break;case`message.updated`:e.emit(`message.updated`,t.message);break;case`part.created`:e.emit(`part.created`,t.sessionId,t.part);break;case`part.updated`:e.emit(`part.updated`,t.sessionId,t.part);break;case`part.append`:e.emit(`part.append`,t.sessionId,t.partId,t.field,t.delta);break;case`chat.usage`:e.emit(`chat.usage`,t.sessionId,t.usage,t.model,t.variant);break;case`compaction.complete`:e.emit(`compaction.complete`,t.sessionId,t.tokensUsed);break;case`permission.list`:e.emit(`permission.list`,t.workspaceId,t.grants);break;case`permission.revoked`:e.emit(`permission.revoked`,t.grantId);break;case`permission.all_revoked`:e.emit(`permission.all_revoked`,t.workspaceId,t.count);break;case`queue.list`:e.emit(`queue.list`,t.sessionId,t.messages);break;case`queue.added`:e.emit(`queue.added`,t.sessionId,t.message);break;case`queue.removed`:e.emit(`queue.removed`,t.sessionId,t.queueId);break;case`queue.sending`:e.emit(`queue.sending`,t.sessionId,t.queueId);break;case`provider.status`:e.emit(`provider.status`,t.provider,t.connected,t.authorizationUrl,t.error);break;case`provider.connected`:e.emit(`provider.connected`,t.provider,t.connected,t.connectedAt,t.accountId);break;case`ask.request`:e.emit(`ask.request`,t.sessionId,t.toolCallId,t.toolName,t.ask,t.requestId,t.authority);break;case`ask.response_rejected`:e.emit(`ask.response_rejected`,t.sessionId,t.toolCallId,t.requestId,t.code,t.message);break;case`ask.timeout`:e.emit(`ask.timeout`,t.sessionId,t.toolCallId,t.requestId);break;case`ask.pending_sync`:e.emit(`ask.pending_sync`,t.sessionId,t.requests);break;case`error`:e.emit(`error`,t.code,t.message);break;case`error.rate_limit`:e.emit(`error.rate_limit`,t.code,t.message,t.retryAfterMs),e.emit(`error`,t.code,t.message);break;case`error.server`:e.emit(`error.server`,t.code,t.message,t.retryAfterMs),e.emit(`error`,t.code,t.message);break;case`error.timeout`:e.emit(`error.timeout`,t.code,t.message,t.retryAfterMs),e.emit(`error`,t.code,t.message);break;case`error.auth`:e.emit(`error.auth`,t.code,t.message),e.emit(`error`,t.code,t.message);break;case`error.invalid_request`:e.emit(`error.invalid_request`,t.code,t.message),e.emit(`error`,t.code,t.message);break;case`error.context_overflow`:e.emit(`error.context_overflow`,t.code,t.message),e.emit(`error`,t.code,t.message);break;case`ping`:return;default:console.warn(`Unknown server message type: ${t.type}`);break}e.emit(`*`,{source:`server`,type:t.type,raw:t})}var o=class extends Error{constructor(e,t){super(e,t),this.name=`Jean2Error`}},s=class extends o{constructor(e,t){super(e,t),this.name=`ConnectionError`}},c=class extends o{constructor(e,t){super(e,t),this.name=`AuthError`}},l=class extends o{constructor(e,t,n){super(e,n),r(this,`retryAfterMs`,void 0),this.name=`RateLimitError`,this.retryAfterMs=t}},u=class extends o{constructor(e,t,n){super(e,n),r(this,`statusCode`,void 0),this.name=`ServerError`,this.statusCode=t}},d=class extends o{constructor(e,t=400,n){super(e,n),r(this,`statusCode`,void 0),this.name=`ValidationError`,this.statusCode=t}},f=class e{constructor(e){r(this,`_ws`,null),r(this,`config`,void 0),r(this,`_state`,`disconnected`),r(this,`onOpen`,null),r(this,`onMessage`,null),r(this,`onClose`,null),r(this,`onError`,null),r(this,`heartbeatTimer`,null),r(this,`missedHeartbeats`,0),this.config=e}async connect(){return new Promise((e,t)=>{var n,r;let i=(n=this.config.wsConstructor)==null?globalThis.WebSocket:n,a=this.buildWsUrl();this._state=`connecting`,this._ws=new i(a);let o=(r=this.config.connectionTimeout)==null?1e4:r,c=setTimeout(()=>{var e;(e=this._ws)==null||e.close(1e3,`Connection timeout`),t(new s(`Connection timeout (${o}ms)`))},o);this._ws.onopen=()=>{var t;clearTimeout(c),this._state=`connected`,this.startHeartbeatMonitor(),(t=this.onOpen)==null||t.call(this),e()},this._ws.onmessage=e=>{try{var t;let n=JSON.parse(String(e.data));if(n.type===`ping`){this.resetHeartbeat(),this.send({type:`pong`});return}this.resetHeartbeat(),(t=this.onMessage)==null||t.call(this,n)}catch(e){var n;let t=e instanceof Error?e.message:String(e);(n=this.onError)==null||n.call(this,Error(`Failed to parse WebSocket message: ${t}`))}},this._ws.onclose=e=>{var n;clearTimeout(c),this.stopHeartbeatMonitor(),this._state=`disconnected`,this._ws!==null&&t(new s(`Connection closed before open: code=${e.code}, reason=${e.reason}`)),this._ws=null,(n=this.onClose)==null||n.call(this,e.code,e.reason,e.wasClean)},this._ws.onerror=()=>{var e;clearTimeout(c),(e=this.onError)==null||e.call(this,Error(`WebSocket error`)),t(new s(`WebSocket error`))}})}send(e){if(!this._ws||this._ws.readyState!==WebSocket.OPEN)throw new s(`WebSocket is not connected`);this._ws.send(JSON.stringify(e))}async disconnect(){if(!this._ws)return;let e=this._ws;if(e.readyState===WebSocket.CLOSING||e.readyState===WebSocket.CLOSED){this._state=`disconnected`,this._ws=null;return}return new Promise(t=>{this._state=`disconnecting`;let n=()=>{e.removeEventListener(`close`,n),t()};e.addEventListener(`close`,n),e.close(1e3,`Client disconnect`)})}dispose(){this.stopHeartbeatMonitor(),this.onOpen=null,this.onMessage=null,this.onClose=null,this.onError=null,this._ws&&(this._ws.onopen=null,this._ws.onmessage=null,this._ws.onclose=null,this._ws.onerror=null,this._ws.close(),this._ws=null),this._state=`disconnected`}get connected(){return this._state===`connected`}get readyState(){var e,t;return(e=(t=this._ws)==null?void 0:t.readyState)==null?WebSocket.CLOSED:e}get ws(){return this._ws}resetHeartbeat(){this.missedHeartbeats=0}startHeartbeatMonitor(){this.stopHeartbeatMonitor(),this.missedHeartbeats=0,this.heartbeatTimer=setInterval(()=>{this.missedHeartbeats++,this.missedHeartbeats>=4&&(this.stopHeartbeatMonitor(),this._ws&&this._ws.close(1e3,`Heartbeat timeout`))},e.HEARTBEAT_TIMEOUT_MS)}stopHeartbeatMonitor(){this.heartbeatTimer!==null&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}buildWsUrl(){let e=this.config.url.startsWith(`https`)?`wss`:`ws`,t=this.config.url.replace(/^https?:\/\//,``);return this.config.token?`${e}://${t}/ws?token=${encodeURIComponent(this.config.token)}`:`${e}://${t}/ws`}};r(f,`HEARTBEAT_TIMEOUT_MS`,12e4);var p=class{constructor(e){r(this,`baseUrl`,void 0),r(this,`token`,void 0);let t=e.apiBase||`/api`;this.baseUrl=`${e.url.startsWith(`https`)?`https`:`http`}://${e.url.replace(/^https?:\/\//,``)}${t}`,this.token=e.token}async request(e,t={}){let{method:n=`GET`,body:r,headers:i={},signal:a,params:o}=t,s=`${this.baseUrl}${e}`;if(o){let e=new URLSearchParams(o);s+=`?${e.toString()}`}let f={...i};r!==void 0&&!(r instanceof FormData)&&(f[`Content-Type`]=`application/json`),this.token&&(f.Authorization=`Bearer ${this.token}`);let p=await fetch(s,{method:n,headers:f,body:r instanceof FormData?r:r?JSON.stringify(r):void 0,signal:a});if(p.status===401)throw new c(`Authentication failed. Your token may be invalid or expired.`);if(p.status===429){let e=p.headers.get(`Retry-After`);throw new l(`Too many requests`,e?parseInt(e,10)*1e3:void 0)}if(!p.ok){let e=`HTTP ${p.status}`;try{let t=await p.json();t.message&&(e=t.message)}catch{}throw p.status>=500?new u(e,p.status):new d(e,p.status)}let m=p.headers.get(`Content-Type`);return m!=null&&m.includes(`application/json`)?p.json():p}get(e,t){return this.request(e,{...t,method:`GET`})}post(e,t,n){return this.request(e,{...n,method:`POST`,body:t})}put(e,t,n){return this.request(e,{...n,method:`PUT`,body:t})}patch(e,t,n){return this.request(e,{...n,method:`PATCH`,body:t})}delete(e,t){return this.request(e,{...t,method:`DELETE`})}static async verifyToken(e,t){let n=e.startsWith(`https`)?`https`:`http`,r=e.replace(/^https?:\/\//,``);try{let e={};return t&&(e.Authorization=`Bearer ${t}`),(await fetch(`${n}://${r}/api/auth/verify`,{headers:e})).status===200}catch(e){throw new s(`Failed to reach server for auth verification: ${e instanceof Error?e.message:String(e)}`)}}},m=class{constructor(e){this.send=e}create(e){this.send({type:`session.create`,...e})}resume(e){this.send({type:`session.resume`,sessionId:e})}close(e){this.send({type:`session.close`,sessionId:e})}update(e,t){this.send({type:`session.update`,sessionId:e,...t})}updateModel(e,t){this.send({type:`session.update_model`,sessionId:e,...t})}reopen(e){this.send({type:`session.reopen`,sessionId:e})}delete(e){this.send({type:`session.delete`,sessionId:e})}rename(e,t){this.send({type:`session.rename`,sessionId:e,title:t})}compact(e){this.send({type:`session.compact`,sessionId:e})}revert(e,t){this.send({type:`session.revert`,sessionId:e,messageId:t})}fork(e,t,n){this.send({type:`session.fork`,sessionId:e,messageId:t,title:n})}interrupt(e,t){this.send({type:`session.interrupt`,sessionId:e,reason:t})}},h=class{constructor(e){this._send=e}send(e,t,n){let r={type:`chat.message`,sessionId:e,content:t};n!=null&&n.attachments&&n.attachments.length>0&&(r.attachments=n.attachments),this._send(r)}},g=class{constructor(e){this.send=e}list(e,t){this.send({type:`permission.list`,workspaceId:e,includeRevoked:t})}revoke(e){this.send({type:`permission.revoke`,grantId:e})}revokeAll(e){this.send({type:`permission.revoke_all`,workspaceId:e})}},_=class{constructor(e){this.send=e}add(e,t,n){let r=n;this.send({type:`queue.add`,sessionId:e,content:t,...r&&r.length>0?{attachments:r}:{}})}remove(e){this.send({type:`queue.remove`,queueId:e})}},v=class{constructor(e){this.send=e}connect(e){this.send({type:`provider.connect`,provider:e})}disconnect(e){this.send({type:`provider.disconnect`,provider:e})}},y=class{constructor(e){r(this,`send`,void 0),this.send=e}claim(e){this.send({type:`session.control.claim`,sessionId:e})}release(e){this.send({type:`session.control.release`,sessionId:e})}requestTakeover(e){this.send({type:`session.control.request_takeover`,sessionId:e})}respondTakeover(e,t,n){this.send({type:`session.control.respond_takeover`,sessionId:e,requesterClientId:t,decision:n})}},b={INPUT:1,RESIZE:2,CLOSE:3,OUTPUT:4,EXIT:5,ERROR:6,INIT_ACK:7,TITLE:8};function x(e,t){let n=new Uint8Array(1+t.length);return n[0]=e,n.set(t,1),n}var S=class extends i{constructor(e,t,n){super(),r(this,`ws`,void 0),r(this,`_session`,void 0),r(this,`_closed`,!1),r(this,`_disposed`,!1),r(this,`_preInitOutput`,[]),this.ws=e,this._session=t,n&&(this._preInitOutput=n),this.ws.binaryType=`arraybuffer`,this.ws.onmessage=this.handleMessage.bind(this),this.ws.onclose=this.handleClose.bind(this),this.ws.onerror=this.handleError.bind(this)}on(e,t){let n=super.on(e,t);return e===`output`&&this.flushPreInitOutput(),n}flushPreInitOutput(){if(this._preInitOutput.length===0)return;let e=this._preInitOutput;this._preInitOutput=[];for(let t of e){if(this._closed)break;this.emit(`output`,t)}}handleMessage(e){if(this._closed)return;let t=new Uint8Array(e.data);if(t.length<1)return;let n=t[0],r=t.slice(1);switch(n){case b.OUTPUT:this.emit(`output`,r);break;case b.EXIT:{let e=0;if(r.length>0)try{let t=JSON.parse(new TextDecoder().decode(r));e=typeof t.exitCode==`number`?t.exitCode:0}catch{e=0}this._session={...this._session,status:`exited`,exitCode:e},this.emit(`exit`,e);break}case b.TITLE:{let e=`Terminal`;if(r.length>0)try{let t=JSON.parse(new TextDecoder().decode(r));e=typeof t.title==`string`?t.title:`Terminal`}catch{e=`Terminal`}this._session={...this._session,title:e},this.emit(`title`,e);break}case b.ERROR:{let e=new TextDecoder().decode(r),t=Error(e||`Terminal error`);this.emit(`error`,t);break}case b.CLOSE:this.doClose();break;default:break}}handleClose(e){this._closed||(this._closed=!0,this.emit(`close`))}handleError(){if(!this._closed){let e=Error(`WebSocket error`);this.emit(`error`,e)}}doClose(){if(!this._closed){this._closed=!0;try{this.ws.close(1e3,`Client close`)}catch{}this.emit(`close`),this.cleanupHandlers()}}cleanupHandlers(){this._disposed||(this._disposed=!0,this.ws.onmessage=null,this.ws.onclose=null,this.ws.onerror=null)}dispatchFrame(e){this.handleMessage({data:e.buffer})}write(e){if(this._closed||this.ws.readyState!==WebSocket.OPEN)return;let t;t=typeof e==`string`?new TextEncoder().encode(e):e,this.ws.send(x(b.INPUT,t))}resize(e,t){if(this._closed||this.ws.readyState!==WebSocket.OPEN)return;let n=JSON.stringify({cols:e,rows:t}),r=new TextEncoder().encode(n);this.ws.send(x(b.RESIZE,r))}close(){this._closed||(this.ws.readyState===WebSocket.OPEN&&this.ws.send(x(b.CLOSE,new Uint8Array)),this.doClose())}dispose(){if(this.cleanupHandlers(),!this._closed){this._closed=!0;try{this.ws.close(1e3,`Disposed`)}catch{}}this.removeAllListeners()}get session(){return this._session}get sessionId(){return this._session.sessionId}get pid(){return this._session.pid}get cwd(){return this._session.cwd}get shell(){return this._session.shell}get cols(){return this._session.cols}get rows(){return this._session.rows}get title(){return this._session.title}get status(){return this._session.status}get exitCode(){return this._session.exitCode}get isReconnect(){return this._session.isReconnect}get closed(){return this._closed}},C=class extends i{constructor(e){super(),r(this,`ws`,void 0),r(this,`_closed`,!1),r(this,`_disposed`,!1),this.ws=e,this.ws.onmessage=this.handleMessage.bind(this),this.ws.onclose=this.handleClose.bind(this),this.ws.onerror=this.handleError.bind(this)}handleMessage(e){if(this._closed)return;let t=e.data;if(typeof t!=`string`)return;let n;try{n=JSON.parse(t)}catch{return}switch(n.type){case`snapshot`:this.emit(`snapshot`,n.sessions);break;case`created`:this.emit(`created`,n.session);break;case`destroyed`:this.emit(`destroyed`,n.sessionId);break;case`exited`:this.emit(`exited`,n.sessionId,n.exitCode);break;case`title_changed`:this.emit(`title_changed`,n.sessionId,n.title);break;case`status_changed`:this.emit(`status_changed`,n.sessionId,n.status);break}}handleClose(e){this._closed||(this._closed=!0,this.emit(`close`))}handleError(){if(!this._closed){let e=Error(`WebSocket error`);this.emit(`error`,e)}}close(){if(!this._closed){this._closed=!0;try{this.ws.close(1e3,`Client close`)}catch{}this.cleanupHandlers()}}dispose(){if(this.cleanupHandlers(),this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING)try{this.ws.close(1e3,`Disposed`)}catch{}this._closed||(this._closed=!0,this.emit(`close`)),this.removeAllListeners()}cleanupHandlers(){this._disposed||(this._disposed=!0,this.ws.onmessage=null,this.ws.onclose=null,this.ws.onerror=null)}get closed(){return this._closed}},w=class{constructor(e){r(this,`config`,void 0),this.config={connectTimeout:1e4,...e}}async connect(e){var t;let n=(t=this.config.wsConstructor)==null?globalThis.WebSocket:t,r=this.config.url.startsWith(`https`)?`wss`:`ws`,i=this.config.url.replace(/^https?:\/\//,``),a=new URLSearchParams({cwd:e.cwd,workspaceId:e.workspaceId});this.config.token&&a.set(`token`,this.config.token),e.shell&&a.set(`shell`,e.shell),e.sessionId&&a.set(`sessionId`,e.sessionId);let o=`${r}://${i}/ws/terminal?${a.toString()}`;return new Promise((e,t)=>{var r;let i=new n(o);i.binaryType=`arraybuffer`;let a=(r=this.config.connectTimeout)==null?1e4:r,c=!1,l=t=>{c||(c=!0,clearTimeout(d),e(t))},u=e=>{c||(c=!0,clearTimeout(d),t(e))},d=setTimeout(()=>{i.close(),u(new s(`Terminal connection timeout (${a}ms)`))},a);i.onopen=()=>{};let f=[];i.onmessage=e=>{let t=new Uint8Array(e.data);if(t.length<1)return;let n=t[0],r=t.slice(1);if(n===b.INIT_ACK)try{let e=new S(i,JSON.parse(new TextDecoder().decode(r)),f.filter(e=>e.opcode===b.OUTPUT).map(e=>e.data));for(let t of f)t.opcode!==b.OUTPUT&&e.dispatchFrame(t.data);l(e)}catch(e){i.close(),u(new s(`Failed to parse terminal init: ${e instanceof Error?e.message:String(e)}`))}else if(n===b.ERROR){i.close();let e=`Terminal connection failed`;try{e=JSON.parse(new TextDecoder().decode(r)).message||e}catch{}u(new s(e))}else f.push({opcode:n,data:t})},i.onerror=()=>{i.close(),u(new s(`Terminal WebSocket error`))},i.onclose=()=>{u(new s(`Terminal connection closed before init`))}})}async subscribeEvents(e){var t;let n=(t=this.config.wsConstructor)==null?globalThis.WebSocket:t,r=this.config.url.startsWith(`https`)?`wss`:`ws`,i=this.config.url.replace(/^https?:\/\//,``),a=new URLSearchParams({workspaceId:e});this.config.token&&a.set(`token`,this.config.token);let o=`${r}://${i}/ws/terminal/events?${a.toString()}`;return new Promise((e,t)=>{var r;let i=new n(o),a=(r=this.config.connectTimeout)==null?1e4:r,c=!1,l=t=>{c||(c=!0,clearTimeout(d),e(t))},u=e=>{c||(c=!0,clearTimeout(d),t(e))},d=setTimeout(()=>{i.close(),u(new s(`Terminal events subscription timeout (${a}ms)`))},a);i.onopen=()=>{};let f=null;i.onmessage=e=>{if(c)return;let t=e.data;if(typeof t!=`string`)return;let n;try{n=JSON.parse(t)}catch{return}n.type===`snapshot`&&(f||(f=new C(i)),l({conn:f,initialSessions:n.sessions}))},i.onerror=()=>{i.close(),u(new s(`Terminal events WebSocket error`))},i.onclose=()=>{c||u(new s(`Terminal events connection closed before snapshot`))}})}},T=class{constructor(e){this.http=e}async list(e){return this.http.get(`/sessions`,{params:e!=null&&e.status?{status:e.status}:void 0,signal:e==null?void 0:e.signal})}async create(e){let{signal:t,...n}=e==null?{}:e;return this.http.post(`/sessions`,n,{signal:t})}async get(e,t){return this.http.get(`/sessions/${encodeURIComponent(e)}`,{signal:t==null?void 0:t.signal})}async update(e,t,n){return this.http.put(`/sessions/${encodeURIComponent(e)}`,t,{signal:n==null?void 0:n.signal})}async delete(e,t){return this.http.delete(`/sessions/${encodeURIComponent(e)}`,{signal:t==null?void 0:t.signal})}async listMessages(e,t){return this.http.get(`/sessions/${encodeURIComponent(e)}/messages`,{signal:t==null?void 0:t.signal})}async listGrouped(e){let t={workspaceIds:e.workspaceIds.join(`,`)};return e.status&&(t.status=e.status),e.rootOnly&&(t.rootOnly=`true`),this.http.get(`/sessions/grouped`,{params:t,signal:e.signal})}async listByWorkspace(e){let t={};return e.status&&(t.status=e.status),e.rootOnly&&(t.rootOnly=`true`),this.http.get(`/workspaces/${encodeURIComponent(e.workspaceId)}/sessions`,{params:t,signal:e.signal})}},E=class{constructor(e){this.http=e}async list(e){return this.http.get(`/workspaces`,{signal:e==null?void 0:e.signal})}async create(e){let{signal:t,...n}=e==null?{}:e;return this.http.post(`/workspaces`,n,{signal:t})}async get(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}`,{signal:t==null?void 0:t.signal})}async update(e,t,n){return this.http.patch(`/workspaces/${encodeURIComponent(e)}`,t,{signal:n==null?void 0:n.signal})}async delete(e,t){return this.http.delete(`/workspaces/${encodeURIComponent(e)}`,{signal:t==null?void 0:t.signal})}async listSessions(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/sessions`,{signal:t==null?void 0:t.signal})}},D=class{constructor(e){this.http=e}async list(e){return this.http.get(`/models`,{signal:e==null?void 0:e.signal})}},O=class{constructor(e){this.http=e}async list(e){return this.http.get(`/tools`,{signal:e==null?void 0:e.signal})}async get(e,t){return this.http.get(`/tools/${encodeURIComponent(e)}`,{signal:t==null?void 0:t.signal})}async listEnvVars(e){return this.http.get(`/tools/env`,{signal:e==null?void 0:e.signal})}async setEnvVar(e,t,n){return this.http.put(`/tools/env/${encodeURIComponent(e)}`,t,{signal:n==null?void 0:n.signal})}async clearEnvVar(e,t){return this.http.delete(`/tools/env/${encodeURIComponent(e)}`,{signal:t==null?void 0:t.signal})}},k=class{constructor(e){this.http=e}async list(e){return this.http.get(`/providers`,{signal:e==null?void 0:e.signal})}async getStatus(e,t){return this.http.get(`/providers/${encodeURIComponent(e)}/status`,{signal:t==null?void 0:t.signal})}async connect(e,t){return this.http.post(`/providers/${encodeURIComponent(e)}/connect`,void 0,{signal:t==null?void 0:t.signal})}async disconnect(e,t){return this.http.delete(`/providers/${encodeURIComponent(e)}`,{signal:t==null?void 0:t.signal})}async listCredentials(e){return this.http.get(`/config/providers`,{signal:e==null?void 0:e.signal})}async setCredential(e,t,n){return this.http.put(`/config/providers/${encodeURIComponent(e)}`,t,{signal:n==null?void 0:n.signal})}async clearCredential(e,t){return this.http.delete(`/config/providers/${encodeURIComponent(e)}`,{signal:t==null?void 0:t.signal})}},A=class{constructor(e){this.http=e}async list(e){return this.http.get(`/preconfigs`,{signal:e==null?void 0:e.signal})}async create(e){let{signal:t,...n}=e==null?{}:e;return this.http.post(`/preconfigs`,n,{signal:t})}async get(e,t){return this.http.get(`/preconfigs/${encodeURIComponent(e)}`,{signal:t==null?void 0:t.signal})}async update(e,t,n){return this.http.put(`/preconfigs/${encodeURIComponent(e)}`,t,{signal:n==null?void 0:n.signal})}async delete(e,t){return this.http.delete(`/preconfigs/${encodeURIComponent(e)}`,{signal:t==null?void 0:t.signal})}},j=class{constructor(e){this.http=e}async list(e){return this.http.get(`/prompts`,{signal:e==null?void 0:e.signal})}},M=class{constructor(e){this.http=e}async browse(e,t,n){let r={};return t!==void 0&&(r.path=t),(n==null?void 0:n.showHidden)!==void 0&&(r.showHidden=String(n.showHidden)),(n==null?void 0:n.limit)!==void 0&&(r.limit=String(n.limit)),this.http.get(`/workspaces/${encodeURIComponent(e)}/files`,{params:Object.keys(r).length>0?r:void 0,signal:n==null?void 0:n.signal})}async search(e,t,n){let r={search:t};return(n==null?void 0:n.limit)!==void 0&&(r.limit=String(n.limit)),(n==null?void 0:n.showHidden)!==void 0&&(r.showHidden=String(n.showHidden)),this.http.get(`/workspaces/${encodeURIComponent(e)}/files`,{params:r,signal:n==null?void 0:n.signal})}async preview(e,t,n){return this.http.get(`/workspaces/${encodeURIComponent(e)}/file-preview`,{params:{path:t},signal:n==null?void 0:n.signal})}async browseFs(e,t){return this.http.get(`/fs/browse`,{params:e===void 0?void 0:{path:e},signal:t==null?void 0:t.signal})}async parent(e,t){return this.http.get(`/fs/parent`,{params:{path:e},signal:t==null?void 0:t.signal})}async drives(e){return this.http.get(`/fs/drives`,{signal:e==null?void 0:e.signal})}},N=class{constructor(e){this.http=e}async list(e,t){return this.http.get(`/sessions/${encodeURIComponent(e)}/attachments`,{signal:t==null?void 0:t.signal})}async upload(e,t,n){let r=new FormData;r.append(`file`,t);let{signal:i}=n==null?{}:n;return this.http.post(`/sessions/${encodeURIComponent(e)}/attachments`,r,{signal:i})}getUrl(e,t,n){return`/api/sessions/${encodeURIComponent(e)}/attachments/${encodeURIComponent(t)}/content?key=${encodeURIComponent(n)}`}},P=class{constructor(e){this.http=e}async list(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/terminals`,{signal:t==null?void 0:t.signal})}async create(e,t){let{signal:n,body:r}=t==null?{}:t;return this.http.post(`/workspaces/${encodeURIComponent(e)}/terminals`,r==null?{}:r,{signal:n})}async get(e,t,n){return this.http.get(`/workspaces/${encodeURIComponent(e)}/terminals/${encodeURIComponent(t)}`,{signal:n==null?void 0:n.signal})}async delete(e,t,n){return this.http.delete(`/workspaces/${encodeURIComponent(e)}/terminals/${encodeURIComponent(t)}`,{signal:n==null?void 0:n.signal})}},F=class{constructor(e){this.http=e}async getStatus(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/mcp/status`,{signal:t==null?void 0:t.signal})}async connect(e,t,n){let{signal:r}=n==null?{}:n;return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/connect`,{name:t},{signal:r})}async disconnect(e,t,n){let{signal:r}=n==null?{}:n;return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/disconnect`,{name:t},{signal:r})}async startAuth(e,t,n){let{signal:r}=n==null?{}:n;return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/auth`,{name:t},{signal:r})}async finishAuth(e,t,n,r){let{signal:i}=r==null?{}:r;return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/auth/callback`,{name:t,code:n},{signal:i})}},I=class{constructor(e){this.http=e}async get(e){return this.http.get(`/config/models`,{signal:e==null?void 0:e.signal})}async createProvider(e,t){return this.http.post(`/config/models/providers`,e,{signal:t==null?void 0:t.signal})}async updateProvider(e,t,n){return this.http.put(`/config/models/providers/${encodeURIComponent(e)}`,t,{signal:n==null?void 0:n.signal})}async deleteProvider(e,t){return this.http.delete(`/config/models/providers/${encodeURIComponent(e)}`,{signal:t==null?void 0:t.signal})}async createModel(e,t,n){return this.http.post(`/config/models/providers/${encodeURIComponent(e)}/models`,t,{signal:n==null?void 0:n.signal})}async updateModel(e,t,n,r){return this.http.put(`/config/models/providers/${encodeURIComponent(e)}/models/${encodeURIComponent(t)}`,n,{signal:r==null?void 0:r.signal})}async deleteModel(e,t,n){return this.http.delete(`/config/models/providers/${encodeURIComponent(e)}/models/${encodeURIComponent(t)}`,{signal:n==null?void 0:n.signal})}async setDefaults(e,t){return this.http.put(`/config/models/defaults`,e,{signal:t==null?void 0:t.signal})}},L=class{constructor(e){this.http=e}async list(e){return this.http.get(`/config/prompts`,{signal:e==null?void 0:e.signal})}async get(e,t){return this.http.get(`/config/prompts/${encodeURIComponent(e)}`,{signal:t==null?void 0:t.signal})}async create(e,t){return this.http.post(`/config/prompts`,e,{signal:t==null?void 0:t.signal})}async update(e,t,n){return this.http.put(`/config/prompts/${encodeURIComponent(e)}`,t,{signal:n==null?void 0:n.signal})}async delete(e,t){return this.http.delete(`/config/prompts/${encodeURIComponent(e)}`,{signal:t==null?void 0:t.signal})}},R=class{constructor(e){r(this,`models`,void 0),r(this,`prompts`,void 0),this.models=new I(e),this.prompts=new L(e)}},z=class{constructor(e){r(this,`sessions`,void 0),r(this,`workspaces`,void 0),r(this,`models`,void 0),r(this,`tools`,void 0),r(this,`providers`,void 0),r(this,`preconfigs`,void 0),r(this,`prompts`,void 0),r(this,`files`,void 0),r(this,`attachments`,void 0),r(this,`terminals`,void 0),r(this,`mcp`,void 0),r(this,`config`,void 0),this.sessions=new T(e),this.workspaces=new E(e),this.models=new D(e),this.tools=new O(e),this.providers=new k(e),this.preconfigs=new A(e),this.prompts=new j(e),this.files=new M(e),this.attachments=new N(e),this.terminals=new P(e),this.mcp=new F(e),this.config=new R(e)}async loadAll(e){let[t,n,r,i,a]=await Promise.all([this.workspaces.list(e),this.preconfigs.list(e),this.prompts.list(e),this.models.list(e),this.providers.list(e)]);return{workspaces:t.workspaces,preconfigs:n.preconfigs,prompts:r.prompts,models:i.models,defaultModel:i.defaultModel,defaultProvider:i.defaultProvider,providers:a.providers}}},B=class extends i{constructor(e){super(),r(this,`config`,void 0),r(this,`transport`,void 0),r(this,`_httpClient`,void 0),r(this,`_state`,`disconnected`),r(this,`_connectionId`,null),r(this,`_registeredClient`,null),r(this,`sessions`,void 0),r(this,`chat`,void 0),r(this,`permissions`,void 0),r(this,`queue`,void 0),r(this,`providers`,void 0),r(this,`control`,void 0),r(this,`http`,void 0),r(this,`terminal`,void 0),this.config=e,this.transport=new f({url:e.url,token:e.token,wsConstructor:e.wsConstructor,connectionTimeout:e.connectionTimeout}),this._httpClient=new p({url:e.url,token:e.token,apiBase:e.apiBase});let t=this.transport.send.bind(this.transport);this.sessions=new m(t),this.chat=new h(t),this.permissions=new g(t),this.queue=new _(t),this.providers=new v(t),this.control=new y(t),this.http=new z(this._httpClient),this.terminal=new w({url:e.url,token:e.token,wsConstructor:e.wsConstructor}),this.transport.onOpen=()=>{this._state=`connected`,this._connectionId=null,this._registeredClient=null,this.config.clientDescriptor&&this.send({type:`client.register`,client:this.config.clientDescriptor}),this.emit(`connected`),this.emit(`*`,{source:`lifecycle`,type:`connected`,payload:void 0})},this.transport.onMessage=e=>{e.type===`client.registered`&&(this._connectionId=e.connectionId,this._registeredClient=e.client),a(this,e)},this.transport.onClose=(e,t,n)=>{let r=this._state;this._state=`disconnected`,r!==`disconnected`&&(this.emit(`disconnected`,{code:e,reason:t,wasClean:n}),this.emit(`*`,{source:`lifecycle`,type:`disconnected`,payload:{code:e,reason:t,wasClean:n}}))},this.transport.onError=e=>{this.emit(`error.connection`,e),this.emit(`*`,{source:`lifecycle`,type:`error.connection`,payload:e})}}async connect(){this._state=`connecting`,await this.transport.connect()}async disconnect(){this._state=`disconnecting`,await this.transport.disconnect()}async dispose(){await this.disconnect(),this.transport.dispose(),this.removeAllListeners()}get state(){return this._state}get connected(){return this._state===`connected`}get ws(){return this.transport.ws}get httpClient(){return this._httpClient}get connectionId(){return this._connectionId}get registeredClient(){return this._registeredClient}get clientId(){var e,t;return(e=(t=this._registeredClient)==null?void 0:t.clientId)==null?null:e}send(e){this.transport.send(e)}};export{z as n,p as r,B as t};
@@ -1 +0,0 @@
1
- import{o as e,r as t}from"./compiler-runtime-DZXZ41-q.js";import{t as n}from"./useRouter-C67ywEA3.js";var r=e(t(),1);function i(e){let t=n();return r.useCallback(n=>{var r;return t.navigate({...n,from:(r=n.from)==null?e==null?void 0:e.from:r})},[e==null?void 0:e.from,t])}export{i as t};