ocean-brain 0.13.0 → 0.13.2

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 (48) hide show
  1. package/README.md +5 -3
  2. package/dist/index.js +12 -4
  3. package/package.json +10 -8
  4. package/server/client/dist/assets/{Calendar-CaeK7gTz.js → Calendar-DH3eSSRs.js} +1 -1
  5. package/server/client/dist/assets/{Note-CGI-Y1__.js → Note-CpzLtGVM.js} +1 -1
  6. package/server/client/dist/assets/{Search-DAYHxAml.js → Search-D9detGWk.js} +1 -1
  7. package/server/client/dist/assets/{Tag-CG8b0l1j.js → Tag-Bquqtx23.js} +1 -1
  8. package/server/client/dist/assets/{TagNotes-COyaVsdn.js → TagNotes-CbjfxqAN.js} +1 -1
  9. package/server/client/dist/assets/{Views-BPxlw3vk.js → Views-L4eC96Lx.js} +1 -1
  10. package/server/client/dist/assets/{app-BezcjTfd.js → app-BFM2V_Rx.js} +2 -2
  11. package/server/client/dist/assets/{index-CzZFedXj.js → index-CJPl3MJE.js} +1 -1
  12. package/server/client/dist/assets/{manage-image-detail-9hRTiAsR.js → manage-image-detail-BIDHUR5-.js} +1 -1
  13. package/server/client/dist/assets/mcp-D8footel.js +5 -0
  14. package/server/client/dist/assets/{note-core-DUTqUh5N.js → note-core-YhYEmI_R.js} +1 -1
  15. package/server/client/dist/assets/note-runtime-B3ats-dC.js +153 -0
  16. package/server/client/dist/assets/{note-ui-BaqzP-YU.js → note-ui-BtzPk8gA.js} +1 -1
  17. package/server/client/dist/assets/{placeholder-CZoqs4S3.js → placeholder-DKgxoe_f.js} +1 -1
  18. package/server/client/dist/assets/route-preload.js +2 -2
  19. package/server/client/dist/index.html +1 -1
  20. package/server/dist/app.js +91 -8
  21. package/server/dist/features/auth/http/api.js +9 -8
  22. package/server/dist/features/auth/http/pages.js +27 -28
  23. package/server/dist/features/auth/service.js +7 -27
  24. package/server/dist/features/cache/graphql/cache.type-defs.js +1 -1
  25. package/server/dist/features/image/http/upload.js +2 -2
  26. package/server/dist/features/mcp-admin/http/handlers.js +9 -9
  27. package/server/dist/features/note/http/mcp.js +17 -17
  28. package/server/dist/features/search/http/handlers.js +10 -10
  29. package/server/dist/features/search/search-manager.js +34 -6
  30. package/server/dist/features/tag/http/mcp.js +2 -2
  31. package/server/dist/modules/auth-guard.js +36 -53
  32. package/server/dist/modules/blocknote.js +16 -9
  33. package/server/dist/modules/error-handler.js +17 -20
  34. package/server/dist/modules/mcp-auth.js +50 -56
  35. package/server/dist/modules/rate-limit.js +23 -23
  36. package/server/dist/modules/server-events-handler.js +15 -13
  37. package/server/dist/modules/session-store.js +6 -8
  38. package/server/dist/paths.js +2 -1
  39. package/server/dist/routes/api.js +105 -71
  40. package/server/dist/routes/auth-pages.js +21 -11
  41. package/server/dist/routes/client.js +60 -72
  42. package/server/dist/routes/graphql.js +31 -26
  43. package/server/dist/routes/mcp.js +25 -35
  44. package/server/dist/server.js +14 -16
  45. package/server/client/dist/assets/mcp-ugdCKa6H.js +0 -4
  46. package/server/client/dist/assets/note-runtime-zN5ddTba.js +0 -168
  47. package/server/dist/modules/logger.js +0 -53
  48. package/server/dist/modules/use-async.js +0 -10
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Calendar-CaeK7gTz.js","assets/floating-ui.react-dom-BWTnA00G.js","assets/time-PxWila4-.js","assets/url-DKUMNVCI.js","assets/useNoteMutate-BjvZUmtX.js","assets/calendar-data-wB0ifXdo.js","assets/FileText.es-DPIwDCEe.js","assets/Callout-CcYyvHQP.js","assets/Info.es-CYxg-Vku.js","assets/preload-helper-BXl3LOEh.js","assets/Graph-hVj6vAYJ.js","assets/Views-BPxlw3vk.js","assets/tag.api-DEUROVKQ.js","assets/SurfaceCard-D5QxOte_.js","assets/ViewChip-BVkZAXyx.js","assets/ArrowRight.es-BlNsZQFs.js","assets/CheckCircle.es-Dqr3WImn.js","assets/Plus.es-Dy6onD-Z.js","assets/Reminders-DnuALBL6.js","assets/useReminderMutate-C5n-5LM-.js","assets/Graph-CdEu8eAn.js","assets/transform-BUB79_za.js","assets/isObject-U9U2HXiq.js","assets/toNumber-DE3J3kMD.js","assets/ordinal-Cboi1Yqb.js","assets/init-Gi6I4Gst.js","assets/colors-Cc3OSVma.js","assets/min-tv6RD-6E.js","assets/FlowArrow.es-Dxee98ir.js","assets/CaretUp.es-C8iY5OlB.js","assets/LinkSimple.es-B-P-7Iem.js","assets/Search-DAYHxAml.js","assets/AuxiliaryPanelHeader-HAttwVby.js","assets/search-admin-adapter-Daf7e2YQ.js","assets/File.es-CHtXXafR.js","assets/Tag-CG8b0l1j.js","assets/Note-CGI-Y1__.js","assets/NotePropertiesPanel-6P7UfRBR.js","assets/note-ui-BaqzP-YU.js","assets/note-core-DUTqUh5N.js","assets/note-runtime-zN5ddTba.js","assets/note-ui-DL8owV-U.css","assets/image.api-ChvlfuZg.js","assets/Copy.es-fMv0ETir.js","assets/TagNotes-COyaVsdn.js","assets/index-CzZFedXj.js","assets/mcp-admin-adapter-D0R8p9az.js","assets/Image.es-CjXY1JVf.js","assets/Trash.es-XEcWG_aq.js","assets/mcp-ugdCKa6H.js","assets/search-ddYl3qH-.js","assets/trash-BHida7BG.js","assets/manage-image-CSJ3Flgc.js","assets/image-delete-confirmation-D7xrODQV.js","assets/manage-image-detail-9hRTiAsR.js","assets/properties-B7Fv95qY.js","assets/placeholder-CZoqs4S3.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Calendar-DH3eSSRs.js","assets/floating-ui.react-dom-BWTnA00G.js","assets/time-PxWila4-.js","assets/url-DKUMNVCI.js","assets/useNoteMutate-BjvZUmtX.js","assets/calendar-data-wB0ifXdo.js","assets/FileText.es-DPIwDCEe.js","assets/Callout-CcYyvHQP.js","assets/Info.es-CYxg-Vku.js","assets/preload-helper-BXl3LOEh.js","assets/Graph-hVj6vAYJ.js","assets/Views-L4eC96Lx.js","assets/tag.api-DEUROVKQ.js","assets/SurfaceCard-D5QxOte_.js","assets/ViewChip-BVkZAXyx.js","assets/ArrowRight.es-BlNsZQFs.js","assets/CheckCircle.es-Dqr3WImn.js","assets/Plus.es-Dy6onD-Z.js","assets/Reminders-DnuALBL6.js","assets/useReminderMutate-C5n-5LM-.js","assets/Graph-CdEu8eAn.js","assets/transform-BUB79_za.js","assets/isObject-U9U2HXiq.js","assets/toNumber-DE3J3kMD.js","assets/ordinal-Cboi1Yqb.js","assets/init-Gi6I4Gst.js","assets/colors-Cc3OSVma.js","assets/min-tv6RD-6E.js","assets/FlowArrow.es-Dxee98ir.js","assets/CaretUp.es-C8iY5OlB.js","assets/LinkSimple.es-B-P-7Iem.js","assets/Search-D9detGWk.js","assets/AuxiliaryPanelHeader-HAttwVby.js","assets/search-admin-adapter-Daf7e2YQ.js","assets/File.es-CHtXXafR.js","assets/Tag-Bquqtx23.js","assets/Note-CpzLtGVM.js","assets/NotePropertiesPanel-6P7UfRBR.js","assets/note-ui-BtzPk8gA.js","assets/note-core-YhYEmI_R.js","assets/note-runtime-B3ats-dC.js","assets/note-ui-DL8owV-U.css","assets/image.api-ChvlfuZg.js","assets/Copy.es-fMv0ETir.js","assets/TagNotes-CbjfxqAN.js","assets/index-CJPl3MJE.js","assets/mcp-admin-adapter-D0R8p9az.js","assets/Image.es-CjXY1JVf.js","assets/Trash.es-XEcWG_aq.js","assets/mcp-D8footel.js","assets/search-ddYl3qH-.js","assets/trash-BHida7BG.js","assets/manage-image-CSJ3Flgc.js","assets/image-delete-confirmation-D7xrODQV.js","assets/manage-image-detail-BIDHUR5-.js","assets/properties-B7Fv95qY.js","assets/placeholder-DKgxoe_f.js"])))=>i.map(i=>d[i]);
2
2
  import{j as p,r as d,b as G,a as ut}from"./floating-ui.react-dom-BWTnA00G.js";import{q as As,t as Is,v as Ts,w as Ds,x as Ns,l as js,u as Vs,a as Os,b as ks,e as ar,o as Fs,s as Hs,j as Bs,n as $s,d as bo,m as Zs,h as zs,R as Us}from"./useNoteMutate-BjvZUmtX.js";import{aw as ze,ax as bt,ay as te,az as X,aA as yt,aB as We,aC as ir,aD as Ks,aE as Gs,aF as Ws,aG as qs,aH as Xs,aI as Ys,aJ as Qs,aK as Ue,aL as yo,aM as Js,aN as vn,aO as ea,aP as xo,aQ as ae,aR as wo,aS as ct,aT as ta,aU as na,aV as Ct,aW as oa,aX as V,aY as So,aZ as ra,a_ as sa,a$ as aa,b0 as ia,al as Ee,ah as Hn,b1 as ca,b2 as Ro,b3 as pe,b4 as bn,b5 as Ot,b6 as Bn,b7 as la,b8 as da,A as _t,f as qe,u as $n,b9 as ua,ba as ha,bb as fa,bc as pa,T as ne,x as yn,bd as cr,y as lt,be as lr,bf as ma,L as ga,K as va,g as B,c as ie,F as ba,q as xt,e as ya,i as dr,Q as ur,av as xa,l as ht,D as Gt,bg as wa,J as Sa,ar as Ra,O as Ea,N as Ca,h as _a,P as Pa,k as Ma,E as La,bh as Aa,bi as Ia,bj as Ta,bk as $,bl as Da,a1 as Pn,bm as Eo,bn as Na}from"./time-PxWila4-.js";import{_ as z}from"./preload-helper-BXl3LOEh.js";import{f as Pt,N as Zn,H as rn,V as zn,G as hr,C as fr,R as pr,e as mr,i as gr,T as vr,j as ja,g as Va,h as Oa,S as ka,c as Fa,b as Ha,d as Ba,a as $a}from"./url-DKUMNVCI.js";import{f as br,G as Za}from"./Graph-hVj6vAYJ.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function o(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const Un={DARK:"(prefers-color-scheme: dark)",LIGHT:"(prefers-color-scheme: light)",RETINA:"(min-resolution: 2dppx)",RESPONSIVE:e=>`screen and (max-width: ${e})`},yr=e=>typeof window<"u"&&window.matchMedia?window.matchMedia(e):null,Kn=(e,t,n=!0)=>{const o=yr(e);n&&t(o?.matches||!1);const r=s=>{t?.(s.matches)};return o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},za=(e,t=!0)=>Kn(Un.DARK,e,t),Ua=(e,t,n=!0)=>Kn(Un.RESPONSIVE(e),t,n),Ka={MEDIA_QUERY:Un,listenThemeChange:za,listenResponsiveChange:Ua,createMediaQuery:yr,listenMediaQueryChange:Kn};var N=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(N||{});function xr({update:e,notify:t,unwatched:n}){return{link:o,unlink:r,propagate:s,checkDirty:a,shallowPropagate:i};function o(c,u,h){const f=u.depsTail;if(f!==void 0&&f.dep===c)return;const m=f!==void 0?f.nextDep:u.deps;if(m!==void 0&&m.dep===c){m.version=h,u.depsTail=m;return}const g=c.subsTail;if(g!==void 0&&g.version===h&&g.sub===u)return;const v=u.depsTail=c.subsTail={version:h,dep:c,sub:u,prevDep:f,nextDep:m,prevSub:g,nextSub:void 0};m!==void 0&&(m.prevDep=v),f!==void 0?f.nextDep=v:u.deps=v,g!==void 0?g.nextSub=v:c.subs=v}function r(c,u=c.sub){const h=c.dep,f=c.prevDep,m=c.nextDep,g=c.nextSub,v=c.prevSub;return m!==void 0?m.prevDep=f:u.depsTail=f,f!==void 0?f.nextDep=m:u.deps=m,g!==void 0?g.prevSub=v:h.subsTail=v,v!==void 0?v.nextSub=g:(h.subs=g)===void 0&&n(h),m}function s(c){let u=c.nextSub,h;e:do{const f=c.sub;let m=f.flags;if(m&60?m&12?m&4?!(m&48)&&l(c,f)?(f.flags=m|40,m&=1):m=0:f.flags=m&-9|32:m=0:f.flags=m|32,m&2&&t(f),m&1){const g=f.subs;if(g!==void 0){const v=(c=g).nextSub;v!==void 0&&(h={value:u,prev:h},u=v);continue}}if((c=u)!==void 0){u=c.nextSub;continue}for(;h!==void 0;)if(c=h.value,h=h.prev,c!==void 0){u=c.nextSub;continue e}break}while(!0)}function a(c,u){let h,f=0,m=!1;e:do{const g=c.dep,v=g.flags;if(u.flags&16)m=!0;else if((v&17)===17){if(e(g)){const b=g.subs;b.nextSub!==void 0&&i(b),m=!0}}else if((v&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(h={value:c,prev:h}),c=g.deps,u=g,++f;continue}if(!m){const b=c.nextDep;if(b!==void 0){c=b;continue}}for(;f--;){const b=u.subs,y=b.nextSub!==void 0;if(y?(c=h.value,h=h.prev):c=b,m){if(e(u)){y&&i(b),u=c.sub;continue}m=!1}else u.flags&=-33;u=c.sub;const w=c.nextDep;if(w!==void 0){c=w;continue e}}return m}while(!0)}function i(c){do{const u=c.sub,h=u.flags;(h&48)===32&&(u.flags=h|16,(h&6)===2&&t(u))}while((c=c.nextSub)!==void 0)}function l(c,u){let h=u.depsTail;for(;h!==void 0;){if(h===c)return!0;h=h.prevDep}return!1}}let Gn=0,je=0,ft=0;const we=[],{link:ih,unlink:wr,propagate:ch,checkDirty:Ga,shallowPropagate:lh}=xr({update(e){return e.depsTail!==void 0?Ya(e):Qa(e)},notify(e){let t=ft,n=t;do if(we[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(ft=t;n<--t;){const o=we[n];we[n++]=we[t],we[t]=o}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,sn(e)):ti.call(e)}});function Wa(){return Gn}function qa(){++Gn}function Xa(){--Gn||ei()}function Ya(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,sn(e)}}function Qa(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Ja(e){const t=e.flags;if(t&16||t&32&&Ga(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,sn(e)}}else e.flags=2}function ei(){try{for(;je<ft;){const e=we[je];we[je++]=void 0,Ja(e)}}finally{for(;je<ft;){const e=we[je];we[je++]=void 0,e.flags|=10}je=0,ft=0}}function ti(){this.depsTail=void 0,this.flags=0,sn(this);const e=this.subs;e!==void 0&&wr(e)}function sn(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=wr(n,e)}function Wn(e,t,n){const o=typeof e=="object",r=o?e:void 0;return{next:(o?e.next:e)?.bind(r),error:(o?e.error:t)?.bind(r),complete:(o?e.complete:n)?.bind(r)}}const Mn=[];let zt=0;const{link:Co,unlink:ni,propagate:oi,checkDirty:Sr,shallowPropagate:_o}=xr({update(e){return e._update()},notify(e){Mn[Ln++]=e,e.flags&=~N.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=N.Mutable|N.Dirty,Wt(e))}});let kt=0,Ln=0,fe;function Wt(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=ni(n,e)}function Rr(){if(!(Wa()>0)){for(;kt<Ln;){const e=Mn[kt];Mn[kt++]=void 0,e.notify()}kt=0,Ln=0}}function Er(e,t){const n=typeof e=="function",o=e,r={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?N.None:N.Mutable,get(){return fe!==void 0&&Co(r,fe,zt),r._snapshot},subscribe(s){const a=Wn(s),i={current:!1},l=ri(()=>{r.get(),i.current?a.next?.(r._snapshot):i.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(s){const a=fe,i=Object.is;if(n)fe=r,++zt,r.depsTail=void 0;else if(s===void 0)return!1;n&&(r.flags=N.Mutable|N.RecursedCheck);try{const l=r._snapshot,c=typeof s=="function"?s(l):s===void 0&&n?o(l):s;return l===void 0||!i(l,c)?(r._snapshot=c,!0):!1}finally{fe=a,n&&(r.flags&=~N.RecursedCheck),Wt(r)}}};return n?(r.flags=N.Mutable|N.Dirty,r.get=function(){const s=r.flags;if(s&N.Dirty||s&N.Pending&&Sr(r.deps,r)){if(r._update()){const a=r.subs;a!==void 0&&_o(a)}}else s&N.Pending&&(r.flags=s&~N.Pending);return fe!==void 0&&Co(r,fe,zt),r._snapshot}):r.set=function(s){if(r._update(s)){const a=r.subs;a!==void 0&&(oi(a),_o(a),Rr())}},r}function ri(e){const t=()=>{const o=fe;fe=n,++zt,n.depsTail=void 0,n.flags=N.Watching|N.RecursedCheck;try{return e()}finally{fe=o,n.flags&=~N.RecursedCheck,Wt(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:N.Watching|N.RecursedCheck,notify(){const o=this.flags;o&N.Dirty||o&N.Pending&&Sr(this.deps,this)?t():this.flags=N.Watching},stop(){this.flags=N.None,this.depsTail=void 0,Wt(this)}};return t(),n}class si{constructor(t){this.atom=Er(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Wn(t))}}class ai{constructor(t){this.atom=Er(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Wn(t))}}function ii(e){return typeof e=="function"?new ai(e):new si(e)}function ci(e){try{qa(),e()}finally{Xa(),Rr()}}const De="__TSR_index",Po="popstate",Mo="beforeunload";function li(e){let t=e.getLocation();const n=new Set,o=a=>{t=e.getLocation(),n.forEach(i=>i({location:t,action:a}))},r=a=>{e.notifyOnIndexChange??!0?o(a):t=e.getLocation()},s=async({task:a,navigateOpts:i,...l})=>{if(i?.ignoreBlocker??!1){a();return}const u=e.getBlockers?.()??[],h=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&h)for(const f of u){const m=qt(l.path,l.state);if(await f.blockerFn({currentLocation:t,nextLocation:m,action:l.type})){e.onBlocked?.();return}}a()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:a=>(n.add(a),()=>{n.delete(a)}),push:(a,i,l)=>{const c=t.state[De];i=Lo(c+1,i),s({task:()=>{e.pushState(a,i),o({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:i})},replace:(a,i,l)=>{const c=t.state[De];i=Lo(c,i),s({task:()=>{e.replaceState(a,i),o({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:i})},go:(a,i)=>{s({task:()=>{e.go(a),r({type:"GO",index:a})},navigateOpts:i,type:"GO"})},back:a=>{s({task:()=>{e.back(a?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{s({task:()=>{e.forward(a?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[De]!==0,createHref:a=>e.createHref(a),block:a=>{if(!e.setBlockers)return()=>{};const i=e.getBlockers?.()??[];return e.setBlockers([...i,a]),()=>{const l=e.getBlockers?.()??[];e.setBlockers?.(l.filter(c=>c!==a))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:o}}function Lo(e,t){t||(t={});const n=qn();return{...t,key:n,__TSR_key:n,[De]:e}}function di(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,o=t.history.replaceState;let r=[];const s=()=>r,a=x=>r=x,i=(x=>x),l=(()=>qt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const x=qn();t.history.replaceState({[De]:0,key:x,__TSR_key:x},"")}let c=l(),u,h=!1,f=!1,m=!1,g=!1;const v=()=>c;let b,y;const w=()=>{b&&(E._ignoreSubscribers=!0,(b.isPush?t.history.pushState:t.history.replaceState)(b.state,"",b.href),E._ignoreSubscribers=!1,b=void 0,y=void 0,u=void 0)},R=(x,C,I)=>{const P=i(C);y||(u=c),c=qt(C,I),b={href:P,state:I,isPush:b?.isPush||x==="push"},y||(y=Promise.resolve().then(()=>w()))},S=x=>{c=l(),E.notify({type:x})},_=async()=>{if(f){f=!1;return}const x=l(),C=x.state[De]-c.state[De],I=C===1,P=C===-1,L=!I&&!P||h;h=!1;const K=L?"GO":P?"BACK":"FORWARD",D=L?{type:"GO",index:C}:{type:P?"BACK":"FORWARD"};if(m)m=!1;else{const le=s();if(typeof document<"u"&&le.length){for(const W of le)if(await W.blockerFn({currentLocation:c,nextLocation:x,action:K})){f=!0,t.history.go(1),E.notify(D);return}}}c=l(),E.notify(D)},M=x=>{if(g){g=!1;return}let C=!1;const I=s();if(typeof document<"u"&&I.length)for(const P of I){const L=P.enableBeforeUnload??!0;if(L===!0){C=!0;break}if(typeof L=="function"&&L()===!0){C=!0;break}}if(C)return x.preventDefault(),x.returnValue=""},E=li({getLocation:v,getLength:()=>t.history.length,pushState:(x,C)=>R("push",x,C),replaceState:(x,C)=>R("replace",x,C),back:x=>(x&&(m=!0),g=!0,t.history.back()),forward:x=>{x&&(m=!0),g=!0,t.history.forward()},go:x=>{h=!0,t.history.go(x)},createHref:x=>i(x),flush:w,destroy:()=>{t.history.pushState=n,t.history.replaceState=o,t.removeEventListener(Mo,M,{capture:!0}),t.removeEventListener(Po,_)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:s,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(Mo,M,{capture:!0}),t.addEventListener(Po,_),t.history.pushState=function(...x){const C=n.apply(t.history,x);return E._ignoreSubscribers||S("PUSH"),C},t.history.replaceState=function(...x){const C=o.apply(t.history,x);return E._ignoreSubscribers||S("REPLACE"),C},E}function ui(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function qt(e,t){const n=ui(e),o=n.indexOf("#"),r=n.indexOf("?"),s=qn();return{href:n,pathname:n.substring(0,o>0?r>0?Math.min(o,r):o:r>0?r:n.length),hash:o>-1?n.substring(o):"",search:r>-1?n.slice(r,o===-1?void 0:o):"",state:t||{[De]:0,key:s,__TSR_key:s}}}function qn(){return(Math.random()+1).toString(36).substring(7)}const hi=!1;function pt(e){let t;return ci(()=>{t=e()}),t}function fi(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const An="tsr-scroll-restoration-v1_3",pi=(e,t)=>{let n;return(...o)=>{n||(n=setTimeout(()=>{e(...o),n=null},t))}};function mi(){const e=fi();if(!e)return null;const t=e.getItem(An);let n=t?JSON.parse(t):{};return{state:n,set:o=>{n=ze(o,n)||n;try{e.setItem(An,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Ft=mi(),gi=e=>e.state.__TSR_key||e.href;function vi(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Xt=!1;function bi({storageKey:e,key:t,behavior:n,shouldScrollRestoration:o,scrollToTopSelectors:r,location:s}){let a;try{a=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(c){console.error(c);return}const i=t||window.history.state?.__TSR_key,l=a[i];Xt=!0;e:{if(o&&l&&Object.keys(l).length>0){for(const h in l){const f=l[h];if(h==="window")window.scrollTo({top:f.scrollY,left:f.scrollX,behavior:n});else if(h){const m=document.querySelector(h);m&&(m.scrollLeft=f.scrollX,m.scrollTop=f.scrollY)}}break e}const c=(s??window.location).hash.split("#",2)[1];if(c){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const f=document.getElementById(c);f&&f.scrollIntoView(h)}break e}const u={top:0,left:0,behavior:n};if(window.scrollTo(u),r)for(const h of r){if(h==="window")continue;const f=typeof h=="function"?h():document.querySelector(h);f&&f.scrollTo(u)}}Xt=!1}function yi(e,t){if(!Ft||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Ft))return;e.isScrollRestorationSetup=!0,Xt=!1;const o=e.options.getScrollRestorationKey||gi;window.history.scrollRestoration="manual";const r=s=>{if(Xt||!e.isScrollRestoring)return;let a="";if(s.target===document||s.target===window)a="window";else{const l=s.target.getAttribute("data-scroll-restoration-id");l?a=`[data-scroll-restoration-id="${l}"]`:a=vi(s.target)}const i=o(e.state.location);Ft.set(l=>{const c=l[i]||={},u=c[a]||={};if(a==="window")u.scrollX=window.scrollX||0,u.scrollY=window.scrollY||0;else if(a){const h=document.querySelector(a);h&&(u.scrollX=h.scrollLeft||0,u.scrollY=h.scrollTop||0)}return l})};typeof document<"u"&&document.addEventListener("scroll",pi(r,100),!0),e.subscribe("onRendered",s=>{const a=o(s.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(bi({storageKey:An,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Ft.set(i=>(i[a]||={},i)))})}function xi(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function wi(e,t=String){const n=new URLSearchParams;for(const o in e){const r=e[o];r!==void 0&&n.set(o,t(r))}return n.toString()}function xn(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Si(e){const t=new URLSearchParams(e),n={};for(const[o,r]of t.entries()){const s=n[o];s==null?n[o]=xn(r):Array.isArray(s)?s.push(xn(r)):n[o]=[s,xn(r)]}return n}const Ri=Ci(JSON.parse),Ei=_i(JSON.stringify,JSON.parse);function Ci(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=Si(t);for(const o in n){const r=n[o];if(typeof r=="string")try{n[o]=e(r)}catch{}}return n}}function _i(e,t){const n=typeof t=="function";function o(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(n&&typeof r=="string")try{return t(r),e(r)}catch{}return r}return r=>{const s=wi(r,o);return s?`?${s}`:""}}const In=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},an=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Ke=(e,t,n=!0)=>{const o={...e.router.options.context??{}},r=n?t:t-1;for(let s=0;s<=r;s++){const a=e.matches[s];if(!a)continue;const i=e.router.getMatch(a.id);i&&Object.assign(o,i.__routeContext,i.__beforeLoadContext)}return o},Ao=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,o=e.matches.findIndex(a=>a.routeId===e.router.routeTree.id),r=o>=0?o:0;let s=n?e.matches.findIndex(a=>a.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=r);for(let a=s;a>=0;a--){const i=e.matches[a];if(e.router.looseRoutesById[i.routeId].options.notFoundComponent)return a}return n?s:r},Te=(e,t,n)=>{if(!(!te(n)&&!X(n)))throw te(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:te(n)?"redirected":o.status==="pending"?"success":o.status,context:Ke(e,t.index),isFetching:!1,error:n})),X(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),te(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Cr=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,dt=(e,t,n,o)=>{const{id:r,routeId:s}=e.matches[t],a=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=o,e.firstBadMatchIndex??=t,Te(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(i){n=i,Te(e,e.router.getMatch(r),n)}e.updateMatch(r,i=>(i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,i._nonReactive.loadPromise?.resolve(),{...i,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!te(n)&&!X(n)&&(e.serialError??=n)},_r=(e,t,n,o)=>{if(o._nonReactive.pendingTimeout!==void 0)return;const r=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!an(e,t)&&(n.options.loader||n.options.beforeLoad||Mr(n))&&typeof r=="number"&&r!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const a=setTimeout(()=>{In(e)},r);o._nonReactive.pendingTimeout=a}},Pi=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;_r(e,t,n,o);const r=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&Te(e,s,s.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(r):r()},Mi=(e,t,n,o)=>{const r=e.router.getMatch(t),s=r._nonReactive.loadPromise;r._nonReactive.loadPromise=We(()=>{s?.resolve()});const{paramsError:a,searchError:i}=r;a&&dt(e,n,a,"PARSE_PARAMS"),i&&dt(e,n,i,"VALIDATE_SEARCH"),_r(e,t,o,r);const l=new AbortController;let c=!1;const u=()=>{c||(c=!0,e.updateMatch(t,S=>({...S,isFetching:"beforeLoad",fetchCount:S.fetchCount+1,abortController:l})))},h=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,S=>({...S,isFetching:!1}))};if(!o.options.beforeLoad){pt(()=>{u(),h()});return}r._nonReactive.beforeLoadPromise=We();const f={...Ke(e,n,!1),...r.__routeContext},{search:m,params:g,cause:v}=r,b=an(e,t),y={search:m,abortController:l,params:g,preload:b,context:f,location:e.location,navigate:S=>e.router.navigate({...S,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:b?"preload":v,matches:e.matches,routeId:o.id,...e.router.options.additionalContext},w=S=>{if(S===void 0){pt(()=>{u(),h()});return}(te(S)||X(S))&&(u(),dt(e,n,S,"BEFORE_LOAD")),pt(()=>{u(),e.updateMatch(t,_=>({..._,__beforeLoadContext:S})),h()})};let R;try{if(R=o.options.beforeLoad(y),bt(R))return u(),R.catch(S=>{dt(e,n,S,"BEFORE_LOAD")}).then(w)}catch(S){u(),dt(e,n,S,"BEFORE_LOAD")}w(R)},Li=(e,t)=>{const{id:n,routeId:o}=e.matches[t],r=e.router.looseRoutesById[o],s=()=>i(),a=()=>Mi(e,n,t,r),i=()=>{if(Cr(e,n))return;const l=Pi(e,n,r);return bt(l)?l.then(a):a()};return s()},Ai=(e,t,n)=>{const o=e.router.getMatch(t);if(!o||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([n.options.head?.(r),n.options.scripts?.(r),n.options.headers?.(r)]).then(([s,a,i])=>{const l=s?.meta,c=s?.links,u=s?.scripts,h=s?.styles;return{meta:l,links:c,headScripts:u,headers:i,scripts:a,styles:h}})},Pr=(e,t,n,o,r)=>{const s=t[o-1],{params:a,loaderDeps:i,abortController:l,cause:c}=e.router.getMatch(n),u=Ke(e,o),h=an(e,n);return{params:a,deps:i,preload:!!h,parentMatchPromise:s,abortController:l,context:u,location:e.location,navigate:f=>e.router.navigate({...f,_fromLocation:e.location}),cause:h?"preload":c,route:r,...e.router.options.additionalContext}},Io=async(e,t,n,o,r)=>{try{const s=e.router.getMatch(n);try{(!(hi??e.router.isServer)||s.ssr===!0)&&Yt(r);const a=r.options.loader?.(Pr(e,t,n,o,r)),i=r.options.loader&&bt(a);if((i||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,u=>({...u,isFetching:"loader"})),r.options.loader){const u=i?await a:a;Te(e,e.router.getMatch(n),u),u!==void 0&&e.updateMatch(n,h=>({...h,loaderData:u}))}r._lazyPromise&&await r._lazyPromise;const c=s._nonReactive.minPendingPromise;c&&await c,r._componentsPromise&&await r._componentsPromise,e.updateMatch(n,u=>({...u,error:void 0,context:Ke(e,o),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let i=a;if(i?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,c=>({...c,status:c.status==="pending"?"success":c.status,isFetching:!1,context:Ke(e,o)}));return}const l=s._nonReactive.minPendingPromise;l&&await l,X(a)&&await r.options.notFoundComponent?.preload?.(),Te(e,e.router.getMatch(n),a);try{r.options.onError?.(a)}catch(c){i=c,Te(e,e.router.getMatch(n),c)}e.updateMatch(n,c=>({...c,error:i,context:Ke(e,o),status:"error",isFetching:!1}))}}catch(s){const a=e.router.getMatch(n);a&&(a._nonReactive.loaderPromise=void 0),Te(e,a,s)}},Ii=async(e,t,n)=>{async function o(h,f,m,g){const v=Date.now()-f.updatedAt,b=h?g.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:g.options.staleTime??e.router.options.defaultStaleTime??0,y=g.options.shouldReload,w=typeof y=="function"?y(Pr(e,t,r,n,g)):y,{status:R,invalid:S}=m;a=R==="success"&&(S||(w??v>b)),h&&g.options.preload===!1||(a&&!e.sync?(i=!0,(async()=>{try{await Io(e,t,r,n,g);const _=e.router.getMatch(r);_._nonReactive.loaderPromise?.resolve(),_._nonReactive.loadPromise?.resolve(),_._nonReactive.loaderPromise=void 0}catch(_){te(_)&&await e.router.navigate(_.options)}})()):(R!=="success"||a&&e.sync)&&await Io(e,t,r,n,g))}const{id:r,routeId:s}=e.matches[n];let a=!1,i=!1;const l=e.router.looseRoutesById[s];if(!Cr(e,r)){const h=e.router.getMatch(r),f=an(e,r);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!e.sync&&!h.preload)return h;await h._nonReactive.loaderPromise;const m=e.router.getMatch(r),g=m._nonReactive.error||m.error;g&&Te(e,m,g),m.status==="pending"&&await o(f,h,m,l)}else{const m=f&&!e.router.state.matches.some(v=>v.id===r),g=e.router.getMatch(r);g._nonReactive.loaderPromise=We(),m!==g.preload&&e.updateMatch(r,v=>({...v,preload:m})),await o(f,h,g,l)}}const c=e.router.getMatch(r);i||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,i||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;const u=i?c.isFetching:!1;return u!==c.isFetching||c.invalid!==!1?(e.updateMatch(r,h=>({...h,isFetching:u,invalid:!1})),e.router.getMatch(r)):c};async function To(e){const t=e,n=[];t.router.state.matches.some(f=>f._forcePending)&&In(t);let o;for(let f=0;f<t.matches.length;f++){try{const m=Li(t,f);bt(m)&&await m}catch(m){if(te(m))throw m;if(X(m))o=m;else if(!t.preload)throw m;break}if(t.serialError)break}const r=t.firstBadMatchIndex??t.matches.length,s=o&&!t.preload?Ao(t,o):void 0,a=o&&t.preload?0:s!==void 0?Math.min(s+1,r):r;let i,l;for(let f=0;f<a;f++)n.push(Ii(t,n,f));try{await Promise.all(n)}catch{const f=await Promise.allSettled(n);for(const m of f){if(m.status!=="rejected")continue;const g=m.reason;if(te(g))throw g;X(g)?i??=g:l??=g}if(l!==void 0)throw l}const c=i??(o&&!t.preload?o:void 0);let u=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!c&&o&&t.preload)return t.matches;if(c){const f=Ao(t,c);yt(f!==void 0);const m=t.matches[f],g=t.router.looseRoutesById[m.routeId],v=t.router.options?.defaultNotFoundComponent;!g.options.notFoundComponent&&v&&(g.options.notFoundComponent=v),c.routeId=m.routeId;const b=m.routeId===t.router.routeTree.id;t.updateMatch(m.id,y=>({...y,...b?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),u=f,await Yt(g)}else if(!t.preload){const f=t.matches[0];f.globalNotFound||t.router.getMatch(f.id)?.globalNotFound&&t.updateMatch(f.id,g=>({...g,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const f=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Yt(f)}for(let f=0;f<=u;f++){const m=t.matches[f],{id:g,routeId:v}=m,b=t.router.looseRoutesById[v];try{const y=Ai(t,g,b);if(y){const w=await y;t.updateMatch(g,R=>({...R,...w}))}}catch(y){console.error(`Error executing head for route ${v}:`,y)}}const h=In(t);if(bt(h)&&await h,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function Yt(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...o}=t.options;Object.assign(e.options,o),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const o of Lr){const r=e.options[o]?.preload;r&&n.push(r())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Mr(e){for(const t of Lr)if(e.options[t]?.preload)return!0;return!1}const Lr=["component","errorComponent","pendingComponent","notFoundComponent"];function Ti(e){return{input:({url:t})=>{for(const n of e)t=Tn(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Ar(e[n],t);return t}}}function Di(e){const t=ir(e.basepath),n=`/${t}`,o=`${n}/`,r=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?o:o.toLowerCase();return{input:({url:a})=>{const i=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return i===r?a.pathname="/":i.startsWith(s)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=Ks(["/",t,a.pathname]),a)}}function Tn(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Ar(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Ve(e){const t=e.resolvedLocation,n=e.location,o=t?.pathname!==n.pathname,r=t?.href!==n.href,s=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:o,hrefChanged:r,hashChanged:s}}function Ni(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class ji{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{const o=this.options,r=this.basepath??o?.basepath??"/",s=this.basepath===void 0,a=o?.rewrite;if(this.options={...o,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Gs(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=di()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;this.resolvePathCache=Ws(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=ii(Oi(this.latestLocation)),yi(this));let i=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(s||r!==l||a!==c){this.basepath=l;const f=[],m=ir(l);m&&m!=="/"&&f.push(Di({basepath:l})),c&&f.push(c),this.rewrite=f.length===0?void 0:f.length===1?f[0]:Ti(f),this.history&&this.updateLatestLocation(),i=!0}i&&this.__store&&this.__store.setState(f=>({...f,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=qs(this.routeTree,this.options.caseSensitive,(o,r)=>{o.init({originalIndex:r})});return this.options.routeMasks&&Xs(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,o)=>{const r={eventType:n,fn:o};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=n=>{this.subscribers.forEach(o=>{o.eventType===n.type&&o.fn(n)})},this.parseLocation=(n,o)=>{const r=({pathname:l,search:c,hash:u,href:h,state:f})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const w=this.options.parseSearch(c),R=this.options.stringifySearch(w);return{href:l+R+u,publicHref:h,pathname:ct(l).path,external:!1,searchStr:R,search:ae(o?.search,w),hash:ct(u.slice(1)).path,state:ae(o?.state,f)}}const m=new URL(h,this.origin),g=Tn(this.rewrite,m),v=this.options.parseSearch(g.search),b=this.options.stringifySearch(v);return g.search=b,{href:g.href.replace(g.origin,""),publicHref:h,pathname:ct(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:b,search:ae(o?.search,v),hash:ct(g.hash.slice(1)).path,state:ae(o?.state,f)}},s=r(n),{__tempLocation:a,__tempKey:i}=s.state;if(a&&(!i||i===this.tempLocationKey)){const l=r(a);return l.state.key=s.state.key,l.state.__TSR_key=s.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:s}}return s},this.resolvePathWithBase=(n,o)=>Ys({base:n,to:Qs(o),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,o,r)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:o},r):this.matchRoutesInternal(n,o),this.getMatchedRoutes=n=>ki({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const o=this.getMatch(n);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(s=>s.status==="pending"),o=this.state.matches.filter(s=>s.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...o]).forEach(s=>{this.cancelMatch(s.id)})},this.buildLocation=n=>{const o=(s={})=>{const a=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(a);s.from;const l=s.unsafeRelative==="path"?a.pathname:s.from??i.fullPath,c=this.resolvePathWithBase(l,"."),u=i.search,h={...i.params},f=s.to?this.resolvePathWithBase(c,`${s.to}`):this.resolvePathWithBase(c,"."),m=s.params===!1||s.params===null?{}:(s.params??!0)===!0?h:Object.assign(h,ze(s.params,h)),g=this.getMatchedRoutes(f);let v=g.matchedRoutes;if((!g.foundRoute||g.foundRoute.path!=="/"&&g.routeParams["**"])&&this.options.notFoundRoute&&(v=[...v,this.options.notFoundRoute]),Object.keys(m).length>0)for(const P of v){const L=P.options.params?.stringify??P.options.stringifyParams;if(L)try{Object.assign(m,L(m))}catch{}}const y=n.leaveParams?f:ct(xo({path:f,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let w=u;if(n._includeValidateSearch&&this.options.search?.strict){const P={};v.forEach(L=>{if(L.options.validateSearch)try{Object.assign(P,Ut(L.options.validateSearch,{...P,...w}))}catch{}}),w=P}w=Fi({search:w,dest:s,destRoutes:v,_includeValidateSearch:n._includeValidateSearch}),w=ae(u,w);const R=this.options.stringifySearch(w),S=s.hash===!0?a.hash:s.hash?ze(s.hash,a.hash):void 0,_=S?`#${S}`:"";let M=s.state===!0?a.state:s.state?ze(s.state,a.state):{};M=ae(a.state,M);const E=`${y}${R}${_}`;let x,C,I=!1;if(this.rewrite){const P=new URL(E,this.origin),L=Ar(this.rewrite,P);x=P.href.replace(P.origin,""),L.origin!==this.origin?(C=L.href,I=!0):C=L.pathname+L.search+L.hash}else x=oa(E),C=x;return{publicHref:C,href:x,pathname:y,search:w,searchStr:R,state:M,hash:S??"",external:I,unmaskOnReload:s.unmaskOnReload}},r=(s={},a)=>{const i=o(s);let l=a?o(a):void 0;if(!l){const c={};if(this.options.routeMasks){const u=ta(i.pathname,this.processedTree);if(u){Object.assign(c,u.rawParams);const{from:h,params:f,...m}=u.route,g=f===!1||f===null?{}:(f??!0)===!0?c:Object.assign(c,ze(f,c));a={from:n.from,...m,params:g},l=o(a)}}}return l&&(i.maskedLocation=l),i};return n.mask?r(n,{from:n.from,...n.mask}):r(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:o,...r})=>{const s=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(u=>{r.state[u]=this.latestLocation.state[u]});const c=vn(r.state,this.latestLocation.state);return l.forEach(u=>{delete r.state[u]}),c},a=Ue(this.latestLocation.href)===Ue(r.href),i=this.commitLocationPromise;if(this.commitLocationPromise=We(()=>{i?.resolve()}),a&&s())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...u}=r;l&&(u={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[r.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:o})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:o,hashScrollIntoView:r,viewTransition:s,ignoreBlocker:a,href:i,...l}={})=>{if(i){const h=this.history.location.state.__TSR_index,f=qt(i,{__TSR_index:n?h:h+1}),m=new URL(f.pathname,this.origin),g=Tn(this.rewrite,m);l.to=g.pathname,l.search=this.options.parseSearch(f.search),l.hash=f.hash.slice(1)}const c=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const u=this.commitLocation({...c,viewTransition:s,replace:n,resetScroll:o,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=async({to:n,reloadDocument:o,href:r,publicHref:s,...a})=>{let i=!1;if(r)try{new URL(`${r}`),i=!0}catch{}if(i&&!o&&(o=!0),o){if(n!==void 0||!r){const c=this.buildLocation({to:n,...a});r=r??c.publicHref,s=s??c.publicHref}const l=!i&&s?s:r;if(yo(l,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const u=this.history.getBlockers?.()??[];for(const h of u)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(l):window.location.href=l,Promise.resolve()}return this.buildAndCommitLocation({...a,href:r,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(o=>({...o,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:o.cachedMatches.filter(r=>!n.some(s=>s.id===r.id))}))},this.load=async n=>{let o,r,s;for(s=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();const l=this.latestLocation,c=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Ve({resolvedLocation:c,location:l})}),this.emit({type:"onBeforeLoad",...Ve({resolvedLocation:c,location:l})}),await To({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:l,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let u=[],h=[],f=[],m=[];pt(()=>{this.__store.setState(g=>{const v=g.matches,b=g.pendingMatches||g.matches;return u=v.filter(y=>!b.some(w=>w.id===y.id)),h=v.filter(y=>!b.some(w=>w.routeId===y.routeId)),f=b.filter(y=>!v.some(w=>w.routeId===y.routeId)),m=b.filter(y=>v.some(w=>w.routeId===y.routeId)),{...g,isLoading:!1,loadedAt:Date.now(),matches:b,pendingMatches:void 0,cachedMatches:[...g.cachedMatches,...u.filter(y=>y.status!=="error"&&y.status!=="notFound"&&y.status!=="redirected")]}}),this.clearExpiredCache()}),[[h,"onLeave"],[f,"onEnter"],[m,"onStay"]].forEach(([g,v])=>{g.forEach(b=>{this.looseRoutesById[b.routeId].options[v]?.(b)})})})})}})}catch(l){te(l)?(o=l,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):X(l)&&(r=l),this.__store.setState(c=>({...c,statusCode:o?o.status:r?404:c.matches.some(u=>u.status==="error")?500:200,redirect:o}))}this.latestLoadPromise===s&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(i=>i.status==="error")&&(a=500),a!==void 0&&this.__store.setState(i=>({...i,statusCode:a}))},this.startViewTransition=n=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,a=this.state.resolvedLocation,i=typeof o.types=="function"?o.types(Ve({resolvedLocation:a,location:s})):o.types;if(i===!1){n();return}r={update:n,types:i}}else r=n;document.startViewTransition(r)}else n()},this.updateMatch=(n,o)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(s=>s.id===n)?"pendingMatches":this.state.matches.some(s=>s.id===n)?"matches":this.state.cachedMatches.some(s=>s.id===n)?"cachedMatches":"";r&&(r==="cachedMatches"?this.__store.setState(s=>({...s,cachedMatches:Ni(s.cachedMatches.map(a=>a.id===n?o(a):a))})):this.__store.setState(s=>({...s,[r]:s[r]?.map(a=>a.id===n?o(a):a)})))})},this.getMatch=n=>{const o=r=>r.id===n;return this.state.cachedMatches.find(o)??this.state.pendingMatches?.find(o)??this.state.matches.find(o)},this.invalidate=n=>{const o=r=>n?.filter?.(r)??!0?{...r,invalid:!0,...n?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(o),cachedMatches:r.cachedMatches.map(o),pendingMatches:r.pendingMatches?.map(o)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const o=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const r=n.options._builtLocation??this.buildLocation(n.options),s=this.getParsedLocationHref(r);n.options.href=s,n.headers.set("Location",s)}else if(o)try{const r=new URL(o);if(this.origin&&r.origin===this.origin){const s=r.pathname+r.search+r.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}if(n.options.href&&!n.options._builtLocation&&yo(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const o=n?.filter;o!==void 0?this.__store.setState(r=>({...r,cachedMatches:r.cachedMatches.filter(s=>!o(s))})):this.__store.setState(r=>({...r,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=o=>{const r=this.looseRoutesById[o.routeId];if(!r.options.loader)return!0;const s=(o.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:Date.now()-o.updatedAt>=s};this.clearCache({filter:n})},this.loadRouteChunk=Yt,this.preloadRoute=async n=>{const o=n._builtLocation??this.buildLocation(n);let r=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:n});const s=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(i=>i.id)),a=new Set([...s,...this.state.cachedMatches.map(i=>i.id)]);pt(()=>{r.forEach(i=>{a.has(i.id)||this.__store.setState(l=>({...l,cachedMatches:[...l.cachedMatches,i]}))})});try{return r=await To({router:this,matches:r,location:o,preload:!0,updateMatch:(i,l)=>{s.has(i)?r=r.map(c=>c.id===i?l(c):c):this.updateMatch(i,l)}}),r}catch(i){if(te(i))return i.options.reloadDocument?void 0:await this.preloadRoute({...i.options,_fromLocation:o});X(i)||console.error(i);return}},this.matchRoute=(n,o)=>{const r={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(r);if(o?.pending&&this.state.status!=="pending")return!1;const i=(o?.pending===void 0?!this.state.isLoading:o.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=Js(s.pathname,o?.caseSensitive??!1,o?.fuzzy??!1,i.pathname,this.processedTree);return!l||n.params&&!vn(l.rawParams,n.params,{partial:!0})?!1:o?.includeSearch??!0?vn(i.search,s.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Ei,parseSearch:t.parseSearch??Ri,protocolAllowlist:t.protocolAllowlist??ea}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:o}){this.routesById=t,this.routesByPath=n,this.processedTree=o;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,n){const o=this.getMatchedRoutes(t.pathname),{foundRoute:r,routeParams:s,parsedParams:a}=o;let{matchedRoutes:i}=o,l=!1;(r?r.path!=="/"&&s["**"]:Ue(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:l=!0);const c=l?Bi(this.options.notFoundMode,i):void 0,u=new Array(i.length),h=new Map(this.state.matches.map(f=>[f.routeId,f]));for(let f=0;f<i.length;f++){const m=i[f],g=u[f-1];let v,b,y;{const D=g?.search??t.search,le=g?._strictSearch??void 0;try{const W=Ut(m.options.validateSearch,{...D})??void 0;v={...D,...W},b={...le,...W},y=void 0}catch(W){let k=W;if(W instanceof Qt||(k=new Qt(W.message,{cause:W})),n?.throwOnError)throw k;v=D,b={},y=k}}const w=m.options.loaderDeps?.({search:v})??"",R=w?JSON.stringify(w):"",{interpolatedPath:S,usedParams:_}=xo({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),M=m.id+S+R,E=this.getMatch(M),x=h.get(m.id),C=E?._strictParams??_;let I;if(!E)try{Do(m,_,a,C)}catch(D){if(X(D)||te(D)?I=D:I=new Vi(D.message,{cause:D}),n?.throwOnError)throw I}Object.assign(s,C);const P=x?"stay":"enter";let L;if(E)L={...E,cause:P,params:x?.params??s,_strictParams:C,search:x?ae(x.search,v):ae(E.search,v),_strictSearch:b};else{const D=m.options.loader||m.options.beforeLoad||m.lazyFn||Mr(m)?"pending":"success";L={id:M,ssr:m.options.ssr,index:f,routeId:m.id,params:x?.params??s,_strictParams:C,pathname:S,updatedAt:Date.now(),search:x?ae(x.search,v):v,_strictSearch:b,searchError:void 0,status:D,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:We()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:P,loaderDeps:x?ae(x.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(L.globalNotFound=c===m.id),L.searchError=y;const K=this.getParentContext(g);L.context={...K,...L.__routeContext,...L.__beforeLoadContext},u[f]=L}for(let f=0;f<u.length;f++){const m=u[f],g=this.looseRoutesById[m.routeId],v=this.getMatch(m.id),b=h.get(m.routeId);if(m.params=b?ae(b.params,s):s,!v){const y=u[f-1],w=this.getParentContext(y);if(g.options.context){const R={deps:m.loaderDeps,params:m.params,context:w??{},location:t,navigate:S=>this.navigate({...S,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:u,routeId:g.id};m.__routeContext=g.options.context(R)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return u}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:o,parsedParams:r}=this.getMatchedRoutes(t.pathname),s=wo(n),a={...t.search};for(const u of n)try{Object.assign(a,Ut(u.options.validateSearch,a))}catch{}const i=wo(this.state.matches),l=i&&i.routeId===s.id&&t.pathname===this.state.location.pathname;let c;if(l)c=i.params;else{const u={...o};for(const h of n)try{Do(h,o,r??{},u)}catch{}c=u}return{matchedRoutes:n,fullPath:s.fullPath,search:a,params:c}}}class Qt extends Error{}class Vi extends Error{}function Oi(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ut(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Qt("Async validation not supported");if(n.issues)throw new Qt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function ki({pathname:e,routesById:t,processedTree:n}){const o={},r=Ue(e);let s,a;const i=na(r,n,!0);return i&&(s=i.route,Object.assign(o,i.rawParams),a=Object.assign({},i.parsedParams)),{matchedRoutes:i?.branch||[t[Ct]],routeParams:o,foundRoute:s,parsedParams:a}}function Fi({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){return Hi(n)(e,t,o??!1)}function Hi(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of e){if("search"in r.options)r.options.search?.middlewares&&t.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const s=({search:a,next:i})=>{let l=a;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(l=r.options.preSearchFilters.reduce((u,h)=>h(u),a));const c=i(l);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((u,h)=>h(u),c):c};t.middlewares.push(s)}if(r.options.validateSearch){const s=({search:a,next:i})=>{const l=i(a);if(!t._includeValidateSearch)return l;try{return{...l,...Ut(r.options.validateSearch,l)??void 0}}catch{return l}};t.middlewares.push(s)}}const n=({search:r})=>{const s=t.dest;return s.search?s.search===!0?r:ze(s.search,r):{}};t.middlewares.push(n);const o=(r,s,a)=>{if(r>=a.length)return s;const i=a[r];return i({search:s,next:c=>o(r+1,c,a)})};return function(s,a,i){return t.dest=a,t._includeValidateSearch=i,o(0,s,t.middlewares)}}function Bi(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const o=t[n];if(o.children)return o.id}return Ct}function Do(e,t,n,o){const r=e.options.params?.parse??e.options.parseParams;if(r)if(e.options.skipRouteOnParseError)for(const s in t)s in n&&(o[s]=n[s]);else{const s=r(o);Object.assign(o,s)}}function Xn(e){const t=e.errorComponent??Yn;return p.jsx($i,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?d.createElement(t,{error:n,reset:o}):e.children})}class $i extends d.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Yn({error:e}){const[t,n]=d.useState(!1);return p.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[p.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),p.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(o=>!o),children:t?"Hide Error":"Show Error"})]}),p.jsx("div",{style:{height:".25rem"}}),t?p.jsx("div",{children:p.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?p.jsx("code",{children:e.message}):null})}):null]})}function No(e){return typeof e=="object"?new jo(e,{silent:!0}).createRoute(e):new jo(e,{silent:!0}).createRoute}class jo{constructor(t,n){this.path=t,this.createRoute=o=>{const r=V(o);return r.isRoot=!1,r},this.silent=n?.silent}}class Vo{constructor(t){this.useMatch=n=>So({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>So({from:this.options.id,select:o=>n?.select?n.select(o.context):o.context}),this.useSearch=n=>ra({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>sa({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>aa({...n,from:this.options.id}),this.useLoaderData=n=>ia({...n,from:this.options.id}),this.useNavigate=()=>{const n=Ee();return Hn({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Oo(e){return typeof e=="object"?new Vo(e):t=>new Vo({id:e,...t})}function U(e,t){let n,o,r,s;const a=()=>(n||(n=e().then(l=>{n=void 0,o=l.default}).catch(l=>{if(r=l,ca(r)&&r instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const c=`tanstack_router_reload:${r.message}`;sessionStorage.getItem(c)||(sessionStorage.setItem(c,"1"),s=!0)}})),n),i=function(c){if(s)throw window.location.reload(),new Promise(()=>{});if(r)throw r;if(!o)if(Ro)Ro(a());else throw a();return d.createElement(o,c)};return i.preload=a,i}function Zi(){const e=Ee(),t=d.useRef({router:e,mounted:!1}),[n,o]=d.useState(!1),{hasPendingMatches:r,isLoading:s}=pe({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),a=bn(s),i=s||n||r,l=bn(i),c=s||r,u=bn(c);return e.startTransition=h=>{o(!0),d.startTransition(()=>{h(),o(!1)})},d.useEffect(()=>{const h=e.history.subscribe(e.load),f=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ue(e.latestLocation.publicHref)!==Ue(f.publicHref)&&e.commitLocation({...f,replace:!0}),()=>{h()}},[e,e.history]),Ot(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(f){console.error(f)}})()},[e]),Ot(()=>{a&&!s&&e.emit({type:"onLoad",...Ve(e.state)})},[a,e,s]),Ot(()=>{u&&!c&&e.emit({type:"onBeforeRouteMount",...Ve(e.state)})},[c,u,e]),Ot(()=>{if(l&&!i){const h=Ve(e.state);e.emit({type:"onResolved",...h}),e.__store.setState(f=>({...f,status:"idle",resolvedLocation:f.location})),h.hrefChanged&&xi(e)}},[i,l,e]),null}function zi(e){const t=pe({select:n=>`not-found-${n.location.pathname}-${n.status}`});return p.jsx(Xn,{getResetKey:()=>t,onCatch:(n,o)=>{if(X(n))e.onCatch?.(n,o);else throw n},errorComponent:({error:n})=>{if(X(n))return e.fallback?.(n);throw n},children:e.children})}function Ui(){return p.jsx("p",{children:"Not Found"})}function Ze(e){return p.jsx(p.Fragment,{children:e.children})}function Ir(e,t,n){return t.options.notFoundComponent?p.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?p.jsx(e.options.defaultNotFoundComponent,{...n}):p.jsx(Ui,{})}function Ki(){return Ee().isScrollRestoring,null}const Tr=d.memo(function({matchId:t}){const n=Ee(),o=pe({select:v=>{const b=v.matches.findIndex(w=>w.id===t),y=v.matches[b];return yt(y),{routeId:y.routeId,ssr:y.ssr,_displayPending:y._displayPending,resetKey:v.loadedAt,parentRouteId:v.matches[b-1]?.routeId}},structuralSharing:!0}),r=n.routesById[o.routeId],s=r.options.pendingComponent??n.options.defaultPendingComponent,a=s?p.jsx(s,{}):null,i=r.options.errorComponent??n.options.defaultErrorComponent,l=r.options.onCatch??n.options.defaultOnCatch,c=r.isRoot?r.options.notFoundComponent??n.options.notFoundRoute?.options.component:r.options.notFoundComponent,u=o.ssr===!1||o.ssr==="data-only",h=(!r.isRoot||r.options.wrapInSuspense||u)&&(r.options.wrapInSuspense??s??(r.options.errorComponent?.preload||u))?d.Suspense:Ze,f=i?Xn:Ze,m=c?zi:Ze,g=r.isRoot?r.options.shellComponent??Ze:Ze;return p.jsxs(g,{children:[p.jsx(Bn.Provider,{value:t,children:p.jsx(h,{fallback:a,children:p.jsx(f,{getResetKey:()=>o.resetKey,errorComponent:i||Yn,onCatch:(v,b)=>{if(X(v))throw v;l?.(v,b)},children:p.jsx(m,{fallback:v=>{if(!c||v.routeId&&v.routeId!==o.routeId||!v.routeId&&!r.isRoot)throw v;return d.createElement(c,v)},children:u||o._displayPending?p.jsx(la,{fallback:a,children:p.jsx(ko,{matchId:t})}):p.jsx(ko,{matchId:t})})})})}),o.parentRouteId===Ct&&n.options.scrollRestoration?p.jsxs(p.Fragment,{children:[p.jsx(Gi,{}),p.jsx(Ki,{})]}):null]})});function Gi(){const e=Ee(),t=d.useRef(void 0);return p.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Ve(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const ko=d.memo(function({matchId:t}){const n=Ee(),{match:o,key:r,routeId:s}=pe({select:l=>{const c=l.matches.find(g=>g.id===t),u=c.routeId,f=(n.routesById[u].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:u,loaderDeps:c.loaderDeps,params:c._strictParams,search:c._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:u,match:{id:c.id,status:c.status,error:c.error,invalid:c.invalid,_forcePending:c._forcePending,_displayPending:c._displayPending}}},structuralSharing:!0}),a=n.routesById[s],i=d.useMemo(()=>{const l=a.options.component??n.options.defaultComponent;return l?p.jsx(l,{},r):p.jsx(Dr,{})},[r,a.options.component,n.options.defaultComponent]);if(o._displayPending)throw n.getMatch(o.id)?._nonReactive.displayPendingPromise;if(o._forcePending)throw n.getMatch(o.id)?._nonReactive.minPendingPromise;if(o.status==="pending"){const l=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(l){const c=n.getMatch(o.id);if(c&&!c._nonReactive.minPendingPromise){const u=We();c._nonReactive.minPendingPromise=u,setTimeout(()=>{u.resolve(),c._nonReactive.minPendingPromise=void 0},l)}}throw n.getMatch(o.id)?._nonReactive.loadPromise}if(o.status==="notFound")return yt(X(o.error)),Ir(n,a,o.error);if(o.status==="redirected")throw yt(te(o.error)),n.getMatch(o.id)?._nonReactive.loadPromise;if(o.status==="error")throw o.error;return i}),Dr=d.memo(function(){const t=Ee(),n=d.useContext(Bn),o=pe({select:c=>c.matches.find(u=>u.id===n)?.routeId}),r=t.routesById[o],s=pe({select:c=>{const h=c.matches.find(f=>f.id===n);return yt(h),h.globalNotFound}}),a=pe({select:c=>{const u=c.matches,h=u.findIndex(f=>f.id===n);return u[h+1]?.id}}),i=t.options.defaultPendingComponent?p.jsx(t.options.defaultPendingComponent,{}):null;if(s)return Ir(t,r,void 0);if(!a)return null;const l=p.jsx(Tr,{matchId:a});return o===Ct?p.jsx(d.Suspense,{fallback:i,children:l}):l});function Wi(){const e=Ee(),n=e.routesById[Ct].options.pendingComponent??e.options.defaultPendingComponent,o=n?p.jsx(n,{}):null,r=typeof document<"u"&&e.ssr?Ze:d.Suspense,s=p.jsxs(r,{fallback:o,children:[p.jsx(Zi,{}),p.jsx(qi,{})]});return e.options.InnerWrap?p.jsx(e.options.InnerWrap,{children:s}):s}function qi(){const e=Ee(),t=pe({select:r=>r.matches[0]?.id}),n=pe({select:r=>r.loadedAt}),o=t?p.jsx(Tr,{matchId:t}):null;return p.jsx(Bn.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:p.jsx(Xn,{getResetKey:()=>n,errorComponent:Yn,onCatch:void 0,children:o})})}const Xi=e=>new Yi(e);class Yi extends ji{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=No,globalThis.createLazyFileRoute=Oo):typeof window<"u"&&(window.createFileRoute=No,window.createLazyFileRoute=Oo);function Qi({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const o=p.jsx(da.Provider,{value:e,children:t});return e.options.Wrap?p.jsx(e.options.Wrap,{children:o}):o}function Ji({router:e,...t}){return p.jsx(Qi,{router:e,...t,children:p.jsx(Wi,{})})}function cn(e){return pe({select:t=>e?.select?e.select(t.location):t.location})}const ec=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,28H188V24a12,12,0,0,0-24,0v4H92V24a12,12,0,0,0-24,0v4H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28ZM68,52a12,12,0,0,0,24,0h72a12,12,0,0,0,24,0h16V76H52V52ZM52,204V100H204V204Zm60-80v56a12,12,0,0,1-24,0V143.32a12,12,0,0,1-9.37-22l16-8A12,12,0,0,1,112,124Zm61.49,33.88L163.9,168H168a12,12,0,0,1,0,24H136a12,12,0,0,1-8.71-20.25L155.45,142a4,4,0,0,0,.55-2,4,4,0,0,0-7.47-2,12,12,0,0,1-20.78-12A28,28,0,0,1,180,140a27.77,27.77,0,0,1-5.64,16.86A10.63,10.63,0,0,1,173.49,157.88Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,48V88H40V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z",opacity:"0.2"}),d.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Zm-96-88v64a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm59.16,30.45L152,176h16a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136,23.76,23.76,0,0,1,171.16,150.45Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM112,184a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm56-8a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136a23.76,23.76,0,0,1-4.84,14.45L152,176ZM48,80V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,34H182V24a6,6,0,0,0-12,0V34H86V24a6,6,0,0,0-12,0V34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34ZM48,46H74V56a6,6,0,0,0,12,0V46h84V56a6,6,0,0,0,12,0V46h26a2,2,0,0,1,2,2V82H46V48A2,2,0,0,1,48,46ZM208,210H48a2,2,0,0,1-2-2V94H210V208A2,2,0,0,1,208,210Zm-98-90v64a6,6,0,0,1-12,0V129.71l-7.32,3.66a6,6,0,1,1-5.36-10.74l16-8A6,6,0,0,1,110,120Zm59.57,29.25L148,178h20a6,6,0,0,1,0,12H136a6,6,0,0,1-4.8-9.6L160,142a10,10,0,1,0-16.65-11A6,6,0,1,1,133,125a22,22,0,1,1,36.62,24.26Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Zm-96-88v64a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm59.16,30.45L152,176h16a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136,23.76,23.76,0,0,1,171.16,150.45Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,36H180V24a4,4,0,0,0-8,0V36H84V24a4,4,0,0,0-8,0V36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36ZM48,44H76V56a4,4,0,0,0,8,0V44h88V56a4,4,0,0,0,8,0V44h28a4,4,0,0,1,4,4V84H44V48A4,4,0,0,1,48,44ZM208,212H48a4,4,0,0,1-4-4V92H212V208A4,4,0,0,1,208,212ZM108,120v64a4,4,0,0,1-8,0V126.47l-10.21,5.11a4,4,0,0,1-3.58-7.16l16-8A4,4,0,0,1,108,120Zm60,28-24,32h24a4,4,0,0,1,0,8H136a4,4,0,0,1-3.2-6.4l28.78-38.37A11.88,11.88,0,0,0,164,136a12,12,0,0,0-22.4-6,4,4,0,0,1-6.92-4A20,20,0,0,1,172,136,19.79,19.79,0,0,1,168,148Z"}))]]),tc=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M108,60A16,16,0,1,1,92,44,16,16,0,0,1,108,60Zm56,16a16,16,0,1,0-16-16A16,16,0,0,0,164,76ZM92,112a16,16,0,1,0,16,16A16,16,0,0,0,92,112Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,112ZM92,180a16,16,0,1,0,16,16A16,16,0,0,0,92,180Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,180Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32V224a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V32A16,16,0,0,1,64,16H192A16,16,0,0,1,208,32Z",opacity:"0.2"}),d.createElement("path",{d:"M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M192,16H64A16,16,0,0,0,48,32V224a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V32A16,16,0,0,0,192,16ZM100,200a12,12,0,1,1,12-12A12,12,0,0,1,100,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,80Zm56,120a12,12,0,1,1,12-12A12,12,0,0,1,156,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,80Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M102,60A10,10,0,1,1,92,50,10,10,0,0,1,102,60Zm62,10a10,10,0,1,0-10-10A10,10,0,0,0,164,70ZM92,118a10,10,0,1,0,10,10A10,10,0,0,0,92,118Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,118ZM92,186a10,10,0,1,0,10,10A10,10,0,0,0,92,186Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,186Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M100,60a8,8,0,1,1-8-8A8,8,0,0,1,100,60Zm64,8a8,8,0,1,0-8-8A8,8,0,0,0,164,68ZM92,120a8,8,0,1,0,8,8A8,8,0,0,0,92,120Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,120ZM92,188a8,8,0,1,0,8,8A8,8,0,0,0,92,188Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,188Z"}))]]),nc=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,80H140V60h56ZM116,60v56H60V60ZM60,140h56v56H60Zm80,56V140h56v56Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",opacity:"0.2"}),d.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,56v60a4,4,0,0,1-4,4H136V44a4,4,0,0,1,4-4h60A16,16,0,0,1,216,56ZM116,40H56A16,16,0,0,0,40,56v60a4,4,0,0,0,4,4h76V44A4,4,0,0,0,116,40Zm96,96H136v76a4,4,0,0,0,4,4h60a16,16,0,0,0,16-16V140A4,4,0,0,0,212,136ZM40,140v60a16,16,0,0,0,16,16h60a4,4,0,0,0,4-4V136H44A4,4,0,0,0,40,140Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,14v66H134V54h66A2,2,0,0,1,202,56ZM56,54h66v68H54V56A2,2,0,0,1,56,54ZM54,200V134h68v68H56A2,2,0,0,1,54,200Zm146,2H134V134h68v66A2,2,0,0,1,200,202Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,12v68H132V52h68A4,4,0,0,1,204,56ZM56,52h68v72H52V56A4,4,0,0,1,56,52ZM52,200V132h72v72H56A4,4,0,0,1,52,200Zm148,4H132V132h72v68A4,4,0,0,1,200,204Z"}))]]),oc=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),d.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),rc=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,128a12,12,0,0,1-12,12H48a12,12,0,0,1,0-24h68A12,12,0,0,1,128,128ZM48,76H180a12,12,0,0,0,0-24H48a12,12,0,0,0,0,24Zm52,104H48a12,12,0,0,0,0,24h52a12,12,0,0,0,0-24Zm132.49-20.49a12,12,0,0,0-17,0L196,179V112a12,12,0,0,0-24,0v67l-19.51-19.52a12,12,0,0,0-17,17l40,40a12,12,0,0,0,17,0l40-40A12,12,0,0,0,232.49,159.51Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,80v88l-24,24H48V64H208A16,16,0,0,1,224,80Z",opacity:"0.2"}),d.createElement("path",{d:"M128,128a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16h72A8,8,0,0,1,128,128ZM48,72H184a8,8,0,0,0,0-16H48a8,8,0,0,0,0,16Zm56,112H48a8,8,0,0,0,0,16h56a8,8,0,0,0,0-16Zm125.66-21.66a8,8,0,0,0-11.32,0L192,188.69V112a8,8,0,0,0-16,0v76.69l-26.34-26.35a8,8,0,0,0-11.32,11.32l40,40a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,229.66,162.34Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,72h96a8,8,0,0,1,0,16H72a8,8,0,0,1,0-16Zm40,112H72a8,8,0,0,1,0-16h40a8,8,0,0,1,0,16Zm8-48H72a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Zm77.66,29.66-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L160,164.69V120a8,8,0,0,1,16,0v44.69l10.34-10.35a8,8,0,0,1,11.32,11.32Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M126,128a6,6,0,0,1-6,6H48a6,6,0,0,1,0-12h72A6,6,0,0,1,126,128ZM48,70H184a6,6,0,0,0,0-12H48a6,6,0,0,0,0,12Zm56,116H48a6,6,0,0,0,0,12h56a6,6,0,0,0,0-12Zm124.24-22.24a6,6,0,0,0-8.48,0L190,193.51V112a6,6,0,0,0-12,0v81.51l-29.76-29.75a6,6,0,0,0-8.48,8.48l40,40a6,6,0,0,0,8.48,0l40-40A6,6,0,0,0,228.24,163.76Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,128a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16h72A8,8,0,0,1,128,128ZM48,72H184a8,8,0,0,0,0-16H48a8,8,0,0,0,0,16Zm56,112H48a8,8,0,0,0,0,16h56a8,8,0,0,0,0-16Zm125.66-21.66a8,8,0,0,0-11.32,0L192,188.69V112a8,8,0,0,0-16,0v76.69l-26.34-26.35a8,8,0,0,0-11.32,11.32l40,40a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,229.66,162.34Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M124,128a4,4,0,0,1-4,4H48a4,4,0,0,1,0-8h72A4,4,0,0,1,124,128ZM48,68H184a4,4,0,0,0,0-8H48a4,4,0,0,0,0,8Zm56,120H48a4,4,0,0,0,0,8h56a4,4,0,0,0,0-8Zm122.83-22.83a4,4,0,0,0-5.66,0L188,198.34V112a4,4,0,0,0-8,0v86.34l-33.17-33.17a4,4,0,0,0-5.66,5.66l40,40a4,4,0,0,0,5.66,0l40-40A4,4,0,0,0,226.83,165.17Z"}))]]),Nr=d.forwardRef((e,t)=>d.createElement(_t,{ref:t,...e,weights:ec}));Nr.displayName="CalendarIcon";const sc=Nr,jr=d.forwardRef((e,t)=>d.createElement(_t,{ref:t,...e,weights:tc}));jr.displayName="DotsSixVerticalIcon";const ac=jr,Vr=d.forwardRef((e,t)=>d.createElement(_t,{ref:t,...e,weights:nc}));Vr.displayName="GridFourIcon";const Or=Vr,kr=d.forwardRef((e,t)=>d.createElement(_t,{ref:t,...e,weights:oc}));kr.displayName="PencilSimpleIcon";const ic=kr,Fr=d.forwardRef((e,t)=>d.createElement(_t,{ref:t,...e,weights:rc}));Fr.displayName="SortAscendingIcon";const cc=Fr,Qn="/login",lc="/api/auth/";let Fo=!1;const dc=e=>{const t=`${e.pathname||"/"}${e.search}${e.hash}`;return`${Qn}?next=${encodeURIComponent(t)}`},uc=e=>{if(!qe.isAxiosError(e)||e.response?.status!==401)return!1;const t=e.config?.url??"";return!t.startsWith(lc)&&t!==Qn},Hr=(e=window.location)=>{Fo||e.pathname===Qn||(Fo=!0,e.assign(dc(e)))},hc="X-Ocean-Brain-Session-Generation";let Ho=!1,Ht;const fc=e=>!!(e.authRequired&&!e.authenticated),pc=e=>{const t=e.headers.get(hc);return t?Ht?Ht===t?!1:(Ht=t,!0):(Ht=t,!1):!1},mc=(e=window.location)=>{Ho||(Ho=!0,e.reload())},Jt=async(e=fetch)=>{const t=await e("/api/auth/session").catch(()=>{});if(!t?.ok)return"unavailable";const n=pc(t),o=await t.json();return fc(o)?(Hr(),"expired"):n?(mc(),"reloading"):"active"},gc=e=>t=>{if(!(t instanceof MessageEvent)||typeof t.data!="string")return;const n=Ts(t.data);!n||n.type!==e||Ds(n)},vc=()=>{const e=$n();return d.useEffect(()=>As(t=>{Ns(e,t)}),[e]),d.useEffect(()=>{if(typeof EventSource>"u")return;const t=new EventSource("/api/events");let n=!1;const o=()=>{n=!0,Jt()},r=()=>{n&&(n=!1,Jt())},s=Is.map(a=>{const i=gc(a);return t.addEventListener(a,i),()=>{t.removeEventListener(a,i)}});return t.addEventListener("error",o),t.addEventListener("open",r),()=>{s.forEach(a=>{a()}),t.removeEventListener("error",o),t.removeEventListener("open",r),t.close()}},[]),null},bc=({children:e})=>p.jsx(ua,{client:ha,children:p.jsx(fa,{children:p.jsxs(pa,{children:[p.jsx(vc,{}),e]})})}),Bo=({children:e,fallback:t})=>e||t;function yc({itemsPerPage:e,onItemsPerPageChange:t,sortBy:n,onSortByChange:o,sortOrder:r,onSortOrderChange:s,pinnedFirst:a,onPinnedFirstChange:i}){return p.jsx("div",{className:"flex justify-end",children:p.jsxs("div",{className:"surface-base inline-flex flex-wrap items-center gap-3 rounded-[16px] px-3.5 py-2.5",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Or,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),p.jsx(ne,{id:"note-filters-items-label",as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Items"}),p.jsx(yn,{value:String(e),"aria-labelledby":"note-filters-items-label",onValueChange:l=>{const c=Number(l);ma(c)&&t(c)},variant:"ghost",size:"sm",children:cr.map(l=>p.jsx(lt,{value:String(l),children:l===lr?`Default (${l})`:l},l))})]}),p.jsx("div",{className:"h-5 w-px bg-divider"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(cc,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),p.jsx(ne,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Sort"}),p.jsxs(yn,{value:n,ariaLabel:"Sort field",onValueChange:l=>o(l),variant:"ghost",size:"sm",children:[p.jsx(lt,{value:"updatedAt",children:"Updated"}),p.jsx(lt,{value:"createdAt",children:"Created"})]}),p.jsxs(yn,{value:r,ariaLabel:"Sort order",onValueChange:l=>s(l),variant:"ghost",size:"sm",children:[p.jsx(lt,{value:"desc",children:"Newest"}),p.jsx(lt,{value:"asc",children:"Oldest"})]})]}),p.jsx("div",{className:"h-5 w-px bg-divider"}),p.jsxs(ga,{htmlFor:"pinnedFirst",size:"sm",className:"flex cursor-pointer items-center gap-1.5",children:[p.jsx(va,{id:"pinnedFirst",size:"sm",checked:a,onChange:l=>i(l.target.checked)}),p.jsx(ne,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Pinned First"})]})]})})}const xc=e=>{let t=!1;return()=>{t||(window.requestAnimationFrame(()=>{e(),t=!1}),t=!0)}},wn=new Map;function wc(){const e=cn({select:n=>n.pathname}),t=d.useRef(null);return d.useEffect(()=>{if(t.current?.parentElement){const{parentElement:n}=t.current,o=s=>{if(s!==0){wn.set(e,s);return}wn.delete(e)},r=xc(()=>{if(t.current){const{scrollTop:s}=n;o(s)}});return n.scrollTop=wn.get(e)??0,n.addEventListener("scroll",r),()=>{n.removeEventListener("scroll",r)}}},[e]),p.jsx("div",{ref:t,className:"hidden"})}const Jn=`
