ocean-brain 0.13.3 → 0.15.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 (177) hide show
  1. package/README.md +66 -2
  2. package/dist/mcp.js +439 -480
  3. package/package.json +3 -2
  4. package/server/client/dist/assets/ArrowClockwise.es-BwtKWcmj.js +1 -0
  5. package/server/client/dist/assets/{ArrowRight.es-BlNsZQFs.js → ArrowRight.es-E09Lfefr.js} +1 -1
  6. package/server/client/dist/assets/{AuxiliaryPanelHeader-HAttwVby.js → AuxiliaryPanelHeader-Bys98BJJ.js} +1 -1
  7. package/server/client/dist/assets/Calendar-BOhJYi8K.js +25 -0
  8. package/server/client/dist/assets/Callout-CAH1ua9B.js +1 -0
  9. package/server/client/dist/assets/{CaretUp.es-C8iY5OlB.js → CaretUp.es-DSWjIa-J.js} +1 -1
  10. package/server/client/dist/assets/{CheckCircle.es-Dqr3WImn.js → CheckCircle.es-Cou6rItm.js} +1 -1
  11. package/server/client/dist/assets/{Copy.es-fMv0ETir.js → Copy.es-ftEldGIL.js} +1 -1
  12. package/server/client/dist/assets/{File.es-CHtXXafR.js → File.es-DlKAX1uO.js} +1 -1
  13. package/server/client/dist/assets/{FileText.es-DPIwDCEe.js → FileText.es-D6JM_MqM.js} +1 -1
  14. package/server/client/dist/assets/{FlowArrow.es-Dxee98ir.js → FlowArrow.es-BRWXqf9A.js} +1 -1
  15. package/server/client/dist/assets/{Graph-hVj6vAYJ.js → Graph-BaqGi3M7.js} +1 -1
  16. package/server/client/dist/assets/{Graph-CdEu8eAn.js → Graph-L-d0cdMk.js} +1 -1
  17. package/server/client/dist/assets/{Image.es-CjXY1JVf.js → Image.es-Bh2mTNtr.js} +1 -1
  18. package/server/client/dist/assets/{Info.es-CYxg-Vku.js → Info.es-Bwz4CSvS.js} +1 -1
  19. package/server/client/dist/assets/Integration-C-rva2X9.js +1 -0
  20. package/server/client/dist/assets/{LinkSimple.es-B-P-7Iem.js → LinkSimple.es-iJvLf-MB.js} +1 -1
  21. package/server/client/dist/assets/Note-OO_uh2a7.js +19 -0
  22. package/server/client/dist/assets/{NotePropertiesPanel-6P7UfRBR.js → NotePropertiesPanel-BFWjxL_w.js} +1 -1
  23. package/server/client/dist/assets/{Plus.es-Dy6onD-Z.js → Plus.es-Dmb3oijD.js} +1 -1
  24. package/server/client/dist/assets/{Reminders-DnuALBL6.js → Reminders-CtpFtvu6.js} +1 -1
  25. package/server/client/dist/assets/{Search-AaD1Mt0d.js → Search-t48pkUg-.js} +2 -2
  26. package/server/client/dist/assets/{SurfaceCard-D5QxOte_.js → SurfaceCard-zdJ8k1o0.js} +1 -1
  27. package/server/client/dist/assets/{Tag-B2Qiq1Hv.js → Tag-BL2h3ZaX.js} +1 -1
  28. package/server/client/dist/assets/TagNotes-BpRTCEBf.js +1 -0
  29. package/server/client/dist/assets/Trash.es-DFnO8iF5.js +1 -0
  30. package/server/client/dist/assets/{ViewChip-BVkZAXyx.js → ViewChip-BdPhSEvG.js} +1 -1
  31. package/server/client/dist/assets/{Views-B5oh8GVM.js → Views-BoO6vgnF.js} +1 -1
  32. package/server/client/dist/assets/WarningCircle.es-BAvgGuQK.js +1 -0
  33. package/server/client/dist/assets/{abnfDiagram-N423BO3Z-D44O4T7q.js → abnfDiagram-N423BO3Z-CPgGmCbn.js} +1 -1
  34. package/server/client/dist/assets/app-OGsLwSqJ.js +151 -0
  35. package/server/client/dist/assets/app-yYMsgUrz.css +1 -0
  36. package/server/client/dist/assets/{arc-Cil9fXuW.js → arc-DqTgRpuF.js} +1 -1
  37. package/server/client/dist/assets/{architectureDiagram-T3A2C74G-Cjq6ayF2.js → architectureDiagram-T3A2C74G-rTYMAQ-J.js} +1 -1
  38. package/server/client/dist/assets/{blockDiagram-VBNYF7ZC-B2Xm5N0i.js → blockDiagram-VBNYF7ZC-BOluytVz.js} +1 -1
  39. package/server/client/dist/assets/{c4Diagram-5PPSVZJV-Dp0y-lCR.js → c4Diagram-5PPSVZJV-C8gbPpcb.js} +1 -1
  40. package/server/client/dist/assets/{calendar-data-wB0ifXdo.js → calendar-data-CwVF7Pz3.js} +1 -1
  41. package/server/client/dist/assets/channel--aI9fJWX.js +1 -0
  42. package/server/client/dist/assets/{chunk-2GRJ4B5K-CWaaNkFx.js → chunk-2GRJ4B5K-CRER5Ka0.js} +1 -1
  43. package/server/client/dist/assets/{chunk-2Q5K7J3B-Ces-xz2S.js → chunk-2Q5K7J3B-hxmJWGu_.js} +1 -1
  44. package/server/client/dist/assets/{chunk-5RXB4S5H-B-4Chlfc.js → chunk-5RXB4S5H-Bpr5Us8Y.js} +1 -1
  45. package/server/client/dist/assets/{chunk-5VM5RSS4-C8_HVwuz.js → chunk-5VM5RSS4-CKUz9fAb.js} +1 -1
  46. package/server/client/dist/assets/{chunk-6Q2QTUOP-xZ8ofRqk.js → chunk-6Q2QTUOP-B8XEOHPN.js} +1 -1
  47. package/server/client/dist/assets/{chunk-GF5L2VYU-Bpa43a7s.js → chunk-GF5L2VYU-BBUD-HJi.js} +1 -1
  48. package/server/client/dist/assets/{chunk-JWPE2WC7-DsyTXbuq.js → chunk-JWPE2WC7-Dq6_B8-d.js} +1 -1
  49. package/server/client/dist/assets/{chunk-KBJHAD2P-BDhjm9-8.js → chunk-KBJHAD2P--2VZEwNJ.js} +1 -1
  50. package/server/client/dist/assets/{chunk-RYQCIY6F-Cn-jdp6I.js → chunk-RYQCIY6F-CKCwnKiC.js} +1 -1
  51. package/server/client/dist/assets/{chunk-XXDRQBXY-BKsc_0wh.js → chunk-XXDRQBXY-VDufR1Oi.js} +1 -1
  52. package/server/client/dist/assets/classDiagram-JCYQIIEL-BsbwE38V.js +1 -0
  53. package/server/client/dist/assets/classDiagram-v2-OCEON4UE-BsbwE38V.js +1 -0
  54. package/server/client/dist/assets/{cose-bilkent-JH36ORCC-jmn3Q4zj.js → cose-bilkent-JH36ORCC-D4nqOx8S.js} +1 -1
  55. package/server/client/dist/assets/{cynefinDiagram-MW4NZA55-BpLstuBJ.js → cynefinDiagram-MW4NZA55-CUuLMs-6.js} +1 -1
  56. package/server/client/dist/assets/{dagre-VZM6K2ZE-B5ft5Yzm.js → dagre-VZM6K2ZE-CUSkhZgS.js} +1 -1
  57. package/server/client/dist/assets/{diagram-7IWD3JNH-B_W9IsWZ.js → diagram-7IWD3JNH-D95eVcKx.js} +4 -4
  58. package/server/client/dist/assets/{diagram-B4RE2ZJO-32chS3GX.js → diagram-B4RE2ZJO-7OH_fb0K.js} +1 -1
  59. package/server/client/dist/assets/{diagram-LBJQPF4R-Bqupdb3-.js → diagram-LBJQPF4R-D9UwEIMd.js} +1 -1
  60. package/server/client/dist/assets/{diagram-Q27KOJAE-BD8jKBsv.js → diagram-Q27KOJAE-Dx7WFDuX.js} +1 -1
  61. package/server/client/dist/assets/{diagram-UB23O5K3-C40jAU8D.js → diagram-UB23O5K3-D2BYwAKT.js} +1 -1
  62. package/server/client/dist/assets/{ebnfDiagram-BXEA7PRR-BQfW9mFA.js → ebnfDiagram-BXEA7PRR-DbeA-fk4.js} +1 -1
  63. package/server/client/dist/assets/{erDiagram-JOGREHBK-ILZnLzz2.js → erDiagram-JOGREHBK-jWW-ICGO.js} +1 -1
  64. package/server/client/dist/assets/{flowDiagram-UKHOOZJN-CDmwr2dI.js → flowDiagram-UKHOOZJN-68iZdxxw.js} +1 -1
  65. package/server/client/dist/assets/{ganttDiagram-PKOTCBZU-DBcrUc49.js → ganttDiagram-PKOTCBZU-CxwY3VXg.js} +1 -1
  66. package/server/client/dist/assets/{gitGraphDiagram-DS77QQ5N-_xO6__FK.js → gitGraphDiagram-DS77QQ5N-Ci6o5MfZ.js} +1 -1
  67. package/server/client/dist/assets/{image.api-ChvlfuZg.js → image.api-CHuhmq_G.js} +1 -1
  68. package/server/client/dist/assets/index-CuCzOHJ6.js +1 -0
  69. package/server/client/dist/assets/{infoDiagram-6WML65LV-CuIIcu-L.js → infoDiagram-6WML65LV-DY7aMdjV.js} +1 -1
  70. package/server/client/dist/assets/integrations-B5SIEnG_.js +1 -0
  71. package/server/client/dist/assets/{ishikawaDiagram-WSZJBQD7-BVtRGTOj.js → ishikawaDiagram-WSZJBQD7-Bh5qKh1d.js} +1 -1
  72. package/server/client/dist/assets/{journeyDiagram-NVQOT4AX-D5-Nzb2N.js → journeyDiagram-NVQOT4AX-B_svXTTT.js} +1 -1
  73. package/server/client/dist/assets/{kanban-definition-27J2QSJJ-DmOhgC8H.js → kanban-definition-27J2QSJJ-CaJslHGg.js} +1 -1
  74. package/server/client/dist/assets/manage-image-Kd-7IGfB.js +1 -0
  75. package/server/client/dist/assets/{manage-image-detail-Dw3tAW3h.js → manage-image-detail-HU0QLP-t.js} +1 -1
  76. package/server/client/dist/assets/mcp-BQ418pyx.js +5 -0
  77. package/server/client/dist/assets/{mcp-admin-adapter-D0R8p9az.js → mcp-admin-adapter-CUakQ_Xm.js} +1 -1
  78. package/server/client/dist/assets/{mermaid.core-C2tL9tq7.js → mermaid.core-BfUQM5vF.js} +4 -4
  79. package/server/client/dist/assets/{mindmap-definition-FAOFIHXS-DuvsPqrh.js → mindmap-definition-FAOFIHXS-DGbkJda2.js} +1 -1
  80. package/server/client/dist/assets/{note-core-YhYEmI_R.js → note-core-DRBsBf9H.js} +9 -9
  81. package/server/client/dist/assets/{note-runtime-B3ats-dC.js → note-runtime-ztZvXRIu.js} +16 -16
  82. package/server/client/dist/assets/{note-ui-BtzPk8gA.js → note-ui-CRcP5BjO.js} +1 -1
  83. package/server/client/dist/assets/{pegDiagram-VL7TDLO6-D64crEZV.js → pegDiagram-VL7TDLO6-Bip6zQct.js} +1 -1
  84. package/server/client/dist/assets/{pieDiagram-7S7Q4E2Y--kl7vopC.js → pieDiagram-7S7Q4E2Y-CjfjGY8Y.js} +1 -1
  85. package/server/client/dist/assets/{placeholder-B5uPsE7-.js → placeholder-D7JKnpuh.js} +1 -1
  86. package/server/client/dist/assets/{properties-B7Fv95qY.js → properties-CtagYHMr.js} +1 -1
  87. package/server/client/dist/assets/{quadrantDiagram-CIZ2JOQS-DuvJ4M2y.js → quadrantDiagram-CIZ2JOQS-B6F1yUT-.js} +1 -1
  88. package/server/client/dist/assets/{railroadDiagram-AXF67PYL-BMKmCOY7.js → railroadDiagram-AXF67PYL-D-0fLe0F.js} +1 -1
  89. package/server/client/dist/assets/{requirementDiagram-LRYGKXZP-DY1eJcy0.js → requirementDiagram-LRYGKXZP-tm4mnCyJ.js} +1 -1
  90. package/server/client/dist/assets/route-preload.js +2 -2
  91. package/server/client/dist/assets/{sankeyDiagram-W5VNT64P-C3Ka4GKM.js → sankeyDiagram-W5VNT64P-DSBWFurb.js} +1 -1
  92. package/server/client/dist/assets/search-B5tCkhwj.js +1 -0
  93. package/server/client/dist/assets/{search-admin-adapter-Daf7e2YQ.js → search-admin-adapter-Be9xSY88.js} +1 -1
  94. package/server/client/dist/assets/{sequenceDiagram-SI44F4Z6-Bhpwtk2s.js → sequenceDiagram-SI44F4Z6-KrwjjJIV.js} +1 -1
  95. package/server/client/dist/assets/{sizeCapture-X5ZJPWSS-BFta71TW.js → sizeCapture-X5ZJPWSS-DL2cn_Q6.js} +1 -1
  96. package/server/client/dist/assets/{stateDiagram-OKZ733FA-D6GCn1io.js → stateDiagram-OKZ733FA-CKuNDH85.js} +1 -1
  97. package/server/client/dist/assets/{stateDiagram-v2-UEYNNEHI-g4yinGDn.js → stateDiagram-v2-UEYNNEHI-BFaj2wbM.js} +1 -1
  98. package/server/client/dist/assets/{swimlanes-SLNWSIFB-DLFvOjUl.js → swimlanes-SLNWSIFB-5S17nqhK.js} +2 -2
  99. package/server/client/dist/assets/swimlanesDiagram-ULZ7WXOC-dexsHJq2.js +8 -0
  100. package/server/client/dist/assets/{tag.api-DEUROVKQ.js → tag.api-DGfi8hWL.js} +1 -1
  101. package/server/client/dist/assets/time-Kh6oav5R.js +361 -0
  102. package/server/client/dist/assets/{timeline-definition-Z64GVDOM-DTSIekSM.js → timeline-definition-Z64GVDOM-CU1hp_7d.js} +3 -3
  103. package/server/client/dist/assets/{trash-BHida7BG.js → trash-Di2BWyUO.js} +1 -1
  104. package/server/client/dist/assets/url-Bp8sXMb4.js +1 -0
  105. package/server/client/dist/assets/{useNoteMutate-BjvZUmtX.js → useNoteMutate-BQj6jHhV.js} +3 -3
  106. package/server/client/dist/assets/{useReminderMutate-C5n-5LM-.js → useReminderMutate-jubqwSD9.js} +1 -1
  107. package/server/client/dist/assets/{vennDiagram-T6HMQDX7-CMNqSI2X.js → vennDiagram-T6HMQDX7-MoiVLnil.js} +1 -1
  108. package/server/client/dist/assets/{wardleyDiagram-T6FBY63Y-DV-JOYqB.js → wardleyDiagram-T6FBY63Y-cZkfdI6C.js} +1 -1
  109. package/server/client/dist/assets/{xychartDiagram-ELKLHX3M-BUIniF4m.js → xychartDiagram-ELKLHX3M-B63hxD-r.js} +1 -1
  110. package/server/client/dist/index.html +6 -6
  111. package/server/dist/app.js +11 -1
  112. package/server/dist/features/app-gateway/access.js +73 -0
  113. package/server/dist/features/app-gateway/database.js +20 -0
  114. package/server/dist/features/app-gateway/gateway.js +208 -0
  115. package/server/dist/features/integration/access-events.js +17 -0
  116. package/server/dist/features/integration/auth.js +21 -0
  117. package/server/dist/features/integration/manifest.js +116 -0
  118. package/server/dist/features/integration/note-sync.js +156 -0
  119. package/server/dist/features/integration/schema.js +54 -0
  120. package/server/dist/features/integration/service.js +246 -0
  121. package/server/dist/features/integration/status-report.js +22 -0
  122. package/server/dist/features/mcp-admin/service.js +19 -83
  123. package/server/dist/features/note/graphql/note.field.resolver.js +1 -1
  124. package/server/dist/features/note/graphql/note.mutation.resolver.js +20 -12
  125. package/server/dist/features/note/graphql/note.query.resolver.js +10 -1
  126. package/server/dist/features/note/graphql/note.type-defs.js +13 -1
  127. package/server/dist/features/note/http/authoring.js +493 -0
  128. package/server/dist/features/note/http/mcp.js +15 -463
  129. package/server/dist/features/note/services/authoring.js +17 -1
  130. package/server/dist/features/note/services/change-events.js +26 -0
  131. package/server/dist/features/note/services/markdown-intent-write.js +1 -0
  132. package/server/dist/features/note/services/markdown-read.js +85 -0
  133. package/server/dist/features/note/services/properties.js +36 -30
  134. package/server/dist/features/note/services/search.js +17 -0
  135. package/server/dist/features/search/graphql/resolver.js +10 -1
  136. package/server/dist/features/search/graphql/type-defs.js +3 -0
  137. package/server/dist/features/search/search-manager.js +4 -7
  138. package/server/dist/features/tag/graphql/tag.query.resolver.js +10 -0
  139. package/server/dist/features/tag/graphql/tag.type-defs.js +1 -0
  140. package/server/dist/features/view/graphql/mcp.query.resolver.js +22 -0
  141. package/server/dist/features/view/graphql/view.query.resolver.js +2 -0
  142. package/server/dist/features/view/graphql/view.type-defs.js +27 -0
  143. package/server/dist/features/view/services/mcp-read.js +142 -0
  144. package/server/dist/features/view/services/workspace.js +12 -4
  145. package/server/dist/modules/auth-guard.js +24 -1
  146. package/server/dist/modules/integration-token.js +27 -0
  147. package/server/dist/modules/mcp-auth.js +37 -23
  148. package/server/dist/modules/mcp-token.js +6 -25
  149. package/server/dist/modules/server-events.js +3 -0
  150. package/server/dist/routes/api.js +2 -0
  151. package/server/dist/routes/apps.js +163 -0
  152. package/server/dist/routes/graphql.js +2 -1
  153. package/server/dist/routes/index.js +2 -0
  154. package/server/dist/routes/integrations.js +137 -0
  155. package/server/dist/routes/mcp.js +29 -9
  156. package/server/prisma/migrations/20260917120000_0020_plugin_installations/migration.sql +39 -0
  157. package/server/prisma/migrations/20260917150000_0021_integration_connections/migration.sql +29 -0
  158. package/server/prisma/migrations/20260919090000_0022_integration_proxy_url/migration.sql +2 -0
  159. package/server/prisma/schema.prisma +36 -10
  160. package/server/client/dist/assets/Calendar-DwQBllfw.js +0 -25
  161. package/server/client/dist/assets/Callout-CcYyvHQP.js +0 -1
  162. package/server/client/dist/assets/Note-CpzLtGVM.js +0 -19
  163. package/server/client/dist/assets/TagNotes-B27G1ZVg.js +0 -1
  164. package/server/client/dist/assets/Trash.es-XEcWG_aq.js +0 -1
  165. package/server/client/dist/assets/app-EwvT7bMw.css +0 -1
  166. package/server/client/dist/assets/app-NgiBDISG.js +0 -151
  167. package/server/client/dist/assets/channel-DZFalh-h.js +0 -1
  168. package/server/client/dist/assets/classDiagram-JCYQIIEL-CkEhFvVV.js +0 -1
  169. package/server/client/dist/assets/classDiagram-v2-OCEON4UE-CkEhFvVV.js +0 -1
  170. package/server/client/dist/assets/index-CIEap4bu.js +0 -1
  171. package/server/client/dist/assets/manage-image-CSJ3Flgc.js +0 -1
  172. package/server/client/dist/assets/mcp-D8footel.js +0 -5
  173. package/server/client/dist/assets/search-ddYl3qH-.js +0 -1
  174. package/server/client/dist/assets/swimlanesDiagram-ULZ7WXOC-Ci4mcvmo.js +0 -8
  175. package/server/client/dist/assets/time-PxWila4-.js +0 -361
  176. package/server/client/dist/assets/url-DKUMNVCI.js +0 -1
  177. package/server/dist/features/search/note-change.js +0 -16
