@inkeep/open-knowledge 0.0.0-dev-20260427224203 → 0.0.0-dev-20260428024726

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 (47) hide show
  1. package/dist/cli.mjs +4 -4
  2. package/dist/constants-Bypdthtt.mjs +2 -0
  3. package/dist/{dist-BWvkug8h.mjs → dist-BW0CmwMf.mjs} +2 -2
  4. package/dist/{dist-Bx5GgBdJ.mjs → dist-CUNdZ2_C.mjs} +1 -1
  5. package/dist/index.mjs +1 -1
  6. package/dist/init-C9NcluI6.mjs +1 -0
  7. package/dist/{init-BqrZVrrc.mjs → init-DT5HolXi.mjs} +3 -3
  8. package/dist/init-GJP2EVzJ.mjs +1 -0
  9. package/dist/{init-DG1atKPS.mjs → init-rEg7vsQo.mjs} +2 -2
  10. package/dist/{loader-2_9PfZaf.mjs → loader-G-_WDqR0.mjs} +2 -2
  11. package/dist/loader-LG3X7RJ0.mjs +1 -0
  12. package/dist/paths-DfUzFdTC.mjs +1 -0
  13. package/dist/{paths-B-e6l9Cv.mjs → paths-YqCzdIxh.mjs} +2 -2
  14. package/dist/preview-1YeKX_ki.mjs +1 -0
  15. package/dist/{preview-B01l8vaj.mjs → preview-ByA3Zxgf.mjs} +2 -2
  16. package/dist/public/assets/{ActivityModeContent-DEirlK4U.js → ActivityModeContent-QSE28ToP.js} +1 -1
  17. package/dist/public/assets/DocumentContext-C7zXwLGg.js +5 -0
  18. package/dist/public/assets/{GraphPanel-BkWSPzhS.js → GraphPanel-B9s5n-VJ.js} +1 -1
  19. package/dist/public/assets/McpConsentDialogBody-FBruOF3J.js +1 -0
  20. package/dist/public/assets/{PageListContext-BeAv6YTY.js → PageListContext-DNRRECTw.js} +21 -21
  21. package/dist/public/assets/{SourceEditor-CZP0vn5G.js → SourceEditor-B5_U1uud.js} +1 -1
  22. package/dist/public/assets/{agent-presence-DBKMYj1x.js → agent-presence-CN4nWhyr.js} +1 -1
  23. package/dist/public/assets/{button-B1XQHQcX.js → button-BPXuMr5W.js} +1 -1
  24. package/dist/public/assets/{clipboard-DQ6xQqEq.js → clipboard-BcHcwwH2.js} +1 -1
  25. package/dist/public/assets/{dialog-BFKTD2mP.js → dialog-CtSN0d2b.js} +2 -2
  26. package/dist/public/assets/index-Bw1KsDm4.css +1 -0
  27. package/dist/public/assets/index-CfLPPlu0.js +1843 -0
  28. package/dist/public/assets/{panel-rtdrPcLu.js → panel-BCRdtBla.js} +1 -1
  29. package/dist/public/assets/{toggle-group-C2g3gOrt.js → toggle-group-akWK7-wE.js} +1 -1
  30. package/dist/public/assets/{tooltip-D180uIJr.js → tooltip-nCu_fYrg.js} +1 -1
  31. package/dist/public/index.html +11 -11
  32. package/dist/src-5CKdfahI.mjs +1 -0
  33. package/dist/{start-iqLai80L.mjs → start-BXOGxEm7.mjs} +2 -2
  34. package/dist/start-DJ47R0B2.mjs +1 -0
  35. package/package.json +1 -1
  36. package/dist/constants-BYPRF6Xi.mjs +0 -2
  37. package/dist/init-DGI17ChL.mjs +0 -1
  38. package/dist/init-XE8qwnlF.mjs +0 -1
  39. package/dist/loader-CI-6Alpn.mjs +0 -1
  40. package/dist/paths-BtikHzQ1.mjs +0 -1
  41. package/dist/preview-B9E3uOhO.mjs +0 -1
  42. package/dist/public/assets/DocumentContext-C1QoSdgU.js +0 -5
  43. package/dist/public/assets/McpConsentDialogBody-BFq9W9ap.js +0 -1
  44. package/dist/public/assets/index-C7ubYQQH.css +0 -1
  45. package/dist/public/assets/index-CQCwZ-Zo.js +0 -1843
  46. package/dist/src-Bg5pxSQA.mjs +0 -1
  47. package/dist/start-Cb3q8ycm.mjs +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{n as i}from"./button-B1XQHQcX.js";var a=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(){}},o=new class extends a{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},s={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},c=new class{#e=s;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function l(e){setTimeout(e,0)}var u=typeof window>`u`||`Deno`in globalThis;function d(){}function f(e,t){return typeof e==`function`?e(t):e}function p(e){return typeof e==`number`&&e>=0&&e!==1/0}function m(e,t){return Math.max(e+(t||0)-Date.now(),0)}function h(e,t){return typeof e==`function`?e(t):e}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==y(o,t.options))return!1}else if(!x(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 v(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(b(t.options.mutationKey)!==b(a))return!1}else if(!x(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function y(e,t){return(t?.queryKeyHashFn||b)(e)}function b(e){return JSON.stringify(e,(e,t)=>E(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function x(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>x(e[n],t[n])):!1}var S=Object.prototype.hasOwnProperty;function C(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=T(e)&&T(t);if(!r&&!(E(e)&&E(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:S.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=C(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function w(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 T(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function E(e){if(!D(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!D(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function D(e){return Object.prototype.toString.call(e)===`[object Object]`}function ee(e){return new Promise(t=>{c.setTimeout(t,e)})}function O(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:C(e,t)}function te(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ne(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var k=Symbol();function A(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===k?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function j(e,t){return typeof e==`function`?e(...t):!!e}function re(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var M=(()=>{let e=()=>u;return{isServer(){return e()},setIsServer(t){e=t}}})();function N(){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 ie=l;function ae(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ie,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 P=ae(),F=new class extends a{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function oe(e){return Math.min(1e3*2**e,3e4)}function I(e){return(e??`online`)===`online`?F.isOnline():!0}var L=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function R(e){let t=!1,n=0,r,i=N(),a=()=>i.status!==`pending`,s=t=>{if(!a()){let n=new L(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>o.isFocused()&&(e.networkMode===`always`||F.isOnline())&&e.canRun(),d=()=>I(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(M.isServer()?0:3),o=e.retryDelay??oe,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ee(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var z=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),p(this.gcTime)&&(this.#e=c.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(M.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(c.clearTimeout(this.#e),this.#e=void 0)}},se=class extends z{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=H(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=H(this.options);e.data!==void 0&&(this.setState(V(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=O(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(d).catch(d):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>g(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===k||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>h(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:!m(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=A(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=R({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof L&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof L){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(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`:return{...t,...B(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...V(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),P.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function B(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:I(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function V(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function H(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ce=class extends a{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=N(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),U(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return W(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return W(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof g(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!w(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&G(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||h(this.options.staleTime,this.#t)!==h(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ue(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(d)),t}#g(){this.#b();let e=h(this.options.staleTime,this.#t);if(M.isServer()||this.#r.isStale||!p(e))return;let t=m(this.#r.dataUpdatedAt,e)+1;this.#d=c.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(M.isServer()||g(this.options.enabled,this.#t)===!1||!p(this.#p)||this.#p===0)&&(this.#f=c.setInterval(()=>{(this.options.refetchIntervalInBackground||o.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(c.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(c.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&U(e,t),o=i&&G(e,n,t,r);(a||o)&&(l={...l,...B(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=O(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=O(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let _=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&_,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:K(e,t),refetch:this.refetch,promise:this.#o,isEnabled:g(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{i(this.#o=S.promise=N())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!w(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){P.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function le(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function U(e,t){return le(e,t)||e.state.data!==void 0&&W(e,t,t.refetchOnMount)}function W(e,t,n){if(g(t.enabled,e)!==!1&&h(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&K(e,t)}return!1}function G(e,t,n,r){return(e!==t||g(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&K(e,n)}function K(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(h(t.staleTime,e))}function ue(e,t){return!w(e.getCurrentResult(),t)}var q=e(t(),1),J=n(),Y=q.createContext(void 0),X=e=>{let t=q.useContext(Y);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},de=({client:e,children:t})=>(q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,J.jsx)(Y.Provider,{value:e,children:t})),fe=q.createContext(!1),pe=()=>q.useContext(fe);fe.Provider;function me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var he=q.createContext(me()),ge=()=>q.useContext(he),_e=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?j(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},ve=e=>{q.useEffect(()=>{e.clearReset()},[e])},ye=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||j(n,[e.error,r])),be=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},xe=(e,t)=>e.isLoading&&e.isFetching&&!t,Se=(e,t)=>e?.suspense&&t.isPending,Ce=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function we(e,t,n){let r=pe(),i=ge(),a=X(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,be(o),_e(o,i,s),ve(i);let c=!a.getQueryCache().get(o.queryHash),[l]=q.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),f=!r&&e.subscribed!==!1;if(q.useSyncExternalStore(q.useCallback(e=>{let t=f?l.subscribe(P.batchCalls(e)):d;return l.updateResult(),t},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),q.useEffect(()=>{l.setOptions(o)},[o,l]),Se(o,u))throw Ce(o,l,i);if(ye({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!M.isServer()&&xe(u,r)&&(c?Ce(o,l,i):s?.promise)?.catch(d).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function Te(e,t){return we(e,ce,t)}var Ee=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},De=[`light`,`dark`],Oe=`(prefers-color-scheme: dark)`,ke=typeof window>`u`,Z=q.createContext(void 0),Ae={setTheme:e=>{},themes:[]},je=()=>q.useContext(Z)??Ae,Me=e=>q.useContext(Z)?q.createElement(q.Fragment,null,e.children):q.createElement(Pe,{...e}),Ne=[`light`,`dark`],Pe=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=Ne,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=q.useState(()=>Ie(i,o)),[m,h]=q.useState(()=>f===`system`?Q():f),g=c?Object.values(c):a,_=q.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=Q());let a=c?c[i]:i,l=t?Le(u):null,d=document.documentElement,f=e=>{e===`class`?(d.classList.remove(...g),a&&d.classList.add(a)):e.startsWith(`data-`)&&(a?d.setAttribute(e,a):d.removeAttribute(e))};if(Array.isArray(s)?s.forEach(f):f(s),r){let e=De.includes(o)?o:null,t=De.includes(i)?i:e;d.style.colorScheme=t}l?.()},[u]),v=q.useCallback(e=>{let t=typeof e==`function`?e(f):e;p(t);try{localStorage.setItem(i,t)}catch{}},[f]),y=q.useCallback(t=>{h(Q(t)),f===`system`&&n&&!e&&_(`system`)},[f,e]);q.useEffect(()=>{let e=window.matchMedia(Oe);return e.addListener(y),y(e),()=>e.removeListener(y)},[y]),q.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?p(e.newValue):v(o))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[v]),q.useEffect(()=>{_(e??f)},[e,f]);let b=q.useMemo(()=>({theme:f,setTheme:v,forcedTheme:e,resolvedTheme:f===`system`?m:f,themes:n?[...a,`system`]:a,systemTheme:n?m:void 0}),[f,v,e,m,n,a]);return q.createElement(Z.Provider,{value:b},q.createElement(Fe,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},Fe=q.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return q.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${Ee.toString()})(${u})`}})}),Ie=(e,t)=>{if(ke)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},Le=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Q=e=>(e||=window.matchMedia(Oe),e.matches?`dark`:`light`),$=r();function Re(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`flex h-full min-h-0 flex-col`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`section`,{"data-slot":`panel`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function ze(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`shrink-0 flex items-center justify-between px-4 py-3`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`div`,{"data-slot":`panel-header`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Be(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm font-medium uppercase font-mono tracking-wider text-muted-foreground`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`h2`,{"data-slot":`panel-title`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ve(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-xs text-muted-foreground font-mono bg-muted-foreground/5 rounded-md px-2 py-1`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-count`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function He(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`subtle-scrollbar min-h-0 flex-1 overflow-y-auto px-4 py-3`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`div`,{"data-slot":`panel-body`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ue(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm text-muted-foreground/60`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-empty`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function We(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm text-destructive`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-error`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}export{k as A,b as C,d as D,_ as E,a as M,x as O,f as S,v as T,P as _,We as a,ne as b,Me as c,de as d,X as f,F as g,R as h,Ue as i,o as j,h as k,je as l,z as m,He as n,ze as o,se as p,Ve as r,Be as s,Re as t,Te as u,re as v,y as w,A as x,te as y};
1
+ import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{n as i}from"./button-BPXuMr5W.js";var a=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(){}},o=new class extends a{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},s={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},c=new class{#e=s;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function l(e){setTimeout(e,0)}var u=typeof window>`u`||`Deno`in globalThis;function d(){}function f(e,t){return typeof e==`function`?e(t):e}function p(e){return typeof e==`number`&&e>=0&&e!==1/0}function m(e,t){return Math.max(e+(t||0)-Date.now(),0)}function h(e,t){return typeof e==`function`?e(t):e}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==y(o,t.options))return!1}else if(!x(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 v(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(b(t.options.mutationKey)!==b(a))return!1}else if(!x(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function y(e,t){return(t?.queryKeyHashFn||b)(e)}function b(e){return JSON.stringify(e,(e,t)=>E(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function x(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>x(e[n],t[n])):!1}var S=Object.prototype.hasOwnProperty;function C(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=T(e)&&T(t);if(!r&&!(E(e)&&E(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:S.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=C(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function w(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 T(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function E(e){if(!D(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!D(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function D(e){return Object.prototype.toString.call(e)===`[object Object]`}function ee(e){return new Promise(t=>{c.setTimeout(t,e)})}function O(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:C(e,t)}function te(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ne(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var k=Symbol();function A(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===k?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function j(e,t){return typeof e==`function`?e(...t):!!e}function re(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var M=(()=>{let e=()=>u;return{isServer(){return e()},setIsServer(t){e=t}}})();function N(){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 ie=l;function ae(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ie,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 P=ae(),F=new class extends a{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function oe(e){return Math.min(1e3*2**e,3e4)}function I(e){return(e??`online`)===`online`?F.isOnline():!0}var L=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function R(e){let t=!1,n=0,r,i=N(),a=()=>i.status!==`pending`,s=t=>{if(!a()){let n=new L(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>o.isFocused()&&(e.networkMode===`always`||F.isOnline())&&e.canRun(),d=()=>I(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(M.isServer()?0:3),o=e.retryDelay??oe,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ee(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var z=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),p(this.gcTime)&&(this.#e=c.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(M.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(c.clearTimeout(this.#e),this.#e=void 0)}},se=class extends z{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=H(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=H(this.options);e.data!==void 0&&(this.setState(V(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=O(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(d).catch(d):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>g(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===k||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>h(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:!m(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=A(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=R({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof L&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof L){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(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`:return{...t,...B(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...V(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),P.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function B(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:I(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function V(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function H(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ce=class extends a{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=N(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),U(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return W(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return W(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof g(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!w(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&G(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||h(this.options.staleTime,this.#t)!==h(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ue(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(d)),t}#g(){this.#b();let e=h(this.options.staleTime,this.#t);if(M.isServer()||this.#r.isStale||!p(e))return;let t=m(this.#r.dataUpdatedAt,e)+1;this.#d=c.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(M.isServer()||g(this.options.enabled,this.#t)===!1||!p(this.#p)||this.#p===0)&&(this.#f=c.setInterval(()=>{(this.options.refetchIntervalInBackground||o.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(c.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(c.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&U(e,t),o=i&&G(e,n,t,r);(a||o)&&(l={...l,...B(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=O(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=O(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let _=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&_,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:K(e,t),refetch:this.refetch,promise:this.#o,isEnabled:g(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{i(this.#o=S.promise=N())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!w(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){P.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function le(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function U(e,t){return le(e,t)||e.state.data!==void 0&&W(e,t,t.refetchOnMount)}function W(e,t,n){if(g(t.enabled,e)!==!1&&h(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&K(e,t)}return!1}function G(e,t,n,r){return(e!==t||g(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&K(e,n)}function K(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(h(t.staleTime,e))}function ue(e,t){return!w(e.getCurrentResult(),t)}var q=e(t(),1),J=n(),Y=q.createContext(void 0),X=e=>{let t=q.useContext(Y);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},de=({client:e,children:t})=>(q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,J.jsx)(Y.Provider,{value:e,children:t})),fe=q.createContext(!1),pe=()=>q.useContext(fe);fe.Provider;function me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var he=q.createContext(me()),ge=()=>q.useContext(he),_e=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?j(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},ve=e=>{q.useEffect(()=>{e.clearReset()},[e])},ye=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||j(n,[e.error,r])),be=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},xe=(e,t)=>e.isLoading&&e.isFetching&&!t,Se=(e,t)=>e?.suspense&&t.isPending,Ce=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function we(e,t,n){let r=pe(),i=ge(),a=X(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,be(o),_e(o,i,s),ve(i);let c=!a.getQueryCache().get(o.queryHash),[l]=q.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),f=!r&&e.subscribed!==!1;if(q.useSyncExternalStore(q.useCallback(e=>{let t=f?l.subscribe(P.batchCalls(e)):d;return l.updateResult(),t},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),q.useEffect(()=>{l.setOptions(o)},[o,l]),Se(o,u))throw Ce(o,l,i);if(ye({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!M.isServer()&&xe(u,r)&&(c?Ce(o,l,i):s?.promise)?.catch(d).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function Te(e,t){return we(e,ce,t)}var Ee=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},De=[`light`,`dark`],Oe=`(prefers-color-scheme: dark)`,ke=typeof window>`u`,Z=q.createContext(void 0),Ae={setTheme:e=>{},themes:[]},je=()=>q.useContext(Z)??Ae,Me=e=>q.useContext(Z)?q.createElement(q.Fragment,null,e.children):q.createElement(Pe,{...e}),Ne=[`light`,`dark`],Pe=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=Ne,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=q.useState(()=>Ie(i,o)),[m,h]=q.useState(()=>f===`system`?Q():f),g=c?Object.values(c):a,_=q.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=Q());let a=c?c[i]:i,l=t?Le(u):null,d=document.documentElement,f=e=>{e===`class`?(d.classList.remove(...g),a&&d.classList.add(a)):e.startsWith(`data-`)&&(a?d.setAttribute(e,a):d.removeAttribute(e))};if(Array.isArray(s)?s.forEach(f):f(s),r){let e=De.includes(o)?o:null,t=De.includes(i)?i:e;d.style.colorScheme=t}l?.()},[u]),v=q.useCallback(e=>{let t=typeof e==`function`?e(f):e;p(t);try{localStorage.setItem(i,t)}catch{}},[f]),y=q.useCallback(t=>{h(Q(t)),f===`system`&&n&&!e&&_(`system`)},[f,e]);q.useEffect(()=>{let e=window.matchMedia(Oe);return e.addListener(y),y(e),()=>e.removeListener(y)},[y]),q.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?p(e.newValue):v(o))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[v]),q.useEffect(()=>{_(e??f)},[e,f]);let b=q.useMemo(()=>({theme:f,setTheme:v,forcedTheme:e,resolvedTheme:f===`system`?m:f,themes:n?[...a,`system`]:a,systemTheme:n?m:void 0}),[f,v,e,m,n,a]);return q.createElement(Z.Provider,{value:b},q.createElement(Fe,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},Fe=q.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return q.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${Ee.toString()})(${u})`}})}),Ie=(e,t)=>{if(ke)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},Le=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Q=e=>(e||=window.matchMedia(Oe),e.matches?`dark`:`light`),$=r();function Re(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`flex h-full min-h-0 flex-col`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`section`,{"data-slot":`panel`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function ze(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`shrink-0 flex items-center justify-between px-4 py-3`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`div`,{"data-slot":`panel-header`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Be(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm font-medium uppercase font-mono tracking-wider text-muted-foreground`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`h2`,{"data-slot":`panel-title`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ve(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-xs text-muted-foreground font-mono bg-muted-foreground/5 rounded-md px-2 py-1`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-count`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function He(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`subtle-scrollbar min-h-0 flex-1 overflow-y-auto px-4 py-3`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`div`,{"data-slot":`panel-body`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ue(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm text-muted-foreground/60`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-empty`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function We(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm text-destructive`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-error`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}export{k as A,b as C,d as D,_ as E,a as M,x as O,f as S,v as T,P as _,We as a,ne as b,Me as c,de as d,X as f,F as g,R as h,Ue as i,o as j,h as k,je as l,z as m,He as n,ze as o,se as p,Ve as r,Be as s,Re as t,Te as u,re as v,y as w,A as x,te as y};
@@ -1 +1 @@
1
- import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{a as i,b as a,c as o,f as s,g as c,n as l,o as u,p as d,u as f,x as p,y as m}from"./button-B1XQHQcX.js";import{ot as h}from"./PageListContext-BeAv6YTY.js";var g=p(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),_=p(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),v=p(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),y=p(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),b=e(t(),1),x=n();function S(e){let t=e+`CollectionProvider`,[n,r]=s(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=b.useRef(null),a=b.useRef(new Map).current;return(0,x.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let l=e+`CollectionSlot`,u=c(l),d=b.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,x.jsx)(u,{ref:m(t,a(l,n).collectionRef),children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,h=c(f),g=b.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=b.useRef(null),s=m(t,o),c=a(f,n);return b.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,x.jsx)(h,{[p]:``,ref:s,children:r})});g.displayName=f;function _(t){let n=a(e+`CollectionConsumer`,t);return b.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:d,ItemSlot:g},_,r]}var C=b.createContext(void 0);function w(e){let t=b.useContext(C);return e||t||`ltr`}var T=`rovingFocusGroup.onEntryFocus`,ee={bubbles:!1,cancelable:!0},E=`RovingFocusGroup`,[D,O,k]=S(E),[A,j]=s(E,[k]),[te,M]=A(E),N=b.forwardRef((e,t)=>(0,x.jsx)(D.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,x.jsx)(D.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,x.jsx)(P,{...e,ref:t})})}));N.displayName=E;var P=b.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:p,preventScrollOnEntryFocus:h=!1,...g}=e,_=b.useRef(null),v=m(t,_),y=w(s),[S,C]=o({prop:c,defaultProp:l??null,onChange:u,caller:E}),[D,k]=b.useState(!1),A=i(p),j=O(n),M=b.useRef(!1),[N,P]=b.useState(0);return b.useEffect(()=>{let e=_.current;if(e)return e.addEventListener(T,A),()=>e.removeEventListener(T,A)},[A]),(0,x.jsx)(te,{scope:n,orientation:r,dir:y,loop:a,currentTabStopId:S,onItemFocus:b.useCallback(e=>C(e),[C]),onItemShiftTab:b.useCallback(()=>k(!0),[]),onFocusableItemAdd:b.useCallback(()=>P(e=>e+1),[]),onFocusableItemRemove:b.useCallback(()=>P(e=>e-1),[]),children:(0,x.jsx)(d.div,{tabIndex:D||N===0?-1:0,"data-orientation":r,...g,ref:v,style:{outline:`none`,...e.style},onMouseDown:f(e.onMouseDown,()=>{M.current=!0}),onFocus:f(e.onFocus,e=>{let t=!M.current;if(e.target===e.currentTarget&&t&&!D){let t=new CustomEvent(T,ee);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=j().filter(e=>e.focusable);L([e.find(e=>e.active),e.find(e=>e.id===S),...e].filter(Boolean).map(e=>e.ref.current),h)}}M.current=!1}),onBlur:f(e.onBlur,()=>k(!1))})})}),F=`RovingFocusGroupItem`,I=b.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=u(),l=a||c,p=M(F,n),m=p.currentTabStopId===l,h=O(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:v}=p;return b.useEffect(()=>{if(r)return g(),()=>_()},[r,g,_]),(0,x.jsx)(D.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,x.jsx)(d.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...s,ref:t,onMouseDown:f(e.onMouseDown,e=>{r?p.onItemFocus(l):e.preventDefault()}),onFocus:f(e.onFocus,()=>p.onItemFocus(l)),onKeyDown:f(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){p.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ie(e,p.orientation,p.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=p.loop?ae(n,r+1):n.slice(r+1)}setTimeout(()=>L(n))}}),children:typeof o==`function`?o({isCurrentTabStop:m,hasTabStop:v!=null}):o})})});I.displayName=F;var ne={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function re(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function ie(e,t,n){let r=re(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return ne[r]}function L(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ae(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var R=N,z=I,B=`Toggle`,V=b.forwardRef((e,t)=>{let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[s,c]=o({prop:n,onChange:i,defaultProp:r??!1,caller:B});return(0,x.jsx)(d.button,{type:`button`,"aria-pressed":s,"data-state":s?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:f(e.onClick,()=>{e.disabled||c(!s)})})});V.displayName=B;var H=`ToggleGroup`,[U,oe]=s(H,[j]),W=j(),G=b.forwardRef((e,t)=>{let{type:n,...r}=e;if(n===`single`)return(0,x.jsx)(se,{...r,ref:t});if(n===`multiple`)return(0,x.jsx)(ce,{...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${H}\``)});G.displayName=H;var[K,q]=U(H),se=b.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[s,c]=o({prop:n,defaultProp:r??``,onChange:i,caller:H});return(0,x.jsx)(K,{scope:e.__scopeToggleGroup,type:`single`,value:b.useMemo(()=>s?[s]:[],[s]),onItemActivate:c,onItemDeactivate:b.useCallback(()=>c(``),[c]),children:(0,x.jsx)(J,{...a,ref:t})})}),ce=b.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[s,c]=o({prop:n,defaultProp:r??[],onChange:i,caller:H}),l=b.useCallback(e=>c((t=[])=>[...t,e]),[c]),u=b.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return(0,x.jsx)(K,{scope:e.__scopeToggleGroup,type:`multiple`,value:s,onItemActivate:l,onItemDeactivate:u,children:(0,x.jsx)(J,{...a,ref:t})})});G.displayName=H;var[le,ue]=U(H),J=b.forwardRef((e,t)=>{let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=W(n),u=w(o),f={role:`group`,dir:u,...c};return(0,x.jsx)(le,{scope:n,rovingFocus:i,disabled:r,children:i?(0,x.jsx)(R,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,x.jsx)(d.div,{...f,ref:t})}):(0,x.jsx)(d.div,{...f,ref:t})})}),Y=`ToggleGroupItem`,X=b.forwardRef((e,t)=>{let n=q(Y,e.__scopeToggleGroup),r=ue(Y,e.__scopeToggleGroup),i=W(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=b.useRef(null);return r.rovingFocus?(0,x.jsx)(z,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,x.jsx)(Z,{...s,ref:t})}):(0,x.jsx)(Z,{...s,ref:t})});X.displayName=Y;var Z=b.forwardRef((e,t)=>{let{__scopeToggleGroup:n,value:r,...i}=e,a=q(Y,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0};return(0,x.jsx)(V,{...a.type===`single`?o:void 0,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})}),de=G,fe=X;function pe(e){switch(e.kind){case`doc`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:return`missing`}}function me(e,t){let n=h(e,t);return{resolvedTarget:n,hashDocName:n.target,displayState:pe(n)}}var Q=r(),he=a(`group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`,segmented:`text-muted-foreground hover:bg-muted-foreground/10 data-[state=on]:bg-background data-[state=on]:shadow-sm data-[state=on]:text-foreground dark:data-[state=on]:bg-muted`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),$=b.createContext({size:`default`,variant:`default`,spacing:0,orientation:`horizontal`});function ge(e){let t=(0,Q.c)(29),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]):({className:r,variant:c,size:a,spacing:o,orientation:s,children:n,...i}=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 u=o===void 0?0:o,d=s===void 0?`horizontal`:s,f;t[8]===u?f=t[9]:(f={"--gap":u},t[8]=u,t[9]=f);let p=f,m;t[10]===r?m=t[11]:(m=l(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch`,r),t[10]=r,t[11]=m);let h;t[12]!==d||t[13]!==a||t[14]!==u||t[15]!==c?(h={variant:c,size:a,spacing:u,orientation:d},t[12]=d,t[13]=a,t[14]=u,t[15]=c,t[16]=h):h=t[16];let g;t[17]!==n||t[18]!==h?(g=(0,x.jsx)($.Provider,{value:h,children:n}),t[17]=n,t[18]=h,t[19]=g):g=t[19];let _;return t[20]!==d||t[21]!==i||t[22]!==a||t[23]!==u||t[24]!==p||t[25]!==m||t[26]!==g||t[27]!==c?(_=(0,x.jsx)(de,{"data-slot":`toggle-group`,"data-variant":c,"data-size":a,"data-spacing":u,"data-orientation":d,style:p,className:m,...i,children:g}),t[20]=d,t[21]=i,t[22]=a,t[23]=u,t[24]=p,t[25]=m,t[26]=g,t[27]=c,t[28]=_):_=t[28],_}function _e(e){let t=(0,Q.c)(19),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,variant:a,size:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?`default`:a,c=o===void 0?`default`:o,u=b.use($),d=u.variant||s,f=u.size||c,p=u.spacing,m;t[6]!==r||t[7]!==u.size||t[8]!==u.variant||t[9]!==c||t[10]!==s?(m=l(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t text-muted-foreground data-[state=on]:text-foreground`,he({variant:u.variant||s,size:u.size||c}),r),t[6]=r,t[7]=u.size,t[8]=u.variant,t[9]=c,t[10]=s,t[11]=m):m=t[11];let h;return t[12]!==n||t[13]!==u.spacing||t[14]!==i||t[15]!==d||t[16]!==f||t[17]!==m?(h=(0,x.jsx)(fe,{"data-slot":`toggle-group-item`,"data-variant":d,"data-size":f,"data-spacing":p,className:m,...i,children:n}),t[12]=n,t[13]=u.spacing,t[14]=i,t[15]=d,t[16]=f,t[17]=m,t[18]=h):h=t[18],h}export{R as a,S as c,_ as d,g as f,z as i,y as l,_e as n,j as o,me as r,w as s,ge as t,v as u};
1
+ import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{a as i,b as a,c as o,f as s,g as c,n as l,o as u,p as d,u as f,x as p,y as m}from"./button-BPXuMr5W.js";import{ot as h}from"./PageListContext-DNRRECTw.js";var g=p(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),_=p(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),v=p(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),y=p(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),b=e(t(),1),x=n();function S(e){let t=e+`CollectionProvider`,[n,r]=s(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=b.useRef(null),a=b.useRef(new Map).current;return(0,x.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let l=e+`CollectionSlot`,u=c(l),d=b.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,x.jsx)(u,{ref:m(t,a(l,n).collectionRef),children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,h=c(f),g=b.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=b.useRef(null),s=m(t,o),c=a(f,n);return b.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,x.jsx)(h,{[p]:``,ref:s,children:r})});g.displayName=f;function _(t){let n=a(e+`CollectionConsumer`,t);return b.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:d,ItemSlot:g},_,r]}var C=b.createContext(void 0);function w(e){let t=b.useContext(C);return e||t||`ltr`}var T=`rovingFocusGroup.onEntryFocus`,ee={bubbles:!1,cancelable:!0},E=`RovingFocusGroup`,[D,O,k]=S(E),[A,j]=s(E,[k]),[te,M]=A(E),N=b.forwardRef((e,t)=>(0,x.jsx)(D.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,x.jsx)(D.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,x.jsx)(P,{...e,ref:t})})}));N.displayName=E;var P=b.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:p,preventScrollOnEntryFocus:h=!1,...g}=e,_=b.useRef(null),v=m(t,_),y=w(s),[S,C]=o({prop:c,defaultProp:l??null,onChange:u,caller:E}),[D,k]=b.useState(!1),A=i(p),j=O(n),M=b.useRef(!1),[N,P]=b.useState(0);return b.useEffect(()=>{let e=_.current;if(e)return e.addEventListener(T,A),()=>e.removeEventListener(T,A)},[A]),(0,x.jsx)(te,{scope:n,orientation:r,dir:y,loop:a,currentTabStopId:S,onItemFocus:b.useCallback(e=>C(e),[C]),onItemShiftTab:b.useCallback(()=>k(!0),[]),onFocusableItemAdd:b.useCallback(()=>P(e=>e+1),[]),onFocusableItemRemove:b.useCallback(()=>P(e=>e-1),[]),children:(0,x.jsx)(d.div,{tabIndex:D||N===0?-1:0,"data-orientation":r,...g,ref:v,style:{outline:`none`,...e.style},onMouseDown:f(e.onMouseDown,()=>{M.current=!0}),onFocus:f(e.onFocus,e=>{let t=!M.current;if(e.target===e.currentTarget&&t&&!D){let t=new CustomEvent(T,ee);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=j().filter(e=>e.focusable);L([e.find(e=>e.active),e.find(e=>e.id===S),...e].filter(Boolean).map(e=>e.ref.current),h)}}M.current=!1}),onBlur:f(e.onBlur,()=>k(!1))})})}),F=`RovingFocusGroupItem`,I=b.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=u(),l=a||c,p=M(F,n),m=p.currentTabStopId===l,h=O(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:v}=p;return b.useEffect(()=>{if(r)return g(),()=>_()},[r,g,_]),(0,x.jsx)(D.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,x.jsx)(d.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...s,ref:t,onMouseDown:f(e.onMouseDown,e=>{r?p.onItemFocus(l):e.preventDefault()}),onFocus:f(e.onFocus,()=>p.onItemFocus(l)),onKeyDown:f(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){p.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ie(e,p.orientation,p.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=p.loop?ae(n,r+1):n.slice(r+1)}setTimeout(()=>L(n))}}),children:typeof o==`function`?o({isCurrentTabStop:m,hasTabStop:v!=null}):o})})});I.displayName=F;var ne={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function re(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function ie(e,t,n){let r=re(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return ne[r]}function L(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ae(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var R=N,z=I,B=`Toggle`,V=b.forwardRef((e,t)=>{let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[s,c]=o({prop:n,onChange:i,defaultProp:r??!1,caller:B});return(0,x.jsx)(d.button,{type:`button`,"aria-pressed":s,"data-state":s?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:f(e.onClick,()=>{e.disabled||c(!s)})})});V.displayName=B;var H=`ToggleGroup`,[U,oe]=s(H,[j]),W=j(),G=b.forwardRef((e,t)=>{let{type:n,...r}=e;if(n===`single`)return(0,x.jsx)(se,{...r,ref:t});if(n===`multiple`)return(0,x.jsx)(ce,{...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${H}\``)});G.displayName=H;var[K,q]=U(H),se=b.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[s,c]=o({prop:n,defaultProp:r??``,onChange:i,caller:H});return(0,x.jsx)(K,{scope:e.__scopeToggleGroup,type:`single`,value:b.useMemo(()=>s?[s]:[],[s]),onItemActivate:c,onItemDeactivate:b.useCallback(()=>c(``),[c]),children:(0,x.jsx)(J,{...a,ref:t})})}),ce=b.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[s,c]=o({prop:n,defaultProp:r??[],onChange:i,caller:H}),l=b.useCallback(e=>c((t=[])=>[...t,e]),[c]),u=b.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return(0,x.jsx)(K,{scope:e.__scopeToggleGroup,type:`multiple`,value:s,onItemActivate:l,onItemDeactivate:u,children:(0,x.jsx)(J,{...a,ref:t})})});G.displayName=H;var[le,ue]=U(H),J=b.forwardRef((e,t)=>{let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=W(n),u=w(o),f={role:`group`,dir:u,...c};return(0,x.jsx)(le,{scope:n,rovingFocus:i,disabled:r,children:i?(0,x.jsx)(R,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,x.jsx)(d.div,{...f,ref:t})}):(0,x.jsx)(d.div,{...f,ref:t})})}),Y=`ToggleGroupItem`,X=b.forwardRef((e,t)=>{let n=q(Y,e.__scopeToggleGroup),r=ue(Y,e.__scopeToggleGroup),i=W(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=b.useRef(null);return r.rovingFocus?(0,x.jsx)(z,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,x.jsx)(Z,{...s,ref:t})}):(0,x.jsx)(Z,{...s,ref:t})});X.displayName=Y;var Z=b.forwardRef((e,t)=>{let{__scopeToggleGroup:n,value:r,...i}=e,a=q(Y,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0};return(0,x.jsx)(V,{...a.type===`single`?o:void 0,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})}),de=G,fe=X;function pe(e){switch(e.kind){case`doc`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:return`missing`}}function me(e,t){let n=h(e,t);return{resolvedTarget:n,hashDocName:n.target,displayState:pe(n)}}var Q=r(),he=a(`group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`,segmented:`text-muted-foreground hover:bg-muted-foreground/10 data-[state=on]:bg-background data-[state=on]:shadow-sm data-[state=on]:text-foreground dark:data-[state=on]:bg-muted`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),$=b.createContext({size:`default`,variant:`default`,spacing:0,orientation:`horizontal`});function ge(e){let t=(0,Q.c)(29),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]):({className:r,variant:c,size:a,spacing:o,orientation:s,children:n,...i}=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 u=o===void 0?0:o,d=s===void 0?`horizontal`:s,f;t[8]===u?f=t[9]:(f={"--gap":u},t[8]=u,t[9]=f);let p=f,m;t[10]===r?m=t[11]:(m=l(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch`,r),t[10]=r,t[11]=m);let h;t[12]!==d||t[13]!==a||t[14]!==u||t[15]!==c?(h={variant:c,size:a,spacing:u,orientation:d},t[12]=d,t[13]=a,t[14]=u,t[15]=c,t[16]=h):h=t[16];let g;t[17]!==n||t[18]!==h?(g=(0,x.jsx)($.Provider,{value:h,children:n}),t[17]=n,t[18]=h,t[19]=g):g=t[19];let _;return t[20]!==d||t[21]!==i||t[22]!==a||t[23]!==u||t[24]!==p||t[25]!==m||t[26]!==g||t[27]!==c?(_=(0,x.jsx)(de,{"data-slot":`toggle-group`,"data-variant":c,"data-size":a,"data-spacing":u,"data-orientation":d,style:p,className:m,...i,children:g}),t[20]=d,t[21]=i,t[22]=a,t[23]=u,t[24]=p,t[25]=m,t[26]=g,t[27]=c,t[28]=_):_=t[28],_}function _e(e){let t=(0,Q.c)(19),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,variant:a,size:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?`default`:a,c=o===void 0?`default`:o,u=b.use($),d=u.variant||s,f=u.size||c,p=u.spacing,m;t[6]!==r||t[7]!==u.size||t[8]!==u.variant||t[9]!==c||t[10]!==s?(m=l(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t text-muted-foreground data-[state=on]:text-foreground`,he({variant:u.variant||s,size:u.size||c}),r),t[6]=r,t[7]=u.size,t[8]=u.variant,t[9]=c,t[10]=s,t[11]=m):m=t[11];let h;return t[12]!==n||t[13]!==u.spacing||t[14]!==i||t[15]!==d||t[16]!==f||t[17]!==m?(h=(0,x.jsx)(fe,{"data-slot":`toggle-group-item`,"data-variant":d,"data-size":f,"data-spacing":p,className:m,...i,children:n}),t[12]=n,t[13]=u.spacing,t[14]=i,t[15]=d,t[16]=f,t[17]=m,t[18]=h):h=t[18],h}export{R as a,S as c,_ as d,g as f,z as i,y as l,_e as n,j as o,me as r,w as s,ge as t,v as u};
@@ -1 +1 @@
1
- import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{S as i,_ as a,a as o,c as s,f as c,i as l,l as u,n as d,o as f,p,r as m,s as h,u as g,y as _}from"./button-B1XQHQcX.js";import{Ht as v,Jt as y,Kt as b,Ut as x,Vt as S,Wt as C,Yt as w,qt as T,zt as E}from"./PageListContext-BeAv6YTY.js";var D=e(i(),1),O=e(t(),1),k=n(),A=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),j=`VisuallyHidden`,M=O.forwardRef((e,t)=>(0,k.jsx)(p.span,{...e,ref:t,style:{...A,...e.style}}));M.displayName=j;var N=M;function P(e){let[t,n]=O.useState(void 0);return u(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var F=typeof document<`u`?O.useLayoutEffect:function(){};function I(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!I(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!I(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function L(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function R(e,t){let n=L(e);return Math.round(t*n)/n}function z(e){let t=O.useRef(e);return F(()=>{t.current=e}),t}function B(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=O.useState(r);I(f,r)||p(r);let[m,h]=O.useState(null),[g,_]=O.useState(null),y=O.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=O.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=O.useRef(null),w=O.useRef(null),T=O.useRef(u),E=c!=null,k=z(c),A=z(i),j=z(l),M=O.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};A.current&&(e.platform=A.current),v(C.current,w.current,e).then(e=>{let t={...e,isPositioned:j.current!==!1};N.current&&!I(T.current,t)&&(T.current=t,D.flushSync(()=>{d(t)}))})},[f,t,n,A,j]);F(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let N=O.useRef(!1);F(()=>(N.current=!0,()=>{N.current=!1}),[]),F(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(k.current)return k.current(x,S,M);M()}},[x,S,M,k,E]);let P=O.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),B=O.useMemo(()=>({reference:x,floating:S}),[x,S]),V=O.useMemo(()=>{let e={position:n,left:0,top:0};if(!B.floating)return e;let t=R(B.floating,u.x),r=R(B.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...L(B.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,B.floating,u.x,u.y]);return O.useMemo(()=>({...u,update:M,refs:P,elements:B,floatingStyles:V}),[u,M,P,B,V])}var V=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:E({element:r.current,padding:i}).fn(n):r?E({element:r,padding:i}).fn(n):{}}}},ee=(e,t)=>{let n=T(e);return{name:n.name,fn:n.fn,options:[e,t]}},te=(e,t)=>{let n=y(e);return{name:n.name,fn:n.fn,options:[e,t]}},ne=(e,t)=>({fn:b(e).fn,options:[e,t]}),re=(e,t)=>{let n=x(e);return{name:n.name,fn:n.fn,options:[e,t]}},ie=(e,t)=>{let n=w(e);return{name:n.name,fn:n.fn,options:[e,t]}},ae=(e,t)=>{let n=C(e);return{name:n.name,fn:n.fn,options:[e,t]}},oe=(e,t)=>{let n=V(e);return{name:n.name,fn:n.fn,options:[e,t]}},H=`Arrow`,U=O.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,k.jsx)(p.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,k.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});U.displayName=H;var W=U,G=`Popper`,[K,q]=c(G),[se,ce]=K(G),le=e=>{let{__scopePopper:t,children:n}=e,[r,i]=O.useState(null);return(0,k.jsx)(se,{scope:t,anchor:r,onAnchorChange:i,children:n})};le.displayName=G;var ue=`PopperAnchor`,de=O.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=ce(ue,n),o=O.useRef(null),s=_(t,o),c=O.useRef(null);return O.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,k.jsx)(p.div,{...i,ref:s})});de.displayName=ue;var fe=`PopperContent`,[pe,me]=K(fe),he=O.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:m=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:g=`optimized`,onPlaced:v,...y}=e,b=ce(fe,n),[x,C]=O.useState(null),w=_(t,e=>C(e)),[T,E]=O.useState(null),D=P(T),A=D?.width??0,j=D?.height??0,M=r+(a===`center`?``:`-`+a),N=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},F=Array.isArray(d)?d:[d],I=F.length>0,L={padding:N,boundary:F.filter(ye),altBoundary:I},{refs:R,floatingStyles:z,placement:V,isPositioned:H,middlewareData:U}=B({strategy:`fixed`,placement:M,whileElementsMounted:(...e)=>S(...e,{animationFrame:g===`always`}),elements:{reference:b.anchor},middleware:[ee({mainAxis:i+j,alignmentAxis:s}),l&&te({mainAxis:!0,crossAxis:!1,limiter:m===`partial`?ne():void 0,...L}),l&&re({...L}),ie({...L,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),T&&oe({element:T,padding:c}),be({arrowWidth:A,arrowHeight:j}),h&&ae({strategy:`referenceHidden`,...L})]}),[W,G]=xe(V),K=o(v);u(()=>{H&&K?.()},[H,K]);let q=U.arrow?.x,se=U.arrow?.y,le=U.arrow?.centerOffset!==0,[ue,de]=O.useState();return u(()=>{x&&de(window.getComputedStyle(x).zIndex)},[x]),(0,k.jsx)(`div`,{ref:R.setFloating,"data-radix-popper-content-wrapper":``,style:{...z,transform:H?z.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ue,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(` `),...U.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,k.jsx)(pe,{scope:n,placedSide:W,onArrowChange:E,arrowX:q,arrowY:se,shouldHideArrow:le,children:(0,k.jsx)(p.div,{"data-side":W,"data-align":G,...y,ref:w,style:{...y.style,animation:H?void 0:`none`}})})})});he.displayName=fe;var ge=`PopperArrow`,_e={top:`bottom`,right:`left`,bottom:`top`,left:`right`},ve=O.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=me(ge,n),a=_e[i.placedSide];return(0,k.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,k.jsx)(W,{...r,ref:t,style:{...r.style,display:`block`}})})});ve.displayName=ge;function ye(e){return e!==null}var be=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=xe(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function xe(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Se=le,Ce=de,we=he,Te=ve,[J,Ee]=c(`Tooltip`,[q]),Y=q(),De=`TooltipProvider`,Oe=700,ke=`tooltip.open`,[Ae,je]=J(De),Me=e=>{let{__scopeTooltip:t,delayDuration:n=Oe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=O.useRef(!0),s=O.useRef(!1),c=O.useRef(0);return O.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,k.jsx)(Ae,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:O.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:O.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:O.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Me.displayName=De;var X=`Tooltip`,[Ne,Z]=J(X),Pe=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:c}=e,l=je(X,e.__scopeTooltip),u=Y(t),[d,p]=O.useState(null),m=f(),h=O.useRef(0),g=o??l.disableHoverableContent,_=c??l.delayDuration,v=O.useRef(!1),[y,b]=s({prop:r,defaultProp:i??!1,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(ke))):l.onClose(),a?.(e)},caller:X}),x=O.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=O.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=O.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=O.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);return O.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,k.jsx)(Se,{...u,children:(0,k.jsx)(Ne,{scope:t,contentId:m,open:y,stateAttribute:x,trigger:d,onTriggerChange:p,onTriggerEnter:O.useCallback(()=>{l.isOpenDelayedRef.current?w():S()},[l.isOpenDelayedRef,w,S]),onTriggerLeave:O.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})};Pe.displayName=X;var Fe=`TooltipTrigger`,Ie=O.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Z(Fe,n),a=je(Fe,n),o=Y(n),s=_(t,O.useRef(null),i.onTriggerChange),c=O.useRef(!1),l=O.useRef(!1),u=O.useCallback(()=>c.current=!1,[]);return O.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,k.jsx)(Ce,{asChild:!0,...o,children:(0,k.jsx)(p.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:g(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:g(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:g(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:g(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:g(e.onBlur,i.onClose),onClick:g(e.onClick,i.onClose)})})});Ie.displayName=Fe;var Le=`TooltipPortal`,[Re,ze]=J(Le,{forceMount:void 0}),Be=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Z(Le,t);return(0,k.jsx)(Re,{scope:t,forceMount:n,children:(0,k.jsx)(h,{present:n||a.open,children:(0,k.jsx)(m,{asChild:!0,container:i,children:r})})})};Be.displayName=Le;var Q=`TooltipContent`,Ve=O.forwardRef((e,t)=>{let n=ze(Q,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Z(Q,e.__scopeTooltip);return(0,k.jsx)(h,{present:r||o.open,children:o.disableHoverableContent?(0,k.jsx)(Ke,{side:i,...a,ref:t}):(0,k.jsx)(He,{side:i,...a,ref:t})})}),He=O.forwardRef((e,t)=>{let n=Z(Q,e.__scopeTooltip),r=je(Q,e.__scopeTooltip),i=O.useRef(null),a=_(t,i),[o,s]=O.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=O.useCallback(()=>{s(null),d(!1)},[d]),p=O.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Xe(r,Ye(r,n.getBoundingClientRect())),a=Ze(t.getBoundingClientRect());s($e([...i,...a])),d(!0)},[d]);return O.useEffect(()=>()=>f(),[f]),O.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),O.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Qe(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,k.jsx)(Ke,{...e,ref:a})}),[Ue,We]=J(X,{isInside:!1}),Ge=a(`TooltipContent`),Ke=O.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Z(Q,n),u=Y(n),{onClose:d}=c;return O.useEffect(()=>(document.addEventListener(ke,d),()=>document.removeEventListener(ke,d)),[d]),O.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,d]),(0,k.jsx)(l,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,k.jsxs)(we,{"data-state":c.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,k.jsx)(Ge,{children:r}),(0,k.jsx)(Ue,{scope:n,isInside:!0,children:(0,k.jsx)(N,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});Ve.displayName=Q;var qe=`TooltipArrow`,Je=O.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Y(n);return We(qe,n).isInside?null:(0,k.jsx)(Te,{...i,...r,ref:t})});Je.displayName=qe;function Ye(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Xe(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ze(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Qe(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function $e(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),et(t)}function et(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var tt=Me,nt=Pe,rt=Ie,it=Be,at=Ve,ot=Je,$=r();function st(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,k.jsx)(tt,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function ct(e){let t=(0,$.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,k.jsx)(nt,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function lt(e){let t=(0,$.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,k.jsx)(rt,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function ut(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,sideOffset:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?0:a,s;t[5]===r?s=t[6]:(s=d(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 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-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 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`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,k.jsx)(ot,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,k.jsx)(it,{children:(0,k.jsxs)(at,{"data-slot":`tooltip-content`,sideOffset:o,className:s,...i,children:[n,c]})}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}export{Ce as a,Se as c,lt as i,q as l,ut as n,Te as o,st as r,we as s,ct as t,P as u};
1
+ import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{S as i,_ as a,a as o,c as s,f as c,i as l,l as u,n as d,o as f,p,r as m,s as h,u as g,y as _}from"./button-BPXuMr5W.js";import{Ht as v,Jt as y,Kt as b,Ut as x,Vt as S,Wt as C,Yt as w,qt as T,zt as E}from"./PageListContext-DNRRECTw.js";var D=e(i(),1),O=e(t(),1),k=n(),A=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),j=`VisuallyHidden`,M=O.forwardRef((e,t)=>(0,k.jsx)(p.span,{...e,ref:t,style:{...A,...e.style}}));M.displayName=j;var N=M;function P(e){let[t,n]=O.useState(void 0);return u(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var F=typeof document<`u`?O.useLayoutEffect:function(){};function I(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!I(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!I(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function L(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function R(e,t){let n=L(e);return Math.round(t*n)/n}function z(e){let t=O.useRef(e);return F(()=>{t.current=e}),t}function B(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=O.useState(r);I(f,r)||p(r);let[m,h]=O.useState(null),[g,_]=O.useState(null),y=O.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=O.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=O.useRef(null),w=O.useRef(null),T=O.useRef(u),E=c!=null,k=z(c),A=z(i),j=z(l),M=O.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};A.current&&(e.platform=A.current),v(C.current,w.current,e).then(e=>{let t={...e,isPositioned:j.current!==!1};N.current&&!I(T.current,t)&&(T.current=t,D.flushSync(()=>{d(t)}))})},[f,t,n,A,j]);F(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let N=O.useRef(!1);F(()=>(N.current=!0,()=>{N.current=!1}),[]),F(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(k.current)return k.current(x,S,M);M()}},[x,S,M,k,E]);let P=O.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),B=O.useMemo(()=>({reference:x,floating:S}),[x,S]),V=O.useMemo(()=>{let e={position:n,left:0,top:0};if(!B.floating)return e;let t=R(B.floating,u.x),r=R(B.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...L(B.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,B.floating,u.x,u.y]);return O.useMemo(()=>({...u,update:M,refs:P,elements:B,floatingStyles:V}),[u,M,P,B,V])}var V=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:E({element:r.current,padding:i}).fn(n):r?E({element:r,padding:i}).fn(n):{}}}},ee=(e,t)=>{let n=T(e);return{name:n.name,fn:n.fn,options:[e,t]}},te=(e,t)=>{let n=y(e);return{name:n.name,fn:n.fn,options:[e,t]}},ne=(e,t)=>({fn:b(e).fn,options:[e,t]}),re=(e,t)=>{let n=x(e);return{name:n.name,fn:n.fn,options:[e,t]}},ie=(e,t)=>{let n=w(e);return{name:n.name,fn:n.fn,options:[e,t]}},ae=(e,t)=>{let n=C(e);return{name:n.name,fn:n.fn,options:[e,t]}},oe=(e,t)=>{let n=V(e);return{name:n.name,fn:n.fn,options:[e,t]}},H=`Arrow`,U=O.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,k.jsx)(p.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,k.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});U.displayName=H;var W=U,G=`Popper`,[K,q]=c(G),[se,ce]=K(G),le=e=>{let{__scopePopper:t,children:n}=e,[r,i]=O.useState(null);return(0,k.jsx)(se,{scope:t,anchor:r,onAnchorChange:i,children:n})};le.displayName=G;var ue=`PopperAnchor`,de=O.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=ce(ue,n),o=O.useRef(null),s=_(t,o),c=O.useRef(null);return O.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,k.jsx)(p.div,{...i,ref:s})});de.displayName=ue;var fe=`PopperContent`,[pe,me]=K(fe),he=O.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:m=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:g=`optimized`,onPlaced:v,...y}=e,b=ce(fe,n),[x,C]=O.useState(null),w=_(t,e=>C(e)),[T,E]=O.useState(null),D=P(T),A=D?.width??0,j=D?.height??0,M=r+(a===`center`?``:`-`+a),N=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},F=Array.isArray(d)?d:[d],I=F.length>0,L={padding:N,boundary:F.filter(ye),altBoundary:I},{refs:R,floatingStyles:z,placement:V,isPositioned:H,middlewareData:U}=B({strategy:`fixed`,placement:M,whileElementsMounted:(...e)=>S(...e,{animationFrame:g===`always`}),elements:{reference:b.anchor},middleware:[ee({mainAxis:i+j,alignmentAxis:s}),l&&te({mainAxis:!0,crossAxis:!1,limiter:m===`partial`?ne():void 0,...L}),l&&re({...L}),ie({...L,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),T&&oe({element:T,padding:c}),be({arrowWidth:A,arrowHeight:j}),h&&ae({strategy:`referenceHidden`,...L})]}),[W,G]=xe(V),K=o(v);u(()=>{H&&K?.()},[H,K]);let q=U.arrow?.x,se=U.arrow?.y,le=U.arrow?.centerOffset!==0,[ue,de]=O.useState();return u(()=>{x&&de(window.getComputedStyle(x).zIndex)},[x]),(0,k.jsx)(`div`,{ref:R.setFloating,"data-radix-popper-content-wrapper":``,style:{...z,transform:H?z.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ue,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(` `),...U.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,k.jsx)(pe,{scope:n,placedSide:W,onArrowChange:E,arrowX:q,arrowY:se,shouldHideArrow:le,children:(0,k.jsx)(p.div,{"data-side":W,"data-align":G,...y,ref:w,style:{...y.style,animation:H?void 0:`none`}})})})});he.displayName=fe;var ge=`PopperArrow`,_e={top:`bottom`,right:`left`,bottom:`top`,left:`right`},ve=O.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=me(ge,n),a=_e[i.placedSide];return(0,k.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,k.jsx)(W,{...r,ref:t,style:{...r.style,display:`block`}})})});ve.displayName=ge;function ye(e){return e!==null}var be=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=xe(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function xe(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Se=le,Ce=de,we=he,Te=ve,[J,Ee]=c(`Tooltip`,[q]),Y=q(),De=`TooltipProvider`,Oe=700,ke=`tooltip.open`,[Ae,je]=J(De),Me=e=>{let{__scopeTooltip:t,delayDuration:n=Oe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=O.useRef(!0),s=O.useRef(!1),c=O.useRef(0);return O.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,k.jsx)(Ae,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:O.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:O.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:O.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Me.displayName=De;var X=`Tooltip`,[Ne,Z]=J(X),Pe=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:c}=e,l=je(X,e.__scopeTooltip),u=Y(t),[d,p]=O.useState(null),m=f(),h=O.useRef(0),g=o??l.disableHoverableContent,_=c??l.delayDuration,v=O.useRef(!1),[y,b]=s({prop:r,defaultProp:i??!1,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(ke))):l.onClose(),a?.(e)},caller:X}),x=O.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=O.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=O.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=O.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);return O.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,k.jsx)(Se,{...u,children:(0,k.jsx)(Ne,{scope:t,contentId:m,open:y,stateAttribute:x,trigger:d,onTriggerChange:p,onTriggerEnter:O.useCallback(()=>{l.isOpenDelayedRef.current?w():S()},[l.isOpenDelayedRef,w,S]),onTriggerLeave:O.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})};Pe.displayName=X;var Fe=`TooltipTrigger`,Ie=O.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Z(Fe,n),a=je(Fe,n),o=Y(n),s=_(t,O.useRef(null),i.onTriggerChange),c=O.useRef(!1),l=O.useRef(!1),u=O.useCallback(()=>c.current=!1,[]);return O.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,k.jsx)(Ce,{asChild:!0,...o,children:(0,k.jsx)(p.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:g(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:g(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:g(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:g(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:g(e.onBlur,i.onClose),onClick:g(e.onClick,i.onClose)})})});Ie.displayName=Fe;var Le=`TooltipPortal`,[Re,ze]=J(Le,{forceMount:void 0}),Be=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Z(Le,t);return(0,k.jsx)(Re,{scope:t,forceMount:n,children:(0,k.jsx)(h,{present:n||a.open,children:(0,k.jsx)(m,{asChild:!0,container:i,children:r})})})};Be.displayName=Le;var Q=`TooltipContent`,Ve=O.forwardRef((e,t)=>{let n=ze(Q,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Z(Q,e.__scopeTooltip);return(0,k.jsx)(h,{present:r||o.open,children:o.disableHoverableContent?(0,k.jsx)(Ke,{side:i,...a,ref:t}):(0,k.jsx)(He,{side:i,...a,ref:t})})}),He=O.forwardRef((e,t)=>{let n=Z(Q,e.__scopeTooltip),r=je(Q,e.__scopeTooltip),i=O.useRef(null),a=_(t,i),[o,s]=O.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=O.useCallback(()=>{s(null),d(!1)},[d]),p=O.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Xe(r,Ye(r,n.getBoundingClientRect())),a=Ze(t.getBoundingClientRect());s($e([...i,...a])),d(!0)},[d]);return O.useEffect(()=>()=>f(),[f]),O.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),O.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Qe(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,k.jsx)(Ke,{...e,ref:a})}),[Ue,We]=J(X,{isInside:!1}),Ge=a(`TooltipContent`),Ke=O.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Z(Q,n),u=Y(n),{onClose:d}=c;return O.useEffect(()=>(document.addEventListener(ke,d),()=>document.removeEventListener(ke,d)),[d]),O.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,d]),(0,k.jsx)(l,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,k.jsxs)(we,{"data-state":c.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,k.jsx)(Ge,{children:r}),(0,k.jsx)(Ue,{scope:n,isInside:!0,children:(0,k.jsx)(N,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});Ve.displayName=Q;var qe=`TooltipArrow`,Je=O.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Y(n);return We(qe,n).isInside?null:(0,k.jsx)(Te,{...i,...r,ref:t})});Je.displayName=qe;function Ye(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Xe(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ze(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Qe(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function $e(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),et(t)}function et(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var tt=Me,nt=Pe,rt=Ie,it=Be,at=Ve,ot=Je,$=r();function st(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,k.jsx)(tt,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function ct(e){let t=(0,$.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,k.jsx)(nt,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function lt(e){let t=(0,$.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,k.jsx)(rt,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function ut(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,sideOffset:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?0:a,s;t[5]===r?s=t[6]:(s=d(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 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-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 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`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,k.jsx)(ot,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,k.jsx)(it,{children:(0,k.jsxs)(at,{"data-slot":`tooltip-content`,sideOffset:o,className:s,...i,children:[n,c]})}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}export{Ce as a,Se as c,lt as i,q as l,ut as n,Te as o,st as r,we as s,ct as t,P as u};
@@ -20,24 +20,24 @@
20
20
  nothing for the formatter to reindent.
21
21
  -->
22
22
  <script>(() => { let mode = 'wysiwyg'; try { const raw = localStorage.getItem('ok-editor-mode-v1'); if (raw === 'wysiwyg' || raw === 'source') mode = raw; } catch {} window.__OK_EDITOR_MODE__ = mode; })();</script>
23
- <script type="module" crossorigin src="./assets/index-CQCwZ-Zo.js"></script>
23
+ <script type="module" crossorigin src="./assets/index-CfLPPlu0.js"></script>
24
24
  <link rel="modulepreload" crossorigin href="./assets/chunk-DECur_0Z.js">
25
25
  <link rel="modulepreload" crossorigin href="./assets/propagation-api-Bugyj7xy.js">
26
26
  <link rel="modulepreload" crossorigin href="./assets/w3c-keyname-CSlwavrd.js">
27
27
  <link rel="modulepreload" crossorigin href="./assets/dist-CgLbXgrr.js">
28
28
  <link rel="modulepreload" crossorigin href="./assets/dist-D2wwoXzm.js">
29
29
  <link rel="modulepreload" crossorigin href="./assets/compiler-runtime-Y11fyRVL.js">
30
- <link rel="modulepreload" crossorigin href="./assets/PageListContext-BeAv6YTY.js">
31
- <link rel="modulepreload" crossorigin href="./assets/button-B1XQHQcX.js">
32
- <link rel="modulepreload" crossorigin href="./assets/dialog-BFKTD2mP.js">
33
- <link rel="modulepreload" crossorigin href="./assets/DocumentContext-C1QoSdgU.js">
30
+ <link rel="modulepreload" crossorigin href="./assets/PageListContext-DNRRECTw.js">
31
+ <link rel="modulepreload" crossorigin href="./assets/button-BPXuMr5W.js">
32
+ <link rel="modulepreload" crossorigin href="./assets/dialog-CtSN0d2b.js">
33
+ <link rel="modulepreload" crossorigin href="./assets/DocumentContext-C7zXwLGg.js">
34
34
  <link rel="modulepreload" crossorigin href="./assets/dist-GlH2KPqY.js">
35
- <link rel="modulepreload" crossorigin href="./assets/panel-rtdrPcLu.js">
36
- <link rel="modulepreload" crossorigin href="./assets/clipboard-DQ6xQqEq.js">
37
- <link rel="modulepreload" crossorigin href="./assets/tooltip-D180uIJr.js">
38
- <link rel="modulepreload" crossorigin href="./assets/toggle-group-C2g3gOrt.js">
39
- <link rel="modulepreload" crossorigin href="./assets/agent-presence-DBKMYj1x.js">
40
- <link rel="stylesheet" crossorigin href="./assets/index-C7ubYQQH.css">
35
+ <link rel="modulepreload" crossorigin href="./assets/panel-BCRdtBla.js">
36
+ <link rel="modulepreload" crossorigin href="./assets/clipboard-BcHcwwH2.js">
37
+ <link rel="modulepreload" crossorigin href="./assets/tooltip-nCu_fYrg.js">
38
+ <link rel="modulepreload" crossorigin href="./assets/toggle-group-akWK7-wE.js">
39
+ <link rel="modulepreload" crossorigin href="./assets/agent-presence-CN4nWhyr.js">
40
+ <link rel="stylesheet" crossorigin href="./assets/index-Bw1KsDm4.css">
41
41
  </head>
42
42
 
43
43
  <body class="antialiased">
@@ -0,0 +1 @@
1
+ import"./init-DT5HolXi.mjs";import"./loader-G-_WDqR0.mjs";export{};
@@ -1,2 +1,2 @@
1
- import{t as e}from"./esm-29fM6BBO.mjs";import{i as t}from"./constants-BYPRF6Xi.mjs";import{p as n}from"./dist-DRC09WNZ.mjs";import{spawn as r}from"node:child_process";import{join as i}from"node:path";import{closeSync as a,existsSync as o,mkdirSync as s,openSync as c}from"node:fs";function l(){let e=process.execPath,t=process.argv[1];return t?{command:e,prefixArgs:[t]}:(console.warn(`[self-spawn] process.argv[1] is empty — falling back to \`npx @inkeep/open-knowledge\`. This re-introduces the version-drift surface that re-exec was fixing. Observed argv: ${JSON.stringify(process.argv)}`),{command:`npx`,prefixArgs:[`@inkeep/open-knowledge`]})}function u(e){return e.uiLock?e.isAlive(e.uiLock.pid)?{action:`skip`,reason:`alive`,pid:e.uiLock.pid,port:e.uiLock.port}:{action:`spawn`,reason:`stale`,stalePid:e.uiLock.pid}:{action:`spawn`,reason:`absent`}}function d(e){o(e.lockDir)||s(e.lockDir,{recursive:!0});let t=c(i(e.lockDir,`last-spawn-error.log`),`w`),n=e.spawn??r,{PORT:u,...d}=process.env,f=l();try{let r=n(f.command,[...f.prefixArgs,...e.args??[`ui`]],{detached:!0,stdio:[`ignore`,`ignore`,t],cwd:e.cwd,env:d});return r.unref(),r}finally{try{a(t)}catch{}}}async function f(e){let t=e.now()+e.timeoutMs;for(;e.now()<t;){let t=e.readUiLock();if(t&&t.port>0)return t.port;await e.sleep(e.pollIntervalMs)}let n=e.readUiLock();return n&&n.port>0?n.port:null}function p(e){let t=e.sigtermGraceMs??1e4,n=e.sigtermPollIntervalMs??200,r=e.sleep??(e=>new Promise(t=>setTimeout(t,e)));return async()=>{try{let i=e.readUiLock();if(i&&e.isAlive(i.pid))try{e.killPid(i.pid,`SIGTERM`),e.log?.info({pid:i.pid,port:i.port},`idle-shutdown: SIGTERM UI sibling`);let a=Date.now()+t;for(;Date.now()<a&&e.isAlive(i.pid);)await r(n);if(e.isAlive(i.pid))try{e.killPid(i.pid,`SIGKILL`),e.log?.warn({pid:i.pid,graceMs:t},`idle-shutdown: SIGTERM grace expired — escalated to SIGKILL`)}catch(t){e.log?.error({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: SIGKILL failed`)}}catch(t){e.log?.warn({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: failed to SIGTERM UI sibling`)}}catch(t){e.log?.warn({err:t instanceof Error?t.message:String(t)},`idle-shutdown: UI lookup failed; proceeding with destroy`)}await e.destroy()}}async function m(e){let{config:t,cwd:r}=e,i=e.skipAutoInit??!1,a=e.skipUiAutoSpawn??!1,o=e.idleThresholdMs??18e5,{existsSync:s,mkdirSync:c}=await import(`node:fs`),{resolve:l}=await import(`node:path`),{bootServer:m,ensureProjectGit:h,getLogger:g,isProcessAlive:_,readUiLock:v}=await import(`./dist-Bx5GgBdJ.mjs`),{resolveContentDir:y}=await import(`./paths-BtikHzQ1.mjs`),b=e.log??g(`start`),x=y(t,r);s(x)||(c(x,{recursive:!0}),b.info({contentDir:x},`Created content directory`));let S=!s(l(r,n)),C=i?void 0:async()=>{try{let{initContent:e}=await import(`./init-DGI17ChL.mjs`),t=e(r);return S||t.created.length>0}catch(e){return console.warn(`Auto-init failed:`,e instanceof Error?e.message:e),!1}},w=!1,T=l(x,n),E=t.server.openOnAgentEdit?()=>{if(w)return;let e=v(T);if(!e||e.port<=0||!_(e.pid))return;w=!0;let t=`http://localhost:${e.port}`;import(`./open-browser-BzMQ6cLf.mjs`).then(({openBrowser:e})=>e(t)).catch(()=>{})}:void 0,D=null,O=await m({contentDir:x,projectDir:r,contentRoot:t.content.dir,port:t.server.port,host:t.server.host,quiet:!1,debounce:t.persistence.debounceMs,maxDebounce:t.persistence.maxDebounceMs,includePatterns:t.content.include,excludePatterns:t.content.exclude,onAgentWrite:E,localOpCliArgs:[process.execPath,process.argv[1]],attachUiSibling:!0,idleShutdownMs:o,skipAutoInit:i,autoInitFn:C,ensureProjectGitFn:i?void 0:()=>h(r),spawnUiSiblingFn:async({lockDir:t})=>{if(D=u({uiLock:v(t),isAlive:_}),D.action===`spawn`&&!a)try{d({lockDir:t,cwd:r,spawn:e.spawn}),b.info({reason:D.reason},`[start] auto-spawned ok ui sibling`)}catch(e){console.warn(`[start] failed to auto-spawn ok ui: ${e instanceof Error?e.message:String(e)}`)}else D.action===`skip`&&b.info({port:D.port,pid:D.pid},`UI already running at port ${D.port}`)},idleShutdownHandler:e=>p({readUiLock:()=>v(O.lockDir),isAlive:_,killPid:(e,t)=>{process.kill(e,t)},destroy:e,log:b}),log:b});D||={action:`skip`,reason:`alive`,pid:0,port:0};let k=D,A=null;if(k.action===`skip`)A=k.port>0?k.port:null;else if(!a){let t=e.uiBindTimeoutMs??3e3;A=await f({readUiLock:()=>v(O.lockDir),now:Date.now,sleep:e=>new Promise(t=>setTimeout(t,e)),timeoutMs:t,pollIntervalMs:50}),A===null&&b.warn({timeoutMs:t},`[start] ok ui did not bind within timeout — banner falls back to API URL`)}return{httpServer:O.httpServer,destroy:O.destroy,lockDir:O.lockDir,contentDir:x,port:O.port,ready:O.ready,degraded:O.degraded,uiSpawnDecision:D,resolvedUiPort:A,didAutoInit:O.didAutoInit,didGitInit:O.didGitInit}}function h(r){return new e(`start`).description(`Start the knowledge base collab server`).option(`-p, --port <port>`,`Server port`,void 0).option(`-H, --host <host>`,`Server host`,void 0).option(`--open`,`Open browser after start`).option(`--no-init`,`Skip auto-scaffolding of ${n}/`).action(async e=>{let{renderBanner:i}=await import(`./banner-BxI1wnW9.mjs`),{dim:a,error:o,info:s,warning:c}=await import(`./colors-BnZ-i-vb.mjs`),l=r(),u=process.cwd();e.port!==void 0&&(l.server.port=Number(e.port)),e.host!==void 0&&(l.server.host=e.host);let d;try{d=await m({config:l,cwd:u,skipAutoInit:e.init===!1})}catch(e){let{ProjectGitInitError:t}=await import(`./dist-Bx5GgBdJ.mjs`);e instanceof t&&(console.error(o(`open-knowledge requires git to initialize a parent repo. Install git or run 'git init' yourself, then re-run.`)),e.stderr&&console.error(a(e.stderr.trim())),process.exit(1)),console.error(`${o(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let f=!1,p=async e=>{if(!f){f=!0,console.log(a(`\nShutting down (${e})...`));try{await d.destroy()}catch(e){console.error(`${o(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)}};process.once(`SIGINT`,()=>{p(`SIGINT`)}),process.once(`SIGTERM`,()=>{p(`SIGTERM`)});let h=`http://${l.server.host}:${d.port}`,g=l.server.host===`0.0.0.0`||l.server.host===`::`?`http://0.0.0.0:${d.port}`:void 0,_=d.resolvedUiPort,v=_!==null&&_>0?`http://${l.server.host}:${_}`:h;console.log(i({name:`open-knowledge`,version:t,localUrl:v,apiUrl:v===h?void 0:h,networkUrl:g})),d.didAutoInit&&(console.log(` ${s(`✓`)} Scaffolded ${n}/ (first run)`),console.log(` ${a("Tip: Run `open-knowledge init` to register MCP tools for Claude Code")}\n`));let y={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};d.ready.then(async()=>{if(d.degraded.length>0){console.log();for(let e of d.degraded){let t=y[e]??`${e} (check server logs for details)`;console.warn(` ${c(`⚠`)} ${c(e)}: ${a(t)}`)}console.log()}if(d.didAutoInit||d.didGitInit)if(d.didGitInit&&console.log(`\n ${s(`✓`)} Initialized git repo at ${u}/.git/ (default branch: main)`),d.didAutoInit)try{let{previewContent:e,formatPreviewBlock:t}=await import(`./preview-B9E3uOhO.mjs`),n=e({projectDir:u,contentDir:d.contentDir,include:l.content.include,exclude:l.content.exclude});console.log(`\n${t(n,u)}\n`)}catch(e){console.warn(`Content preview unavailable: ${e instanceof Error?e.message:String(e)}`)}else console.log();if(e.open){let{openBrowser:e}=await import(`./open-browser-BzMQ6cLf.mjs`);e(v)}}).catch(e=>{console.error(` ${o(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})})}export{d as a,u as i,m as n,h as o,p as r,l as s,f as t};
2
- //# sourceMappingURL=start-iqLai80L.mjs.map
1
+ import{t as e}from"./esm-29fM6BBO.mjs";import{i as t}from"./constants-Bypdthtt.mjs";import{p as n}from"./dist-DRC09WNZ.mjs";import{spawn as r}from"node:child_process";import{join as i}from"node:path";import{closeSync as a,existsSync as o,mkdirSync as s,openSync as c}from"node:fs";function l(){let e=process.execPath,t=process.argv[1];return t?{command:e,prefixArgs:[t]}:(console.warn(`[self-spawn] process.argv[1] is empty — falling back to \`npx @inkeep/open-knowledge\`. This re-introduces the version-drift surface that re-exec was fixing. Observed argv: ${JSON.stringify(process.argv)}`),{command:`npx`,prefixArgs:[`@inkeep/open-knowledge`]})}function u(e){return e.uiLock?e.isAlive(e.uiLock.pid)?{action:`skip`,reason:`alive`,pid:e.uiLock.pid,port:e.uiLock.port}:{action:`spawn`,reason:`stale`,stalePid:e.uiLock.pid}:{action:`spawn`,reason:`absent`}}function d(e){o(e.lockDir)||s(e.lockDir,{recursive:!0});let t=c(i(e.lockDir,`last-spawn-error.log`),`w`),n=e.spawn??r,{PORT:u,...d}=process.env,f=l();try{let r=n(f.command,[...f.prefixArgs,...e.args??[`ui`]],{detached:!0,stdio:[`ignore`,`ignore`,t],cwd:e.cwd,env:d});return r.unref(),r}finally{try{a(t)}catch{}}}async function f(e){let t=e.now()+e.timeoutMs;for(;e.now()<t;){let t=e.readUiLock();if(t&&t.port>0)return t.port;await e.sleep(e.pollIntervalMs)}let n=e.readUiLock();return n&&n.port>0?n.port:null}function p(e){let t=e.sigtermGraceMs??1e4,n=e.sigtermPollIntervalMs??200,r=e.sleep??(e=>new Promise(t=>setTimeout(t,e)));return async()=>{try{let i=e.readUiLock();if(i&&e.isAlive(i.pid))try{e.killPid(i.pid,`SIGTERM`),e.log?.info({pid:i.pid,port:i.port},`idle-shutdown: SIGTERM UI sibling`);let a=Date.now()+t;for(;Date.now()<a&&e.isAlive(i.pid);)await r(n);if(e.isAlive(i.pid))try{e.killPid(i.pid,`SIGKILL`),e.log?.warn({pid:i.pid,graceMs:t},`idle-shutdown: SIGTERM grace expired — escalated to SIGKILL`)}catch(t){e.log?.error({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: SIGKILL failed`)}}catch(t){e.log?.warn({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: failed to SIGTERM UI sibling`)}}catch(t){e.log?.warn({err:t instanceof Error?t.message:String(t)},`idle-shutdown: UI lookup failed; proceeding with destroy`)}await e.destroy()}}async function m(e){let{config:t,cwd:r}=e,i=e.skipAutoInit??!1,a=e.skipUiAutoSpawn??!1,o=e.idleThresholdMs??18e5,{existsSync:s,mkdirSync:c}=await import(`node:fs`),{resolve:l}=await import(`node:path`),{bootServer:m,ensureProjectGit:h,getLogger:g,isProcessAlive:_,readUiLock:v}=await import(`./dist-CUNdZ2_C.mjs`),{resolveContentDir:y}=await import(`./paths-DfUzFdTC.mjs`),b=e.log??g(`start`),x=y(t,r);s(x)||(c(x,{recursive:!0}),b.info({contentDir:x},`Created content directory`));let S=!s(l(r,n)),C=i?void 0:async()=>{try{let{initContent:e}=await import(`./init-GJP2EVzJ.mjs`),t=e(r);return S||t.created.length>0}catch(e){return console.warn(`Auto-init failed:`,e instanceof Error?e.message:e),!1}},w=!1,T=l(x,n),E=t.server.openOnAgentEdit?()=>{if(w)return;let e=v(T);if(!e||e.port<=0||!_(e.pid))return;w=!0;let t=`http://localhost:${e.port}`;import(`./open-browser-BzMQ6cLf.mjs`).then(({openBrowser:e})=>e(t)).catch(()=>{})}:void 0,D=null,O=await m({contentDir:x,projectDir:r,contentRoot:t.content.dir,port:t.server.port,host:t.server.host,quiet:!1,debounce:t.persistence.debounceMs,maxDebounce:t.persistence.maxDebounceMs,includePatterns:t.content.include,excludePatterns:t.content.exclude,onAgentWrite:E,localOpCliArgs:[process.execPath,process.argv[1]],attachUiSibling:!0,idleShutdownMs:o,skipAutoInit:i,autoInitFn:C,ensureProjectGitFn:i?void 0:()=>h(r),spawnUiSiblingFn:async({lockDir:t})=>{if(D=u({uiLock:v(t),isAlive:_}),D.action===`spawn`&&!a)try{d({lockDir:t,cwd:r,spawn:e.spawn}),b.info({reason:D.reason},`[start] auto-spawned ok ui sibling`)}catch(e){console.warn(`[start] failed to auto-spawn ok ui: ${e instanceof Error?e.message:String(e)}`)}else D.action===`skip`&&b.info({port:D.port,pid:D.pid},`UI already running at port ${D.port}`)},idleShutdownHandler:e=>p({readUiLock:()=>v(O.lockDir),isAlive:_,killPid:(e,t)=>{process.kill(e,t)},destroy:e,log:b}),log:b});D||={action:`skip`,reason:`alive`,pid:0,port:0};let k=D,A=null;if(k.action===`skip`)A=k.port>0?k.port:null;else if(!a){let t=e.uiBindTimeoutMs??3e3;A=await f({readUiLock:()=>v(O.lockDir),now:Date.now,sleep:e=>new Promise(t=>setTimeout(t,e)),timeoutMs:t,pollIntervalMs:50}),A===null&&b.warn({timeoutMs:t},`[start] ok ui did not bind within timeout — banner falls back to API URL`)}return{httpServer:O.httpServer,destroy:O.destroy,lockDir:O.lockDir,contentDir:x,port:O.port,ready:O.ready,degraded:O.degraded,uiSpawnDecision:D,resolvedUiPort:A,didAutoInit:O.didAutoInit,didGitInit:O.didGitInit}}function h(r){return new e(`start`).description(`Start the knowledge base collab server`).option(`-p, --port <port>`,`Server port`,void 0).option(`-H, --host <host>`,`Server host`,void 0).option(`--open`,`Open browser after start`).option(`--no-init`,`Skip auto-scaffolding of ${n}/`).action(async e=>{let{renderBanner:i}=await import(`./banner-BxI1wnW9.mjs`),{dim:a,error:o,info:s,warning:c}=await import(`./colors-BnZ-i-vb.mjs`),l=r(),u=process.cwd();e.port!==void 0&&(l.server.port=Number(e.port)),e.host!==void 0&&(l.server.host=e.host);let d;try{d=await m({config:l,cwd:u,skipAutoInit:e.init===!1})}catch(e){let{ProjectGitInitError:t}=await import(`./dist-CUNdZ2_C.mjs`);e instanceof t&&(console.error(o(`open-knowledge requires git to initialize a parent repo. Install git or run 'git init' yourself, then re-run.`)),e.stderr&&console.error(a(e.stderr.trim())),process.exit(1)),console.error(`${o(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let f=!1,p=async e=>{if(!f){f=!0,console.log(a(`\nShutting down (${e})...`));try{await d.destroy()}catch(e){console.error(`${o(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)}};process.once(`SIGINT`,()=>{p(`SIGINT`)}),process.once(`SIGTERM`,()=>{p(`SIGTERM`)});let h=`http://${l.server.host}:${d.port}`,g=l.server.host===`0.0.0.0`||l.server.host===`::`?`http://0.0.0.0:${d.port}`:void 0,_=d.resolvedUiPort,v=_!==null&&_>0?`http://${l.server.host}:${_}`:h;console.log(i({name:`open-knowledge`,version:t,localUrl:v,apiUrl:v===h?void 0:h,networkUrl:g})),d.didAutoInit&&(console.log(` ${s(`✓`)} Scaffolded ${n}/ (first run)`),console.log(` ${a("Tip: Run `open-knowledge init` to register MCP tools for Claude Code")}\n`));let y={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};d.ready.then(async()=>{if(d.degraded.length>0){console.log();for(let e of d.degraded){let t=y[e]??`${e} (check server logs for details)`;console.warn(` ${c(`⚠`)} ${c(e)}: ${a(t)}`)}console.log()}if(d.didAutoInit||d.didGitInit)if(d.didGitInit&&console.log(`\n ${s(`✓`)} Initialized git repo at ${u}/.git/ (default branch: main)`),d.didAutoInit)try{let{previewContent:e,formatPreviewBlock:t}=await import(`./preview-1YeKX_ki.mjs`),n=e({projectDir:u,contentDir:d.contentDir,include:l.content.include,exclude:l.content.exclude});console.log(`\n${t(n,u)}\n`)}catch(e){console.warn(`Content preview unavailable: ${e instanceof Error?e.message:String(e)}`)}else console.log();if(e.open){let{openBrowser:e}=await import(`./open-browser-BzMQ6cLf.mjs`);e(v)}}).catch(e=>{console.error(` ${o(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})})}export{d as a,u as i,m as n,h as o,p as r,l as s,f as t};
2
+ //# sourceMappingURL=start-BXOGxEm7.mjs.map
@@ -0,0 +1 @@
1
+ import{o as e}from"./start-BXOGxEm7.mjs";export{e as startCommand};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/open-knowledge",
3
- "version": "0.0.0-dev-20260427224203",
3
+ "version": "0.0.0-dev-20260428024726",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,2 +0,0 @@
1
- import"./dist-DRC09WNZ.mjs";var e=`0.0.0-dev-20260427224203`;const t=`config.yml`,n=`cache`,r=e,i=`open-knowledge`;export{r as i,t as n,i as r,n as t};
2
- //# sourceMappingURL=constants-BYPRF6Xi.mjs.map
@@ -1 +0,0 @@
1
- import{n as e,t}from"./init-DG1atKPS.mjs";export{t as ensureOkGitignoredAtRoot,e as initContent};
@@ -1 +0,0 @@
1
- import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./init-BqrZVrrc.mjs";export{o as detectInstalledEditors,n as formatInitResult,i as initCommand,t as readExistingMcpEntry,e as runInit,r as writeEditorMcpConfig,a as writeUserMcpConfigs};
@@ -1 +0,0 @@
1
- import{n as e}from"./loader-2_9PfZaf.mjs";export{e as loadConfig};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./paths-B-e6l9Cv.mjs";export{t as resolveContentDir,e as resolveLockDir};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./preview-B01l8vaj.mjs";export{t as formatPreviewBlock,e as previewContent};