3
3
  id
4
4
  tabId
@@ -148,4 +148,4 @@ import{j as p,r as d,b as G,a as ut}from"./floating-ui.react-dom-BWTnA00G.js";im
148
148
  order
149
149
  }
150
150
  }
151
- `);if(n.type==="error")throw n;return n.pinnedNotes}});return p.jsx(p.Fragment,{children:e.render(t)})},Ld="focus-ring-soft flex h-8 w-8 items-center justify-center rounded-[10px] text-fg-tertiary opacity-70 outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default hover:opacity-100 focus-visible:opacity-100 active:cursor-grabbing touch-none",Ad="focus-ring-soft block truncate rounded-[10px] px-1.5 py-1 outline-none transition-colors",Id=(e,t,n)=>{if(t===n)return null;const o=e.findIndex(i=>i.id===t),r=e.findIndex(i=>i.id===n);if(o<0||r<0)return null;const s=[...e],[a]=s.splice(o,1);return a?(s.splice(r,0,a),{nextItems:s,orders:s.map((i,l)=>({id:i.id,order:l}))}):null};function Td({id:e,title:t,isActive:n=!1,children:o}){const{attributes:r,listeners:s,setNodeRef:a,setActivatorNodeRef:i,transform:l,transition:c,isDragging:u}=Rd({id:e}),h={transform:Rt.Transform.toString(l),transition:c,opacity:u?.5:1};return p.jsxs("div",{ref:a,style:h,className:ie("group flex min-h-[38px] items-center gap-1.5 rounded-[12px] px-1.5 py-1 transition-colors",n?"bg-hover-subtle":"hover:bg-hover-subtle/70"),children:[p.jsx("button",{type:"button",ref:i,"aria-label":`Reorder note ${t??"Untitled"}`,title:"Drag to reorder",...r,...s,className:ie(Ld,u?"cursor-grabbing":"cursor-grab"),children:p.jsx(ac,{className:"size-4"})}),p.jsx(ne,{as:"div",truncate:!0,variant:"meta",weight:"medium",className:"min-w-0 flex-1",children:o})]})}function Dd({notes:e,pathname:t,pinnedItems:n,setPinnedItems:o,handleDragEnd:r,sensors:s}){d.useEffect(()=>{o(e)},[e,o]);const a=n.length>0?n:e;return a.length===0?null:p.jsx(td,{sensors:s,collisionDetection:tl,onDragEnd:r,modifiers:[ld],children:p.jsx(gd,{items:a.map(i=>i.id),strategy:pd,children:a.map(i=>p.jsx(Td,{id:i.id,title:i.title||"Untitled",isActive:t===`/${i.id}`,children:p.jsx(Gt,{"aria-current":t===`/${i.id}`?"page":void 0,className:ie(Ad,t===`/${i.id}`?"text-fg-default":"text-fg-secondary hover:text-fg-default"),to:Zn,params:{id:i.id},children:i.title||"Untitled"})},i.id))})})}const Nd=()=>{const e=cn({select:i=>i.pathname}),t=$n(),[n,o]=d.useState([]),r=ks({mutationFn:wa,onSuccess:()=>{t.invalidateQueries({queryKey:xt.notes.pinned(),exact:!0})}}),s=Jc(Zo(io,{activationConstraint:{distance:8}}),Zo(so,{coordinateGetter:_d})),a=i=>{const{active:l,over:c}=i;c&&l.id!==c.id&&o(u=>{const h=Id(u,String(l.id),String(c.id));return h?(r.mutate(h.orders),h.nextItems):u})};return p.jsx("div",{className:"border-l border-border-subtle/70 pl-1.5",children:p.jsx(ur,{fallback:p.jsxs("div",{className:"space-y-1",children:[p.jsx(ht,{height:"40px",opacity:.4}),p.jsx(ht,{height:"40px",opacity:.4})]}),errorTitle:"Failed to load pinned notes",errorDescription:"Retry loading the pinned note list.",renderError:({error:i,retry:l})=>p.jsx(xa,{title:"Failed to load pinned notes",description:"Retry loading the pinned note list.",error:i,onRetry:l,showBackAction:!1,showHomeAction:!1}),children:p.jsx(Md,{render:i=>i.length>0?p.jsx(Dd,{notes:i,pathname:e,pinnedItems:n,setPinnedItems:o,handleDragEnd:a,sensors:s}):p.jsx(ne,{as:"div",variant:"meta",tone:"secondary",className:"px-2 py-2.5 leading-6",children:"Pin a note from the note toolbar to keep it here."})})})})},jd=()=>p.jsx("section",{className:"p-3 pt-0","aria-label":"Pinned notes",children:p.jsx(Nd,{})}),Vd="p-3 pb-0",Od="focus-ring-soft surface-base group flex w-full items-center justify-between gap-2.5 px-3 py-2.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",kd="flex items-center gap-2.5",Fd="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-cta text-fg-on-filled",Hd="flex flex-col",Bd="h-4 w-4 text-fg-tertiary transition-colors group-hover:text-fg-default",$d=()=>{const{onCreate:e}=ar();return p.jsx("div",{className:Vd,children:p.jsxs("button",{type:"button",className:Od,onClick:()=>e(),children:[p.jsxs("span",{className:kd,children:[p.jsx("span",{className:Fd,children:p.jsx(ic,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:Hd,children:[p.jsx(ne,{variant:"meta",weight:"semibold",tracking:"tight",children:"Capture"}),p.jsx(ne,{variant:"label",tone:"secondary",children:"Open a new note"})]})]}),p.jsx(Sa,{className:Bd,weight:"bold"})]})})},Zd=/Mac|iPhone|iPad|iPod/i,zd=()=>typeof navigator>"u"?"":`${navigator.platform} ${navigator.userAgent}`,fs=(e=zd())=>Zd.test(e)?"⌘K":"Ctrl+K",Ud="focus-ring-soft surface-base group flex min-h-14 w-full items-center justify-between gap-3 px-3 py-2.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",Kd=()=>{const e=Hn(),t=fs(),n=()=>{e({to:Pt,search:{query:"",page:1,mode:"hybrid"}})};return p.jsxs("button",{type:"button",className:Ud,"aria-label":"Open detailed search","aria-keyshortcuts":"Meta+K Control+K",onClick:n,children:[p.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[p.jsx("span",{className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-muted text-fg-secondary transition-colors group-hover:text-fg-default",children:p.jsx(br,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:"flex min-w-0 flex-col",children:[p.jsx(ne,{as:"span",variant:"meta",weight:"semibold",tracking:"tight",children:"Search"}),p.jsx(ne,{as:"span",variant:"label",tone:"secondary",children:"Find a memory"})]})]}),p.jsx("span",{className:"shrink-0 rounded-[8px] bg-muted px-1.5 py-1 text-label font-medium text-fg-tertiary",children:t})]})},Gd=()=>p.jsx("div",{className:"p-3",children:p.jsx(Kd,{})}),Wd=[{name:"Search",path:Pt,icon:br},{name:"Notes",path:rn,icon:Or},{name:"Views",path:zn,icon:Fs},{name:"Graph",path:hr,icon:Za},{name:"Calendar",path:fr,icon:sc},{name:"Reminders",path:pr,icon:Hs},{name:"Tags",path:mr,icon:Bs},{name:"Setting",path:gr,icon:$s}],qd=()=>{const e=cn({select:n=>n.pathname}),t=fs();return p.jsx("nav",{"aria-label":"Primary navigation",className:"flex items-center gap-1 px-4 py-2.5",children:Wd.map((n,o)=>{const r=e===n.path||n.path!==rn&&e.startsWith(`${n.path}/`),s=n.path===Pt?t:void 0;return p.jsxs(d.Fragment,{children:[o>0&&p.jsx("span",{className:"h-3.5 w-px shrink-0 bg-border-subtle"}),p.jsx(Gt,{to:n.path,"aria-keyshortcuts":s?"Meta+K Control+K":void 0,title:s?`${n.name} (${s})`:void 0,children:p.jsxs("div",{className:`flex min-w-26 items-center justify-center gap-2 border-b px-2 py-2 transition-colors ${r?"border-fg-muted text-fg-default":"border-transparent text-fg-secondary hover:border-border-subtle hover:text-fg-default"}`,children:[p.jsx(n.icon,{className:"size-5",weight:r?"fill":"regular"}),p.jsx(ne,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:n.name})]})})]},n.path)})})},Xd=({children:e})=>p.jsx(jc,{sidebar:p.jsxs(p.Fragment,{children:[p.jsx(kc,{}),p.jsx($d,{}),p.jsx(Gd,{}),p.jsx(jd,{}),p.jsx(Rc,{})]}),topNavigation:p.jsx(qd,{}),children:e}),ps=100,ms=[50,ps,200];function Ch(e){return ms.includes(e)}const kn=1,Yd=100,Qd=100,Jd=256,gs=1e5,eu=50,tu=1970,nu=9999,nr=25,Xe=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),co=e=>e.length>0&&e.length<=Jd,ou=e=>typeof e=="number"&&Number.isInteger(e)&&e>1&&e<=gs?e:void 0,ru=e=>typeof e=="number"&&Number.isInteger(e)&&e>1?Math.min(e,eu):void 0,su=e=>{if(!Xe(e))return;const t=e.by,n=e.order;if(!(t!=="title"&&t!=="createdAt"&&t!=="updatedAt"||n!=="asc"&&n!=="desc"))return{by:t,order:n}},au=e=>{if(!Xe(e))return;const t=e.year,n=e.month;if(!(typeof t!="number"||!Number.isInteger(t)||t<tu||t>nu||typeof n!="number"||!Number.isInteger(n)||n<1||n>12))return{year:t,month:n}},vs=e=>{if(!Xe(e))return;const t=ou(e.page),n=su(e.sort),o=au(e.calendar),r=Xe(e.columns)?Object.fromEntries(Object.entries(e.columns).filter(([s])=>co(s)).slice(0,Qd).flatMap(([s,a])=>{const i=ru(a);return i===void 0?[]:[[s,i]]})):{};if(!(t===void 0&&Object.keys(r).length===0&&n===void 0&&o===void 0))return{...t===void 0?{}:{page:t},...Object.keys(r).length===0?{}:{columns:r},...n===void 0?{}:{sort:n},...o===void 0?{}:{calendar:o}}},Fn=e=>{if(!Xe(e)||e.version!==kn||!Xe(e.sections))return;const t=Object.fromEntries(Object.entries(e.sections).filter(([n])=>co(n)).slice(0,Yd).flatMap(([n,o])=>{const r=vs(o);return r===void 0?[]:[[n,r]]}));return Object.keys(t).length===0?void 0:{version:kn,sections:t}},iu=(e,t)=>e?.sections[t]??{},cu=(e,t,n)=>{if(!co(t))return Fn(e);const o=Fn(e),r=iu(o,t),s=vs(typeof n=="function"?n(r):n),a=Object.fromEntries(Object.entries({...o?.sections??{},[t]:s}).filter(i=>i[1]!==void 0));return Object.keys(a).length===0?void 0:{version:kn,sections:a}},lu=(e,t,n)=>{if(!Number.isSafeInteger(t)||t<=1)return;const o=Number.isSafeInteger(n)&&n>0?n:nr,r=Math.min(Number.MAX_SAFE_INTEGER,(t-1)*nr),s=Math.min(gs,Math.floor(r/o)+1);return cu(void 0,e,{page:s})},du=["updatedAt","createdAt"],uu=["referenceCount","name"],bs=["asc","desc"],hu=["create","update"],fu=["hybrid","lexical","semantic"],pu=["open","completed"],mu=["all","overdue","today","upcoming"],gu=["all","high","medium","low"],fn=e=>Array.isArray(e)?e[0]:e,Re=(e,t,{min:n=1,max:o=Number.MAX_SAFE_INTEGER}={})=>{const r=fn(e),s=typeof r=="number"?r:typeof r=="string"?Number(r):Number.NaN;return!Number.isInteger(s)||s<n||s>o?t:s},ys=(e,t,n)=>{const o=Re(e,Number.NaN);return t.includes(o)?o:n},vu=(e,t=!1)=>{const n=fn(e);return n===!0||n==="true"?!0:n===!1||n==="false"?!1:t},It=(e,t="")=>{const n=fn(e);return typeof n=="string"?n:t},Se=(e,t,n)=>{const o=fn(e);return typeof o!="string"?n:t.includes(o)?o:n},bu=e=>({page:Re(e.page,1),limit:ys(e.limit,cr,lr),sortBy:Se(e.sortBy,du,"updatedAt"),sortOrder:Se(e.sortOrder,bs,"desc"),pinnedFirst:vu(e.pinnedFirst,!1)}),et=e=>({page:Re(e.page,1)}),yu=e=>{const t=Se(e.status,pu,"open"),n=Se(e.scope,mu,"all");return{page:Re(e.page,1),status:t,scope:t==="completed"?"all":n,priority:Se(e.priority,gu,"all")}},xu=e=>({page:Re(e.page,1),query:It(e.query,""),mode:Se(e.mode,fu,"hybrid")}),wu=e=>({page:Re(e.page,1),query:It(e.query,""),limit:ys(e.limit,ms,ps),sortBy:Se(e.sortBy,uu,"referenceCount"),sortOrder:Se(e.sortOrder,bs,"desc")}),Su=e=>({year:Re(e.year,bo().year(),{min:1970,max:9999}),month:Re(e.month,bo().month()+1,{min:1,max:12}),type:Se(e.type,hu,"create")}),Ru=e=>{const t=It(e.selected,"").trim();return t?{selected:t}:{}},Eu=e=>{const t=It(e.tab,"").trim(),n=Fn(e.state);return{...t?{tab:t}:{},...n?{state:n}:{}}},Cu=e=>({page:Re(e.page,1),sectionId:It(e.sectionId,"")}),_u=e=>{const{data:t}=dr({queryKey:xt.notes.list(e.searchParams),async queryFn(){const n=await Ra(e.searchParams);if(n.type==="error")throw n;return n.allNotes}});return e.render(t)};function Pu({id:e,title:t,tags:n,pinned:o,updatedAt:r,onPinned:s,onDelete:a}){const i=Ea(Number(r));return p.jsxs("div",{className:ie("surface-base group relative flex h-full flex-col px-4 py-3.5 transition-colors"),children:[o&&p.jsx("div",{className:"absolute left-1/2 top-0 z-[1] -translate-x-1/2 -translate-y-[38%]",children:p.jsxs("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-border-secondary/70 bg-elevated text-fg-tertiary shadow-[0_8px_18px_-14px_rgba(23,29,38,0.32)]",children:[p.jsx(Zs,{className:"h-3.5 w-3.5",weight:"fill"}),p.jsx("span",{className:"sr-only",children:"Pinned note"})]})}),p.jsxs("div",{className:"flex h-full flex-col gap-2.5",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2.5",children:[p.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1",children:p.jsxs(ne,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Updated ",i]})}),p.jsx(Ca,{button:p.jsx(zs,{label:"Note actions",size:"sm"}),items:[{name:o?"Unpin":"Pin",onClick:()=>s?.()},{name:"Delete",onClick:()=>a?.()}]})]}),p.jsxs("div",{className:"flex flex-1 flex-col justify-between gap-2.5",children:[p.jsx(ne,{as:"div",variant:"body",weight:"semibold",tracking:"tight",className:"leading-[1.45]",children:p.jsx(Gt,{className:"line-clamp-2 transition-colors hover:text-fg-default/85",to:Zn,params:{id:e},children:t||"Untitled"})}),n.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1.5 pt-0.5",children:n.map(l=>p.jsx(Gt,{to:vr,params:{id:l.id},search:{page:1},children:p.jsx(ne,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"inline-flex items-center rounded-full border border-border-subtle bg-transparent px-2 py-0.5 transition-colors hover:bg-hover-subtle hover:text-fg-default",children:l.name})},l.id))})]})]})]},e)}const or=_a(rn);function Mu(){const e=or.useNavigate(),{limit:t,page:n,sortBy:o,sortOrder:r,pinnedFirst:s}=or.useSearch(),{onDelete:a,onPinned:i,deleteWarningDialog:l}=ar(),c=u=>{e({search:h=>({...h,...u})})};return p.jsxs(Pa,{title:"",variant:"none",children:[p.jsxs("div",{className:"flex flex-col gap-5",children:[p.jsx(yc,{itemsPerPage:t,onItemsPerPageChange:u=>c({limit:u,page:1}),sortBy:o,onSortByChange:u=>c({sortBy:u,page:1}),sortOrder:r,onSortOrderChange:u=>c({sortOrder:u,page:1}),pinnedFirst:s,onPinnedFirstChange:u=>c({pinnedFirst:u,page:1})}),p.jsx(ur,{fallback:p.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[p.jsx(ht,{height:"112px"}),p.jsx(ht,{height:"112px"}),p.jsx(ht,{height:"112px"})]}),errorTitle:"Failed to load notes",errorDescription:"Retry loading the current note list.",resetKeys:[n,t,o,r,s],children:p.jsx(_u,{searchParams:{offset:(n-1)*t,limit:t,sortBy:o,sortOrder:r,pinnedFirst:s},render:({notes:u,totalCount:h})=>p.jsx(Bo,{fallback:p.jsx(La,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:u.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"grid-auto-cards grid gap-5",children:u.map(f=>p.jsx(Pu,{...f,onPinned:()=>i(f.id,f.pinned),onDelete:()=>a(f.id)},f.id))}),p.jsx(Bo,{fallback:null,children:h&&t<h&&p.jsx(Ma,{page:n,last:Math.ceil(h/t),onChange:f=>{c({page:f})}})})]})})})})]}),l]})}const O=Aa({component:()=>p.jsx(Xd,{children:p.jsx(Dr,{})}),errorComponent:Ta,notFoundComponent:Ia}),Lu=V({getParentRoute:()=>O,path:rn,component:Mu,validateSearch:bu}),Au=V({getParentRoute:()=>O,path:fr,component:U(()=>z(()=>import("./Calendar-CaeK7gTz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading calendar",description:"Preparing note and reminder snapshots."}),validateSearch:Su}),Iu=V({getParentRoute:()=>O,path:zn,component:U(()=>z(()=>import("./Views-BPxlw3vk.js"),__vite__mapDeps([11,1,4,2,3,12,13,14,5,6,15,16,17,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading views",description:"Preparing your saved dashboards."}),validateSearch:Eu}),Tu=V({getParentRoute:()=>O,path:pr,component:U(()=>z(()=>import("./Reminders-DnuALBL6.js"),__vite__mapDeps([18,1,2,3,4,19,15]))),pendingComponent:()=>p.jsx($,{title:"Loading reminders",description:"Preparing your reminder workspace."}),validateSearch:yu}),Du=V({getParentRoute:()=>O,path:hr,component:U(()=>z(()=>import("./Graph-CdEu8eAn.js"),__vite__mapDeps([20,1,2,3,21,22,23,24,25,26,27,10,15,28,29,6,8,30]))),pendingComponent:()=>p.jsx($,{title:"Loading graph",description:"Preparing the linked note constellation."}),validateSearch:Ru}),Nu=V({getParentRoute:()=>O,path:Pt,component:U(()=>z(()=>import("./Search-DAYHxAml.js"),__vite__mapDeps([31,1,4,2,3,32,10,15,14,33,30,34,9]))),pendingComponent:()=>p.jsx($,{title:"Loading search",description:"Preparing indexed note results."}),validateSearch:xu}),ju=V({getParentRoute:()=>O,path:mr,component:U(()=>z(()=>import("./Tag-CG8b0l1j.js"),__vite__mapDeps([35,1,2,3,12,10,4,9]))),pendingComponent:()=>p.jsx($,{title:"Loading tags",description:"Preparing the tag catalog."}),validateSearch:wu}),Vu=V({getParentRoute:()=>O,path:Zn,component:U(()=>z(()=>import("./Note-CGI-Y1__.js"),__vite__mapDeps([36,1,2,3,4,7,8,37,32,30,17,13,19,38,39,40,9,41,42,28,43,12,34]))),pendingComponent:()=>p.jsx($,{title:"Loading note",description:"Preparing the editor and note content."})}),Ou=V({getParentRoute:()=>O,path:vr,component:U(()=>z(()=>import("./TagNotes-COyaVsdn.js"),__vite__mapDeps([44,1,2,3,37,4,32,30,17,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading tagged notes",description:"Preparing notes for the selected tag."}),validateSearch:et}),ku=V({getParentRoute:()=>O,path:ja,validateSearch:Cu,beforeLoad:async({search:e})=>{const t=e.sectionId?await Sc(e.sectionId).catch(()=>null):null,n=t?.type==="success"?t.viewSection:null;throw Da({to:zn,search:{tab:n?.tabId,state:n?lu(n.id,e.page,n.limit):void 0},replace:!0})}}),Fu=V({getParentRoute:()=>O,path:gr,component:U(()=>z(()=>import("./index-CzZFedXj.js"),__vite__mapDeps([45,1,4,2,3,46,47,48,10,9]))),pendingComponent:()=>p.jsx($,{title:"Loading settings",description:"Preparing workspace preferences."})}),Hu=V({getParentRoute:()=>O,path:Oa,component:U(()=>z(()=>import("./mcp-ugdCKa6H.js"),__vite__mapDeps([49,1,4,2,3,46,43]))),pendingComponent:()=>p.jsx($,{title:"Loading MCP settings",description:"Preparing MCP access controls."})}),Bu=V({getParentRoute:()=>O,path:Va,component:U(()=>z(()=>import("./search-ddYl3qH-.js"),__vite__mapDeps([50,1,4,2,3,33,10,16]))),pendingComponent:()=>p.jsx($,{title:"Loading search settings",description:"Preparing semantic search controls."})}),$u=V({getParentRoute:()=>O,path:ka,component:U(()=>z(()=>import("./trash-BHida7BG.js"),__vite__mapDeps([51,1,4,2,3,13,37,32,30,17]))),pendingComponent:()=>p.jsx($,{title:"Loading trash",description:"Preparing deleted notes for restore."}),validateSearch:et}),Zu=V({getParentRoute:()=>O,path:Fa,component:U(()=>z(()=>import("./manage-image-CSJ3Flgc.js"),__vite__mapDeps([52,1,2,3,4,42,53,13,48]))),pendingComponent:()=>p.jsx($,{title:"Loading image manager",description:"Preparing uploaded image metadata."}),validateSearch:et}),zu=V({getParentRoute:()=>O,path:Ha,component:U(()=>z(()=>import("./manage-image-detail-9hRTiAsR.js"),__vite__mapDeps([54,1,2,3,4,42,53,13,37,32,30,17,48,47,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading image detail",description:"Preparing references for the selected image."}),validateSearch:et}),Uu=V({getParentRoute:()=>O,path:$a,component:U(()=>z(()=>import("./properties-B7Fv95qY.js"),__vite__mapDeps([55,1,4,2,3]))),pendingComponent:()=>p.jsx($,{title:"Loading properties",description:"Preparing shared property definitions."}),validateSearch:et}),Ku=V({getParentRoute:()=>O,path:Ba,component:U(()=>z(()=>import("./placeholder-CZoqs4S3.js"),__vite__mapDeps([56,1,4,2,3,13,29,17,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading placeholders",description:"Preparing template replacement rules."}),validateSearch:et}),Gu=O.addChildren([Lu,Iu,Au,Tu,Du,Nu,ju,Vu,Ou,ku,Fu,Bu,Hu,$u,Zu,zu,Ku,Uu]),Wu=Xi({routeTree:Gu,defaultPreload:"intent",scrollRestoration:!0,defaultPendingComponent:()=>p.jsx($,{title:"Loading page",description:"Preparing the next route."})});function qu(){const e=Pn(n=>n.setSystemTheme),t=Pn(n=>n.setTheme);return d.useEffect(()=>{const n=Eo();return n&&t(n),Ka.listenThemeChange(o=>{Eo()||e(o?"dark":"light")},n==null)},[e,t]),p.jsx(bc,{children:p.jsx(Ji,{router:Wu})})}const xs="__oceanBrainCsrfRetry";let _n;const Xu=e=>!qe.isAxiosError(e)||e.response?.status!==403?!1:e.response.data?.code==="CSRF_TOKEN_INVALID",ws=e=>{if(!Xu(e)||!qe.isAxiosError(e))return!1;const t=e.config;return!!(t&&!t[xs])},Yu=()=>(_n??=Jt().finally(()=>{_n=void 0}),_n),rr=(e,t)=>{if(!e)return;const n=e;if(typeof n.delete=="function"){n.delete(t);return}delete e[t]},Qu=e=>{rr(e.headers,"X-XSRF-TOKEN"),rr(e.headers,"x-xsrf-token")},Ju=async e=>{if(!ws(e)||!qe.isAxiosError(e))return Promise.reject(e);const t=e.config;return t[xs]=!0,await Yu()!=="active"?Promise.reject(e):(Qu(t),qe.request(t))};let sr;const eh=()=>{sr===void 0&&(sr=qe.interceptors.response.use(e=>e,e=>{if(uc(e))Hr();else if(ws(e))return Ju(e);return Promise.reject(e)}))};Pn.setState({theme:Na()});eh();Jt();Us.createRoot(document.getElementById("root")).render(p.jsx(G.StrictMode,{children:p.jsx(qu,{})}));export{ph as A,mh as B,Rt as C,td as D,gh as E,Bo as F,yh as G,xh as H,wh as I,bh as J,so as K,Sh as L,_l as M,Pu as N,io as P,gd as S,ms as T,ps as a,cc as b,Oc as c,sc as d,ic as e,hh as f,Zo as g,tl as h,Ch as i,cd as j,fh as k,rd as l,ac as m,uh as n,_d as o,Eh as p,Rd as q,Rh as r,Or as s,dh as t,Jc as u,cu as v,ld as w,pd as x,iu as y,vh as z};
151
+ `);if(n.type==="error")throw n;return n.pinnedNotes}});return p.jsx(p.Fragment,{children:e.render(t)})},Ld="focus-ring-soft flex h-8 w-8 items-center justify-center rounded-[10px] text-fg-tertiary opacity-70 outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default hover:opacity-100 focus-visible:opacity-100 active:cursor-grabbing touch-none",Ad="focus-ring-soft block truncate rounded-[10px] px-1.5 py-1 outline-none transition-colors",Id=(e,t,n)=>{if(t===n)return null;const o=e.findIndex(i=>i.id===t),r=e.findIndex(i=>i.id===n);if(o<0||r<0)return null;const s=[...e],[a]=s.splice(o,1);return a?(s.splice(r,0,a),{nextItems:s,orders:s.map((i,l)=>({id:i.id,order:l}))}):null};function Td({id:e,title:t,isActive:n=!1,children:o}){const{attributes:r,listeners:s,setNodeRef:a,setActivatorNodeRef:i,transform:l,transition:c,isDragging:u}=Rd({id:e}),h={transform:Rt.Transform.toString(l),transition:c,opacity:u?.5:1};return p.jsxs("div",{ref:a,style:h,className:ie("group flex min-h-[38px] items-center gap-1.5 rounded-[12px] px-1.5 py-1 transition-colors",n?"bg-hover-subtle":"hover:bg-hover-subtle/70"),children:[p.jsx("button",{type:"button",ref:i,"aria-label":`Reorder note ${t??"Untitled"}`,title:"Drag to reorder",...r,...s,className:ie(Ld,u?"cursor-grabbing":"cursor-grab"),children:p.jsx(ac,{className:"size-4"})}),p.jsx(ne,{as:"div",truncate:!0,variant:"meta",weight:"medium",className:"min-w-0 flex-1",children:o})]})}function Dd({notes:e,pathname:t,pinnedItems:n,setPinnedItems:o,handleDragEnd:r,sensors:s}){d.useEffect(()=>{o(e)},[e,o]);const a=n.length>0?n:e;return a.length===0?null:p.jsx(td,{sensors:s,collisionDetection:tl,onDragEnd:r,modifiers:[ld],children:p.jsx(gd,{items:a.map(i=>i.id),strategy:pd,children:a.map(i=>p.jsx(Td,{id:i.id,title:i.title||"Untitled",isActive:t===`/${i.id}`,children:p.jsx(Gt,{"aria-current":t===`/${i.id}`?"page":void 0,className:ie(Ad,t===`/${i.id}`?"text-fg-default":"text-fg-secondary hover:text-fg-default"),to:Zn,params:{id:i.id},children:i.title||"Untitled"})},i.id))})})}const Nd=()=>{const e=cn({select:i=>i.pathname}),t=$n(),[n,o]=d.useState([]),r=ks({mutationFn:wa,onSuccess:()=>{t.invalidateQueries({queryKey:xt.notes.pinned(),exact:!0})}}),s=Jc(Zo(io,{activationConstraint:{distance:8}}),Zo(so,{coordinateGetter:_d})),a=i=>{const{active:l,over:c}=i;c&&l.id!==c.id&&o(u=>{const h=Id(u,String(l.id),String(c.id));return h?(r.mutate(h.orders),h.nextItems):u})};return p.jsx("div",{className:"border-l border-border-subtle/70 pl-1.5",children:p.jsx(ur,{fallback:p.jsxs("div",{className:"space-y-1",children:[p.jsx(ht,{height:"40px",opacity:.4}),p.jsx(ht,{height:"40px",opacity:.4})]}),errorTitle:"Failed to load pinned notes",errorDescription:"Retry loading the pinned note list.",renderError:({error:i,retry:l})=>p.jsx(xa,{title:"Failed to load pinned notes",description:"Retry loading the pinned note list.",error:i,onRetry:l,showBackAction:!1,showHomeAction:!1}),children:p.jsx(Md,{render:i=>i.length>0?p.jsx(Dd,{notes:i,pathname:e,pinnedItems:n,setPinnedItems:o,handleDragEnd:a,sensors:s}):p.jsx(ne,{as:"div",variant:"meta",tone:"secondary",className:"px-2 py-2.5 leading-6",children:"Pin a note from the note toolbar to keep it here."})})})})},jd=()=>p.jsx("section",{className:"p-3 pt-0","aria-label":"Pinned notes",children:p.jsx(Nd,{})}),Vd="p-3 pb-0",Od="focus-ring-soft surface-base group flex w-full items-center justify-between gap-2.5 px-3 py-2.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",kd="flex items-center gap-2.5",Fd="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-cta text-fg-on-filled",Hd="flex flex-col",Bd="h-4 w-4 text-fg-tertiary transition-colors group-hover:text-fg-default",$d=()=>{const{onCreate:e}=ar();return p.jsx("div",{className:Vd,children:p.jsxs("button",{type:"button",className:Od,onClick:()=>e(),children:[p.jsxs("span",{className:kd,children:[p.jsx("span",{className:Fd,children:p.jsx(ic,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:Hd,children:[p.jsx(ne,{variant:"meta",weight:"semibold",tracking:"tight",children:"Capture"}),p.jsx(ne,{variant:"label",tone:"secondary",children:"Open a new note"})]})]}),p.jsx(Sa,{className:Bd,weight:"bold"})]})})},Zd=/Mac|iPhone|iPad|iPod/i,zd=()=>typeof navigator>"u"?"":`${navigator.platform} ${navigator.userAgent}`,fs=(e=zd())=>Zd.test(e)?"⌘K":"Ctrl+K",Ud="focus-ring-soft surface-base group flex min-h-14 w-full items-center justify-between gap-3 px-3 py-2.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",Kd=()=>{const e=Hn(),t=fs(),n=()=>{e({to:Pt,search:{query:"",page:1,mode:"hybrid"}})};return p.jsxs("button",{type:"button",className:Ud,"aria-label":"Open detailed search","aria-keyshortcuts":"Meta+K Control+K",onClick:n,children:[p.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[p.jsx("span",{className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-muted text-fg-secondary transition-colors group-hover:text-fg-default",children:p.jsx(br,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:"flex min-w-0 flex-col",children:[p.jsx(ne,{as:"span",variant:"meta",weight:"semibold",tracking:"tight",children:"Search"}),p.jsx(ne,{as:"span",variant:"label",tone:"secondary",children:"Find a memory"})]})]}),p.jsx("span",{className:"shrink-0 rounded-[8px] bg-muted px-1.5 py-1 text-label font-medium text-fg-tertiary",children:t})]})},Gd=()=>p.jsx("div",{className:"p-3",children:p.jsx(Kd,{})}),Wd=[{name:"Search",path:Pt,icon:br},{name:"Notes",path:rn,icon:Or},{name:"Views",path:zn,icon:Fs},{name:"Graph",path:hr,icon:Za},{name:"Calendar",path:fr,icon:sc},{name:"Reminders",path:pr,icon:Hs},{name:"Tags",path:mr,icon:Bs},{name:"Setting",path:gr,icon:$s}],qd=()=>{const e=cn({select:n=>n.pathname}),t=fs();return p.jsx("nav",{"aria-label":"Primary navigation",className:"flex items-center gap-1 px-4 py-2.5",children:Wd.map((n,o)=>{const r=e===n.path||n.path!==rn&&e.startsWith(`${n.path}/`),s=n.path===Pt?t:void 0;return p.jsxs(d.Fragment,{children:[o>0&&p.jsx("span",{className:"h-3.5 w-px shrink-0 bg-border-subtle"}),p.jsx(Gt,{to:n.path,"aria-keyshortcuts":s?"Meta+K Control+K":void 0,title:s?`${n.name} (${s})`:void 0,children:p.jsxs("div",{className:`flex min-w-26 items-center justify-center gap-2 border-b px-2 py-2 transition-colors ${r?"border-fg-muted text-fg-default":"border-transparent text-fg-secondary hover:border-border-subtle hover:text-fg-default"}`,children:[p.jsx(n.icon,{className:"size-5",weight:r?"fill":"regular"}),p.jsx(ne,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:n.name})]})})]},n.path)})})},Xd=({children:e})=>p.jsx(jc,{sidebar:p.jsxs(p.Fragment,{children:[p.jsx(kc,{}),p.jsx($d,{}),p.jsx(Gd,{}),p.jsx(jd,{}),p.jsx(Rc,{})]}),topNavigation:p.jsx(qd,{}),children:e}),ps=100,ms=[50,ps,200];function Ch(e){return ms.includes(e)}const kn=1,Yd=100,Qd=100,Jd=256,gs=1e5,eu=50,tu=1970,nu=9999,nr=25,Xe=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),co=e=>e.length>0&&e.length<=Jd,ou=e=>typeof e=="number"&&Number.isInteger(e)&&e>1&&e<=gs?e:void 0,ru=e=>typeof e=="number"&&Number.isInteger(e)&&e>1?Math.min(e,eu):void 0,su=e=>{if(!Xe(e))return;const t=e.by,n=e.order;if(!(t!=="title"&&t!=="createdAt"&&t!=="updatedAt"||n!=="asc"&&n!=="desc"))return{by:t,order:n}},au=e=>{if(!Xe(e))return;const t=e.year,n=e.month;if(!(typeof t!="number"||!Number.isInteger(t)||t<tu||t>nu||typeof n!="number"||!Number.isInteger(n)||n<1||n>12))return{year:t,month:n}},vs=e=>{if(!Xe(e))return;const t=ou(e.page),n=su(e.sort),o=au(e.calendar),r=Xe(e.columns)?Object.fromEntries(Object.entries(e.columns).filter(([s])=>co(s)).slice(0,Qd).flatMap(([s,a])=>{const i=ru(a);return i===void 0?[]:[[s,i]]})):{};if(!(t===void 0&&Object.keys(r).length===0&&n===void 0&&o===void 0))return{...t===void 0?{}:{page:t},...Object.keys(r).length===0?{}:{columns:r},...n===void 0?{}:{sort:n},...o===void 0?{}:{calendar:o}}},Fn=e=>{if(!Xe(e)||e.version!==kn||!Xe(e.sections))return;const t=Object.fromEntries(Object.entries(e.sections).filter(([n])=>co(n)).slice(0,Yd).flatMap(([n,o])=>{const r=vs(o);return r===void 0?[]:[[n,r]]}));return Object.keys(t).length===0?void 0:{version:kn,sections:t}},iu=(e,t)=>e?.sections[t]??{},cu=(e,t,n)=>{if(!co(t))return Fn(e);const o=Fn(e),r=iu(o,t),s=vs(typeof n=="function"?n(r):n),a=Object.fromEntries(Object.entries({...o?.sections??{},[t]:s}).filter(i=>i[1]!==void 0));return Object.keys(a).length===0?void 0:{version:kn,sections:a}},lu=(e,t,n)=>{if(!Number.isSafeInteger(t)||t<=1)return;const o=Number.isSafeInteger(n)&&n>0?n:nr,r=Math.min(Number.MAX_SAFE_INTEGER,(t-1)*nr),s=Math.min(gs,Math.floor(r/o)+1);return cu(void 0,e,{page:s})},du=["updatedAt","createdAt"],uu=["referenceCount","name"],bs=["asc","desc"],hu=["create","update"],fu=["hybrid","lexical","semantic"],pu=["open","completed"],mu=["all","overdue","today","upcoming"],gu=["all","high","medium","low"],fn=e=>Array.isArray(e)?e[0]:e,Re=(e,t,{min:n=1,max:o=Number.MAX_SAFE_INTEGER}={})=>{const r=fn(e),s=typeof r=="number"?r:typeof r=="string"?Number(r):Number.NaN;return!Number.isInteger(s)||s<n||s>o?t:s},ys=(e,t,n)=>{const o=Re(e,Number.NaN);return t.includes(o)?o:n},vu=(e,t=!1)=>{const n=fn(e);return n===!0||n==="true"?!0:n===!1||n==="false"?!1:t},It=(e,t="")=>{const n=fn(e);return typeof n=="string"?n:t},Se=(e,t,n)=>{const o=fn(e);return typeof o!="string"?n:t.includes(o)?o:n},bu=e=>({page:Re(e.page,1),limit:ys(e.limit,cr,lr),sortBy:Se(e.sortBy,du,"updatedAt"),sortOrder:Se(e.sortOrder,bs,"desc"),pinnedFirst:vu(e.pinnedFirst,!1)}),et=e=>({page:Re(e.page,1)}),yu=e=>{const t=Se(e.status,pu,"open"),n=Se(e.scope,mu,"all");return{page:Re(e.page,1),status:t,scope:t==="completed"?"all":n,priority:Se(e.priority,gu,"all")}},xu=e=>({page:Re(e.page,1),query:It(e.query,""),mode:Se(e.mode,fu,"hybrid")}),wu=e=>({page:Re(e.page,1),query:It(e.query,""),limit:ys(e.limit,ms,ps),sortBy:Se(e.sortBy,uu,"referenceCount"),sortOrder:Se(e.sortOrder,bs,"desc")}),Su=e=>({year:Re(e.year,bo().year(),{min:1970,max:9999}),month:Re(e.month,bo().month()+1,{min:1,max:12}),type:Se(e.type,hu,"create")}),Ru=e=>{const t=It(e.selected,"").trim();return t?{selected:t}:{}},Eu=e=>{const t=It(e.tab,"").trim(),n=Fn(e.state);return{...t?{tab:t}:{},...n?{state:n}:{}}},Cu=e=>({page:Re(e.page,1),sectionId:It(e.sectionId,"")}),_u=e=>{const{data:t}=dr({queryKey:xt.notes.list(e.searchParams),async queryFn(){const n=await Ra(e.searchParams);if(n.type==="error")throw n;return n.allNotes}});return e.render(t)};function Pu({id:e,title:t,tags:n,pinned:o,updatedAt:r,onPinned:s,onDelete:a}){const i=Ea(Number(r));return p.jsxs("div",{className:ie("surface-base group relative flex h-full flex-col px-4 py-3.5 transition-colors"),children:[o&&p.jsx("div",{className:"absolute left-1/2 top-0 z-[1] -translate-x-1/2 -translate-y-[38%]",children:p.jsxs("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-border-secondary/70 bg-elevated text-fg-tertiary shadow-[0_8px_18px_-14px_rgba(23,29,38,0.32)]",children:[p.jsx(Zs,{className:"h-3.5 w-3.5",weight:"fill"}),p.jsx("span",{className:"sr-only",children:"Pinned note"})]})}),p.jsxs("div",{className:"flex h-full flex-col gap-2.5",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2.5",children:[p.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1",children:p.jsxs(ne,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Updated ",i]})}),p.jsx(Ca,{button:p.jsx(zs,{label:"Note actions",size:"sm"}),items:[{name:o?"Unpin":"Pin",onClick:()=>s?.()},{name:"Delete",onClick:()=>a?.()}]})]}),p.jsxs("div",{className:"flex flex-1 flex-col justify-between gap-2.5",children:[p.jsx(ne,{as:"div",variant:"body",weight:"semibold",tracking:"tight",className:"leading-[1.45]",children:p.jsx(Gt,{className:"line-clamp-2 transition-colors hover:text-fg-default/85",to:Zn,params:{id:e},children:t||"Untitled"})}),n.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1.5 pt-0.5",children:n.map(l=>p.jsx(Gt,{to:vr,params:{id:l.id},search:{page:1},children:p.jsx(ne,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"inline-flex items-center rounded-full border border-border-subtle bg-transparent px-2 py-0.5 transition-colors hover:bg-hover-subtle hover:text-fg-default",children:l.name})},l.id))})]})]})]},e)}const or=_a(rn);function Mu(){const e=or.useNavigate(),{limit:t,page:n,sortBy:o,sortOrder:r,pinnedFirst:s}=or.useSearch(),{onDelete:a,onPinned:i,deleteWarningDialog:l}=ar(),c=u=>{e({search:h=>({...h,...u})})};return p.jsxs(Pa,{title:"",variant:"none",children:[p.jsxs("div",{className:"flex flex-col gap-5",children:[p.jsx(yc,{itemsPerPage:t,onItemsPerPageChange:u=>c({limit:u,page:1}),sortBy:o,onSortByChange:u=>c({sortBy:u,page:1}),sortOrder:r,onSortOrderChange:u=>c({sortOrder:u,page:1}),pinnedFirst:s,onPinnedFirstChange:u=>c({pinnedFirst:u,page:1})}),p.jsx(ur,{fallback:p.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[p.jsx(ht,{height:"112px"}),p.jsx(ht,{height:"112px"}),p.jsx(ht,{height:"112px"})]}),errorTitle:"Failed to load notes",errorDescription:"Retry loading the current note list.",resetKeys:[n,t,o,r,s],children:p.jsx(_u,{searchParams:{offset:(n-1)*t,limit:t,sortBy:o,sortOrder:r,pinnedFirst:s},render:({notes:u,totalCount:h})=>p.jsx(Bo,{fallback:p.jsx(La,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:u.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"grid-auto-cards grid gap-5",children:u.map(f=>p.jsx(Pu,{...f,onPinned:()=>i(f.id,f.pinned),onDelete:()=>a(f.id)},f.id))}),p.jsx(Bo,{fallback:null,children:h&&t<h&&p.jsx(Ma,{page:n,last:Math.ceil(h/t),onChange:f=>{c({page:f})}})})]})})})})]}),l]})}const O=Aa({component:()=>p.jsx(Xd,{children:p.jsx(Dr,{})}),errorComponent:Ta,notFoundComponent:Ia}),Lu=V({getParentRoute:()=>O,path:rn,component:Mu,validateSearch:bu}),Au=V({getParentRoute:()=>O,path:fr,component:U(()=>z(()=>import("./Calendar-DH3eSSRs.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading calendar",description:"Preparing note and reminder snapshots."}),validateSearch:Su}),Iu=V({getParentRoute:()=>O,path:zn,component:U(()=>z(()=>import("./Views-L4eC96Lx.js"),__vite__mapDeps([11,1,4,2,3,12,13,14,5,6,15,16,17,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading views",description:"Preparing your saved dashboards."}),validateSearch:Eu}),Tu=V({getParentRoute:()=>O,path:pr,component:U(()=>z(()=>import("./Reminders-DnuALBL6.js"),__vite__mapDeps([18,1,2,3,4,19,15]))),pendingComponent:()=>p.jsx($,{title:"Loading reminders",description:"Preparing your reminder workspace."}),validateSearch:yu}),Du=V({getParentRoute:()=>O,path:hr,component:U(()=>z(()=>import("./Graph-CdEu8eAn.js"),__vite__mapDeps([20,1,2,3,21,22,23,24,25,26,27,10,15,28,29,6,8,30]))),pendingComponent:()=>p.jsx($,{title:"Loading graph",description:"Preparing the linked note constellation."}),validateSearch:Ru}),Nu=V({getParentRoute:()=>O,path:Pt,component:U(()=>z(()=>import("./Search-D9detGWk.js"),__vite__mapDeps([31,1,4,2,3,32,10,15,14,33,30,34,9]))),pendingComponent:()=>p.jsx($,{title:"Loading search",description:"Preparing indexed note results."}),validateSearch:xu}),ju=V({getParentRoute:()=>O,path:mr,component:U(()=>z(()=>import("./Tag-Bquqtx23.js"),__vite__mapDeps([35,1,2,3,12,10,4,9]))),pendingComponent:()=>p.jsx($,{title:"Loading tags",description:"Preparing the tag catalog."}),validateSearch:wu}),Vu=V({getParentRoute:()=>O,path:Zn,component:U(()=>z(()=>import("./Note-CpzLtGVM.js"),__vite__mapDeps([36,1,2,3,4,7,8,37,32,30,17,13,19,38,39,40,9,41,42,28,43,12,34]))),pendingComponent:()=>p.jsx($,{title:"Loading note",description:"Preparing the editor and note content."})}),Ou=V({getParentRoute:()=>O,path:vr,component:U(()=>z(()=>import("./TagNotes-CbjfxqAN.js"),__vite__mapDeps([44,1,2,3,37,4,32,30,17,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading tagged notes",description:"Preparing notes for the selected tag."}),validateSearch:et}),ku=V({getParentRoute:()=>O,path:ja,validateSearch:Cu,beforeLoad:async({search:e})=>{const t=e.sectionId?await Sc(e.sectionId).catch(()=>null):null,n=t?.type==="success"?t.viewSection:null;throw Da({to:zn,search:{tab:n?.tabId,state:n?lu(n.id,e.page,n.limit):void 0},replace:!0})}}),Fu=V({getParentRoute:()=>O,path:gr,component:U(()=>z(()=>import("./index-CJPl3MJE.js"),__vite__mapDeps([45,1,4,2,3,46,47,48,10,9]))),pendingComponent:()=>p.jsx($,{title:"Loading settings",description:"Preparing workspace preferences."})}),Hu=V({getParentRoute:()=>O,path:Oa,component:U(()=>z(()=>import("./mcp-D8footel.js"),__vite__mapDeps([49,1,4,2,3,46,43]))),pendingComponent:()=>p.jsx($,{title:"Loading MCP settings",description:"Preparing MCP access controls."})}),Bu=V({getParentRoute:()=>O,path:Va,component:U(()=>z(()=>import("./search-ddYl3qH-.js"),__vite__mapDeps([50,1,4,2,3,33,10,16]))),pendingComponent:()=>p.jsx($,{title:"Loading search settings",description:"Preparing semantic search controls."})}),$u=V({getParentRoute:()=>O,path:ka,component:U(()=>z(()=>import("./trash-BHida7BG.js"),__vite__mapDeps([51,1,4,2,3,13,37,32,30,17]))),pendingComponent:()=>p.jsx($,{title:"Loading trash",description:"Preparing deleted notes for restore."}),validateSearch:et}),Zu=V({getParentRoute:()=>O,path:Fa,component:U(()=>z(()=>import("./manage-image-CSJ3Flgc.js"),__vite__mapDeps([52,1,2,3,4,42,53,13,48]))),pendingComponent:()=>p.jsx($,{title:"Loading image manager",description:"Preparing uploaded image metadata."}),validateSearch:et}),zu=V({getParentRoute:()=>O,path:Ha,component:U(()=>z(()=>import("./manage-image-detail-BIDHUR5-.js"),__vite__mapDeps([54,1,2,3,4,42,53,13,37,32,30,17,48,47,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading image detail",description:"Preparing references for the selected image."}),validateSearch:et}),Uu=V({getParentRoute:()=>O,path:$a,component:U(()=>z(()=>import("./properties-B7Fv95qY.js"),__vite__mapDeps([55,1,4,2,3]))),pendingComponent:()=>p.jsx($,{title:"Loading properties",description:"Preparing shared property definitions."}),validateSearch:et}),Ku=V({getParentRoute:()=>O,path:Ba,component:U(()=>z(()=>import("./placeholder-DKgxoe_f.js"),__vite__mapDeps([56,1,4,2,3,13,29,17,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading placeholders",description:"Preparing template replacement rules."}),validateSearch:et}),Gu=O.addChildren([Lu,Iu,Au,Tu,Du,Nu,ju,Vu,Ou,ku,Fu,Bu,Hu,$u,Zu,zu,Ku,Uu]),Wu=Xi({routeTree:Gu,defaultPreload:"intent",scrollRestoration:!0,defaultPendingComponent:()=>p.jsx($,{title:"Loading page",description:"Preparing the next route."})});function qu(){const e=Pn(n=>n.setSystemTheme),t=Pn(n=>n.setTheme);return d.useEffect(()=>{const n=Eo();return n&&t(n),Ka.listenThemeChange(o=>{Eo()||e(o?"dark":"light")},n==null)},[e,t]),p.jsx(bc,{children:p.jsx(Ji,{router:Wu})})}const xs="__oceanBrainCsrfRetry";let _n;const Xu=e=>!qe.isAxiosError(e)||e.response?.status!==403?!1:e.response.data?.code==="CSRF_TOKEN_INVALID",ws=e=>{if(!Xu(e)||!qe.isAxiosError(e))return!1;const t=e.config;return!!(t&&!t[xs])},Yu=()=>(_n??=Jt().finally(()=>{_n=void 0}),_n),rr=(e,t)=>{if(!e)return;const n=e;if(typeof n.delete=="function"){n.delete(t);return}delete e[t]},Qu=e=>{rr(e.headers,"X-XSRF-TOKEN"),rr(e.headers,"x-xsrf-token")},Ju=async e=>{if(!ws(e)||!qe.isAxiosError(e))return Promise.reject(e);const t=e.config;return t[xs]=!0,await Yu()!=="active"?Promise.reject(e):(Qu(t),qe.request(t))};let sr;const eh=()=>{sr===void 0&&(sr=qe.interceptors.response.use(e=>e,e=>{if(uc(e))Hr();else if(ws(e))return Ju(e);return Promise.reject(e)}))};Pn.setState({theme:Na()});eh();Jt();Us.createRoot(document.getElementById("root")).render(p.jsx(G.StrictMode,{children:p.jsx(qu,{})}));export{ph as A,mh as B,Rt as C,td as D,gh as E,Bo as F,yh as G,xh as H,wh as I,bh as J,so as K,Sh as L,_l as M,Pu as N,io as P,gd as S,ms as T,ps as a,cc as b,Oc as c,sc as d,ic as e,hh as f,Zo as g,tl as h,Ch as i,cd as j,fh as k,rd as l,ac as m,uh as n,_d as o,Eh as p,Rd as q,Rh as r,Or as s,dh as t,Jc as u,cu as v,ld as w,pd as x,iu as y,vh as z};
@@ -1 +1 @@
1
- import{r as e,j as a}from"./floating-ui.react-dom-BWTnA00G.js";import{a as N,j as E}from"./useNoteMutate-BjvZUmtX.js";import{A,a1 as M,P as y,T as t,D as c,J as o}from"./time-PxWila4-.js";import{f as w}from"./mcp-admin-adapter-D0R8p9az.js";import{a as b,d as H,c as S,S as T,g as C,h as R}from"./url-DKUMNVCI.js";import{e as k}from"./app-BezcjTfd.js";import{I as F}from"./Image.es-CjXY1JVf.js";import{n as V,c as _}from"./Trash.es-XEcWG_aq.js";import{f as I}from"./Graph-hVj6vAYJ.js";import"./preload-helper-BXl3LOEh.js";const L=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z",opacity:"0.2"}),e.createElement("path",{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z"}))]]),P=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z",opacity:"0.2"}),e.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"}))]]),O=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z",opacity:"0.2"}),e.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z"}))]]),x=e.forwardRef((s,r)=>e.createElement(A,{ref:r,...s,weights:L}));x.displayName="MoonIcon";const U=x,g=e.forwardRef((s,r)=>e.createElement(A,{ref:r,...s,weights:P}));g.displayName="PaletteIcon";const $=g,p=e.forwardRef((s,r)=>e.createElement(A,{ref:r,...s,weights:O}));p.displayName="SunIcon";const G=p,q="https://github.com/baealex/ocean-brain/releases",D=s=>/^\d+\.\d+\.\d+/.test(s)?`v${s}`:s,Q=["mcp-admin","status"],s0=()=>{const{theme:s,toggleTheme:r}=M(j=>j),{data:Z,isLoading:u}=N({queryKey:Q,queryFn:w}),d=Z?.server,n="focus-ring-soft surface-base group flex items-start justify-between gap-3.5 px-4 py-3.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",l="inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-[15px] border border-border-subtle bg-muted text-fg-secondary transition-colors group-hover:border-border-secondary/70 group-hover:text-fg-default",m="h-6 w-6",h="text-fg-tertiary",i="min-w-0 flex flex-col gap-0.5 pt-0.5",f=d?D(d.version):u?"checking…":"unknown",v=d?.releaseUrl??q;return a.jsx(y,{title:"Settings",description:"Manage display, workspace tools, and advanced connections",children:a.jsxs("div",{className:"flex flex-col gap-6",children:[a.jsxs("section",{className:"flex flex-col gap-3",children:[a.jsx(t,{as:"p",variant:"label",weight:"medium",className:h,children:"Appearance"}),a.jsxs("button",{type:"button",className:n,onClick:r,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx($,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Theme"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Switch between light and dark mode."})]})]}),a.jsxs("div",{className:"mt-0.5 flex shrink-0 items-center gap-2 text-fg-tertiary",children:[a.jsx(t,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:s==="dark"?"Dark":"Light"}),s==="dark"?a.jsx(U,{className:"h-4 w-4",weight:"fill"}):a.jsx(G,{className:"h-4 w-4",weight:"fill"})]})]})]}),a.jsxs("section",{className:"flex flex-col gap-3",children:[a.jsx(t,{as:"p",variant:"label",weight:"medium",className:h,children:"Workspace"}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[a.jsxs(c,{to:b,search:{page:1},className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(E,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Properties"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Manage fields used across notes."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),a.jsxs(c,{to:H,search:{page:1},className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(k,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Placeholders"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Manage reusable template variables."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),a.jsxs(c,{to:S,search:{page:1},className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(F,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Images"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Review uploaded note images."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),a.jsxs(c,{to:T,search:{page:1},className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(V,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Trash"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Restore or permanently delete notes."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]})]})]}),a.jsxs("section",{className:"flex flex-col gap-3",children:[a.jsx(t,{as:"p",variant:"label",weight:"medium",className:h,children:"Advanced"}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[a.jsxs(c,{to:C,className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(I,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Search"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Add meaning-based recall with an embedding API."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),a.jsxs(c,{to:R,className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(_,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"MCP"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Connect Codex, Claude, or another MCP client."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]})]})]}),a.jsxs(t,{as:"p",variant:"meta",tone:"tertiary",className:"border-t border-border-subtle pt-4",children:["Ocean Brain ",f," ·"," ",a.jsx("a",{href:v,target:"_blank",rel:"noreferrer",className:"font-medium text-fg-secondary underline-offset-4 hover:underline",children:"Releases"})]})]})})};export{s0 as default};
1
+ import{r as e,j as a}from"./floating-ui.react-dom-BWTnA00G.js";import{a as N,j as E}from"./useNoteMutate-BjvZUmtX.js";import{A,a1 as M,P as y,T as t,D as c,J as o}from"./time-PxWila4-.js";import{f as w}from"./mcp-admin-adapter-D0R8p9az.js";import{a as b,d as H,c as S,S as T,g as C,h as R}from"./url-DKUMNVCI.js";import{e as k}from"./app-BFM2V_Rx.js";import{I as F}from"./Image.es-CjXY1JVf.js";import{n as V,c as _}from"./Trash.es-XEcWG_aq.js";import{f as I}from"./Graph-hVj6vAYJ.js";import"./preload-helper-BXl3LOEh.js";const L=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z",opacity:"0.2"}),e.createElement("path",{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z"}))]]),P=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z",opacity:"0.2"}),e.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"}))]]),O=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z",opacity:"0.2"}),e.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z"}))]]),x=e.forwardRef((s,r)=>e.createElement(A,{ref:r,...s,weights:L}));x.displayName="MoonIcon";const U=x,g=e.forwardRef((s,r)=>e.createElement(A,{ref:r,...s,weights:P}));g.displayName="PaletteIcon";const $=g,p=e.forwardRef((s,r)=>e.createElement(A,{ref:r,...s,weights:O}));p.displayName="SunIcon";const G=p,q="https://github.com/baealex/ocean-brain/releases",D=s=>/^\d+\.\d+\.\d+/.test(s)?`v${s}`:s,Q=["mcp-admin","status"],s0=()=>{const{theme:s,toggleTheme:r}=M(j=>j),{data:Z,isLoading:u}=N({queryKey:Q,queryFn:w}),d=Z?.server,n="focus-ring-soft surface-base group flex items-start justify-between gap-3.5 px-4 py-3.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",l="inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-[15px] border border-border-subtle bg-muted text-fg-secondary transition-colors group-hover:border-border-secondary/70 group-hover:text-fg-default",m="h-6 w-6",h="text-fg-tertiary",i="min-w-0 flex flex-col gap-0.5 pt-0.5",f=d?D(d.version):u?"checking…":"unknown",v=d?.releaseUrl??q;return a.jsx(y,{title:"Settings",description:"Manage display, workspace tools, and advanced connections",children:a.jsxs("div",{className:"flex flex-col gap-6",children:[a.jsxs("section",{className:"flex flex-col gap-3",children:[a.jsx(t,{as:"p",variant:"label",weight:"medium",className:h,children:"Appearance"}),a.jsxs("button",{type:"button",className:n,onClick:r,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx($,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Theme"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Switch between light and dark mode."})]})]}),a.jsxs("div",{className:"mt-0.5 flex shrink-0 items-center gap-2 text-fg-tertiary",children:[a.jsx(t,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:s==="dark"?"Dark":"Light"}),s==="dark"?a.jsx(U,{className:"h-4 w-4",weight:"fill"}):a.jsx(G,{className:"h-4 w-4",weight:"fill"})]})]})]}),a.jsxs("section",{className:"flex flex-col gap-3",children:[a.jsx(t,{as:"p",variant:"label",weight:"medium",className:h,children:"Workspace"}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[a.jsxs(c,{to:b,search:{page:1},className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(E,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Properties"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Manage fields used across notes."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),a.jsxs(c,{to:H,search:{page:1},className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(k,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Placeholders"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Manage reusable template variables."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),a.jsxs(c,{to:S,search:{page:1},className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(F,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Images"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Review uploaded note images."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),a.jsxs(c,{to:T,search:{page:1},className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(V,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Trash"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Restore or permanently delete notes."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]})]})]}),a.jsxs("section",{className:"flex flex-col gap-3",children:[a.jsx(t,{as:"p",variant:"label",weight:"medium",className:h,children:"Advanced"}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[a.jsxs(c,{to:C,className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(I,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Search"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Add meaning-based recall with an embedding API."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),a.jsxs(c,{to:R,className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(_,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"MCP"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Connect Codex, Claude, or another MCP client."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]})]})]}),a.jsxs(t,{as:"p",variant:"meta",tone:"tertiary",className:"border-t border-border-subtle pt-4",children:["Ocean Brain ",f," ·"," ",a.jsx("a",{href:v,target:"_blank",rel:"noreferrer",className:"font-medium text-fg-secondary underline-offset-4 hover:underline",children:"Releases"})]})]})})};export{s0 as default};
@@ -1 +1 @@
1
- import{r as t,j as e}from"./floating-ui.react-dom-BWTnA00G.js";import{A as k,T as r,O as D,D as p,R as F,H as _,Q as R,h as Z,u as q,i as y,q as h,U as B,V as O,B as b,l as c,e as z}from"./time-PxWila4-.js";import{u as G,b as v}from"./useNoteMutate-BjvZUmtX.js";import{a as L,d as U}from"./image.api-ChvlfuZg.js";import{c as H}from"./app-BezcjTfd.js";import{I as K,g as Q}from"./image-delete-confirmation-D7xrODQV.js";import{S as x}from"./SurfaceCard-D5QxOte_.js";import{N as P,T as $,c as C,b as V}from"./url-DKUMNVCI.js";import"./NotePropertiesPanel-6P7UfRBR.js";import{c as J,n as W}from"./Trash.es-XEcWG_aq.js";import{I as X}from"./Image.es-CjXY1JVf.js";import"./preload-helper-BXl3LOEh.js";import"./Graph-hVj6vAYJ.js";import"./AuxiliaryPanelHeader-HAttwVby.js";import"./LinkSimple.es-B-P-7Iem.js";import"./Plus.es-Dy6onD-Z.js";const Y=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M178,36c-20.09,0-37.92,7.93-50,21.56C115.92,43.93,98.09,36,78,36a66.08,66.08,0,0,0-66,66c0,72.34,105.81,130.14,110.31,132.57a12,12,0,0,0,11.38,0C138.19,232.14,244,174.34,244,102A66.08,66.08,0,0,0,178,36Zm-5.49,142.36A328.69,328.69,0,0,1,128,210.16a328.69,328.69,0,0,1-44.51-31.8C61.82,159.77,36,131.42,36,102A42,42,0,0,1,78,60c17.8,0,32.7,9.4,38.89,24.54a12,12,0,0,0,22.22,0C145.3,69.4,160.2,60,178,60a42,42,0,0,1,42,42C220,131.42,194.18,159.77,172.51,178.36Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M232,102c0,66-104,122-104,122S24,168,24,102A54,54,0,0,1,78,48c22.59,0,41.94,12.31,50,32,8.06-19.69,27.41-32,50-32A54,54,0,0,1,232,102Z",opacity:"0.2"}),t.createElement("path",{d:"M178,40c-20.65,0-38.73,8.88-50,23.89C116.73,48.88,98.65,40,78,40a62.07,62.07,0,0,0-62,62c0,70,103.79,126.66,108.21,129a8,8,0,0,0,7.58,0C136.21,228.66,240,172,240,102A62.07,62.07,0,0,0,178,40ZM128,214.8C109.74,204.16,32,155.69,32,102A46.06,46.06,0,0,1,78,56c19.45,0,35.78,10.36,42.6,27a8,8,0,0,0,14.8,0c6.82-16.67,23.15-27,42.6-27a46.06,46.06,0,0,1,46,46C224,155.61,146.24,204.15,128,214.8Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M240,102c0,70-103.79,126.66-108.21,129a8,8,0,0,1-7.58,0C119.79,228.66,16,172,16,102A62.07,62.07,0,0,1,78,40c20.65,0,38.73,8.88,50,23.89C139.27,48.88,157.35,40,178,40A62.07,62.07,0,0,1,240,102Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M178,42c-21,0-39.26,9.47-50,25.34C117.26,51.47,99,42,78,42a60.07,60.07,0,0,0-60,60c0,29.2,18.2,59.59,54.1,90.31a334.68,334.68,0,0,0,53.06,37,6,6,0,0,0,5.68,0,334.68,334.68,0,0,0,53.06-37C219.8,161.59,238,131.2,238,102A60.07,60.07,0,0,0,178,42ZM128,217.11C111.59,207.64,30,157.72,30,102A48.05,48.05,0,0,1,78,54c20.28,0,37.31,10.83,44.45,28.27a6,6,0,0,0,11.1,0C140.69,64.83,157.72,54,178,54a48.05,48.05,0,0,1,48,48C226,157.72,144.41,207.64,128,217.11Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M178,40c-20.65,0-38.73,8.88-50,23.89C116.73,48.88,98.65,40,78,40a62.07,62.07,0,0,0-62,62c0,70,103.79,126.66,108.21,129a8,8,0,0,0,7.58,0C136.21,228.66,240,172,240,102A62.07,62.07,0,0,0,178,40ZM128,214.8C109.74,204.16,32,155.69,32,102A46.06,46.06,0,0,1,78,56c19.45,0,35.78,10.36,42.6,27a8,8,0,0,0,14.8,0c6.82-16.67,23.15-27,42.6-27a46.06,46.06,0,0,1,46,46C224,155.61,146.24,204.15,128,214.8Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M178,44c-21.44,0-39.92,10.19-50,27.07C117.92,54.19,99.44,44,78,44a58.07,58.07,0,0,0-58,58c0,28.59,18,58.47,53.4,88.79a333.81,333.81,0,0,0,52.7,36.73,4,4,0,0,0,3.8,0,333.81,333.81,0,0,0,52.7-36.73C218,160.47,236,130.59,236,102A58.07,58.07,0,0,0,178,44ZM128,219.42c-14-8-100-59.35-100-117.42A50.06,50.06,0,0,1,78,52c21.11,0,38.85,11.31,46.3,29.51a4,4,0,0,0,7.4,0C139.15,63.31,156.89,52,178,52a50.06,50.06,0,0,1,50,50C228,160,142,211.46,128,219.42Z"}))]]),E=t.forwardRef((a,n)=>t.createElement(k,{ref:n,...a,weights:Y}));E.displayName="HeartIcon";const ee=E;function ae({name:a}){return e.jsx(r,{as:"div",variant:"label",weight:"medium",tone:"secondary",className:"inline-flex items-center rounded-full border border-border-subtle bg-hover-subtle px-2.5 py-1",children:a})}function se({id:a,title:n,tags:i,createdAt:u,updatedAt:d}){const o=new Date(Number(u)),m=D(Number(d));return e.jsx("div",{className:"border-b-2 border-dashed border-border-subtle last:border-b-0",children:e.jsxs("div",{className:"py-4 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r,{variant:"label",weight:"medium",tone:"tertiary",children:m}),e.jsxs(r,{variant:"label",tone:"placeholder",children:["(",o.toDateString(),")"]})]}),e.jsx(r,{as:"div",variant:"body",weight:"bold",tracking:"tight",children:e.jsx(p,{className:"transition-colors hover:text-accent-primary",to:P,params:{id:a},children:n||"Untitled"})}),i&&i.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.map(l=>e.jsx(p,{to:$,params:{id:l.id},search:{page:1},children:e.jsx(ae,{name:l.name})},l.id))})]})})}const f=Z(V),te="mb-4 inline-flex items-center gap-1 text-fg-secondary transition-colors hover:text-fg-default",A="flex h-[248px] items-center justify-center bg-muted/25 p-3 sm:h-[352px]",re="h-full w-full rounded-[12px] object-contain",I="mb-3 flex flex-wrap items-start justify-between gap-3 border-b border-border-subtle pb-3",T="space-y-1",M="grid gap-6 min-[1200px]:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]",ne=a=>a===0?"Unused":a===1?"1 reference":`${a} references`,w=(a,n)=>typeof a=="object"&&a!==null&&"errors"in a&&Array.isArray(a.errors)&&typeof a.errors[0]?.message=="string"?a.errors[0].message:a instanceof Error&&a.message?a.message:n,ie=()=>e.jsxs("div",{className:M,children:[e.jsx("div",{className:"min-w-0",children:e.jsxs(x,{flush:!0,children:[e.jsx("div",{className:A,children:e.jsx(c,{width:"100%",height:"100%",className:"rounded-[12px]"})}),e.jsxs("div",{className:"flex flex-col gap-4 border-t border-border-subtle p-4",children:[e.jsx(c,{width:96,height:14,className:"rounded-full"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(c,{height:32,className:"flex-1 rounded-[12px]"}),e.jsx(c,{height:32,className:"flex-1 rounded-[12px]"})]})]})]})}),e.jsx("div",{className:"min-w-0",children:e.jsxs(x,{children:[e.jsxs("div",{className:I,children:[e.jsxs("div",{className:T,children:[e.jsx(c,{width:140,height:18}),e.jsx(c,{width:220,height:14,className:"rounded-full"})]}),e.jsx(c,{width:84,height:14,className:"rounded-full"})]}),e.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:3},(a,n)=>e.jsx(c,{height:72,className:"rounded-[16px]"},n))})]})})]}),le=({id:a})=>{const n=G(),i=z(),u=f.useNavigate(),d=q(),{data:o}=y({queryKey:h.images.detail(a),queryFn:async()=>{const s=await L(a);if(s.type==="error")throw s;return s.image}}),{data:m}=y({queryKey:h.images.notes(a),queryFn:async()=>{const s=await B(o.url);if(s.type==="error")throw s;return s.imageNotes}}),l=m.length,j=ne(l),g=v({mutationFn:async()=>{const s=await U(a);if(s.type==="error")throw s;if(!s.deleteImage)throw new Error("Failed to delete image");return s.deleteImage},onSuccess:async()=>{await d.invalidateQueries({queryKey:h.images.listAll(),exact:!1}),i("Image deleted"),u({to:C,search:{page:1}})},onError:s=>{i(w(s,"Failed to delete image"))}}),N=v({mutationFn:async()=>{const s=await H("heroBanner",o.url);if(s.type==="error")throw s},onSuccess:async()=>{await d.invalidateQueries({queryKey:h.ui.heroBanner(),exact:!0}),i("Hero banner updated")},onError:s=>{i(w(s,"Failed to update hero banner"))}}),S=async()=>{g.isPending||await n(Q(l))&&g.mutate()};return e.jsxs("div",{className:M,children:[e.jsx("div",{className:"min-w-0",children:e.jsxs(x,{flush:!0,children:[e.jsx("a",{href:o.url,target:"_blank",rel:"noreferrer","aria-label":"Open original image",className:"focus-ring-soft block overflow-hidden rounded-t-[18px] outline-none",children:e.jsx("div",{className:A,children:e.jsx(K,{className:`${re} transition-transform duration-200 hover:scale-[1.02]`,src:o.url,alt:`Image ${o.id}`})})}),e.jsxs("div",{className:"flex flex-col gap-4 border-t border-border-subtle p-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{size:14,className:"text-fg-tertiary"}),e.jsx(r,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:j})]}),e.jsx(r,{as:"p",variant:"meta",tone:"tertiary",children:l>0?"Deleting this image will break it in the referenced notes":"No notes currently reference this image"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(O,{content:"Delete this image",side:"bottom",children:e.jsxs(b,{variant:"soft-danger",size:"sm",className:"flex-1",isLoading:g.isPending,onClick:S,children:[e.jsx(W,{size:16}),"Delete"]})}),e.jsxs(b,{variant:"primary",size:"sm",className:"flex-1",isLoading:N.isPending,onClick:()=>N.mutate(),children:[e.jsx(ee,{size:16}),"Set hero banner"]})]})]})]})}),e.jsx("div",{className:"min-w-0",children:e.jsxs(x,{children:[e.jsxs("div",{className:I,children:[e.jsxs("div",{className:T,children:[e.jsx(r,{as:"h2",variant:"subheading",weight:"medium",tracking:"tight",children:"Referenced Notes"}),e.jsx(r,{as:"p",variant:"meta",tone:"secondary",children:"Notes currently using this image"})]}),e.jsx(r,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:j})]}),l>0?e.jsx("ul",{className:"flex flex-col",children:m.map(s=>e.jsx("li",{children:e.jsx(se,{...s})},s.id))}):e.jsxs("div",{className:"flex items-start gap-3 py-1",children:[e.jsx("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-[10px] bg-muted/25 text-fg-disabled",children:e.jsx(X,{size:18})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(r,{as:"p",variant:"body",weight:"medium",tone:"secondary",children:"No notes reference this image"}),e.jsx(r,{as:"p",variant:"meta",tone:"secondary",children:"This image can be deleted or reused in another note"})]})]})]})})]})},Ce=()=>{const{id:a}=f.useParams(),{page:n}=f.useSearch();return e.jsxs("div",{className:"w-full",children:[e.jsx(F,{children:e.jsx("title",{children:"Image Detail | Ocean Brain"})}),e.jsxs(p,{to:C,search:{page:n},className:te,children:[e.jsx(_,{size:16}),e.jsx(r,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:"Back to Images"})]}),e.jsx(r,{as:"h1",variant:"heading",weight:"bold",tracking:"tighter",className:"sr-only",children:"Image Detail"}),e.jsx(R,{fallback:e.jsx(ie,{}),errorTitle:"Failed to load image detail",errorDescription:"Retry loading the image preview and its referenced notes",resetKeys:[a],children:e.jsx(le,{id:a})})]})};export{Ce as default};
1
+ import{r as t,j as e}from"./floating-ui.react-dom-BWTnA00G.js";import{A as k,T as r,O as D,D as p,R as F,H as _,Q as R,h as Z,u as q,i as y,q as h,U as B,V as O,B as b,l as c,e as z}from"./time-PxWila4-.js";import{u as G,b as v}from"./useNoteMutate-BjvZUmtX.js";import{a as L,d as U}from"./image.api-ChvlfuZg.js";import{c as H}from"./app-BFM2V_Rx.js";import{I as K,g as Q}from"./image-delete-confirmation-D7xrODQV.js";import{S as x}from"./SurfaceCard-D5QxOte_.js";import{N as P,T as $,c as C,b as V}from"./url-DKUMNVCI.js";import"./NotePropertiesPanel-6P7UfRBR.js";import{c as J,n as W}from"./Trash.es-XEcWG_aq.js";import{I as X}from"./Image.es-CjXY1JVf.js";import"./preload-helper-BXl3LOEh.js";import"./Graph-hVj6vAYJ.js";import"./AuxiliaryPanelHeader-HAttwVby.js";import"./LinkSimple.es-B-P-7Iem.js";import"./Plus.es-Dy6onD-Z.js";const Y=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M178,36c-20.09,0-37.92,7.93-50,21.56C115.92,43.93,98.09,36,78,36a66.08,66.08,0,0,0-66,66c0,72.34,105.81,130.14,110.31,132.57a12,12,0,0,0,11.38,0C138.19,232.14,244,174.34,244,102A66.08,66.08,0,0,0,178,36Zm-5.49,142.36A328.69,328.69,0,0,1,128,210.16a328.69,328.69,0,0,1-44.51-31.8C61.82,159.77,36,131.42,36,102A42,42,0,0,1,78,60c17.8,0,32.7,9.4,38.89,24.54a12,12,0,0,0,22.22,0C145.3,69.4,160.2,60,178,60a42,42,0,0,1,42,42C220,131.42,194.18,159.77,172.51,178.36Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M232,102c0,66-104,122-104,122S24,168,24,102A54,54,0,0,1,78,48c22.59,0,41.94,12.31,50,32,8.06-19.69,27.41-32,50-32A54,54,0,0,1,232,102Z",opacity:"0.2"}),t.createElement("path",{d:"M178,40c-20.65,0-38.73,8.88-50,23.89C116.73,48.88,98.65,40,78,40a62.07,62.07,0,0,0-62,62c0,70,103.79,126.66,108.21,129a8,8,0,0,0,7.58,0C136.21,228.66,240,172,240,102A62.07,62.07,0,0,0,178,40ZM128,214.8C109.74,204.16,32,155.69,32,102A46.06,46.06,0,0,1,78,56c19.45,0,35.78,10.36,42.6,27a8,8,0,0,0,14.8,0c6.82-16.67,23.15-27,42.6-27a46.06,46.06,0,0,1,46,46C224,155.61,146.24,204.15,128,214.8Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M240,102c0,70-103.79,126.66-108.21,129a8,8,0,0,1-7.58,0C119.79,228.66,16,172,16,102A62.07,62.07,0,0,1,78,40c20.65,0,38.73,8.88,50,23.89C139.27,48.88,157.35,40,178,40A62.07,62.07,0,0,1,240,102Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M178,42c-21,0-39.26,9.47-50,25.34C117.26,51.47,99,42,78,42a60.07,60.07,0,0,0-60,60c0,29.2,18.2,59.59,54.1,90.31a334.68,334.68,0,0,0,53.06,37,6,6,0,0,0,5.68,0,334.68,334.68,0,0,0,53.06-37C219.8,161.59,238,131.2,238,102A60.07,60.07,0,0,0,178,42ZM128,217.11C111.59,207.64,30,157.72,30,102A48.05,48.05,0,0,1,78,54c20.28,0,37.31,10.83,44.45,28.27a6,6,0,0,0,11.1,0C140.69,64.83,157.72,54,178,54a48.05,48.05,0,0,1,48,48C226,157.72,144.41,207.64,128,217.11Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M178,40c-20.65,0-38.73,8.88-50,23.89C116.73,48.88,98.65,40,78,40a62.07,62.07,0,0,0-62,62c0,70,103.79,126.66,108.21,129a8,8,0,0,0,7.58,0C136.21,228.66,240,172,240,102A62.07,62.07,0,0,0,178,40ZM128,214.8C109.74,204.16,32,155.69,32,102A46.06,46.06,0,0,1,78,56c19.45,0,35.78,10.36,42.6,27a8,8,0,0,0,14.8,0c6.82-16.67,23.15-27,42.6-27a46.06,46.06,0,0,1,46,46C224,155.61,146.24,204.15,128,214.8Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M178,44c-21.44,0-39.92,10.19-50,27.07C117.92,54.19,99.44,44,78,44a58.07,58.07,0,0,0-58,58c0,28.59,18,58.47,53.4,88.79a333.81,333.81,0,0,0,52.7,36.73,4,4,0,0,0,3.8,0,333.81,333.81,0,0,0,52.7-36.73C218,160.47,236,130.59,236,102A58.07,58.07,0,0,0,178,44ZM128,219.42c-14-8-100-59.35-100-117.42A50.06,50.06,0,0,1,78,52c21.11,0,38.85,11.31,46.3,29.51a4,4,0,0,0,7.4,0C139.15,63.31,156.89,52,178,52a50.06,50.06,0,0,1,50,50C228,160,142,211.46,128,219.42Z"}))]]),E=t.forwardRef((a,n)=>t.createElement(k,{ref:n,...a,weights:Y}));E.displayName="HeartIcon";const ee=E;function ae({name:a}){return e.jsx(r,{as:"div",variant:"label",weight:"medium",tone:"secondary",className:"inline-flex items-center rounded-full border border-border-subtle bg-hover-subtle px-2.5 py-1",children:a})}function se({id:a,title:n,tags:i,createdAt:u,updatedAt:d}){const o=new Date(Number(u)),m=D(Number(d));return e.jsx("div",{className:"border-b-2 border-dashed border-border-subtle last:border-b-0",children:e.jsxs("div",{className:"py-4 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r,{variant:"label",weight:"medium",tone:"tertiary",children:m}),e.jsxs(r,{variant:"label",tone:"placeholder",children:["(",o.toDateString(),")"]})]}),e.jsx(r,{as:"div",variant:"body",weight:"bold",tracking:"tight",children:e.jsx(p,{className:"transition-colors hover:text-accent-primary",to:P,params:{id:a},children:n||"Untitled"})}),i&&i.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.map(l=>e.jsx(p,{to:$,params:{id:l.id},search:{page:1},children:e.jsx(ae,{name:l.name})},l.id))})]})})}const f=Z(V),te="mb-4 inline-flex items-center gap-1 text-fg-secondary transition-colors hover:text-fg-default",A="flex h-[248px] items-center justify-center bg-muted/25 p-3 sm:h-[352px]",re="h-full w-full rounded-[12px] object-contain",I="mb-3 flex flex-wrap items-start justify-between gap-3 border-b border-border-subtle pb-3",T="space-y-1",M="grid gap-6 min-[1200px]:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]",ne=a=>a===0?"Unused":a===1?"1 reference":`${a} references`,w=(a,n)=>typeof a=="object"&&a!==null&&"errors"in a&&Array.isArray(a.errors)&&typeof a.errors[0]?.message=="string"?a.errors[0].message:a instanceof Error&&a.message?a.message:n,ie=()=>e.jsxs("div",{className:M,children:[e.jsx("div",{className:"min-w-0",children:e.jsxs(x,{flush:!0,children:[e.jsx("div",{className:A,children:e.jsx(c,{width:"100%",height:"100%",className:"rounded-[12px]"})}),e.jsxs("div",{className:"flex flex-col gap-4 border-t border-border-subtle p-4",children:[e.jsx(c,{width:96,height:14,className:"rounded-full"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(c,{height:32,className:"flex-1 rounded-[12px]"}),e.jsx(c,{height:32,className:"flex-1 rounded-[12px]"})]})]})]})}),e.jsx("div",{className:"min-w-0",children:e.jsxs(x,{children:[e.jsxs("div",{className:I,children:[e.jsxs("div",{className:T,children:[e.jsx(c,{width:140,height:18}),e.jsx(c,{width:220,height:14,className:"rounded-full"})]}),e.jsx(c,{width:84,height:14,className:"rounded-full"})]}),e.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:3},(a,n)=>e.jsx(c,{height:72,className:"rounded-[16px]"},n))})]})})]}),le=({id:a})=>{const n=G(),i=z(),u=f.useNavigate(),d=q(),{data:o}=y({queryKey:h.images.detail(a),queryFn:async()=>{const s=await L(a);if(s.type==="error")throw s;return s.image}}),{data:m}=y({queryKey:h.images.notes(a),queryFn:async()=>{const s=await B(o.url);if(s.type==="error")throw s;return s.imageNotes}}),l=m.length,j=ne(l),g=v({mutationFn:async()=>{const s=await U(a);if(s.type==="error")throw s;if(!s.deleteImage)throw new Error("Failed to delete image");return s.deleteImage},onSuccess:async()=>{await d.invalidateQueries({queryKey:h.images.listAll(),exact:!1}),i("Image deleted"),u({to:C,search:{page:1}})},onError:s=>{i(w(s,"Failed to delete image"))}}),N=v({mutationFn:async()=>{const s=await H("heroBanner",o.url);if(s.type==="error")throw s},onSuccess:async()=>{await d.invalidateQueries({queryKey:h.ui.heroBanner(),exact:!0}),i("Hero banner updated")},onError:s=>{i(w(s,"Failed to update hero banner"))}}),S=async()=>{g.isPending||await n(Q(l))&&g.mutate()};return e.jsxs("div",{className:M,children:[e.jsx("div",{className:"min-w-0",children:e.jsxs(x,{flush:!0,children:[e.jsx("a",{href:o.url,target:"_blank",rel:"noreferrer","aria-label":"Open original image",className:"focus-ring-soft block overflow-hidden rounded-t-[18px] outline-none",children:e.jsx("div",{className:A,children:e.jsx(K,{className:`${re} transition-transform duration-200 hover:scale-[1.02]`,src:o.url,alt:`Image ${o.id}`})})}),e.jsxs("div",{className:"flex flex-col gap-4 border-t border-border-subtle p-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{size:14,className:"text-fg-tertiary"}),e.jsx(r,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:j})]}),e.jsx(r,{as:"p",variant:"meta",tone:"tertiary",children:l>0?"Deleting this image will break it in the referenced notes":"No notes currently reference this image"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(O,{content:"Delete this image",side:"bottom",children:e.jsxs(b,{variant:"soft-danger",size:"sm",className:"flex-1",isLoading:g.isPending,onClick:S,children:[e.jsx(W,{size:16}),"Delete"]})}),e.jsxs(b,{variant:"primary",size:"sm",className:"flex-1",isLoading:N.isPending,onClick:()=>N.mutate(),children:[e.jsx(ee,{size:16}),"Set hero banner"]})]})]})]})}),e.jsx("div",{className:"min-w-0",children:e.jsxs(x,{children:[e.jsxs("div",{className:I,children:[e.jsxs("div",{className:T,children:[e.jsx(r,{as:"h2",variant:"subheading",weight:"medium",tracking:"tight",children:"Referenced Notes"}),e.jsx(r,{as:"p",variant:"meta",tone:"secondary",children:"Notes currently using this image"})]}),e.jsx(r,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:j})]}),l>0?e.jsx("ul",{className:"flex flex-col",children:m.map(s=>e.jsx("li",{children:e.jsx(se,{...s})},s.id))}):e.jsxs("div",{className:"flex items-start gap-3 py-1",children:[e.jsx("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-[10px] bg-muted/25 text-fg-disabled",children:e.jsx(X,{size:18})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(r,{as:"p",variant:"body",weight:"medium",tone:"secondary",children:"No notes reference this image"}),e.jsx(r,{as:"p",variant:"meta",tone:"secondary",children:"This image can be deleted or reused in another note"})]})]})]})})]})},Ce=()=>{const{id:a}=f.useParams(),{page:n}=f.useSearch();return e.jsxs("div",{className:"w-full",children:[e.jsx(F,{children:e.jsx("title",{children:"Image Detail | Ocean Brain"})}),e.jsxs(p,{to:C,search:{page:n},className:te,children:[e.jsx(_,{size:16}),e.jsx(r,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:"Back to Images"})]}),e.jsx(r,{as:"h1",variant:"heading",weight:"bold",tracking:"tighter",className:"sr-only",children:"Image Detail"}),e.jsx(R,{fallback:e.jsx(ie,{}),errorTitle:"Failed to load image detail",errorDescription:"Retry loading the image preview and its referenced notes",resetKeys:[a],children:e.jsx(le,{id:a})})]})};export{Ce as default};
@@ -0,0 +1,5 @@
1
+ import{r as u,j as e}from"./floating-ui.react-dom-BWTnA00G.js";import{u as ne,a as se,b as C}from"./useNoteMutate-BjvZUmtX.js";import{u as ae,P as oe,T as i,a as A,b as p,L as h,B as f,d as F,s as ie,I as J,S as re,e as ce}from"./time-PxWila4-.js";import{f as le,s as de,r as me,a as ue}from"./mcp-admin-adapter-D0R8p9az.js";import{s as z}from"./Copy.es-fMv0ETir.js";import"./url-DKUMNVCI.js";const y=["mcp-admin","status"],N=t=>/^[A-Za-z0-9_./:@$-]+$/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`,b=t=>`'${t.replace(/'/g,"''")}'`,g={posix:"$HOME/.config/ocean-brain/mcp-token",powershell:"$HOME\\.config\\ocean-brain\\mcp-token"},Q=()=>typeof navigator<"u"&&/Windows/i.test(navigator.userAgent)?"powershell":"posix",pe=t=>{const n=t.match(/^\$HOME[\\/](.+)$/i)?.[1];return n?`Join-Path $HOME ${b(n)}`:b(t)},q=(t,n,a)=>{if(t==="powershell")return[`$tokenPath = ${pe(n)}`,"New-Item -ItemType Directory -Force -Path (Split-Path -Parent $tokenPath) | Out-Null",`Set-Content -Path $tokenPath -Value ${b(a)} -NoNewline -Encoding utf8`].join(`
2
+ `);const o=N(n);return[`mkdir -p "$(dirname ${o})"`,`printf '%s' ${N(a)} > ${o}`,`chmod 600 ${o}`].join(`
3
+ `)},H=(t,n,a)=>{const o=t==="powershell"?b:N;return`${t==="powershell"?"cmd.exe /d /c ":""}npx -y ocean-brain mcp --server ${o(n)} --token-file ${o(a)}`},he=(t,n,a)=>`codex mcp add ocean-brain -- ${H(t,n,a)}`,xe=(t,n,a)=>`claude mcp add --transport stdio ocean-brain -- ${H(t,n,a)}`,fe=(t,n,a)=>{const o=t==="powershell"?"cmd.exe":"npx",c=[...t==="powershell"?["/d","/c","npx"]:[],"-y","ocean-brain","mcp","--server",n,"--token-file",a];return JSON.stringify({mcpServers:{"ocean-brain":{command:o,args:c}}},null,2)},ye=(t,n,a,o,c)=>{const r=t==="codex"?he(n,a,o):t==="claude"?xe(n,a,o):fe(n,a,o);return t==="json"?["# 1. Create the token file",q(n,o,c),"","# 2. Add this MCP JSON",r].join(`
4
+ `):["# 1. Create the token file",q(n,o,c),"",`# 2. Add Ocean Brain to ${t}`,r].join(`
5
+ `)},ge=t=>!t||t==="unknown"?"MCP compatibility":`MCP compatibility ${t}`,be={codex:"Codex",claude:"Claude",json:"JSON"},Te=()=>{const t=ne(),n=ce(),a=ae(),[o,c]=u.useState(()=>window.location.origin),[r,P]=u.useState(""),[x,I]=u.useState(Q),[T,M]=u.useState(()=>g[Q()]),[l,B]=u.useState("codex"),{data:j,isLoading:V}=se({queryKey:y,queryFn:le}),S=C({mutationFn:de,onSuccess:s=>{a.setQueryData(y,s),n(s.enabled?"MCP access enabled.":"MCP access disabled.")}}),$=C({mutationFn:me,onSuccess:async({token:s})=>{P(s),n("New MCP token issued. Previous token is no longer valid."),await a.invalidateQueries({queryKey:y})}}),O=C({mutationFn:ue,onSuccess:s=>{P(""),a.setQueryData(y,s),n("MCP token revoked. Existing client configs will stop working.")}}),k=j?.enabled??!1,d=j?.hasActiveToken??!1,K=!V&&!S.isPending,_=T.trim()||g[x],D=ge(j?.server.mcpVersionRequirement),G=d?"1 active token":"No active token",W=l==="json"?"Token file and MCP JSON":`${be[l]} setup`,E=ye(l,x,o,_,r||"PASTE_TOKEN_HERE"),U="Copy setup",L="text-fg-tertiary",m="font-medium text-fg-tertiary",v="surface-base px-4 py-3.5",w="space-y-2",Z="max-w-full overflow-x-auto whitespace-pre font-mono text-xs leading-5 text-fg-secondary",X=async()=>{try{await navigator.clipboard.writeText(r),n("Copied token.")}catch{n("Failed to copy token.")}},Y=async()=>{try{await navigator.clipboard.writeText(E),n(l==="json"?"Copied MCP JSON.":"Copied MCP command.")}catch{n(`Could not copy. Select the ${l==="json"?"JSON":"command"} and copy it manually.`)}},ee=async()=>{d&&!await t("Rotate the MCP token? Existing MCP clients will stop working until they use the new token.")||$.mutate(void 0)},te=async()=>{await t("Revoke the MCP token? Existing MCP clients will stop working immediately.")&&O.mutate()};return e.jsx(oe,{title:"MCP",variant:"default",description:"Connect this Ocean Brain instance to MCP clients.",headerRight:e.jsxs("div",{className:"inline-flex items-center gap-3 rounded-[14px] border border-border-subtle bg-muted px-3 py-2",children:[e.jsxs(i,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:["MCP access ",k?"on":"off"]}),e.jsx(re,{"aria-label":"MCP access",checked:k,disabled:!K,onCheckedChange:()=>{S.mutate(!k)}})]}),children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("section",{className:"flex flex-col gap-3","aria-labelledby":"mcp-connect-heading",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(i,{id:"mcp-connect-heading",as:"h2",variant:"label",weight:"medium",className:L,children:"Connect a client"}),e.jsx(i,{as:"p",variant:"meta",tone:"secondary",children:"Save your token in a local file, then copy the command for your client."})]}),e.jsx(i,{as:"span",variant:"meta",weight:"medium",tone:"tertiary",className:"rounded-full border border-border-subtle bg-hover-subtle px-2.5 py-1",children:D})]}),e.jsxs("div",{className:`${v} flex flex-col gap-3`,children:[e.jsx("div",{className:"flex flex-wrap items-center gap-3",children:e.jsxs(A,{type:"single",variant:"quiet",size:"sm",value:l,onValueChange:s=>{(s==="codex"||s==="claude"||s==="json")&&B(s)},children:[e.jsx(p,{value:"codex",children:"Codex"}),e.jsx(p,{value:"claude",children:"Claude"}),e.jsx(p,{value:"json",children:"JSON"})]})}),e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx(h,{htmlFor:"mcp-connection-output",className:m,children:W}),e.jsxs(f,{type:"button",variant:"subtle",size:"sm",onClick:Y,children:[e.jsx(z,{className:"h-4 w-4"}),U]})]}),e.jsx(F,{id:"mcp-connection-output",readOnly:!0,rows:l==="json"?13:9,wrap:"off",value:E,className:Z}),e.jsx(i,{as:"p",variant:"meta",tone:"tertiary",children:r?"The new token is already included in the token file step.":"Replace PASTE_TOKEN_HERE before running. The MCP client reads the token from that file."})]}),e.jsxs("details",{className:"group rounded-[12px] border border-border-subtle bg-muted",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2.5 marker:hidden",children:[e.jsx(i,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:"Connection options"}),e.jsx(ie,{className:"h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-open:rotate-180","aria-hidden":"true"})]}),e.jsxs("div",{className:"space-y-3 border-t border-border-subtle px-3 py-3",children:[e.jsxs("div",{className:w,children:[e.jsx(h,{className:m,children:"Setup shell"}),e.jsxs(A,{type:"single",variant:"quiet",size:"sm",value:x,onValueChange:s=>{s!=="posix"&&s!=="powershell"||(M(R=>R===g[x]?g[s]:R),I(s))},"aria-label":"Setup shell",children:[e.jsx(p,{value:"posix",children:"macOS / Linux"}),e.jsx(p,{value:"powershell",children:"Windows PowerShell"})]})]}),e.jsxs("div",{className:w,children:[e.jsx(h,{htmlFor:"mcp-server-url",className:m,children:"Ocean Brain URL"}),e.jsx(J,{id:"mcp-server-url",value:o,onChange:s=>c(s.target.value)})]}),e.jsxs("div",{className:w,children:[e.jsx(h,{htmlFor:"mcp-token-file-path",className:m,children:"Token file path"}),e.jsx(J,{id:"mcp-token-file-path",placeholder:"/absolute/path/to/ocean-brain/mcp-token",value:T,onChange:s=>M(s.target.value)})]})]})]})]})]}),e.jsxs("section",{className:"flex flex-col gap-3","aria-labelledby":"mcp-token-heading",children:[e.jsxs("div",{className:`${v} flex flex-wrap items-center justify-between gap-3`,children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx(i,{id:"mcp-token-heading",as:"h2",variant:"label",weight:"medium",className:L,children:"Token"}),e.jsxs(i,{as:"p",variant:"meta",tone:"tertiary",children:[G,". New tokens are shown once."]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(f,{type:"button",size:"sm",variant:d?"subtle":"primary",onClick:ee,isLoading:$.isPending,children:d?"Rotate token":"Issue token"}),e.jsx(f,{type:"button",size:"sm",variant:"soft-danger",onClick:te,isLoading:O.isPending,disabled:!d,children:"Revoke token"})]})]}),r&&e.jsxs("div",{className:`${v} border-dashed`,children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(h,{htmlFor:"issued-mcp-token",className:m,children:"New token"}),e.jsx(i,{as:"p",variant:"meta",tone:"secondary",children:"Copy this token now and save it in your token file."})]}),e.jsxs(f,{type:"button",variant:"subtle",size:"sm",onClick:X,children:[e.jsx(z,{className:"h-4 w-4"}),"Copy token"]})]}),e.jsx(F,{id:"issued-mcp-token",rows:3,readOnly:!0,value:r})]})]})]})})};export{Te as default};
@@ -1,4 +1,4 @@
1
- import{S as Tn,E as V,P as B,a as I,c as kt,g as wo,f as Ne,u as xo,C as de,D as _,b as U,N as F,M as ce,T as L,d as De,R as So,e as H,F as M,h as An,i as Ln,j as Dt,k as Pn,t as $n,m as oe,l as In,y as et,n as On,r as _n,o as ie,p as Nn,q as le,s as Dn,v as Hn,w as Vn,x as Rn,z as zn,A as Un,B as jn,G as Fn,O as qn,H as Wn,I as Eo,J as Gn,K as Zn,L as Jn,Q as Xn,U as Kn,V as Yn,W as Qn,X as er,Y as tr,Z as or,_ as nr,$ as Mo,a0 as rr,a1 as ir,a2 as Bo,a3 as ar,a4 as ue,a5 as sr,a6 as Ht,a7 as Vt,a8 as Rt,a9 as lr,aa as dr,ab as cr,ac as ur,ad as pr,ae as hr,af as fr,ag as Pe,ah as mr,ai as To,aj as gr,ak as br,al as kr,am as yr,an as vr,ao as Cr,ap as wr,aq as xr,ar as Sr,as as Er,at as Mr,au as fe,av as Br,aw as Tr,ax as Ar,ay as Lr,az as Pr,aA as zt,aB as $r,aC as Ir,aD as Or,aE as He,aF as _r,aG as Nr,aH as Dr,aI as Hr,aJ as Vr,aK as Rr}from"./note-runtime-zN5ddTba.js";import{_ as Ut}from"./preload-helper-BXl3LOEh.js";var tt=Symbol("originalFactory");function v(e){if(typeof e=="object"&&"key"in e)return function t(){return e[tt]=t,e};if(typeof e!="function")throw Error("factory must be a function");return function t(o){return n=>{let r=e({editor:n.editor,options:o});return r[tt]=t,r}}}function Q(e,t){return new Tn(e,t)}function zr(e,t=JSON.stringify){let o={};return e.filter(n=>{let r=t(n);return Object.prototype.hasOwnProperty.call(o,r)?!1:o[r]=!0})}function Ur(e){return zr(e.filter((t,o)=>e.indexOf(t)!==o))}var Ve=V.create({name:"uniqueID",priority:1e4,addOptions(){return{attributeName:"id",types:[],setIdAttribute:!1,isWithinEditor:void 0,generateID:()=>{if(typeof window<"u"&&window.__TEST_OPTIONS){let e=window.__TEST_OPTIONS;return e.mockID===void 0?e.mockID=0:e.mockID++,e.mockID.toString()}return xo()},filterTransaction:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:e=>e.getAttribute(`data-${this.options.attributeName}`),renderHTML:e=>{let t={[`data-${this.options.attributeName}`]:e[this.options.attributeName]};return this.options.setIdAttribute?{...t,id:e[this.options.attributeName]}:t}}}}]},addProseMirrorPlugins(){let{isWithinEditor:e}=this.options,t=null,o=!1;return[new B({key:new I("uniqueID"),appendTransaction:(n,r,i)=>{let a=n.some(m=>m.docChanged)&&!r.doc.eq(i.doc),s=this.options.filterTransaction&&n.some(m=>!this.options.filterTransaction?.(m));if(!a||s)return;let{tr:l}=i,{types:d,attributeName:c,generateID:u}=this.options,p=kt(r.doc,n),{mapping:f}=p;if(wo(p).forEach(({newRange:m})=>{let h=Ne(i.doc,m,g=>d.includes(g.type.name)),b=Ur(h.map(({node:g})=>g.attrs[c]).filter(g=>g!==null));h.forEach(({node:g,pos:k})=>{let y=l.doc.nodeAt(k)?.attrs[c];if(y===null){let S=r.doc.type.createAndFill().content;if(r.doc.content.findDiffStart(S)===null){let q=JSON.parse(JSON.stringify(i.doc.toJSON()));if(q.content[0].content[0].attrs.id="initialBlockId",JSON.stringify(q.content)===JSON.stringify(S.toJSON())){l.setNodeMarkup(k,void 0,{...g.attrs,[c]:"initialBlockId"});return}}l.setNodeMarkup(k,void 0,{...g.attrs,[c]:u()});return}let{deleted:w}=f.invert().mapResult(k);w&&b.includes(y)&&l.setNodeMarkup(k,void 0,{...g.attrs,[c]:u()})})}),l.steps.length)return l.setMeta("uniqueID",!0),l},view(n){let r=i=>{let a=n.dom.parentElement;t=a?.contains(i.target)||e?.(i.target)?a:null};return window.addEventListener("dragstart",r),{destroy(){window.removeEventListener("dragstart",r)}}},props:{handleDOMEvents:{drop:(n,r)=>(o=t!==n.dom.parentElement||r.dataTransfer?.effectAllowed==="copy",t=null,!1),paste:()=>(o=!0,!1)},transformPasted:n=>{if(!o)return n;let{types:r,attributeName:i}=this.options,a=s=>{let l=[];return s.forEach(d=>{if(d.isText){l.push(d);return}if(!r.includes(d.type.name)){l.push(d.copy(a(d.content)));return}let c=d.type.create({...d.attrs,[i]:null},a(d.content),d.marks);l.push(c)}),M.from(l)};return o=!1,new H(a(n.content),n.openStart,n.openEnd)}}})]}});function jt(e){return e.type==="link"}function Ao(e){return typeof e!="string"&&e.type==="link"}function ne(e){return typeof e!="string"&&e.type==="text"}function ot(e){return yt(e)?{...e}:ve(e)?{type:"tableCell",content:[].concat(e.content),props:{backgroundColor:e.props?.backgroundColor??"default",textColor:e.props?.textColor??"default",textAlignment:e.props?.textAlignment??"left",colspan:e.props?.colspan??1,rowspan:e.props?.rowspan??1}}:{type:"tableCell",content:[].concat(e),props:{backgroundColor:"default",textColor:"default",textAlignment:"left",colspan:1,rowspan:1}}}function ve(e){return e!=null&&typeof e!="string"&&!Array.isArray(e)&&e.type==="tableCell"}function yt(e){return ve(e)&&e.props!==void 0&&e.content!==void 0}function Ce(e){return yt(e)?e.props.colspan??1:1}function nt(e){return yt(e)?e.props.rowspan??1:1}var j=class extends Error{constructor(e){super(`Unreachable case: ${e}`)}};function Ed(e,t=!0){let{"data-test":o,...n}=e;if(Object.keys(n).length>0&&t)throw Error("Object must be empty "+JSON.stringify(e))}var jr=()=>typeof navigator<"u"&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function G(e,t="Ctrl"){return jr()?e.replace("Mod","⌘"):e.replace("Mod",t)}function X(...e){return[...new Set(e.filter(t=>t).join(" ").split(" "))].join(" ")}var Md=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function Fr(e,t,o,n){let r=document.createElement("div");r.className=X("bn-block-content",o.class),r.setAttribute("data-content-type",e);for(let[a,s]of Object.entries(o))a!=="class"&&r.setAttribute(a,s);let i=document.createElement(t);i.className=X("bn-inline-content",n.class);for(let[a,s]of Object.entries(n))a!=="class"&&i.setAttribute(a,s);return r.appendChild(i),{dom:r,contentDOM:i}}var Ft=(e,t)=>{let o=ae(e,t.pmSchema);o.type.name==="blockContainer"&&(o=o.firstChild);let n=t.pmSchema.nodes[o.type.name].spec.toDOM;if(n===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let r=n(o);if(typeof r!="object"||!("dom"in r))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");return r};function Lo(e,t="<br>"){let o=e.querySelectorAll("p");if(o.length>1){let n=o[0];for(let r=1;r<o.length;r++){let i=o[r];n.innerHTML+=t+i.innerHTML,i.remove()}}}function we(e){return"data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Bd(e){let t=e.split("/");return!t.length||t[t.length-1]===""?e:t[t.length-1]}function qr(e){let t=["mp4","webm","ogg","mov","mkv","flv","avi","wmv","m4v"];try{let o=new URL(e).pathname.split(".").pop()?.toLowerCase()||"";return t.includes(o)}catch{return!1}}function Wr(e){let t={};return Object.entries(e).forEach(([o,n])=>{t[o]={default:n.default,keepOnSplit:!0,parseHTML:r=>{let i=r.getAttribute(we(o));if(i===null)return null;if(n.default===void 0&&n.type==="boolean"||n.default!==void 0&&typeof n.default=="boolean")return i==="true"?!0:i==="false"?!1:null;if(n.default===void 0&&n.type==="number"||n.default!==void 0&&typeof n.default=="number"){let a=parseFloat(i);return!Number.isNaN(a)&&Number.isFinite(a)?a:null}return i},renderHTML:r=>r[o]===n.default?{}:{[we(o)]:r[o]}}}),t}function Gr(e,t,o,n){let r=e();if(r===void 0)throw Error("Cannot find node position");let i=o.state.doc.resolve(r).node().attrs.id;if(!i)throw Error("Block doesn't have id");let a=t.getBlock(i);if(a.type!==n)throw Error("Block type does not match");return a}function rt(e,t,o,n,r=!1,i){let a=document.createElement("div");if(i!==void 0)for(let[s,l]of Object.entries(i))s!=="class"&&a.setAttribute(s,l);a.className=X("bn-block-content",i?.class||""),a.setAttribute("data-content-type",t);for(let[s,l]of Object.entries(o))l!==n[s].default&&a.setAttribute(we(s),l);return r&&a.setAttribute("data-file-block",""),a.appendChild(e.dom),e.contentDOM&&(e.contentDOM.className=X("bn-inline-content",e.contentDOM.className)),{...e,dom:a}}function Zr(e,t,o){return{config:{type:e.type,content:e.content,propSchema:t},implementation:{node:e.node,render:Ft,toExternalHTML:Ft},extensions:o}}function Jr(e,t){e.stopEvent=o=>(o.type==="mousedown"&&setTimeout(()=>{t.view.dom.blur()},10),!0)}function Xr(e,t){let o=[{tag:"[data-content-type="+e.type+"]",contentElement:".bn-inline-content"}];return t.parse&&o.push({tag:"*",getAttrs(n){if(typeof n=="string")return!1;let r=t.parse?.(n);return r===void 0?!1:r},preserveWhitespace:!0,getContent:e.content==="inline"||e.content==="none"?(n,r)=>{if(t.parseContent){let i=t.parseContent({el:n,schema:r});if(i!==void 0)return i}if(e.content==="inline"){let i=n.cloneNode(!0);return Lo(i,t.meta?.code?`
1
+ import{S as Tn,E as V,P as B,a as I,c as kt,g as wo,f as Ne,u as xo,C as de,D as _,b as U,N as F,M as ce,T as L,d as De,R as So,e as H,F as M,h as An,i as Ln,j as Dt,k as Pn,t as $n,m as oe,l as In,y as et,n as On,r as _n,o as ie,p as Nn,q as le,s as Dn,v as Hn,w as Vn,x as Rn,z as zn,A as Un,B as jn,G as Fn,O as qn,H as Wn,I as Eo,J as Gn,K as Zn,L as Jn,Q as Xn,U as Kn,V as Yn,W as Qn,X as er,Y as tr,Z as or,_ as nr,$ as Mo,a0 as rr,a1 as ir,a2 as Bo,a3 as ar,a4 as ue,a5 as sr,a6 as Ht,a7 as Vt,a8 as Rt,a9 as lr,aa as dr,ab as cr,ac as ur,ad as pr,ae as hr,af as fr,ag as Pe,ah as mr,ai as To,aj as gr,ak as br,al as kr,am as yr,an as vr,ao as Cr,ap as wr,aq as xr,ar as Sr,as as Er,at as Mr,au as fe,av as Br,aw as Tr,ax as Ar,ay as Lr,az as Pr,aA as zt,aB as $r,aC as Ir,aD as Or,aE as He,aF as _r,aG as Nr,aH as Dr,aI as Hr,aJ as Vr,aK as Rr}from"./note-runtime-B3ats-dC.js";import{_ as Ut}from"./preload-helper-BXl3LOEh.js";var tt=Symbol("originalFactory");function v(e){if(typeof e=="object"&&"key"in e)return function t(){return e[tt]=t,e};if(typeof e!="function")throw Error("factory must be a function");return function t(o){return n=>{let r=e({editor:n.editor,options:o});return r[tt]=t,r}}}function Q(e,t){return new Tn(e,t)}function zr(e,t=JSON.stringify){let o={};return e.filter(n=>{let r=t(n);return Object.prototype.hasOwnProperty.call(o,r)?!1:o[r]=!0})}function Ur(e){return zr(e.filter((t,o)=>e.indexOf(t)!==o))}var Ve=V.create({name:"uniqueID",priority:1e4,addOptions(){return{attributeName:"id",types:[],setIdAttribute:!1,isWithinEditor:void 0,generateID:()=>{if(typeof window<"u"&&window.__TEST_OPTIONS){let e=window.__TEST_OPTIONS;return e.mockID===void 0?e.mockID=0:e.mockID++,e.mockID.toString()}return xo()},filterTransaction:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:e=>e.getAttribute(`data-${this.options.attributeName}`),renderHTML:e=>{let t={[`data-${this.options.attributeName}`]:e[this.options.attributeName]};return this.options.setIdAttribute?{...t,id:e[this.options.attributeName]}:t}}}}]},addProseMirrorPlugins(){let{isWithinEditor:e}=this.options,t=null,o=!1;return[new B({key:new I("uniqueID"),appendTransaction:(n,r,i)=>{let a=n.some(m=>m.docChanged)&&!r.doc.eq(i.doc),s=this.options.filterTransaction&&n.some(m=>!this.options.filterTransaction?.(m));if(!a||s)return;let{tr:l}=i,{types:d,attributeName:c,generateID:u}=this.options,p=kt(r.doc,n),{mapping:f}=p;if(wo(p).forEach(({newRange:m})=>{let h=Ne(i.doc,m,g=>d.includes(g.type.name)),b=Ur(h.map(({node:g})=>g.attrs[c]).filter(g=>g!==null));h.forEach(({node:g,pos:k})=>{let y=l.doc.nodeAt(k)?.attrs[c];if(y===null){let S=r.doc.type.createAndFill().content;if(r.doc.content.findDiffStart(S)===null){let q=JSON.parse(JSON.stringify(i.doc.toJSON()));if(q.content[0].content[0].attrs.id="initialBlockId",JSON.stringify(q.content)===JSON.stringify(S.toJSON())){l.setNodeMarkup(k,void 0,{...g.attrs,[c]:"initialBlockId"});return}}l.setNodeMarkup(k,void 0,{...g.attrs,[c]:u()});return}let{deleted:w}=f.invert().mapResult(k);w&&b.includes(y)&&l.setNodeMarkup(k,void 0,{...g.attrs,[c]:u()})})}),l.steps.length)return l.setMeta("uniqueID",!0),l},view(n){let r=i=>{let a=n.dom.parentElement;t=a?.contains(i.target)||e?.(i.target)?a:null};return window.addEventListener("dragstart",r),{destroy(){window.removeEventListener("dragstart",r)}}},props:{handleDOMEvents:{drop:(n,r)=>(o=t!==n.dom.parentElement||r.dataTransfer?.effectAllowed==="copy",t=null,!1),paste:()=>(o=!0,!1)},transformPasted:n=>{if(!o)return n;let{types:r,attributeName:i}=this.options,a=s=>{let l=[];return s.forEach(d=>{if(d.isText){l.push(d);return}if(!r.includes(d.type.name)){l.push(d.copy(a(d.content)));return}let c=d.type.create({...d.attrs,[i]:null},a(d.content),d.marks);l.push(c)}),M.from(l)};return o=!1,new H(a(n.content),n.openStart,n.openEnd)}}})]}});function jt(e){return e.type==="link"}function Ao(e){return typeof e!="string"&&e.type==="link"}function ne(e){return typeof e!="string"&&e.type==="text"}function ot(e){return yt(e)?{...e}:ve(e)?{type:"tableCell",content:[].concat(e.content),props:{backgroundColor:e.props?.backgroundColor??"default",textColor:e.props?.textColor??"default",textAlignment:e.props?.textAlignment??"left",colspan:e.props?.colspan??1,rowspan:e.props?.rowspan??1}}:{type:"tableCell",content:[].concat(e),props:{backgroundColor:"default",textColor:"default",textAlignment:"left",colspan:1,rowspan:1}}}function ve(e){return e!=null&&typeof e!="string"&&!Array.isArray(e)&&e.type==="tableCell"}function yt(e){return ve(e)&&e.props!==void 0&&e.content!==void 0}function Ce(e){return yt(e)?e.props.colspan??1:1}function nt(e){return yt(e)?e.props.rowspan??1:1}var j=class extends Error{constructor(e){super(`Unreachable case: ${e}`)}};function Ed(e,t=!0){let{"data-test":o,...n}=e;if(Object.keys(n).length>0&&t)throw Error("Object must be empty "+JSON.stringify(e))}var jr=()=>typeof navigator<"u"&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function G(e,t="Ctrl"){return jr()?e.replace("Mod","⌘"):e.replace("Mod",t)}function X(...e){return[...new Set(e.filter(t=>t).join(" ").split(" "))].join(" ")}var Md=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function Fr(e,t,o,n){let r=document.createElement("div");r.className=X("bn-block-content",o.class),r.setAttribute("data-content-type",e);for(let[a,s]of Object.entries(o))a!=="class"&&r.setAttribute(a,s);let i=document.createElement(t);i.className=X("bn-inline-content",n.class);for(let[a,s]of Object.entries(n))a!=="class"&&i.setAttribute(a,s);return r.appendChild(i),{dom:r,contentDOM:i}}var Ft=(e,t)=>{let o=ae(e,t.pmSchema);o.type.name==="blockContainer"&&(o=o.firstChild);let n=t.pmSchema.nodes[o.type.name].spec.toDOM;if(n===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let r=n(o);if(typeof r!="object"||!("dom"in r))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");return r};function Lo(e,t="<br>"){let o=e.querySelectorAll("p");if(o.length>1){let n=o[0];for(let r=1;r<o.length;r++){let i=o[r];n.innerHTML+=t+i.innerHTML,i.remove()}}}function we(e){return"data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Bd(e){let t=e.split("/");return!t.length||t[t.length-1]===""?e:t[t.length-1]}function qr(e){let t=["mp4","webm","ogg","mov","mkv","flv","avi","wmv","m4v"];try{let o=new URL(e).pathname.split(".").pop()?.toLowerCase()||"";return t.includes(o)}catch{return!1}}function Wr(e){let t={};return Object.entries(e).forEach(([o,n])=>{t[o]={default:n.default,keepOnSplit:!0,parseHTML:r=>{let i=r.getAttribute(we(o));if(i===null)return null;if(n.default===void 0&&n.type==="boolean"||n.default!==void 0&&typeof n.default=="boolean")return i==="true"?!0:i==="false"?!1:null;if(n.default===void 0&&n.type==="number"||n.default!==void 0&&typeof n.default=="number"){let a=parseFloat(i);return!Number.isNaN(a)&&Number.isFinite(a)?a:null}return i},renderHTML:r=>r[o]===n.default?{}:{[we(o)]:r[o]}}}),t}function Gr(e,t,o,n){let r=e();if(r===void 0)throw Error("Cannot find node position");let i=o.state.doc.resolve(r).node().attrs.id;if(!i)throw Error("Block doesn't have id");let a=t.getBlock(i);if(a.type!==n)throw Error("Block type does not match");return a}function rt(e,t,o,n,r=!1,i){let a=document.createElement("div");if(i!==void 0)for(let[s,l]of Object.entries(i))s!=="class"&&a.setAttribute(s,l);a.className=X("bn-block-content",i?.class||""),a.setAttribute("data-content-type",t);for(let[s,l]of Object.entries(o))l!==n[s].default&&a.setAttribute(we(s),l);return r&&a.setAttribute("data-file-block",""),a.appendChild(e.dom),e.contentDOM&&(e.contentDOM.className=X("bn-inline-content",e.contentDOM.className)),{...e,dom:a}}function Zr(e,t,o){return{config:{type:e.type,content:e.content,propSchema:t},implementation:{node:e.node,render:Ft,toExternalHTML:Ft},extensions:o}}function Jr(e,t){e.stopEvent=o=>(o.type==="mousedown"&&setTimeout(()=>{t.view.dom.blur()},10),!0)}function Xr(e,t){let o=[{tag:"[data-content-type="+e.type+"]",contentElement:".bn-inline-content"}];return t.parse&&o.push({tag:"*",getAttrs(n){if(typeof n=="string")return!1;let r=t.parse?.(n);return r===void 0?!1:r},preserveWhitespace:!0,getContent:e.content==="inline"||e.content==="none"?(n,r)=>{if(t.parseContent){let i=t.parseContent({el:n,schema:r});if(i!==void 0)return i}if(e.content==="inline"){let i=n.cloneNode(!0);return Lo(i,t.meta?.code?`
2
2
  `:"<br>"),ie.fromSchema(r).parse(i,{topNode:r.nodes.paragraph.create(),preserveWhitespace:!0}).content}return M.empty}:void 0}),o}function Kr(e,t,o,n){let r=t.node||F.create({name:e.type,content:e.content==="inline"?"inline*":e.content==="none"?"":e.content,group:"blockContent",selectable:t.meta?.selectable??!0,isolating:t.meta?.isolating??!0,code:t.meta?.code??!1,defining:t.meta?.defining??!0,priority:n,addAttributes(){return Wr(e.propSchema)},parseHTML(){return Xr(e,t)},renderHTML({HTMLAttributes:i}){let a=document.createElement("div");return rt({dom:a,contentDOM:e.content==="inline"?a:void 0},e.type,{},e.propSchema,t.meta?.fileBlockAccept!==void 0,i)},addNodeView(){return i=>{let a=this.options.editor,s=Gr(i.getPos,a,this.editor,e.type),l=this.options.domAttributes?.blockContent||{},d=t.render.call({blockContentDOMAttributes:l,props:i,renderType:"nodeView"},s,a);return t.meta?.selectable===!1&&Jr(d,this.editor),d}}});if(r.name!==e.type)throw Error("Node name does not match block type. This is a bug in BlockNote.");return{config:e,implementation:{...t,node:r,render(i,a){let s=r.options.domAttributes?.blockContent||{};return t.render.call({blockContentDOMAttributes:s,props:void 0,renderType:"dom"},i,a)},toExternalHTML:(i,a,s)=>{let l=r.options.domAttributes?.blockContent||{};return t.toExternalHTML?.call({blockContentDOMAttributes:l},i,a,s)??t.render.call({blockContentDOMAttributes:l,renderType:"dom",props:void 0},i,a)}},extensions:o}}function D(e,t,o){return(n={})=>{let r=typeof e=="function"?e(n):e,i=typeof t=="function"?t(n):t,a=o?typeof o=="function"?o(n):o:void 0;return{config:r,implementation:{...i,toExternalHTML(s,l,d){let c=i.toExternalHTML?.call({blockContentDOMAttributes:this.blockContentDOMAttributes},s,l,d);if(c!==void 0)return rt(c,s.type,s.props,r.propSchema,i.meta?.fileBlockAccept!==void 0)},render(s,l){return rt(i.render.call({blockContentDOMAttributes:this.blockContentDOMAttributes,renderType:this.renderType,props:this.props},s,l),s.type,s.props,r.propSchema,i.meta?.fileBlockAccept!==void 0,this.blockContentDOMAttributes)}},extensions:a}}}function K(e,t){let o=e.resolve(t);if(o.nodeAfter&&o.nodeAfter.type.isInGroup("bnBlock"))return{posBeforeNode:o.pos,node:o.nodeAfter};let n=o.depth,r=o.node(n);for(;n>0;){if(r.type.isInGroup("bnBlock"))return{posBeforeNode:o.before(n),node:r};n--,r=o.node(n)}let i=[];e.descendants((s,l)=>{s.type.isInGroup("bnBlock")&&i.push(l)}),console.warn(`Position ${t} is not within a blockContainer node.`);let a=e.resolve(i.find(s=>s>=t)||i[i.length-1]);return{posBeforeNode:a.pos,node:a.nodeAfter}}function vt(e,t){if(!e.type.isInGroup("bnBlock"))throw Error(`Attempted to get bnBlock node at position but found node of different type ${e.type.name}`);let o=e,n=t,r={node:o,beforePos:n,afterPos:n+o.nodeSize};if(o.type.name==="blockContainer"){let i,a;if(o.forEach((s,l)=>{if(s.type.spec.group==="blockContent"){let d=s,c=n+l+1;i={node:d,beforePos:c,afterPos:c+s.nodeSize}}else if(s.type.name==="blockGroup"){let d=s,c=n+l+1;a={node:d,beforePos:c,afterPos:c+s.nodeSize}}}),!i)throw Error(`blockContainer node does not contain a blockContent node in its children: ${o}`);return{isBlockContainer:!0,bnBlock:r,blockContent:i,childContainer:a,blockNoteType:i.node.type.name}}else{if(!r.node.type.isInGroup("childContainer"))throw Error(`bnBlock node is not in the childContainer group: ${r.node}`);return{isBlockContainer:!1,bnBlock:r,childContainer:r,blockNoteType:r.node.type.name}}}function W(e){return vt(e.node,e.posBeforeNode)}function Y(e){if(!e.nodeAfter)throw Error(`Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`);return vt(e.nodeAfter,e.pos)}function E(e){return W(K(e.doc,e.selection.anchor))}function Se(e){return W(K(e.doc,e.selection.anchor))}function T(e){return"doc"in e?e.doc.type.schema:e.type.schema}function Po(e){return e.cached.blockNoteEditor}function Ee(e){return Po(e).schema}function Ct(e){return Ee(e).blockSchema}function wt(e){return Ee(e).inlineContentSchema}function pe(e){return Ee(e).styleSchema}function xt(e){return Po(e).blockCache}function $o(e,t,o){let n={type:"tableContent",columnWidths:[],headerRows:void 0,headerCols:void 0,rows:[]},r=[];e.content.forEach((i,a,s)=>{let l={cells:[]};s===0&&i.content.forEach(d=>{let c=d.attrs.colwidth;c??=Array(d.attrs.colspan??1).fill(void 0),n.columnWidths.push(...c)}),l.cells=i.content.content.map((d,c)=>(r[s]||(r[s]=[]),r[s][c]=d.type.name==="tableHeader",{type:"tableCell",content:d.content.content.map(u=>Re(u,t,o)).reduce((u,p)=>{if(!u.length)return p;let f=u[u.length-1],m=p[0];return m&&ne(f)&&ne(m)&&JSON.stringify(f.styles)===JSON.stringify(m.styles)?(f.text+=`
3
3
  `+m.text,u.push(...p.slice(1)),u):(u.push(...p),u)},[]),props:{colspan:d.attrs.colspan,rowspan:d.attrs.rowspan,backgroundColor:d.attrs.backgroundColor,textColor:d.attrs.textColor,textAlignment:d.attrs.textAlignment}})),n.rows.push(l)});for(let i=0;i<r.length;i++)r[i]?.every(a=>a)&&(n.headerRows=(n.headerRows??0)+1);for(let i=0;i<r[0]?.length;i++)r?.every(a=>a[i])&&(n.headerCols=(n.headerCols??0)+1);return n}function Re(e,t,o){let n=[],r;return e.content.forEach(i=>{if(i.type.name==="hardBreak"){if(r)if(ne(r))r.text+=`
4
4
  `;else if(jt(r))r.content[r.content.length-1].text+=`