@@ -0,0 +1,151 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Calendar-BOhJYi8K.js","assets/floating-ui.react-dom-BWTnA00G.js","assets/time-Kh6oav5R.js","assets/url-Bp8sXMb4.js","assets/useNoteMutate-BQj6jHhV.js","assets/calendar-data-CwVF7Pz3.js","assets/FileText.es-D6JM_MqM.js","assets/Callout-CAH1ua9B.js","assets/WarningCircle.es-BAvgGuQK.js","assets/Info.es-Bwz4CSvS.js","assets/preload-helper-BXl3LOEh.js","assets/Graph-BaqGi3M7.js","assets/Views-BoO6vgnF.js","assets/tag.api-DGfi8hWL.js","assets/SurfaceCard-zdJ8k1o0.js","assets/ViewChip-BdPhSEvG.js","assets/ArrowRight.es-E09Lfefr.js","assets/CheckCircle.es-Cou6rItm.js","assets/Plus.es-Dmb3oijD.js","assets/Reminders-CtpFtvu6.js","assets/useReminderMutate-jubqwSD9.js","assets/Graph-L-d0cdMk.js","assets/transform-BUB79_za.js","assets/isObject-U9U2HXiq.js","assets/toNumber-DE3J3kMD.js","assets/ordinal-Cboi1Yqb.js","assets/init-Gi6I4Gst.js","assets/colors-Cc3OSVma.js","assets/min-tv6RD-6E.js","assets/FlowArrow.es-BRWXqf9A.js","assets/CaretUp.es-DSWjIa-J.js","assets/LinkSimple.es-iJvLf-MB.js","assets/Search-t48pkUg-.js","assets/AuxiliaryPanelHeader-Bys98BJJ.js","assets/search-admin-adapter-Be9xSY88.js","assets/File.es-DlKAX1uO.js","assets/Tag-BL2h3ZaX.js","assets/Note-OO_uh2a7.js","assets/NotePropertiesPanel-BFWjxL_w.js","assets/note-ui-CRcP5BjO.js","assets/note-core-DRBsBf9H.js","assets/note-runtime-ztZvXRIu.js","assets/note-ui-DL8owV-U.css","assets/image.api-CHuhmq_G.js","assets/Copy.es-ftEldGIL.js","assets/TagNotes-BpRTCEBf.js","assets/index-CuCzOHJ6.js","assets/mcp-admin-adapter-CUakQ_Xm.js","assets/Image.es-Bh2mTNtr.js","assets/Trash.es-DFnO8iF5.js","assets/integrations-B5SIEnG_.js","assets/ArrowClockwise.es-BwtKWcmj.js","assets/Integration-C-rva2X9.js","assets/mcp-BQ418pyx.js","assets/search-B5tCkhwj.js","assets/trash-Di2BWyUO.js","assets/manage-image-Kd-7IGfB.js","assets/image-delete-confirmation-D7xrODQV.js","assets/manage-image-detail-HU0QLP-t.js","assets/properties-CtagYHMr.js","assets/placeholder-D7JKnpuh.js"])))=>i.map(i=>d[i]);
2
+ import{j as p,r as d,b as G,a as mt}from"./floating-ui.react-dom-BWTnA00G.js";import{q as js,t as ks,v as Fs,w as Hs,x as Bs,l as $s,u as Zs,a as dr,b as zs,e as ur,o as Us,s as Ks,j as Gs,n as Ws,d as wo,m as qs,h as Xs,R as Ys}from"./useNoteMutate-BQj6jHhV.js";import{aG as Ue,aH as St,aI as te,aJ as X,aK as Rt,aL as qe,aM as hr,aN as Qs,aO as Js,aP as ea,aQ as ta,aR as na,aS as oa,aT as ra,aU as Ke,aV as So,aW as sa,aX as bn,aY as aa,aZ as Ro,a_ as ce,a$ as Eo,b0 as ht,b1 as ia,b2 as ca,b3 as Lt,b4 as la,b5 as O,b6 as Co,X as da,W as ua,b7 as ha,b8 as fa,av as Ce,Y as $n,b9 as pa,ba as _o,bb as le,bc as yn,bd as Ht,be as Zn,bf as ma,bg as ga,C as Qe,f as ae,u as zn,bh as va,bi as ba,bj as ya,bk as xa,T as ne,h as xn,bl as fr,i as ft,bm as pr,bn as wa,L as Sa,K as Ra,g as Z,c as ie,G as Ea,q as Xe,e as Ca,l as mr,Q as gr,aF as _a,o as gt,F as Et,bo as Aa,J as Pa,aB as La,O as Ma,N as Ia,k as Ta,P as Na,n as Da,E as Oa,bp as Va,bq as ja,br as ka,bs as z,bt as Fa,a4 as Pn,bu as Ao,bv as Ha}from"./time-Kh6oav5R.js";import{_ as H}from"./preload-helper-BXl3LOEh.js";import{g as Mt,N as Un,I as Kn,H as an,V as Gn,G as vr,C as br,R as yr,f as xr,j as wr,T as Sr,k as Ba,h as $a,i as Za,S as za,a as Ua,d as Ka,c as Ga,e as Wa,b as qa}from"./url-Bp8sXMb4.js";import{f as Rr,G as Xa}from"./Graph-BaqGi3M7.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 Wn={DARK:"(prefers-color-scheme: dark)",LIGHT:"(prefers-color-scheme: light)",RETINA:"(min-resolution: 2dppx)",RESPONSIVE:e=>`screen and (max-width: ${e})`},Er=e=>typeof window<"u"&&window.matchMedia?window.matchMedia(e):null,qn=(e,t,n=!0)=>{const o=Er(e);n&&t(o?.matches||!1);const r=s=>{t?.(s.matches)};return o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},Ya=(e,t=!0)=>qn(Wn.DARK,e,t),Qa=(e,t,n=!0)=>qn(Wn.RESPONSIVE(e),t,n),Ja={MEDIA_QUERY:Wn,listenThemeChange:Ya,listenResponsiveChange:Qa,createMediaQuery:Er,listenMediaQueryChange:qn};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 Cr({update:e,notify:t,unwatched:n}){return{link:o,unlink:r,propagate:s,checkDirty:a,shallowPropagate:i};function o(c,u,h){const f=u.depsTail;if(f!==void 0&&f.dep===c)return;const m=f!==void 0?f.nextDep:u.deps;if(m!==void 0&&m.dep===c){m.version=h,u.depsTail=m;return}const g=c.subsTail;if(g!==void 0&&g.version===h&&g.sub===u)return;const v=u.depsTail=c.subsTail={version:h,dep:c,sub:u,prevDep:f,nextDep:m,prevSub:g,nextSub:void 0};m!==void 0&&(m.prevDep=v),f!==void 0?f.nextDep=v:u.deps=v,g!==void 0?g.nextSub=v:c.subs=v}function r(c,u=c.sub){const h=c.dep,f=c.prevDep,m=c.nextDep,g=c.nextSub,v=c.prevSub;return m!==void 0?m.prevDep=f:u.depsTail=f,f!==void 0?f.nextDep=m:u.deps=m,g!==void 0?g.prevSub=v:h.subsTail=v,v!==void 0?v.nextSub=g:(h.subs=g)===void 0&&n(h),m}function s(c){let u=c.nextSub,h;e:do{const f=c.sub;let m=f.flags;if(m&60?m&12?m&4?!(m&48)&&l(c,f)?(f.flags=m|40,m&=1):m=0:f.flags=m&-9|32:m=0:f.flags=m|32,m&2&&t(f),m&1){const g=f.subs;if(g!==void 0){const v=(c=g).nextSub;v!==void 0&&(h={value:u,prev:h},u=v);continue}}if((c=u)!==void 0){u=c.nextSub;continue}for(;h!==void 0;)if(c=h.value,h=h.prev,c!==void 0){u=c.nextSub;continue e}break}while(!0)}function a(c,u){let h,f=0,m=!1;e:do{const g=c.dep,v=g.flags;if(u.flags&16)m=!0;else if((v&17)===17){if(e(g)){const b=g.subs;b.nextSub!==void 0&&i(b),m=!0}}else if((v&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(h={value:c,prev:h}),c=g.deps,u=g,++f;continue}if(!m){const b=c.nextDep;if(b!==void 0){c=b;continue}}for(;f--;){const b=u.subs,y=b.nextSub!==void 0;if(y?(c=h.value,h=h.prev):c=b,m){if(e(u)){y&&i(b),u=c.sub;continue}m=!1}else u.flags&=-33;u=c.sub;const w=c.nextDep;if(w!==void 0){c=w;continue e}}return m}while(!0)}function i(c){do{const u=c.sub,h=u.flags;(h&48)===32&&(u.flags=h|16,(h&6)===2&&t(u))}while((c=c.nextSub)!==void 0)}function l(c,u){let h=u.depsTail;for(;h!==void 0;){if(h===c)return!0;h=h.prevDep}return!1}}let Xn=0,Ve=0,vt=0;const Se=[],{link:Eh,unlink:_r,propagate:Ch,checkDirty:ei,shallowPropagate:_h}=Cr({update(e){return e.depsTail!==void 0?ri(e):si(e)},notify(e){let t=vt,n=t;do if(Se[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(vt=t;n<--t;){const o=Se[n];Se[n++]=Se[t],Se[t]=o}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,cn(e)):ci.call(e)}});function ti(){return Xn}function ni(){++Xn}function oi(){--Xn||ii()}function ri(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,cn(e)}}function si(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function ai(e){const t=e.flags;if(t&16||t&32&&ei(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,cn(e)}}else e.flags=2}function ii(){try{for(;Ve<vt;){const e=Se[Ve];Se[Ve++]=void 0,ai(e)}}finally{for(;Ve<vt;){const e=Se[Ve];Se[Ve++]=void 0,e.flags|=10}Ve=0,vt=0}}function ci(){this.depsTail=void 0,this.flags=0,cn(this);const e=this.subs;e!==void 0&&_r(e)}function cn(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=_r(n,e)}function Yn(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 Ln=[];let Gt=0;const{link:Po,unlink:li,propagate:di,checkDirty:Ar,shallowPropagate:Lo}=Cr({update(e){return e._update()},notify(e){Ln[Mn++]=e,e.flags&=~D.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=D.Mutable|D.Dirty,Xt(e))}});let Bt=0,Mn=0,me;function Xt(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=li(n,e)}function Pr(){if(!(ti()>0)){for(;Bt<Mn;){const e=Ln[Bt];Ln[Bt++]=void 0,e.notify()}Bt=0,Mn=0}}function Lr(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 me!==void 0&&Po(r,me,Gt),r._snapshot},subscribe(s){const a=Yn(s),i={current:!1},l=ui(()=>{r.get(),i.current?a.next?.(r._snapshot):i.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(s){const a=me,i=Object.is;if(n)me=r,++Gt,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{me=a,n&&(r.flags&=~D.RecursedCheck),Xt(r)}}};return n?(r.flags=D.Mutable|D.Dirty,r.get=function(){const s=r.flags;if(s&D.Dirty||s&D.Pending&&Ar(r.deps,r)){if(r._update()){const a=r.subs;a!==void 0&&Lo(a)}}else s&D.Pending&&(r.flags=s&~D.Pending);return me!==void 0&&Po(r,me,Gt),r._snapshot}):r.set=function(s){if(r._update(s)){const a=r.subs;a!==void 0&&(di(a),Lo(a),Pr())}},r}function ui(e){const t=()=>{const o=me;me=n,++Gt,n.depsTail=void 0,n.flags=D.Watching|D.RecursedCheck;try{return e()}finally{me=o,n.flags&=~D.RecursedCheck,Xt(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&&Ar(this.deps,this)?t():this.flags=D.Watching},stop(){this.flags=D.None,this.depsTail=void 0,Xt(this)}};return t(),n}class hi{constructor(t){this.atom=Lr(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Yn(t))}}class fi{constructor(t){this.atom=Lr(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Yn(t))}}function pi(e){return typeof e=="function"?new fi(e):new hi(e)}function mi(e){try{ni(),e()}finally{oi(),Pr()}}const De="__TSR_index",Mo="popstate",Io="beforeunload";function gi(e){let t=e.getLocation();const n=new Set,o=a=>{t=e.getLocation(),n.forEach(i=>i({location:t,action:a}))},r=a=>{e.notifyOnIndexChange??!0?o(a):t=e.getLocation()},s=async({task:a,navigateOpts:i,...l})=>{if(i?.ignoreBlocker??!1){a();return}const u=e.getBlockers?.()??[],h=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&h)for(const f of u){const m=Yt(l.path,l.state);if(await f.blockerFn({currentLocation:t,nextLocation:m,action:l.type})){e.onBlocked?.();return}}a()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:a=>(n.add(a),()=>{n.delete(a)}),push:(a,i,l)=>{const c=t.state[De];i=To(c+1,i),s({task:()=>{e.pushState(a,i),o({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:i})},replace:(a,i,l)=>{const c=t.state[De];i=To(c,i),s({task:()=>{e.replaceState(a,i),o({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:i})},go:(a,i)=>{s({task:()=>{e.go(a),r({type:"GO",index:a})},navigateOpts:i,type:"GO"})},back:a=>{s({task:()=>{e.back(a?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{s({task:()=>{e.forward(a?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[De]!==0,createHref:a=>e.createHref(a),block:a=>{if(!e.setBlockers)return()=>{};const i=e.getBlockers?.()??[];return e.setBlockers([...i,a]),()=>{const l=e.getBlockers?.()??[];e.setBlockers?.(l.filter(c=>c!==a))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:o}}function To(e,t){t||(t={});const n=Qn();return{...t,key:n,__TSR_key:n,[De]:e}}function vi(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,o=t.history.replaceState;let r=[];const s=()=>r,a=x=>r=x,i=(x=>x),l=(()=>Yt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const x=Qn();t.history.replaceState({[De]:0,key:x,__TSR_key:x},"")}let c=l(),u,h=!1,f=!1,m=!1,g=!1;const v=()=>c;let b,y;const w=()=>{b&&(E._ignoreSubscribers=!0,(b.isPush?t.history.pushState:t.history.replaceState)(b.state,"",b.href),E._ignoreSubscribers=!1,b=void 0,y=void 0,u=void 0)},R=(x,C,I)=>{const A=i(C);y||(u=c),c=Yt(C,I),b={href:A,state:I,isPush:b?.isPush||x==="push"},y||(y=Promise.resolve().then(()=>w()))},S=x=>{c=l(),E.notify({type:x})},_=async()=>{if(f){f=!1;return}const x=l(),C=x.state[De]-c.state[De],I=C===1,A=C===-1,L=!I&&!A||h;h=!1;const K=L?"GO":A?"BACK":"FORWARD",N=L?{type:"GO",index:C}:{type:A?"BACK":"FORWARD"};if(m)m=!1;else{const ue=s();if(typeof document<"u"&&ue.length){for(const W of ue)if(await W.blockerFn({currentLocation:c,nextLocation:x,action:K})){f=!0,t.history.go(1),E.notify(N);return}}}c=l(),E.notify(N)},P=x=>{if(g){g=!1;return}let C=!1;const I=s();if(typeof document<"u"&&I.length)for(const A of I){const L=A.enableBeforeUnload??!0;if(L===!0){C=!0;break}if(typeof L=="function"&&L()===!0){C=!0;break}}if(C)return x.preventDefault(),x.returnValue=""},E=gi({getLocation:v,getLength:()=>t.history.length,pushState:(x,C)=>R("push",x,C),replaceState:(x,C)=>R("replace",x,C),back:x=>(x&&(m=!0),g=!0,t.history.back()),forward:x=>{x&&(m=!0),g=!0,t.history.forward()},go:x=>{h=!0,t.history.go(x)},createHref:x=>i(x),flush:w,destroy:()=>{t.history.pushState=n,t.history.replaceState=o,t.removeEventListener(Io,P,{capture:!0}),t.removeEventListener(Mo,_)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:s,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(Io,P,{capture:!0}),t.addEventListener(Mo,_),t.history.pushState=function(...x){const C=n.apply(t.history,x);return E._ignoreSubscribers||S("PUSH"),C},t.history.replaceState=function(...x){const C=o.apply(t.history,x);return E._ignoreSubscribers||S("REPLACE"),C},E}function bi(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Yt(e,t){const n=bi(e),o=n.indexOf("#"),r=n.indexOf("?"),s=Qn();return{href:n,pathname:n.substring(0,o>0?r>0?Math.min(o,r):o:r>0?r:n.length),hash:o>-1?n.substring(o):"",search:r>-1?n.slice(r,o===-1?void 0:o):"",state:t||{[De]:0,key:s,__TSR_key:s}}}function Qn(){return(Math.random()+1).toString(36).substring(7)}const yi=!1;function bt(e){let t;return mi(()=>{t=e()}),t}function xi(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const In="tsr-scroll-restoration-v1_3",wi=(e,t)=>{let n;return(...o)=>{n||(n=setTimeout(()=>{e(...o),n=null},t))}};function Si(){const e=xi();if(!e)return null;const t=e.getItem(In);let n=t?JSON.parse(t):{};return{state:n,set:o=>{n=Ue(o,n)||n;try{e.setItem(In,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const $t=Si(),Ri=e=>e.state.__TSR_key||e.href;function Ei(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 Qt=!1;function Ci({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];Qt=!0;e:{if(o&&l&&Object.keys(l).length>0){for(const h in l){const f=l[h];if(h==="window")window.scrollTo({top:f.scrollY,left:f.scrollX,behavior:n});else if(h){const m=document.querySelector(h);m&&(m.scrollLeft=f.scrollX,m.scrollTop=f.scrollY)}}break e}const c=(s??window.location).hash.split("#",2)[1];if(c){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const f=document.getElementById(c);f&&f.scrollIntoView(h)}break e}const u={top:0,left:0,behavior:n};if(window.scrollTo(u),r)for(const h of r){if(h==="window")continue;const f=typeof h=="function"?h():document.querySelector(h);f&&f.scrollTo(u)}}Qt=!1}function _i(e,t){if(!$t||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!$t))return;e.isScrollRestorationSetup=!0,Qt=!1;const o=e.options.getScrollRestorationKey||Ri;window.history.scrollRestoration="manual";const r=s=>{if(Qt||!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=Ei(s.target)}const i=o(e.state.location);$t.set(l=>{const c=l[i]||={},u=c[a]||={};if(a==="window")u.scrollX=window.scrollX||0,u.scrollY=window.scrollY||0;else if(a){const h=document.querySelector(a);h&&(u.scrollX=h.scrollLeft||0,u.scrollY=h.scrollTop||0)}return l})};typeof document<"u"&&document.addEventListener("scroll",wi(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})||(Ci({storageKey:In,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&$t.set(i=>(i[a]||={},i)))})}function Ai(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 Pi(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 wn(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Li(e){const t=new URLSearchParams(e),n={};for(const[o,r]of t.entries()){const s=n[o];s==null?n[o]=wn(r):Array.isArray(s)?s.push(wn(r)):n[o]=[s,wn(r)]}return n}const Mi=Ti(JSON.parse),Ii=Ni(JSON.stringify,JSON.parse);function Ti(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=Li(t);for(const o in n){const r=n[o];if(typeof r=="string")try{n[o]=e(r)}catch{}}return n}}function Ni(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=Pi(r,o);return s?`?${s}`:""}}const Tn=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},ln=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Ge=(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},No=(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},Ne=(e,t,n)=>{if(!(!te(n)&&!X(n)))throw te(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:te(n)?"redirected":o.status==="pending"?"success":o.status,context:Ge(e,t.index),isFetching:!1,error:n})),X(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),te(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Mr=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,pt=(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,Ne(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(i){n=i,Ne(e,e.router.getMatch(r),n)}e.updateMatch(r,i=>(i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,i._nonReactive.loadPromise?.resolve(),{...i,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!te(n)&&!X(n)&&(e.serialError??=n)},Ir=(e,t,n,o)=>{if(o._nonReactive.pendingTimeout!==void 0)return;const r=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!ln(e,t)&&(n.options.loader||n.options.beforeLoad||Nr(n))&&typeof r=="number"&&r!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const a=setTimeout(()=>{Tn(e)},r);o._nonReactive.pendingTimeout=a}},Di=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;Ir(e,t,n,o);const r=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&Ne(e,s,s.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(r):r()},Oi=(e,t,n,o)=>{const r=e.router.getMatch(t),s=r._nonReactive.loadPromise;r._nonReactive.loadPromise=qe(()=>{s?.resolve()});const{paramsError:a,searchError:i}=r;a&&pt(e,n,a,"PARSE_PARAMS"),i&&pt(e,n,i,"VALIDATE_SEARCH"),Ir(e,t,o,r);const l=new AbortController;let c=!1;const u=()=>{c||(c=!0,e.updateMatch(t,S=>({...S,isFetching:"beforeLoad",fetchCount:S.fetchCount+1,abortController:l})))},h=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,S=>({...S,isFetching:!1}))};if(!o.options.beforeLoad){bt(()=>{u(),h()});return}r._nonReactive.beforeLoadPromise=qe();const f={...Ge(e,n,!1),...r.__routeContext},{search:m,params:g,cause:v}=r,b=ln(e,t),y={search:m,abortController:l,params:g,preload:b,context:f,location:e.location,navigate:S=>e.router.navigate({...S,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:b?"preload":v,matches:e.matches,routeId:o.id,...e.router.options.additionalContext},w=S=>{if(S===void 0){bt(()=>{u(),h()});return}(te(S)||X(S))&&(u(),pt(e,n,S,"BEFORE_LOAD")),bt(()=>{u(),e.updateMatch(t,_=>({..._,__beforeLoadContext:S})),h()})};let R;try{if(R=o.options.beforeLoad(y),St(R))return u(),R.catch(S=>{pt(e,n,S,"BEFORE_LOAD")}).then(w)}catch(S){u(),pt(e,n,S,"BEFORE_LOAD")}w(R)},Vi=(e,t)=>{const{id:n,routeId:o}=e.matches[t],r=e.router.looseRoutesById[o],s=()=>i(),a=()=>Oi(e,n,t,r),i=()=>{if(Mr(e,n))return;const l=Di(e,n,r);return St(l)?l.then(a):a()};return s()},ji=(e,t,n)=>{const o=e.router.getMatch(t);if(!o||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([n.options.head?.(r),n.options.scripts?.(r),n.options.headers?.(r)]).then(([s,a,i])=>{const l=s?.meta,c=s?.links,u=s?.scripts,h=s?.styles;return{meta:l,links:c,headScripts:u,headers:i,scripts:a,styles:h}})},Tr=(e,t,n,o,r)=>{const s=t[o-1],{params:a,loaderDeps:i,abortController:l,cause:c}=e.router.getMatch(n),u=Ge(e,o),h=ln(e,n);return{params:a,deps:i,preload:!!h,parentMatchPromise:s,abortController:l,context:u,location:e.location,navigate:f=>e.router.navigate({...f,_fromLocation:e.location}),cause:h?"preload":c,route:r,...e.router.options.additionalContext}},Do=async(e,t,n,o,r)=>{try{const s=e.router.getMatch(n);try{(!(yi??e.router.isServer)||s.ssr===!0)&&Jt(r);const a=r.options.loader?.(Tr(e,t,n,o,r)),i=r.options.loader&&St(a);if((i||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,u=>({...u,isFetching:"loader"})),r.options.loader){const u=i?await a:a;Ne(e,e.router.getMatch(n),u),u!==void 0&&e.updateMatch(n,h=>({...h,loaderData:u}))}r._lazyPromise&&await r._lazyPromise;const c=s._nonReactive.minPendingPromise;c&&await c,r._componentsPromise&&await r._componentsPromise,e.updateMatch(n,u=>({...u,error:void 0,context:Ge(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:Ge(e,o)}));return}const l=s._nonReactive.minPendingPromise;l&&await l,X(a)&&await r.options.notFoundComponent?.preload?.(),Ne(e,e.router.getMatch(n),a);try{r.options.onError?.(a)}catch(c){i=c,Ne(e,e.router.getMatch(n),c)}e.updateMatch(n,c=>({...c,error:i,context:Ge(e,o),status:"error",isFetching:!1}))}}catch(s){const a=e.router.getMatch(n);a&&(a._nonReactive.loaderPromise=void 0),Ne(e,a,s)}},ki=async(e,t,n)=>{async function o(h,f,m,g){const v=Date.now()-f.updatedAt,b=h?g.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:g.options.staleTime??e.router.options.defaultStaleTime??0,y=g.options.shouldReload,w=typeof y=="function"?y(Tr(e,t,r,n,g)):y,{status:R,invalid:S}=m;a=R==="success"&&(S||(w??v>b)),h&&g.options.preload===!1||(a&&!e.sync?(i=!0,(async()=>{try{await Do(e,t,r,n,g);const _=e.router.getMatch(r);_._nonReactive.loaderPromise?.resolve(),_._nonReactive.loadPromise?.resolve(),_._nonReactive.loaderPromise=void 0}catch(_){te(_)&&await e.router.navigate(_.options)}})()):(R!=="success"||a&&e.sync)&&await Do(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(!Mr(e,r)){const h=e.router.getMatch(r),f=ln(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&&Ne(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=qe(),m!==g.preload&&e.updateMatch(r,v=>({...v,preload:m})),await o(f,h,g,l)}}const c=e.router.getMatch(r);i||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,i||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;const u=i?c.isFetching:!1;return u!==c.isFetching||c.invalid!==!1?(e.updateMatch(r,h=>({...h,isFetching:u,invalid:!1})),e.router.getMatch(r)):c};async function Oo(e){const t=e,n=[];t.router.state.matches.some(f=>f._forcePending)&&Tn(t);let o;for(let f=0;f<t.matches.length;f++){try{const m=Vi(t,f);St(m)&&await m}catch(m){if(te(m))throw m;if(X(m))o=m;else if(!t.preload)throw m;break}if(t.serialError)break}const r=t.firstBadMatchIndex??t.matches.length,s=o&&!t.preload?No(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(ki(t,n,f));try{await Promise.all(n)}catch{const f=await Promise.allSettled(n);for(const m of f){if(m.status!=="rejected")continue;const g=m.reason;if(te(g))throw g;X(g)?i??=g:l??=g}if(l!==void 0)throw l}const c=i??(o&&!t.preload?o:void 0);let u=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!c&&o&&t.preload)return t.matches;if(c){const f=No(t,c);Rt(f!==void 0);const m=t.matches[f],g=t.router.looseRoutesById[m.routeId],v=t.router.options?.defaultNotFoundComponent;!g.options.notFoundComponent&&v&&(g.options.notFoundComponent=v),c.routeId=m.routeId;const b=m.routeId===t.router.routeTree.id;t.updateMatch(m.id,y=>({...y,...b?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),u=f,await Jt(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 Jt(f)}for(let f=0;f<=u;f++){const m=t.matches[f],{id:g,routeId:v}=m,b=t.router.looseRoutesById[v];try{const y=ji(t,g,b);if(y){const w=await y;t.updateMatch(g,R=>({...R,...w}))}}catch(y){console.error(`Error executing head for route ${v}:`,y)}}const h=Tn(t);if(St(h)&&await h,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function Jt(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 Dr){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 Nr(e){for(const t of Dr)if(e.options[t]?.preload)return!0;return!1}const Dr=["component","errorComponent","pendingComponent","notFoundComponent"];function Fi(e){return{input:({url:t})=>{for(const n of e)t=Nn(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Or(e[n],t);return t}}}function Hi(e){const t=hr(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=Qs(["/",t,a.pathname]),a)}}function Nn(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 Or(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 Bi(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class $i{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=Js(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=vi()),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=ea(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=pi(zi(this.latestLocation)),_i(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=hr(l);m&&m!=="/"&&f.push(Hi({basepath:l})),c&&f.push(c),this.rewrite=f.length===0?void 0:f.length===1?f[0]:Fi(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=ta(this.routeTree,this.options.caseSensitive,(o,r)=>{o.init({originalIndex:r})});return this.options.routeMasks&&na(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,o)=>{const r={eventType:n,fn:o};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=n=>{this.subscribers.forEach(o=>{o.eventType===n.type&&o.fn(n)})},this.parseLocation=(n,o)=>{const r=({pathname:l,search:c,hash:u,href:h,state:f})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const w=this.options.parseSearch(c),R=this.options.stringifySearch(w);return{href:l+R+u,publicHref:h,pathname:ht(l).path,external:!1,searchStr:R,search:ce(o?.search,w),hash:ht(u.slice(1)).path,state:ce(o?.state,f)}}const m=new URL(h,this.origin),g=Nn(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:ht(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:b,search:ce(o?.search,v),hash:ht(g.hash.slice(1)).path,state:ce(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)=>oa({base:n,to:ra(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=>Ui({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const o=this.getMatch(n);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(s=>s.status==="pending"),o=this.state.matches.filter(s=>s.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...o]).forEach(s=>{this.cancelMatch(s.id)})},this.buildLocation=n=>{const o=(s={})=>{const a=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(a);s.from;const l=s.unsafeRelative==="path"?a.pathname:s.from??i.fullPath,c=this.resolvePathWithBase(l,"."),u=i.search,h={...i.params},f=s.to?this.resolvePathWithBase(c,`${s.to}`):this.resolvePathWithBase(c,"."),m=s.params===!1||s.params===null?{}:(s.params??!0)===!0?h:Object.assign(h,Ue(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 A of v){const L=A.options.params?.stringify??A.options.stringifyParams;if(L)try{Object.assign(m,L(m))}catch{}}const y=n.leaveParams?f:ht(Ro({path:f,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let w=u;if(n._includeValidateSearch&&this.options.search?.strict){const A={};v.forEach(L=>{if(L.options.validateSearch)try{Object.assign(A,Wt(L.options.validateSearch,{...A,...w}))}catch{}}),w=A}w=Ki({search:w,dest:s,destRoutes:v,_includeValidateSearch:n._includeValidateSearch}),w=ce(u,w);const R=this.options.stringifySearch(w),S=s.hash===!0?a.hash:s.hash?Ue(s.hash,a.hash):void 0,_=S?`#${S}`:"";let P=s.state===!0?a.state:s.state?Ue(s.state,a.state):{};P=ce(a.state,P);const E=`${y}${R}${_}`;let x,C,I=!1;if(this.rewrite){const A=new URL(E,this.origin),L=Or(this.rewrite,A);x=A.href.replace(A.origin,""),L.origin!==this.origin?(C=L.href,I=!0):C=L.pathname+L.search+L.hash}else x=la(E),C=x;return{publicHref:C,href:x,pathname:y,search:w,searchStr:R,state:P,hash:S??"",external:I,unmaskOnReload:s.unmaskOnReload}},r=(s={},a)=>{const i=o(s);let l=a?o(a):void 0;if(!l){const c={};if(this.options.routeMasks){const u=ia(i.pathname,this.processedTree);if(u){Object.assign(c,u.rawParams);const{from:h,params:f,...m}=u.route,g=f===!1||f===null?{}:(f??!0)===!0?c:Object.assign(c,Ue(f,c));a={from:n.from,...m,params:g},l=o(a)}}}return l&&(i.maskedLocation=l),i};return n.mask?r(n,{from:n.from,...n.mask}):r(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:o,...r})=>{const s=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(u=>{r.state[u]=this.latestLocation.state[u]});const c=bn(r.state,this.latestLocation.state);return l.forEach(u=>{delete r.state[u]}),c},a=Ke(this.latestLocation.href)===Ke(r.href),i=this.commitLocationPromise;if(this.commitLocationPromise=qe(()=>{i?.resolve()}),a&&s())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...u}=r;l&&(u={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[r.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:o})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:o,hashScrollIntoView:r,viewTransition:s,ignoreBlocker:a,href:i,...l}={})=>{if(i){const h=this.history.location.state.__TSR_index,f=Yt(i,{__TSR_index:n?h:h+1}),m=new URL(f.pathname,this.origin),g=Nn(this.rewrite,m);l.to=g.pathname,l.search=this.options.parseSearch(f.search),l.hash=f.hash.slice(1)}const c=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const u=this.commitLocation({...c,viewTransition:s,replace:n,resetScroll:o,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=async({to:n,reloadDocument:o,href:r,publicHref:s,...a})=>{let i=!1;if(r)try{new URL(`${r}`),i=!0}catch{}if(i&&!o&&(o=!0),o){if(n!==void 0||!r){const c=this.buildLocation({to:n,...a});r=r??c.publicHref,s=s??c.publicHref}const l=!i&&s?s:r;if(So(l,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const u=this.history.getBlockers?.()??[];for(const h of u)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(l):window.location.href=l,Promise.resolve()}return this.buildAndCommitLocation({...a,href:r,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(o=>({...o,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:o.cachedMatches.filter(r=>!n.some(s=>s.id===r.id))}))},this.load=async n=>{let o,r,s;for(s=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();const l=this.latestLocation,c=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...je({resolvedLocation:c,location:l})}),this.emit({type:"onBeforeLoad",...je({resolvedLocation:c,location:l})}),await Oo({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:l,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let u=[],h=[],f=[],m=[];bt(()=>{this.__store.setState(g=>{const v=g.matches,b=g.pendingMatches||g.matches;return u=v.filter(y=>!b.some(w=>w.id===y.id)),h=v.filter(y=>!b.some(w=>w.routeId===y.routeId)),f=b.filter(y=>!v.some(w=>w.routeId===y.routeId)),m=b.filter(y=>v.some(w=>w.routeId===y.routeId)),{...g,isLoading:!1,loadedAt:Date.now(),matches:b,pendingMatches:void 0,cachedMatches:[...g.cachedMatches,...u.filter(y=>y.status!=="error"&&y.status!=="notFound"&&y.status!=="redirected")]}}),this.clearExpiredCache()}),[[h,"onLeave"],[f,"onEnter"],[m,"onStay"]].forEach(([g,v])=>{g.forEach(b=>{this.looseRoutesById[b.routeId].options[v]?.(b)})})})})}})}catch(l){te(l)?(o=l,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):X(l)&&(r=l),this.__store.setState(c=>({...c,statusCode:o?o.status:r?404:c.matches.some(u=>u.status==="error")?500:200,redirect:o}))}this.latestLoadPromise===s&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(i=>i.status==="error")&&(a=500),a!==void 0&&this.__store.setState(i=>({...i,statusCode:a}))},this.startViewTransition=n=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,a=this.state.resolvedLocation,i=typeof o.types=="function"?o.types(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:Bi(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&&So(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=Jt,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)]);bt(()=>{r.forEach(i=>{a.has(i.id)||this.__store.setState(l=>({...l,cachedMatches:[...l.cachedMatches,i]}))})});try{return r=await Oo({router:this,matches:r,location:o,preload:!0,updateMatch:(i,l)=>{s.has(i)?r=r.map(c=>c.id===i?l(c):c):this.updateMatch(i,l)}}),r}catch(i){if(te(i))return i.options.reloadDocument?void 0:await this.preloadRoute({...i.options,_fromLocation:o});X(i)||console.error(i);return}},this.matchRoute=(n,o)=>{const r={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(r);if(o?.pending&&this.state.status!=="pending")return!1;const i=(o?.pending===void 0?!this.state.isLoading:o.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=sa(s.pathname,o?.caseSensitive??!1,o?.fuzzy??!1,i.pathname,this.processedTree);return!l||n.params&&!bn(l.rawParams,n.params,{partial:!0})?!1:o?.includeSearch??!0?bn(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??Ii,parseSearch:t.parseSearch??Mi,protocolAllowlist:t.protocolAllowlist??aa}),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["**"]:Ke(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:l=!0);const c=l?Wi(this.options.notFoundMode,i):void 0,u=new Array(i.length),h=new Map(this.state.matches.map(f=>[f.routeId,f]));for(let f=0;f<i.length;f++){const m=i[f],g=u[f-1];let v,b,y;{const N=g?.search??t.search,ue=g?._strictSearch??void 0;try{const W=Wt(m.options.validateSearch,{...N})??void 0;v={...N,...W},b={...ue,...W},y=void 0}catch(W){let k=W;if(W instanceof en||(k=new en(W.message,{cause:W})),n?.throwOnError)throw k;v=N,b={},y=k}}const w=m.options.loaderDeps?.({search:v})??"",R=w?JSON.stringify(w):"",{interpolatedPath:S,usedParams:_}=Ro({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),P=m.id+S+R,E=this.getMatch(P),x=h.get(m.id),C=E?._strictParams??_;let I;if(!E)try{Vo(m,_,a,C)}catch(N){if(X(N)||te(N)?I=N:I=new Zi(N.message,{cause:N}),n?.throwOnError)throw I}Object.assign(s,C);const A=x?"stay":"enter";let L;if(E)L={...E,cause:A,params:x?.params??s,_strictParams:C,search:x?ce(x.search,v):ce(E.search,v),_strictSearch:b};else{const N=m.options.loader||m.options.beforeLoad||m.lazyFn||Nr(m)?"pending":"success";L={id:P,ssr:m.options.ssr,index:f,routeId:m.id,params:x?.params??s,_strictParams:C,pathname:S,updatedAt:Date.now(),search:x?ce(x.search,v):v,_strictSearch:b,searchError:void 0,status:N,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:qe()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:A,loaderDeps:x?ce(x.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(L.globalNotFound=c===m.id),L.searchError=y;const K=this.getParentContext(g);L.context={...K,...L.__routeContext,...L.__beforeLoadContext},u[f]=L}for(let f=0;f<u.length;f++){const m=u[f],g=this.looseRoutesById[m.routeId],v=this.getMatch(m.id),b=h.get(m.routeId);if(m.params=b?ce(b.params,s):s,!v){const y=u[f-1],w=this.getParentContext(y);if(g.options.context){const R={deps:m.loaderDeps,params:m.params,context:w??{},location:t,navigate:S=>this.navigate({...S,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:u,routeId:g.id};m.__routeContext=g.options.context(R)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return u}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:o,parsedParams:r}=this.getMatchedRoutes(t.pathname),s=Eo(n),a={...t.search};for(const u of n)try{Object.assign(a,Wt(u.options.validateSearch,a))}catch{}const i=Eo(this.state.matches),l=i&&i.routeId===s.id&&t.pathname===this.state.location.pathname;let c;if(l)c=i.params;else{const u={...o};for(const h of n)try{Vo(h,o,r??{},u)}catch{}c=u}return{matchedRoutes:n,fullPath:s.fullPath,search:a,params:c}}}class en extends Error{}class Zi extends Error{}function zi(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Wt(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new en("Async validation not supported");if(n.issues)throw new en(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 Ui({pathname:e,routesById:t,processedTree:n}){const o={},r=Ke(e);let s,a;const i=ca(r,n,!0);return i&&(s=i.route,Object.assign(o,i.rawParams),a=Object.assign({},i.parsedParams)),{matchedRoutes:i?.branch||[t[Lt]],routeParams:o,foundRoute:s,parsedParams:a}}function Ki({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){return Gi(n)(e,t,o??!1)}function Gi(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of e){if("search"in r.options)r.options.search?.middlewares&&t.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const s=({search:a,next:i})=>{let l=a;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(l=r.options.preSearchFilters.reduce((u,h)=>h(u),a));const c=i(l);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((u,h)=>h(u),c):c};t.middlewares.push(s)}if(r.options.validateSearch){const s=({search:a,next:i})=>{const l=i(a);if(!t._includeValidateSearch)return l;try{return{...l,...Wt(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:Ue(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 Wi(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 Lt}function Vo(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 Jn(e){const t=e.errorComponent??eo;return p.jsx(qi,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?d.createElement(t,{error:n,reset:o}):e.children})}class qi extends d.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function eo({error:e}){const[t,n]=d.useState(!1);return p.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[p.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),p.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(o=>!o),children:t?"Hide Error":"Show Error"})]}),p.jsx("div",{style:{height:".25rem"}}),t?p.jsx("div",{children:p.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?p.jsx("code",{children:e.message}):null})}):null]})}function jo(e){return typeof e=="object"?new ko(e,{silent:!0}).createRoute(e):new ko(e,{silent:!0}).createRoute}class ko{constructor(t,n){this.path=t,this.createRoute=o=>{const r=O(o);return r.isRoot=!1,r},this.silent=n?.silent}}class Fo{constructor(t){this.useMatch=n=>Co({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Co({from:this.options.id,select:o=>n?.select?n.select(o.context):o.context}),this.useSearch=n=>da({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>ua({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>ha({...n,from:this.options.id}),this.useLoaderData=n=>fa({...n,from:this.options.id}),this.useNavigate=()=>{const n=Ce();return $n({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Ho(e){return typeof e=="object"?new Fo(e):t=>new Fo({id:e,...t})}function B(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,pa(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(_o)_o(a());else throw a();return d.createElement(o,c)};return i.preload=a,i}function Xi(){const e=Ce(),t=d.useRef({router:e,mounted:!1}),[n,o]=d.useState(!1),{hasPendingMatches:r,isLoading:s}=le({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),a=yn(s),i=s||n||r,l=yn(i),c=s||r,u=yn(c);return e.startTransition=h=>{o(!0),d.startTransition(()=>{h(),o(!1)})},d.useEffect(()=>{const h=e.history.subscribe(e.load),f=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ke(e.latestLocation.publicHref)!==Ke(f.publicHref)&&e.commitLocation({...f,replace:!0}),()=>{h()}},[e,e.history]),Ht(()=>{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]),Ht(()=>{a&&!s&&e.emit({type:"onLoad",...je(e.state)})},[a,e,s]),Ht(()=>{u&&!c&&e.emit({type:"onBeforeRouteMount",...je(e.state)})},[c,u,e]),Ht(()=>{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&&Ai(e)}},[i,l,e]),null}function Yi(e){const t=le({select:n=>`not-found-${n.location.pathname}-${n.status}`});return p.jsx(Jn,{getResetKey:()=>t,onCatch:(n,o)=>{if(X(n))e.onCatch?.(n,o);else throw n},errorComponent:({error:n})=>{if(X(n))return e.fallback?.(n);throw n},children:e.children})}function Qi(){return p.jsx("p",{children:"Not Found"})}function ze(e){return p.jsx(p.Fragment,{children:e.children})}function Vr(e,t,n){return t.options.notFoundComponent?p.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?p.jsx(e.options.defaultNotFoundComponent,{...n}):p.jsx(Qi,{})}function Ji(){return Ce().isScrollRestoring,null}const jr=d.memo(function({matchId:t}){const n=Ce(),o=le({select:v=>{const b=v.matches.findIndex(w=>w.id===t),y=v.matches[b];return Rt(y),{routeId:y.routeId,ssr:y.ssr,_displayPending:y._displayPending,resetKey:v.loadedAt,parentRouteId:v.matches[b-1]?.routeId}},structuralSharing:!0}),r=n.routesById[o.routeId],s=r.options.pendingComponent??n.options.defaultPendingComponent,a=s?p.jsx(s,{}):null,i=r.options.errorComponent??n.options.defaultErrorComponent,l=r.options.onCatch??n.options.defaultOnCatch,c=r.isRoot?r.options.notFoundComponent??n.options.notFoundRoute?.options.component:r.options.notFoundComponent,u=o.ssr===!1||o.ssr==="data-only",h=(!r.isRoot||r.options.wrapInSuspense||u)&&(r.options.wrapInSuspense??s??(r.options.errorComponent?.preload||u))?d.Suspense:ze,f=i?Jn:ze,m=c?Yi:ze,g=r.isRoot?r.options.shellComponent??ze:ze;return p.jsxs(g,{children:[p.jsx(Zn.Provider,{value:t,children:p.jsx(h,{fallback:a,children:p.jsx(f,{getResetKey:()=>o.resetKey,errorComponent:i||eo,onCatch:(v,b)=>{if(X(v))throw v;l?.(v,b)},children:p.jsx(m,{fallback:v=>{if(!c||v.routeId&&v.routeId!==o.routeId||!v.routeId&&!r.isRoot)throw v;return d.createElement(c,v)},children:u||o._displayPending?p.jsx(ma,{fallback:a,children:p.jsx(Bo,{matchId:t})}):p.jsx(Bo,{matchId:t})})})})}),o.parentRouteId===Lt&&n.options.scrollRestoration?p.jsxs(p.Fragment,{children:[p.jsx(ec,{}),p.jsx(Ji,{})]}):null]})});function ec(){const e=Ce(),t=d.useRef(void 0);return p.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...je(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const Bo=d.memo(function({matchId:t}){const n=Ce(),{match:o,key:r,routeId:s}=le({select:l=>{const c=l.matches.find(g=>g.id===t),u=c.routeId,f=(n.routesById[u].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:u,loaderDeps:c.loaderDeps,params:c._strictParams,search:c._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:u,match:{id:c.id,status:c.status,error:c.error,invalid:c.invalid,_forcePending:c._forcePending,_displayPending:c._displayPending}}},structuralSharing:!0}),a=n.routesById[s],i=d.useMemo(()=>{const l=a.options.component??n.options.defaultComponent;return l?p.jsx(l,{},r):p.jsx(kr,{})},[r,a.options.component,n.options.defaultComponent]);if(o._displayPending)throw n.getMatch(o.id)?._nonReactive.displayPendingPromise;if(o._forcePending)throw n.getMatch(o.id)?._nonReactive.minPendingPromise;if(o.status==="pending"){const l=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(l){const c=n.getMatch(o.id);if(c&&!c._nonReactive.minPendingPromise){const u=qe();c._nonReactive.minPendingPromise=u,setTimeout(()=>{u.resolve(),c._nonReactive.minPendingPromise=void 0},l)}}throw n.getMatch(o.id)?._nonReactive.loadPromise}if(o.status==="notFound")return Rt(X(o.error)),Vr(n,a,o.error);if(o.status==="redirected")throw Rt(te(o.error)),n.getMatch(o.id)?._nonReactive.loadPromise;if(o.status==="error")throw o.error;return i}),kr=d.memo(function(){const t=Ce(),n=d.useContext(Zn),o=le({select:c=>c.matches.find(u=>u.id===n)?.routeId}),r=t.routesById[o],s=le({select:c=>{const h=c.matches.find(f=>f.id===n);return Rt(h),h.globalNotFound}}),a=le({select:c=>{const u=c.matches,h=u.findIndex(f=>f.id===n);return u[h+1]?.id}}),i=t.options.defaultPendingComponent?p.jsx(t.options.defaultPendingComponent,{}):null;if(s)return Vr(t,r,void 0);if(!a)return null;const l=p.jsx(jr,{matchId:a});return o===Lt?p.jsx(d.Suspense,{fallback:i,children:l}):l});function tc(){const e=Ce(),n=e.routesById[Lt].options.pendingComponent??e.options.defaultPendingComponent,o=n?p.jsx(n,{}):null,r=typeof document<"u"&&e.ssr?ze:d.Suspense,s=p.jsxs(r,{fallback:o,children:[p.jsx(Xi,{}),p.jsx(nc,{})]});return e.options.InnerWrap?p.jsx(e.options.InnerWrap,{children:s}):s}function nc(){const e=Ce(),t=le({select:r=>r.matches[0]?.id}),n=le({select:r=>r.loadedAt}),o=t?p.jsx(jr,{matchId:t}):null;return p.jsx(Zn.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:p.jsx(Jn,{getResetKey:()=>n,errorComponent:eo,onCatch:void 0,children:o})})}function oc(e){return le({select:t=>{const n=t.matches;return e?.select?e.select(n):n},structuralSharing:e?.structuralSharing})}const rc=e=>new sc(e);class sc extends $i{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=jo,globalThis.createLazyFileRoute=Ho):typeof window<"u"&&(window.createFileRoute=jo,window.createLazyFileRoute=Ho);function ac({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(ga.Provider,{value:e,children:t});return e.options.Wrap?p.jsx(e.options.Wrap,{children:o}):o}function ic({router:e,...t}){return p.jsx(ac,{router:e,...t,children:p.jsx(tc,{})})}function dn(e){return le({select:t=>e?.select?e.select(t.location):t.location})}const Ah=1,$o="/",cc=2048,Dn="https://integration-app.invalid",Fr=e=>{if(typeof e!="string"||e.length===0||e.length>cc||!e.startsWith("/")||e.startsWith("//")||e.includes("\\")||[...e].some(n=>{const o=n.charCodeAt(0);return o<=31||o===127}))return;const t=e.split(/[?#]/,1)[0];for(const n of t.split("/")){let o=n;for(let r=0;r<3;r+=1){let s;try{s=decodeURIComponent(o)}catch{return}if(s==="."||s===".."||s.includes("/")||s.includes("\\"))return;if(s===o)break;o=s}}try{const n=new URL(e,Dn);return n.origin!==Dn?void 0:`${n.pathname}${n.search}${n.hash}`}catch{return}},Ph=(e,t)=>{const n=Fr(t)??$o,o=new URL(e);if(n===$o)return o.href;const r=new URL(n,Dn);if(r.pathname!=="/"){const s=o.pathname.endsWith("/")?o.pathname:`${o.pathname}/`;o.pathname=`${s}${r.pathname.slice(1)}`}return o.search=r.search,o.hash=r.hash,o.href},lc=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,28H188V24a12,12,0,0,0-24,0v4H92V24a12,12,0,0,0-24,0v4H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28ZM68,52a12,12,0,0,0,24,0h72a12,12,0,0,0,24,0h16V76H52V52ZM52,204V100H204V204Zm60-80v56a12,12,0,0,1-24,0V143.32a12,12,0,0,1-9.37-22l16-8A12,12,0,0,1,112,124Zm61.49,33.88L163.9,168H168a12,12,0,0,1,0,24H136a12,12,0,0,1-8.71-20.25L155.45,142a4,4,0,0,0,.55-2,4,4,0,0,0-7.47-2,12,12,0,0,1-20.78-12A28,28,0,0,1,180,140a27.77,27.77,0,0,1-5.64,16.86A10.63,10.63,0,0,1,173.49,157.88Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,48V88H40V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z",opacity:"0.2"}),d.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Zm-96-88v64a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm59.16,30.45L152,176h16a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136,23.76,23.76,0,0,1,171.16,150.45Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM112,184a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm56-8a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136a23.76,23.76,0,0,1-4.84,14.45L152,176ZM48,80V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,34H182V24a6,6,0,0,0-12,0V34H86V24a6,6,0,0,0-12,0V34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34ZM48,46H74V56a6,6,0,0,0,12,0V46h84V56a6,6,0,0,0,12,0V46h26a2,2,0,0,1,2,2V82H46V48A2,2,0,0,1,48,46ZM208,210H48a2,2,0,0,1-2-2V94H210V208A2,2,0,0,1,208,210Zm-98-90v64a6,6,0,0,1-12,0V129.71l-7.32,3.66a6,6,0,1,1-5.36-10.74l16-8A6,6,0,0,1,110,120Zm59.57,29.25L148,178h20a6,6,0,0,1,0,12H136a6,6,0,0,1-4.8-9.6L160,142a10,10,0,1,0-16.65-11A6,6,0,1,1,133,125a22,22,0,1,1,36.62,24.26Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Zm-96-88v64a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm59.16,30.45L152,176h16a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136,23.76,23.76,0,0,1,171.16,150.45Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,36H180V24a4,4,0,0,0-8,0V36H84V24a4,4,0,0,0-8,0V36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36ZM48,44H76V56a4,4,0,0,0,8,0V44h88V56a4,4,0,0,0,8,0V44h28a4,4,0,0,1,4,4V84H44V48A4,4,0,0,1,48,44ZM208,212H48a4,4,0,0,1-4-4V92H212V208A4,4,0,0,1,208,212ZM108,120v64a4,4,0,0,1-8,0V126.47l-10.21,5.11a4,4,0,0,1-3.58-7.16l16-8A4,4,0,0,1,108,120Zm60,28-24,32h24a4,4,0,0,1,0,8H136a4,4,0,0,1-3.2-6.4l28.78-38.37A11.88,11.88,0,0,0,164,136a12,12,0,0,0-22.4-6,4,4,0,0,1-6.92-4A20,20,0,0,1,172,136,19.79,19.79,0,0,1,168,148Z"}))]]),dc=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M108,60A16,16,0,1,1,92,44,16,16,0,0,1,108,60Zm56,16a16,16,0,1,0-16-16A16,16,0,0,0,164,76ZM92,112a16,16,0,1,0,16,16A16,16,0,0,0,92,112Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,112ZM92,180a16,16,0,1,0,16,16A16,16,0,0,0,92,180Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,180Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32V224a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V32A16,16,0,0,1,64,16H192A16,16,0,0,1,208,32Z",opacity:"0.2"}),d.createElement("path",{d:"M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M192,16H64A16,16,0,0,0,48,32V224a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V32A16,16,0,0,0,192,16ZM100,200a12,12,0,1,1,12-12A12,12,0,0,1,100,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,80Zm56,120a12,12,0,1,1,12-12A12,12,0,0,1,156,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,80Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M102,60A10,10,0,1,1,92,50,10,10,0,0,1,102,60Zm62,10a10,10,0,1,0-10-10A10,10,0,0,0,164,70ZM92,118a10,10,0,1,0,10,10A10,10,0,0,0,92,118Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,118ZM92,186a10,10,0,1,0,10,10A10,10,0,0,0,92,186Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,186Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M100,60a8,8,0,1,1-8-8A8,8,0,0,1,100,60Zm64,8a8,8,0,1,0-8-8A8,8,0,0,0,164,68ZM92,120a8,8,0,1,0,8,8A8,8,0,0,0,92,120Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,120ZM92,188a8,8,0,1,0,8,8A8,8,0,0,0,92,188Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,188Z"}))]]),uc=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,80H140V60h56ZM116,60v56H60V60ZM60,140h56v56H60Zm80,56V140h56v56Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",opacity:"0.2"}),d.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,56v60a4,4,0,0,1-4,4H136V44a4,4,0,0,1,4-4h60A16,16,0,0,1,216,56ZM116,40H56A16,16,0,0,0,40,56v60a4,4,0,0,0,4,4h76V44A4,4,0,0,0,116,40Zm96,96H136v76a4,4,0,0,0,4,4h60a16,16,0,0,0,16-16V140A4,4,0,0,0,212,136ZM40,140v60a16,16,0,0,0,16,16h60a4,4,0,0,0,4-4V136H44A4,4,0,0,0,40,140Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,14v66H134V54h66A2,2,0,0,1,202,56ZM56,54h66v68H54V56A2,2,0,0,1,56,54ZM54,200V134h68v68H56A2,2,0,0,1,54,200Zm146,2H134V134h68v66A2,2,0,0,1,200,202Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,12v68H132V52h68A4,4,0,0,1,204,56ZM56,52h68v72H52V56A4,4,0,0,1,56,52ZM52,200V132h72v72H56A4,4,0,0,1,52,200Zm148,4H132V132h72v68A4,4,0,0,1,200,204Z"}))]]),hc=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M218.34,119.6,183.6,154.34a46.58,46.58,0,0,1-44.31,12.26c-.31.34-.62.67-.95,1L103.6,202.34A46.63,46.63,0,1,1,37.66,136.4L72.4,101.66A46.6,46.6,0,0,1,116.71,89.4c.31-.34.62-.67,1-1L152.4,53.66a46.63,46.63,0,0,1,65.94,65.94Z",opacity:"0.2"}),d.createElement("path",{d:"M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,7.78,8.22H152a8,8,0,0,0,8-7.78A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM115.7,192.49a43.31,43.31,0,0,1-55-66.43l25.37-25.37a43.35,43.35,0,0,1,61.25,0,42.9,42.9,0,0,1,9.95,15.43,8,8,0,1,1-15,5.6A27.33,27.33,0,0,0,97.37,112L72,137.37a27.32,27.32,0,0,0,34.68,41.91,8,8,0,1,1,9,13.21Zm79.61-62.55-25.37,25.37A43,43,0,0,1,139.32,168h0a43.35,43.35,0,0,1-40.53-28.12,8,8,0,1,1,15-5.6A27.35,27.35,0,0,0,139.28,152h0a27.14,27.14,0,0,0,19.32-8L184,118.63a27.32,27.32,0,0,0-34.68-41.91,8,8,0,1,1-9-13.21,43.32,43.32,0,0,1,55,66.43Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M238,88.18a52.42,52.42,0,0,1-15.4,35.66l-34.75,34.75A52.28,52.28,0,0,1,150.62,174h-.05A52.63,52.63,0,0,1,98,119.9a6,6,0,0,1,6-5.84h.17a6,6,0,0,1,5.83,6.16A40.62,40.62,0,0,0,150.58,162h0a40.4,40.4,0,0,0,28.73-11.9l34.75-34.74A40.63,40.63,0,0,0,156.63,57.9l-11,11a6,6,0,0,1-8.49-8.49l11-11a52.62,52.62,0,0,1,74.43,0A52.83,52.83,0,0,1,238,88.18Zm-127.62,98.9-11,11A40.36,40.36,0,0,1,70.6,210h0a40.63,40.63,0,0,1-28.7-69.36L76.62,105.9A40.63,40.63,0,0,1,146,135.77a6,6,0,0,0,5.83,6.16H152a6,6,0,0,0,6-5.84A52.63,52.63,0,0,0,68.14,97.42L33.38,132.16A52.63,52.63,0,0,0,70.56,222h0a52.26,52.26,0,0,0,37.22-15.42l11-11a6,6,0,1,0-8.49-8.48Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M236,88.12a50.44,50.44,0,0,1-14.81,34.31l-34.75,34.74A50.33,50.33,0,0,1,150.62,172h-.05A50.63,50.63,0,0,1,100,120a4,4,0,0,1,4-3.89h.11a4,4,0,0,1,3.89,4.11A42.64,42.64,0,0,0,150.58,164h0a42.32,42.32,0,0,0,30.14-12.49l34.75-34.74a42.63,42.63,0,1,0-60.29-60.28l-11,11a4,4,0,0,1-5.66-5.65l11-11A50.64,50.64,0,0,1,236,88.12ZM111.78,188.49l-11,11A42.33,42.33,0,0,1,70.6,212h0a42.63,42.63,0,0,1-30.11-72.77l34.75-34.74A42.63,42.63,0,0,1,148,135.82a4,4,0,0,0,8,.23A50.64,50.64,0,0,0,69.55,98.83L34.8,133.57A50.63,50.63,0,0,0,70.56,220h0a50.33,50.33,0,0,0,35.81-14.83l11-11a4,4,0,1,0-5.65-5.66Z"}))]]),fc=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),d.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),pc=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,128a12,12,0,0,1-12,12H48a12,12,0,0,1,0-24h68A12,12,0,0,1,128,128ZM48,76H180a12,12,0,0,0,0-24H48a12,12,0,0,0,0,24Zm52,104H48a12,12,0,0,0,0,24h52a12,12,0,0,0,0-24Zm132.49-20.49a12,12,0,0,0-17,0L196,179V112a12,12,0,0,0-24,0v67l-19.51-19.52a12,12,0,0,0-17,17l40,40a12,12,0,0,0,17,0l40-40A12,12,0,0,0,232.49,159.51Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,80v88l-24,24H48V64H208A16,16,0,0,1,224,80Z",opacity:"0.2"}),d.createElement("path",{d:"M128,128a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16h72A8,8,0,0,1,128,128ZM48,72H184a8,8,0,0,0,0-16H48a8,8,0,0,0,0,16Zm56,112H48a8,8,0,0,0,0,16h56a8,8,0,0,0,0-16Zm125.66-21.66a8,8,0,0,0-11.32,0L192,188.69V112a8,8,0,0,0-16,0v76.69l-26.34-26.35a8,8,0,0,0-11.32,11.32l40,40a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,229.66,162.34Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,72h96a8,8,0,0,1,0,16H72a8,8,0,0,1,0-16Zm40,112H72a8,8,0,0,1,0-16h40a8,8,0,0,1,0,16Zm8-48H72a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Zm77.66,29.66-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L160,164.69V120a8,8,0,0,1,16,0v44.69l10.34-10.35a8,8,0,0,1,11.32,11.32Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M126,128a6,6,0,0,1-6,6H48a6,6,0,0,1,0-12h72A6,6,0,0,1,126,128ZM48,70H184a6,6,0,0,0,0-12H48a6,6,0,0,0,0,12Zm56,116H48a6,6,0,0,0,0,12h56a6,6,0,0,0,0-12Zm124.24-22.24a6,6,0,0,0-8.48,0L190,193.51V112a6,6,0,0,0-12,0v81.51l-29.76-29.75a6,6,0,0,0-8.48,8.48l40,40a6,6,0,0,0,8.48,0l40-40A6,6,0,0,0,228.24,163.76Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,128a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16h72A8,8,0,0,1,128,128ZM48,72H184a8,8,0,0,0,0-16H48a8,8,0,0,0,0,16Zm56,112H48a8,8,0,0,0,0,16h56a8,8,0,0,0,0-16Zm125.66-21.66a8,8,0,0,0-11.32,0L192,188.69V112a8,8,0,0,0-16,0v76.69l-26.34-26.35a8,8,0,0,0-11.32,11.32l40,40a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,229.66,162.34Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M124,128a4,4,0,0,1-4,4H48a4,4,0,0,1,0-8h72A4,4,0,0,1,124,128ZM48,68H184a4,4,0,0,0,0-8H48a4,4,0,0,0,0,8Zm56,120H48a4,4,0,0,0,0,8h56a4,4,0,0,0,0-8Zm122.83-22.83a4,4,0,0,0-5.66,0L188,198.34V112a4,4,0,0,0-8,0v86.34l-33.17-33.17a4,4,0,0,0-5.66,5.66l40,40a4,4,0,0,0,5.66,0l40-40A4,4,0,0,0,226.83,165.17Z"}))]]),Hr=d.forwardRef((e,t)=>d.createElement(Qe,{ref:t,...e,weights:lc}));Hr.displayName="CalendarIcon";const mc=Hr,Br=d.forwardRef((e,t)=>d.createElement(Qe,{ref:t,...e,weights:dc}));Br.displayName="DotsSixVerticalIcon";const gc=Br,$r=d.forwardRef((e,t)=>d.createElement(Qe,{ref:t,...e,weights:uc}));$r.displayName="GridFourIcon";const Zr=$r,zr=d.forwardRef((e,t)=>d.createElement(Qe,{ref:t,...e,weights:hc}));zr.displayName="LinkIcon";const vc=zr,Ur=d.forwardRef((e,t)=>d.createElement(Qe,{ref:t,...e,weights:fc}));Ur.displayName="PencilSimpleIcon";const bc=Ur,Kr=d.forwardRef((e,t)=>d.createElement(Qe,{ref:t,...e,weights:pc}));Kr.displayName="SortAscendingIcon";const yc=Kr,to="/login",xc="/api/auth/";let Zo=!1;const wc=e=>{const t=`${e.pathname||"/"}${e.search}${e.hash}`;return`${to}?next=${encodeURIComponent(t)}`},Sc=e=>{if(!ae.isAxiosError(e)||e.response?.status!==401)return!1;const t=e.config?.url??"";return!t.startsWith(xc)&&t!==to},Gr=(e=window.location)=>{Zo||e.pathname===to||(Zo=!0,e.assign(wc(e)))},Rc="X-Ocean-Brain-Session-Generation";let zo=!1,Zt;const Ec=e=>!!(e.authRequired&&!e.authenticated),Cc=e=>{const t=e.headers.get(Rc);return t?Zt?Zt===t?!1:(Zt=t,!0):(Zt=t,!1):!1},_c=(e=window.location)=>{zo||(zo=!0,e.reload())},tn=async(e=fetch)=>{const t=await e("/api/auth/session").catch(()=>{});if(!t?.ok)return"unavailable";const n=Cc(t),o=await t.json();return Ec(o)?(Gr(),"expired"):n?(_c(),"reloading"):"active"},Ac=e=>t=>{if(!(t instanceof MessageEvent)||typeof t.data!="string")return;const n=Fs(t.data);!n||n.type!==e||Hs(n)},Pc=()=>{const e=zn();return d.useEffect(()=>js(t=>{Bs(e,t)}),[e]),d.useEffect(()=>{if(typeof EventSource>"u")return;const t=new EventSource("/api/events");let n=!1;const o=()=>{n=!0,tn()},r=()=>{n&&(n=!1,tn())},s=ks.map(a=>{const i=Ac(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},Lc=({children:e})=>p.jsx(va,{client:ba,children:p.jsx(ya,{children:p.jsxs(xa,{children:[p.jsx(Pc,{}),e]})})}),Uo=({children:e,fallback:t})=>e||t;function Mc({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(Zr,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),p.jsx(ne,{id:"note-filters-items-label",as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Items"}),p.jsx(xn,{value:String(e),"aria-labelledby":"note-filters-items-label",onValueChange:l=>{const c=Number(l);wa(c)&&t(c)},variant:"ghost",size:"sm",children:fr.map(l=>p.jsx(ft,{value:String(l),children:l===pr?`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(yc,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),p.jsx(ne,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Sort"}),p.jsxs(xn,{value:n,ariaLabel:"Sort field",onValueChange:l=>o(l),variant:"ghost",size:"sm",children:[p.jsx(ft,{value:"updatedAt",children:"Updated"}),p.jsx(ft,{value:"createdAt",children:"Created"})]}),p.jsxs(xn,{value:r,ariaLabel:"Sort order",onValueChange:l=>s(l),variant:"ghost",size:"sm",children:[p.jsx(ft,{value:"desc",children:"Newest"}),p.jsx(ft,{value:"asc",children:"Oldest"})]})]}),p.jsx("div",{className:"h-5 w-px bg-divider"}),p.jsxs(Sa,{htmlFor:"pinnedFirst",size:"sm",className:"flex cursor-pointer items-center gap-1.5",children:[p.jsx(Ra,{id:"pinnedFirst",size:"sm",checked:a,onChange:l=>i(l.target.checked)}),p.jsx(ne,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Pinned First"})]})]})})}const Ic=e=>{let t=!1;return()=>{t||(window.requestAnimationFrame(()=>{e(),t=!1}),t=!0)}},Sn=new Map;function Tc(){const e=dn({select:n=>n.pathname}),t=d.useRef(null);return d.useEffect(()=>{if(t.current?.parentElement){const{parentElement:n}=t.current,o=s=>{if(s!==0){Sn.set(e,s);return}Sn.delete(e)},r=Ic(()=>{if(t.current){const{scrollTop:s}=n;o(s)}});return n.scrollTop=Sn.get(e)??0,n.addEventListener("scroll",r),()=>{n.removeEventListener("scroll",r)}}},[e]),p.jsx("div",{ref:t,className:"hidden"})}const no=`
3
+ id
4
+ tabId
5
+ title
6
+ displayType
7
+ displayOptions {
8
+ tableColumns
9
+ tablePropertyKeys
10
+ boardGroupByPropertyKey
11
+ calendarDateField
12
+ calendarDatePropertyKey
13
+ }
14
+ tagNames
15
+ mode
16
+ propertyFilters {
17
+ key
18
+ name
19
+ valueType
20
+ operator
21
+ value
22
+ }
23
+ sortBy
24
+ sortOrder
25
+ limit
26
+ order
27
+ `;function Lh(){return Z(`query FetchViewWorkspace {
28
+ viewWorkspace {
29
+ activeTabId
30
+ tabs {
31
+ id
32
+ title
33
+ order
34
+ sections {
35
+ ${no}
36
+ }
37
+ }
38
+ }
39
+ }`)}function Nc(e){return Z(`query FetchViewSection($id: ID!) {
40
+ viewSection(id: $id) {
41
+ ${no}
42
+ }
43
+ }`,{id:e})}function Mh(e,{limit:t=25,offset:n=0,sortBy:o,sortOrder:r}={}){return Z(`query FetchViewSectionNotes(
44
+ $id: ID!
45
+ $pagination: PaginationInput
46
+ $sortBy: ViewSortBy
47
+ $sortOrder: ViewSortOrder
48
+ ) {
49
+ viewSectionNotes(id: $id, pagination: $pagination, sortBy: $sortBy, sortOrder: $sortOrder) {
50
+ totalCount
51
+ notes {
52
+ id
53
+ title
54
+ pinned
55
+ tags {
56
+ id
57
+ name
58
+ }
59
+ createdAt
60
+ updatedAt
61
+ properties {
62
+ key
63
+ name
64
+ value
65
+ valueType
66
+ option { id label value color order }
67
+ createdAt
68
+ updatedAt
69
+ }
70
+ }
71
+ }
72
+ }`,{id:e,pagination:{limit:t,offset:n},sortBy:o,sortOrder:r})}function Ih(e,t){return Z(`query FetchViewSectionCalendarNotes($id: ID!, $dateRange: DateRangeInput!) {
73
+ viewSectionCalendarNotes(id: $id, dateRange: $dateRange) {
74
+ id
75
+ title
76
+ calendarDate
77
+ }
78
+ }`,{id:e,dateRange:t})}function Th(e,{optionValue:t,limit:n=5,offset:o=0}){return Z(`query FetchViewSectionBoardColumn($id: ID!, $optionValue: String, $pagination: PaginationInput) {
79
+ viewSectionBoardColumn(id: $id, optionValue: $optionValue, pagination: $pagination) {
80
+ totalCount
81
+ notes {
82
+ id
83
+ title
84
+ updatedAt
85
+ }
86
+ }
87
+ }`,{id:e,optionValue:t,pagination:{limit:n,offset:o}})}function Nh(e){return Z(`mutation CreateViewTab($title: String!) {
88
+ createViewTab(title: $title) {
89
+ id
90
+ }
91
+ }`,{title:e})}function Dh(e,t){return Z(`mutation UpdateViewTab($id: ID!, $title: String!) {
92
+ updateViewTab(id: $id, title: $title) {
93
+ id
94
+ }
95
+ }`,{id:e,title:t})}function Oh(e){return Z(`mutation DeleteViewTab($id: ID!) {
96
+ deleteViewTab(id: $id)
97
+ }`,{id:e})}function Vh(e){return Z(`mutation SetActiveViewTab($id: ID!) {
98
+ setActiveViewTab(id: $id) {
99
+ activeTabId
100
+ tabs {
101
+ id
102
+ title
103
+ order
104
+ sections {
105
+ ${no}
106
+ }
107
+ }
108
+ }
109
+ }`,{id:e})}function jh(e){return Z(`mutation ReorderViewTabs($tabIds: [ID!]!) {
110
+ reorderViewTabs(tabIds: $tabIds) {
111
+ id
112
+ }
113
+ }`,{tabIds:e})}function kh(e,t){return Z(`mutation CreateViewSection($tabId: ID!, $input: ViewSectionInput!) {
114
+ createViewSection(tabId: $tabId, input: $input) {
115
+ id
116
+ }
117
+ }`,{tabId:e,input:t})}function Fh(e,t){return Z(`mutation UpdateViewSection($id: ID!, $input: ViewSectionInput!) {
118
+ updateViewSection(id: $id, input: $input) {
119
+ id
120
+ }
121
+ }`,{id:e,input:t})}function Hh(e){return Z(`mutation DeleteViewSection($id: ID!) {
122
+ deleteViewSection(id: $id)
123
+ }`,{id:e})}function Bh(e,t){return Z(`mutation ReorderViewSections($tabId: ID!, $sectionIds: [ID!]!) {
124
+ reorderViewSections(tabId: $tabId, sectionIds: $sectionIds) {
125
+ id
126
+ }
127
+ }`,{tabId:e,sectionIds:t})}const Dc=()=>null,Oc=e=>e instanceof Element?e instanceof HTMLElement&&(e.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(e.tagName))?!0:!!e.closest('button, [role="button"], [role="dialog"], [role="menu"], [role="menuitem"], [role="listbox"]'):!1,Vc=()=>{const e=$n();return d.useEffect(()=>{const t=n=>{n.defaultPrevented||!(n.metaKey||n.ctrlKey)||n.key.toLowerCase()!=="k"||Oc(n.target)||(n.preventDefault(),e({to:Mt,search:{query:"",page:1,mode:"hybrid"}}))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),null},jc="flex h-dvh min-h-0 w-full flex-row overflow-hidden",kc=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"),Fc=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","sm:w-[300px]","sm:border-r","min-[1000px]:static","min-[1000px]:w-auto","min-[1000px]:translate-x-0","min-[1000px]:pb-0","min-[1000px]:pointer-events-auto"),Hc="pointer-events-none -translate-x-full",Bc="pointer-events-auto translate-x-0",$c=ie("flex","h-full","min-h-0","min-w-0","flex-1","flex-col","overscroll-contain","[scrollbar-gutter:stable]"),Zc=ie("shrink-0","sticky","top-0","z-[1001]","border-b","border-border-subtle","bg-[var(--page-bg)]","max-[999px]:after:content-['']","max-[999px]:after:pointer-events-none","max-[999px]:after:absolute","max-[999px]:after:inset-y-0","max-[999px]:after:right-0","max-[999px]:after:w-12","max-[999px]:after:bg-[linear-gradient(to_right,transparent,var(--page-bg))]"),zc=ie("flex","items-center","overflow-x-auto","whitespace-nowrap","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden"),Uc=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-[999px]:after:h-24"),Kc=({sidebar:e,topNavigation:t,children:n,contentMode:o="page"})=>{const r=dn({select:l=>l.pathname}),[s,a]=d.useState(!1),i="site-layout-sidebar";return d.useEffect(()=>{a(!1)},[r]),p.jsxs("div",{className:jc,children:[p.jsx(Vc,{}),p.jsx("div",{className:"min-[1000px]:hidden",children:p.jsx("button",{type:"button",className:kc,"aria-label":"Toggle sidebar","aria-controls":i,"aria-expanded":s,onClick:()=>a(l=>!l),children:p.jsx($s,{className:"h-6 w-6"})})}),p.jsx("aside",{id:i,className:ie(Fc,s?Bc:Hc),children:e}),p.jsxs("main",{className:ie($c,o==="app"?"overflow-hidden":"overflow-x-hidden overflow-y-auto"),children:[p.jsx("div",{className:Zc,children:p.jsx("div",{className:zc,children:t})}),p.jsx("div",{className:o==="app"?"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden":Uc,children:n}),p.jsx(Tc,{})]})]})},Wr=e=>typeof e=="object"&&e!==null&&"value"in e&&typeof e.value=="string",qr=(e,t)=>({type:"error",category:"graphql",errors:[{code:"INVALID_RESPONSE_SHAPE",message:`GraphQL response field "${e}" is missing or invalid`,details:t}]}),Gc=async e=>{try{const t=await Z(`
128
+ query GetServerCache($key: String!) {
129
+ cache(key: $key) {
130
+ value
131
+ }
132
+ }
133
+ `,{key:e});if(t.type==="error")throw t;if(!Wr(t.cache))throw qr("cache",t);return t.cache.value}catch{return""}},Wc=async(e,t)=>{const n=await Z(`
134
+ mutation SetServerCache($key: String!, $value: String!) {
135
+ setCache(key: $key, value: $value) {
136
+ value
137
+ }
138
+ }
139
+ `,{key:e,value:encodeURIComponent(t)});return n.type==="error"?n:Wr(n.setCache)?{...n,setCache:n.setCache}:qr("setCache",n)},qc=()=>{const e=Zs(),t=Ca(),n=zn(),{data:o}=dr({queryKey:Xe.ui.heroBanner(),async queryFn(){return Gc("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 Wc("heroBanner","");if(r.type==="error"){t(r.errors[0]?.message??"Failed to remove hero banner");return}await n.invalidateQueries({queryKey:Xe.ui.heroBanner(),exact:!0})}},children:p.jsx(Ea,{className:"h-4 w-4",weight:"bold"})})]})}):null};function Xc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d.useMemo(()=>o=>{t.forEach(r=>r(o))},t)}const un=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Je(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function oo(e){return"nodeType"in e}function Y(e){var t,n;return e?Je(e)?e:oo(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function ro(e){const{Document:t}=Y(e);return e instanceof t}function It(e){return Je(e)?!1:e instanceof Y(e).HTMLElement}function Xr(e){return e instanceof Y(e).SVGElement}function et(e){return e?Je(e)?e.document:oo(e)?ro(e)?e:It(e)||Xr(e)?e.ownerDocument:document:document:document}const ge=un?d.useLayoutEffect:d.useEffect;function so(e){const t=d.useRef(e);return ge(()=>{t.current=e}),d.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 Yc(){const e=d.useRef(null),t=d.useCallback((o,r)=>{e.current=setInterval(o,r)},[]),n=d.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ct(e,t){t===void 0&&(t=[e]);const n=d.useRef(e);return ge(()=>{n.current!==e&&(n.current=e)},t),n}function Tt(e,t){const n=d.useRef();return d.useMemo(()=>{const o=e(n.current);return n.current=o,o},[...t])}function nn(e){const t=so(e),n=d.useRef(null),o=d.useCallback(r=>{r!==n.current&&t?.(r,n.current),n.current=r},[]);return[n,o]}function On(e){const t=d.useRef();return d.useEffect(()=>{t.current=e},[e]),t.current}let Rn={};function Nt(e,t){return d.useMemo(()=>{if(t)return t;const n=Rn[e]==null?0:Rn[e]+1;return Rn[e]=n,e+"-"+n},[e,t])}function Yr(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 u=s[l];u!=null&&(s[l]=u+e*c)}return s},{...t})}}const We=Yr(1),_t=Yr(-1);function Qc(e){return"clientX"in e&&"clientY"in e}function ao(e){if(!e)return!1;const{KeyboardEvent:t}=Y(e.target);return t&&e instanceof t}function Jc(e){if(!e)return!1;const{TouchEvent:t}=Y(e.target);return t&&e instanceof t}function Vn(e){if(Jc(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 Qc(e)?{x:e.clientX,y:e.clientY}:null}const At=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[At.Translate.toString(e),At.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),Ko="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function el(e){return e.matches(Ko)?e:e.querySelector(Ko)}const tl={display:"none"};function nl(e){let{id:t,value:n}=e;return G.createElement("div",{id:t,style:tl},n)}function ol(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 G.createElement("div",{id:t,style:r,role:"status","aria-live":o,"aria-atomic":!0},n)}function rl(){const[e,t]=d.useState("");return{announce:d.useCallback(o=>{o!=null&&t(o)},[]),announcement:e}}const Qr=d.createContext(null);function sl(e){const t=d.useContext(Qr);d.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function al(){const[e]=d.useState(()=>new Set),t=d.useCallback(o=>(e.add(o),()=>e.delete(o)),[e]);return[d.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 il={draggable:`
140
+ To pick up a draggable item, press the space bar.
141
+ While dragging, use the arrow keys to move the item.
142
+ Press space again to drop the item in its new position, or press escape to cancel.
143
+ `},cl={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 ll(e){let{announcements:t=cl,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=il}=e;const{announce:s,announcement:a}=rl(),i=Nt("DndLiveRegion"),[l,c]=d.useState(!1);if(d.useEffect(()=>{c(!0)},[]),sl(d.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 u=G.createElement(G.Fragment,null,G.createElement(nl,{id:o,value:r.draggable}),G.createElement(ol,{id:i,announcement:a}));return n?mt.createPortal(u,n):u}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 on(){}function Go(e,t){return d.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function dl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d.useMemo(()=>[...t].filter(o=>o!=null),[...t])}const de=Object.freeze({x:0,y:0});function Jr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function es(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function ul(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function Wo(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 ts(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function qo(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 hl=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=qo(t,t.left,t.top),s=[];for(const a of o){const{id:i}=a,l=n.get(i);if(l){const c=Jr(qo(l),r);s.push({id:i,data:{droppableContainer:a,value:c}})}}return s.sort(es)},fl=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Wo(t),s=[];for(const a of o){const{id:i}=a,l=n.get(i);if(l){const c=Wo(l),u=r.reduce((f,m,g)=>f+Jr(c[g],m),0),h=Number((u/4).toFixed(4));s.push({id:i,data:{droppableContainer:a,value:h}})}}return s.sort(es)};function pl(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,u=a*i,h=u/(l+c-u);return Number(h.toFixed(4))}return 0}const ml=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=pl(i,t);l>0&&r.push({id:a,data:{droppableContainer:s,value:l}})}}return r.sort(ul)};function gl(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function ns(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:de}function vl(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 bl=vl(1);function yl(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 xl(e,t,n){const o=yl(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)),u=r?e.width/r:e.width,h=s?e.height/s:e.height;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l}}const wl={ignoreTransform:!1};function tt(e,t){t===void 0&&(t=wl);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=Y(e).getComputedStyle(e);c&&(n=xl(n,c,u))}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 Xo(e){return tt(e,{ignoreTransform:!0})}function Sl(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 El(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 hn(e,t){const n=[];function o(r){if(t!=null&&n.length>=t||!r)return n;if(ro(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!It(r)||Xr(r)||n.includes(r))return n;const s=Y(e).getComputedStyle(r);return r!==e&&El(r,s)&&n.push(r),Rl(r,s)?n:o(r.parentNode)}return e?o(e):n}function os(e){const[t]=hn(e,1);return t??null}function En(e){return!un||!e?null:Je(e)?e:oo(e)?ro(e)||e===et(e).scrollingElement?window:It(e)?e:null:null}function rs(e){return Je(e)?e.scrollX:e.scrollLeft}function ss(e){return Je(e)?e.scrollY:e.scrollTop}function jn(e){return{x:rs(e),y:ss(e)}}var F;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(F||(F={}));function as(e){return!un||!e?!1:e===document.scrollingElement}function is(e){const t={x:0,y:0},n=as(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 Cl={x:.2,y:.2};function _l(e,t,n,o,r){let{top:s,left:a,right:i,bottom:l}=n;o===void 0&&(o=10),r===void 0&&(r=Cl);const{isTop:c,isBottom:u,isLeft:h,isRight:f}=is(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=F.Backward,g.y=o*Math.abs((t.top+v.height-s)/v.height)):!u&&l>=t.bottom-v.height&&(m.y=F.Forward,g.y=o*Math.abs((t.bottom-v.height-l)/v.height)),!f&&i>=t.right-v.width?(m.x=F.Forward,g.x=o*Math.abs((t.right-v.width-i)/v.width)):!h&&a<=t.left+v.width&&(m.x=F.Backward,g.x=o*Math.abs((t.left+v.width-a)/v.width)),{direction:m,speed:g}}function Al(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 cs(e){return e.reduce((t,n)=>We(t,jn(n)),de)}function Pl(e){return e.reduce((t,n)=>t+rs(n),0)}function Ll(e){return e.reduce((t,n)=>t+ss(n),0)}function Ml(e,t){if(t===void 0&&(t=tt),!e)return;const{top:n,left:o,bottom:r,right:s}=t(e);os(e)&&(r<=0||s<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Il=[["x",["left","right"],Pl],["y",["top","bottom"],Ll]];class io{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=hn(n),r=cs(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,i]of Il)for(const l of a)Object.defineProperty(this,l,{get:()=>{const c=i(o),u=r[s]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class yt{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 Tl(e){const{EventTarget:t}=Y(e);return e instanceof t?e:et(e)}function Cn(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 se;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(se||(se={}));function Yo(e){e.preventDefault()}function Nl(e){e.stopPropagation()}var M;(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"})(M||(M={}));const ls={start:[M.Space,M.Enter],cancel:[M.Esc],end:[M.Space,M.Enter,M.Tab]},Dl=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case M.Right:return{...n,x:n.x+25};case M.Left:return{...n,x:n.x-25};case M.Down:return{...n,y:n.y+25};case M.Up:return{...n,y:n.y-25}}};class co{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 yt(et(n)),this.windowListeners=new yt(Y(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(se.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&Ml(o),n(de)}handleKeyDown(t){if(ao(t)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:s=ls,coordinateGetter:a=Dl,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,u=c?{x:c.left,y:c.top}:de;this.referenceCoordinates||(this.referenceCoordinates=u);const h=a(t,{active:n,context:o.current,currentCoordinates:u});if(h){const f=_t(h,u),m={x:0,y:0},{scrollableAncestors:g}=o.current;for(const v of g){const b=t.code,{isTop:y,isRight:w,isLeft:R,isBottom:S,maxScroll:_,minScroll:P}=is(v),E=Al(v),x={x:Math.min(b===M.Right?E.right-E.width/2:E.right,Math.max(b===M.Right?E.left:E.left+E.width/2,h.x)),y:Math.min(b===M.Down?E.bottom-E.height/2:E.bottom,Math.max(b===M.Down?E.top:E.top+E.height/2,h.y))},C=b===M.Right&&!w||b===M.Left&&!R,I=b===M.Down&&!S||b===M.Up&&!y;if(C&&x.x!==h.x){const A=v.scrollLeft+f.x,L=b===M.Right&&A<=_.x||b===M.Left&&A>=P.x;if(L&&!f.y){v.scrollTo({left:A,behavior:i});return}L?m.x=v.scrollLeft-A:m.x=b===M.Right?v.scrollLeft-_.x:v.scrollLeft-P.x,m.x&&v.scrollBy({left:-m.x,behavior:i});break}else if(I&&x.y!==h.y){const A=v.scrollTop+f.y,L=b===M.Down&&A<=_.y||b===M.Up&&A>=P.y;if(L&&!f.x){v.scrollTo({top:A,behavior:i});return}L?m.y=v.scrollTop-A:m.y=b===M.Down?v.scrollTop-_.y:v.scrollTop-P.y,m.y&&v.scrollBy({top:-m.y,behavior:i});break}}this.handleMove(t,We(_t(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()}}co.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=ls,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 Qo(e){return!!(e&&"distance"in e)}function Jo(e){return!!(e&&"delay"in e)}class lo{constructor(t,n,o){var r;o===void 0&&(o=Tl(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=et(a),this.documentListeners=new yt(this.document),this.listeners=new yt(o),this.windowListeners=new yt(Y(a)),this.initialCoordinates=(r=Vn(s))!=null?r:de,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(se.Resize,this.handleCancel),this.windowListeners.add(se.DragStart,Yo),this.windowListeners.add(se.VisibilityChange,this.handleCancel),this.windowListeners.add(se.ContextMenu,Yo),this.documentListeners.add(se.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Jo(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Qo(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(se.Click,Nl,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(se.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=Vn(t))!=null?n:de,c=_t(r,l);if(!o&&i){if(Qo(i)){if(i.tolerance!=null&&Cn(c,i.tolerance))return this.handleCancel();if(Cn(c,i.distance))return this.handleStart()}if(Jo(i)&&Cn(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===M.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ol={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class uo extends lo{constructor(t){const{event:n}=t,o=et(n.target);super(t,Ol,o)}}uo.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 kn;(function(e){e[e.RightClick=2]="RightClick"})(kn||(kn={}));class jl extends lo{constructor(t){super(t,Vl,et(t.event.target))}}jl.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button===kn.RightClick?!1:(o?.({event:n}),!0)}}];const _n={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class kl extends lo{constructor(t){super(t,_n)}static setup(){return window.addEventListener(_n.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(_n.move.name,t)};function t(){}}}kl.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 xt;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(xt||(xt={}));var rn;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(rn||(rn={}));function Fl(e){let{acceleration:t,activator:n=xt.Pointer,canScroll:o,draggingRect:r,enabled:s,interval:a=5,order:i=rn.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:h,threshold:f}=e;const m=Bl({delta:h,disabled:!s}),[g,v]=Yc(),b=d.useRef({x:0,y:0}),y=d.useRef({x:0,y:0}),w=d.useMemo(()=>{switch(n){case xt.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case xt.DraggableRect:return r}},[n,r,l]),R=d.useRef(null),S=d.useCallback(()=>{const P=R.current;if(!P)return;const E=b.current.x*y.current.x,x=b.current.y*y.current.y;P.scrollBy(E,x)},[]),_=d.useMemo(()=>i===rn.TreeOrder?[...c].reverse():c,[i,c]);d.useEffect(()=>{if(!s||!c.length||!w){v();return}for(const P of _){if(o?.(P)===!1)continue;const E=c.indexOf(P),x=u[E];if(!x)continue;const{direction:C,speed:I}=_l(P,x,w,t,f);for(const A of["x","y"])m[A][C[A]]||(I[A]=0,C[A]=0);if(I.x>0||I.y>0){v(),R.current=P,g(S,a),b.current=I,y.current=C;return}}b.current={x:0,y:0},y.current={x:0,y:0},v()},[t,S,o,v,s,a,JSON.stringify(w),JSON.stringify(m),g,c,_,u,JSON.stringify(f)])}const Hl={x:{[F.Backward]:!1,[F.Forward]:!1},y:{[F.Backward]:!1,[F.Forward]:!1}};function Bl(e){let{delta:t,disabled:n}=e;const o=On(t);return Tt(r=>{if(n||!o||!r)return Hl;const s={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[F.Backward]:r.x[F.Backward]||s.x===-1,[F.Forward]:r.x[F.Forward]||s.x===1},y:{[F.Backward]:r.y[F.Backward]||s.y===-1,[F.Forward]:r.y[F.Forward]||s.y===1}}},[n,t,o])}function $l(e,t){const n=t!=null?e.get(t):void 0,o=n?n.node.current:null;return Tt(r=>{var s;return t==null?null:(s=o??r)!=null?s:null},[o,t])}function Zl(e,t){return d.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 Pt;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Pt||(Pt={}));var Fn;(function(e){e.Optimized="optimized"})(Fn||(Fn={}));const er=new Map;function zl(e,t){let{dragging:n,dependencies:o,config:r}=t;const[s,a]=d.useState(null),{frequency:i,measure:l,strategy:c}=r,u=d.useRef(e),h=b(),f=Ct(h),m=d.useCallback(function(y){y===void 0&&(y=[]),!f.current&&a(w=>w===null?y:w.concat(y.filter(R=>!w.includes(R))))},[f]),g=d.useRef(null),v=Tt(y=>{if(h&&!n)return er;if(!y||y===er||u.current!==e||s!=null){const w=new Map;for(let R of e){if(!R)continue;if(s&&s.length>0&&!s.includes(R.id)&&R.rect.current){w.set(R.id,R.rect.current);continue}const S=R.node.current,_=S?new io(l(S),S):null;R.rect.current=_,_&&w.set(R.id,_)}return w}return y},[e,s,n,h,l]);return d.useEffect(()=>{u.current=e},[e]),d.useEffect(()=>{h||m()},[n,h]),d.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),d.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 Pt.Always:return!1;case Pt.BeforeDragging:return n;default:return!n}}}function ds(e,t){return Tt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Ul(e,t){return ds(e,t)}function Kl(e){let{callback:t,disabled:n}=e;const o=so(t),r=d.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(o)},[o,n]);return d.useEffect(()=>()=>r?.disconnect(),[r]),r}function fn(e){let{callback:t,disabled:n}=e;const o=so(t),r=d.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(o)},[n]);return d.useEffect(()=>()=>r?.disconnect(),[r]),r}function Gl(e){return new io(tt(e),e)}function tr(e,t,n){t===void 0&&(t=Gl);const[o,r]=d.useState(null);function s(){r(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const a=Kl({callback(l){if(e)for(const c of l){const{type:u,target:h}=c;if(u==="childList"&&h instanceof HTMLElement&&h.contains(e)){s();break}}}}),i=fn({callback:s});return ge(()=>{s(),e?(i?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(i?.disconnect(),a?.disconnect())},[e]),o}function Wl(e){const t=ds(e);return ns(e,t)}const nr=[];function ql(e){const t=d.useRef(e),n=Tt(o=>e?o&&o!==nr&&e&&t.current&&e.parentNode===t.current.parentNode?o:hn(e):nr,[e]);return d.useEffect(()=>{t.current=e},[e]),n}function Xl(e){const[t,n]=d.useState(null),o=d.useRef(e),r=d.useCallback(s=>{const a=En(s.target);a&&n(i=>i?(i.set(a,jn(a)),new Map(i)):null)},[]);return d.useEffect(()=>{const s=o.current;if(e!==s){a(s);const i=e.map(l=>{const c=En(l);return c?(c.addEventListener("scroll",r,{passive:!0}),[c,jn(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=En(l);c?.removeEventListener("scroll",r)})}},[r,e]),d.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>We(s,a),de):cs(e):de,[e,t])}function or(e,t){t===void 0&&(t=[]);const n=d.useRef(null);return d.useEffect(()=>{n.current=null},t),d.useEffect(()=>{const o=e!==de;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?_t(e,n.current):de}function Yl(e){d.useEffect(()=>{if(!un)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 Ql(e,t){return d.useMemo(()=>e.reduce((n,o)=>{let{eventName:r,handler:s}=o;return n[r]=a=>{s(a,t)},n},{}),[e,t])}function us(e){return d.useMemo(()=>e?Sl(e):null,[e])}const rr=[];function Jl(e,t){t===void 0&&(t=tt);const[n]=e,o=us(n?Y(n):null),[r,s]=d.useState(rr);function a(){s(()=>e.length?e.map(l=>as(l)?o:new io(t(l),l)):rr)}const i=fn({callback:a});return ge(()=>{i?.disconnect(),a(),e.forEach(l=>i?.observe(l))},[e]),r}function ed(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return It(t)?t:e}function td(e){let{measure:t}=e;const[n,o]=d.useState(null),r=d.useCallback(c=>{for(const{target:u}of c)if(It(u)){o(h=>{const f=t(u);return h?{...h,width:f.width,height:f.height}:f});break}},[t]),s=fn({callback:r}),a=d.useCallback(c=>{const u=ed(c);s?.disconnect(),u&&s?.observe(u),o(u?t(u):null)},[t,s]),[i,l]=nn(a);return d.useMemo(()=>({nodeRef:i,rect:n,setRef:l}),[n,i,l])}const nd=[{sensor:uo,options:{}},{sensor:co,options:{}}],od={current:{}},qt={draggable:{measure:Xo},droppable:{measure:Xo,strategy:Pt.WhileDragging,frequency:Fn.Optimized},dragOverlay:{measure:tt}};class wt 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 rd={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new wt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:on},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:qt,measureDroppableContainers:on,windowRect:null,measuringScheduled:!1},sd={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:on,draggableNodes:new Map,over:null,measureDroppableContainers:on},pn=d.createContext(sd),hs=d.createContext(rd);function ad(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new wt}}}function id(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 wt(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 wt(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 wt(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function cd(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=d.useContext(pn),s=On(o),a=On(n?.id);return d.useEffect(()=>{if(!t&&!o&&s&&a!=null){if(!ao(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 u of[l.current,c.current]){if(!u)continue;const h=el(u);if(h){h.focus();break}}})}},[o,t,r,a,s]),null}function ld(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((r,s)=>s({transform:r,...o}),n):n}function dd(e){return d.useMemo(()=>({draggable:{...qt.draggable,...e?.draggable},droppable:{...qt.droppable,...e?.droppable},dragOverlay:{...qt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function ud(e){let{activeNode:t,measure:n,initialRect:o,config:r=!0}=e;const s=d.useRef(!1),{x:a,y:i}=typeof r=="boolean"?{x:r,y:r}:r;ge(()=>{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 u=n(c),h=ns(u,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=os(c);f&&f.scrollBy({top:h.y,left:h.x})}},[t,a,i,o,n])}const fs=d.createContext({...de,scaleX:1,scaleY:1});var Te;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Te||(Te={}));const hd=d.memo(function(t){var n,o,r,s;let{id:a,accessibility:i,autoScroll:l=!0,children:c,sensors:u=nd,collisionDetection:h=ml,measuring:f,modifiers:m,...g}=t;const v=d.useReducer(id,void 0,ad),[b,y]=v,[w,R]=al(),[S,_]=d.useState(Te.Uninitialized),P=S===Te.Initialized,{draggable:{active:E,nodes:x,translate:C},droppable:{containers:I}}=b,A=E!=null?x.get(E):null,L=d.useRef({initial:null,translated:null}),K=d.useMemo(()=>{var U;return E!=null?{id:E,data:(U=A?.data)!=null?U:od,rect:L}:null},[E,A]),N=d.useRef(null),[ue,W]=d.useState(null),[k,Ot]=d.useState(null),ve=Ct(g,Object.values(g)),st=Nt("DndDescribedBy",a),Vt=d.useMemo(()=>I.getEnabled(),[I]),q=dd(f),{droppableRects:be,measureDroppableContainers:Oe,measuringScheduled:at}=zl(Vt,{dragging:P,dependencies:[C.x,C.y],config:q.droppable}),oe=$l(x,E),jt=d.useMemo(()=>k?Vn(k):null,[k]),_e=Vs(),ye=Ul(oe,q.draggable.measure);ud({activeNode:E!=null?x.get(E):null,config:_e.layoutShiftCompensation,initialRect:ye,measure:q.draggable.measure});const T=tr(oe,q.draggable.measure,ye),it=tr(oe?oe.parentElement:null),he=d.useRef({activatorEvent:null,active:null,activeNode:oe,collisionRect:null,collisions:null,droppableRects:be,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ke=I.getNodeFor((n=he.current.over)==null?void 0:n.id),xe=td({measure:q.dragOverlay.measure}),Fe=(o=xe.nodeRef.current)!=null?o:oe,He=P?(r=xe.rect)!=null?r:T:null,fo=!!(xe.nodeRef.current&&xe.rect),po=Wl(fo?null:T),mn=us(Fe?Y(Fe):null),Ae=ql(P?ke??oe:null),kt=Jl(Ae),Ft=ld(m,{transform:{x:C.x-po.x,y:C.y-po.y,scaleX:1,scaleY:1},activatorEvent:k,active:K,activeNodeRect:T,containerNodeRect:it,draggingNodeRect:He,over:he.current.over,overlayNodeRect:xe.rect,scrollableAncestors:Ae,scrollableAncestorRects:kt,windowRect:mn}),mo=jt?We(jt,C):null,go=Xl(Ae),Ls=or(go),Ms=or(go,[T]),Be=We(Ft,Ls),$e=He?bl(He,Ft):null,ct=K&&$e?h({active:K,collisionRect:$e,droppableRects:be,droppableContainers:Vt,pointerCoordinates:mo}):null,vo=ts(ct,"id"),[Pe,bo]=d.useState(null),Is=fo?Ft:We(Ft,Ms),Ts=gl(Is,(s=Pe?.rect)!=null?s:null,T),gn=d.useRef(null),yo=d.useCallback((U,Q)=>{let{sensor:J,options:Le}=Q;if(N.current==null)return;const re=x.get(N.current);if(!re)return;const ee=U.nativeEvent,fe=new J({active:N.current,activeNode:re,event:ee,options:Le,context:he,onAbort($){if(!x.get($))return;const{onDragAbort:pe}=ve.current,we={id:$};pe?.(we),w({type:"onDragAbort",event:we})},onPending($,Me,pe,we){if(!x.get($))return;const{onDragPending:dt}=ve.current,Ie={id:$,constraint:Me,initialCoordinates:pe,offset:we};dt?.(Ie),w({type:"onDragPending",event:Ie})},onStart($){const Me=N.current;if(Me==null)return;const pe=x.get(Me);if(!pe)return;const{onDragStart:we}=ve.current,lt={activatorEvent:ee,active:{id:Me,data:pe.data,rect:L}};mt.unstable_batchedUpdates(()=>{we?.(lt),_(Te.Initializing),y({type:j.DragStart,initialCoordinates:$,active:Me}),w({type:"onDragStart",event:lt}),W(gn.current),Ot(ee)})},onMove($){y({type:j.DragMove,coordinates:$})},onEnd:Ze(j.DragEnd),onCancel:Ze(j.DragCancel)});gn.current=fe;function Ze($){return async function(){const{active:pe,collisions:we,over:lt,scrollAdjustedTranslate:dt}=he.current;let Ie=null;if(pe&&dt){const{cancelDrop:ut}=ve.current;Ie={activatorEvent:ee,active:pe,collisions:we,delta:dt,over:lt},$===j.DragEnd&&typeof ut=="function"&&await Promise.resolve(ut(Ie))&&($=j.DragCancel)}N.current=null,mt.unstable_batchedUpdates(()=>{y({type:$}),_(Te.Uninitialized),bo(null),W(null),Ot(null),gn.current=null;const ut=$===j.DragEnd?"onDragEnd":"onDragCancel";if(Ie){const vn=ve.current[ut];vn?.(Ie),w({type:ut,event:Ie})}})}}},[x]),Ns=d.useCallback((U,Q)=>(J,Le)=>{const re=J.nativeEvent,ee=x.get(Le);if(N.current!==null||!ee||re.dndKit||re.defaultPrevented)return;const fe={active:ee};U(J,Q.options,fe)===!0&&(re.dndKit={capturedBy:Q.sensor},N.current=Le,yo(J,Q))},[x,yo]),xo=Zl(u,Ns);Yl(u),ge(()=>{T&&S===Te.Initializing&&_(Te.Initialized)},[T,S]),d.useEffect(()=>{const{onDragMove:U}=ve.current,{active:Q,activatorEvent:J,collisions:Le,over:re}=he.current;if(!Q||!J)return;const ee={active:Q,activatorEvent:J,collisions:Le,delta:{x:Be.x,y:Be.y},over:re};mt.unstable_batchedUpdates(()=>{U?.(ee),w({type:"onDragMove",event:ee})})},[Be.x,Be.y]),d.useEffect(()=>{const{active:U,activatorEvent:Q,collisions:J,droppableContainers:Le,scrollAdjustedTranslate:re}=he.current;if(!U||N.current==null||!Q||!re)return;const{onDragOver:ee}=ve.current,fe=Le.get(vo),Ze=fe&&fe.rect.current?{id:fe.id,rect:fe.rect.current,data:fe.data,disabled:fe.disabled}:null,$={active:U,activatorEvent:Q,collisions:J,delta:{x:re.x,y:re.y},over:Ze};mt.unstable_batchedUpdates(()=>{bo(Ze),ee?.($),w({type:"onDragOver",event:$})})},[vo]),ge(()=>{he.current={activatorEvent:k,active:K,activeNode:oe,collisionRect:$e,collisions:ct,droppableRects:be,draggableNodes:x,draggingNode:Fe,draggingNodeRect:He,droppableContainers:I,over:Pe,scrollableAncestors:Ae,scrollAdjustedTranslate:Be},L.current={initial:He,translated:$e}},[K,oe,ct,$e,x,Fe,He,be,I,Pe,Ae,Be]),Fl({..._e,delta:C,draggingRect:$e,pointerCoordinates:mo,scrollableAncestors:Ae,scrollableAncestorRects:kt});const Ds=d.useMemo(()=>({active:K,activeNode:oe,activeNodeRect:T,activatorEvent:k,collisions:ct,containerNodeRect:it,dragOverlay:xe,draggableNodes:x,droppableContainers:I,droppableRects:be,over:Pe,measureDroppableContainers:Oe,scrollableAncestors:Ae,scrollableAncestorRects:kt,measuringConfiguration:q,measuringScheduled:at,windowRect:mn}),[K,oe,T,k,ct,it,xe,x,I,be,Pe,Oe,Ae,kt,q,at,mn]),Os=d.useMemo(()=>({activatorEvent:k,activators:xo,active:K,activeNodeRect:T,ariaDescribedById:{draggable:st},dispatch:y,draggableNodes:x,over:Pe,measureDroppableContainers:Oe}),[k,xo,K,T,y,st,x,Pe,Oe]);return G.createElement(Qr.Provider,{value:R},G.createElement(pn.Provider,{value:Os},G.createElement(hs.Provider,{value:Ds},G.createElement(fs.Provider,{value:Ts},c)),G.createElement(cd,{disabled:i?.restoreFocus===!1})),G.createElement(ll,{...i,hiddenTextDescribedById:st}));function Vs(){const U=ue?.autoScrollEnabled===!1,Q=typeof l=="object"?l.enabled===!1:l===!1,J=P&&!U&&!Q;return typeof l=="object"?{...l,enabled:J}:{enabled:J}}}),fd=d.createContext(null),sr="button",pd="Draggable";function md(e){let{id:t,data:n,disabled:o=!1,attributes:r}=e;const s=Nt(pd),{activators:a,activatorEvent:i,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:h,over:f}=d.useContext(pn),{role:m=sr,roleDescription:g="draggable",tabIndex:v=0}=r??{},b=l?.id===t,y=d.useContext(b?fs:fd),[w,R]=nn(),[S,_]=nn(),P=Ql(a,t),E=Ct(n);ge(()=>(h.set(t,{id:t,key:s,node:w,activatorNode:S,data:E}),()=>{const C=h.get(t);C&&C.key===s&&h.delete(t)}),[h,t]);const x=d.useMemo(()=>({role:m,tabIndex:v,"aria-disabled":o,"aria-pressed":b&&m===sr?!0:void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[o,m,v,b,g,u.draggable]);return{active:l,activatorEvent:i,activeNodeRect:c,attributes:x,isDragging:b,listeners:o?void 0:P,node:w,over:f,setNodeRef:R,setActivatorNodeRef:_,transform:y}}function gd(){return d.useContext(hs)}const vd="Droppable",bd={timeout:25};function yd(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:r}=e;const s=Nt(vd),{active:a,dispatch:i,over:l,measureDroppableContainers:c}=d.useContext(pn),u=d.useRef({disabled:n}),h=d.useRef(!1),f=d.useRef(null),m=d.useRef(null),{disabled:g,updateMeasurementsFor:v,timeout:b}={...bd,...r},y=Ct(v??o),w=d.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]),R=fn({callback:w,disabled:g||!a}),S=d.useCallback((x,C)=>{R&&(C&&(R.unobserve(C),h.current=!1),x&&R.observe(x))},[R]),[_,P]=nn(S),E=Ct(t);return d.useEffect(()=>{!R||!_.current||(R.disconnect(),h.current=!1,R.observe(_.current))},[_,R]),d.useEffect(()=>(i({type:j.RegisterDroppable,element:{id:o,key:s,disabled:n,node:_,rect:f,data:E}}),()=>i({type:j.UnregisterDroppable,key:s,id:o})),[o]),d.useEffect(()=>{n!==u.current.disabled&&(i({type:j.SetDroppableDisabled,id:o,key:s,disabled:n}),u.current.disabled=n)},[o,s,n,i]),{active:a,rect:f,isOver:l?.id===o,node:_,over:l,setNodeRef:P}}const $h=e=>{let{transform:t}=e;return{...t,y:0}},xd=e=>{let{transform:t}=e;return{...t,x:0}};function ps(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function wd(e,t){return e.reduce((n,o,r)=>{const s=t.get(o);return s&&(n[r]=s),n},Array(e.length))}function zt(e){return e!==null&&e>=0}function Sd(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 Rd(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Ut={scaleX:1,scaleY:1},Zh=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=Ed(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,...Ut}:null}return a>r&&a<=s?{x:-i.width-l,y:0,...Ut}:a<r&&a>=s?{x:i.width+l,y:0,...Ut}:{x:0,y:0,...Ut}};function Ed(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 ms=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const s=ps(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}},Kt={scaleX:1,scaleY:1},Cd=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,...Kt}:null}const l=_d(s,r,n);return r>n&&r<=a?{x:0,y:-i.height-l,...Kt}:r<n&&r>=a?{x:0,y:i.height+l,...Kt}:{x:0,y:0,...Kt}};function _d(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 gs="Sortable",vs=G.createContext({activeIndex:-1,containerId:gs,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ms,disabled:{draggable:!1,droppable:!1}});function Ad(e){let{children:t,id:n,items:o,strategy:r=ms,disabled:s=!1}=e;const{active:a,dragOverlay:i,droppableRects:l,over:c,measureDroppableContainers:u}=gd(),h=Nt(gs,n),f=i.rect!==null,m=d.useMemo(()=>o.map(P=>typeof P=="object"&&"id"in P?P.id:P),[o]),g=a!=null,v=a?m.indexOf(a.id):-1,b=c?m.indexOf(c.id):-1,y=d.useRef(m),w=!Sd(m,y.current),R=b!==-1&&v===-1||w,S=Rd(s);ge(()=>{w&&g&&u(m)},[w,m,g,u]),d.useEffect(()=>{y.current=m},[m]);const _=d.useMemo(()=>({activeIndex:v,containerId:h,disabled:S,disableTransforms:R,items:m,overIndex:b,useDragOverlay:f,sortedRects:wd(m,l),strategy:r}),[v,h,S.draggable,S.droppable,R,m,b,l,f,r]);return G.createElement(vs.Provider,{value:_},t)}const Pd=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return ps(n,o,r).indexOf(t)},Ld=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},Md={duration:200,easing:"ease"},bs="transform",Id=At.Transition.toString({property:bs,duration:0,easing:"linear"}),Td={roleDescription:"sortable"};function Nd(e){let{disabled:t,index:n,node:o,rect:r}=e;const[s,a]=d.useState(null),i=d.useRef(n);return ge(()=>{if(!t&&n!==i.current&&o.current){const l=r.current;if(l){const c=tt(o.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&a(u)}}n!==i.current&&(i.current=n)},[t,n,o,r]),d.useEffect(()=>{s&&a(null)},[s]),s}function Dd(e){let{animateLayoutChanges:t=Ld,attributes:n,disabled:o,data:r,getNewIndex:s=Pd,id:a,strategy:i,resizeObserverConfig:l,transition:c=Md}=e;const{items:u,containerId:h,activeIndex:f,disabled:m,disableTransforms:g,sortedRects:v,overIndex:b,useDragOverlay:y,strategy:w}=d.useContext(vs),R=Od(o,m),S=u.indexOf(a),_=d.useMemo(()=>({sortable:{containerId:h,index:S,items:u},...r}),[h,r,S,u]),P=d.useMemo(()=>u.slice(u.indexOf(a)),[u,a]),{rect:E,node:x,isOver:C,setNodeRef:I}=yd({id:a,data:_,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:P,...l}}),{active:A,activatorEvent:L,activeNodeRect:K,attributes:N,setNodeRef:ue,listeners:W,isDragging:k,over:Ot,setActivatorNodeRef:ve,transform:st}=md({id:a,data:_,attributes:{...Td,...n},disabled:R.draggable}),Vt=Xc(I,ue),q=!!A,be=q&&!g&&zt(f)&&zt(b),Oe=!y&&k,at=Oe&&be?st:null,jt=be?at??(i??w)({rects:v,activeNodeRect:K,activeIndex:f,overIndex:b,index:S}):null,_e=zt(f)&&zt(b)?s({id:a,items:u,activeIndex:f,overIndex:b}):S,ye=A?.id,T=d.useRef({activeId:ye,items:u,newIndex:_e,containerId:h}),it=u!==T.current.items,he=t({active:A,containerId:h,isDragging:k,isSorting:q,id:a,index:S,items:u,newIndex:T.current.newIndex,previousItems:T.current.items,previousContainerId:T.current.containerId,transition:c,wasDragging:T.current.activeId!=null}),ke=Nd({disabled:!he,index:S,node:x,rect:E});return d.useEffect(()=>{q&&T.current.newIndex!==_e&&(T.current.newIndex=_e),h!==T.current.containerId&&(T.current.containerId=h),u!==T.current.items&&(T.current.items=u)},[q,_e,h,u]),d.useEffect(()=>{if(ye===T.current.activeId)return;if(ye!=null&&T.current.activeId==null){T.current.activeId=ye;return}const Fe=setTimeout(()=>{T.current.activeId=ye},50);return()=>clearTimeout(Fe)},[ye]),{active:A,activeIndex:f,attributes:N,data:_,rect:E,index:S,newIndex:_e,items:u,isOver:C,isSorting:q,isDragging:k,listeners:W,node:x,overIndex:b,over:Ot,setNodeRef:Vt,setActivatorNodeRef:ve,setDroppableNodeRef:I,setDraggableNodeRef:ue,transform:ke??jt,transition:xe()};function xe(){if(ke||it&&T.current.newIndex===S)return Id;if(!(Oe&&!ao(L)||!c)&&(q||he))return At.Transition.toString({...c,property:bs})}}function Od(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 sn(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 Vd=[M.Down,M.Right,M.Up,M.Left],jd=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:s,over:a,scrollableAncestors:i}}=t;if(Vd.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 M.Down:o.top<f.top&&l.push(h);break;case M.Up:o.top>f.top&&l.push(h);break;case M.Left:o.left>f.left&&l.push(h);break;case M.Right:o.left<f.left&&l.push(h);break}});const c=fl({collisionRect:o,droppableRects:r,droppableContainers:l});let u=ts(c,"id");if(u===a?.id&&c.length>1&&(u=c[1].id),u!=null){const h=s.get(n.id),f=s.get(u),m=f?r.get(f.id):null,g=f?.node.current;if(g&&m&&h&&f){const b=hn(g).some((P,E)=>i[E]!==P),y=ys(h,f),w=kd(h,f),R=b||!y?{x:0,y:0}:{x:w?o.width-m.width:0,y:w?o.height-m.height:0},S={x:m.left,y:m.top};return R.x&&R.y?S:_t(S,R)}}}};function ys(e,t){return!sn(e)||!sn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function kd(e,t){return!sn(e)||!sn(t)||!ys(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const Fd=e=>{const{data:t}=mr({queryKey:Xe.notes.pinned(),async queryFn(){const n=await Z(`
144
+ query FetchPinnedNotes {
145
+ pinnedNotes {
146
+ id
147
+ title
148
+ order
149
+ }
150
+ }
151
+ `);if(n.type==="error")throw n;return n.pinnedNotes}});return p.jsx(p.Fragment,{children:e.render(t)})},Hd="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",Bd="focus-ring-soft block truncate rounded-[10px] px-1.5 py-1 outline-none transition-colors",$d=(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 Zd({id:e,title:t,isActive:n=!1,children:o}){const{attributes:r,listeners:s,setNodeRef:a,setActivatorNodeRef:i,transform:l,transition:c,isDragging:u}=Dd({id:e}),h={transform:At.Transform.toString(l),transition:c,opacity:u?.5:1};return p.jsxs("div",{ref:a,style:h,className:ie("group flex min-h-[38px] items-center gap-1.5 rounded-[12px] px-1.5 py-1 transition-colors",n?"bg-hover-subtle":"hover:bg-hover-subtle/70"),children:[p.jsx("button",{type:"button",ref:i,"aria-label":`Reorder note ${t??"Untitled"}`,title:"Drag to reorder",...r,...s,className:ie(Hd,u?"cursor-grabbing":"cursor-grab"),children:p.jsx(gc,{className:"size-4"})}),p.jsx(ne,{as:"div",truncate:!0,variant:"meta",weight:"medium",className:"min-w-0 flex-1",children:o})]})}function zd({notes:e,pathname:t,pinnedItems:n,setPinnedItems:o,handleDragEnd:r,sensors:s}){d.useEffect(()=>{o(e)},[e,o]);const a=n.length>0?n:e;return a.length===0?null:p.jsx(hd,{sensors:s,collisionDetection:hl,onDragEnd:r,modifiers:[xd],children:p.jsx(Ad,{items:a.map(i=>i.id),strategy:Cd,children:a.map(i=>p.jsx(Zd,{id:i.id,title:i.title||"Untitled",isActive:t===`/${i.id}`,children:p.jsx(Et,{"aria-current":t===`/${i.id}`?"page":void 0,className:ie(Bd,t===`/${i.id}`?"text-fg-default":"text-fg-secondary hover:text-fg-default"),to:Un,params:{id:i.id},children:i.title||"Untitled"})},i.id))})})}const Ud=()=>{const e=dn({select:i=>i.pathname}),t=zn(),[n,o]=d.useState([]),r=zs({mutationFn:Aa,onSuccess:()=>{t.invalidateQueries({queryKey:Xe.notes.pinned(),exact:!0})}}),s=dl(Go(uo,{activationConstraint:{distance:8}}),Go(co,{coordinateGetter:jd})),a=i=>{const{active:l,over:c}=i;c&&l.id!==c.id&&o(u=>{const h=$d(u,String(l.id),String(c.id));return h?(r.mutate(h.orders),h.nextItems):u})};return p.jsx("div",{className:"border-l border-border-subtle/70 pl-1.5",children:p.jsx(gr,{fallback:p.jsxs("div",{className:"space-y-1",children:[p.jsx(gt,{height:"40px",opacity:.4}),p.jsx(gt,{height:"40px",opacity:.4})]}),errorTitle:"Failed to load pinned notes",errorDescription:"Retry loading the pinned note list.",renderError:({error:i,retry:l})=>p.jsx(_a,{title:"Failed to load pinned notes",description:"Retry loading the pinned note list.",error:i,onRetry:l,showBackAction:!1,showHomeAction:!1}),children:p.jsx(Fd,{render:i=>i.length>0?p.jsx(zd,{notes:i,pathname:e,pinnedItems:n,setPinnedItems:o,handleDragEnd:a,sensors:s}):p.jsx(ne,{as:"div",variant:"meta",tone:"secondary",className:"px-2 py-2.5 leading-6",children:"Pin a note from the note toolbar to keep it here."})})})})},Kd=()=>p.jsx("section",{className:"p-3 pt-0","aria-label":"Pinned notes",children:p.jsx(Ud,{})}),Gd="p-3 pb-0",Wd="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",qd="flex items-center gap-2.5",Xd="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-cta text-fg-on-filled",Yd="flex flex-col",Qd="h-4 w-4 text-fg-tertiary transition-colors group-hover:text-fg-default",Jd=()=>{const{onCreate:e}=ur();return p.jsx("div",{className:Gd,children:p.jsxs("button",{type:"button",className:Wd,onClick:()=>e(),children:[p.jsxs("span",{className:qd,children:[p.jsx("span",{className:Xd,children:p.jsx(bc,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:Yd,children:[p.jsx(ne,{variant:"meta",weight:"semibold",tracking:"tight",children:"Capture"}),p.jsx(ne,{variant:"label",tone:"secondary",children:"Open a new note"})]})]}),p.jsx(Pa,{className:Qd,weight:"bold"})]})})},eu=/Mac|iPhone|iPad|iPod/i,tu=()=>typeof navigator>"u"?"":`${navigator.platform} ${navigator.userAgent}`,xs=(e=tu())=>eu.test(e)?"⌘K":"Ctrl+K",nu="focus-ring-soft surface-base group flex min-h-14 w-full items-center justify-between gap-3 px-3 py-2.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",ou=()=>{const e=$n(),t=xs(),n=()=>{e({to:Mt,search:{query:"",page:1,mode:"hybrid"}})};return p.jsxs("button",{type:"button",className:nu,"aria-label":"Open detailed search","aria-keyshortcuts":"Meta+K Control+K",onClick:n,children:[p.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[p.jsx("span",{className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-muted text-fg-secondary transition-colors group-hover:text-fg-default",children:p.jsx(Rr,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:"flex min-w-0 flex-col",children:[p.jsx(ne,{as:"span",variant:"meta",weight:"semibold",tracking:"tight",children:"Search"}),p.jsx(ne,{as:"span",variant:"label",tone:"secondary",children:"Find a memory"})]})]}),p.jsx("span",{className:"shrink-0 rounded-[8px] bg-muted px-1.5 py-1 text-label font-medium text-fg-tertiary",children:t})]})},ru=()=>p.jsx("div",{className:"p-3",children:p.jsx(ou,{})}),nt="/api/integration-admin/connections",su=async()=>(await ae.get(nt)).data.connections,zh=async e=>(await ae.post(nt,e)).data,Uh=async({id:e,...t})=>(await ae.patch(`${nt}/${encodeURIComponent(e)}`,t)).data,Kh=async e=>{await ae.delete(`${nt}/${encodeURIComponent(e)}`)},Gh=async e=>(await ae.post(`${nt}/${encodeURIComponent(e)}/token/rotate`)).data,Wh=async e=>{await ae.post(`${nt}/${encodeURIComponent(e)}/token/revoke`)};function au(){const{data:e=[]}=dr({queryKey:Xe.integrations.list(),queryFn:su});return e.filter(t=>t.enabled&&t.pinned&&t.manifest.launch).map(t=>p.jsxs(Et,{to:Kn,params:{connectionId:t.id},title:t.manifest.description,className:"flex shrink-0 items-center gap-2 border-l border-border-subtle px-3 py-2 text-sm text-fg-secondary hover:text-fg-default",children:[p.jsx(vc,{className:"size-5"}),p.jsx("span",{children:t.manifest.name})]},t.id))}const iu=[{name:"Search",path:Mt,icon:Rr},{name:"Notes",path:an,icon:Zr},{name:"Views",path:Gn,icon:Us},{name:"Graph",path:vr,icon:Xa},{name:"Calendar",path:br,icon:mc},{name:"Reminders",path:yr,icon:Ks},{name:"Tags",path:xr,icon:Gs},{name:"Setting",path:wr,icon:Ws}],cu=()=>{const e=dn({select:n=>n.pathname}),t=xs();return p.jsxs("nav",{"aria-label":"Primary navigation",className:"flex items-center gap-1 px-4 py-2.5",children:[iu.map((n,o)=>{const r=e===n.path||n.path!==an&&e.startsWith(`${n.path}/`),s=n.path===Mt?t:void 0;return p.jsxs(d.Fragment,{children:[o>0&&p.jsx("span",{className:"h-3.5 w-px shrink-0 bg-border-subtle"}),p.jsx(Et,{to:n.path,"aria-keyshortcuts":s?"Meta+K Control+K":void 0,title:s?`${n.name} (${s})`:void 0,children:p.jsxs("div",{className:`flex min-w-26 items-center justify-center gap-2 border-b px-2 py-2 transition-colors ${r?"border-fg-muted text-fg-default":"border-transparent text-fg-secondary hover:border-border-subtle hover:text-fg-default"}`,children:[p.jsx(n.icon,{className:"size-5",weight:r?"fill":"regular"}),p.jsx(ne,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:n.name})]})})]},n.path)}),p.jsx(au,{})]})},lu=({children:e})=>{const t=oc({select:n=>n.some(o=>o.routeId===Kn)});return p.jsx(Kc,{contentMode:t?"app":"page",sidebar:p.jsxs(p.Fragment,{children:[p.jsx(qc,{}),p.jsx(Jd,{}),p.jsx(ru,{}),p.jsx(Kd,{}),p.jsx(Dc,{})]}),topNavigation:p.jsx(cu,{}),children:e})},ws=100,Ss=[50,ws,200];function qh(e){return Ss.includes(e)}const Hn=1,du=100,uu=100,hu=256,Rs=1e5,fu=50,pu=1970,mu=9999,ar=25,Ye=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),ho=e=>e.length>0&&e.length<=hu,gu=e=>typeof e=="number"&&Number.isInteger(e)&&e>1&&e<=Rs?e:void 0,vu=e=>typeof e=="number"&&Number.isInteger(e)&&e>1?Math.min(e,fu):void 0,bu=e=>{if(!Ye(e))return;const t=e.by,n=e.order;if(!(t!=="title"&&t!=="createdAt"&&t!=="updatedAt"||n!=="asc"&&n!=="desc"))return{by:t,order:n}},yu=e=>{if(!Ye(e))return;const t=e.year,n=e.month;if(!(typeof t!="number"||!Number.isInteger(t)||t<pu||t>mu||typeof n!="number"||!Number.isInteger(n)||n<1||n>12))return{year:t,month:n}},Es=e=>{if(!Ye(e))return;const t=gu(e.page),n=bu(e.sort),o=yu(e.calendar),r=Ye(e.columns)?Object.fromEntries(Object.entries(e.columns).filter(([s])=>ho(s)).slice(0,uu).flatMap(([s,a])=>{const i=vu(a);return i===void 0?[]:[[s,i]]})):{};if(!(t===void 0&&Object.keys(r).length===0&&n===void 0&&o===void 0))return{...t===void 0?{}:{page:t},...Object.keys(r).length===0?{}:{columns:r},...n===void 0?{}:{sort:n},...o===void 0?{}:{calendar:o}}},Bn=e=>{if(!Ye(e)||e.version!==Hn||!Ye(e.sections))return;const t=Object.fromEntries(Object.entries(e.sections).filter(([n])=>ho(n)).slice(0,du).flatMap(([n,o])=>{const r=Es(o);return r===void 0?[]:[[n,r]]}));return Object.keys(t).length===0?void 0:{version:Hn,sections:t}},xu=(e,t)=>e?.sections[t]??{},wu=(e,t,n)=>{if(!ho(t))return Bn(e);const o=Bn(e),r=xu(o,t),s=Es(typeof n=="function"?n(r):n),a=Object.fromEntries(Object.entries({...o?.sections??{},[t]:s}).filter(i=>i[1]!==void 0));return Object.keys(a).length===0?void 0:{version:Hn,sections:a}},Su=(e,t,n)=>{if(!Number.isSafeInteger(t)||t<=1)return;const o=Number.isSafeInteger(n)&&n>0?n:ar,r=Math.min(Number.MAX_SAFE_INTEGER,(t-1)*ar),s=Math.min(Rs,Math.floor(r/o)+1);return wu(void 0,e,{page:s})},Ru=["updatedAt","createdAt"],Eu=["referenceCount","name"],Cs=["asc","desc"],Cu=["create","update"],_u=["hybrid","lexical","semantic"],Au=["open","completed"],Pu=["all","overdue","today","upcoming"],Lu=["all","high","medium","low"],Dt=e=>Array.isArray(e)?e[0]:e,Ee=(e,t,{min:n=1,max:o=Number.MAX_SAFE_INTEGER}={})=>{const r=Dt(e),s=typeof r=="number"?r:typeof r=="string"?Number(r):Number.NaN;return!Number.isInteger(s)||s<n||s>o?t:s},_s=(e,t,n)=>{const o=Ee(e,Number.NaN);return t.includes(o)?o:n},Mu=(e,t=!1)=>{const n=Dt(e);return n===!0||n==="true"?!0:n===!1||n==="false"?!1:t},ot=(e,t="")=>{const n=Dt(e);return typeof n=="string"?n:t},Re=(e,t,n)=>{const o=Dt(e);return typeof o!="string"?n:t.includes(o)?o:n},Iu=e=>({page:Ee(e.page,1),limit:_s(e.limit,fr,pr),sortBy:Re(e.sortBy,Ru,"updatedAt"),sortOrder:Re(e.sortOrder,Cs,"desc"),pinnedFirst:Mu(e.pinnedFirst,!1)}),rt=e=>({page:Ee(e.page,1)}),Tu=e=>{const t=Re(e.status,Au,"open"),n=Re(e.scope,Pu,"all");return{page:Ee(e.page,1),status:t,scope:t==="completed"?"all":n,priority:Re(e.priority,Lu,"all")}},Nu=e=>({page:Ee(e.page,1),query:ot(e.query,""),mode:Re(e.mode,_u,"hybrid")}),Du=e=>({page:Ee(e.page,1),query:ot(e.query,""),limit:_s(e.limit,Ss,ws),sortBy:Re(e.sortBy,Eu,"referenceCount"),sortOrder:Re(e.sortOrder,Cs,"desc")}),Ou=e=>({year:Ee(e.year,wo().year(),{min:1970,max:9999}),month:Ee(e.month,wo().month()+1,{min:1,max:12}),type:Re(e.type,Cu,"create")}),Vu=e=>{const t=ot(e.selected,"").trim();return t?{selected:t}:{}},ju=e=>{const t=ot(e.connection).trim();return t?{connection:t}:{}},ku=e=>{const t=Fr(Dt(e.app));return t&&t!=="/"?{app:t}:{}},Fu=e=>{const t=ot(e.tab,"").trim(),n=Bn(e.state);return{...t?{tab:t}:{},...n?{state:n}:{}}},Hu=e=>({page:Ee(e.page,1),sectionId:ot(e.sectionId,"")}),Bu=e=>{const{data:t}=mr({queryKey:Xe.notes.list(e.searchParams),async queryFn(){const n=await La(e.searchParams);if(n.type==="error")throw n;return n.allNotes}});return e.render(t)};function $u({id:e,title:t,tags:n,pinned:o,updatedAt:r,onPinned:s,onDelete:a}){const i=Ma(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(qs,{className:"h-3.5 w-3.5",weight:"fill"}),p.jsx("span",{className:"sr-only",children:"Pinned note"})]})}),p.jsxs("div",{className:"flex h-full flex-col gap-2.5",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2.5",children:[p.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1",children:p.jsxs(ne,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Updated ",i]})}),p.jsx(Ia,{button:p.jsx(Xs,{label:"Note actions",size:"sm"}),items:[{name:o?"Unpin":"Pin",onClick:()=>s?.()},{name:"Delete",onClick:()=>a?.()}]})]}),p.jsxs("div",{className:"flex flex-1 flex-col justify-between gap-2.5",children:[p.jsx(ne,{as:"div",variant:"body",weight:"semibold",tracking:"tight",className:"leading-[1.45]",children:p.jsx(Et,{className:"line-clamp-2 transition-colors hover:text-fg-default/85",to:Un,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(Et,{to:Sr,params:{id:l.id},search:{page:1},children:p.jsx(ne,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"inline-flex items-center rounded-full border border-border-subtle bg-transparent px-2 py-0.5 transition-colors hover:bg-hover-subtle hover:text-fg-default",children:l.name})},l.id))})]})]})]},e)}const ir=Ta(an);function Zu(){const e=ir.useNavigate(),{limit:t,page:n,sortBy:o,sortOrder:r,pinnedFirst:s}=ir.useSearch(),{onDelete:a,onPinned:i,deleteWarningDialog:l}=ur(),c=u=>{e({search:h=>({...h,...u})})};return p.jsxs(Na,{title:"",variant:"none",children:[p.jsxs("div",{className:"flex flex-col gap-5",children:[p.jsx(Mc,{itemsPerPage:t,onItemsPerPageChange:u=>c({limit:u,page:1}),sortBy:o,onSortByChange:u=>c({sortBy:u,page:1}),sortOrder:r,onSortOrderChange:u=>c({sortOrder:u,page:1}),pinnedFirst:s,onPinnedFirstChange:u=>c({pinnedFirst:u,page:1})}),p.jsx(gr,{fallback:p.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[p.jsx(gt,{height:"112px"}),p.jsx(gt,{height:"112px"}),p.jsx(gt,{height:"112px"})]}),errorTitle:"Failed to load notes",errorDescription:"Retry loading the current note list.",resetKeys:[n,t,o,r,s],children:p.jsx(Bu,{searchParams:{offset:(n-1)*t,limit:t,sortBy:o,sortOrder:r,pinnedFirst:s},render:({notes:u,totalCount:h})=>p.jsx(Uo,{fallback:p.jsx(Oa,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:u.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"grid-auto-cards grid gap-5",children:u.map(f=>p.jsx($u,{...f,onPinned:()=>i(f.id,f.pinned),onDelete:()=>a(f.id)},f.id))}),p.jsx(Uo,{fallback:null,children:h&&t<h&&p.jsx(Da,{page:n,last:Math.ceil(h/t),onChange:f=>{c({page:f})}})})]})})})})]}),l]})}const V=Va({component:()=>p.jsx(lu,{children:p.jsx(kr,{})}),errorComponent:ka,notFoundComponent:ja}),zu=O({getParentRoute:()=>V,path:an,component:Zu,validateSearch:Iu}),Uu=O({getParentRoute:()=>V,path:br,component:B(()=>H(()=>import("./Calendar-BOhJYi8K.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),pendingComponent:()=>p.jsx(z,{title:"Loading calendar",description:"Preparing note and reminder snapshots."}),validateSearch:Ou}),Ku=O({getParentRoute:()=>V,path:Gn,component:B(()=>H(()=>import("./Views-BoO6vgnF.js"),__vite__mapDeps([12,1,4,2,3,13,14,15,5,6,16,17,18,10,11]))),pendingComponent:()=>p.jsx(z,{title:"Loading views",description:"Preparing your saved dashboards."}),validateSearch:Fu}),Gu=O({getParentRoute:()=>V,path:yr,component:B(()=>H(()=>import("./Reminders-CtpFtvu6.js"),__vite__mapDeps([19,1,2,3,4,20,16]))),pendingComponent:()=>p.jsx(z,{title:"Loading reminders",description:"Preparing your reminder workspace."}),validateSearch:Tu}),Wu=O({getParentRoute:()=>V,path:vr,component:B(()=>H(()=>import("./Graph-L-d0cdMk.js"),__vite__mapDeps([21,1,2,3,22,23,24,25,26,27,28,11,16,29,30,6,9,31]))),pendingComponent:()=>p.jsx(z,{title:"Loading graph",description:"Preparing the linked note constellation."}),validateSearch:Vu}),qu=O({getParentRoute:()=>V,path:Mt,component:B(()=>H(()=>import("./Search-t48pkUg-.js"),__vite__mapDeps([32,1,4,2,3,33,11,16,15,34,31,35,10]))),pendingComponent:()=>p.jsx(z,{title:"Loading search",description:"Preparing indexed note results."}),validateSearch:Nu}),Xu=O({getParentRoute:()=>V,path:xr,component:B(()=>H(()=>import("./Tag-BL2h3ZaX.js"),__vite__mapDeps([36,1,2,3,13,11,4,10]))),pendingComponent:()=>p.jsx(z,{title:"Loading tags",description:"Preparing the tag catalog."}),validateSearch:Du}),Yu=O({getParentRoute:()=>V,path:Un,component:B(()=>H(()=>import("./Note-OO_uh2a7.js"),__vite__mapDeps([37,1,2,3,4,8,38,33,31,18,9,7,14,20,39,40,41,10,42,43,29,44,13,35]))),pendingComponent:()=>p.jsx(z,{title:"Loading note",description:"Preparing the editor and note content."})}),Qu=O({getParentRoute:()=>V,path:Sr,component:B(()=>H(()=>import("./TagNotes-BpRTCEBf.js"),__vite__mapDeps([45,1,2,3,38,4,33,31,18,10,11]))),pendingComponent:()=>p.jsx(z,{title:"Loading tagged notes",description:"Preparing notes for the selected tag."}),validateSearch:rt}),Ju=O({getParentRoute:()=>V,path:Ba,validateSearch:Hu,beforeLoad:async({search:e})=>{const t=e.sectionId?await Nc(e.sectionId).catch(()=>null):null,n=t?.type==="success"?t.viewSection:null;throw Fa({to:Gn,search:{tab:n?.tabId,state:n?Su(n.id,e.page,n.limit):void 0},replace:!0})}}),eh=O({getParentRoute:()=>V,path:wr,component:B(()=>H(()=>import("./index-CuCzOHJ6.js"),__vite__mapDeps([46,1,4,2,3,47,48,49,11,10]))),pendingComponent:()=>p.jsx(z,{title:"Loading settings",description:"Preparing workspace preferences."})}),th=O({getParentRoute:()=>V,path:za,validateSearch:ju,component:B(()=>H(()=>import("./integrations-B5SIEnG_.js"),__vite__mapDeps([50,1,4,2,3,8,9,16,44,51,18,10,11])))}),nh=O({getParentRoute:()=>V,path:Kn,validateSearch:ku,component:B(()=>H(()=>import("./Integration-C-rva2X9.js"),__vite__mapDeps([52,1,4,2,3,10,11])))}),oh=O({getParentRoute:()=>V,path:Za,component:B(()=>H(()=>import("./mcp-BQ418pyx.js"),__vite__mapDeps([53,1,4,2,3,47,44]))),pendingComponent:()=>p.jsx(z,{title:"Loading MCP settings",description:"Preparing MCP access controls."})}),rh=O({getParentRoute:()=>V,path:$a,component:B(()=>H(()=>import("./search-B5tCkhwj.js"),__vite__mapDeps([54,1,4,2,3,34,11,17,51]))),pendingComponent:()=>p.jsx(z,{title:"Loading search settings",description:"Preparing semantic search controls."})}),sh=O({getParentRoute:()=>V,path:Ua,component:B(()=>H(()=>import("./trash-Di2BWyUO.js"),__vite__mapDeps([55,1,4,2,3,14,38,33,31,18]))),pendingComponent:()=>p.jsx(z,{title:"Loading trash",description:"Preparing deleted notes for restore."}),validateSearch:rt}),ah=O({getParentRoute:()=>V,path:Ka,component:B(()=>H(()=>import("./manage-image-Kd-7IGfB.js"),__vite__mapDeps([56,1,2,3,4,43,57,14,49,10,11]))),pendingComponent:()=>p.jsx(z,{title:"Loading image manager",description:"Preparing uploaded image metadata."}),validateSearch:rt}),ih=O({getParentRoute:()=>V,path:Ga,component:B(()=>H(()=>import("./manage-image-detail-HU0QLP-t.js"),__vite__mapDeps([58,1,2,3,4,43,57,14,38,33,31,18,49,48,10,11]))),pendingComponent:()=>p.jsx(z,{title:"Loading image detail",description:"Preparing references for the selected image."}),validateSearch:rt}),ch=O({getParentRoute:()=>V,path:qa,component:B(()=>H(()=>import("./properties-CtagYHMr.js"),__vite__mapDeps([59,1,4,2,3]))),pendingComponent:()=>p.jsx(z,{title:"Loading properties",description:"Preparing shared property definitions."}),validateSearch:rt}),lh=O({getParentRoute:()=>V,path:Wa,component:B(()=>H(()=>import("./placeholder-D7JKnpuh.js"),__vite__mapDeps([60,1,4,2,3,14,30,18,10,11]))),pendingComponent:()=>p.jsx(z,{title:"Loading placeholders",description:"Preparing template replacement rules."}),validateSearch:rt}),dh=V.addChildren([zu,Ku,Uu,Gu,Wu,qu,Xu,Yu,Qu,Ju,eh,rh,oh,th,nh,sh,ah,ih,lh,ch]),uh=rc({routeTree:dh,defaultPreload:"intent",scrollRestoration:!0,defaultPendingComponent:()=>p.jsx(z,{title:"Loading page",description:"Preparing the next route."})});function hh(){const e=Pn(n=>n.setSystemTheme),t=Pn(n=>n.setTheme);return d.useEffect(()=>{const n=Ao();return n&&t(n),Ja.listenThemeChange(o=>{Ao()||e(o?"dark":"light")},n==null)},[e,t]),p.jsx(Lc,{children:p.jsx(ic,{router:uh})})}const As="__oceanBrainCsrfRetry";let An;const fh=e=>!ae.isAxiosError(e)||e.response?.status!==403?!1:e.response.data?.code==="CSRF_TOKEN_INVALID",Ps=e=>{if(!fh(e)||!ae.isAxiosError(e))return!1;const t=e.config;return!!(t&&!t[As])},ph=()=>(An??=tn().finally(()=>{An=void 0}),An),cr=(e,t)=>{if(!e)return;const n=e;if(typeof n.delete=="function"){n.delete(t);return}delete e[t]},mh=e=>{cr(e.headers,"X-XSRF-TOKEN"),cr(e.headers,"x-xsrf-token")},gh=async e=>{if(!Ps(e)||!ae.isAxiosError(e))return Promise.reject(e);const t=e.config;return t[As]=!0,await ph()!=="active"?Promise.reject(e):(mh(t),ae.request(t))};let lr;const vh=()=>{lr===void 0&&(lr=ae.interceptors.response.use(e=>e,e=>{if(Sc(e))Gr();else if(Ps(e))return gh(e);return Promise.reject(e)}))};Pn.setState({theme:Ha()});vh();tn();Ys.createRoot(document.getElementById("root")).render(p.jsx(G.StrictMode,{children:p.jsx(hh,{})}));export{Bh as $,jd as A,$h as B,At as C,$o as D,Zh as E,Uo as F,Dd as G,Lh as H,Ah as I,wu as J,co as K,xd as L,jl as M,$u as N,Cd as O,uo as P,xu as Q,Vh as R,Ad as S,Ss as T,Nh as U,Dh as V,Oh as W,kh as X,Fh as Y,Hh as Z,jh as _,ws as a,yc as b,vc as c,Wc as d,mc as e,su as f,bc as g,Gh as h,qh as i,Wh as j,Kh as k,zh as l,Ih as m,Fr as n,dl as o,Go as p,hd as q,Ph as r,Zr as s,hl as t,Uh as u,yd as v,Th as w,md as x,gc as y,Mh as z};