ocean-brain 0.8.2 → 0.10.0

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 (232) hide show
  1. package/README.md +2 -0
  2. package/dist/mcp.js +47 -75
  3. package/package.json +3 -2
  4. package/server/client/dist/assets/{ArrowRight.es-g2YZTklZ.js → ArrowRight.es-Bm-ZXpEC.js} +1 -1
  5. package/server/client/dist/assets/Calendar-BsNs3NzO.js +25 -0
  6. package/server/client/dist/assets/{Callout-B_IPSF_5.js → Callout-CviyPHKO.js} +1 -1
  7. package/server/client/dist/assets/{Copy.es-CNxe4ujr.js → Copy.es-BPreRnP9.js} +1 -1
  8. package/server/client/dist/assets/{Graph-D9GeO71k.js → Graph-vXQQ0a-Q.js} +1 -1
  9. package/server/client/dist/assets/Graph-yPE3ljW0.js +46 -0
  10. package/server/client/dist/assets/{Image.es-DnON8cv2.js → Image.es-DnR3qc_c.js} +1 -1
  11. package/server/client/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  12. package/server/client/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  13. package/server/client/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  14. package/server/client/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  15. package/server/client/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  16. package/server/client/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  17. package/server/client/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  18. package/server/client/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  19. package/server/client/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  20. package/server/client/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  21. package/server/client/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  22. package/server/client/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  23. package/server/client/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  24. package/server/client/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  25. package/server/client/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  26. package/server/client/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  27. package/server/client/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  28. package/server/client/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  29. package/server/client/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  30. package/server/client/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  31. package/server/client/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  32. package/server/client/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  33. package/server/client/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  34. package/server/client/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  35. package/server/client/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  36. package/server/client/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  37. package/server/client/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  38. package/server/client/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  39. package/server/client/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  40. package/server/client/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  41. package/server/client/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  42. package/server/client/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  43. package/server/client/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  44. package/server/client/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  45. package/server/client/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  46. package/server/client/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  47. package/server/client/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  48. package/server/client/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  49. package/server/client/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  50. package/server/client/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  51. package/server/client/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  52. package/server/client/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  53. package/server/client/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  54. package/server/client/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  55. package/server/client/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  56. package/server/client/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  57. package/server/client/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  58. package/server/client/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  59. package/server/client/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  60. package/server/client/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  61. package/server/client/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  62. package/server/client/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  63. package/server/client/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  64. package/server/client/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  65. package/server/client/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  66. package/server/client/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  67. package/server/client/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  68. package/server/client/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  69. package/server/client/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  70. package/server/client/dist/assets/Note-CmreVzvQ.js +25 -0
  71. package/server/client/dist/assets/{NotePropertiesPanel-2DgXEM4B.js → NotePropertiesPanel-DXYgE8h2.js} +2 -2
  72. package/server/client/dist/assets/PencilLine.es-B9V6u64t.js +1 -0
  73. package/server/client/dist/assets/{Plus.es-CQ8wn2is.js → Plus.es-CRRp2u5J.js} +1 -1
  74. package/server/client/dist/assets/Reminders-BOtfNeYD.js +1 -0
  75. package/server/client/dist/assets/Search-C-FB3pKf.js +1 -0
  76. package/server/client/dist/assets/SurfaceCard-GMt5xM7v.js +1 -0
  77. package/server/client/dist/assets/Tag-lBxDRE77.js +1 -0
  78. package/server/client/dist/assets/TagNotes-Bgorp_rC.js +1 -0
  79. package/server/client/dist/assets/{Trash.es-0aPpA-3S.js → Trash.es-svHOb5LN.js} +1 -1
  80. package/server/client/dist/assets/ViewNotes-C7d10VFf.js +1 -0
  81. package/server/client/dist/assets/ViewSectionDialog-Bhw-ILop.js +102 -0
  82. package/server/client/dist/assets/Views-C7V3saUo.js +1 -0
  83. package/server/client/dist/assets/abnfDiagram-VRR7QNED-CWlV5dXw.js +1 -0
  84. package/server/client/dist/assets/app-DQBV36r_.js +50 -0
  85. package/server/client/dist/assets/app-ZgwR5t_I.css +1 -0
  86. package/server/client/dist/assets/arc-BV-n6RUX.js +1 -0
  87. package/server/client/dist/assets/architectureDiagram-ZJ3FMSHR-CekzMXdu.js +36 -0
  88. package/server/client/dist/assets/blockDiagram-677ZJIJ3-B49yHoxq.js +132 -0
  89. package/server/client/dist/assets/c4Diagram-LMCZKHZV-0AfB9NBC.js +10 -0
  90. package/server/client/dist/assets/channel-CigOulR-.js +1 -0
  91. package/server/client/dist/assets/chunk-2Q5K7J3B-DaPQAU1q.js +1 -0
  92. package/server/client/dist/assets/chunk-32BRIVSS-CfL3kZAg.js +1 -0
  93. package/server/client/dist/assets/chunk-5VM5RSS4-DeOwWPE_.js +15 -0
  94. package/server/client/dist/assets/chunk-EX3LRPZG-C3W1oc9y.js +231 -0
  95. package/server/client/dist/assets/chunk-JWPE2WC7-_Oqh79OY.js +1 -0
  96. package/server/client/dist/assets/chunk-MOJQB5TN-DDKNNzI6.js +88 -0
  97. package/server/client/dist/assets/chunk-RYQCIY6F-DCHah7CC.js +1 -0
  98. package/server/client/dist/assets/chunk-V7JOEXUC-uUOIzgxj.js +206 -0
  99. package/server/client/dist/assets/chunk-VR4S4FIN-DDVw2WPs.js +1 -0
  100. package/server/client/dist/assets/chunk-XXDRQBXY-Coo4UFm2.js +1 -0
  101. package/server/client/dist/assets/classDiagram-OUVF2IWQ-D13ISIOW.js +1 -0
  102. package/server/client/dist/assets/classDiagram-v2-EOCWNBFH-D13ISIOW.js +1 -0
  103. package/server/client/dist/assets/colors-Cc3OSVma.js +1 -0
  104. package/server/client/dist/assets/cose-bilkent-JH36ORCC-C3pHmHpD.js +1 -0
  105. package/server/client/dist/assets/cynefin-VYW2F7L2-DU_G4Atc.js +166 -0
  106. package/server/client/dist/assets/cynefinDiagram-TSTJHNR4-DZ6iiJFo.js +62 -0
  107. package/server/client/dist/assets/cytoscape.esm-D3_iZ_3b.js +321 -0
  108. package/server/client/dist/assets/dagre-VKFMJZFB-DNELbhwC.js +4 -0
  109. package/server/client/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
  110. package/server/client/dist/assets/diagram-FQU43EPY-CMEvZJ61.js +3 -0
  111. package/server/client/dist/assets/diagram-G47NLZAW-BYDtf6j9.js +24 -0
  112. package/server/client/dist/assets/diagram-NH7WQ7WH-CmXfcCQA.js +24 -0
  113. package/server/client/dist/assets/diagram-OA4YK3LP-BflTKJxU.js +30 -0
  114. package/server/client/dist/assets/diagram-WEI45ONY-KW3fKqna.js +41 -0
  115. package/server/client/dist/assets/ebnfDiagram-CCIWWBDH-CbyhY5Nj.js +1 -0
  116. package/server/client/dist/assets/erDiagram-Q63AITRT-CC2eZV8g.js +85 -0
  117. package/server/client/dist/assets/{floating-ui.react-dom-wWLZ1CdM.js → floating-ui.react-dom-BWTnA00G.js} +1 -1
  118. package/server/client/dist/assets/flowDiagram-23GEKE2U-unplo7Qm.js +156 -0
  119. package/server/client/dist/assets/ganttDiagram-NO4QXBWP-BcBK5HcZ.js +292 -0
  120. package/server/client/dist/assets/gitGraphDiagram-IHSO6WYX-DgVbbb5k.js +106 -0
  121. package/server/client/dist/assets/graph-C5DFNLrC.js +1 -0
  122. package/server/client/dist/assets/image-delete-confirmation-D7xrODQV.js +1 -0
  123. package/server/client/dist/assets/image.api-QmHYjp3z.js +17 -0
  124. package/server/client/dist/assets/index-CaF9d-zG.js +1 -0
  125. package/server/client/dist/assets/infoDiagram-FWYZ7A6U-N_D9RdfG.js +2 -0
  126. package/server/client/dist/assets/init-Gi6I4Gst.js +1 -0
  127. package/server/client/dist/assets/isObject-U9U2HXiq.js +1 -0
  128. package/server/client/dist/assets/ishikawaDiagram-FXEZZL3T-BBKrzmB2.js +70 -0
  129. package/server/client/dist/assets/journeyDiagram-5HDEW3XC-NdCxLmQB.js +139 -0
  130. package/server/client/dist/assets/kanban-definition-HUTT4EX6-Ck7t4-tt.js +89 -0
  131. package/server/client/dist/assets/katex-DywYRkvg.css +1 -0
  132. package/server/client/dist/assets/katex-HP8lGamR.js +257 -0
  133. package/server/client/dist/assets/katex-x288kqHd.js +257 -0
  134. package/server/client/dist/assets/layout-Cz0MDlGi.js +1 -0
  135. package/server/client/dist/assets/linear-D6yRgDLq.js +1 -0
  136. package/server/client/dist/assets/manage-image-DCDF8AM9.js +1 -0
  137. package/server/client/dist/assets/manage-image-detail-e0ViRAj-.js +1 -0
  138. package/server/client/dist/assets/map-Mm1V-_Na.js +1 -0
  139. package/server/client/dist/assets/mcp-admin-adapter-D39G3udJ.js +1 -0
  140. package/server/client/dist/assets/{mcp-CT_9IV2c.js → mcp-uFZkdhCi.js} +4 -4
  141. package/server/client/dist/assets/mermaid.core-B14ZAmWA.js +308 -0
  142. package/server/client/dist/assets/min-tv6RD-6E.js +1 -0
  143. package/server/client/dist/assets/mindmap-definition-LN4V7U3C-BTUqSdcP.js +96 -0
  144. package/server/client/dist/assets/{note-core-Buwzyxi7.js → note-core-DUTqUh5N.js} +2 -2
  145. package/server/client/dist/assets/{note-runtime-CPDVOFEo.js → note-runtime-zN5ddTba.js} +1 -1
  146. package/server/client/dist/assets/{note-ui-CHI-tzj-.js → note-ui-CxK8ymUc.js} +1 -1
  147. package/server/client/dist/assets/{note.api-D_00ZzJC.js → note.api-BQovzEzd.js} +6 -6
  148. package/server/client/dist/assets/ordinal-Cboi1Yqb.js +1 -0
  149. package/server/client/dist/assets/pegDiagram-2B236MQR-Cjcu3mVz.js +1 -0
  150. package/server/client/dist/assets/pieDiagram-ENE6RG2P-BxI_c22Z.js +39 -0
  151. package/server/client/dist/assets/{placeholder-DbdGiYGL.js → placeholder-D3b8lZGE.js} +4 -4
  152. package/server/client/dist/assets/properties-M-yWq1D7.js +1 -0
  153. package/server/client/dist/assets/quadrantDiagram-ABIIQ3AL-DGm0a-yR.js +7 -0
  154. package/server/client/dist/assets/railroadDiagram-RFXS5EU6-DmCDu89O.js +1 -0
  155. package/server/client/dist/assets/requirementDiagram-TGXJPOKE-CBpUt7Ig.js +84 -0
  156. package/server/client/dist/assets/route-preload.js +2 -2
  157. package/server/client/dist/assets/sankeyDiagram-HTMAVEWB-BjGnDZlp.js +40 -0
  158. package/server/client/dist/assets/search-DFnzZKLd.js +1 -0
  159. package/server/client/dist/assets/sequenceDiagram-DBY2YBRQ-B7rpCfS6.js +162 -0
  160. package/server/client/dist/assets/sizeCapture-X5ZJPWSS-CUJhD0uW.js +1 -0
  161. package/server/client/dist/assets/stateDiagram-2N3HPSRC-Y9-3XqRX.js +1 -0
  162. package/server/client/dist/assets/stateDiagram-v2-6OUMAXLB-DbHXhT02.js +1 -0
  163. package/server/client/dist/assets/swimlanes-5IMT3BWC-Cs1NO9ng.js +2 -0
  164. package/server/client/dist/assets/swimlanesDiagram-G3AALYLV-DQnrq2ZC.js +8 -0
  165. package/server/client/dist/assets/{tag.api-CX0SE06J.js → tag.api-DUfjr8bg.js} +3 -3
  166. package/server/client/dist/assets/time-CfAYZipR.js +9 -0
  167. package/server/client/dist/assets/timeline-definition-FHXFAJF6-8fqD4WNL.js +120 -0
  168. package/server/client/dist/assets/toNumber-DE3J3kMD.js +1 -0
  169. package/server/client/dist/assets/transform-BUB79_za.js +1 -0
  170. package/server/client/dist/assets/trash-CClKfP1x.js +1 -0
  171. package/server/client/dist/assets/url-9nrbQs7Z.js +1 -0
  172. package/server/client/dist/assets/{useReminderMutate-CLK1tHvT.js → useReminderMutate--omDLmBV.js} +4 -4
  173. package/server/client/dist/assets/vennDiagram-L72KCM5P-BPqKkd5a.js +34 -0
  174. package/server/client/dist/assets/wardleyDiagram-EHGQE667-Cq11kU2M.js +78 -0
  175. package/server/client/dist/assets/xychartDiagram-FW5EYKEG-DJ6UzFj-.js +7 -0
  176. package/server/client/dist/index.html +7 -7
  177. package/server/dist/features/image/services/delete.js +25 -1
  178. package/server/dist/features/note/graphql/note.mutation.resolver.js +38 -12
  179. package/server/dist/features/note/graphql/note.type-defs.js +1 -1
  180. package/server/dist/features/note/http/mcp.js +1 -60
  181. package/server/dist/features/note/services/authoring.js +2 -70
  182. package/server/dist/features/note/services/markdown-patch.js +80 -8
  183. package/server/dist/features/note/services/properties.js +21 -1
  184. package/server/dist/features/note/services/property-restore.js +26 -0
  185. package/server/dist/features/note/services/snapshot.js +79 -59
  186. package/server/dist/features/note/services/trash.js +16 -31
  187. package/server/dist/features/search/embedding-api-key-store.js +57 -0
  188. package/server/dist/features/search/embedding-client.js +179 -0
  189. package/server/dist/features/search/graphql/index.js +6 -0
  190. package/server/dist/features/search/graphql/resolver.js +20 -0
  191. package/server/dist/features/search/graphql/type-defs.js +30 -0
  192. package/server/dist/features/search/http/handlers.js +108 -0
  193. package/server/dist/features/search/hybrid-ranking.js +55 -0
  194. package/server/dist/features/search/hybrid-search.js +174 -0
  195. package/server/dist/features/search/note-change.js +16 -0
  196. package/server/dist/features/search/note-chunking.js +75 -0
  197. package/server/dist/features/search/search-config.js +150 -0
  198. package/server/dist/features/search/search-manager.js +431 -0
  199. package/server/dist/features/search/semantic-indexer.js +138 -0
  200. package/server/dist/features/search/sqlite-vector-index.js +636 -0
  201. package/server/dist/features/search/url-normalization.js +10 -0
  202. package/server/dist/features/tag/services/organization.js +3 -0
  203. package/server/dist/features/view/services/workspace.js +1 -1
  204. package/server/dist/main.js +2 -0
  205. package/server/dist/modules/blocknote.js +4 -5
  206. package/server/dist/paths.js +7 -2
  207. package/server/dist/routes/api.js +37 -0
  208. package/server/dist/routes/mcp.js +0 -5
  209. package/server/dist/schema/index.js +3 -0
  210. package/server/client/dist/assets/Calendar-BP6HTuSn.js +0 -25
  211. package/server/client/dist/assets/Graph-Xha3fwhp.js +0 -46
  212. package/server/client/dist/assets/Image-BLEjLUqd.js +0 -1
  213. package/server/client/dist/assets/Note-DjrCYtat.js +0 -24
  214. package/server/client/dist/assets/Reminders-B4l3KdlK.js +0 -1
  215. package/server/client/dist/assets/Search-BN5sf7bE.js +0 -1
  216. package/server/client/dist/assets/SurfaceCard-BZm73nyS.js +0 -1
  217. package/server/client/dist/assets/Tag-oSnmViVp.js +0 -1
  218. package/server/client/dist/assets/TagNotes-BDTCcJcL.js +0 -1
  219. package/server/client/dist/assets/ViewNotes-CiZtGJNE.js +0 -1
  220. package/server/client/dist/assets/ViewSectionDialog-Ctl_694Y.js +0 -102
  221. package/server/client/dist/assets/Views-D-zlatYD.js +0 -1
  222. package/server/client/dist/assets/app-DmqIOMWF.css +0 -1
  223. package/server/client/dist/assets/app-cTRcKMGc.js +0 -26
  224. package/server/client/dist/assets/image.api-CVuuvTBk.js +0 -17
  225. package/server/client/dist/assets/index-DKJChPr4.js +0 -1
  226. package/server/client/dist/assets/manage-image-BZjaxp-f.js +0 -1
  227. package/server/client/dist/assets/manage-image-detail-DPv0FQ2m.js +0 -1
  228. package/server/client/dist/assets/mcp-admin-adapter-xAuyZc_M.js +0 -1
  229. package/server/client/dist/assets/properties-D447wsWk.js +0 -1
  230. package/server/client/dist/assets/time-B3pt8vt4.js +0 -9
  231. package/server/client/dist/assets/trash-8sH7EZgc.js +0 -1
  232. package/server/client/dist/assets/url-BSnWpmJx.js +0 -1
@@ -0,0 +1,50 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Calendar-BsNs3NzO.js","assets/floating-ui.react-dom-BWTnA00G.js","assets/note.api-BQovzEzd.js","assets/url-9nrbQs7Z.js","assets/time-CfAYZipR.js","assets/Callout-CviyPHKO.js","assets/preload-helper-BXl3LOEh.js","assets/Graph-vXQQ0a-Q.js","assets/Views-C7V3saUo.js","assets/tag.api-DUfjr8bg.js","assets/ViewSectionDialog-Bhw-ILop.js","assets/SurfaceCard-GMt5xM7v.js","assets/ArrowRight.es-Bm-ZXpEC.js","assets/Plus.es-CRRp2u5J.js","assets/Reminders-BOtfNeYD.js","assets/useReminderMutate--omDLmBV.js","assets/Graph-yPE3ljW0.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/Search-C-FB3pKf.js","assets/Tag-lBxDRE77.js","assets/Note-CmreVzvQ.js","assets/NotePropertiesPanel-DXYgE8h2.js","assets/note-ui-CxK8ymUc.js","assets/note-core-DUTqUh5N.js","assets/note-runtime-zN5ddTba.js","assets/note-ui-DL8owV-U.css","assets/image.api-QmHYjp3z.js","assets/Copy.es-BPreRnP9.js","assets/PencilLine.es-B9V6u64t.js","assets/TagNotes-Bgorp_rC.js","assets/ViewNotes-C7d10VFf.js","assets/index-CaF9d-zG.js","assets/mcp-admin-adapter-D39G3udJ.js","assets/Image.es-DnR3qc_c.js","assets/Trash.es-svHOb5LN.js","assets/mcp-uFZkdhCi.js","assets/search-DFnzZKLd.js","assets/trash-CClKfP1x.js","assets/manage-image-DCDF8AM9.js","assets/image-delete-confirmation-D7xrODQV.js","assets/manage-image-detail-e0ViRAj-.js","assets/properties-M-yWq1D7.js","assets/placeholder-D3b8lZGE.js"])))=>i.map(i=>d[i]);
2
+ import{j as p,r as u,b as K,a as ht}from"./floating-ui.react-dom-BWTnA00G.js";import{v as Ps,x as _s,y as Ls,z as As,A as Is,l as Ts,u as Ns,a as er,b as Ds,e as tr,o as js,s as Vs,n as Os,j as ks,d as lo,t as Hs,m as Fs,f as Bs,R as Zs}from"./time-CfAYZipR.js";import{ao as $e,ap as bt,aq as te,ar as W,as as yt,at as Ge,au as nr,av as $s,aw as zs,ax as Us,ay as Ks,az as qs,aA as Gs,aB as Ws,aC as ze,aD as uo,aE as Xs,aF as gn,aG as Ys,aH as ho,aI as se,aJ as fo,aK as lt,aL as Qs,aM as Js,aN as Ct,aO as ea,aP as V,aQ as po,aR as ta,aS as na,aT as oa,aU as ra,af as Se,ab as or,aV as sa,aW as mo,aX as pe,aY as vn,aZ as Dt,a_ as On,a$ as aa,b0 as ia,z as Ye,e as ae,u as kn,b1 as ca,b2 as la,b3 as ua,b4 as da,T as X,w as bn,b5 as rr,x as ut,b6 as sr,b7 as ha,L as fa,F as pa,H as ie,g as en,A as ar,q as We,d as ma,h as ir,Q as cr,an as ga,k as Ue,C as xt,b8 as va,U as lr,aj as ba,G as ya,f as xa,P as wa,j as Sa,E as Ra,b9 as Ea,ba as Ca,bb as Ma,bc as F,V as Mn,bd as go,be as Pa}from"./note.api-BQovzEzd.js";import{_ as Z}from"./preload-helper-BXl3LOEh.js";import{N as tn,g as ur,H as nn,c as dr,G as hr,C as fr,R as pr,b as mr,j as gr,T as vr,V as _a,h as La,i as Aa,S as Ia,e as Ta,d as Na,f as Da,a as ja}from"./url-9nrbQs7Z.js";import{f as Va,G as Oa}from"./Graph-vXQQ0a-Q.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 Hn={DARK:"(prefers-color-scheme: dark)",LIGHT:"(prefers-color-scheme: light)",RETINA:"(min-resolution: 2dppx)",RESPONSIVE:e=>`screen and (max-width: ${e})`},br=e=>typeof window<"u"&&window.matchMedia?window.matchMedia(e):null,Fn=(e,t,n=!0)=>{const o=br(e);n&&t(o?.matches||!1);const r=s=>{t?.(s.matches)};return o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},ka=(e,t=!0)=>Fn(Hn.DARK,e,t),Ha=(e,t,n=!0)=>Fn(Hn.RESPONSIVE(e),t,n),Fa={MEDIA_QUERY:Hn,listenThemeChange:ka,listenResponsiveChange:Ha,createMediaQuery:br,listenMediaQueryChange:Fn};var D=(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))(D||{});function yr({update:e,notify:t,unwatched:n}){return{link:o,unlink:r,propagate:s,checkDirty:a,shallowPropagate:i};function o(c,d,h){const f=d.depsTail;if(f!==void 0&&f.dep===c)return;const m=f!==void 0?f.nextDep:d.deps;if(m!==void 0&&m.dep===c){m.version=h,d.depsTail=m;return}const g=c.subsTail;if(g!==void 0&&g.version===h&&g.sub===d)return;const v=d.depsTail=c.subsTail={version:h,dep:c,sub:d,prevDep:f,nextDep:m,prevSub:g,nextSub:void 0};m!==void 0&&(m.prevDep=v),f!==void 0?f.nextDep=v:d.deps=v,g!==void 0?g.nextSub=v:c.subs=v}function r(c,d=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:d.depsTail=f,f!==void 0?f.nextDep=m:d.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 d=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:d,prev:h},d=v);continue}}if((c=d)!==void 0){d=c.nextSub;continue}for(;h!==void 0;)if(c=h.value,h=h.prev,c!==void 0){d=c.nextSub;continue e}break}while(!0)}function a(c,d){let h,f=0,m=!1;e:do{const g=c.dep,v=g.flags;if(d.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,d=g,++f;continue}if(!m){const b=c.nextDep;if(b!==void 0){c=b;continue}}for(;f--;){const b=d.subs,y=b.nextSub!==void 0;if(y?(c=h.value,h=h.prev):c=b,m){if(e(d)){y&&i(b),d=c.sub;continue}m=!1}else d.flags&=-33;d=c.sub;const x=c.nextDep;if(x!==void 0){c=x;continue e}}return m}while(!0)}function i(c){do{const d=c.sub,h=d.flags;(h&48)===32&&(d.flags=h|16,(h&6)===2&&t(d))}while((c=c.nextSub)!==void 0)}function l(c,d){let h=d.depsTail;for(;h!==void 0;){if(h===c)return!0;h=h.prevDep}return!1}}let Bn=0,De=0,ft=0;const we=[],{link:Kd,unlink:xr,propagate:qd,checkDirty:Ba,shallowPropagate:Gd}=yr({update(e){return e.depsTail!==void 0?Ua(e):Ka(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,on(e)):Wa.call(e)}});function Za(){return Bn}function $a(){++Bn}function za(){--Bn||Ga()}function Ua(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,on(e)}}function Ka(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function qa(e){const t=e.flags;if(t&16||t&32&&Ba(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,on(e)}}else e.flags=2}function Ga(){try{for(;De<ft;){const e=we[De];we[De++]=void 0,qa(e)}}finally{for(;De<ft;){const e=we[De];we[De++]=void 0,e.flags|=10}De=0,ft=0}}function Wa(){this.depsTail=void 0,this.flags=0,on(this);const e=this.subs;e!==void 0&&xr(e)}function on(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=xr(n,e)}function Zn(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 Pn=[];let Bt=0;const{link:vo,unlink:Xa,propagate:Ya,checkDirty:wr,shallowPropagate:bo}=yr({update(e){return e._update()},notify(e){Pn[_n++]=e,e.flags&=~D.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=D.Mutable|D.Dirty,zt(e))}});let jt=0,_n=0,fe;function zt(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=Xa(n,e)}function Sr(){if(!(Za()>0)){for(;jt<_n;){const e=Pn[jt];Pn[jt++]=void 0,e.notify()}jt=0,_n=0}}function Rr(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?D.None:D.Mutable,get(){return fe!==void 0&&vo(r,fe,Bt),r._snapshot},subscribe(s){const a=Zn(s),i={current:!1},l=Qa(()=>{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,++Bt,r.depsTail=void 0;else if(s===void 0)return!1;n&&(r.flags=D.Mutable|D.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&=~D.RecursedCheck),zt(r)}}};return n?(r.flags=D.Mutable|D.Dirty,r.get=function(){const s=r.flags;if(s&D.Dirty||s&D.Pending&&wr(r.deps,r)){if(r._update()){const a=r.subs;a!==void 0&&bo(a)}}else s&D.Pending&&(r.flags=s&~D.Pending);return fe!==void 0&&vo(r,fe,Bt),r._snapshot}):r.set=function(s){if(r._update(s)){const a=r.subs;a!==void 0&&(Ya(a),bo(a),Sr())}},r}function Qa(e){const t=()=>{const o=fe;fe=n,++Bt,n.depsTail=void 0,n.flags=D.Watching|D.RecursedCheck;try{return e()}finally{fe=o,n.flags&=~D.RecursedCheck,zt(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:D.Watching|D.RecursedCheck,notify(){const o=this.flags;o&D.Dirty||o&D.Pending&&wr(this.deps,this)?t():this.flags=D.Watching},stop(){this.flags=D.None,this.depsTail=void 0,zt(this)}};return t(),n}class Ja{constructor(t){this.atom=Rr(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Zn(t))}}class ei{constructor(t){this.atom=Rr(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Zn(t))}}function ti(e){return typeof e=="function"?new ei(e):new Ja(e)}function ni(e){try{$a(),e()}finally{za(),Sr()}}const Ie="__TSR_index",yo="popstate",xo="beforeunload";function oi(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 d=e.getBlockers?.()??[],h=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&d.length&&h)for(const f of d){const m=Ut(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[Ie];i=wo(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[Ie];i=wo(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[Ie]!==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 wo(e,t){t||(t={});const n=$n();return{...t,key:n,__TSR_key:n,[Ie]:e}}function ri(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,o=t.history.replaceState;let r=[];const s=()=>r,a=w=>r=w,i=(w=>w),l=(()=>Ut(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const w=$n();t.history.replaceState({[Ie]:0,key:w,__TSR_key:w},"")}let c=l(),d,h=!1,f=!1,m=!1,g=!1;const v=()=>c;let b,y;const x=()=>{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,d=void 0)},S=(w,C,I)=>{const P=i(C);y||(d=c),c=Ut(C,I),b={href:P,state:I,isPush:b?.isPush||w==="push"},y||(y=Promise.resolve().then(()=>x()))},R=w=>{c=l(),E.notify({type:w})},M=async()=>{if(f){f=!1;return}const w=l(),C=w.state[Ie]-c.state[Ie],I=C===1,P=C===-1,L=!I&&!P||h;h=!1;const U=L?"GO":P?"BACK":"FORWARD",N=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 q of le)if(await q.blockerFn({currentLocation:c,nextLocation:w,action:U})){f=!0,t.history.go(1),E.notify(N);return}}}c=l(),E.notify(N)},_=w=>{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 w.preventDefault(),w.returnValue=""},E=oi({getLocation:v,getLength:()=>t.history.length,pushState:(w,C)=>S("push",w,C),replaceState:(w,C)=>S("replace",w,C),back:w=>(w&&(m=!0),g=!0,t.history.back()),forward:w=>{w&&(m=!0),g=!0,t.history.forward()},go:w=>{h=!0,t.history.go(w)},createHref:w=>i(w),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=o,t.removeEventListener(xo,_,{capture:!0}),t.removeEventListener(yo,M)},onBlocked:()=>{d&&c!==d&&(c=d)},getBlockers:s,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(xo,_,{capture:!0}),t.addEventListener(yo,M),t.history.pushState=function(...w){const C=n.apply(t.history,w);return E._ignoreSubscribers||R("PUSH"),C},t.history.replaceState=function(...w){const C=o.apply(t.history,w);return E._ignoreSubscribers||R("REPLACE"),C},E}function si(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Ut(e,t){const n=si(e),o=n.indexOf("#"),r=n.indexOf("?"),s=$n();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||{[Ie]:0,key:s,__TSR_key:s}}}function $n(){return(Math.random()+1).toString(36).substring(7)}const ai=!1;function pt(e){let t;return ni(()=>{t=e()}),t}function ii(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Ln="tsr-scroll-restoration-v1_3",ci=(e,t)=>{let n;return(...o)=>{n||(n=setTimeout(()=>{e(...o),n=null},t))}};function li(){const e=ii();if(!e)return null;const t=e.getItem(Ln);let n=t?JSON.parse(t):{};return{state:n,set:o=>{n=$e(o,n)||n;try{e.setItem(Ln,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Vt=li(),ui=e=>e.state.__TSR_key||e.href;function di(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 Kt=!1;function hi({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];Kt=!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 d={top:0,left:0,behavior:n};if(window.scrollTo(d),r)for(const h of r){if(h==="window")continue;const f=typeof h=="function"?h():document.querySelector(h);f&&f.scrollTo(d)}}Kt=!1}function fi(e,t){if(!Vt||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Vt))return;e.isScrollRestorationSetup=!0,Kt=!1;const o=e.options.getScrollRestorationKey||ui;window.history.scrollRestoration="manual";const r=s=>{if(Kt||!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=di(s.target)}const i=o(e.state.location);Vt.set(l=>{const c=l[i]||={},d=c[a]||={};if(a==="window")d.scrollX=window.scrollX||0,d.scrollY=window.scrollY||0;else if(a){const h=document.querySelector(a);h&&(d.scrollX=h.scrollLeft||0,d.scrollY=h.scrollTop||0)}return l})};typeof document<"u"&&document.addEventListener("scroll",ci(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})||(hi({storageKey:Ln,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Vt.set(i=>(i[a]||={},i)))})}function pi(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 mi(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 yn(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function gi(e){const t=new URLSearchParams(e),n={};for(const[o,r]of t.entries()){const s=n[o];s==null?n[o]=yn(r):Array.isArray(s)?s.push(yn(r)):n[o]=[s,yn(r)]}return n}const vi=yi(JSON.parse),bi=xi(JSON.stringify,JSON.parse);function yi(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=gi(t);for(const o in n){const r=n[o];if(typeof r=="string")try{n[o]=e(r)}catch{}}return n}}function xi(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=mi(r,o);return s?`?${s}`:""}}const An=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},rn=(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},So=(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},Ae=(e,t,n)=>{if(!(!te(n)&&!W(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})),W(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},Er=(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,Ae(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(i){n=i,Ae(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)&&!W(n)&&(e.serialError??=n)},Cr=(e,t,n,o)=>{if(o._nonReactive.pendingTimeout!==void 0)return;const r=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!rn(e,t)&&(n.options.loader||n.options.beforeLoad||Pr(n))&&typeof r=="number"&&r!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const a=setTimeout(()=>{An(e)},r);o._nonReactive.pendingTimeout=a}},wi=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;Cr(e,t,n,o);const r=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&Ae(e,s,s.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(r):r()},Si=(e,t,n,o)=>{const r=e.router.getMatch(t),s=r._nonReactive.loadPromise;r._nonReactive.loadPromise=Ge(()=>{s?.resolve()});const{paramsError:a,searchError:i}=r;a&&dt(e,n,a,"PARSE_PARAMS"),i&&dt(e,n,i,"VALIDATE_SEARCH"),Cr(e,t,o,r);const l=new AbortController;let c=!1;const d=()=>{c||(c=!0,e.updateMatch(t,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:l})))},h=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,R=>({...R,isFetching:!1}))};if(!o.options.beforeLoad){pt(()=>{d(),h()});return}r._nonReactive.beforeLoadPromise=Ge();const f={...Ke(e,n,!1),...r.__routeContext},{search:m,params:g,cause:v}=r,b=rn(e,t),y={search:m,abortController:l,params:g,preload:b,context:f,location:e.location,navigate:R=>e.router.navigate({...R,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:b?"preload":v,matches:e.matches,routeId:o.id,...e.router.options.additionalContext},x=R=>{if(R===void 0){pt(()=>{d(),h()});return}(te(R)||W(R))&&(d(),dt(e,n,R,"BEFORE_LOAD")),pt(()=>{d(),e.updateMatch(t,M=>({...M,__beforeLoadContext:R})),h()})};let S;try{if(S=o.options.beforeLoad(y),bt(S))return d(),S.catch(R=>{dt(e,n,R,"BEFORE_LOAD")}).then(x)}catch(R){d(),dt(e,n,R,"BEFORE_LOAD")}x(S)},Ri=(e,t)=>{const{id:n,routeId:o}=e.matches[t],r=e.router.looseRoutesById[o],s=()=>i(),a=()=>Si(e,n,t,r),i=()=>{if(Er(e,n))return;const l=wi(e,n,r);return bt(l)?l.then(a):a()};return s()},Ei=(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,d=s?.scripts,h=s?.styles;return{meta:l,links:c,headScripts:d,headers:i,scripts:a,styles:h}})},Mr=(e,t,n,o,r)=>{const s=t[o-1],{params:a,loaderDeps:i,abortController:l,cause:c}=e.router.getMatch(n),d=Ke(e,o),h=rn(e,n);return{params:a,deps:i,preload:!!h,parentMatchPromise:s,abortController:l,context:d,location:e.location,navigate:f=>e.router.navigate({...f,_fromLocation:e.location}),cause:h?"preload":c,route:r,...e.router.options.additionalContext}},Ro=async(e,t,n,o,r)=>{try{const s=e.router.getMatch(n);try{(!(ai??e.router.isServer)||s.ssr===!0)&&qt(r);const a=r.options.loader?.(Mr(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,d=>({...d,isFetching:"loader"})),r.options.loader){const d=i?await a:a;Ae(e,e.router.getMatch(n),d),d!==void 0&&e.updateMatch(n,h=>({...h,loaderData:d}))}r._lazyPromise&&await r._lazyPromise;const c=s._nonReactive.minPendingPromise;c&&await c,r._componentsPromise&&await r._componentsPromise,e.updateMatch(n,d=>({...d,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,W(a)&&await r.options.notFoundComponent?.preload?.(),Ae(e,e.router.getMatch(n),a);try{r.options.onError?.(a)}catch(c){i=c,Ae(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),Ae(e,a,s)}},Ci=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,x=typeof y=="function"?y(Mr(e,t,r,n,g)):y,{status:S,invalid:R}=m;a=S==="success"&&(R||(x??v>b)),h&&g.options.preload===!1||(a&&!e.sync?(i=!0,(async()=>{try{await Ro(e,t,r,n,g);const M=e.router.getMatch(r);M._nonReactive.loaderPromise?.resolve(),M._nonReactive.loadPromise?.resolve(),M._nonReactive.loaderPromise=void 0}catch(M){te(M)&&await e.router.navigate(M.options)}})()):(S!=="success"||a&&e.sync)&&await Ro(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(!Er(e,r)){const h=e.router.getMatch(r),f=rn(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&&Ae(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=Ge(),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 d=i?c.isFetching:!1;return d!==c.isFetching||c.invalid!==!1?(e.updateMatch(r,h=>({...h,isFetching:d,invalid:!1})),e.router.getMatch(r)):c};async function Eo(e){const t=e,n=[];t.router.state.matches.some(f=>f._forcePending)&&An(t);let o;for(let f=0;f<t.matches.length;f++){try{const m=Ri(t,f);bt(m)&&await m}catch(m){if(te(m))throw m;if(W(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?So(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(Ci(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;W(g)?i??=g:l??=g}if(l!==void 0)throw l}const c=i??(o&&!t.preload?o:void 0);let d=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!c&&o&&t.preload)return t.matches;if(c){const f=So(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})),d=f,await qt(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 qt(f)}for(let f=0;f<=d;f++){const m=t.matches[f],{id:g,routeId:v}=m,b=t.router.looseRoutesById[v];try{const y=Ei(t,g,b);if(y){const x=await y;t.updateMatch(g,S=>({...S,...x}))}}catch(y){console.error(`Error executing head for route ${v}:`,y)}}const h=An(t);if(bt(h)&&await h,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function qt(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 _r){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 Pr(e){for(const t of _r)if(e.options[t]?.preload)return!0;return!1}const _r=["component","errorComponent","pendingComponent","notFoundComponent"];function Mi(e){return{input:({url:t})=>{for(const n of e)t=In(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Lr(e[n],t);return t}}}function Pi(e){const t=nr(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=$s(["/",t,a.pathname]),a)}}function In(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 Lr(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 je(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 _i(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class Li{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=zs(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=ri()),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=Us(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=ti(Ii(this.latestLocation)),fi(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=nr(l);m&&m!=="/"&&f.push(Pi({basepath:l})),c&&f.push(c),this.rewrite=f.length===0?void 0:f.length===1?f[0]:Mi(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=Ks(this.routeTree,this.options.caseSensitive,(o,r)=>{o.init({originalIndex:r})});return this.options.routeMasks&&qs(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:d,href:h,state:f})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const x=this.options.parseSearch(c),S=this.options.stringifySearch(x);return{href:l+S+d,publicHref:h,pathname:lt(l).path,external:!1,searchStr:S,search:se(o?.search,x),hash:lt(d.slice(1)).path,state:se(o?.state,f)}}const m=new URL(h,this.origin),g=In(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:lt(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:b,search:se(o?.search,v),hash:lt(g.hash.slice(1)).path,state:se(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)=>Gs({base:n,to:Ws(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=>Ti({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,"."),d=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,$e(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:lt(ho({path:f,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let x=d;if(n._includeValidateSearch&&this.options.search?.strict){const P={};v.forEach(L=>{if(L.options.validateSearch)try{Object.assign(P,Zt(L.options.validateSearch,{...P,...x}))}catch{}}),x=P}x=Ni({search:x,dest:s,destRoutes:v,_includeValidateSearch:n._includeValidateSearch}),x=se(d,x);const S=this.options.stringifySearch(x),R=s.hash===!0?a.hash:s.hash?$e(s.hash,a.hash):void 0,M=R?`#${R}`:"";let _=s.state===!0?a.state:s.state?$e(s.state,a.state):{};_=se(a.state,_);const E=`${y}${S}${M}`;let w,C,I=!1;if(this.rewrite){const P=new URL(E,this.origin),L=Lr(this.rewrite,P);w=P.href.replace(P.origin,""),L.origin!==this.origin?(C=L.href,I=!0):C=L.pathname+L.search+L.hash}else w=ea(E),C=w;return{publicHref:C,href:w,pathname:y,search:x,searchStr:S,state:_,hash:R??"",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 d=Qs(i.pathname,this.processedTree);if(d){Object.assign(c,d.rawParams);const{from:h,params:f,...m}=d.route,g=f===!1||f===null?{}:(f??!0)===!0?c:Object.assign(c,$e(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(d=>{r.state[d]=this.latestLocation.state[d]});const c=gn(r.state,this.latestLocation.state);return l.forEach(d=>{delete r.state[d]}),c},a=ze(this.latestLocation.href)===ze(r.href),i=this.commitLocationPromise;if(this.commitLocationPromise=Ge(()=>{i?.resolve()}),a&&s())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...d}=r;l&&(d={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...d,search:d.searchStr,state:{...d.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(d.unmaskOnReload??this.options.unmaskOnReload??!1)&&(d.state.__tempKey=this.tempLocationKey)),d.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[r.replace?"replace":"push"](d.publicHref,d.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=Ut(i,{__TSR_index:n?h:h+1}),m=new URL(f.pathname,this.origin),g=In(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 d=this.commitLocation({...c,viewTransition:s,replace:n,resetScroll:o,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),d},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(uo(l,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const h of d)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",...je({resolvedLocation:c,location:l})}),this.emit({type:"onBeforeLoad",...je({resolvedLocation:c,location:l})}),await Eo({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:l,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let d=[],h=[],f=[],m=[];pt(()=>{this.__store.setState(g=>{const v=g.matches,b=g.pendingMatches||g.matches;return d=v.filter(y=>!b.some(x=>x.id===y.id)),h=v.filter(y=>!b.some(x=>x.routeId===y.routeId)),f=b.filter(y=>!v.some(x=>x.routeId===y.routeId)),m=b.filter(y=>v.some(x=>x.routeId===y.routeId)),{...g,isLoading:!1,loadedAt:Date.now(),matches:b,pendingMatches:void 0,cachedMatches:[...g.cachedMatches,...d.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})):W(l)&&(r=l),this.__store.setState(c=>({...c,statusCode:o?o.status:r?404:c.matches.some(d=>d.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(je({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:_i(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&&uo(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=qt,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 Eo({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});W(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=Xs(s.pathname,o?.caseSensitive??!1,o?.fuzzy??!1,i.pathname,this.processedTree);return!l||n.params&&!gn(l.rawParams,n.params,{partial:!0})?!1:o?.includeSearch??!0?gn(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??bi,parseSearch:t.parseSearch??vi,protocolAllowlist:t.protocolAllowlist??Ys}),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["**"]:ze(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:l=!0);const c=l?ji(this.options.notFoundMode,i):void 0,d=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=d[f-1];let v,b,y;{const N=g?.search??t.search,le=g?._strictSearch??void 0;try{const q=Zt(m.options.validateSearch,{...N})??void 0;v={...N,...q},b={...le,...q},y=void 0}catch(q){let k=q;if(q instanceof Gt||(k=new Gt(q.message,{cause:q})),n?.throwOnError)throw k;v=N,b={},y=k}}const x=m.options.loaderDeps?.({search:v})??"",S=x?JSON.stringify(x):"",{interpolatedPath:R,usedParams:M}=ho({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),_=m.id+R+S,E=this.getMatch(_),w=h.get(m.id),C=E?._strictParams??M;let I;if(!E)try{Co(m,M,a,C)}catch(N){if(W(N)||te(N)?I=N:I=new Ai(N.message,{cause:N}),n?.throwOnError)throw I}Object.assign(s,C);const P=w?"stay":"enter";let L;if(E)L={...E,cause:P,params:w?.params??s,_strictParams:C,search:w?se(w.search,v):se(E.search,v),_strictSearch:b};else{const N=m.options.loader||m.options.beforeLoad||m.lazyFn||Pr(m)?"pending":"success";L={id:_,ssr:m.options.ssr,index:f,routeId:m.id,params:w?.params??s,_strictParams:C,pathname:R,updatedAt:Date.now(),search:w?se(w.search,v):v,_strictSearch:b,searchError:void 0,status:N,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:Ge()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:P,loaderDeps:w?se(w.loaderDeps,x):x,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 U=this.getParentContext(g);L.context={...U,...L.__routeContext,...L.__beforeLoadContext},d[f]=L}for(let f=0;f<d.length;f++){const m=d[f],g=this.looseRoutesById[m.routeId],v=this.getMatch(m.id),b=h.get(m.routeId);if(m.params=b?se(b.params,s):s,!v){const y=d[f-1],x=this.getParentContext(y);if(g.options.context){const S={deps:m.loaderDeps,params:m.params,context:x??{},location:t,navigate:R=>this.navigate({...R,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d,routeId:g.id};m.__routeContext=g.options.context(S)??void 0}m.context={...x,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:o,parsedParams:r}=this.getMatchedRoutes(t.pathname),s=fo(n),a={...t.search};for(const d of n)try{Object.assign(a,Zt(d.options.validateSearch,a))}catch{}const i=fo(this.state.matches),l=i&&i.routeId===s.id&&t.pathname===this.state.location.pathname;let c;if(l)c=i.params;else{const d={...o};for(const h of n)try{Co(h,o,r??{},d)}catch{}c=d}return{matchedRoutes:n,fullPath:s.fullPath,search:a,params:c}}}class Gt extends Error{}class Ai extends Error{}function Ii(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Zt(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Gt("Async validation not supported");if(n.issues)throw new Gt(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 Ti({pathname:e,routesById:t,processedTree:n}){const o={},r=ze(e);let s,a;const i=Js(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 Ni({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){return Di(n)(e,t,o??!1)}function Di(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((d,h)=>h(d),a));const c=i(l);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((d,h)=>h(d),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,...Zt(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:$e(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 ji(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 Co(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 zn(e){const t=e.errorComponent??Un;return p.jsx(Vi,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?u.createElement(t,{error:n,reset:o}):e.children})}class Vi extends u.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 Un({error:e}){const[t,n]=u.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 Mo(e){return typeof e=="object"?new Po(e,{silent:!0}).createRoute(e):new Po(e,{silent:!0}).createRoute}class Po{constructor(t,n){this.path=t,this.createRoute=o=>{const r=V(o);return r.isRoot=!1,r},this.silent=n?.silent}}class _o{constructor(t){this.useMatch=n=>po({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>po({from:this.options.id,select:o=>n?.select?n.select(o.context):o.context}),this.useSearch=n=>ta({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>na({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>oa({...n,from:this.options.id}),this.useLoaderData=n=>ra({...n,from:this.options.id}),this.useNavigate=()=>{const n=Se();return or({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Lo(e){return typeof e=="object"?new _o(e):t=>new _o({id:e,...t})}function $(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,sa(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(mo)mo(a());else throw a();return u.createElement(o,c)};return i.preload=a,i}function Oi(){const e=Se(),t=u.useRef({router:e,mounted:!1}),[n,o]=u.useState(!1),{hasPendingMatches:r,isLoading:s}=pe({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),a=vn(s),i=s||n||r,l=vn(i),c=s||r,d=vn(c);return e.startTransition=h=>{o(!0),u.startTransition(()=>{h(),o(!1)})},u.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 ze(e.latestLocation.publicHref)!==ze(f.publicHref)&&e.commitLocation({...f,replace:!0}),()=>{h()}},[e,e.history]),Dt(()=>{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]),Dt(()=>{a&&!s&&e.emit({type:"onLoad",...je(e.state)})},[a,e,s]),Dt(()=>{d&&!c&&e.emit({type:"onBeforeRouteMount",...je(e.state)})},[c,d,e]),Dt(()=>{if(l&&!i){const h=je(e.state);e.emit({type:"onResolved",...h}),e.__store.setState(f=>({...f,status:"idle",resolvedLocation:f.location})),h.hrefChanged&&pi(e)}},[i,l,e]),null}function ki(e){const t=pe({select:n=>`not-found-${n.location.pathname}-${n.status}`});return p.jsx(zn,{getResetKey:()=>t,onCatch:(n,o)=>{if(W(n))e.onCatch?.(n,o);else throw n},errorComponent:({error:n})=>{if(W(n))return e.fallback?.(n);throw n},children:e.children})}function Hi(){return p.jsx("p",{children:"Not Found"})}function Ze(e){return p.jsx(p.Fragment,{children:e.children})}function Ar(e,t,n){return t.options.notFoundComponent?p.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?p.jsx(e.options.defaultNotFoundComponent,{...n}):p.jsx(Hi,{})}function Fi(){return Se().isScrollRestoring,null}const Ir=u.memo(function({matchId:t}){const n=Se(),o=pe({select:v=>{const b=v.matches.findIndex(x=>x.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,d=o.ssr===!1||o.ssr==="data-only",h=(!r.isRoot||r.options.wrapInSuspense||d)&&(r.options.wrapInSuspense??s??(r.options.errorComponent?.preload||d))?u.Suspense:Ze,f=i?zn:Ze,m=c?ki:Ze,g=r.isRoot?r.options.shellComponent??Ze:Ze;return p.jsxs(g,{children:[p.jsx(On.Provider,{value:t,children:p.jsx(h,{fallback:a,children:p.jsx(f,{getResetKey:()=>o.resetKey,errorComponent:i||Un,onCatch:(v,b)=>{if(W(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 u.createElement(c,v)},children:d||o._displayPending?p.jsx(aa,{fallback:a,children:p.jsx(Ao,{matchId:t})}):p.jsx(Ao,{matchId:t})})})})}),o.parentRouteId===Ct&&n.options.scrollRestoration?p.jsxs(p.Fragment,{children:[p.jsx(Bi,{}),p.jsx(Fi,{})]}):null]})});function Bi(){const e=Se(),t=u.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",...je(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const Ao=u.memo(function({matchId:t}){const n=Se(),{match:o,key:r,routeId:s}=pe({select:l=>{const c=l.matches.find(g=>g.id===t),d=c.routeId,f=(n.routesById[d].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:d,loaderDeps:c.loaderDeps,params:c._strictParams,search:c._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:d,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=u.useMemo(()=>{const l=a.options.component??n.options.defaultComponent;return l?p.jsx(l,{},r):p.jsx(Tr,{})},[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 d=Ge();c._nonReactive.minPendingPromise=d,setTimeout(()=>{d.resolve(),c._nonReactive.minPendingPromise=void 0},l)}}throw n.getMatch(o.id)?._nonReactive.loadPromise}if(o.status==="notFound")return yt(W(o.error)),Ar(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}),Tr=u.memo(function(){const t=Se(),n=u.useContext(On),o=pe({select:c=>c.matches.find(d=>d.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 d=c.matches,h=d.findIndex(f=>f.id===n);return d[h+1]?.id}}),i=t.options.defaultPendingComponent?p.jsx(t.options.defaultPendingComponent,{}):null;if(s)return Ar(t,r,void 0);if(!a)return null;const l=p.jsx(Ir,{matchId:a});return o===Ct?p.jsx(u.Suspense,{fallback:i,children:l}):l});function Zi(){const e=Se(),n=e.routesById[Ct].options.pendingComponent??e.options.defaultPendingComponent,o=n?p.jsx(n,{}):null,r=typeof document<"u"&&e.ssr?Ze:u.Suspense,s=p.jsxs(r,{fallback:o,children:[p.jsx(Oi,{}),p.jsx($i,{})]});return e.options.InnerWrap?p.jsx(e.options.InnerWrap,{children:s}):s}function $i(){const e=Se(),t=pe({select:r=>r.matches[0]?.id}),n=pe({select:r=>r.loadedAt}),o=t?p.jsx(Ir,{matchId:t}):null;return p.jsx(On.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:p.jsx(zn,{getResetKey:()=>n,errorComponent:Un,onCatch:void 0,children:o})})}const zi=e=>new Ui(e);class Ui extends Li{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Mo,globalThis.createLazyFileRoute=Lo):typeof window<"u"&&(window.createFileRoute=Mo,window.createLazyFileRoute=Lo);function Ki({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(ia.Provider,{value:e,children:t});return e.options.Wrap?p.jsx(e.options.Wrap,{children:o}):o}function qi({router:e,...t}){return p.jsx(Ki,{router:e,...t,children:p.jsx(Zi,{})})}function sn(e){return pe({select:t=>e?.select?e.select(t.location):t.location})}const Gi=new Map([["bold",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.createElement("path",{d:"M216,48V88H40V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z",opacity:"0.2"}),u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}))]]),Wi=new Map([["bold",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}),u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}))]]),Xi=new Map([["bold",u.createElement(u.Fragment,null,u.createElement("path",{d:"M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Zm112-80a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,132Zm0,40a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,172Z"}))],["duotone",u.createElement(u.Fragment,null,u.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),u.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["fill",u.createElement(u.Fragment,null,u.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,176H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm-8-56V44l44,44Z"}))],["light",u.createElement(u.Fragment,null,u.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-34-82a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,136Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,168Z"}))],["regular",u.createElement(u.Fragment,null,u.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["thin",u.createElement(u.Fragment,null,u.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Zm-36-84a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,136Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,168Z"}))]]),Yi=new Map([["bold",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}),u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}))]]),Qi=new Map([["bold",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}),u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}))]]),Ji=new Map([["bold",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.createElement("path",{d:"M224,80v88l-24,24H48V64H208A16,16,0,0,1,224,80Z",opacity:"0.2"}),u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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=u.forwardRef((e,t)=>u.createElement(Ye,{ref:t,...e,weights:Gi}));Nr.displayName="CalendarIcon";const ec=Nr,Dr=u.forwardRef((e,t)=>u.createElement(Ye,{ref:t,...e,weights:Wi}));Dr.displayName="DotsSixVerticalIcon";const tc=Dr,jr=u.forwardRef((e,t)=>u.createElement(Ye,{ref:t,...e,weights:Xi}));jr.displayName="FileTextIcon";const Io=jr,Vr=u.forwardRef((e,t)=>u.createElement(Ye,{ref:t,...e,weights:Yi}));Vr.displayName="GridFourIcon";const Or=Vr,kr=u.forwardRef((e,t)=>u.createElement(Ye,{ref:t,...e,weights:Qi}));kr.displayName="PencilSimpleIcon";const nc=kr,Hr=u.forwardRef((e,t)=>u.createElement(Ye,{ref:t,...e,weights:Ji}));Hr.displayName="SortAscendingIcon";const oc=Hr,Kn="/login",rc="/api/auth/";let To=!1;const sc=e=>{const t=`${e.pathname||"/"}${e.search}${e.hash}`;return`${Kn}?next=${encodeURIComponent(t)}`},ac=e=>{if(!ae.isAxiosError(e)||e.response?.status!==401)return!1;const t=e.config?.url??"";return!t.startsWith(rc)&&t!==Kn},Fr=(e=window.location)=>{To||e.pathname===Kn||(To=!0,e.assign(sc(e)))},ic="X-Ocean-Brain-Session-Generation";let No=!1,Ot;const cc=e=>!!(e.authRequired&&!e.authenticated),lc=e=>{const t=e.headers.get(ic);return t?Ot?Ot===t?!1:(Ot=t,!0):(Ot=t,!1):!1},uc=(e=window.location)=>{No||(No=!0,e.reload())},Wt=async(e=fetch)=>{const t=await e("/api/auth/session").catch(()=>{});if(!t?.ok)return"unavailable";const n=lc(t),o=await t.json();return cc(o)?(Fr(),"expired"):n?(uc(),"reloading"):"active"},dc=e=>t=>{if(!(t instanceof MessageEvent)||typeof t.data!="string")return;const n=Ls(t.data);!n||n.type!==e||As(n)},hc=()=>{const e=kn();return u.useEffect(()=>Ps(t=>{Is(e,t)}),[e]),u.useEffect(()=>{if(typeof EventSource>"u")return;const t=new EventSource("/api/events");let n=!1;const o=()=>{n=!0,Wt()},r=()=>{n&&(n=!1,Wt())},s=_s.map(a=>{const i=dc(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},fc=({children:e})=>p.jsx(ca,{client:la,children:p.jsx(ua,{children:p.jsxs(da,{children:[p.jsx(hc,{}),e]})})}),Do=({children:e,fallback:t})=>e||t;function pc({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(X,{id:"note-filters-items-label",as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Items"}),p.jsx(bn,{value:String(e),"aria-labelledby":"note-filters-items-label",onValueChange:l=>{const c=Number(l);ha(c)&&t(c)},variant:"ghost",size:"sm",children:rr.map(l=>p.jsx(ut,{value:String(l),children:l===sr?`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(oc,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),p.jsx(X,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Sort"}),p.jsxs(bn,{value:n,ariaLabel:"Sort field",onValueChange:l=>o(l),variant:"ghost",size:"sm",children:[p.jsx(ut,{value:"updatedAt",children:"Updated"}),p.jsx(ut,{value:"createdAt",children:"Created"})]}),p.jsxs(bn,{value:r,ariaLabel:"Sort order",onValueChange:l=>s(l),variant:"ghost",size:"sm",children:[p.jsx(ut,{value:"desc",children:"Newest"}),p.jsx(ut,{value:"asc",children:"Oldest"})]})]}),p.jsx("div",{className:"h-5 w-px bg-divider"}),p.jsxs(fa,{htmlFor:"pinnedFirst",size:"sm",className:"flex cursor-pointer items-center gap-1.5",children:[p.jsx(pa,{id:"pinnedFirst",size:"sm",checked:a,onChange:l=>i(l.target.checked)}),p.jsx(X,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Pinned First"})]})]})})}const mc=e=>{let t=!1;return()=>{t||(window.requestAnimationFrame(()=>{e(),t=!1}),t=!0)}},xn=new Map;function gc(){const e=sn({select:n=>n.pathname}),t=u.useRef(null);return u.useEffect(()=>{if(t.current?.parentElement){const{parentElement:n}=t.current,o=s=>{if(s!==0){xn.set(e,s);return}xn.delete(e)},r=mc(()=>{if(t.current){const{scrollTop:s}=n;o(s)}});return n.scrollTop=xn.get(e)??0,n.addEventListener("scroll",r),()=>{n.removeEventListener("scroll",r)}}},[e]),p.jsx("div",{ref:t,className:"hidden"})}const vc=()=>null,bc="flex h-dvh min-h-0 w-full flex-row overflow-hidden",yc=ie("fixed","bottom-4","left-4","z-[1003]","flex","h-12","w-12","items-center","justify-center","rounded-[14px]","border","border-border-subtle","bg-surface","text-fg-secondary","shadow-[0_12px_24px_-18px_rgba(0,0,0,0.35)]","transition-all","hover:bg-hover-subtle","hover:text-fg-default","active:translate-y-px","aria-expanded:bg-hover-subtle","aria-expanded:text-fg-default"),xc=ie("fixed","z-[1002]","h-full","w-full","flex-[0_0_300px]","overflow-y-auto","border-r-0","border-border-subtle","bg-[var(--page-bg)]","pb-20","md:static","md:w-auto","md:translate-x-0","md:border-r","md:pb-0","md:pointer-events-auto"),wc="pointer-events-none -translate-x-full",Sc="pointer-events-auto translate-x-0",Rc=ie("flex","h-full","min-h-0","min-w-0","flex-1","flex-col","overflow-x-hidden","overflow-y-auto","overscroll-contain","[scrollbar-gutter:stable]"),Ec=ie("sticky","top-0","z-[1001]","border-b","border-border-subtle","bg-[var(--page-bg)]","max-md:after:content-['']","max-md:after:pointer-events-none","max-md:after:absolute","max-md:after:inset-y-0","max-md:after:right-0","max-md:after:w-12","max-md:after:bg-[linear-gradient(to_right,transparent,var(--page-bg))]"),Cc=ie("flex","items-center","overflow-x-auto","whitespace-nowrap","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden"),Mc=ie("min-h-0","min-w-0","max-w-full","flex-1","overflow-x-clip","px-4","pt-4","after:block","after:h-4","after:content-['']","max-md:after:h-24"),Pc=({sidebar:e,topNavigation:t,children:n})=>{const o=sn({select:i=>i.pathname}),[r,s]=u.useState(!1),a="site-layout-sidebar";return u.useEffect(()=>{s(!1)},[o]),p.jsxs("div",{className:bc,children:[p.jsx("div",{className:"md:hidden",children:p.jsx("button",{type:"button",className:yc,"aria-label":"Toggle sidebar","aria-controls":a,"aria-expanded":r,onClick:()=>s(i=>!i),children:p.jsx(Ts,{className:"h-6 w-6"})})}),p.jsx("aside",{id:a,className:ie(xc,r?Sc:wc),children:e}),p.jsxs("main",{className:Rc,children:[p.jsx("div",{className:Ec,children:p.jsx("div",{className:Cc,children:t})}),p.jsx("div",{className:Mc,children:n}),p.jsx(gc,{})]})]})},Br=e=>typeof e=="object"&&e!==null&&"value"in e&&typeof e.value=="string",Zr=(e,t)=>({type:"error",category:"graphql",errors:[{code:"INVALID_RESPONSE_SHAPE",message:`GraphQL response field "${e}" is missing or invalid`,details:t}]}),_c=async e=>{try{const t=await en(`
3
+ query GetServerCache($key: String!) {
4
+ cache(key: $key) {
5
+ value
6
+ }
7
+ }
8
+ `,{key:e});if(t.type==="error")throw t;if(!Br(t.cache))throw Zr("cache",t);return t.cache.value}catch{return""}},Lc=async(e,t)=>{const n=await en(`
9
+ mutation SetServerCache($key: String!, $value: String!) {
10
+ setCache(key: $key, value: $value) {
11
+ value
12
+ }
13
+ }
14
+ `,{key:e,value:encodeURIComponent(t)});return n.type==="error"?n:Br(n.setCache)?{...n,setCache:n.setCache}:Zr("setCache",n)},Ac=()=>{const e=Ns(),t=ma(),n=kn(),{data:o}=er({queryKey:We.ui.heroBanner(),async queryFn(){return _c("heroBanner")}});return o?p.jsx("div",{className:"p-3 pb-0",children:p.jsxs("div",{className:"surface-base group relative overflow-hidden",children:[p.jsx("img",{alt:"Studio atmosphere banner",className:"w-full object-cover transition duration-500 group-hover:scale-[1.01] group-hover:opacity-90 dark:brightness-[0.85] dark:saturate-[0.9]",src:o}),p.jsx("button",{type:"button","aria-label":"Remove sidebar banner",title:"Remove banner",className:"focus-ring-soft absolute right-2 top-2 inline-flex h-8 w-8 items-center justify-center rounded-[10px] border border-white/14 bg-black/24 text-white/85 opacity-0 outline-none backdrop-blur-sm transition-opacity hover:bg-black/34 hover:text-white focus-visible:opacity-100 group-hover:opacity-100",onClick:async()=>{if(await e("Remove this hero banner from the sidebar?")){const r=await Lc("heroBanner","");if(r.type==="error"){t(r.errors[0]?.message??"Failed to remove hero banner");return}await n.invalidateQueries({queryKey:We.ui.heroBanner(),exact:!0})}},children:p.jsx(ar,{className:"h-4 w-4",weight:"bold"})})]})}):null};function Ic(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return u.useMemo(()=>o=>{t.forEach(r=>r(o))},t)}const an=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Qe(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function qn(e){return"nodeType"in e}function Y(e){var t,n;return e?Qe(e)?e:qn(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Gn(e){const{Document:t}=Y(e);return e instanceof t}function Mt(e){return Qe(e)?!1:e instanceof Y(e).HTMLElement}function $r(e){return e instanceof Y(e).SVGElement}function Je(e){return e?Qe(e)?e.document:qn(e)?Gn(e)?e:Mt(e)||$r(e)?e.ownerDocument:document:document:document}const me=an?u.useLayoutEffect:u.useEffect;function Wn(e){const t=u.useRef(e);return me(()=>{t.current=e}),u.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function Tc(){const e=u.useRef(null),t=u.useCallback((o,r)=>{e.current=setInterval(o,r)},[]),n=u.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function wt(e,t){t===void 0&&(t=[e]);const n=u.useRef(e);return me(()=>{n.current!==e&&(n.current=e)},t),n}function Pt(e,t){const n=u.useRef();return u.useMemo(()=>{const o=e(n.current);return n.current=o,o},[...t])}function Xt(e){const t=Wn(e),n=u.useRef(null),o=u.useCallback(r=>{r!==n.current&&t?.(r,n.current),n.current=r},[]);return[n,o]}function Tn(e){const t=u.useRef();return u.useEffect(()=>{t.current=e},[e]),t.current}let wn={};function _t(e,t){return u.useMemo(()=>{if(t)return t;const n=wn[e]==null?0:wn[e]+1;return wn[e]=n,e+"-"+n},[e,t])}function zr(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((s,a)=>{const i=Object.entries(a);for(const[l,c]of i){const d=s[l];d!=null&&(s[l]=d+e*c)}return s},{...t})}}const qe=zr(1),St=zr(-1);function Nc(e){return"clientX"in e&&"clientY"in e}function Xn(e){if(!e)return!1;const{KeyboardEvent:t}=Y(e.target);return t&&e instanceof t}function Dc(e){if(!e)return!1;const{TouchEvent:t}=Y(e.target);return t&&e instanceof t}function Nn(e){if(Dc(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Nc(e)?{x:e.clientX,y:e.clientY}:null}const Rt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Rt.Translate.toString(e),Rt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),jo="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function jc(e){return e.matches(jo)?e:e.querySelector(jo)}const Vc={display:"none"};function Oc(e){let{id:t,value:n}=e;return K.createElement("div",{id:t,style:Vc},n)}function kc(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;const r={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return K.createElement("div",{id:t,style:r,role:"status","aria-live":o,"aria-atomic":!0},n)}function Hc(){const[e,t]=u.useState("");return{announce:u.useCallback(o=>{o!=null&&t(o)},[]),announcement:e}}const Ur=u.createContext(null);function Fc(e){const t=u.useContext(Ur);u.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Bc(){const[e]=u.useState(()=>new Set),t=u.useCallback(o=>(e.add(o),()=>e.delete(o)),[e]);return[u.useCallback(o=>{let{type:r,event:s}=o;e.forEach(a=>{var i;return(i=a[r])==null?void 0:i.call(a,s)})},[e]),t]}const Zc={draggable:`
15
+ To pick up a draggable item, press the space bar.
16
+ While dragging, use the arrow keys to move the item.
17
+ Press space again to drop the item in its new position, or press escape to cancel.
18
+ `},$c={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function zc(e){let{announcements:t=$c,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=Zc}=e;const{announce:s,announcement:a}=Hc(),i=_t("DndLiveRegion"),[l,c]=u.useState(!1);if(u.useEffect(()=>{c(!0)},[]),Fc(u.useMemo(()=>({onDragStart(h){let{active:f}=h;s(t.onDragStart({active:f}))},onDragMove(h){let{active:f,over:m}=h;t.onDragMove&&s(t.onDragMove({active:f,over:m}))},onDragOver(h){let{active:f,over:m}=h;s(t.onDragOver({active:f,over:m}))},onDragEnd(h){let{active:f,over:m}=h;s(t.onDragEnd({active:f,over:m}))},onDragCancel(h){let{active:f,over:m}=h;s(t.onDragCancel({active:f,over:m}))}}),[s,t])),!l)return null;const d=K.createElement(K.Fragment,null,K.createElement(Oc,{id:o,value:r.draggable}),K.createElement(kc,{id:i,announcement:a}));return n?ht.createPortal(d,n):d}var j;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(j||(j={}));function Yt(){}function Vo(e,t){return u.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Uc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return u.useMemo(()=>[...t].filter(o=>o!=null),[...t])}const ce=Object.freeze({x:0,y:0});function Kr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function qr(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function Kc(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function Oo(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function Gr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function ko(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const qc=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=ko(t,t.left,t.top),s=[];for(const a of o){const{id:i}=a,l=n.get(i);if(l){const c=Kr(ko(l),r);s.push({id:i,data:{droppableContainer:a,value:c}})}}return s.sort(qr)},Gc=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Oo(t),s=[];for(const a of o){const{id:i}=a,l=n.get(i);if(l){const c=Oo(l),d=r.reduce((f,m,g)=>f+Kr(c[g],m),0),h=Number((d/4).toFixed(4));s.push({id:i,data:{droppableContainer:a,value:h}})}}return s.sort(qr)};function Wc(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=r-o,i=s-n;if(o<r&&n<s){const l=t.width*t.height,c=e.width*e.height,d=a*i,h=d/(l+c-d);return Number(h.toFixed(4))}return 0}const Xc=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const s of o){const{id:a}=s,i=n.get(a);if(i){const l=Wc(i,t);l>0&&r.push({id:a,data:{droppableContainer:s,value:l}})}}return r.sort(Kc)};function Yc(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Wr(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ce}function Qc(e){return function(n){for(var o=arguments.length,r=new Array(o>1?o-1:0),s=1;s<o;s++)r[s-1]=arguments[s];return r.reduce((a,i)=>({...a,top:a.top+e*i.y,bottom:a.bottom+e*i.y,left:a.left+e*i.x,right:a.right+e*i.x}),{...n})}}const Jc=Qc(1);function el(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function tl(e,t,n){const o=el(t);if(!o)return e;const{scaleX:r,scaleY:s,x:a,y:i}=o,l=e.left-a-(1-r)*parseFloat(n),c=e.top-i-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?e.width/r:e.width,h=s?e.height/s:e.height;return{width:d,height:h,top:c,right:l+d,bottom:c+h,left:l}}const nl={ignoreTransform:!1};function et(e,t){t===void 0&&(t=nl);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=Y(e).getComputedStyle(e);c&&(n=tl(n,c,d))}const{top:o,left:r,width:s,height:a,bottom:i,right:l}=n;return{top:o,left:r,width:s,height:a,bottom:i,right:l}}function Ho(e){return et(e,{ignoreTransform:!0})}function ol(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function rl(e,t){return t===void 0&&(t=Y(e).getComputedStyle(e)),t.position==="fixed"}function sl(e,t){t===void 0&&(t=Y(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{const s=t[r];return typeof s=="string"?n.test(s):!1})}function cn(e,t){const n=[];function o(r){if(t!=null&&n.length>=t||!r)return n;if(Gn(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!Mt(r)||$r(r)||n.includes(r))return n;const s=Y(e).getComputedStyle(r);return r!==e&&sl(r,s)&&n.push(r),rl(r,s)?n:o(r.parentNode)}return e?o(e):n}function Xr(e){const[t]=cn(e,1);return t??null}function Sn(e){return!an||!e?null:Qe(e)?e:qn(e)?Gn(e)||e===Je(e).scrollingElement?window:Mt(e)?e:null:null}function Yr(e){return Qe(e)?e.scrollX:e.scrollLeft}function Qr(e){return Qe(e)?e.scrollY:e.scrollTop}function Dn(e){return{x:Yr(e),y:Qr(e)}}var H;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(H||(H={}));function Jr(e){return!an||!e?!1:e===document.scrollingElement}function es(e){const t={x:0,y:0},n=Jr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},r=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=o.y,i=e.scrollLeft>=o.x;return{isTop:r,isLeft:s,isBottom:a,isRight:i,maxScroll:o,minScroll:t}}const al={x:.2,y:.2};function il(e,t,n,o,r){let{top:s,left:a,right:i,bottom:l}=n;o===void 0&&(o=10),r===void 0&&(r=al);const{isTop:c,isBottom:d,isLeft:h,isRight:f}=es(e),m={x:0,y:0},g={x:0,y:0},v={height:t.height*r.y,width:t.width*r.x};return!c&&s<=t.top+v.height?(m.y=H.Backward,g.y=o*Math.abs((t.top+v.height-s)/v.height)):!d&&l>=t.bottom-v.height&&(m.y=H.Forward,g.y=o*Math.abs((t.bottom-v.height-l)/v.height)),!f&&i>=t.right-v.width?(m.x=H.Forward,g.x=o*Math.abs((t.right-v.width-i)/v.width)):!h&&a<=t.left+v.width&&(m.x=H.Backward,g.x=o*Math.abs((t.left+v.width-a)/v.width)),{direction:m,speed:g}}function cl(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function ts(e){return e.reduce((t,n)=>qe(t,Dn(n)),ce)}function ll(e){return e.reduce((t,n)=>t+Yr(n),0)}function ul(e){return e.reduce((t,n)=>t+Qr(n),0)}function dl(e,t){if(t===void 0&&(t=et),!e)return;const{top:n,left:o,bottom:r,right:s}=t(e);Xr(e)&&(r<=0||s<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const hl=[["x",["left","right"],ll],["y",["top","bottom"],ul]];class Yn{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=cn(n),r=ts(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,i]of hl)for(const l of a)Object.defineProperty(this,l,{get:()=>{const c=i(o),d=r[s]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class mt{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var r;(r=this.target)==null||r.addEventListener(t,n,o),this.listeners.push([t,n,o])}}function fl(e){const{EventTarget:t}=Y(e);return e instanceof t?e:Je(e)}function Rn(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t?o>t.y:!1}var re;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(re||(re={}));function Fo(e){e.preventDefault()}function pl(e){e.stopPropagation()}var A;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(A||(A={}));const ns={start:[A.Space,A.Enter],cancel:[A.Esc],end:[A.Space,A.Enter,A.Tab]},ml=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case A.Right:return{...n,x:n.x+25};case A.Left:return{...n,x:n.x-25};case A.Down:return{...n,y:n.y+25};case A.Up:return{...n,y:n.y-25}}};class Qn{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new mt(Je(n)),this.windowListeners=new mt(Y(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(re.Resize,this.handleCancel),this.windowListeners.add(re.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(re.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&dl(o),n(ce)}handleKeyDown(t){if(Xn(t)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:s=ns,coordinateGetter:a=ml,scrollBehavior:i="smooth"}=r,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=o.current,d=c?{x:c.left,y:c.top}:ce;this.referenceCoordinates||(this.referenceCoordinates=d);const h=a(t,{active:n,context:o.current,currentCoordinates:d});if(h){const f=St(h,d),m={x:0,y:0},{scrollableAncestors:g}=o.current;for(const v of g){const b=t.code,{isTop:y,isRight:x,isLeft:S,isBottom:R,maxScroll:M,minScroll:_}=es(v),E=cl(v),w={x:Math.min(b===A.Right?E.right-E.width/2:E.right,Math.max(b===A.Right?E.left:E.left+E.width/2,h.x)),y:Math.min(b===A.Down?E.bottom-E.height/2:E.bottom,Math.max(b===A.Down?E.top:E.top+E.height/2,h.y))},C=b===A.Right&&!x||b===A.Left&&!S,I=b===A.Down&&!R||b===A.Up&&!y;if(C&&w.x!==h.x){const P=v.scrollLeft+f.x,L=b===A.Right&&P<=M.x||b===A.Left&&P>=_.x;if(L&&!f.y){v.scrollTo({left:P,behavior:i});return}L?m.x=v.scrollLeft-P:m.x=b===A.Right?v.scrollLeft-M.x:v.scrollLeft-_.x,m.x&&v.scrollBy({left:-m.x,behavior:i});break}else if(I&&w.y!==h.y){const P=v.scrollTop+f.y,L=b===A.Down&&P<=M.y||b===A.Up&&P>=_.y;if(L&&!f.x){v.scrollTo({top:P,behavior:i});return}L?m.y=v.scrollTop-P:m.y=b===A.Down?v.scrollTop-M.y:v.scrollTop-_.y,m.y&&v.scrollBy({top:-m.y,behavior:i});break}}this.handleMove(t,qe(St(h,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:o}=this.props;t.preventDefault(),o(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Qn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=ns,onActivation:r}=t,{active:s}=n;const{code:a}=e.nativeEvent;if(o.start.includes(a)){const i=s.activatorNode.current;return i&&e.target!==i?!1:(e.preventDefault(),r?.({event:e.nativeEvent}),!0)}return!1}}];function Bo(e){return!!(e&&"distance"in e)}function Zo(e){return!!(e&&"delay"in e)}class Jn{constructor(t,n,o){var r;o===void 0&&(o=fl(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:a}=s;this.props=t,this.events=n,this.document=Je(a),this.documentListeners=new mt(this.document),this.listeners=new mt(o),this.windowListeners=new mt(Y(a)),this.initialCoordinates=(r=Nn(s))!=null?r:ce,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(re.Resize,this.handleCancel),this.windowListeners.add(re.DragStart,Fo),this.windowListeners.add(re.VisibilityChange,this.handleCancel),this.windowListeners.add(re.ContextMenu,Fo),this.documentListeners.add(re.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Zo(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Bo(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:o,onPending:r}=this.props;r(o,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(re.Click,pl,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(re.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:o,initialCoordinates:r,props:s}=this,{onMove:a,options:{activationConstraint:i}}=s;if(!r)return;const l=(n=Nn(t))!=null?n:ce,c=St(r,l);if(!o&&i){if(Bo(i)){if(i.tolerance!=null&&Rn(c,i.tolerance))return this.handleCancel();if(Rn(c,i.distance))return this.handleStart()}if(Zo(i)&&Rn(c,i.tolerance))return this.handleCancel();this.handlePending(i,c);return}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===A.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const gl={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class eo extends Jn{constructor(t){const{event:n}=t,o=Je(n.target);super(t,gl,o)}}eo.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!n.isPrimary||n.button!==0?!1:(o?.({event:n}),!0)}}];const vl={move:{name:"mousemove"},end:{name:"mouseup"}};var jn;(function(e){e[e.RightClick=2]="RightClick"})(jn||(jn={}));class bl extends Jn{constructor(t){super(t,vl,Je(t.event.target))}}bl.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button===jn.RightClick?!1:(o?.({event:n}),!0)}}];const En={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class yl extends Jn{constructor(t){super(t,En)}static setup(){return window.addEventListener(En.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(En.move.name,t)};function t(){}}}yl.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return r.length>1?!1:(o?.({event:n}),!0)}}];var gt;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(gt||(gt={}));var Qt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Qt||(Qt={}));function xl(e){let{acceleration:t,activator:n=gt.Pointer,canScroll:o,draggingRect:r,enabled:s,interval:a=5,order:i=Qt.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:h,threshold:f}=e;const m=Sl({delta:h,disabled:!s}),[g,v]=Tc(),b=u.useRef({x:0,y:0}),y=u.useRef({x:0,y:0}),x=u.useMemo(()=>{switch(n){case gt.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case gt.DraggableRect:return r}},[n,r,l]),S=u.useRef(null),R=u.useCallback(()=>{const _=S.current;if(!_)return;const E=b.current.x*y.current.x,w=b.current.y*y.current.y;_.scrollBy(E,w)},[]),M=u.useMemo(()=>i===Qt.TreeOrder?[...c].reverse():c,[i,c]);u.useEffect(()=>{if(!s||!c.length||!x){v();return}for(const _ of M){if(o?.(_)===!1)continue;const E=c.indexOf(_),w=d[E];if(!w)continue;const{direction:C,speed:I}=il(_,w,x,t,f);for(const P of["x","y"])m[P][C[P]]||(I[P]=0,C[P]=0);if(I.x>0||I.y>0){v(),S.current=_,g(R,a),b.current=I,y.current=C;return}}b.current={x:0,y:0},y.current={x:0,y:0},v()},[t,R,o,v,s,a,JSON.stringify(x),JSON.stringify(m),g,c,M,d,JSON.stringify(f)])}const wl={x:{[H.Backward]:!1,[H.Forward]:!1},y:{[H.Backward]:!1,[H.Forward]:!1}};function Sl(e){let{delta:t,disabled:n}=e;const o=Tn(t);return Pt(r=>{if(n||!o||!r)return wl;const s={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[H.Backward]:r.x[H.Backward]||s.x===-1,[H.Forward]:r.x[H.Forward]||s.x===1},y:{[H.Backward]:r.y[H.Backward]||s.y===-1,[H.Forward]:r.y[H.Forward]||s.y===1}}},[n,t,o])}function Rl(e,t){const n=t!=null?e.get(t):void 0,o=n?n.node.current:null;return Pt(r=>{var s;return t==null?null:(s=o??r)!=null?s:null},[o,t])}function El(e,t){return u.useMemo(()=>e.reduce((n,o)=>{const{sensor:r}=o,s=r.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,o)}));return[...n,...s]},[]),[e,t])}var Et;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Et||(Et={}));var Vn;(function(e){e.Optimized="optimized"})(Vn||(Vn={}));const $o=new Map;function Cl(e,t){let{dragging:n,dependencies:o,config:r}=t;const[s,a]=u.useState(null),{frequency:i,measure:l,strategy:c}=r,d=u.useRef(e),h=b(),f=wt(h),m=u.useCallback(function(y){y===void 0&&(y=[]),!f.current&&a(x=>x===null?y:x.concat(y.filter(S=>!x.includes(S))))},[f]),g=u.useRef(null),v=Pt(y=>{if(h&&!n)return $o;if(!y||y===$o||d.current!==e||s!=null){const x=new Map;for(let S of e){if(!S)continue;if(s&&s.length>0&&!s.includes(S.id)&&S.rect.current){x.set(S.id,S.rect.current);continue}const R=S.node.current,M=R?new Yn(l(R),R):null;S.rect.current=M,M&&x.set(S.id,M)}return x}return y},[e,s,n,h,l]);return u.useEffect(()=>{d.current=e},[e]),u.useEffect(()=>{h||m()},[n,h]),u.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),u.useEffect(()=>{h||typeof i!="number"||g.current!==null||(g.current=setTimeout(()=>{m(),g.current=null},i))},[i,h,m,...o]),{droppableRects:v,measureDroppableContainers:m,measuringScheduled:s!=null};function b(){switch(c){case Et.Always:return!1;case Et.BeforeDragging:return n;default:return!n}}}function os(e,t){return Pt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Ml(e,t){return os(e,t)}function Pl(e){let{callback:t,disabled:n}=e;const o=Wn(t),r=u.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(o)},[o,n]);return u.useEffect(()=>()=>r?.disconnect(),[r]),r}function ln(e){let{callback:t,disabled:n}=e;const o=Wn(t),r=u.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(o)},[n]);return u.useEffect(()=>()=>r?.disconnect(),[r]),r}function _l(e){return new Yn(et(e),e)}function zo(e,t,n){t===void 0&&(t=_l);const[o,r]=u.useState(null);function s(){r(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const a=Pl({callback(l){if(e)for(const c of l){const{type:d,target:h}=c;if(d==="childList"&&h instanceof HTMLElement&&h.contains(e)){s();break}}}}),i=ln({callback:s});return me(()=>{s(),e?(i?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(i?.disconnect(),a?.disconnect())},[e]),o}function Ll(e){const t=os(e);return Wr(e,t)}const Uo=[];function Al(e){const t=u.useRef(e),n=Pt(o=>e?o&&o!==Uo&&e&&t.current&&e.parentNode===t.current.parentNode?o:cn(e):Uo,[e]);return u.useEffect(()=>{t.current=e},[e]),n}function Il(e){const[t,n]=u.useState(null),o=u.useRef(e),r=u.useCallback(s=>{const a=Sn(s.target);a&&n(i=>i?(i.set(a,Dn(a)),new Map(i)):null)},[]);return u.useEffect(()=>{const s=o.current;if(e!==s){a(s);const i=e.map(l=>{const c=Sn(l);return c?(c.addEventListener("scroll",r,{passive:!0}),[c,Dn(c)]):null}).filter(l=>l!=null);n(i.length?new Map(i):null),o.current=e}return()=>{a(e),a(s)};function a(i){i.forEach(l=>{const c=Sn(l);c?.removeEventListener("scroll",r)})}},[r,e]),u.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>qe(s,a),ce):ts(e):ce,[e,t])}function Ko(e,t){t===void 0&&(t=[]);const n=u.useRef(null);return u.useEffect(()=>{n.current=null},t),u.useEffect(()=>{const o=e!==ce;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?St(e,n.current):ce}function Tl(e){u.useEffect(()=>{if(!an)return;const t=e.map(n=>{let{sensor:o}=n;return o.setup==null?void 0:o.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function Nl(e,t){return u.useMemo(()=>e.reduce((n,o)=>{let{eventName:r,handler:s}=o;return n[r]=a=>{s(a,t)},n},{}),[e,t])}function rs(e){return u.useMemo(()=>e?ol(e):null,[e])}const qo=[];function Dl(e,t){t===void 0&&(t=et);const[n]=e,o=rs(n?Y(n):null),[r,s]=u.useState(qo);function a(){s(()=>e.length?e.map(l=>Jr(l)?o:new Yn(t(l),l)):qo)}const i=ln({callback:a});return me(()=>{i?.disconnect(),a(),e.forEach(l=>i?.observe(l))},[e]),r}function jl(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Mt(t)?t:e}function Vl(e){let{measure:t}=e;const[n,o]=u.useState(null),r=u.useCallback(c=>{for(const{target:d}of c)if(Mt(d)){o(h=>{const f=t(d);return h?{...h,width:f.width,height:f.height}:f});break}},[t]),s=ln({callback:r}),a=u.useCallback(c=>{const d=jl(c);s?.disconnect(),d&&s?.observe(d),o(d?t(d):null)},[t,s]),[i,l]=Xt(a);return u.useMemo(()=>({nodeRef:i,rect:n,setRef:l}),[n,i,l])}const Ol=[{sensor:eo,options:{}},{sensor:Qn,options:{}}],kl={current:{}},$t={draggable:{measure:Ho},droppable:{measure:Ho,strategy:Et.WhileDragging,frequency:Vn.Optimized},dragOverlay:{measure:et}};class vt extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}}const Hl={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new vt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Yt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:$t,measureDroppableContainers:Yt,windowRect:null,measuringScheduled:!1},Fl={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Yt,draggableNodes:new Map,over:null,measureDroppableContainers:Yt},un=u.createContext(Fl),ss=u.createContext(Hl);function Bl(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new vt}}}function Zl(e,t){switch(t.type){case j.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case j.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case j.DragEnd:case j.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case j.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new vt(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case j.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,s=e.droppable.containers.get(n);if(!s||o!==s.key)return e;const a=new vt(e.droppable.containers);return a.set(n,{...s,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case j.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const s=new vt(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function $l(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=u.useContext(un),s=Tn(o),a=Tn(n?.id);return u.useEffect(()=>{if(!t&&!o&&s&&a!=null){if(!Xn(s)||document.activeElement===s.target)return;const i=r.get(a);if(!i)return;const{activatorNode:l,node:c}=i;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const h=jc(d);if(h){h.focus();break}}})}},[o,t,r,a,s]),null}function zl(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((r,s)=>s({transform:r,...o}),n):n}function Ul(e){return u.useMemo(()=>({draggable:{...$t.draggable,...e?.draggable},droppable:{...$t.droppable,...e?.droppable},dragOverlay:{...$t.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Kl(e){let{activeNode:t,measure:n,initialRect:o,config:r=!0}=e;const s=u.useRef(!1),{x:a,y:i}=typeof r=="boolean"?{x:r,y:r}:r;me(()=>{if(!a&&!i||!t){s.current=!1;return}if(s.current||!o)return;const c=t?.node.current;if(!c||c.isConnected===!1)return;const d=n(c),h=Wr(d,o);if(a||(h.x=0),i||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const f=Xr(c);f&&f.scrollBy({top:h.y,left:h.x})}},[t,a,i,o,n])}const as=u.createContext({...ce,scaleX:1,scaleY:1});var Le;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Le||(Le={}));const ql=u.memo(function(t){var n,o,r,s;let{id:a,accessibility:i,autoScroll:l=!0,children:c,sensors:d=Ol,collisionDetection:h=Xc,measuring:f,modifiers:m,...g}=t;const v=u.useReducer(Zl,void 0,Bl),[b,y]=v,[x,S]=Bc(),[R,M]=u.useState(Le.Uninitialized),_=R===Le.Initialized,{draggable:{active:E,nodes:w,translate:C},droppable:{containers:I}}=b,P=E!=null?w.get(E):null,L=u.useRef({initial:null,translated:null}),U=u.useMemo(()=>{var z;return E!=null?{id:E,data:(z=P?.data)!=null?z:kl,rect:L}:null},[E,P]),N=u.useRef(null),[le,q]=u.useState(null),[k,Lt]=u.useState(null),ge=wt(g,Object.values(g)),nt=_t("DndDescribedBy",a),At=u.useMemo(()=>I.getEnabled(),[I]),G=Ul(f),{droppableRects:ve,measureDroppableContainers:Ne,measuringScheduled:ot}=Cl(At,{dragging:_,dependencies:[C.x,C.y],config:G.droppable}),ne=Rl(w,E),It=u.useMemo(()=>k?Nn(k):null,[k]),Re=Ms(),be=Ml(ne,G.draggable.measure);Kl({activeNode:E!=null?w.get(E):null,config:Re.layoutShiftCompensation,initialRect:be,measure:G.draggable.measure});const T=zo(ne,G.draggable.measure,be),rt=zo(ne?ne.parentElement:null),ue=u.useRef({activatorEvent:null,active:null,activeNode:ne,collisionRect:null,collisions:null,droppableRects:ve,draggableNodes:w,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ve=I.getNodeFor((n=ue.current.over)==null?void 0:n.id),ye=Vl({measure:G.dragOverlay.measure}),Oe=(o=ye.nodeRef.current)!=null?o:ne,ke=_?(r=ye.rect)!=null?r:T:null,to=!!(ye.nodeRef.current&&ye.rect),no=Ll(to?null:T),fn=rs(Oe?Y(Oe):null),Ee=Al(_?Ve??ne:null),Tt=Dl(Ee),Nt=zl(m,{transform:{x:C.x-no.x,y:C.y-no.y,scaleX:1,scaleY:1},activatorEvent:k,active:U,activeNodeRect:T,containerNodeRect:rt,draggingNodeRect:ke,over:ue.current.over,overlayNodeRect:ye.rect,scrollableAncestors:Ee,scrollableAncestorRects:Tt,windowRect:fn}),oo=It?qe(It,C):null,ro=Il(Ee),ys=Ko(ro),xs=Ko(ro,[T]),He=qe(Nt,ys),Fe=ke?Jc(ke,Nt):null,st=U&&Fe?h({active:U,collisionRect:Fe,droppableRects:ve,droppableContainers:At,pointerCoordinates:oo}):null,so=Gr(st,"id"),[Ce,ao]=u.useState(null),ws=to?Nt:qe(Nt,xs),Ss=Yc(ws,(s=Ce?.rect)!=null?s:null,T),pn=u.useRef(null),io=u.useCallback((z,Q)=>{let{sensor:J,options:Me}=Q;if(N.current==null)return;const oe=w.get(N.current);if(!oe)return;const ee=z.nativeEvent,de=new J({active:N.current,activeNode:oe,event:ee,options:Me,context:ue,onAbort(B){if(!w.get(B))return;const{onDragAbort:he}=ge.current,xe={id:B};he?.(xe),x({type:"onDragAbort",event:xe})},onPending(B,Pe,he,xe){if(!w.get(B))return;const{onDragPending:it}=ge.current,_e={id:B,constraint:Pe,initialCoordinates:he,offset:xe};it?.(_e),x({type:"onDragPending",event:_e})},onStart(B){const Pe=N.current;if(Pe==null)return;const he=w.get(Pe);if(!he)return;const{onDragStart:xe}=ge.current,at={activatorEvent:ee,active:{id:Pe,data:he.data,rect:L}};ht.unstable_batchedUpdates(()=>{xe?.(at),M(Le.Initializing),y({type:j.DragStart,initialCoordinates:B,active:Pe}),x({type:"onDragStart",event:at}),q(pn.current),Lt(ee)})},onMove(B){y({type:j.DragMove,coordinates:B})},onEnd:Be(j.DragEnd),onCancel:Be(j.DragCancel)});pn.current=de;function Be(B){return async function(){const{active:he,collisions:xe,over:at,scrollAdjustedTranslate:it}=ue.current;let _e=null;if(he&&it){const{cancelDrop:ct}=ge.current;_e={activatorEvent:ee,active:he,collisions:xe,delta:it,over:at},B===j.DragEnd&&typeof ct=="function"&&await Promise.resolve(ct(_e))&&(B=j.DragCancel)}N.current=null,ht.unstable_batchedUpdates(()=>{y({type:B}),M(Le.Uninitialized),ao(null),q(null),Lt(null),pn.current=null;const ct=B===j.DragEnd?"onDragEnd":"onDragCancel";if(_e){const mn=ge.current[ct];mn?.(_e),x({type:ct,event:_e})}})}}},[w]),Rs=u.useCallback((z,Q)=>(J,Me)=>{const oe=J.nativeEvent,ee=w.get(Me);if(N.current!==null||!ee||oe.dndKit||oe.defaultPrevented)return;const de={active:ee};z(J,Q.options,de)===!0&&(oe.dndKit={capturedBy:Q.sensor},N.current=Me,io(J,Q))},[w,io]),co=El(d,Rs);Tl(d),me(()=>{T&&R===Le.Initializing&&M(Le.Initialized)},[T,R]),u.useEffect(()=>{const{onDragMove:z}=ge.current,{active:Q,activatorEvent:J,collisions:Me,over:oe}=ue.current;if(!Q||!J)return;const ee={active:Q,activatorEvent:J,collisions:Me,delta:{x:He.x,y:He.y},over:oe};ht.unstable_batchedUpdates(()=>{z?.(ee),x({type:"onDragMove",event:ee})})},[He.x,He.y]),u.useEffect(()=>{const{active:z,activatorEvent:Q,collisions:J,droppableContainers:Me,scrollAdjustedTranslate:oe}=ue.current;if(!z||N.current==null||!Q||!oe)return;const{onDragOver:ee}=ge.current,de=Me.get(so),Be=de&&de.rect.current?{id:de.id,rect:de.rect.current,data:de.data,disabled:de.disabled}:null,B={active:z,activatorEvent:Q,collisions:J,delta:{x:oe.x,y:oe.y},over:Be};ht.unstable_batchedUpdates(()=>{ao(Be),ee?.(B),x({type:"onDragOver",event:B})})},[so]),me(()=>{ue.current={activatorEvent:k,active:U,activeNode:ne,collisionRect:Fe,collisions:st,droppableRects:ve,draggableNodes:w,draggingNode:Oe,draggingNodeRect:ke,droppableContainers:I,over:Ce,scrollableAncestors:Ee,scrollAdjustedTranslate:He},L.current={initial:ke,translated:Fe}},[U,ne,st,Fe,w,Oe,ke,ve,I,Ce,Ee,He]),xl({...Re,delta:C,draggingRect:Fe,pointerCoordinates:oo,scrollableAncestors:Ee,scrollableAncestorRects:Tt});const Es=u.useMemo(()=>({active:U,activeNode:ne,activeNodeRect:T,activatorEvent:k,collisions:st,containerNodeRect:rt,dragOverlay:ye,draggableNodes:w,droppableContainers:I,droppableRects:ve,over:Ce,measureDroppableContainers:Ne,scrollableAncestors:Ee,scrollableAncestorRects:Tt,measuringConfiguration:G,measuringScheduled:ot,windowRect:fn}),[U,ne,T,k,st,rt,ye,w,I,ve,Ce,Ne,Ee,Tt,G,ot,fn]),Cs=u.useMemo(()=>({activatorEvent:k,activators:co,active:U,activeNodeRect:T,ariaDescribedById:{draggable:nt},dispatch:y,draggableNodes:w,over:Ce,measureDroppableContainers:Ne}),[k,co,U,T,y,nt,w,Ce,Ne]);return K.createElement(Ur.Provider,{value:S},K.createElement(un.Provider,{value:Cs},K.createElement(ss.Provider,{value:Es},K.createElement(as.Provider,{value:Ss},c)),K.createElement($l,{disabled:i?.restoreFocus===!1})),K.createElement(zc,{...i,hiddenTextDescribedById:nt}));function Ms(){const z=le?.autoScrollEnabled===!1,Q=typeof l=="object"?l.enabled===!1:l===!1,J=_&&!z&&!Q;return typeof l=="object"?{...l,enabled:J}:{enabled:J}}}),Gl=u.createContext(null),Go="button",Wl="Draggable";function Xl(e){let{id:t,data:n,disabled:o=!1,attributes:r}=e;const s=_t(Wl),{activators:a,activatorEvent:i,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:h,over:f}=u.useContext(un),{role:m=Go,roleDescription:g="draggable",tabIndex:v=0}=r??{},b=l?.id===t,y=u.useContext(b?as:Gl),[x,S]=Xt(),[R,M]=Xt(),_=Nl(a,t),E=wt(n);me(()=>(h.set(t,{id:t,key:s,node:x,activatorNode:R,data:E}),()=>{const C=h.get(t);C&&C.key===s&&h.delete(t)}),[h,t]);const w=u.useMemo(()=>({role:m,tabIndex:v,"aria-disabled":o,"aria-pressed":b&&m===Go?!0:void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[o,m,v,b,g,d.draggable]);return{active:l,activatorEvent:i,activeNodeRect:c,attributes:w,isDragging:b,listeners:o?void 0:_,node:x,over:f,setNodeRef:S,setActivatorNodeRef:M,transform:y}}function Yl(){return u.useContext(ss)}const Ql="Droppable",Jl={timeout:25};function eu(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:r}=e;const s=_t(Ql),{active:a,dispatch:i,over:l,measureDroppableContainers:c}=u.useContext(un),d=u.useRef({disabled:n}),h=u.useRef(!1),f=u.useRef(null),m=u.useRef(null),{disabled:g,updateMeasurementsFor:v,timeout:b}={...Jl,...r},y=wt(v??o),x=u.useCallback(()=>{if(!h.current){h.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{c(Array.isArray(y.current)?y.current:[y.current]),m.current=null},b)},[b]),S=ln({callback:x,disabled:g||!a}),R=u.useCallback((w,C)=>{S&&(C&&(S.unobserve(C),h.current=!1),w&&S.observe(w))},[S]),[M,_]=Xt(R),E=wt(t);return u.useEffect(()=>{!S||!M.current||(S.disconnect(),h.current=!1,S.observe(M.current))},[M,S]),u.useEffect(()=>(i({type:j.RegisterDroppable,element:{id:o,key:s,disabled:n,node:M,rect:f,data:E}}),()=>i({type:j.UnregisterDroppable,key:s,id:o})),[o]),u.useEffect(()=>{n!==d.current.disabled&&(i({type:j.SetDroppableDisabled,id:o,key:s,disabled:n}),d.current.disabled=n)},[o,s,n,i]),{active:a,rect:f,isOver:l?.id===o,node:M,over:l,setNodeRef:_}}const Wd=e=>{let{transform:t}=e;return{...t,y:0}},tu=e=>{let{transform:t}=e;return{...t,x:0}};function is(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function nu(e,t){return e.reduce((n,o,r)=>{const s=t.get(o);return s&&(n[r]=s),n},Array(e.length))}function kt(e){return e!==null&&e>=0}function ou(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ru(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Ht={scaleX:1,scaleY:1},Xd=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:s,index:a}=e;const i=(t=n[r])!=null?t:o;if(!i)return null;const l=su(n,a,r);if(a===r){const c=n[s];return c?{x:r<s?c.left+c.width-(i.left+i.width):c.left-i.left,y:0,...Ht}:null}return a>r&&a<=s?{x:-i.width-l,y:0,...Ht}:a<r&&a>=s?{x:i.width+l,y:0,...Ht}:{x:0,y:0,...Ht}};function su(e,t,n){const o=e[t],r=e[t-1],s=e[t+1];return!o||!r&&!s?0:n<t?r?o.left-(r.left+r.width):s.left-(o.left+o.width):s?s.left-(o.left+o.width):o.left-(r.left+r.width)}const cs=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const s=is(t,o,n),a=t[r],i=s[r];return!i||!a?null:{x:i.left-a.left,y:i.top-a.top,scaleX:i.width/a.width,scaleY:i.height/a.height}},Ft={scaleX:1,scaleY:1},au=e=>{var t;let{activeIndex:n,activeNodeRect:o,index:r,rects:s,overIndex:a}=e;const i=(t=s[n])!=null?t:o;if(!i)return null;if(r===n){const c=s[a];return c?{x:0,y:n<a?c.top+c.height-(i.top+i.height):c.top-i.top,...Ft}:null}const l=iu(s,r,n);return r>n&&r<=a?{x:0,y:-i.height-l,...Ft}:r<n&&r>=a?{x:0,y:i.height+l,...Ft}:{x:0,y:0,...Ft}};function iu(e,t,n){const o=e[t],r=e[t-1],s=e[t+1];return o?n<t?r?o.top-(r.top+r.height):s?s.top-(o.top+o.height):0:s?s.top-(o.top+o.height):r?o.top-(r.top+r.height):0:0}const ls="Sortable",us=K.createContext({activeIndex:-1,containerId:ls,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:cs,disabled:{draggable:!1,droppable:!1}});function cu(e){let{children:t,id:n,items:o,strategy:r=cs,disabled:s=!1}=e;const{active:a,dragOverlay:i,droppableRects:l,over:c,measureDroppableContainers:d}=Yl(),h=_t(ls,n),f=i.rect!==null,m=u.useMemo(()=>o.map(_=>typeof _=="object"&&"id"in _?_.id:_),[o]),g=a!=null,v=a?m.indexOf(a.id):-1,b=c?m.indexOf(c.id):-1,y=u.useRef(m),x=!ou(m,y.current),S=b!==-1&&v===-1||x,R=ru(s);me(()=>{x&&g&&d(m)},[x,m,g,d]),u.useEffect(()=>{y.current=m},[m]);const M=u.useMemo(()=>({activeIndex:v,containerId:h,disabled:R,disableTransforms:S,items:m,overIndex:b,useDragOverlay:f,sortedRects:nu(m,l),strategy:r}),[v,h,R.draggable,R.droppable,S,m,b,l,f,r]);return K.createElement(us.Provider,{value:M},t)}const lu=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return is(n,o,r).indexOf(t)},uu=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:s,newIndex:a,previousItems:i,previousContainerId:l,transition:c}=e;return!c||!o||i!==s&&r===a?!1:n?!0:a!==r&&t===l},du={duration:200,easing:"ease"},ds="transform",hu=Rt.Transition.toString({property:ds,duration:0,easing:"linear"}),fu={roleDescription:"sortable"};function pu(e){let{disabled:t,index:n,node:o,rect:r}=e;const[s,a]=u.useState(null),i=u.useRef(n);return me(()=>{if(!t&&n!==i.current&&o.current){const l=r.current;if(l){const c=et(o.current,{ignoreTransform:!0}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&a(d)}}n!==i.current&&(i.current=n)},[t,n,o,r]),u.useEffect(()=>{s&&a(null)},[s]),s}function mu(e){let{animateLayoutChanges:t=uu,attributes:n,disabled:o,data:r,getNewIndex:s=lu,id:a,strategy:i,resizeObserverConfig:l,transition:c=du}=e;const{items:d,containerId:h,activeIndex:f,disabled:m,disableTransforms:g,sortedRects:v,overIndex:b,useDragOverlay:y,strategy:x}=u.useContext(us),S=gu(o,m),R=d.indexOf(a),M=u.useMemo(()=>({sortable:{containerId:h,index:R,items:d},...r}),[h,r,R,d]),_=u.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:E,node:w,isOver:C,setNodeRef:I}=eu({id:a,data:M,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...l}}),{active:P,activatorEvent:L,activeNodeRect:U,attributes:N,setNodeRef:le,listeners:q,isDragging:k,over:Lt,setActivatorNodeRef:ge,transform:nt}=Xl({id:a,data:M,attributes:{...fu,...n},disabled:S.draggable}),At=Ic(I,le),G=!!P,ve=G&&!g&&kt(f)&&kt(b),Ne=!y&&k,ot=Ne&&ve?nt:null,It=ve?ot??(i??x)({rects:v,activeNodeRect:U,activeIndex:f,overIndex:b,index:R}):null,Re=kt(f)&&kt(b)?s({id:a,items:d,activeIndex:f,overIndex:b}):R,be=P?.id,T=u.useRef({activeId:be,items:d,newIndex:Re,containerId:h}),rt=d!==T.current.items,ue=t({active:P,containerId:h,isDragging:k,isSorting:G,id:a,index:R,items:d,newIndex:T.current.newIndex,previousItems:T.current.items,previousContainerId:T.current.containerId,transition:c,wasDragging:T.current.activeId!=null}),Ve=pu({disabled:!ue,index:R,node:w,rect:E});return u.useEffect(()=>{G&&T.current.newIndex!==Re&&(T.current.newIndex=Re),h!==T.current.containerId&&(T.current.containerId=h),d!==T.current.items&&(T.current.items=d)},[G,Re,h,d]),u.useEffect(()=>{if(be===T.current.activeId)return;if(be!=null&&T.current.activeId==null){T.current.activeId=be;return}const Oe=setTimeout(()=>{T.current.activeId=be},50);return()=>clearTimeout(Oe)},[be]),{active:P,activeIndex:f,attributes:N,data:M,rect:E,index:R,newIndex:Re,items:d,isOver:C,isSorting:G,isDragging:k,listeners:q,node:w,overIndex:b,over:Lt,setNodeRef:At,setActivatorNodeRef:ge,setDroppableNodeRef:I,setDraggableNodeRef:le,transform:Ve??It,transition:ye()};function ye(){if(Ve||rt&&T.current.newIndex===R)return hu;if(!(Ne&&!Xn(L)||!c)&&(G||ue))return Rt.Transition.toString({...c,property:ds})}}function gu(e,t){var n,o;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(o=e?.droppable)!=null?o:t.droppable}}function Jt(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const vu=[A.Down,A.Right,A.Up,A.Left],bu=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:s,over:a,scrollableAncestors:i}}=t;if(vu.includes(e.code)){if(e.preventDefault(),!n||!o)return;const l=[];s.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const f=r.get(h.id);if(f)switch(e.code){case A.Down:o.top<f.top&&l.push(h);break;case A.Up:o.top>f.top&&l.push(h);break;case A.Left:o.left>f.left&&l.push(h);break;case A.Right:o.left<f.left&&l.push(h);break}});const c=Gc({collisionRect:o,droppableRects:r,droppableContainers:l});let d=Gr(c,"id");if(d===a?.id&&c.length>1&&(d=c[1].id),d!=null){const h=s.get(n.id),f=s.get(d),m=f?r.get(f.id):null,g=f?.node.current;if(g&&m&&h&&f){const b=cn(g).some((_,E)=>i[E]!==_),y=hs(h,f),x=yu(h,f),S=b||!y?{x:0,y:0}:{x:x?o.width-m.width:0,y:x?o.height-m.height:0},R={x:m.left,y:m.top};return S.x&&S.y?R:St(R,S)}}}};function hs(e,t){return!Jt(e)||!Jt(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function yu(e,t){return!Jt(e)||!Jt(t)||!hs(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const xu=e=>{const{data:t}=ir({queryKey:We.notes.pinned(),async queryFn(){const n=await en(`
19
+ query FetchPinnedNotes {
20
+ pinnedNotes {
21
+ id
22
+ title
23
+ order
24
+ }
25
+ }
26
+ `);if(n.type==="error")throw n;return n.pinnedNotes}});return p.jsx(p.Fragment,{children:e.render(t)})},wu="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",Su="focus-ring-soft block truncate rounded-[10px] px-1.5 py-1 outline-none transition-colors",Ru=(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 Eu({id:e,title:t,isActive:n=!1,children:o}){const{attributes:r,listeners:s,setNodeRef:a,setActivatorNodeRef:i,transform:l,transition:c,isDragging:d}=mu({id:e}),h={transform:Rt.Transform.toString(l),transition:c,opacity:d?.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(wu,d?"cursor-grabbing":"cursor-grab"),children:p.jsx(tc,{className:"size-4"})}),p.jsx(X,{as:"div",truncate:!0,variant:"meta",weight:"medium",className:"min-w-0 flex-1",children:o})]})}function Cu({notes:e,pathname:t,pinnedItems:n,setPinnedItems:o,handleDragEnd:r,sensors:s}){u.useEffect(()=>{o(e)},[e,o]);const a=n.length>0?n:e;return a.length===0?null:p.jsx(ql,{sensors:s,collisionDetection:qc,onDragEnd:r,modifiers:[tu],children:p.jsx(cu,{items:a.map(i=>i.id),strategy:au,children:a.map(i=>p.jsx(Eu,{id:i.id,title:i.title||"Untitled",isActive:t===`/${i.id}`,children:p.jsx(xt,{"aria-current":t===`/${i.id}`?"page":void 0,className:ie(Su,t===`/${i.id}`?"text-fg-default":"text-fg-secondary hover:text-fg-default"),to:tn,params:{id:i.id},children:i.title||"Untitled"})},i.id))})})}const Mu=()=>{const e=sn({select:i=>i.pathname}),t=kn(),[n,o]=u.useState([]),r=Ds({mutationFn:va,onSuccess:()=>{t.invalidateQueries({queryKey:We.notes.pinned(),exact:!0})}}),s=Uc(Vo(eo,{activationConstraint:{distance:8}}),Vo(Qn,{coordinateGetter:bu})),a=i=>{const{active:l,over:c}=i;c&&l.id!==c.id&&o(d=>{const h=Ru(d,String(l.id),String(c.id));return h?(r.mutate(h.orders),h.nextItems):d})};return p.jsx("div",{className:"border-l border-border-subtle/70 pl-1.5",children:p.jsx(cr,{fallback:p.jsxs("div",{className:"space-y-1",children:[p.jsx(Ue,{height:"40px",opacity:.4}),p.jsx(Ue,{height:"40px",opacity:.4})]}),errorTitle:"Failed to load pinned notes",errorDescription:"Retry loading the pinned note list.",renderError:({error:i,retry:l})=>p.jsx(ga,{title:"Failed to load pinned notes",description:"Retry loading the pinned note list.",error:i,onRetry:l,showBackAction:!1,showHomeAction:!1}),children:p.jsx(xu,{render:i=>i.length>0?p.jsx(Cu,{notes:i,pathname:e,pinnedItems:n,setPinnedItems:o,handleDragEnd:a,sensors:s}):p.jsx(X,{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."})})})})},Pu=()=>p.jsx("section",{className:"p-3 pt-0","aria-label":"Pinned notes",children:p.jsx(Mu,{})}),_u="p-3 pb-0",Lu="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",Au="flex items-center gap-2.5",Iu="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-cta text-fg-on-filled",Tu="flex flex-col",Nu="h-4 w-4 text-fg-tertiary transition-colors group-hover:text-fg-default",Du=()=>{const{onCreate:e}=tr();return p.jsx("div",{className:_u,children:p.jsxs("button",{type:"button",className:Lu,onClick:()=>e(),children:[p.jsxs("span",{className:Au,children:[p.jsx("span",{className:Iu,children:p.jsx(nc,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:Tu,children:[p.jsx(X,{variant:"meta",weight:"semibold",tracking:"tight",children:"Capture"}),p.jsx(X,{variant:"label",tone:"secondary",children:"Open a new note"})]})]}),p.jsx(lr,{className:Nu,weight:"bold"})]})})},ju=async()=>{const{data:e}=await ae.get("/api/search-admin/status");return e},Yd=async e=>{const{data:t}=await ae.post("/api/search-admin/config",e);return t},Qd=async e=>{const{data:t}=await ae.post("/api/search-admin/models",e);return t},Jd=async e=>{const{data:t}=await ae.post("/api/search-admin/test",e);return t},eh=async()=>{const{data:e}=await ae.post("/api/search-admin/reindex");return e},Vu=()=>{const e=er({queryKey:We.search.adminStatus(),queryFn:ju,staleTime:6e4,retry:1});return{status:e.data,isLoading:e.isPending,isSemanticSearchEnabled:e.data?.config.enabled===!0,isSemanticSearchAvailable:e.data?.available===!0}},Ou={hybrid:"HYBRID",lexical:"LEXICAL",semantic:"SEMANTIC"};function ku({query:e,limit:t=25,offset:n=0,mode:o="hybrid"}){return en(`query FetchSearchNotes($query: String!, $pagination: PaginationInput!, $mode: SearchMode!) {
27
+ searchNotes(query: $query, pagination: $pagination, mode: $mode) {
28
+ totalCount
29
+ semanticAvailable
30
+ semanticUsed
31
+ semanticError
32
+ matches {
33
+ noteId
34
+ lexical
35
+ semantic
36
+ }
37
+ notes {
38
+ id
39
+ title
40
+ content
41
+ pinned
42
+ tags {
43
+ id
44
+ name
45
+ }
46
+ createdAt
47
+ updatedAt
48
+ }
49
+ }
50
+ }`,{query:e,mode:Ou[o],pagination:{limit:t,offset:n}})}const Hu=e=>{const[t,n]=u.useState(!1),o=u.useRef(null),r=u.useRef(!0),s=u.useRef(0),a=u.useCallback(()=>{o.current!==null&&(clearTimeout(o.current),o.current=null)},[]);u.useEffect(()=>(r.current=!0,()=>{r.current=!1,a()}),[a]);const i=u.useCallback(l=>{s.current+=1;const c=s.current;a(),r.current&&n(!0),o.current=setTimeout(()=>{o.current=null,Promise.resolve().then(l).catch(()=>{}).finally(()=>{r.current&&s.current===c&&n(!1)})},e)},[a,e]);return[t,i]},Fu="flex flex-col gap-2.5",Bu="overflow-hidden rounded-[14px] border border-border-subtle bg-elevated transition-colors focus-within:border-border-focus focus-within:shadow-[0_0_0_4px_color-mix(in_srgb,var(--accent-soft-primary)_90%,transparent)]",Zu="grid-search-bar grid items-center border-b border-transparent px-2.5 py-1.5 transition-colors",$u="border-border-subtle/70",Wo="flex h-10 items-center justify-center text-fg-tertiary transition-colors hover:text-fg-default sm:h-8",zu="h-10 w-full bg-transparent py-2 text-meta text-fg-default outline-none placeholder:text-fg-placeholder sm:h-8 sm:py-1.5",Uu="max-h-[min(48vh,320px)] overflow-y-auto px-1 py-1.5",Xo="focus-ring-soft flex min-h-10 items-center gap-2 rounded-[10px] px-2.5 py-2 outline-none transition-colors hover:bg-hover-subtle sm:min-h-0 sm:px-2 sm:py-1.5",Ku="mt-1 border-t border-border-subtle/50 px-2 pb-0.5 pt-1.5",qu="focus-ring-soft flex min-h-9 items-center gap-1.5 rounded-[10px] text-fg-secondary outline-none transition-colors hover:text-fg-default",Gu=400,Wu=({fullSearchMode:e="lexical",meaningSearchEnabled:t=!1})=>{const n=or(),[o,r]=u.useState(""),[s,a]=u.useState(null),[i,l]=u.useState(!1),[c,d]=u.useState(!1),h=u.useRef(0),[,f]=Hu(Gu);u.useEffect(()=>{const y=o.trim();if(!y){h.current+=1,f(()=>{}),a(null),l(!1),d(!1);return}const x=h.current+1;h.current=x,a(null),l(!0),d(!1),f(()=>{ku({query:y,limit:5,mode:e}).then(S=>{h.current===x&&(S.type==="success"?a({notes:S.searchNotes.notes}):(a({notes:[]}),d(!0)),l(!1))},()=>{h.current===x&&(a({notes:[]}),l(!1),d(!0))})})},[e,o,f]);const m=y=>{y?.preventDefault();const x=o.trim();x&&n({to:ur,search:{query:x,page:1,mode:e}})},g=o.trim().length>0,v=(s?.notes.length??0)>0,b=g&&!i&&s!==null&&!v;return p.jsx("form",{className:Fu,onSubmit:m,children:p.jsxs("div",{className:Bu,children:[p.jsxs("div",{className:`${Zu} ${v?$u:""}`,children:[p.jsx("button",{type:"submit","aria-label":"Search notes",className:Wo,children:p.jsx(Va,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsx("input",{type:"text","aria-label":"Quick search notes",placeholder:t?"Search or describe a memory":"Search notes",value:o,onChange:y=>r(y.target.value),className:zu}),o&&p.jsx("button",{type:"button","aria-label":"Clear search",className:Wo,onClick:()=>r(""),children:p.jsx(ar,{className:"h-4 w-4",weight:"bold"})})]}),g&&p.jsxs("div",{className:Uu,children:[i&&p.jsx("div",{children:[.34,.3,.26,.22,.18].map(y=>p.jsxs("div",{className:Xo,"aria-hidden":"true",children:[p.jsx(Io,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary opacity-50"}),p.jsx(Ue,{height:"21px",opacity:y,className:"min-w-0 flex-1"})]},y))}),b&&p.jsx(X,{as:"div",variant:"meta",tone:"secondary",className:"px-2 py-2",children:c?"Search could not refresh. Try again.":t?"No matching notes. Try another way to describe it.":"No quick matches."}),s&&v&&p.jsx("div",{children:s.notes.map(({id:y,title:x})=>p.jsxs(xt,{to:tn,params:{id:y},className:Xo,children:[p.jsx(Io,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary"}),p.jsx(X,{as:"span",truncate:!0,variant:"meta",weight:"medium",className:"min-w-0 flex-1",children:x||"Untitled"})]},y))}),p.jsx("div",{className:Ku,children:p.jsxs("button",{type:"submit",className:qu,children:[p.jsx(X,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:t?"Search all notes":"View all results"}),p.jsx(lr,{className:"h-3.5 w-3.5",weight:"bold"})]})})]})]})})},Xu=()=>{const{isLoading:e,isSemanticSearchAvailable:t}=Vu(),n=!e&&t?"hybrid":"lexical";return p.jsx("div",{className:"p-3",children:p.jsx(Wu,{fullSearchMode:n,meaningSearchEnabled:!e&&t})})},Yu=[{name:"Notes",path:nn,icon:Or},{name:"Views",path:dr,icon:js},{name:"Graph",path:hr,icon:Oa},{name:"Calendar",path:fr,icon:ec},{name:"Reminders",path:pr,icon:Vs},{name:"Tags",path:mr,icon:Os},{name:"Setting",path:gr,icon:ks}],Qu=()=>{const e=sn({select:t=>t.pathname});return p.jsx("nav",{"aria-label":"Primary navigation",className:"flex items-center gap-1 px-4 py-2.5",children:Yu.map((t,n)=>{const o=e===t.path||t.path!==nn&&e.startsWith(`${t.path}/`);return p.jsxs(u.Fragment,{children:[n>0&&p.jsx("span",{className:"h-3.5 w-px shrink-0 bg-border-subtle"}),p.jsx(xt,{to:t.path,children:p.jsxs("div",{className:`flex min-w-26 items-center justify-center gap-2 border-b px-2 py-2 transition-colors ${o?"border-fg-muted text-fg-default":"border-transparent text-fg-secondary hover:border-border-subtle hover:text-fg-default"}`,children:[p.jsx(t.icon,{className:"size-5",weight:o?"fill":"regular"}),p.jsx(X,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:t.name})]})})]},t.path)})})},Ju=({children:e})=>p.jsx(Pc,{sidebar:p.jsxs(p.Fragment,{children:[p.jsx(Ac,{}),p.jsx(Du,{}),p.jsx(Xu,{}),p.jsx(Pu,{}),p.jsx(vc,{})]}),topNavigation:p.jsx(Qu,{}),children:e}),fs=100,ps=[50,fs,200];function th(e){return ps.includes(e)}const ed=["updatedAt","createdAt"],td=["referenceCount","name"],ms=["asc","desc"],nd=["create","update"],od=["hybrid","lexical","semantic"],dn=e=>Array.isArray(e)?e[0]:e,Te=(e,t,{min:n=1,max:o=Number.MAX_SAFE_INTEGER}={})=>{const r=dn(e),s=typeof r=="number"?r:typeof r=="string"?Number(r):Number.NaN;return!Number.isInteger(s)||s<n||s>o?t:s},gs=(e,t,n)=>{const o=Te(e,Number.NaN);return t.includes(o)?o:n},rd=(e,t=!1)=>{const n=dn(e);return n===!0||n==="true"?!0:n===!1||n==="false"?!1:t},hn=(e,t="")=>{const n=dn(e);return typeof n=="string"?n:t},Xe=(e,t,n)=>{const o=dn(e);return typeof o!="string"?n:t.includes(o)?o:n},sd=e=>({page:Te(e.page,1),limit:gs(e.limit,rr,sr),sortBy:Xe(e.sortBy,ed,"updatedAt"),sortOrder:Xe(e.sortOrder,ms,"desc"),pinnedFirst:rd(e.pinnedFirst,!1)}),tt=e=>({page:Te(e.page,1)}),ad=e=>({page:Te(e.page,1),query:hn(e.query,""),mode:Xe(e.mode,od,"hybrid")}),id=e=>({page:Te(e.page,1),query:hn(e.query,""),limit:gs(e.limit,ps,fs),sortBy:Xe(e.sortBy,td,"referenceCount"),sortOrder:Xe(e.sortOrder,ms,"desc")}),cd=e=>({year:Te(e.year,lo().year(),{min:1970,max:9999}),month:Te(e.month,lo().month()+1,{min:1,max:12}),type:Xe(e.type,nd,"create")}),ld=e=>{const t=hn(e.selected,"").trim();return t?{selected:t}:{}},ud=e=>({page:Te(e.page,1),sectionId:hn(e.sectionId,"")}),dd=e=>{const{data:t}=ir({queryKey:We.notes.list(e.searchParams),async queryFn(){const n=await ba(e.searchParams);if(n.type==="error")throw n;return n.allNotes}});return e.render(t)};function hd({id:e,title:t,tags:n,pinned:o,updatedAt:r,onPinned:s,onDelete:a}){const i=Hs(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(Fs,{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(X,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Updated ",i]})}),p.jsx(ya,{button:p.jsx(Bs,{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(X,{as:"div",variant:"body",weight:"semibold",tracking:"tight",className:"leading-[1.45]",children:p.jsx(xt,{className:"line-clamp-2 transition-colors hover:text-fg-default/85",to:tn,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(xt,{to:vr,params:{id:l.id},search:{page:1},children:p.jsx(X,{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 Yo=xa(nn);function fd(){const e=Yo.useNavigate(),{limit:t,page:n,sortBy:o,sortOrder:r,pinnedFirst:s}=Yo.useSearch(),{onDelete:a,onPinned:i,deleteWarningDialog:l}=tr(),c=d=>{e({search:h=>({...h,...d})})};return p.jsxs(wa,{title:"",variant:"none",children:[p.jsxs("div",{className:"flex flex-col gap-5",children:[p.jsx(pc,{itemsPerPage:t,onItemsPerPageChange:d=>c({limit:d,page:1}),sortBy:o,onSortByChange:d=>c({sortBy:d,page:1}),sortOrder:r,onSortOrderChange:d=>c({sortOrder:d,page:1}),pinnedFirst:s,onPinnedFirstChange:d=>c({pinnedFirst:d,page:1})}),p.jsx(cr,{fallback:p.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[p.jsx(Ue,{height:"112px"}),p.jsx(Ue,{height:"112px"}),p.jsx(Ue,{height:"112px"})]}),errorTitle:"Failed to load notes",errorDescription:"Retry loading the current note list.",resetKeys:[n,t,o,r,s],children:p.jsx(dd,{searchParams:{offset:(n-1)*t,limit:t,sortBy:o,sortOrder:r,pinnedFirst:s},render:({notes:d,totalCount:h})=>p.jsx(Do,{fallback:p.jsx(Ra,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:d.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"grid-auto-cards grid gap-5",children:d.map(f=>p.jsx(hd,{...f,onPinned:()=>i(f.id,f.pinned),onDelete:()=>a(f.id)},f.id))}),p.jsx(Do,{fallback:null,children:h&&t<h&&p.jsx(Sa,{page:n,last:Math.ceil(h/t),onChange:f=>{c({page:f})}})})]})})})})]}),l]})}const O=Ea({component:()=>p.jsx(Ju,{children:p.jsx(Tr,{})}),errorComponent:Ma,notFoundComponent:Ca}),pd=V({getParentRoute:()=>O,path:nn,component:fd,validateSearch:sd}),md=V({getParentRoute:()=>O,path:fr,component:$(()=>Z(()=>import("./Calendar-BsNs3NzO.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),pendingComponent:()=>p.jsx(F,{title:"Loading calendar",description:"Preparing note and reminder snapshots."}),validateSearch:cd}),gd=V({getParentRoute:()=>O,path:dr,component:$(()=>Z(()=>import("./Views-C7V3saUo.js"),__vite__mapDeps([8,1,4,2,3,9,10,11,12,13,6,7]))),pendingComponent:()=>p.jsx(F,{title:"Loading views",description:"Preparing your saved dashboards."})}),vd=V({getParentRoute:()=>O,path:pr,component:$(()=>Z(()=>import("./Reminders-BOtfNeYD.js"),__vite__mapDeps([14,1,2,3,15,4]))),pendingComponent:()=>p.jsx(F,{title:"Loading reminders",description:"Collecting upcoming reminder cards."}),validateSearch:tt}),bd=V({getParentRoute:()=>O,path:hr,component:$(()=>Z(()=>import("./Graph-yPE3ljW0.js"),__vite__mapDeps([16,1,2,3,17,18,19,20,21,22,23,7,12]))),pendingComponent:()=>p.jsx(F,{title:"Loading graph",description:"Preparing the linked note constellation."}),validateSearch:ld}),yd=V({getParentRoute:()=>O,path:ur,component:$(()=>Z(()=>import("./Search-C-FB3pKf.js"),__vite__mapDeps([24,1,2,3,7,4,6]))),pendingComponent:()=>p.jsx(F,{title:"Loading search",description:"Preparing indexed note results."}),validateSearch:ad}),xd=V({getParentRoute:()=>O,path:mr,component:$(()=>Z(()=>import("./Tag-lBxDRE77.js"),__vite__mapDeps([25,1,2,3,9,7,4,6]))),pendingComponent:()=>p.jsx(F,{title:"Loading tags",description:"Preparing the tag catalog."}),validateSearch:id}),wd=V({getParentRoute:()=>O,path:tn,component:$(()=>Z(()=>import("./Note-CmreVzvQ.js"),__vite__mapDeps([26,1,2,3,4,5,27,13,11,15,28,29,30,6,31,32,33,34,9]))),pendingComponent:()=>p.jsx(F,{title:"Loading note",description:"Preparing the editor and note content."})}),Sd=V({getParentRoute:()=>O,path:vr,component:$(()=>Z(()=>import("./TagNotes-Bgorp_rC.js"),__vite__mapDeps([35,1,2,3,27,4,13,6,7]))),pendingComponent:()=>p.jsx(F,{title:"Loading tagged notes",description:"Preparing notes for the selected tag."}),validateSearch:tt}),Rd=V({getParentRoute:()=>O,path:_a,component:$(()=>Z(()=>import("./ViewNotes-C7d10VFf.js"),__vite__mapDeps([36,1,4,2,3,9,10,27,13,34,6,7]))),pendingComponent:()=>p.jsx(F,{title:"Loading view notes",description:"Preparing notes for this saved view section."}),validateSearch:ud}),Ed=V({getParentRoute:()=>O,path:gr,component:$(()=>Z(()=>import("./index-CaF9d-zG.js"),__vite__mapDeps([37,1,4,2,3,38,39,40,7,6]))),pendingComponent:()=>p.jsx(F,{title:"Loading settings",description:"Preparing workspace preferences."})}),Cd=V({getParentRoute:()=>O,path:Aa,component:$(()=>Z(()=>import("./mcp-uFZkdhCi.js"),__vite__mapDeps([41,1,4,2,3,38,33]))),pendingComponent:()=>p.jsx(F,{title:"Loading MCP settings",description:"Preparing MCP access controls."})}),Md=V({getParentRoute:()=>O,path:La,component:$(()=>Z(()=>import("./search-DFnzZKLd.js"),__vite__mapDeps([42,1,4,2,3,7,6]))),pendingComponent:()=>p.jsx(F,{title:"Loading search settings",description:"Preparing semantic search controls."})}),Pd=V({getParentRoute:()=>O,path:Ia,component:$(()=>Z(()=>import("./trash-CClKfP1x.js"),__vite__mapDeps([43,1,4,2,3,11,27,13]))),pendingComponent:()=>p.jsx(F,{title:"Loading trash",description:"Preparing deleted notes for restore."}),validateSearch:tt}),_d=V({getParentRoute:()=>O,path:Ta,component:$(()=>Z(()=>import("./manage-image-DCDF8AM9.js"),__vite__mapDeps([44,1,2,3,4,32,45,11,40]))),pendingComponent:()=>p.jsx(F,{title:"Loading image manager",description:"Preparing uploaded image metadata."}),validateSearch:tt}),Ld=V({getParentRoute:()=>O,path:Na,component:$(()=>Z(()=>import("./manage-image-detail-e0ViRAj-.js"),__vite__mapDeps([46,1,2,3,4,32,45,11,27,13,40,39,6,7]))),pendingComponent:()=>p.jsx(F,{title:"Loading image detail",description:"Preparing references for the selected image."})}),Ad=V({getParentRoute:()=>O,path:ja,component:$(()=>Z(()=>import("./properties-M-yWq1D7.js"),__vite__mapDeps([47,1,4,2,3]))),pendingComponent:()=>p.jsx(F,{title:"Loading properties",description:"Preparing shared property definitions."}),validateSearch:tt}),Id=V({getParentRoute:()=>O,path:Da,component:$(()=>Z(()=>import("./placeholder-D3b8lZGE.js"),__vite__mapDeps([48,1,4,2,3,11,13,6,7]))),pendingComponent:()=>p.jsx(F,{title:"Loading placeholders",description:"Preparing template replacement rules."}),validateSearch:tt}),Td=O.addChildren([pd,gd,md,vd,bd,yd,xd,wd,Sd,Rd,Ed,Md,Cd,Pd,_d,Ld,Id,Ad]),Nd=zi({routeTree:Td,defaultPreload:"intent",defaultPendingComponent:()=>p.jsx(F,{title:"Loading page",description:"Preparing the next route."})});function Dd(){const e=Mn(n=>n.setSystemTheme),t=Mn(n=>n.setTheme);return u.useEffect(()=>{const n=go();return n&&t(n),Fa.listenThemeChange(o=>{go()||e(o?"dark":"light")},n==null)},[e,t]),p.jsx(fc,{children:p.jsx(qi,{router:Nd})})}const vs="__oceanBrainCsrfRetry";let Cn;const jd=e=>!ae.isAxiosError(e)||e.response?.status!==403?!1:e.response.data?.code==="CSRF_TOKEN_INVALID",bs=e=>{if(!jd(e)||!ae.isAxiosError(e))return!1;const t=e.config;return!!(t&&!t[vs])},Vd=()=>(Cn??=Wt().finally(()=>{Cn=void 0}),Cn),Qo=(e,t)=>{if(!e)return;const n=e;if(typeof n.delete=="function"){n.delete(t);return}delete e[t]},Od=e=>{Qo(e.headers,"X-XSRF-TOKEN"),Qo(e.headers,"x-xsrf-token")},kd=async e=>{if(!bs(e)||!ae.isAxiosError(e))return Promise.reject(e);const t=e.config;return t[vs]=!0,await Vd()!=="active"?Promise.reject(e):(Od(t),ae.request(t))};let Jo;const Hd=()=>{Jo===void 0&&(Jo=ae.interceptors.response.use(e=>e,e=>{if(ac(e))Fr();else if(bs(e))return kd(e);return Promise.reject(e)}))};Mn.setState({theme:Pa()});Hd();Wt();Zs.createRoot(document.getElementById("root")).render(p.jsx(K.StrictMode,{children:p.jsx(Dd,{})}));export{Rt as C,ql as D,Do as F,Qn as K,bl as M,hd as N,eo as P,cu as S,ps as T,fs as a,oc as b,Yd as c,Qd as d,eh as e,ju as f,Lc as g,Vu as h,th as i,ku as j,Uc as k,Vo as l,bu as m,qc as n,Xd as o,mu as p,tu as q,Wd as r,Or as s,Jd as t,Hu as u,au as v,tc as w,Io as x,ec as y,nc as z};