@pasko70/pibo 1.1.0 → 1.2.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 (426) hide show
  1. package/README.md +106 -254
  2. package/context/codex-base-prompt.md +4 -0
  3. package/context/compute-worker.md +23 -0
  4. package/context/pibo-native-tooling.md +18 -0
  5. package/context/pibo-system-prompt.md +69 -8
  6. package/dist/api/simple-agent-api.js +136 -0
  7. package/dist/app-context.js +4 -0
  8. package/dist/apps/chat/agent-profiles.js +18 -3
  9. package/dist/apps/chat/agent-store.js +113 -16
  10. package/dist/apps/chat/chat-api-routes.js +311 -0
  11. package/dist/apps/chat/chat-capability-routes.js +90 -0
  12. package/dist/apps/chat/chat-files.js +178 -0
  13. package/dist/apps/chat/chat-request-normalizers.js +681 -0
  14. package/dist/apps/chat/chat-settings-routes.js +75 -0
  15. package/dist/apps/chat/chat-trace-helpers.js +94 -0
  16. package/dist/apps/chat/chat-user-skill-routes.js +149 -0
  17. package/dist/apps/chat/cron-api.js +213 -0
  18. package/dist/apps/chat/data/chat-data-mappers.js +74 -0
  19. package/dist/apps/chat/data/event-command-service.js +75 -0
  20. package/dist/apps/chat/data/navigation-query-service.js +11 -0
  21. package/dist/apps/chat/data/project-service.js +844 -0
  22. package/dist/apps/chat/data/read-state-service.js +42 -0
  23. package/dist/apps/chat/data/room-service.js +52 -0
  24. package/dist/apps/chat/data/session-query-service.js +63 -0
  25. package/dist/apps/chat/data/timeline-query-service.js +96 -0
  26. package/dist/apps/chat/event-log.js +1 -307
  27. package/dist/apps/chat/model-catalog.js +7 -2
  28. package/dist/apps/chat/output-compactor.js +126 -0
  29. package/dist/apps/chat/output-event-policy.js +17 -0
  30. package/dist/apps/chat/project-workflow-human-actions.js +347 -0
  31. package/dist/apps/chat/project-workflow-sessions.js +260 -0
  32. package/dist/apps/chat/provider-auth-actions.js +43 -0
  33. package/dist/apps/chat/ralph-api.js +156 -0
  34. package/dist/apps/chat/read-model.js +1 -218
  35. package/dist/apps/chat/rooms.js +1 -321
  36. package/dist/apps/chat/static-assets.js +996 -0
  37. package/dist/apps/chat/stream.js +29 -6
  38. package/dist/apps/chat/trace.js +179 -1003
  39. package/dist/apps/chat/types/event-store.js +1 -0
  40. package/dist/apps/chat/types/read-model.js +1 -0
  41. package/dist/apps/chat/types/rooms.js +36 -0
  42. package/dist/apps/chat/web-app.js +3131 -1959
  43. package/dist/apps/chat/workflow-catalog.js +572 -0
  44. package/dist/apps/chat/workflow-edge-compatibility.js +51 -0
  45. package/dist/apps/chat/workflow-json-schema-validation.js +335 -0
  46. package/dist/apps/chat/workflow-persistence-model.js +140 -0
  47. package/dist/apps/chat/workflow-persistence.js +633 -0
  48. package/dist/apps/chat/workflow-registered-ref-params.js +130 -0
  49. package/dist/apps/chat/workflow-registered-ref-pickers.js +179 -0
  50. package/dist/apps/chat/workflow-registered-ref-validation.js +210 -0
  51. package/dist/apps/chat/workflow-v2-security-validation.js +93 -0
  52. package/dist/apps/chat/workflow-validation-helpers.js +114 -0
  53. package/dist/apps/chat-ui/assets/{dist-CNLWH2qh.js → dist-B4lw9z4F.js} +1 -1
  54. package/dist/apps/chat-ui/assets/{dist-8e4L8ciw.js → dist-BbTaHWON.js} +1 -1
  55. package/dist/apps/chat-ui/assets/{dist-CMZOa5ik.js → dist-BcT_c1EJ.js} +1 -1
  56. package/dist/apps/chat-ui/assets/{dist-DNcnQRPF.js → dist-CGINd7XU.js} +1 -1
  57. package/dist/apps/chat-ui/assets/{dist-CqqUC8Ce.js → dist-CrBzZkUp.js} +1 -1
  58. package/dist/apps/chat-ui/assets/{dist-D2N4-LIc.js → dist-CyyISotB.js} +1 -1
  59. package/dist/apps/chat-ui/assets/{dist-CUqpST5w.js → dist-DFbnFNpX.js} +1 -1
  60. package/dist/apps/chat-ui/assets/{dist-CspjOeBj.js → dist-DGLWQLX8.js} +1 -1
  61. package/dist/apps/chat-ui/assets/{dist-B7bbI3Qz.js → dist-DfcIkFSN.js} +1 -1
  62. package/dist/apps/chat-ui/assets/{dist-v4pjHlB7.js → dist-sKDHTwaT.js} +1 -1
  63. package/dist/apps/chat-ui/assets/{dist-D9L4MSRF.js → dist-y9D6la48.js} +1 -1
  64. package/dist/apps/chat-ui/assets/index-C25VYnyb.css +1 -0
  65. package/dist/apps/chat-ui/assets/index-CUkuvI3v.js +165 -0
  66. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-144x144.png +0 -0
  67. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-192x192.png +0 -0
  68. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-48x48.png +0 -0
  69. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-512x512.png +0 -0
  70. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-72x72.png +0 -0
  71. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-96x96.png +0 -0
  72. package/dist/apps/chat-ui/assets/pwa-images/ios/100.png +0 -0
  73. package/dist/apps/chat-ui/assets/pwa-images/ios/1024.png +0 -0
  74. package/dist/apps/chat-ui/assets/pwa-images/ios/114.png +0 -0
  75. package/dist/apps/chat-ui/assets/pwa-images/ios/120.png +0 -0
  76. package/dist/apps/chat-ui/assets/pwa-images/ios/128.png +0 -0
  77. package/dist/apps/chat-ui/assets/pwa-images/ios/144.png +0 -0
  78. package/dist/apps/chat-ui/assets/pwa-images/ios/152.png +0 -0
  79. package/dist/apps/chat-ui/assets/pwa-images/ios/16.png +0 -0
  80. package/dist/apps/chat-ui/assets/pwa-images/ios/167.png +0 -0
  81. package/dist/apps/chat-ui/assets/pwa-images/ios/180.png +0 -0
  82. package/dist/apps/chat-ui/assets/pwa-images/ios/192.png +0 -0
  83. package/dist/apps/chat-ui/assets/pwa-images/ios/20.png +0 -0
  84. package/dist/apps/chat-ui/assets/pwa-images/ios/256.png +0 -0
  85. package/dist/apps/chat-ui/assets/pwa-images/ios/29.png +0 -0
  86. package/dist/apps/chat-ui/assets/pwa-images/ios/32.png +0 -0
  87. package/dist/apps/chat-ui/assets/pwa-images/ios/40.png +0 -0
  88. package/dist/apps/chat-ui/assets/pwa-images/ios/50.png +0 -0
  89. package/dist/apps/chat-ui/assets/pwa-images/ios/512.png +0 -0
  90. package/dist/apps/chat-ui/assets/pwa-images/ios/57.png +0 -0
  91. package/dist/apps/chat-ui/assets/pwa-images/ios/58.png +0 -0
  92. package/dist/apps/chat-ui/assets/pwa-images/ios/60.png +0 -0
  93. package/dist/apps/chat-ui/assets/pwa-images/ios/64.png +0 -0
  94. package/dist/apps/chat-ui/assets/pwa-images/ios/72.png +0 -0
  95. package/dist/apps/chat-ui/assets/pwa-images/ios/76.png +0 -0
  96. package/dist/apps/chat-ui/assets/pwa-images/ios/80.png +0 -0
  97. package/dist/apps/chat-ui/assets/pwa-images/ios/87.png +0 -0
  98. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-100.png +0 -0
  99. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-125.png +0 -0
  100. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-150.png +0 -0
  101. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-200.png +0 -0
  102. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-400.png +0 -0
  103. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-100.png +0 -0
  104. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-125.png +0 -0
  105. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-150.png +0 -0
  106. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-200.png +0 -0
  107. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-400.png +0 -0
  108. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-100.png +0 -0
  109. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-125.png +0 -0
  110. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-150.png +0 -0
  111. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-200.png +0 -0
  112. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-400.png +0 -0
  113. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-100.png +0 -0
  114. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-125.png +0 -0
  115. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-150.png +0 -0
  116. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-200.png +0 -0
  117. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-400.png +0 -0
  118. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-16.png +0 -0
  119. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-20.png +0 -0
  120. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-24.png +0 -0
  121. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-256.png +0 -0
  122. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-30.png +0 -0
  123. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-32.png +0 -0
  124. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-36.png +0 -0
  125. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-40.png +0 -0
  126. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-44.png +0 -0
  127. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-48.png +0 -0
  128. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-60.png +0 -0
  129. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-64.png +0 -0
  130. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-72.png +0 -0
  131. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-80.png +0 -0
  132. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-96.png +0 -0
  133. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-16.png +0 -0
  134. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-20.png +0 -0
  135. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-24.png +0 -0
  136. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-256.png +0 -0
  137. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-30.png +0 -0
  138. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-32.png +0 -0
  139. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-36.png +0 -0
  140. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-40.png +0 -0
  141. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-44.png +0 -0
  142. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-48.png +0 -0
  143. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-60.png +0 -0
  144. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-64.png +0 -0
  145. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-72.png +0 -0
  146. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-80.png +0 -0
  147. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-96.png +0 -0
  148. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-100.png +0 -0
  149. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-125.png +0 -0
  150. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-150.png +0 -0
  151. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-200.png +0 -0
  152. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-400.png +0 -0
  153. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-16.png +0 -0
  154. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-20.png +0 -0
  155. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-24.png +0 -0
  156. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-256.png +0 -0
  157. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-30.png +0 -0
  158. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-32.png +0 -0
  159. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-36.png +0 -0
  160. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-40.png +0 -0
  161. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-44.png +0 -0
  162. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-48.png +0 -0
  163. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-60.png +0 -0
  164. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-64.png +0 -0
  165. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-72.png +0 -0
  166. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-80.png +0 -0
  167. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-96.png +0 -0
  168. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-100.png +0 -0
  169. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-125.png +0 -0
  170. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-150.png +0 -0
  171. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-200.png +0 -0
  172. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-400.png +0 -0
  173. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-100.png +0 -0
  174. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-125.png +0 -0
  175. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-150.png +0 -0
  176. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-200.png +0 -0
  177. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-400.png +0 -0
  178. package/dist/apps/chat-ui/index.html +8 -3
  179. package/dist/apps/chat-ui/manifest.webmanifest +25 -0
  180. package/dist/apps/chat-ui/sw.js +41 -0
  181. package/dist/apps/cli-ui/InkSessionApp.js +1218 -0
  182. package/dist/apps/cli-ui/InkTerminalLine.js +53 -0
  183. package/dist/apps/cli-ui/InkTerminalRow.js +304 -0
  184. package/dist/apps/cli-ui/InkTerminalView.js +25 -0
  185. package/dist/apps/cli-ui/cliSessionsCommand.js +232 -0
  186. package/dist/apps/cli-ui/index.js +8 -0
  187. package/dist/apps/cli-ui/inkColors.js +67 -0
  188. package/dist/apps/cli-ui/inkJson.js +244 -0
  189. package/dist/apps/cli-ui/inkMarkdown.js +122 -0
  190. package/dist/apps/context-files-ui/assets/{dist-DFi2YGux.js → dist-BOiGdrG-.js} +1 -1
  191. package/dist/apps/context-files-ui/assets/{dist-DyfSeBMu.js → dist-DK01b7x4.js} +1 -1
  192. package/dist/apps/context-files-ui/assets/{dist-CwbH_3RN.js → dist-DPG9jOQ-.js} +1 -1
  193. package/dist/apps/context-files-ui/assets/{dist-dTBsFYAl.js → dist-Dp5AH00p.js} +1 -1
  194. package/dist/apps/context-files-ui/assets/{dist-CxRLRmMx.js → dist-DqYw0LH7.js} +1 -1
  195. package/dist/apps/context-files-ui/assets/{dist-MyZgX9K2.js → dist-TF5iO5ML.js} +1 -1
  196. package/dist/apps/context-files-ui/assets/{dist-DQXzt2Ng.js → dist-TbjAhles.js} +1 -1
  197. package/dist/apps/context-files-ui/assets/{dist-YwR9dpb-.js → dist-ZsBbt0uY.js} +1 -1
  198. package/dist/apps/context-files-ui/assets/{dist-CKQF1zEu.js → dist-kmsvtHkH.js} +1 -1
  199. package/dist/apps/context-files-ui/assets/{dist-BJW3917N.js → dist-vnd7PMu3.js} +1 -1
  200. package/dist/apps/context-files-ui/assets/{index-BwRDoHMC.css → index-B92tL3Pp.css} +1 -1
  201. package/dist/apps/context-files-ui/assets/{index-GwvjXytt.js → index-BhAWD3dv.js} +2 -2
  202. package/dist/apps/context-files-ui/index.html +2 -2
  203. package/dist/auth/better-auth.js +2 -1
  204. package/dist/auth/login-actions.js +251 -0
  205. package/dist/auth/openai-codex-usage.js +147 -0
  206. package/dist/bin/pibo.js +0 -0
  207. package/dist/bin/rg.js +15 -0
  208. package/dist/cli-session/fakeSessionSource.js +804 -0
  209. package/dist/cli-session/index.js +3 -0
  210. package/dist/cli-session/localSessionSource.js +1144 -0
  211. package/dist/cli-session/sessionSource.js +13 -0
  212. package/dist/cli.js +142 -14
  213. package/dist/compute/cli.js +415 -0
  214. package/dist/compute/docker.js +827 -0
  215. package/dist/compute/resource-health.js +333 -0
  216. package/dist/compute/resource-policy.js +98 -0
  217. package/dist/config/config.js +9 -5
  218. package/dist/core/context-build.js +677 -0
  219. package/dist/core/model-defaults.js +51 -9
  220. package/dist/core/pibo-home.js +8 -0
  221. package/dist/core/profiles.js +48 -0
  222. package/dist/core/provider-telemetry.js +222 -0
  223. package/dist/core/routed-session.js +441 -47
  224. package/dist/core/runtime-telemetry.js +853 -0
  225. package/dist/core/runtime.js +103 -15
  226. package/dist/core/session-errors.js +47 -0
  227. package/dist/core/session-model.js +39 -0
  228. package/dist/core/session-router.js +292 -62
  229. package/dist/core/shared-app.js +17 -0
  230. package/dist/core/skill-expansion.js +43 -0
  231. package/dist/core/system-prompt-template.js +9 -9
  232. package/dist/core/telemetry-staleness.js +128 -0
  233. package/dist/core/test-output-compaction.js +145 -0
  234. package/dist/core/user-settings.js +73 -0
  235. package/dist/cron/channel.js +28 -0
  236. package/dist/cron/cli.js +230 -0
  237. package/dist/cron/plugin.js +11 -0
  238. package/dist/cron/schedule.js +214 -0
  239. package/dist/cron/service.js +177 -0
  240. package/dist/cron/store.js +349 -0
  241. package/dist/cron/types.js +1 -0
  242. package/dist/data/cli.js +184 -0
  243. package/dist/data/event-log.js +106 -0
  244. package/dist/data/final-app-space-cutover-migration.js +728 -0
  245. package/dist/data/ingest-service.js +389 -0
  246. package/dist/data/message-store.js +62 -0
  247. package/dist/data/navigation-store.js +75 -0
  248. package/dist/data/observation-store.js +46 -0
  249. package/dist/data/payload-store.js +144 -0
  250. package/dist/data/pibo-store.js +59 -0
  251. package/dist/data/schema.js +434 -0
  252. package/dist/data/session-store.js +63 -0
  253. package/dist/data/shared-app-migration.js +757 -0
  254. package/dist/data/sqlite-schema.js +12 -0
  255. package/dist/data/telemetry-preview.js +65 -0
  256. package/dist/data/telemetry-queries.js +212 -0
  257. package/dist/data/telemetry-retention.js +50 -0
  258. package/dist/data/telemetry-rows.js +158 -0
  259. package/dist/data/telemetry.js +357 -0
  260. package/dist/debug/delta-compaction.js +99 -0
  261. package/dist/debug/detail-format.js +86 -0
  262. package/dist/debug/events.js +149 -29
  263. package/dist/debug/failures.js +162 -0
  264. package/dist/debug/index.js +655 -30
  265. package/dist/debug/messages.js +185 -0
  266. package/dist/debug/next-commands.js +6 -0
  267. package/dist/debug/payloads.js +123 -0
  268. package/dist/debug/pty.js +924 -0
  269. package/dist/debug/session.js +45 -15
  270. package/dist/debug/sql.js +1 -1
  271. package/dist/debug/stores.js +18 -13
  272. package/dist/debug/summary.js +72 -0
  273. package/dist/debug/telemetry.js +649 -0
  274. package/dist/debug/tools.js +168 -0
  275. package/dist/debug/trace-render-check.js +151 -0
  276. package/dist/debug/trace.js +152 -27
  277. package/dist/debug/web-artifacts.js +63 -0
  278. package/dist/debug/web-options.js +313 -0
  279. package/dist/debug/web-render-analysis.js +310 -0
  280. package/dist/debug/web-snapshot-browser-scripts.js +303 -0
  281. package/dist/debug/web-streaming-benchmark-analysis.js +605 -0
  282. package/dist/debug/web-streaming-browser-library.js +928 -0
  283. package/dist/debug/web-streaming-browser-scripts.js +242 -0
  284. package/dist/debug/web-streaming-provider-telemetry.js +194 -0
  285. package/dist/debug/web-streaming-report.js +493 -0
  286. package/dist/debug/web-streaming-types.js +1 -0
  287. package/dist/debug/web.js +574 -0
  288. package/dist/gateway/backup.js +83 -0
  289. package/dist/gateway/cli.js +511 -0
  290. package/dist/gateway/fallback.js +155 -0
  291. package/dist/gateway/pidfile.js +84 -0
  292. package/dist/gateway/protocol.js +16 -0
  293. package/dist/gateway/server.js +172 -17
  294. package/dist/gateway/tool.js +54 -51
  295. package/dist/gateway/web.js +74 -2
  296. package/dist/index.js +3 -1
  297. package/dist/local/client.js +3 -3
  298. package/dist/local/extension.js +8 -5
  299. package/dist/plugins/builtin.js +251 -49
  300. package/dist/plugins/chat-vscode-web.js +28 -0
  301. package/dist/plugins/codex-compat.js +0 -41
  302. package/dist/plugins/context-files.js +98 -18
  303. package/dist/plugins/dev-auth.js +124 -0
  304. package/dist/plugins/native-tooling.js +15 -0
  305. package/dist/plugins/registry.js +49 -1
  306. package/dist/plugins/web-annotations.js +27 -0
  307. package/dist/providers/minimax.js +70 -0
  308. package/dist/providers/openai-compat.js +48 -0
  309. package/dist/ralph/channel.js +8 -0
  310. package/dist/ralph/cli.js +152 -0
  311. package/dist/ralph/plugin.js +14 -0
  312. package/dist/ralph/service.js +271 -0
  313. package/dist/ralph/stopping.js +151 -0
  314. package/dist/ralph/store.js +450 -0
  315. package/dist/ralph/templates.js +200 -0
  316. package/dist/ralph/types.js +1 -0
  317. package/dist/reliability/store.js +42 -26
  318. package/dist/runs/registry.js +72 -35
  319. package/dist/session-ui/commandCatalog.js +193 -0
  320. package/dist/session-ui/commandResults.js +95 -0
  321. package/dist/session-ui/index.js +7 -0
  322. package/dist/session-ui/ownerViewModel.js +27 -0
  323. package/dist/session-ui/roomSessionViewModel.js +69 -0
  324. package/dist/session-ui/statusViewModel.js +127 -0
  325. package/dist/session-ui/terminalCards.js +210 -0
  326. package/dist/session-ui/terminalRows.js +937 -0
  327. package/dist/session-ui/terminalValue.js +45 -0
  328. package/dist/sessions/pibo-data-store.js +178 -0
  329. package/dist/sessions/sqlite-store.js +78 -12
  330. package/dist/sessions/store.js +11 -4
  331. package/dist/sessions/workflow-session-kind.js +20 -0
  332. package/dist/setup/cli.js +567 -0
  333. package/dist/shared/trace-async-agent-runs.js +127 -0
  334. package/dist/shared/trace-engine.js +96 -0
  335. package/dist/shared/trace-event-projection.js +679 -0
  336. package/dist/shared/trace-live-reducer.js +191 -0
  337. package/dist/shared/trace-nodes.js +76 -0
  338. package/dist/shared/trace-order.js +11 -10
  339. package/dist/shared/trace-patch-nodes.js +83 -0
  340. package/dist/shared/trace-run-notifications.js +69 -0
  341. package/dist/shared/trace-subagent-links.js +46 -0
  342. package/dist/shared/trace-transcript.js +303 -0
  343. package/dist/shared/trace-types.js +1 -0
  344. package/dist/shared-app.js +4 -0
  345. package/dist/signals/aggregate.js +65 -0
  346. package/dist/signals/events.js +1 -0
  347. package/dist/signals/projector.js +158 -0
  348. package/dist/signals/registry.js +513 -0
  349. package/dist/signals/store.js +1 -0
  350. package/dist/signals/types.js +1 -0
  351. package/dist/skills/cli.js +117 -0
  352. package/dist/tools/agent-browser-leases.js +219 -0
  353. package/dist/tools/agent-browser-wrapper.js +99 -0
  354. package/dist/tools/browser-pool.js +623 -0
  355. package/dist/tools/browser-use-cdp.js +56 -4
  356. package/dist/tools/browser-use-leases.js +215 -37
  357. package/dist/tools/browser-use-wrapper.js +508 -65
  358. package/dist/tools/cdp-client.js +189 -0
  359. package/dist/tools/guides.js +203 -4
  360. package/dist/tools/index.js +666 -16
  361. package/dist/tools/npm-runtime.js +136 -0
  362. package/dist/tools/registry.js +107 -8
  363. package/dist/tools/runtime/index.js +3 -0
  364. package/dist/tools/runtime/node-backend.js +225 -0
  365. package/dist/tools/runtime/node-worker-source.js +206 -0
  366. package/dist/tools/runtime/python-backend.js +227 -0
  367. package/dist/tools/runtime/python-worker-source.js +178 -0
  368. package/dist/tools/runtime/registry.js +255 -0
  369. package/dist/tools/runtime/tool.js +168 -0
  370. package/dist/tools/runtime/types.js +1 -0
  371. package/dist/tools/web-search.js +2 -1
  372. package/dist/user-skills/installer.js +39 -36
  373. package/dist/user-skills/store.js +50 -11
  374. package/dist/web/auth.js +5 -1
  375. package/dist/web/channel.js +86 -0
  376. package/dist/web/http.js +79 -14
  377. package/dist/web-annotations/api.js +348 -0
  378. package/dist/web-annotations/attachments.js +201 -0
  379. package/dist/web-annotations/cdp.js +1107 -0
  380. package/dist/web-annotations/index.js +7 -0
  381. package/dist/web-annotations/store.js +407 -0
  382. package/dist/web-annotations/tools.js +350 -0
  383. package/dist/web-annotations/types.js +34 -0
  384. package/dist/web-annotations/validation.js +288 -0
  385. package/docs/README.md +23 -0
  386. package/docs/ops/install-developer-host.md +112 -0
  387. package/docs/ops/install-user-host.md +76 -0
  388. package/docs/ops/upgrade-user-to-developer-host.md +69 -0
  389. package/package.json +24 -10
  390. package/skills/builtin/pi-agent-harness/SKILL.md +24 -24
  391. package/skills/builtin/pibo-docker-system/SKILL.md +170 -0
  392. package/skills/builtin/pibo-spec-writing/SKILL.md +330 -0
  393. package/skills/builtin/prd/SKILL.md +143 -0
  394. package/skills/builtin/ralph-loop/SKILL.md +359 -0
  395. package/skills/builtin/ralph-prd-json/SKILL.md +123 -0
  396. package/skills/builtin/skill-creator/LICENSE.txt +202 -0
  397. package/skills/builtin/skill-creator/SKILL.md +513 -0
  398. package/skills/builtin/skill-creator/agents/analyzer.md +274 -0
  399. package/skills/builtin/skill-creator/agents/comparator.md +202 -0
  400. package/skills/builtin/skill-creator/agents/grader.md +223 -0
  401. package/skills/builtin/skill-creator/assets/eval_review.html +146 -0
  402. package/skills/builtin/skill-creator/eval-viewer/generate_review.py +471 -0
  403. package/skills/builtin/skill-creator/eval-viewer/viewer.html +1325 -0
  404. package/skills/builtin/skill-creator/references/schemas.md +430 -0
  405. package/skills/builtin/skill-creator/scripts/__init__.py +0 -0
  406. package/skills/builtin/skill-creator/scripts/aggregate_benchmark.py +401 -0
  407. package/skills/builtin/skill-creator/scripts/generate_report.py +326 -0
  408. package/skills/builtin/skill-creator/scripts/improve_description.py +247 -0
  409. package/skills/builtin/skill-creator/scripts/package_skill.py +136 -0
  410. package/skills/builtin/skill-creator/scripts/quick_validate.py +103 -0
  411. package/skills/builtin/skill-creator/scripts/run_eval.py +310 -0
  412. package/skills/builtin/skill-creator/scripts/run_loop.py +328 -0
  413. package/skills/builtin/skill-creator/scripts/utils.py +47 -0
  414. package/skills/builtin/web-annotations/SKILL.md +93 -0
  415. package/dist/apps/chat-ui/assets/index-D2Qxambd.js +0 -151
  416. package/dist/apps/chat-ui/assets/index-DXx368XK.css +0 -1
  417. package/dist/env.js +0 -32
  418. package/dist/plugins/core-tools.js +0 -94
  419. package/dist/plugins/example.js +0 -67
  420. package/dist/plugins/remote-agent.js +0 -9
  421. package/dist/remote/channel.js +0 -176
  422. package/dist/remote/client.js +0 -92
  423. package/dist/remote/examples/tui-controller.js +0 -263
  424. package/dist/remote/protocol.js +0 -55
  425. package/dist/remote/session-client.js +0 -189
  426. package/dist/sessions/bindings.js +0 -41
@@ -1,151 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-D2N4-LIc.js","assets/dist-SVPsM5Oi.js","assets/dist-tGfufz3b.js","assets/dist-C5YJOwhH.js","assets/dist-CKM5j-iy.js","assets/rolldown-runtime-S-ySWqyJ.js","assets/dist-CNLWH2qh.js","assets/dist-CqqUC8Ce.js","assets/dist-CUqpST5w.js","assets/dist--55mTWk3.js","assets/dist-v4pjHlB7.js","assets/dist-BZ39rB1W.js","assets/dist-C5oXtFSP.js","assets/dist-D9L4MSRF.js","assets/dist-DNcnQRPF.js","assets/dist-CMZOa5ik.js","assets/dist-B7bbI3Qz.js","assets/dist-CUp9us2q.js","assets/dist-DSKQpPaz.js","assets/dist-CZ9T4Cly.js","assets/dist-Zqt9kNG9.js","assets/dist-BsedZGJo.js","assets/dockerfile-CUaqzcqp.js","assets/simple-mode-CL04yRVp.js","assets/factor-C2tAxNob.js","assets/nsis-SMDwKltR.js","assets/pug-Bo3wfL-f.js","assets/javascript-DSlzRUd8.js","assets/dist-CspjOeBj.js","assets/dist-8e4L8ciw.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./rolldown-runtime-S-ySWqyJ.js";import{$ as r,A as i,At as a,Ct as o,Dt as s,E as c,Et as l,G as u,J as d,K as f,L as p,Mt as m,Nt as h,O as g,Ot as _,P as v,Pt as y,Q as b,S as x,St as S,T as C,Tt as w,W as T,X as E,Y as D,Z as O,_t as k,a as A,at as j,bt as M,c as N,ct as P,dt as F,et as ee,f as te,ft as ne,g as re,gt as ie,ht as ae,it as oe,j as se,jt as ce,kt as le,l as ue,lt as de,mt as fe,n as pe,nt as me,o as he,ot as ge,pt as _e,q as ve,rt as ye,st as be,t as xe,tt as Se,ut as Ce,v as we,vt as Te,w as Ee,wt as De,x as Oe,xt as ke,yt as Ae}from"./dist-SVPsM5Oi.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var je=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ee=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},te={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=te,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,ee)}catch(e){ee(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),Me=n(((e,t)=>{t.exports=je()})),Ne=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Pe=n(((e,t)=>{t.exports=Ne()})),Fe=n((e=>{var t=Me();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.5`})),Ie=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Fe()})),Le=n((e=>{var t=Pe(),n=Me(),r=Ie();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var M=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},ee=[],te=-1;function ne(e){return{current:e}}function re(e){0>te||(e.current=ee[te],ee[te]=null,te--)}function ie(e,t){te++,ee[te]=e.current,e.current=t}var ae=ne(null),oe=ne(null),se=ne(null),ce=ne(null);function le(e,t){switch(ie(se,t),ie(oe,e),ie(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ef(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ef(t),e=tf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}re(ae),ie(ae,e)}function ue(){re(ae),re(oe),re(se)}function de(e){e.memoizedState!==null&&ie(ce,e);var t=ae.current,n=tf(t,e.type);t!==n&&(ie(oe,e),ie(ae,n))}function fe(e){oe.current===e&&(re(ae),re(oe)),ce.current===e&&(re(ce),up._currentValue=F)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1<e.stack.indexOf(`
3
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
- `+pe+e+me}var ge=!1;function _e(e,t){if(!e||ge)return``;ge=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
- `),l=s.split(`
6
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?he(n):``}function ve(e,t){switch(e.tag){case 26:case 27:case 5:return he(e.type);case 16:return he(`Lazy`);case 13:return e.child!==t&&t!==null?he(`Suspense Fallback`):he(`Suspense`);case 19:return he(`SuspenseList`);case 0:case 15:return _e(e.type,!1);case 11:return _e(e.type.render,!1);case 1:return _e(e.type,!0);case 31:return he(`Activity`);default:return``}}function ye(e){try{var t=``,n=null;do t+=ve(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
- Error generating stack: `+e.message+`
9
- `+e.stack}}var be=Object.prototype.hasOwnProperty,xe=t.unstable_scheduleCallback,Se=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,we=t.unstable_requestPaint,Te=t.unstable_now,Ee=t.unstable_getCurrentPriorityLevel,De=t.unstable_ImmediatePriority,Oe=t.unstable_UserBlockingPriority,ke=t.unstable_NormalPriority,Ae=t.unstable_LowPriority,je=t.unstable_IdlePriority,Ne=t.log,Fe=t.unstable_setDisableYieldValue,Le=null,Re=null;function ze(e){if(typeof Ne==`function`&&Fe(e),Re&&typeof Re.setStrictMode==`function`)try{Re.setStrictMode(Le,e)}catch{}}var Be=Math.clz32?Math.clz32:Ue,Ve=Math.log,He=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(Ve(e)/He|0)|0}var We=256,Ge=262144,Ke=4194304;function qe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Je(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=qe(n))):i=qe(o):i=qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=qe(n))):i=qe(o)):i=qe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ye(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ze(){var e=Ke;return Ke<<=1,!(Ke&62914560)&&(Ke=4194304),e}function Qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $e(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function et(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Be(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&tt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function tt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Be(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function nt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Be(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function rt(e,t){var n=t&-t;return n=n&42?1:it(n),(n&(e.suspendedLanes|t))===0?n:0}function it(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function at(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ot(){var e=P.p;return e===0?(e=window.event,e===void 0?32:Ep(e.type)):e}function st(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var ct=Math.random().toString(36).slice(2),lt=`__reactFiber$`+ct,ut=`__reactProps$`+ct,dt=`__reactContainer$`+ct,ft=`__reactEvents$`+ct,pt=`__reactListeners$`+ct,mt=`__reactHandles$`+ct,ht=`__reactResources$`+ct,gt=`__reactMarker$`+ct;function _t(e){delete e[lt],delete e[ut],delete e[ft],delete e[pt],delete e[mt]}function vt(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dt]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cf(e);e!==null;){if(n=e[lt])return n;e=Cf(e)}return t}e=n,n=e.parentNode}return null}function yt(e){if(e=e[lt]||e[dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function xt(e){var t=e[ht];return t||=e[ht]={hoistableStyles:new Map,hoistableScripts:new Map},t}function St(e){e[gt]=!0}var Ct=new Set,wt={};function Tt(e,t){Et(e,t),Et(e+`Capture`,t)}function Et(e,t){for(wt[e]=t,e=0;e<t.length;e++)Ct.add(t[e])}var Dt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Ot={},kt={};function At(e){return be.call(kt,e)?!0:be.call(Ot,e)?!1:Dt.test(e)?kt[e]=!0:(Ot[e]=!0,!1)}function jt(e,t,n){if(At(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Mt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Nt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Pt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ft(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function It(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Lt(e){if(!e._valueTracker){var t=Ft(e)?`checked`:`value`;e._valueTracker=It(e,t,``+e[t])}}function Rt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ft(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function zt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Bt=/[\n"\\]/g;function Vt(e){return e.replace(Bt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ht(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Pt(t)):e.value!==``+Pt(t)&&(e.value=``+Pt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Wt(e,o,Pt(n)):Wt(e,o,Pt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Pt(s):e.removeAttribute(`name`)}function Ut(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Lt(e);return}n=n==null?``:``+Pt(n),t=t==null?n:``+Pt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Lt(e)}function Wt(e,t,n){t===`number`&&zt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Gt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Pt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Kt(e,t,n){if(t!=null&&(t=``+Pt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Pt(n)}function qt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(M(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Pt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Lt(e)}function Jt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var I=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function L(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||I.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Yt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&L(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&L(e,o,t[o])}function Xt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Zt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Qt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function $t(e){return Qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function en(){}var tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rn=null,an=null;function on(e){var t=yt(e);if(t&&(e=t.stateNode)){var n=e[ut]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ht(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Vt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ut]||null;if(!a)throw Error(i(90));Ht(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Rt(r)}break a;case`textarea`:Kt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Gt(e,!!n.multiple,t,!1)}}}var sn=!1;function cn(e,t,n){if(sn)return e(t,n);sn=!0;try{return e(t)}finally{if(sn=!1,(rn!==null||an!==null)&&(ju(),rn&&(t=rn,e=an,an=rn=null,on(t),e)))for(t=0;t<e.length;t++)on(e[t])}}function ln(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ut]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var un=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),dn=!1;if(un)try{var fn={};Object.defineProperty(fn,`passive`,{get:function(){dn=!0}}),window.addEventListener(`test`,fn,fn),window.removeEventListener(`test`,fn,fn)}catch{dn=!1}var pn=null,mn=null,hn=null;function gn(){if(hn)return hn;var e,t=mn,n=t.length,r,i=`value`in pn?pn.value:pn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return hn=i.slice(e,1<r?1-r:void 0)}function _n(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function vn(){return!0}function yn(){return!1}function bn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?vn:yn,this.isPropagationStopped=yn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=vn)},persist:function(){},isPersistent:vn}),t}var xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sn=bn(xn),Cn=f({},xn,{view:0,detail:0}),wn=bn(Cn),Tn,En,Dn,On=f({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Dn&&(Dn&&e.type===`mousemove`?(Tn=e.screenX-Dn.screenX,En=e.screenY-Dn.screenY):En=Tn=0,Dn=e),Tn)},movementY:function(e){return`movementY`in e?e.movementY:En}}),kn=bn(On),An=bn(f({},On,{dataTransfer:0})),jn=bn(f({},Cn,{relatedTarget:0})),Mn=bn(f({},xn,{animationName:0,elapsedTime:0,pseudoElement:0})),Nn=bn(f({},xn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Pn=bn(f({},xn,{data:0})),Fn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},In={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Ln={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ln[e])?!!t[e]:!1}function zn(){return Rn}var Bn=bn(f({},Cn,{key:function(e){if(e.key){var t=Fn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=_n(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?In[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zn,charCode:function(e){return e.type===`keypress`?_n(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?_n(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Vn=bn(f({},On,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hn=bn(f({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zn})),Un=bn(f({},xn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Wn=bn(f({},On,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Gn=bn(f({},xn,{newState:0,oldState:0})),Kn=[9,13,27,32],qn=un&&`CompositionEvent`in window,Jn=null;un&&`documentMode`in document&&(Jn=document.documentMode);var Yn=un&&`TextEvent`in window&&!Jn,Xn=un&&(!qn||Jn&&8<Jn&&11>=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return Kn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=gn(),hn=mn=pn=null,tr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Xn&&t.locale!==`ko`?null:t.data;default:return null}}var ir={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ir[e.type]:t===`textarea`}function or(e,t,n,r){rn?an?an.push(r):an=[r]:rn=r,t=Rd(t,`onChange`),0<t.length&&(n=new Sn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var sr=null,cr=null;function lr(e){jd(e,0)}function ur(e){if(Rt(bt(e)))return e}function dr(e,t){if(e===`change`)return t}var fr=!1;if(un){var pr;if(un){var mr=`oninput`in document;if(!mr){var hr=document.createElement(`div`);hr.setAttribute(`oninput`,`return;`),mr=typeof hr.oninput==`function`}pr=mr}else pr=!1;fr=pr&&(!document.documentMode||9<document.documentMode)}function gr(){sr&&(sr.detachEvent(`onpropertychange`,_r),cr=sr=null)}function _r(e){if(e.propertyName===`value`&&ur(cr)){var t=[];or(t,cr,e,nn(e)),cn(lr,t)}}function vr(e,t,n){e===`focusin`?(gr(),sr=t,cr=n,sr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function yr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ur(cr)}function br(e,t){if(e===`click`)return ur(t)}function xr(e,t){if(e===`input`||e===`change`)return ur(t)}function Sr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Cr=typeof Object.is==`function`?Object.is:Sr;function wr(e,t){if(Cr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!be.call(t,i)||!Cr(e[i],t[i]))return!1}return!0}function Tr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Er(e,t){var n=Tr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Tr(n)}}function Dr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Or(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=zt(e.document)}return t}function kr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ar=un&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,Nr=null,Pr=!1;function Fr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pr||jr==null||jr!==zt(r)||(r=jr,`selectionStart`in r&&kr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nr&&wr(Nr,r)||(Nr=r,r=Rd(Mr,`onSelect`),0<r.length&&(t=new Sn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=jr)))}function Ir(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Lr={animationend:Ir(`Animation`,`AnimationEnd`),animationiteration:Ir(`Animation`,`AnimationIteration`),animationstart:Ir(`Animation`,`AnimationStart`),transitionrun:Ir(`Transition`,`TransitionRun`),transitionstart:Ir(`Transition`,`TransitionStart`),transitioncancel:Ir(`Transition`,`TransitionCancel`),transitionend:Ir(`Transition`,`TransitionEnd`)},Rr={},zr={};un&&(zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Lr.animationend.animation,delete Lr.animationiteration.animation,delete Lr.animationstart.animation),`TransitionEvent`in window||delete Lr.transitionend.transition);function Br(e){if(Rr[e])return Rr[e];if(!Lr[e])return e;var t=Lr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zr)return Rr[e]=t[n];return e}var Vr=Br(`animationend`),Hr=Br(`animationiteration`),Ur=Br(`animationstart`),Wr=Br(`transitionrun`),Gr=Br(`transitionstart`),Kr=Br(`transitioncancel`),qr=Br(`transitionend`),Jr=new Map,Yr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Yr.push(`scrollEnd`);function Xr(e,t){Jr.set(e,t),Tt(t,[e])}var Zr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Qr=[],$r=0,ei=0;function ti(){for(var e=$r,t=ei=$r=0;t<e;){var n=Qr[t];Qr[t++]=null;var r=Qr[t];Qr[t++]=null;var i=Qr[t];Qr[t++]=null;var a=Qr[t];if(Qr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ai(n,i,a)}}function ni(e,t,n,r){Qr[$r++]=e,Qr[$r++]=t,Qr[$r++]=n,Qr[$r++]=r,ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ri(e,t,n,r){return ni(e,t,n,r),oi(e)}function ii(e,t){return ni(e,null,null,t),oi(e)}function ai(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Be(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function oi(e){if(50<Su)throw Su=0,Cu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function ci(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function li(e,t,n,r){return new ci(e,t,n,r)}function ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var n=e.alternate;return n===null?(n=li(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function fi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function pi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ui(e)&&(s=1);else if(typeof e==`string`)s=tp(e,n,ae.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=li(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return mi(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=li(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=li(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=li(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=li(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function mi(e,t,n,r){return e=li(7,e,r,t),e.lanes=n,e}function hi(e,t,n){return e=li(6,e,null,t),e.lanes=n,e}function gi(e){var t=li(18,null,null,0);return t.stateNode=e,t}function _i(e,t,n){return t=li(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vi=new WeakMap;function yi(e,t){if(typeof e==`object`&&e){var n=vi.get(e);return n===void 0?(t={value:e,source:t,stack:ye(t)},vi.set(e,t),t):n}return{value:e,source:t,stack:ye(t)}}var bi=[],xi=0,Si=null,Ci=0,wi=[],Ti=0,Ei=null,Di=1,Oi=``;function ki(e,t){bi[xi++]=Ci,bi[xi++]=Si,Si=e,Ci=t}function Ai(e,t,n){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Ei=e;var r=Di;e=Oi;var i=32-Be(r)-1;r&=~(1<<i),n+=1;var a=32-Be(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Di=1<<32-Be(t)+i|n<<i|r,Oi=a+e}else Di=1<<a|n<<i|r,Oi=e}function ji(e){e.return!==null&&(ki(e,1),Ai(e,1,0))}function Mi(e){for(;e===Si;)Si=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null;for(;e===Ei;)Ei=wi[--Ti],wi[Ti]=null,Oi=wi[--Ti],wi[Ti]=null,Di=wi[--Ti],wi[Ti]=null}function Ni(e,t){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Di=t.id,Oi=t.overflow,Ei=e}var Pi=null,Fi=null,Ii=!1,Li=null,Ri=!1,zi=Error(i(519));function Bi(e){throw Ki(yi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),zi}function Vi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[lt]=e,t[ut]=r,n){case`dialog`:Md(`cancel`,t),Md(`close`,t);break;case`iframe`:case`object`:case`embed`:Md(`load`,t);break;case`video`:case`audio`:for(n=0;n<kd.length;n++)Md(kd[n],t);break;case`source`:Md(`error`,t);break;case`img`:case`image`:case`link`:Md(`error`,t),Md(`load`,t);break;case`details`:Md(`toggle`,t);break;case`input`:Md(`invalid`,t),Ut(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Md(`invalid`,t);break;case`textarea`:Md(`invalid`,t),qt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Wd(t.textContent,n)?(r.popover!=null&&(Md(`beforetoggle`,t),Md(`toggle`,t)),r.onScroll!=null&&Md(`scroll`,t),r.onScrollEnd!=null&&Md(`scrollend`,t),r.onClick!=null&&(t.onclick=en),t=!0):t=!1,t||Bi(e,!0)}function Hi(e){for(Pi=e.return;Pi;)switch(Pi.tag){case 5:case 31:case 13:Ri=!1;return;case 27:case 3:Ri=!0;return;default:Pi=Pi.return}}function Ui(e){if(e!==Pi)return!1;if(!Ii)return Hi(e),Ii=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||V(e.type,e.memoizedProps)),n=!n),n&&Fi&&Bi(e),Hi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Fi=Sf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Fi=Sf(e)}else t===27?(t=Fi,uf(e.type)?(e=xf,xf=null,Fi=e):Fi=t):Fi=Pi?bf(e.stateNode.nextSibling):null;return!0}function Wi(){Fi=Pi=null,Ii=!1}function Gi(){var e=Li;return e!==null&&(cu===null?cu=e:cu.push.apply(cu,e),Li=null),e}function Ki(e){Li===null?Li=[e]:Li.push(e)}var qi=ne(null),Ji=null,Yi=null;function Xi(e,t,n){ie(qi,t._currentValue),t._currentValue=n}function Zi(e){e._currentValue=qi.current,re(qi)}function Qi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function $i(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Qi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Qi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ea(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Cr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ce.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[up]:e.push(up))}a=a.return}e!==null&&$i(t,e,n,r),t.flags|=262144}function ta(e){for(e=e.firstContext;e!==null;){if(!Cr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function na(e){Ji=e,Yi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ra(e){return aa(Ji,e)}function ia(e,t){return Ji===null&&na(e),aa(e,t)}function aa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Yi===null){if(e===null)throw Error(i(308));Yi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Yi=Yi.next=t;return n}var oa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},sa=t.unstable_scheduleCallback,ca=t.unstable_NormalPriority,la={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ua(){return{controller:new oa,data:new Map,refCount:0}}function da(e){e.refCount--,e.refCount===0&&sa(ca,function(){e.controller.abort()})}var fa=null,pa=0,ma=0,ha=null;function ga(e,t){if(fa===null){var n=fa=[];pa=0,ma=Cd(),ha={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return pa++,t.then(_a,_a),t}function _a(){if(--pa===0&&fa!==null){ha!==null&&(ha.status=`fulfilled`);var e=fa;fa=null,ma=0,ha=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function va(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ya=N.S;N.S=function(e,t){du=Te(),typeof t==`object`&&t&&typeof t.then==`function`&&ga(e,t),ya!==null&&ya(e,t)};var ba=ne(null);function xa(){var e=ba.current;return e===null?Kl.pooledCache:e}function Sa(e,t){t===null?ie(ba,ba.current):ie(ba,t.pool)}function Ca(){var e=xa();return e===null?null:{parent:la._currentValue,pool:e}}var wa=Error(i(460)),Ta=Error(i(474)),Ea=Error(i(542)),Da={then:function(){}};function Oa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ka(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(en,en),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Na(e),e;default:if(typeof t.status==`string`)t.then(en,en);else{if(e=Kl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Na(e),e}throw ja=t,wa}}function Aa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ja=e,wa):e}}var ja=null;function Ma(){if(ja===null)throw Error(i(459));var e=ja;return ja=null,e}function Na(e){if(e===wa||e===Ea)throw Error(i(483))}var Pa=null,Fa=0;function Ia(e){var t=Fa;return Fa+=1,Pa===null&&(Pa=[]),ka(Pa,e,t)}function La(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ra(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function za(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=di(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&Aa(i)===t.type)?(t=a(t,n.props),La(t,n),t.return=e,t):(t=pi(n.type,n.key,n.props,null,e.mode,r),La(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=_i(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=mi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=pi(t.type,t.key,t.props,null,e.mode,n),La(n,t),n.return=e,n;case h:return t=_i(t,e.mode,n),t.return=e,t;case T:return t=Aa(t),f(e,t,n)}if(M(t)||k(t))return t=mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ia(t),n);if(t.$$typeof===b)return f(e,ia(e,t),n);Ra(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=Aa(n),p(e,t,n,r)}if(M(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ia(n),r);if(n.$$typeof===b)return p(e,t,ia(e,n),r);Ra(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=Aa(r),_(e,t,n,r,i)}if(M(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Ia(r),i);if(r.$$typeof===b)return _(e,t,n,ia(t,r),i);Ra(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Ii&&ki(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return Ii&&ki(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),Ii&&ki(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Ii&&ki(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Ii&&ki(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Ii&&ki(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Aa(l)===r.type){n(e,r.sibling),c=a(r,o.props),La(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=mi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=pi(o.type,o.key,o.props,null,e.mode,c),La(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=_i(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Aa(o),x(e,r,o,c)}if(M(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Ia(o),c);if(o.$$typeof===b)return x(e,r,ia(e,o),c);Ra(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Fa=0;var i=x(e,t,n,r);return Pa=null,i}catch(t){if(t===wa||t===Ea)throw t;var a=li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ba=za(!0),Va=za(!1),Ha=!1;function Ua(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Wa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ga(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ka(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Gl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=oi(e),ai(e,null,n),t}return ni(e,r,t,n),oi(e)}function qa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nt(e,n)}}function Ja(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ya=!1;function Xa(){if(Ya){var e=ha;if(e!==null)throw e}}function Za(e,t,n,r){Ya=!1;var i=e.updateQueue;Ha=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Jl&p)===p:(r&p)===p){p!==0&&p===ma&&(Ya=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Ha=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),nu|=o,e.lanes=o,e.memoizedState=d}}function Qa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function $a(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Qa(n[e],t)}var eo=ne(null),to=ne(0);function no(e,t){e=eu,ie(to,e),ie(eo,t),eu=e|t.baseLanes}function ro(){ie(to,eu),ie(eo,eo.current)}function io(){eu=to.current,re(eo),re(to)}var ao=ne(null),oo=null;function so(e){var t=e.alternate;ie(po,po.current&1),ie(ao,e),oo===null&&(t===null||eo.current!==null||t.memoizedState!==null)&&(oo=e)}function co(e){ie(po,po.current),ie(ao,e),oo===null&&(oo=e)}function lo(e){e.tag===22?(ie(po,po.current),ie(ao,e),oo===null&&(oo=e)):uo(e)}function uo(){ie(po,po.current),ie(ao,ao.current)}function fo(e){re(ao),oo===e&&(oo=null),re(po)}var po=ne(0);function mo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||_f(n)||vf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ho=0,go=null,_o=null,vo=null,yo=!1,bo=!1,xo=!1,So=0,Co=0,wo=null,To=0;function Eo(){throw Error(i(321))}function Do(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Cr(e[n],t[n]))return!1;return!0}function Oo(e,t,n,r,i,a){return ho=a,go=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Gs:Ks,xo=!1,a=n(r,i),xo=!1,bo&&(a=Ao(t,n,r,i)),ko(e),a}function ko(e){N.H=Ws;var t=_o!==null&&_o.next!==null;if(ho=0,vo=_o=go=null,yo=!1,Co=0,wo=null,t)throw Error(i(300));e===null||R||(e=e.dependencies,e!==null&&ta(e)&&(R=!0))}function Ao(e,t,n,r){go=e;var a=0;do{if(bo&&(wo=null),Co=0,bo=!1,25<=a)throw Error(i(301));if(a+=1,vo=_o=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=qs,o=t(n,r)}while(bo);return o}function jo(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Ro(t):t,e=e.useState()[0],(_o===null?null:_o.memoizedState)!==e&&(go.flags|=1024),t}function Mo(){var e=So!==0;return So=0,e}function No(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Po(e){if(yo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}yo=!1}ho=0,vo=_o=go=null,bo=!1,Co=So=0,wo=null}function Fo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vo===null?go.memoizedState=vo=e:vo=vo.next=e,vo}function Io(){if(_o===null){var e=go.alternate;e=e===null?null:e.memoizedState}else e=_o.next;var t=vo===null?go.memoizedState:vo.next;if(t!==null)vo=t,_o=e;else{if(e===null)throw go.alternate===null?Error(i(467)):Error(i(310));_o=e,e={memoizedState:_o.memoizedState,baseState:_o.baseState,baseQueue:_o.baseQueue,queue:_o.queue,next:null},vo===null?go.memoizedState=vo=e:vo=vo.next=e}return vo}function Lo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ro(e){var t=Co;return Co+=1,wo===null&&(wo=[]),e=ka(wo,e,t),t=go,(vo===null?t.memoizedState:vo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Gs:Ks),e}function zo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ro(e);if(e.$$typeof===b)return ra(e)}throw Error(i(438,String(e)))}function Bo(e){var t=null,n=go.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=go.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Lo(),go.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=D;return t.index++,n}function Vo(e,t){return typeof t==`function`?t(e):t}function Ho(e){return Uo(Io(),_o,e)}function Uo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(ho&f)===f:(Jl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ma&&(d=!0);else if((ho&p)===p){u=u.next,p===ma&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,go.lanes|=p,nu|=p;f=u.action,xo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,go.lanes|=f,nu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Cr(o,e.memoizedState)&&(R=!0,d&&(n=ha,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Wo(e){var t=Io(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Cr(o,t.memoizedState)||(R=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Go(e,t,n){var r=go,a=Io(),o=Ii;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Cr((_o||a).memoizedState,n);if(s&&(a.memoizedState=n,R=!0),a=a.queue,gs(Jo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||vo!==null&&vo.memoizedState.tag&1){if(r.flags|=2048,ds(9,{destroy:void 0},qo.bind(null,r,a,n,t),null),Kl===null)throw Error(i(349));o||ho&127||Ko(r,t,n)}return n}function Ko(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=go.updateQueue,t===null?(t=Lo(),go.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function qo(e,t,n,r){t.value=n,t.getSnapshot=r,Yo(t)&&Xo(e)}function Jo(e,t,n){return n(function(){Yo(t)&&Xo(e)})}function Yo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cr(e,n)}catch{return!0}}function Xo(e){var t=ii(e,2);t!==null&&Eu(t,e,2)}function Zo(e){var t=Fo();if(typeof e==`function`){var n=e;if(e=n(),xo){ze(!0);try{n()}finally{ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:e},t}function Qo(e,t,n,r){return e.baseState=n,Uo(e,_o,typeof r==`function`?r:Vo)}function $o(e,t,n,r,a){if(Vs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),ts(e,t,s)}catch(n){rs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),ts(e,t,a)}catch(n){rs(e,t,n)}}function ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ns(e,t,n)},function(n){return rs(e,t,n)}):ns(e,t,n)}function ns(e,t,n){t.status=`fulfilled`,t.value=n,is(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,es(e,n)))}function rs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,is(t),t=t.next;while(t!==r)}e.action=null}function is(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function as(e,t){return t}function os(e,t){if(Ii){var n=Kl.formState;if(n!==null){a:{var r=go;if(Ii){if(Fi){b:{for(var i=Fi,a=Ri;i.nodeType!==8;){if(!a){i=null;break b}if(i=bf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Fi=bf(i.nextSibling),r=i.data===`F!`;break a}}Bi(r)}r=!1}r&&(t=n[0])}}return n=Fo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:t},n.queue=r,n=Rs.bind(null,go,r),r.dispatch=n,r=Zo(!1),a=Bs.bind(null,go,!1,r.queue),r=Fo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=$o.bind(null,go,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ss(e){return cs(Io(),_o,e)}function cs(e,t,n){if(t=Uo(e,t,as)[0],e=Ho(Vo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ro(t)}catch(e){throw e===wa?Ea:e}else r=t;t=Io();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(go.flags|=2048,ds(9,{destroy:void 0},ls.bind(null,i,n),null)),[r,a,e]}function ls(e,t){e.action=t}function us(e){var t=Io(),n=_o;if(n!==null)return cs(t,n,e);Io(),t=t.memoizedState,n=Io();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ds(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=go.updateQueue,t===null&&(t=Lo(),go.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function fs(){return Io().memoizedState}function ps(e,t,n,r){var i=Fo();go.flags|=e,i.memoizedState=ds(1|t,{destroy:void 0},n,r===void 0?null:r)}function ms(e,t,n,r){var i=Io();r=r===void 0?null:r;var a=i.memoizedState.inst;_o!==null&&r!==null&&Do(r,_o.memoizedState.deps)?i.memoizedState=ds(t,a,n,r):(go.flags|=e,i.memoizedState=ds(1|t,a,n,r))}function hs(e,t){ps(8390656,8,e,t)}function gs(e,t){ms(2048,8,e,t)}function _s(e){go.flags|=4;var t=go.updateQueue;if(t===null)t=Lo(),go.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function vs(e){var t=Io().memoizedState;return _s({ref:t,nextImpl:e}),function(){if(Gl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ys(e,t){return ms(4,2,e,t)}function bs(e,t){return ms(4,4,e,t)}function xs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ss(e,t,n){n=n==null?null:n.concat([e]),ms(4,4,xs.bind(null,t,e),n)}function Cs(){}function ws(e,t){var n=Io();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Do(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ts(e,t){var n=Io();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Do(t,r[1]))return r[0];if(r=e(),xo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r}function Es(e,t,n){return n===void 0||ho&1073741824&&!(Jl&261930)?e.memoizedState=t:(e.memoizedState=n,e=Tu(),go.lanes|=e,nu|=e,n)}function Ds(e,t,n,r){return Cr(n,t)?n:eo.current===null?!(ho&42)||ho&1073741824&&!(Jl&261930)?(R=!0,e.memoizedState=n):(e=Tu(),go.lanes|=e,nu|=e,t):(e=Es(e,n,r),Cr(e,t)||(R=!0),e)}function Os(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Bs(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?zs(e,t,va(c,r),wu(e)):zs(e,t,r,wu(e))}catch(n){zs(e,t,{then:function(){},status:`rejected`,reason:n},wu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function ks(){}function As(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=js(e).queue;Os(e,a,t,F,n===null?ks:function(){return Ms(e),n(r)})}function js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ms(e){var t=js(e);t.next===null&&(t=e.alternate.memoizedState),zs(e,t.next.queue,{},wu())}function Ns(){return ra(up)}function Ps(){return Io().memoizedState}function Fs(){return Io().memoizedState}function Is(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=wu();e=Ga(n);var r=Ka(t,e,n);r!==null&&(Eu(r,t,n),qa(r,t,n)),t={cache:ua()},e.payload=t;return}t=t.return}}function Ls(e,t,n){var r=wu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Vs(e)?Hs(t,n):(n=ri(e,t,n,r),n!==null&&(Eu(n,e,r),Us(n,t,r)))}function Rs(e,t,n){zs(e,t,n,wu())}function zs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vs(e))Hs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Cr(s,o))return ni(e,t,i,0),Kl===null&&ti(),!1}catch{}if(n=ri(e,t,i,r),n!==null)return Eu(n,e,r),Us(n,t,r),!0}return!1}function Bs(e,t,n,r){if(r={lane:2,revertLane:Cd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Vs(e)){if(t)throw Error(i(479))}else t=ri(e,n,r,2),t!==null&&Eu(t,e,2)}function Vs(e){var t=e.alternate;return e===go||t!==null&&t===go}function Hs(e,t){bo=yo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Us(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nt(e,n)}}var Ws={readContext:ra,use:zo,useCallback:Eo,useContext:Eo,useEffect:Eo,useImperativeHandle:Eo,useLayoutEffect:Eo,useInsertionEffect:Eo,useMemo:Eo,useReducer:Eo,useRef:Eo,useState:Eo,useDebugValue:Eo,useDeferredValue:Eo,useTransition:Eo,useSyncExternalStore:Eo,useId:Eo,useHostTransitionStatus:Eo,useFormState:Eo,useActionState:Eo,useOptimistic:Eo,useMemoCache:Eo,useCacheRefresh:Eo};Ws.useEffectEvent=Eo;var Gs={readContext:ra,use:zo,useCallback:function(e,t){return Fo().memoizedState=[e,t===void 0?null:t],e},useContext:ra,useEffect:hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ps(4194308,4,xs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ps(4194308,4,e,t)},useInsertionEffect:function(e,t){ps(4,2,e,t)},useMemo:function(e,t){var n=Fo();t=t===void 0?null:t;var r=e();if(xo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Fo();if(n!==void 0){var i=n(t);if(xo){ze(!0);try{n(t)}finally{ze(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ls.bind(null,go,e),[r.memoizedState,e]},useRef:function(e){var t=Fo();return e={current:e},t.memoizedState=e},useState:function(e){e=Zo(e);var t=e.queue,n=Rs.bind(null,go,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Cs,useDeferredValue:function(e,t){return Es(Fo(),e,t)},useTransition:function(){var e=Zo(!1);return e=Os.bind(null,go,e.queue,!0,!1),Fo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=go,a=Fo();if(Ii){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Kl===null)throw Error(i(349));Jl&127||Ko(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,hs(Jo.bind(null,r,o,e),[e]),r.flags|=2048,ds(9,{destroy:void 0},qo.bind(null,r,o,n,t),null),n},useId:function(){var e=Fo(),t=Kl.identifierPrefix;if(Ii){var n=Oi,r=Di;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=So++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=To++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ns,useFormState:os,useActionState:os,useOptimistic:function(e){var t=Fo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Bs.bind(null,go,!0,n),n.dispatch=t,[e,t]},useMemoCache:Bo,useCacheRefresh:function(){return Fo().memoizedState=Is.bind(null,go)},useEffectEvent:function(e){var t=Fo(),n={impl:e};return t.memoizedState=n,function(){if(Gl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ks={readContext:ra,use:zo,useCallback:ws,useContext:ra,useEffect:gs,useImperativeHandle:Ss,useInsertionEffect:ys,useLayoutEffect:bs,useMemo:Ts,useReducer:Ho,useRef:fs,useState:function(){return Ho(Vo)},useDebugValue:Cs,useDeferredValue:function(e,t){return Ds(Io(),_o.memoizedState,e,t)},useTransition:function(){var e=Ho(Vo)[0],t=Io().memoizedState;return[typeof e==`boolean`?e:Ro(e),t]},useSyncExternalStore:Go,useId:Ps,useHostTransitionStatus:Ns,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){return Qo(Io(),_o,e,t)},useMemoCache:Bo,useCacheRefresh:Fs};Ks.useEffectEvent=vs;var qs={readContext:ra,use:zo,useCallback:ws,useContext:ra,useEffect:gs,useImperativeHandle:Ss,useInsertionEffect:ys,useLayoutEffect:bs,useMemo:Ts,useReducer:Wo,useRef:fs,useState:function(){return Wo(Vo)},useDebugValue:Cs,useDeferredValue:function(e,t){var n=Io();return _o===null?Es(n,e,t):Ds(n,_o.memoizedState,e,t)},useTransition:function(){var e=Wo(Vo)[0],t=Io().memoizedState;return[typeof e==`boolean`?e:Ro(e),t]},useSyncExternalStore:Go,useId:Ps,useHostTransitionStatus:Ns,useFormState:us,useActionState:us,useOptimistic:function(e,t){var n=Io();return _o===null?(n.baseState=e,[e,n.queue.dispatch]):Qo(n,_o,e,t)},useMemoCache:Bo,useCacheRefresh:Fs};qs.useEffectEvent=vs;function Js(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ys={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=wu(),i=Ga(r);i.payload=t,n!=null&&(i.callback=n),t=Ka(e,i,r),t!==null&&(Eu(t,e,r),qa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=wu(),i=Ga(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ka(e,i,r),t!==null&&(Eu(t,e,r),qa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wu(),r=Ga(n);r.tag=2,t!=null&&(r.callback=t),t=Ka(e,r,n),t!==null&&(Eu(t,e,n),qa(t,e,n))}};function Xs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!wr(n,r)||!wr(i,a):!0}function Zs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ys.enqueueReplaceState(t,t.state,null)}function Qs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function $s(e){Zr(e)}function ec(e){console.error(e)}function tc(e){Zr(e)}function nc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function rc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ic(e,t,n){return n=Ga(n),n.tag=3,n.payload={element:null},n.callback=function(){nc(e,t)},n}function ac(e){return e=Ga(e),e.tag=3,e}function oc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){rc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){rc(t,n,r),typeof i!=`function`&&(mu===null?mu=new Set([this]):mu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function sc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ea(t,n,a,!0),n=ao.current,n!==null){switch(n.tag){case 31:case 13:return oo===null?Ru():n.alternate===null&&tu===0&&(tu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Da?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),rd(e,r,a)),!1;case 22:return n.flags|=65536,r===Da?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),rd(e,r,a)),!1}throw Error(i(435,n.tag))}return rd(e,r,a),Ru(),!1}if(Ii)return t=ao.current,t===null?(r!==zi&&(t=Error(i(423),{cause:r}),Ki(yi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=yi(r,n),a=ic(e.stateNode,r,a),Ja(e,a),tu!==4&&(tu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==zi&&(e=Error(i(422),{cause:r}),Ki(yi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=yi(o,n),su===null?su=[o]:su.push(o),tu!==4&&(tu=2),t===null)return!0;r=yi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ic(n.stateNode,r,e),Ja(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(mu===null||!mu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ac(a),oc(a,e,n,r),Ja(n,a),!1}n=n.return}while(n!==null);return!1}var cc=Error(i(461)),R=!1;function lc(e,t,n,r){t.child=e===null?Va(t,null,n,r):Ba(t,e.child,n,r)}function uc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return na(t),r=Oo(e,t,n,o,a,i),s=Mo(),e!==null&&!R?(No(e,t,i),Nc(e,t,i)):(Ii&&s&&ji(t),t.flags|=1,lc(e,t,r,i),t.child)}function dc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,fc(e,t,a,r,i)):(e=pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Pc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?wr:n,n(o,r)&&e.ref===t.ref)return Nc(e,t,i)}return t.flags|=1,e=di(a,r),e.ref=t.ref,e.return=t,t.child=e}function fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(wr(a,r)&&e.ref===t.ref)if(R=!1,t.pendingProps=r=a,Pc(e,i))e.flags&131072&&(R=!0);else return t.lanes=e.lanes,Nc(e,t,i)}return bc(e,t,n,r,i)}function pc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Sa(t,a===null?null:a.cachePool),a===null?ro():no(t,a),lo(t);else return r=t.lanes=536870912,hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Sa(t,null),ro(),uo(t)):(Sa(t,a.cachePool),no(t,a),uo(t),t.memoizedState=null);return lc(e,t,i,n),t.child}function mc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function hc(e,t,n,r,i){var a=xa();return a=a===null?null:{parent:la._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Sa(t,null),ro(),lo(t),e!==null&&ea(e,t,r,!0),t.childLanes=i,null}function gc(e,t){return t=Oc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function _c(e,t,n){return Ba(t,e.child,null,n),e=gc(t,t.pendingProps),e.flags|=2,fo(t),t.memoizedState=null,e}function vc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Ii){if(r.mode===`hidden`)return e=gc(t,r),t.lanes=536870912,mc(null,e);if(co(t),(e=Fi)?(e=gf(e,Ri),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw Bi(t);return t.lanes=536870912,null}return gc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(co(t),a)if(t.flags&256)t.flags&=-257,t=_c(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(R||ea(e,t,n,!1),a=(n&e.childLanes)!==0,R||a){if(r=Kl,r!==null&&(s=rt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ii(e,s),Eu(r,e,s),cc;Ru(),t=_c(e,t,n)}else e=o.treeContext,Fi=bf(s.nextSibling),Pi=t,Ii=!0,Li=null,Ri=!1,e!==null&&Ni(t,e),t=gc(t,r),t.flags|=4096;return t}return e=di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function yc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function bc(e,t,n,r,i){return na(t),n=Oo(e,t,n,r,void 0,i),r=Mo(),e!==null&&!R?(No(e,t,i),Nc(e,t,i)):(Ii&&r&&ji(t),t.flags|=1,lc(e,t,n,i),t.child)}function xc(e,t,n,r,i,a){return na(t),t.updateQueue=null,n=Ao(t,r,n,i),ko(e),r=Mo(),e!==null&&!R?(No(e,t,a),Nc(e,t,a)):(Ii&&r&&ji(t),t.flags|=1,lc(e,t,n,a),t.child)}function z(e,t,n,r,i){if(na(t),t.stateNode===null){var a=si,o=n.contextType;typeof o==`object`&&o&&(a=ra(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ys,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ua(t),o=n.contextType,a.context=typeof o==`object`&&o?ra(o):si,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Js(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ys.enqueueReplaceState(a,a.state,null),Za(t,r,a,i),Xa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Qs(n,s);a.props=c;var l=a.context,u=n.contextType;o=si,typeof u==`object`&&u&&(o=ra(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Zs(t,a,r,o),Ha=!1;var f=t.memoizedState;a.state=f,Za(t,r,a,i),Xa(),l=t.memoizedState,s||f!==l||Ha?(typeof d==`function`&&(Js(t,n,d,r),l=t.memoizedState),(c=Ha||Xs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Wa(e,t),o=t.memoizedProps,u=Qs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=si,typeof l==`object`&&l&&(c=ra(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Zs(t,a,r,c),Ha=!1,f=t.memoizedState,a.state=f,Za(t,r,a,i),Xa();var p=t.memoizedState;o!==d||f!==p||Ha||e!==null&&e.dependencies!==null&&ta(e.dependencies)?(typeof s==`function`&&(Js(t,n,s,r),p=t.memoizedState),(u=Ha||Xs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ta(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,yc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ba(t,e.child,null,i),t.child=Ba(t,null,n,i)):lc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Nc(e,t,i),e}function Sc(e,t,n,r){return Wi(),t.flags|=256,lc(e,t,n,r),t.child}var Cc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wc(e){return{baseLanes:e,cachePool:Ca()}}function Tc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=au),e}function Ec(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(po.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Ii){if(a?so(t):uo(t),(e=Fi)?(e=gf(e,Ri),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw Bi(t);return vf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(uo(t),a=t.mode,c=Oc({mode:`hidden`,children:c},a),r=mi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=wc(n),r.childLanes=Tc(e,s,n),t.memoizedState=Cc,mc(null,r)):(so(t),Dc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(so(t),t.flags&=-257,t=kc(e,t,n)):t.memoizedState===null?(uo(t),c=r.fallback,a=t.mode,r=Oc({mode:`visible`,children:r.children},a),c=mi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ba(t,e.child,null,n),r=t.child,r.memoizedState=wc(n),r.childLanes=Tc(e,s,n),t.memoizedState=Cc,t=mc(null,r)):(uo(t),t.child=e.child,t.flags|=128,t=null);else if(so(t),vf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ki({value:r,source:null,stack:null}),t=kc(e,t,n)}else if(R||ea(e,t,n,!1),s=(n&e.childLanes)!==0,R||s){if(s=Kl,s!==null&&(r=rt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ii(e,r),Eu(s,e,r),cc;_f(c)||Ru(),t=kc(e,t,n)}else _f(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Fi=bf(c.nextSibling),Pi=t,Ii=!0,Li=null,Ri=!1,e!==null&&Ni(t,e),t=Dc(t,r.children),t.flags|=4096);return t}return a?(uo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=di(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=mi(c,a,n,null),c.flags|=2):c=di(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,mc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=wc(n):(a=c.cachePool,a===null?a=Ca():(l=la._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Tc(e,s,n),t.memoizedState=Cc,mc(e.child,r)):(so(t),n=e.child,e=n.sibling,n=di(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Dc(e,t){return t=Oc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Oc(e,t){return e=li(22,e,null,t),e.lanes=0,e}function kc(e,t,n){return Ba(t,e.child,null,n),e=Dc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ac(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qi(e.return,t,n)}function jc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Mc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=po.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,ie(po,o),lc(e,t,r,n),r=Ii?Ci:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ac(e,n,t);else if(e.tag===19)Ac(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&mo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),jc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&mo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}jc(t,!0,n,null,a,r);break;case`together`:jc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Nc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),nu|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ea(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Pc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&ta(e))):!0}function Fc(e,t,n){switch(t.tag){case 3:le(t,t.stateNode.containerInfo),Xi(t,la,e.memoizedState.cache),Wi();break;case 27:case 5:de(t);break;case 4:le(t,t.stateNode.containerInfo);break;case 10:Xi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,co(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(so(t),e=Nc(e,t,n),e===null?null:e.sibling):Ec(e,t,n):(so(t),t.flags|=128,null);so(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ea(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Mc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ie(po,po.current),r)break;return null;case 22:return t.lanes=0,pc(e,t,n,t.pendingProps);case 24:Xi(t,la,e.memoizedState.cache)}return Nc(e,t,n)}function Ic(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)R=!0;else{if(!Pc(e,n)&&!(t.flags&128))return R=!1,Fc(e,t,n);R=!!(e.flags&131072)}else R=!1,Ii&&t.flags&1048576&&Ai(t,Ci,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Aa(t.elementType),t.type=e,typeof e==`function`)ui(e)?(r=Qs(e,r),t.tag=1,t=z(null,t,e,r,n)):(t.tag=0,t=bc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=uc(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=dc(null,t,e,r,n);break a}}throw t=j(e)||e,Error(i(306,t,``))}}return t;case 0:return bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Qs(r,t.pendingProps),z(e,t,r,a,n);case 3:a:{if(le(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Wa(e,t),Za(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Xi(t,la,r),r!==o.cache&&$i(t,[la],n,!0),Xa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Sc(e,t,r,n);break a}else if(r!==a){a=yi(Error(i(424)),t),Ki(a),t=Sc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Fi=bf(e.firstChild),Pi=t,Ii=!0,Li=null,Ri=!0,n=Va(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Wi(),r===a){t=Nc(e,t,n);break a}lc(e,t,r,n)}t=t.child}return t;case 26:return yc(e,t),e===null?(n=Vf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ii||(n=t.type,e=t.pendingProps,r=$d(se.current).createElement(n),r[lt]=t,r[ut]=e,qd(r,n,e),St(r),t.stateNode=r):t.memoizedState=Vf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return de(t),e===null&&Ii&&(r=t.stateNode=wf(t.type,t.pendingProps,se.current),Pi=t,Ri=!0,a=Fi,uf(t.type)?(xf=a,Fi=bf(r.firstChild)):Fi=a),lc(e,t,t.pendingProps.children,n),yc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ii&&((a=r=Fi)&&(r=mf(r,t.type,t.pendingProps,Ri),r===null?a=!1:(t.stateNode=r,Pi=t,Fi=bf(r.firstChild),Ri=!1,a=!0)),a||Bi(t)),de(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,V(a,o)?r=null:s!==null&&V(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Oo(e,t,jo,null,null,n),up._currentValue=a),yc(e,t),lc(e,t,r,n),t.child;case 6:return e===null&&Ii&&((e=n=Fi)&&(n=hf(n,t.pendingProps,Ri),n===null?e=!1:(t.stateNode=n,Pi=t,Fi=null,e=!0)),e||Bi(t)),null;case 13:return Ec(e,t,n);case 4:return le(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ba(t,null,r,n):lc(e,t,r,n),t.child;case 11:return uc(e,t,t.type,t.pendingProps,n);case 7:return lc(e,t,t.pendingProps,n),t.child;case 8:return lc(e,t,t.pendingProps.children,n),t.child;case 12:return lc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Xi(t,t.type,r.value),lc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,na(t),a=ra(a),r=r(a),t.flags|=1,lc(e,t,r,n),t.child;case 14:return dc(e,t,t.type,t.pendingProps,n);case 15:return fc(e,t,t.type,t.pendingProps,n);case 19:return Mc(e,t,n);case 31:return vc(e,t,n);case 22:return pc(e,t,n,t.pendingProps);case 24:return na(t),r=ra(la),e===null?(a=xa(),a===null&&(a=Kl,o=ua(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ua(t),Xi(t,la,a)):((e.lanes&n)!==0&&(Wa(e,t),Za(t,null,null,n),Xa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Xi(t,la,r),r!==a.cache&&$i(t,[la],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Xi(t,la,r))),lc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Lc(e){e.flags|=4}function Rc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Fu())e.flags|=8192;else throw ja=Da,Ta}else e.flags&=-16777217}function zc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!np(t))if(Fu())e.flags|=8192;else throw ja=Da,Ta}function Bc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ze(),e.lanes|=t,ou|=t)}function Vc(e,t){if(!Ii)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Hc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Uc(e,t,n){var r=t.pendingProps;switch(Mi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hc(t),null;case 1:return Hc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Zi(la),ue(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ui(t)?Lc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Gi())),Hc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Lc(t),o===null?(Hc(t),Rc(t,a,null,r,n)):(Hc(t),zc(t,o))):o?o===e.memoizedState?(Hc(t),t.flags&=-16777217):(Lc(t),Hc(t),zc(t,o)):(e=e.memoizedProps,e!==r&&Lc(t),Hc(t),Rc(t,a,e,r,n)),null;case 27:if(fe(t),n=se.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Hc(t),null}e=ae.current,Ui(t)?Vi(t,e):(e=wf(a,r,n),t.stateNode=e,Lc(t))}return Hc(t),null;case 5:if(fe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Hc(t),null}if(o=ae.current,Ui(t))Vi(t,o);else{var s=$d(se.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[lt]=t,o[ut]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(qd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Lc(t)}}return Hc(t),Rc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=se.current,Ui(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Pi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[lt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Wd(e.nodeValue,n)),e||Bi(t,!0)}else e=$d(e).createTextNode(r),e[lt]=t,t.stateNode=e}return Hc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ui(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[lt]=t}else Wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hc(t),e=!1}else n=Gi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(fo(t),t):(fo(t),null);if(t.flags&128)throw Error(i(558))}return Hc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ui(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[lt]=t}else Wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hc(t),a=!1}else a=Gi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(fo(t),t):(fo(t),null)}return fo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Bc(t,t.updateQueue),Hc(t),null);case 4:return ue(),e===null&&Fd(t.stateNode.containerInfo),Hc(t),null;case 10:return Zi(t.type),Hc(t),null;case 19:if(re(po),r=t.memoizedState,r===null)return Hc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Vc(r,!1);else{if(tu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=mo(e),o!==null){for(t.flags|=128,Vc(r,!1),e=o.updateQueue,t.updateQueue=e,Bc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fi(n,e),n=n.sibling;return ie(po,po.current&1|2),Ii&&ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Te()>fu&&(t.flags|=128,a=!0,Vc(r,!1),t.lanes=4194304)}else{if(!a)if(e=mo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Bc(t,e),Vc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ii)return Hc(t),null}else 2*Te()-r.renderingStartTime>fu&&n!==536870912&&(t.flags|=128,a=!0,Vc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Hc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Te(),e.sibling=null,n=po.current,ie(po,a?n&1|2:n&1),Ii&&ki(t,r.treeForkCount),e);case 22:case 23:return fo(t),io(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Hc(t),t.subtreeFlags&6&&(t.flags|=8192)):Hc(t),n=t.updateQueue,n!==null&&Bc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&re(ba),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Zi(la),Hc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Wc(e,t){switch(Mi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zi(la),ue(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fe(t),null;case 31:if(t.memoizedState!==null){if(fo(t),t.alternate===null)throw Error(i(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(fo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return re(po),null;case 4:return ue(),null;case 10:return Zi(t.type),null;case 22:case 23:return fo(t),io(),e!==null&&re(ba),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Zi(la),null;case 25:return null;default:return null}}function Gc(e,t){switch(Mi(t),t.tag){case 3:Zi(la),ue();break;case 26:case 27:case 5:fe(t);break;case 4:ue();break;case 31:t.memoizedState!==null&&fo(t);break;case 13:fo(t);break;case 19:re(po);break;case 10:Zi(t.type);break;case 22:case 23:fo(t),io(),e!==null&&re(ba);break;case 24:Zi(la)}}function Kc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){nd(t,t.return,e)}}function qc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){nd(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){nd(t,t.return,e)}}function Jc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{$a(t,n)}catch(t){nd(e,e.return,t)}}}function Yc(e,t,n){n.props=Qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){nd(e,t,n)}}function Xc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){nd(e,t,n)}}function Zc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){nd(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){nd(e,t,n)}else n.current=null}function Qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){nd(e,e.return,t)}}function $c(e,t,n){try{var r=e.stateNode;Jd(r,e.type,n,t),r[ut]=t}catch(t){nd(e,e.return,t)}}function el(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&uf(e.type)||e.tag===4}function tl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||el(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&uf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=en));else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(nl(e,t,n),e=e.sibling;e!==null;)nl(e,t,n),e=e.sibling}function rl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);qd(t,r,n),t[lt]=e,t[ut]=n}catch(t){nd(e,e.return,t)}}var al=!1,ol=!1,sl=!1,cl=typeof WeakSet==`function`?WeakSet:Set,ll=null;function ul(e,t){if(e=e.containerInfo,Zd=yp,e=Or(e),kr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Qd={focusedElem:e,selectionRange:n},yp=!1,ll=t;ll!==null;)if(t=ll,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ll=e;else for(;ll!==null;){switch(t=ll,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Qs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){nd(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)pf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:pf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ll=e;break}ll=t.return}}function dl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:El(e,n),r&4&&Kc(5,n);break;case 1:if(El(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){nd(n,n.return,e)}else{var i=Qs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){nd(n,n.return,e)}}r&64&&Jc(n),r&512&&Xc(n,n.return);break;case 3:if(El(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{$a(e,t)}catch(e){nd(n,n.return,e)}}break;case 27:t===null&&r&4&&il(n);case 26:case 5:El(e,n),t===null&&r&4&&Qc(n),r&512&&Xc(n,n.return);break;case 12:El(e,n);break;case 31:El(e,n),r&4&&_l(e,n);break;case 13:El(e,n),r&4&&vl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=od.bind(null,n),yf(e,n))));break;case 22:if(r=n.memoizedState!==null||al,!r){t=t!==null&&t.memoizedState!==null||ol,i=al;var a=ol;al=r,(ol=t)&&!a?Ol(e,n,(n.subtreeFlags&8772)!=0):El(e,n),al=i,ol=a}break;case 30:break;default:El(e,n)}}function fl(e){var t=e.alternate;t!==null&&(e.alternate=null,fl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_t(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var pl=null,ml=!1;function hl(e,t,n){for(n=n.child;n!==null;)gl(e,t,n),n=n.sibling}function gl(e,t,n){if(Re&&typeof Re.onCommitFiberUnmount==`function`)try{Re.onCommitFiberUnmount(Le,n)}catch{}switch(n.tag){case 26:ol||Zc(n,t),hl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ol||Zc(n,t);var r=pl,i=ml;uf(n.type)&&(pl=n.stateNode,ml=!1),hl(e,t,n),Tf(n.stateNode),pl=r,ml=i;break;case 5:ol||Zc(n,t);case 6:if(r=pl,i=ml,pl=null,hl(e,t,n),pl=r,ml=i,pl!==null)if(ml)try{(pl.nodeType===9?pl.body:pl.nodeName===`HTML`?pl.ownerDocument.body:pl).removeChild(n.stateNode)}catch(e){nd(n,t,e)}else try{pl.removeChild(n.stateNode)}catch(e){nd(n,t,e)}break;case 18:pl!==null&&(ml?(e=pl,df(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Gp(e)):df(pl,n.stateNode));break;case 4:r=pl,i=ml,pl=n.stateNode.containerInfo,ml=!0,hl(e,t,n),pl=r,ml=i;break;case 0:case 11:case 14:case 15:qc(2,n,t),ol||qc(4,n,t),hl(e,t,n);break;case 1:ol||(Zc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Yc(n,t,r)),hl(e,t,n);break;case 21:hl(e,t,n);break;case 22:ol=(r=ol)||n.memoizedState!==null,hl(e,t,n),ol=r;break;default:hl(e,t,n)}}function _l(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gp(e)}catch(e){nd(t,t.return,e)}}}function vl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gp(e)}catch(e){nd(t,t.return,e)}}function yl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cl),t;default:throw Error(i(435,e.tag))}}function bl(e,t){var n=yl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=sd.bind(null,e,t);t.then(r,r)}})}function xl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(uf(c.type)){pl=c.stateNode,ml=!1;break a}break;case 5:pl=c.stateNode,ml=!1;break a;case 3:case 4:pl=c.stateNode.containerInfo,ml=!0;break a}c=c.return}if(pl===null)throw Error(i(160));gl(o,s,a),pl=null,ml=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Cl(t,e),t=t.sibling}var Sl=null;function Cl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:xl(t,e),wl(e),r&4&&(qc(3,e,e.return),Kc(3,e),qc(5,e,e.return));break;case 1:xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),r&64&&al&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=Sl;if(xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[gt]||o[lt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),qd(o,r,n),o[lt]=e,St(o),r=o;break a;case`link`:var s=$f(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),qd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=$f(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),qd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[lt]=e,St(o),r=o}e.stateNode=r}else ep(a,e.type,e.stateNode);else e.stateNode=Jf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&$c(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?ep(a,e.type,e.stateNode):Jf(a,r,e.memoizedProps))}break;case 27:xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),n!==null&&r&4&&$c(e,e.memoizedProps,n.memoizedProps);break;case 5:if(xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),e.flags&32){a=e.stateNode;try{Jt(a,``)}catch(t){nd(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,$c(e,a,n===null?a:n.memoizedProps)),r&1024&&(sl=!0);break;case 6:if(xl(t,e),wl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){nd(e,e.return,t)}}break;case 3:if(Qf=null,a=Sl,Sl=Of(t.containerInfo),xl(t,e),Sl=a,wl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Gp(t.containerInfo)}catch(t){nd(e,e.return,t)}sl&&(sl=!1,Tl(e));break;case 4:r=Sl,Sl=Of(e.stateNode.containerInfo),xl(t,e),wl(e),Sl=r;break;case 12:xl(t,e),wl(e);break;case 31:xl(t,e),wl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 13:xl(t,e),wl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(uu=Te()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=al,d=ol;if(al=u||a,ol=d||l,xl(t,e),ol=d,al=u,wl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||al||ol||Dl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){nd(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){nd(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?ff(m,!0):ff(l.stateNode,!1)}catch(e){nd(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,bl(e,n))));break;case 19:xl(t,e),wl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 30:break;case 21:break;default:xl(t,e),wl(e)}}function wl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(el(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;rl(e,tl(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Jt(o,``),n.flags&=-33),rl(e,tl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;nl(e,tl(e),s);break;default:throw Error(i(161))}}catch(t){nd(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Tl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function El(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dl(e,t.alternate,t),t=t.sibling}function Dl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:qc(4,t,t.return),Dl(t);break;case 1:Zc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Yc(t,t.return,n),Dl(t);break;case 27:Tf(t.stateNode);case 26:case 5:Zc(t,t.return),Dl(t);break;case 22:t.memoizedState===null&&Dl(t);break;case 30:Dl(t);break;default:Dl(t)}e=e.sibling}}function Ol(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Ol(i,a,n),Kc(4,a);break;case 1:if(Ol(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){nd(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Qa(c[i],s)}catch(e){nd(r,r.return,e)}}n&&o&64&&Jc(a),Xc(a,a.return);break;case 27:il(a);case 26:case 5:Ol(i,a,n),n&&r===null&&o&4&&Qc(a),Xc(a,a.return);break;case 12:Ol(i,a,n);break;case 31:Ol(i,a,n),n&&o&4&&_l(i,a);break;case 13:Ol(i,a,n),n&&o&4&&vl(i,a);break;case 22:a.memoizedState===null&&Ol(i,a,n),Xc(a,a.return);break;case 30:break;default:Ol(i,a,n)}t=t.sibling}}function kl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&da(n))}function Al(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&da(e))}function jl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ml(e,t,n,r),t=t.sibling}function Ml(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:jl(e,t,n,r),i&2048&&Kc(9,t);break;case 1:jl(e,t,n,r);break;case 3:jl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&da(e)));break;case 12:if(i&2048){jl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){nd(t,t.return,e)}}else jl(e,t,n,r);break;case 31:jl(e,t,n,r);break;case 13:jl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?jl(e,t,n,r):(a._visibility|=2,Nl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?jl(e,t,n,r):Pl(e,t),i&2048&&kl(o,t);break;case 24:jl(e,t,n,r),i&2048&&Al(t.alternate,t);break;default:jl(e,t,n,r)}}function Nl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Nl(a,o,s,c,i),Kc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Nl(a,o,s,c,i)):u._visibility&2?Nl(a,o,s,c,i):Pl(a,o),i&&l&2048&&kl(o.alternate,o);break;case 24:Nl(a,o,s,c,i),i&&l&2048&&Al(o.alternate,o);break;default:Nl(a,o,s,c,i)}t=t.sibling}}function Pl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Pl(n,r),i&2048&&kl(r.alternate,r);break;case 24:Pl(n,r),i&2048&&Al(r.alternate,r);break;default:Pl(n,r)}t=t.sibling}}var Fl=8192;function Il(e,t,n){if(e.subtreeFlags&Fl)for(e=e.child;e!==null;)Ll(e,t,n),e=e.sibling}function Ll(e,t,n){switch(e.tag){case 26:Il(e,t,n),e.flags&Fl&&e.memoizedState!==null&&rp(n,Sl,e.memoizedState,e.memoizedProps);break;case 5:Il(e,t,n);break;case 3:case 4:var r=Sl;Sl=Of(e.stateNode.containerInfo),Il(e,t,n),Sl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Fl,Fl=16777216,Il(e,t,n),Fl=r):Il(e,t,n));break;default:Il(e,t,n)}}function Rl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function zl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ll=r,Hl(r,e)}Rl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bl(e),e=e.sibling}function Bl(e){switch(e.tag){case 0:case 11:case 15:zl(e),e.flags&2048&&qc(9,e,e.return);break;case 3:zl(e);break;case 12:zl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Vl(e)):zl(e);break;default:zl(e)}}function Vl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ll=r,Hl(r,e)}Rl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:qc(8,t,t.return),Vl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Vl(t));break;default:Vl(t)}e=e.sibling}}function Hl(e,t){for(;ll!==null;){var n=ll;switch(n.tag){case 0:case 11:case 15:qc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:da(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ll=r;else a:for(n=e;ll!==null;){r=ll;var i=r.sibling,a=r.return;if(fl(r),r===n){ll=null;break a}if(i!==null){i.return=a,ll=i;break a}ll=a}}}var Ul={getCacheForType:function(e){var t=ra(la),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ra(la).controller.signal}},Wl=typeof WeakMap==`function`?WeakMap:Map,Gl=0,Kl=null,ql=null,Jl=0,Yl=0,Xl=null,Zl=!1,Ql=!1,$l=!1,eu=0,tu=0,nu=0,ru=0,iu=0,au=0,ou=0,su=null,cu=null,lu=!1,uu=0,du=0,fu=1/0,pu=null,mu=null,hu=0,gu=null,_u=null,vu=0,yu=0,bu=null,xu=null,Su=0,Cu=null;function wu(){return Gl&2&&Jl!==0?Jl&-Jl:N.T===null?ot():Cd()}function Tu(){if(au===0)if(!(Jl&536870912)||Ii){var e=Ge;Ge<<=1,!(Ge&3932160)&&(Ge=262144),au=e}else au=536870912;return e=ao.current,e!==null&&(e.flags|=32),au}function Eu(e,t,n){(e===Kl&&(Yl===2||Yl===9)||e.cancelPendingCommit!==null)&&(Nu(e,0),Au(e,Jl,au,!1)),$e(e,n),(!(Gl&2)||e!==Kl)&&(e===Kl&&(!(Gl&2)&&(ru|=n),tu===4&&Au(e,Jl,au,!1)),hd(e))}function Du(e,t,n){if(Gl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ye(e,t),a=r?Vu(e,t):zu(e,t,!0),o=r;do{if(a===0){Ql&&!r&&Au(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!ku(n)){a=zu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=su;var l=c.current.memoizedState.isDehydrated;if(l&&(Nu(c,s).flags|=256),s=zu(c,s,!1),s!==2){if($l&&!l){c.errorRecoveryDisabledLanes|=o,ru|=o,a=4;break a}o=cu,cu=a,o!==null&&(cu===null?cu=o:cu.push.apply(cu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Nu(e,0),Au(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Au(r,t,au,!Zl);break a;case 2:cu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=uu+300-Te(),10<a)){if(Au(r,t,au,!Zl),Je(r,0,!0)!==0)break a;vu=t,r.timeoutHandle=af(Ou.bind(null,r,n,cu,pu,lu,t,au,ru,ou,Zl,o,`Throttled`,-0,0),a);break a}Ou(r,n,cu,pu,lu,t,au,ru,ou,Zl,o,null,-0,0)}}break}while(1);hd(e)}function Ou(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:en},Ll(t,a,d);var m=(a&62914560)===a?uu-Te():(a&4194048)===a?du-Te():0;if(m=ap(d,m),m!==null){vu=a,e.cancelPendingCommit=m(Ju.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Au(e,a,o,!l);return}}Ju(e,t,a,n,r,i,o,s,c)}function ku(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Cr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Au(e,t,n,r){t&=~iu,t&=~ru,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Be(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&tt(e,n,t)}function ju(){return Gl&6?!0:(gd(0,!1),!1)}function Mu(){if(ql!==null){if(Yl===0)var e=ql.return;else e=ql,Yi=Ji=null,Po(e),Pa=null,Fa=0,e=ql;for(;e!==null;)Gc(e.alternate,e),e=e.return;ql=null}}function Nu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,of(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),vu=0,Mu(),Kl=e,ql=n=di(e.current,null),Jl=t,Yl=0,Xl=null,Zl=!1,Ql=Ye(e,t),$l=!1,ou=au=iu=ru=nu=tu=0,cu=su=null,lu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Be(r),a=1<<i;t|=e[i],r&=~a}return eu=t,ti(),n}function Pu(e,t){go=null,N.H=Ws,t===wa||t===Ea?(t=Ma(),Yl=3):t===Ta?(t=Ma(),Yl=4):Yl=t===cc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Xl=t,ql===null&&(tu=1,nc(e,yi(t,e.current)))}function Fu(){var e=ao.current;return e===null?!0:(Jl&4194048)===Jl?oo===null:(Jl&62914560)===Jl||Jl&536870912?e===oo:!1}function Iu(){var e=N.H;return N.H=Ws,e===null?Ws:e}function Lu(){var e=N.A;return N.A=Ul,e}function Ru(){tu=4,Zl||(Jl&4194048)!==Jl&&ao.current!==null||(Ql=!0),!(nu&134217727)&&!(ru&134217727)||Kl===null||Au(Kl,Jl,au,!1)}function zu(e,t,n){var r=Gl;Gl|=2;var i=Iu(),a=Lu();(Kl!==e||Jl!==t)&&(pu=null,Nu(e,t)),t=!1;var o=tu;a:do try{if(Yl!==0&&ql!==null){var s=ql,c=Xl;switch(Yl){case 8:Mu(),o=6;break a;case 3:case 2:case 9:case 6:ao.current===null&&(t=!0);var l=Yl;if(Yl=0,Xl=null,Gu(e,s,c,l),n&&Ql){o=0;break a}break;default:l=Yl,Yl=0,Xl=null,Gu(e,s,c,l)}}Bu(),o=tu;break}catch(t){Pu(e,t)}while(1);return t&&e.shellSuspendCounter++,Yi=Ji=null,Gl=r,N.H=i,N.A=a,ql===null&&(Kl=null,Jl=0,ti()),o}function Bu(){for(;ql!==null;)Uu(ql)}function Vu(e,t){var n=Gl;Gl|=2;var r=Iu(),a=Lu();Kl!==e||Jl!==t?(pu=null,fu=Te()+500,Nu(e,t)):Ql=Ye(e,t);a:do try{if(Yl!==0&&ql!==null){t=ql;var o=Xl;b:switch(Yl){case 1:Yl=0,Xl=null,Gu(e,t,o,1);break;case 2:case 9:if(Oa(o)){Yl=0,Xl=null,Wu(t);break}t=function(){Yl!==2&&Yl!==9||Kl!==e||(Yl=7),hd(e)},o.then(t,t);break a;case 3:Yl=7;break a;case 4:Yl=5;break a;case 7:Oa(o)?(Yl=0,Xl=null,Wu(t)):(Yl=0,Xl=null,Gu(e,t,o,7));break;case 5:var s=null;switch(ql.tag){case 26:s=ql.memoizedState;case 5:case 27:var c=ql;if(s?np(s):c.stateNode.complete){Yl=0,Xl=null;var l=c.sibling;if(l!==null)ql=l;else{var u=c.return;u===null?ql=null:(ql=u,Ku(u))}break b}}Yl=0,Xl=null,Gu(e,t,o,5);break;case 6:Yl=0,Xl=null,Gu(e,t,o,6);break;case 8:Mu(),tu=6;break a;default:throw Error(i(462))}}Hu();break}catch(t){Pu(e,t)}while(1);return Yi=Ji=null,N.H=r,N.A=a,Gl=n,ql===null?(Kl=null,Jl=0,ti(),tu):0}function Hu(){for(;ql!==null&&!Ce();)Uu(ql)}function Uu(e){var t=Ic(e.alternate,e,eu);e.memoizedProps=e.pendingProps,t===null?Ku(e):ql=t}function Wu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=xc(n,t,t.pendingProps,t.type,void 0,Jl);break;case 11:t=xc(n,t,t.pendingProps,t.type.render,t.ref,Jl);break;case 5:Po(t);default:Gc(n,t),t=ql=fi(t,eu),t=Ic(n,t,eu)}e.memoizedProps=e.pendingProps,t===null?Ku(e):ql=t}function Gu(e,t,n,r){Yi=Ji=null,Po(t),Pa=null,Fa=0;var i=t.return;try{if(sc(e,i,t,n,Jl)){tu=1,nc(e,yi(n,e.current)),ql=null;return}}catch(t){if(i!==null)throw ql=i,t;tu=1,nc(e,yi(n,e.current)),ql=null;return}t.flags&32768?(Ii||r===1?e=!0:Ql||Jl&536870912?e=!1:(Zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ao.current,r!==null&&r.tag===13&&(r.flags|=16384))),qu(t,e)):Ku(t)}function Ku(e){var t=e;do{if(t.flags&32768){qu(t,Zl);return}e=t.return;var n=Uc(t.alternate,t,eu);if(n!==null){ql=n;return}if(t=t.sibling,t!==null){ql=t;return}ql=t=e}while(t!==null);tu===0&&(tu=5)}function qu(e,t){do{var n=Wc(e.alternate,e);if(n!==null){n.flags&=32767,ql=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ql=e;return}ql=e=n}while(e!==null);tu=6,ql=null}function Ju(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do $u();while(hu!==0);if(Gl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ei,et(e,n,o,s,c,l),e===Kl&&(ql=Kl=null,Jl=0),_u=t,gu=e,vu=n,yu=o,bu=a,xu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,cd(ke,function(){return ed(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Gl,Gl|=4;try{ul(e,t,n)}finally{Gl=s,P.p=a,N.T=r}}hu=1,Yu(),Xu(),Zu()}}function Yu(){if(hu===1){hu=0;var e=gu,t=_u,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Gl;Gl|=4;try{Cl(t,e);var a=Qd,o=Or(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Dr(s.ownerDocument.documentElement,s)){if(c!==null&&kr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Er(s,h),v=Er(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}yp=!!Zd,Qd=Zd=null}finally{Gl=i,P.p=r,N.T=n}}e.current=t,hu=2}}function Xu(){if(hu===2){hu=0;var e=gu,t=_u,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Gl;Gl|=4;try{dl(e,t.alternate,t)}finally{Gl=i,P.p=r,N.T=n}}hu=3}}function Zu(){if(hu===4||hu===3){hu=0,we();var e=gu,t=_u,n=vu,r=xu;t.subtreeFlags&10256||t.flags&10256?hu=5:(hu=0,_u=gu=null,Qu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(mu=null),at(n),t=t.stateNode,Re&&typeof Re.onCommitFiberRoot==`function`)try{Re.onCommitFiberRoot(Le,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}vu&3&&$u(),hd(e),i=e.pendingLanes,n&261930&&i&42?e===Cu?Su++:(Su=0,Cu=e):Su=0,gd(0,!1)}}function Qu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,da(t)))}function $u(){return Yu(),Xu(),Zu(),ed()}function ed(){if(hu!==5)return!1;var e=gu,t=yu;yu=0;var n=at(vu),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=bu,bu=null;var o=gu,s=vu;if(hu=0,_u=gu=null,vu=0,Gl&6)throw Error(i(331));var c=Gl;if(Gl|=4,Bl(o.current),Ml(o,o.current,s,n),Gl=c,gd(0,!1),Re&&typeof Re.onPostCommitFiberRoot==`function`)try{Re.onPostCommitFiberRoot(Le,o)}catch{}return!0}finally{P.p=a,N.T=r,Qu(e,t)}}function td(e,t,n){t=yi(n,t),t=ic(e.stateNode,t,2),e=Ka(e,t,2),e!==null&&($e(e,2),hd(e))}function nd(e,t,n){if(e.tag===3)td(e,e,n);else for(;t!==null;){if(t.tag===3){td(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(mu===null||!mu.has(r))){e=yi(n,e),n=ac(2),r=Ka(t,n,2),r!==null&&(oc(n,r,t,e),$e(r,2),hd(r));break}}t=t.return}}function rd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Wl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||($l=!0,i.add(n),e=id.bind(null,e,t,n),t.then(e,e))}function id(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Kl===e&&(Jl&n)===n&&(tu===4||tu===3&&(Jl&62914560)===Jl&&300>Te()-uu?!(Gl&2)&&Nu(e,0):iu|=n,ou===Jl&&(ou=0)),hd(e)}function ad(e,t){t===0&&(t=Ze()),e=ii(e,t),e!==null&&($e(e,t),hd(e))}function od(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ad(e,n)}function sd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),ad(e,n)}function cd(e,t){return xe(e,t)}var ld=null,ud=null,dd=!1,fd=!1,pd=!1,md=0;function hd(e){e!==ud&&e.next===null&&(ud===null?ld=ud=e:ud=ud.next=e),fd=!0,dd||(dd=!0,Sd())}function gd(e,t){if(!pd&&fd){pd=!0;do for(var n=!1,r=ld;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Be(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,xd(r,a))}else a=Jl,a=Je(r,r===Kl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ye(r,a)||(n=!0,xd(r,a));r=r.next}while(n);pd=!1}}function _d(){vd()}function vd(){fd=dd=!1;var e=0;md!==0&&rf()&&(e=md);for(var t=Te(),n=null,r=ld;r!==null;){var i=r.next,a=yd(r,t);a===0?(r.next=null,n===null?ld=i:n.next=i,i===null&&(ud=n)):(n=r,(e!==0||a&3)&&(fd=!0)),r=i}hu!==0&&hu!==5||gd(e,!1),md!==0&&(md=0)}function yd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Be(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Xe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Kl,n=Jl,n=Je(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Yl===2||Yl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Se(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ye(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Se(r),at(n)){case 2:case 8:n=Oe;break;case 32:n=ke;break;case 268435456:n=je;break;default:n=ke}return r=bd.bind(null,e),n=xe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Se(r),e.callbackPriority=2,e.callbackNode=null,2}function bd(e,t){if(hu!==0&&hu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if($u()&&e.callbackNode!==n)return null;var r=Jl;return r=Je(e,e===Kl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Du(e,r,t),yd(e,Te()),e.callbackNode!=null&&e.callbackNode===n?bd.bind(null,e):null)}function xd(e,t){if($u())return null;Du(e,t,!0)}function Sd(){cf(function(){Gl&6?xe(De,_d):vd()})}function Cd(){if(md===0){var e=ma;e===0&&(e=We,We<<=1,!(We&261888)&&(We=256)),md=e}return md}function wd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:$t(``+e)}function Td(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Ed(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=wd((i[ut]||null).action),o=r.submitter;o&&(t=(t=o[ut]||null)?wd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Sn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(md!==0){var e=o?Td(i,o):new FormData(i);As(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Td(i,o):new FormData(i),As(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Dd=0;Dd<Yr.length;Dd++){var Od=Yr[Dd];Xr(Od.toLowerCase(),`on`+(Od[0].toUpperCase()+Od.slice(1)))}Xr(Vr,`onAnimationEnd`),Xr(Hr,`onAnimationIteration`),Xr(Ur,`onAnimationStart`),Xr(`dblclick`,`onDoubleClick`),Xr(`focusin`,`onFocus`),Xr(`focusout`,`onBlur`),Xr(Wr,`onTransitionRun`),Xr(Gr,`onTransitionStart`),Xr(Kr,`onTransitionCancel`),Xr(qr,`onTransitionEnd`),Et(`onMouseEnter`,[`mouseout`,`mouseover`]),Et(`onMouseLeave`,[`mouseout`,`mouseover`]),Et(`onPointerEnter`,[`pointerout`,`pointerover`]),Et(`onPointerLeave`,[`pointerout`,`pointerover`]),Tt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Tt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Tt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Tt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Tt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Tt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var kd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Ad=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(kd));function jd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Zr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Zr(e)}i.currentTarget=null,a=c}}}}function Md(e,t){var n=t[ft];n===void 0&&(n=t[ft]=new Set);var r=e+`__bubble`;n.has(r)||(Id(t,e,2,!1),n.add(r))}function Nd(e,t,n){var r=0;t&&(r|=4),Id(n,e,r,t)}var Pd=`_reactListening`+Math.random().toString(36).slice(2);function Fd(e){if(!e[Pd]){e[Pd]=!0,Ct.forEach(function(t){t!==`selectionchange`&&(Ad.has(t)||Nd(t,!1,e),Nd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pd]||(t[Pd]=!0,Nd(`selectionchange`,!1,t))}}function Id(e,t,n,r){switch(Ep(t)){case 2:var i=bp;break;case 8:i=xp;break;default:i=Sp}n=i.bind(null,t,n,e),i=void 0,!dn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Ld(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=vt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}cn(function(){var r=a,i=nn(n),s=[];a:{var c=Jr.get(e);if(c!==void 0){var l=Sn,u=e;switch(e){case`keypress`:if(_n(n)===0)break a;case`keydown`:case`keyup`:l=Bn;break;case`focusin`:u=`focus`,l=jn;break;case`focusout`:u=`blur`,l=jn;break;case`beforeblur`:case`afterblur`:l=jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=An;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Hn;break;case Vr:case Hr:case Ur:l=Mn;break;case qr:l=Un;break;case`scroll`:case`scrollend`:l=wn;break;case`wheel`:l=Wn;break;case`copy`:case`cut`:case`paste`:l=Nn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Vn;break;case`toggle`:case`beforetoggle`:l=Gn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=ln(m,p),g!=null&&d.push(B(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==tn&&(u=n.relatedTarget||n.fromElement)&&(vt(u)||u[dt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?vt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Vn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:bt(l),h=u==null?c:bt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,vt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=zd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Bd(s,c,l,d,!1),u!==null&&f!==null&&Bd(s,f,u,d,!0)}}a:{if(c=r?bt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=dr;else if(ar(c))if(fr)v=xr;else{v=yr;var y=vr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Xt(r.elementType)&&(v=dr):v=br;if(v&&=v(e,r)){or(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Wt(c,`number`,c.value)}switch(y=r?bt(r):window,e){case`focusin`:(ar(y)||y.contentEditable===`true`)&&(jr=y,Mr=r,Nr=null);break;case`focusout`:Nr=Mr=jr=null;break;case`mousedown`:Pr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Pr=!1,Fr(s,n,i);break;case`selectionchange`:if(Ar)break;case`keydown`:case`keyup`:Fr(s,n,i)}var b;if(qn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else tr?$n(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Xn&&n.locale!==`ko`&&(tr||x!==`onCompositionStart`?x===`onCompositionEnd`&&tr&&(b=gn()):(pn=i,mn=`value`in pn?pn.value:pn.textContent,tr=!0)),y=Rd(r,x),0<y.length&&(x=new Pn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=er(n),b!==null&&(x.data=b)))),(b=Yn?nr(e,n):rr(e,n))&&(x=Rd(r,`onBeforeInput`),0<x.length&&(y=new Pn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Ed(s,e,r,n,i)}jd(s,t)})}function B(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Rd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=ln(e,n),i!=null&&r.unshift(B(e,i,a)),i=ln(e,t),i!=null&&r.push(B(e,i,a))),e.tag===3)return r;e=e.return}return[]}function zd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Bd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=ln(n,a),l!=null&&o.unshift(B(n,l,c))):i||(l=ln(n,a),l!=null&&o.push(B(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Vd=/\r\n?/g,Hd=/\u0000|\uFFFD/g;function Ud(e){return(typeof e==`string`?e:``+e).replace(Vd,`
10
- `).replace(Hd,``)}function Wd(e,t){return t=Ud(t),Ud(e)===t}function Gd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Jt(e,``+r);break;case`className`:Mt(e,`class`,r);break;case`tabIndex`:Mt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Mt(e,n,r);break;case`style`:Yt(e,r,o);break;case`data`:if(t!==`object`){Mt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Gd(e,t,`name`,a.name,a,null),Gd(e,t,`formEncType`,a.formEncType,a,null),Gd(e,t,`formMethod`,a.formMethod,a,null),Gd(e,t,`formTarget`,a.formTarget,a,null)):(Gd(e,t,`encType`,a.encType,a,null),Gd(e,t,`method`,a.method,a,null),Gd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=$t(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Md(`beforetoggle`,e),Md(`toggle`,e),jt(e,`popover`,r);break;case`xlinkActuate`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:jt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Zt.get(n)||n,jt(e,n,r))}}function Kd(e,t,n,r,a,o){switch(n){case`style`:Yt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Jt(e,``+r);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!wt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ut]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):jt(e,n,r)}}}function qd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Md(`error`,e),Md(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Gd(e,t,o,s,n,null)}}a&&Gd(e,t,`srcSet`,n.srcSet,n,null),r&&Gd(e,t,`src`,n.src,n,null);return;case`input`:Md(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Gd(e,t,r,d,n,null)}}Ut(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Md(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Gd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Gt(e,!!r,n,!0):Gt(e,!!r,t,!1);return;case`textarea`:for(s in Md(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Gd(e,t,s,c,n,null)}qt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Gd(e,t,l,r,n,null)}return;case`dialog`:Md(`beforetoggle`,e),Md(`toggle`,e),Md(`cancel`,e),Md(`close`,e);break;case`iframe`:case`object`:Md(`load`,e);break;case`video`:case`audio`:for(r=0;r<kd.length;r++)Md(kd[r],e);break;case`image`:Md(`error`,e),Md(`load`,e);break;case`details`:Md(`toggle`,e);break;case`embed`:case`source`:case`link`:Md(`error`,e),Md(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Gd(e,t,u,r,n,null)}return;default:if(Xt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Kd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Gd(e,t,c,r,n,null))}function Jd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Gd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Gd(e,t,p,m,r,f)}}Ht(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Gd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Gd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Gt(e,!!n,n?[]:``,!1):Gt(e,!!n,t,!0)):Gt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Gd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Gd(e,t,s,a,r,o)}Kt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Gd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Gd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Gd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Gd(e,t,u,p,r,m)}return;default:if(Xt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Kd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Kd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Gd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Gd(e,t,f,p,r,m)}function Yd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Xd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Yd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Yd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Zd=null,Qd=null;function $d(e){return e.nodeType===9?e:e.ownerDocument}function ef(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function tf(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function V(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var nf=null;function rf(){var e=window.event;return e&&e.type===`popstate`?e===nf?!1:(nf=e,!0):(nf=null,!1)}var af=typeof setTimeout==`function`?setTimeout:void 0,of=typeof clearTimeout==`function`?clearTimeout:void 0,sf=typeof Promise==`function`?Promise:void 0,cf=typeof queueMicrotask==`function`?queueMicrotask:sf===void 0?af:function(e){return sf.resolve(null).then(e).catch(lf)};function lf(e){setTimeout(function(){throw e})}function uf(e){return e===`head`}function df(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Gp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Tf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Tf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[gt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Tf(e.ownerDocument.body);n=i}while(n);Gp(t)}function ff(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function pf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:pf(n),_t(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function mf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[gt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=bf(e.nextSibling),e===null)break}return null}function hf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=bf(e.nextSibling),e===null))return null;return e}function gf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=bf(e.nextSibling),e===null))return null;return e}function _f(e){return e.data===`$?`||e.data===`$~`}function vf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function yf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function bf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var xf=null;function Sf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return bf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Cf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function wf(e,t,n){switch(t=$d(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Tf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_t(e)}var Ef=new Map,Df=new Set;function Of(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var kf=P.d;P.d={f:Af,r:jf,D:Pf,C:Ff,L:If,m:Lf,X:zf,S:Rf,M:Bf};function Af(){var e=kf.f(),t=ju();return e||t}function jf(e){var t=yt(e);t!==null&&t.tag===5&&t.type===`form`?Ms(t):kf.r(e)}var Mf=typeof document>`u`?null:document;function Nf(e,t,n){var r=Mf;if(r&&typeof t==`string`&&t){var i=Vt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Df.has(i)||(Df.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),qd(t,`link`,e),St(t),r.head.appendChild(t)))}}function Pf(e){kf.D(e),Nf(`dns-prefetch`,e,null)}function Ff(e,t){kf.C(e,t),Nf(`preconnect`,e,t)}function If(e,t,n){kf.L(e,t,n);var r=Mf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Vt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Vt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Vt(n.imageSizes)+`"]`)):i+=`[href="`+Vt(e)+`"]`;var a=i;switch(t){case`style`:a=Hf(e);break;case`script`:a=Kf(e)}Ef.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Ef.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Uf(a))||t===`script`&&r.querySelector(qf(a))||(t=r.createElement(`link`),qd(t,`link`,e),St(t),r.head.appendChild(t)))}}function Lf(e,t){kf.m(e,t);var n=Mf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Vt(r)+`"][href="`+Vt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Kf(e)}if(!Ef.has(a)&&(e=f({rel:`modulepreload`,href:e},t),Ef.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qf(a)))return}r=n.createElement(`link`),qd(r,`link`,e),St(r),n.head.appendChild(r)}}}function Rf(e,t,n){kf.S(e,t,n);var r=Mf;if(r&&e){var i=xt(r).hoistableStyles,a=Hf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Uf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Ef.get(a))&&Xf(e,n);var c=o=r.createElement(`link`);St(c),qd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Yf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zf(e,t){kf.X(e,t);var n=Mf;if(n&&e){var r=xt(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=f({src:e,async:!0},t),(t=Ef.get(i))&&Zf(e,t),a=n.createElement(`script`),St(a),qd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bf(e,t){kf.M(e,t);var n=Mf;if(n&&e){var r=xt(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=Ef.get(i))&&Zf(e,t),a=n.createElement(`script`),St(a),qd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vf(e,t,n,r){var a=(a=se.current)?Of(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Hf(n.href),n=xt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Hf(n.href);var o=xt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Uf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Ef.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ef.set(e,n),o||Gf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Kf(n),n=xt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Hf(e){return`href="`+Vt(e)+`"`}function Uf(e){return`link[rel="stylesheet"][`+e+`]`}function Wf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Gf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),qd(t,`link`,n),St(t),e.head.appendChild(t))}function Kf(e){return`[src="`+Vt(e)+`"]`}function qf(e){return`script[async]`+e}function Jf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Vt(n.href)+`"]`);if(r)return t.instance=r,St(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),St(r),qd(r,`style`,a),Yf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hf(n.href);var o=e.querySelector(Uf(a));if(o)return t.state.loading|=4,t.instance=o,St(o),o;r=Wf(n),(a=Ef.get(a))&&Xf(r,a),o=(e.ownerDocument||e).createElement(`link`),St(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),qd(o,`link`,r),t.state.loading|=4,Yf(o,n.precedence,e),t.instance=o;case`script`:return o=Kf(n.src),(a=e.querySelector(qf(o)))?(t.instance=a,St(a),a):(r=n,(a=Ef.get(o))&&(r=f({},n),Zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),St(a),qd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Yf(r,n.precedence,e));return t.instance}function Yf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Xf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qf=null;function $f(e,t,n){if(Qf===null){var r=new Map,i=Qf=new Map;i.set(n,r)}else i=Qf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[gt]||a[lt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function ep(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function tp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function np(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rp(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Hf(r.href),a=t.querySelector(Uf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=op.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,St(a);return}a=t.ownerDocument||t,r=Wf(r),(i=Ef.get(i))&&Xf(r,i),a=a.createElement(`link`),St(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),qd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=op.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ip=0;function ap(e,t){return e.stylesheets&&e.count===0&&cp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ip===0&&(ip=62500*Xd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ip?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function op(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var sp=null;function cp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,sp=new Map,t.forEach(lp,e),sp=null,op.call(e))}function lp(e,t){if(!(t.state.loading&4)){var n=sp.get(e);if(n)var r=n.get(null);else{n=new Map,sp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=op.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var up={$$typeof:b,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function dp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qe(0),this.hiddenUpdates=Qe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function fp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new dp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=li(3,null,null,t),e.current=a,a.stateNode=e,t=ua(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ua(a),e}function pp(e){return e?(e=si,e):si}function mp(e,t,n,r,i,a){i=pp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ga(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ka(e,r,t),n!==null&&(Eu(n,e,t),qa(n,e,t))}function hp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gp(e,t){hp(e,t),(e=e.alternate)&&hp(e,t)}function _p(e){if(e.tag===13||e.tag===31){var t=ii(e,67108864);t!==null&&Eu(t,e,67108864),gp(e,67108864)}}function vp(e){if(e.tag===13||e.tag===31){var t=wu();t=it(t);var n=ii(e,t);n!==null&&Eu(n,e,t),gp(e,t)}}var yp=!0;function bp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,Sp(e,t,n,r)}finally{P.p=a,N.T=i}}function xp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,Sp(e,t,n,r)}finally{P.p=a,N.T=i}}function Sp(e,t,n,r){if(yp){var i=Cp(r);if(i===null)Ld(e,t,r,wp,n),Fp(e,r);else if(Lp(i,e,t,n,r))r.stopPropagation();else if(Fp(e,r),t&4&&-1<Pp.indexOf(e)){for(;i!==null;){var a=yt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Be(o);s.entanglements[1]|=c,o&=~c}hd(a),!(Gl&6)&&(fu=Te()+500,gd(0,!1))}}break;case 31:case 13:s=ii(a,2),s!==null&&Eu(s,a,2),ju(),gp(a,2)}if(a=Cp(r),a===null&&Ld(e,t,r,wp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ld(e,t,r,null,n)}}function Cp(e){return e=nn(e),Tp(e)}var wp=null;function Tp(e){if(wp=null,e=vt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return wp=e,null}function Ep(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ee()){case De:return 2;case Oe:return 8;case ke:case Ae:return 32;case je:return 268435456;default:return 32}default:return 32}}var Dp=!1,Op=null,kp=null,Ap=null,jp=new Map,Mp=new Map,Np=[],Pp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Fp(e,t){switch(e){case`focusin`:case`focusout`:Op=null;break;case`dragenter`:case`dragleave`:kp=null;break;case`mouseover`:case`mouseout`:Ap=null;break;case`pointerover`:case`pointerout`:jp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Mp.delete(t.pointerId)}}function Ip(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=yt(t),t!==null&&_p(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Lp(e,t,n,r,i){switch(t){case`focusin`:return Op=Ip(Op,e,t,n,r,i),!0;case`dragenter`:return kp=Ip(kp,e,t,n,r,i),!0;case`mouseover`:return Ap=Ip(Ap,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return jp.set(a,Ip(jp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Mp.set(a,Ip(Mp.get(a)||null,e,t,n,r,i)),!0}return!1}function Rp(e){var t=vt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,st(e.priority,function(){vp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,st(e.priority,function(){vp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=yt(n),t!==null&&_p(t),e.blockedOn=n,!1;t.shift()}return!0}function Bp(e,t,n){zp(e)&&n.delete(t)}function Vp(){Dp=!1,Op!==null&&zp(Op)&&(Op=null),kp!==null&&zp(kp)&&(kp=null),Ap!==null&&zp(Ap)&&(Ap=null),jp.forEach(Bp),Mp.forEach(Bp)}function Hp(e,n){e.blockedOn===n&&(e.blockedOn=null,Dp||(Dp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Vp)))}var Up=null;function Wp(e){Up!==e&&(Up=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Up===e&&(Up=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Tp(r||n)===null)continue;break}var a=yt(n);a!==null&&(e.splice(t,3),t-=3,As(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Gp(e){function t(t){return Hp(t,e)}Op!==null&&Hp(Op,e),kp!==null&&Hp(kp,e),Ap!==null&&Hp(Ap,e),jp.forEach(t),Mp.forEach(t);for(var n=0;n<Np.length;n++){var r=Np[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Np.length&&(n=Np[0],n.blockedOn===null);)Rp(n),n.blockedOn===null&&Np.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ut]||null;if(typeof a==`function`)o||Wp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ut]||null)s=o.formAction;else if(Tp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Wp(n)}}}function Kp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function qp(e){this._internalRoot=e}Jp.prototype.render=qp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;mp(n,wu(),e,t,null,null)},Jp.prototype.unmount=qp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;mp(e.current,2,null,e,null,null),ju(),t[dt]=null}};function Jp(e){this._internalRoot=e}Jp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ot();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Np.length&&t!==0&&t<Np[n].priority;n++);Np.splice(n,0,e),n===0&&Rp(e)}};var Yp=n.version;if(Yp!==`19.2.5`)throw Error(i(527,Yp,`19.2.5`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Xp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zp.isDisabled&&Zp.supportsFiber)try{Le=Zp.inject(Xp),Re=Zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=$s,s=ec,c=tc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=fp(e,1,!1,null,null,n,r,null,o,s,c,Kp),e[dt]=t.current,Fd(e),new qp(t)}})),Re=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Le()})),ze=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Be=new class extends ze{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Ve={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},He=new class{#e=Ve;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Ue(e){setTimeout(e,0)}var We=typeof window>`u`||`Deno`in globalThis;function Ge(){}function Ke(e,t){return typeof e==`function`?e(t):e}function qe(e){return typeof e==`number`&&e>=0&&e!==1/0}function Je(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ye(e,t){return typeof e==`function`?e(t):e}function Xe(e,t){return typeof e==`function`?e(t):e}function Ze(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==$e(o,t.options))return!1}else if(!tt(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Qe(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(et(t.options.mutationKey)!==et(a))return!1}else if(!tt(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function $e(e,t){return(t?.queryKeyHashFn||et)(e)}function et(e){return JSON.stringify(e,(e,t)=>ot(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function tt(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>tt(e[n],t[n])):!1}var nt=Object.prototype.hasOwnProperty;function rt(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=at(e)&&at(t);if(!r&&!(ot(e)&&ot(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:nt.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=rt(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function it(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function at(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ot(e){if(!st(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!st(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function st(e){return Object.prototype.toString.call(e)===`[object Object]`}function ct(e){return new Promise(t=>{He.setTimeout(t,e)})}function lt(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:rt(e,t)}function ut(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function dt(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ft=Symbol();function pt(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ft?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function mt(e,t){return typeof e==`function`?e(...t):!!e}function ht(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var gt=(()=>{let e=()=>We;return{isServer(){return e()},setIsServer(t){e=t}}})();function _t(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var vt=Ue;function yt(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=vt,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var bt=yt(),xt=new class extends ze{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function St(e){return Math.min(1e3*2**e,3e4)}function Ct(e){return(e??`online`)===`online`?xt.isOnline():!0}var wt=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Tt(e){let t=!1,n=0,r,i=_t(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new wt(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Be.isFocused()&&(e.networkMode===`always`||xt.isOnline())&&e.canRun(),u=()=>Ct(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(gt.isServer()?0:3),o=e.retryDelay??St,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),ct(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Et=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qe(this.gcTime)&&(this.#e=He.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(gt.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(He.clearTimeout(this.#e),this.#e=void 0)}};function Dt(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ht(e,()=>t.signal,()=>n=!0)},u=pt(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?dt:ut;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?kt:Ot,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ot(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Ot(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function kt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var At=class extends Et{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Nt(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Nt(this.options);e.data!==void 0&&(this.setState(Mt(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=lt(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Ge).catch(Ge):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Xe(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ft||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ye(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Je(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=pt(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Dt(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Tt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof wt&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof wt){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...jt(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Mt(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),bt.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function jt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ct(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Mt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Nt(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Pt=class extends ze{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=_t(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),It(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Lt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Lt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Xe(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!it(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Rt(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Xe(this.options.enabled,this.#t)!==Xe(t.enabled,this.#t)||Ye(this.options.staleTime,this.#t)!==Ye(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Xe(this.options.enabled,this.#t)!==Xe(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Bt(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Ge)),t}#g(){this.#b();let e=Ye(this.options.staleTime,this.#t);if(gt.isServer()||this.#r.isStale||!qe(e))return;let t=Je(this.#r.dataUpdatedAt,e)+1;this.#d=He.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(gt.isServer()||Xe(this.options.enabled,this.#t)===!1||!qe(this.#p)||this.#p===0)&&(this.#f=He.setInterval(()=>{(this.options.refetchIntervalInBackground||Be.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(He.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(He.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&It(e,t),o=i&&Rt(e,n,t,r);(a||o)&&(l={...l,...jt(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=lt(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=lt(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:zt(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Xe(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=_t())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!it(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){bt.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ft(e,t){return Xe(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&Xe(t.retryOnMount,e)===!1)}function It(e,t){return Ft(e,t)||e.state.data!==void 0&&Lt(e,t,t.refetchOnMount)}function Lt(e,t,n){if(Xe(t.enabled,e)!==!1&&Ye(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&zt(e,t)}return!1}function Rt(e,t,n,r){return(e!==t||Xe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&zt(e,n)}function zt(e,t){return Xe(t.enabled,e)!==!1&&e.isStaleByTime(Ye(t.staleTime,e))}function Bt(e,t){return!it(e.getCurrentResult(),t)}var Vt=class extends Et{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ht(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Tt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),bt.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ht(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ut=class extends ze{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Vt({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Wt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){bt.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Qe(t,e))}findAll(e={}){return this.getAll().filter(t=>Qe(e,t))}notify(e){bt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return bt.batch(()=>Promise.all(e.map(e=>e.continue().catch(Ge))))}};function Wt(e){return e.options.scope?.id}var Gt=class extends ze{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??$e(r,t),a=this.get(i);return a||(a=new At({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){bt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ze(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Ze(e,t)):t}notify(e){bt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){bt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){bt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Kt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Gt,this.#t=e.mutationCache||new Ut,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Be.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=xt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ye(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Ke(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return bt.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;bt.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return bt.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=bt.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Ge).catch(Ge)}invalidateQueries(e,t={}){return bt.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=bt.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Ge)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Ge)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Ye(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ge).catch(Ge)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ge).catch(Ge)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return xt.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(et(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{tt(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(et(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{tt(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=$e(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===ft&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},qt=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Jt=n(((e,t)=>{t.exports=qt()})),I=t(Me(),1),L=Jt(),Yt=I.createContext(void 0),Xt=e=>{let t=I.useContext(Yt);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Zt=({client:e,children:t})=>(I.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,L.jsx)(Yt.Provider,{value:e,children:t})),Qt=I.createContext(!1),$t=()=>I.useContext(Qt);Qt.Provider;function en(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var tn=I.createContext(en()),nn=()=>I.useContext(tn),rn=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?mt(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},an=e=>{I.useEffect(()=>{e.clearReset()},[e])},on=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||mt(n,[e.error,r])),sn=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},cn=(e,t)=>e.isLoading&&e.isFetching&&!t,ln=(e,t)=>e?.suspense&&t.isPending,un=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function dn(e,t,n){let r=$t(),i=nn(),a=Xt(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,sn(o),rn(o,i,s),an(i);let c=!a.getQueryCache().get(o.queryHash),[l]=I.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(I.useSyncExternalStore(I.useCallback(e=>{let t=d?l.subscribe(bt.batchCalls(e)):Ge;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),I.useEffect(()=>{l.setOptions(o)},[o,l]),ln(o,u))throw un(o,l,i);if(on({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!gt.isServer()&&cn(u,r)&&(c?un(o,l,i):s?.promise)?.catch(Ge).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function fn(e,t){return dn(e,Pt,t)}var pn=typeof window<`u`?I.useLayoutEffect:I.useEffect;function mn(e){let t=I.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function hn(e,t,n={},r={}){I.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function gn(e){let t=I.useRef(null);return I.useImperativeHandle(e,()=>t.current,[]),t}function _n(e){return e[e.length-1]}function vn(e){return typeof e==`function`}function yn(e,t){return vn(e)?e(t):e}var bn=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable;function Sn(e){for(let t in e)if(bn.call(e,t))return!0;return!1}var Cn=()=>Object.create(null),wn=(e,t)=>Tn(e,t,Cn);function Tn(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=kn(e)&&kn(i);if(!a&&!(Dn(e)&&Dn(i)))return i;let o=a?e:En(e);if(!o)return i;let s=a?i:En(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:bn.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=Tn(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function En(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!xn.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!xn.call(e,t))return!1;r.push(t)}return r}function Dn(e){if(!On(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!On(n)||!n.hasOwnProperty(`isPrototypeOf`))}function On(e){return Object.prototype.toString.call(e)===`[object Object]`}function kn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function An(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!An(e[r],t[r],n))return!1;return!0}if(Dn(e)&&Dn(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!An(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!An(e[o],t[o],n)))return!1;return i===a}return!1}function jn(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function Mn(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function Nn(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function Pn(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Nn(t)}var Fn=[`http:`,`https:`,`mailto:`,`tel:`];function In(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Ln(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=Pn(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=Pn(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function Rn(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function zn(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 Bn(){throw Error(`Invariant failed`)}function Vn(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Hn=4,Un=5;function Wn(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function Gn(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=Wn(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Kn(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=Gn(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=Yn(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=Yn(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Xn(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Xn(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=Xn(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=Yn(n.fullPath??n.from);e.kind=Un,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=Yn(n.fullPath??n.from);e.kind=Hn,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)Kn(e,t,r,s,i,a,o)}function qn(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Jn(e){if(e.pathless)for(let t of e.pathless)Jn(t);if(e.static)for(let t of e.static.values())Jn(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())Jn(t);if(e.dynamic?.length){e.dynamic.sort(qn);for(let t of e.dynamic)Jn(t)}if(e.optional?.length){e.optional.sort(qn);for(let t of e.optional)Jn(t)}if(e.wildcard?.length){e.wildcard.sort(qn);for(let t of e.wildcard)Jn(t)}}function Yn(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null}}function Xn(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,caseSensitive:n,prefix:r,suffix:i}}function Zn(e,t){let n=Yn(`/`),r=new Uint16Array(6);for(let t of e)Kn(!1,r,t,1,n,0);Jn(n),t.masksTree=n,t.flatCache=Vn(1e3)}function Qn(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=rr(e,t.masksTree);return t.flatCache.set(e,r),r}function $n(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Yn(`/`),Kn(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),rr(r,o,n)}function er(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=rr(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=ar(a.route)),t.matchCache.set(r,a),a}function tr(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function nr(e,t=!1,n){let r=Yn(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return Kn(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&Bn(),a[e.id]=e,s!==0&&e.path){let t=tr(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),Jn(r),{processedTree:{segmentTree:r,singleCache:Vn(1e3),matchCache:Vn(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function rr(e,t,n=!1){let r=e.split(`/`),i=sr(e,r,t,n);if(!i)return null;let[a]=ir(e,r,i);return{route:i.node.route,rawParams:a}}function ir(e,t,n){let r=or(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===Hn)break;if(u.kind===Un){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function ar(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function or(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function sr(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!_n(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!dr(l,n))continue;if(i.parse){if(!ur(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==Hn&&dr(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===Hn||i.kind===2)&&dr(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[u],b;if(v&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(ur(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&lr(p,o))return n;dr(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+cr(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+cr(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+cr(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+cr(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function cr(e,t){return 2**(e-t-1)}function lr(e,t){return e===2**(t-1)-1}function ur(e,t,n){let r,i;try{[r,i]=ir(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function dr(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Hn)>(e.node.kind===Hn)||t.node.kind===Hn==(e.node.kind===Hn)&&t.depth>e.depth))):!0}function fr(e){return pr(e.filter(e=>e!==void 0).join(`/`))}function pr(e){return e.replace(/\/{2,}/g,`/`)}function mr(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function hr(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function gr(e){return hr(mr(e))}function _r(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function vr(e,t,n){return _r(e,n)===_r(t,n)}function yr({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&_n(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(_n(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=pr(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function br(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function xr(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Cr(e,n)).join(`/`):Cr(r,n):r}function Sr({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=Gn(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=xr(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=xr(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=xr(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Cr(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function wr(e){return e?.isNotFound===!0}function Tr(){try{return typeof window<`u`&&typeof window.sessionStorage==`object`?window.sessionStorage:void 0}catch{return}}var Er=`tsr-scroll-restoration-v1_3`;function Dr(){let e=Tr();if(!e)return null;let t={};try{let n=JSON.parse(e.getItem(`tsr-scroll-restoration-v1_3`)||`{}`);Dn(n)&&(t=n)}catch{}return{get state(){return t},set:e=>{t=yn(e,t)||t},persist:()=>{try{e.setItem(Er,JSON.stringify(t))}catch{}}}}var Or=Dr(),kr=e=>e.state.__TSR_key||e.href;function Ar(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var jr=!1,Mr=`window`,Nr=`data-scroll-restoration-id`;function Pr(e,t){if(!Or)return;let n=Or;if((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,jr=!1;let r=e.options.getScrollRestorationKey||kr,i=new Map;window.history.scrollRestoration=`manual`;let a=t=>{if(!(jr||!e.isScrollRestoring))if(t.target===document||t.target===window)i.set(Mr,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{let e=t.target;i.set(e,{scrollX:e.scrollLeft||0,scrollY:e.scrollTop||0})}},o=t=>{if(!e.isScrollRestoring||!t||i.size===0||!n)return;let r=n.state[t]||={};for(let[e,t]of i){let n;if(e===Mr)n=Mr;else if(e.isConnected){let t=e.getAttribute(Nr);n=t?`[${Nr}="${t}"]`:Ar(e)}n&&(r[n]=t)}};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{o(e.fromLocation?r(e.fromLocation):void 0),i.clear()}),window.addEventListener(`pagehide`,()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe(`onRendered`,t=>{let a=r(t.toLocation),o=e.options.scrollRestorationBehavior,s=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))){jr=!0;try{let t=e.isScrollRestoring?n.state[a]:void 0,r=!1;if(t)for(let e in t){let n=t[e];if(!Dn(n))continue;let{scrollX:i,scrollY:a}=n;if(!(!Number.isFinite(i)||!Number.isFinite(a))){if(e===Mr)window.scrollTo({top:a,left:i,behavior:o}),r=!0;else if(e){let t;try{t=document.querySelector(e)}catch{continue}t&&(t.scrollLeft=i,t.scrollTop=a,r=!0)}}}if(!r){let t=e.history.location.hash.slice(1);if(t){let e=window.history.state?.__hashScrollIntoViewOptions??!0;if(e){let n=document.getElementById(t);n&&n.scrollIntoView(e)}}else{let e={top:0,left:0,behavior:o};if(window.scrollTo(e),s)for(let t of s){if(t===Mr)continue;let n=typeof t==`function`?t():document.querySelector(t);n&&n.scrollTo(e)}}}}finally{jr=!1}e.isScrollRestoring&&n.set(e=>(e[a]||={},e))}})}function Fr(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Ir(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Lr(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Ir(r):Array.isArray(t)?t.push(Ir(r)):n[e]=[t,Ir(r)]}return n}var Rr=Br(JSON.parse),zr=Vr(JSON.stringify,JSON.parse);function Br(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Lr(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Vr(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Fr(e,r);return t?`?${t}`:``}}var Hr=`__root__`;function Ur(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Wr(e){return e instanceof Response&&!!e.options}function Gr(e){return{input:({url:t})=>{for(let n of e)t=qr(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Jr(e[n],t);return t}}}function Kr(e){let t=gr(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=fr([`/`,t,e.pathname]),e)}}function qr(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Jr(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Yr(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>Xr(o,_.get())),x=r(()=>Xr(s,v.get())),S=r(()=>Xr(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=Vn(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:A,setPending:j,setCached:M};A(e.matches),a?.(k);function A(e){Zr(e,o,_,n,i)}function j(e){Zr(e,s,v,n,i)}function M(e){Zr(e,c,y,n,i)}return k}function Xr(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function Zr(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}zn(n.get(),a)||n.set(a)})}var Qr=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},$r=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),ei=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),ti=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},ni=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},ri=(e,t,n)=>{if(!(!Wr(n)&&!wr(n)))throw Wr(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(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,r=>({...r,status:Wr(n)?`redirected`:wr(n)?`notFound`:r.status===`pending`?`success`:r.status,context:ti(e,t.index),isFetching:!1,error:n})),wr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Wr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},ii=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},ai=(e,t,n)=>{let r=ti(e,n);e.updateMatch(t,e=>({...e,context:r}))},oi=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,ri(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,ri(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Wr(n)&&!wr(n)&&(e.serialError??=n)},si=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!ei(e,t)&&(n.options.loader||n.options.beforeLoad||vi(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Qr(e)},i);r._nonReactive.pendingTimeout=t}},ci=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;si(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&ri(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},li=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=jn(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&oi(e,n,o,`PARSE_PARAMS`),s&&oi(e,n,s,`VALIDATE_SEARCH`),si(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=jn();let f={...ti(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=ei(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(Wr(r)||wr(r))&&(u(),oi(e,n,r,`BEFORE_LOAD`)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),Mn(y))return u(),y.catch(t=>{oi(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),oi(e,n,t,`BEFORE_LOAD`)}v(y)},ui=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>li(e,n,t,i),s=()=>{if(ii(e,n))return;let t=ci(e,n,i);return Mn(t)?t.then(o):o()};return a()},di=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},fi=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=ti(e,r),d=ei(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},pi=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{_i(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(fi(e,t,n,r,i)),l=!!s&&Mn(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;ri(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:ti(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:ti(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,wr(t)&&await i.options.notFoundComponent?.preload?.(),ri(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,ri(e,e.router.getMatch(n),t)}!Wr(o)&&!wr(o)&&await _i(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:ti(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),ri(e,r,t)}},mi=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(fi(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await pi(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){Wr(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await pi(e,t,i,n,d):ai(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(ii(e,i)){if(!e.router.getMatch(i))return e.matches[n];ai(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=ei(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&ri(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=jn(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function hi(e){let t=e,n=[];$r(t.router)&&Qr(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=ui(t,e);Mn(n)&&await n}catch(e){if(Wr(e))throw e;if(wr(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?ni(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(mi(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(Wr(e))throw e;wr(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=ni(t,l);e===void 0&&Bn();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await _i(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await _i(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=di(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=Qr(t);if(Mn(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function gi(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function _i(e,t=yi){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===yi?(()=>{if(e._componentsPromise===void 0){let t=gi(e,yi);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():gi(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function vi(e){for(let t of yi)if(e.options[t]?.preload)return!0;return!1}var yi=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],bi=`__TSR_index`,xi=`popstate`,Si=`beforeunload`;function Ci(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Di(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[bi];i=wi(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[bi];i=wi(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[bi]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function wi(e,t){t||={};let n=Oi();return{...t,key:n,__TSR_key:n,[bi]:e}}function Ti(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Di(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Oi();t.history.replaceState({[bi]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Di(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[bi]-l.state[bi],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Ci({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Si,S,{capture:!0}),t.removeEventListener(xi,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Si,S,{capture:!0}),t.addEventListener(xi,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Ei(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Di(e,t){let n=Ei(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Oi();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[bi]:0,key:a,__TSR_key:a}}}function Oi(){return(Math.random()+1).toString(36).substring(7)}function ki(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Ai=class{constructor(e,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.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=br(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Ti()),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 e;this.resolvePathCache=Vn(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Yr(Ni(this.latestLocation),e),Pr(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=gr(o);t&&t!==`/`&&e.push(Kr({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Gr(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(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=()=>{let e=nr(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Zn(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:Ln(e).path,external:!1,searchStr:o,search:wn(t?.search,i),hash:Ln(r.slice(1)).path,state:Tn(t?.state,a)}}let o=new URL(i,this.origin),s=qr(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:Ln(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:wn(t?.search,c),hash:Ln(s.hash.slice(1)).path,state:Tn(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>yr({base:e,to:t.includes(`//`)?pr(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Fi({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,yn(t.params,s)),d=this.routesByPath[hr(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&Sn(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:Ln(Sr({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Pi(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=Ii({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=wn(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?yn(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?yn(t.state,n.state):{};v=Tn(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=Jr(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else b=Rn(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=Qn(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,yn(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=An(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=hr(this.latestLocation.href)===hr(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=jn(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Di(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=qr(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(In(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t,n,r,i=this.stores.resolvedLocation.get()??this.stores.location.get();for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=ki(t,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...n}),this.emit({type:`onBeforeLoad`,...n}),await hi({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.stores.pendingMatches.get(),location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){Wr(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):wr(e)&&(n=e);let r=t?t.status:n?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(r),this.stores.redirect.set(t)})}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(ki(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&In(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=_i,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await hi({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(Wr(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});wr(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=$n(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!An(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?An(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??zr,parseSearch:e.parseSearch??Rr,protocolAllowlist:e.protocolAllowlist??Fn}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=ar(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:hr(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Ri(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=c[n-1],u,d,f;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=Pi(r.options.validateSearch,{...n})??void 0;u={...n,...e},d={...i,...e},f=void 0}catch(e){let r=e;if(e instanceof ji||(r=new ji(e.message,{cause:e})),t?.throwOnError)throw r;u=n,d={},f=r}}let p=r.options.loaderDeps?.({search:u})??``,m=p?JSON.stringify(p):``,{interpolatedPath:h,usedParams:g}=Sr({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),_=r.id+h+m,v=this.getMatch(_),y=l.get(r.id),b=v?._strictParams??g,x;if(!v)try{zi(r,b)}catch(e){if(x=wr(e)||Wr(e)?e:new Mi(e.message,{cause:e}),t?.throwOnError)throw x}Object.assign(i,b);let S=y?`stay`:`enter`,C;if(v)C={...v,cause:S,params:y?.params??i,_strictParams:b,search:wn(y?y.search:v.search,u),_strictSearch:d};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||vi(r)?`pending`:`success`;C={id:_,ssr:r.options.ssr,index:n,routeId:r.id,params:y?.params??i,_strictParams:b,pathname:h,updatedAt:Date.now(),search:y?wn(y.search,u):u,_strictSearch:d,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:x,__routeContext:void 0,_nonReactive:{loadPromise:jn()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:S,loaderDeps:y?Tn(y.loaderDeps,p):p,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(C.globalNotFound=s===r.id),C.searchError=f;let w=this.getParentContext(o);C.context={...w,...C.__routeContext,...C.__beforeLoadContext},c[n]=C}for(let t=0;t<c.length;t++){let n=c[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=l.get(n.routeId);if(n.params=o?wn(o.params,i):i,!a){let i=c[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=_n(t),i={...e.search};for(let e of t)try{Object.assign(i,Pi(e.options.validateSearch,i))}catch{}let a=_n(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{zi(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},ji=class extends Error{},Mi=class extends Error{};function Ni(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Pi(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new ji(`Async validation not supported`);if(n.issues)throw new ji(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 Fi({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=hr(e),a,o=er(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function Ii({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Li(n)(e,t,r??!1)}function Li(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...Pi(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:yn(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function Ri(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return Hr}function zi(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}var Bi=`Error preloading route! ☝️`,Vi=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Hr:this.parentRoute||Bn();let r=n?Hr:t?.path;r&&r!==`/`&&(r=mr(r));let i=t?.id||r,a=n?Hr:fr([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=fr([`/`,a]));let o=a===`__root__`?`/`:fr([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=hr(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Ur({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Hi=class extends Vi{constructor(e){super(e)}};function Ui(e){if(typeof document<`u`&&document.querySelector){let t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==``){let e=document.getElementById(t.hash);e&&e.scrollIntoView(n)}}}function Wi(e){let t=e.errorComponent??Ki;return(0,L.jsx)(Gi,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?I.createElement(t,{error:n,reset:r}):e.children})}var Gi=class extends I.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Ki({error:e}){let[t,n]=I.useState(!1);return(0,L.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,L.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,L.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,L.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,L.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,L.jsx)(`div`,{children:(0,L.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,L.jsx)(`code`,{children:e.message}):null})}):null]})}function qi({children:e,fallback:t=null}){return Ji()?(0,L.jsx)(I.Fragment,{children:e}):(0,L.jsx)(I.Fragment,{children:t})}function Ji(){return I.useSyncExternalStore(Yi,()=>!0,()=>!1)}function Yi(){return()=>{}}var Xi=I.createContext(null);function Zi(e){return I.useContext(Xi)}var Qi=I.createContext(void 0),$i=I.createContext(void 0),ea=(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))(ea||{});function ta({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function na(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var ra=[],ia=0,{link:aa,unlink:oa,propagate:sa,checkDirty:ca,shallowPropagate:la}=ta({update(e){return e._update()},notify(e){ra[da++]=e,e.flags&=~ea.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=ea.Mutable|ea.Dirty,ha(e))}}),ua=0,da=0,fa,pa=0;function ma(e){try{++pa,e()}finally{--pa||ga()}}function ha(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=oa(n,e)}function ga(){if(!(pa>0)){for(;ua<da;){let e=ra[ua];ra[ua++]=void 0,e.notify()}ua=0,da=0}}function _a(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?ea.None:ea.Mutable,get(){return fa!==void 0&&aa(i,fa,ia),i._snapshot},subscribe(e){let t=na(e),n={current:!1},r=va(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=fa,o=t?.compare??Object.is;if(n)fa=i,++ia,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=ea.Mutable|ea.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{fa=a,n&&(i.flags&=~ea.RecursedCheck),ha(i)}}};return n?(i.flags=ea.Mutable|ea.Dirty,i.get=function(){let e=i.flags;if(e&ea.Dirty||e&ea.Pending&&ca(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&la(e)}}else e&ea.Pending&&(i.flags=e&~ea.Pending);return fa!==void 0&&aa(i,fa,ia),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(sa(e),la(e),ga())}},i}function va(e){let t=()=>{let t=fa;fa=n,++ia,n.depsTail=void 0,n.flags=ea.Watching|ea.RecursedCheck;try{return e()}finally{fa=t,n.flags&=~ea.RecursedCheck,ha(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:ea.Watching|ea.RecursedCheck,notify(){let e=this.flags;e&ea.Dirty||e&ea.Pending&&ca(this.deps,this)?t():this.flags=ea.Watching},stop(){this.flags=ea.None,this.depsTail=void 0,ha(this)}};return t(),n}var ya=n((e=>{var t=Me();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),ba=n(((e,t)=>{t.exports=ya()})),xa=n((e=>{var t=Me(),n=ba();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Sa=n(((e,t)=>{t.exports=xa()}))();function Ca(e,t){return e===t}function wa(e,t,n=Ca){let r=(0,I.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,I.useCallback)(()=>e?.get(),[e]);return(0,Sa.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Ta={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function Ea(e){let t=Zi(),n=I.useContext(e.from?$i:Qi),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=I.useRef(void 0);return wa(i??Ta,n=>{if((e.shouldThrow??!0)&&!n&&Bn(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=Tn(a.current,r);return a.current=e,e}return r})}function Da(e){return Ea({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Oa(e){let{select:t,...n}=e;return Ea({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function ka(e){return Ea({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Aa(e){return Ea({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ja(e){let t=Zi();return I.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Ma(e){return Ea({...e,select:t=>e.select?e.select(t.context):t.context})}var Na=t(Ie(),1);function Pa(e,t){let n=Zi(),r=gn(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:S,onFocus:C,onMouseEnter:w,onMouseLeave:T,onTouchStart:E,ignoreBlocker:D,params:O,search:k,hash:A,state:j,mask:M,reloadDocument:N,unsafeRelative:P,from:F,_fromLocation:ee,...te}=e,ne=Ji(),re=I.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ie=wa(n.stores.location,e=>e,(e,t)=>e.href===t.href),ae=I.useMemo(()=>{let e={_fromLocation:ie,...re};return n.buildLocation(e)},[n,ie,re]),oe=ae.maskedLocation?ae.maskedLocation.publicHref:ae.publicHref,se=ae.maskedLocation?ae.maskedLocation.external:ae.external,ce=I.useMemo(()=>Ua(oe,se,n.history,v),[v,se,oe,n.history]),le=I.useMemo(()=>{if(ce?.external)return In(ce.href,n.protocolAllowlist)?void 0:ce.href;if(!Wa(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),In(s,n.protocolAllowlist)?void 0:s}catch{}},[s,ce,n.protocolAllowlist]),ue=I.useMemo(()=>{if(le)return!1;if(o?.exact){if(!vr(ie.pathname,ae.pathname,n.basepath))return!1}else{let e=_r(ie.pathname,n.basepath),t=_r(ae.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!An(ie.search,ae.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?ne&&ie.hash===ae.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,ie,le,ne,ae.hash,ae.pathname,ae.search,n.basepath]),de=ue?yn(i,{})??Ia:Fa,fe=ue?Fa:yn(a,{})??Fa,pe=[b,de.className,fe.className].filter(Boolean).join(` `),me=(y||de.style||fe.style)&&{...y,...de.style,...fe.style},[he,ge]=I.useState(!1),_e=I.useRef(!1),ve=e.reloadDocument||le?!1:c??n.options.defaultPreload,ye=l??n.options.defaultPreloadDelay??0,be=I.useCallback(()=>{n.preloadRoute({...re,_builtLocation:ae}).catch(e=>{console.warn(e),console.warn(Bi)})},[n,re,ae]);hn(r,I.useCallback(e=>{e?.isIntersecting&&be()},[be]),Va,{disabled:!!v||ve!==`viewport`}),I.useEffect(()=>{_e.current||!v&&ve===`render`&&(be(),_e.current=!0)},[v,be,ve]);let xe=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!Ka(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Na.flushSync)(()=>{ge(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ge(!1)});n.navigate({...re,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:D})}};if(le)return{...te,ref:r,href:le,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...S&&{onBlur:S},...C&&{onFocus:C},...w&&{onMouseEnter:w},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};let Se=e=>{if(v||ve!==`intent`)return;if(!ye){be();return}let t=e.currentTarget;if(Ba.has(t))return;let n=setTimeout(()=>{Ba.delete(t),be()},ye);Ba.set(t,n)},Ce=e=>{v||ve!==`intent`||be()},we=e=>{if(v||!ve||!ye)return;let t=e.currentTarget,n=Ba.get(t);n&&(clearTimeout(n),Ba.delete(t))};return{...te,...de,...fe,href:ce?.href,ref:r,onClick:Ha([x,xe]),onBlur:Ha([S,we]),onFocus:Ha([C,Se]),onMouseEnter:Ha([w,Se]),onMouseLeave:Ha([T,we]),onTouchStart:Ha([E,Ce]),disabled:!!v,target:_,...me&&{style:me},...pe&&{className:pe},...v&&La,...ue&&Ra,...ne&&he&&za}}var Fa={},Ia={className:`active`},La={role:`link`,"aria-disabled":!0},Ra={"data-status":`active`,"aria-current":`page`},za={"data-transitioning":`transitioning`},Ba=new WeakMap,Va={rootMargin:`100px`},Ha=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Ua(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Wa(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Ga=I.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Pa(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return I.createElement(`a`,t,o)}return I.createElement(n,a,o)});function Ka(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var qa=class extends Vi{constructor(e){super(e),this.useMatch=e=>Ea({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ma({...e,from:this.id}),this.useSearch=e=>Aa({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ka({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Oa({...e,from:this.id}),this.useLoaderData=e=>Da({...e,from:this.id}),this.useNavigate=()=>ja({from:this.fullPath}),this.Link=I.forwardRef((e,t)=>(0,L.jsx)(Ga,{ref:t,from:this.fullPath,...e}))}};function Ja(e){return new qa(e)}var Ya=class extends Hi{constructor(e){super(e),this.useMatch=e=>Ea({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ma({...e,from:this.id}),this.useSearch=e=>Aa({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ka({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Oa({...e,from:this.id}),this.useLoaderData=e=>Da({...e,from:this.id}),this.useNavigate=()=>ja({from:this.fullPath}),this.Link=I.forwardRef((e,t)=>(0,L.jsx)(Ga,{ref:t,from:this.fullPath,...e}))}};function Xa(e){return new Ya(e)}function Za(e){let t=Zi(),n=`not-found-${wa(t.stores.location,e=>e.pathname)}-${wa(t.stores.status,e=>e)}`;return(0,L.jsx)(Wi,{getResetKey:()=>n,onCatch:(t,n)=>{if(wr(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(wr(t))return e.fallback?.(t);throw t},children:e.children})}function Qa(){return(0,L.jsx)(`p`,{children:`Not Found`})}function $a(e){return(0,L.jsx)(L.Fragment,{children:e.children})}function eo(e,t,n){return t.options.notFoundComponent?(0,L.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,L.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,L.jsx)(Qa,{})}var to=I.memo(function({matchId:e}){let t=Zi(),n=t.stores.matchStores.get(e);n||Bn();let r=wa(t.stores.loadedAt,e=>e),i=wa(n,e=>e);return(0,L.jsx)(no,{router:t,matchId:e,resetKey:r,matchState:I.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function no({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,L.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?I.Suspense:$a,f=s?Wi:$a,p=l?Za:$a;return(0,L.jsxs)(i.isRoot?i.options.shellComponent??$a:$a,{children:[(0,L.jsx)(Qi.Provider,{value:t,children:(0,L.jsx)(d,{fallback:o,children:(0,L.jsx)(f,{getResetKey:()=>n,errorComponent:s||Ki,onCatch:(e,t)=>{if(wr(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,L.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return I.createElement(l,e)},children:u||r._displayPending?(0,L.jsx)(qi,{fallback:o,children:(0,L.jsx)(io,{matchId:t})}):(0,L.jsx)(io,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(ro,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function ro({resetKey:e}){let t=Zi(),n=I.useRef(void 0);return pn(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...ki(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var io=I.memo(function({matchId:e}){let t=Zi(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||Bn();let i=wa(r,e=>e),a=i.routeId,o=t.routesById[a],s=I.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=I.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,L.jsx)(e,{},s):(0,L.jsx)(ao,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=jn();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return wr(i.error)||Bn(),eo(t,o,i.error);if(i.status===`redirected`)throw Wr(i.error)||Bn(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),ao=I.memo(function(){let e=Zi(),t=I.useContext(Qi),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=wa(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=wa(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,L.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||Bn(),eo(e,a,void 0);if(!i)return null;let s=(0,L.jsx)(to,{matchId:i});return n===`__root__`?(0,L.jsx)(I.Suspense,{fallback:o,children:s}):s});function oo(){let e=Zi(),t=I.useRef({router:e,mounted:!1}),[n,r]=I.useState(!1),i=wa(e.stores.isLoading,e=>e),a=wa(e.stores.hasPending,e=>e),o=mn(i),s=i||n||a,c=mn(s),l=i||a,u=mn(l);return e.startTransition=e=>{r(!0),I.startTransition(()=>{e(),r(!1)})},I.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return hr(e.latestLocation.publicHref)!==hr(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),pn(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),pn(()=>{o&&!i&&e.emit({type:`onLoad`,...ki(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),pn(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...ki(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),pn(()=>{if(c&&!s){let t=ki(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),ma(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())}),t.hrefChanged&&Ui(e)}},[s,c,e]),null}function so(){let e=Zi(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,L.jsx)(t,{}):null,r=(0,L.jsxs)(typeof document<`u`&&e.ssr?$a:I.Suspense,{fallback:n,children:[(0,L.jsx)(oo,{}),(0,L.jsx)(co,{})]});return e.options.InnerWrap?(0,L.jsx)(e.options.InnerWrap,{children:r}):r}function co(){let e=Zi(),t=wa(e.stores.firstId,e=>e),n=wa(e.stores.loadedAt,e=>e),r=t?(0,L.jsx)(to,{matchId:t}):null;return(0,L.jsx)(Qi.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,L.jsx)(Wi,{getResetKey:()=>n,errorComponent:Ki,onCatch:void 0,children:r})})}var lo=e=>({createMutableStore:_a,createReadonlyStore:_a,batch:ma}),uo=e=>new fo(e),fo=class extends Ai{constructor(e){super(e,lo)}};function po({router:e,children:t,...n}){Sn(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,L.jsx)(Xi.Provider,{value:e,children:t});return e.options.Wrap?(0,L.jsx)(e.options.Wrap,{children:r}):r}function mo({router:e,...t}){return(0,L.jsx)(po,{router:e,...t,children:(0,L.jsx)(so,{})})}function ho(e){let t=Zi({warn:e?.router===void 0}),n=e?.router||t,r=(0,I.useRef)(void 0);return wa(n.stores.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=Tn(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var go=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),_o=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),vo=e=>{let t=_o(e);return t.charAt(0).toUpperCase()+t.slice(1)},yo=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),bo=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},xo={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},So=(0,I.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,I.createElement)(`svg`,{ref:c,...xo,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:yo(`lucide`,i),...!a&&!bo(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,I.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Co=(e,t)=>{let n=(0,I.forwardRef)(({className:n,...r},i)=>(0,I.createElement)(So,{ref:i,iconNode:t,className:yo(`lucide-${go(vo(e))}`,`lucide-${e}`,n),...r}));return n.displayName=vo(e),n},wo=Co(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),To=Co(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),Eo=Co(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),Do=Co(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Oo=Co(`bolt`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),ko=Co(`book-open-text`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M16 12h2`,key:`7q9ll5`}],[`path`,{d:`M16 8h2`,key:`msurwy`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}],[`path`,{d:`M6 12h2`,key:`32wvfc`}],[`path`,{d:`M6 8h2`,key:`30oboj`}]]),Ao=Co(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),jo=Co(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Mo=Co(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),No=Co(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Po=Co(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Fo=Co(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Io=Co(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),Lo=Co(`chevrons-down`,[[`path`,{d:`m7 6 5 5 5-5`,key:`1lc07p`}],[`path`,{d:`m7 13 5 5 5-5`,key:`1d48rs`}]]),Ro=Co(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),zo=Co(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),Bo=Co(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Vo=Co(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Ho=Co(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Uo=Co(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Wo=Co(`file-plus-2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M3 15h6`,key:`4e2qda`}],[`path`,{d:`M6 12v6`,key:`1u72j0`}]]),Go=Co(`files`,[[`path`,{d:`M15 2a2 2 0 0 1 1.414.586l4 4A2 2 0 0 1 21 8v7a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z`,key:`1vo8kb`}],[`path`,{d:`M15 2v4a2 2 0 0 0 2 2h4`,key:`sud9ri`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]),Ko=Co(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),qo=Co(`git-branch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),Jo=Co(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),Yo=Co(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Xo=Co(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),Zo=Co(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),Qo=Co(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),$o=Co(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),es=Co(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),ts=Co(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),ns=Co(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),rs=Co(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),is=Co(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),as=Co(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),os=Co(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),ss=Co(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),cs=Co(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),ls=Co(`send-horizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),us=Co(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),ds=Co(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),fs=Co(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),ps=Co(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ms=Co(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),hs=Co(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),gs=Co(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),_s=Co(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),vs=Re();async function ys(e,t=!1,n,r=!1){let i=new URLSearchParams;return e&&i.set(`piboSessionId`,e),t&&i.set(`includeArchived`,`true`),n&&i.set(`roomId`,n),r&&i.set(`markRead`,`true`),R(`/api/chat/bootstrap${i.size?`?${i.toString()}`:``}`).then(lc)}async function bs(e,t={}){let n=new URLSearchParams({piboSessionId:e});t.includeRawEvents&&n.set(`includeRawEvents`,`true`),t.rawEventsLimit&&n.set(`rawEventsLimit`,String(t.rawEventsLimit));let r=await fetch(`/api/chat/trace?${n.toString()}`,{headers:t.knownVersion?{"if-none-match":uc(t.knownVersion)}:void 0});if(r.status===304)return{notModified:!0,version:dc(r.headers.get(`etag`))??t.knownVersion};let i=await r.json().catch(()=>void 0);if(!r.ok){let e=i&&typeof i==`object`&&`error`in i?String(i.error):`Request failed`,t=Error(e);throw t.status=r.status,t.data=i,t}return{trace:i,notModified:!1,version:dc(r.headers.get(`etag`))??i.version}}async function xs(e,t){return R(`/api/chat/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...e?{profile:e}:{},...t?{roomId:t}:{}})})}async function Ss(){return(await R(`/api/chat/base-prompt`)).basePrompt}async function Cs(e){return(await R(`/api/chat/base-prompt`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({mode:e})})).basePrompt}async function ws(e){return(await R(`/api/chat/base-prompt/custom`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({markdown:e})})).basePrompt}async function Ts(){return(await R(`/api/chat/compaction-prompt`)).compactionPrompt}async function Es(e){return(await R(`/api/chat/compaction-prompt`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({mode:e})})).compactionPrompt}async function Ds(e){return(await R(`/api/chat/compaction-prompt/custom`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({markdown:e})})).compactionPrompt}async function Os(e){return R(`/api/context-files`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})}async function ks(){return(await R(`/api/context-files`)).files}async function As(e){return(await R(`/api/context-files/${encodeURIComponent(e)}`)).file}async function js(e){return(await R(`/api/context-files`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})).file}async function Ms(e,t={}){return(await R(`/api/context-files/${encodeURIComponent(e)}/link-from-plugin`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})).file}async function Ns(e,t){return(await R(`/api/context-files/${encodeURIComponent(e)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})).file}async function Ps(e,t){return(await R(`/api/context-files/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})).file}async function Fs(e,t){await R(`/api/context-files/${encodeURIComponent(e)}`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify({deleteFile:t})})}async function Is(e){return R(`/api/context-files/${encodeURIComponent(e)}/revisions`)}async function Ls(e,t=`source`,n=`working`){let r=new URLSearchParams({base:t,target:n});return R(`/api/context-files/${encodeURIComponent(e)}/diff?${r.toString()}`)}async function Rs(e){return(await R(`/api/context-files/${encodeURIComponent(e)}/reset-to-source`,{method:`POST`,headers:{"content-type":`application/json`},body:`{}`})).file}async function zs(e){return(await R(`/api/context-files/${encodeURIComponent(e)}/adopt-source`,{method:`POST`,headers:{"content-type":`application/json`},body:`{}`})).file}async function Bs(e,t){return(await R(`/api/context-files/${encodeURIComponent(e)}/restore-revision`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({revisionId:t})})).file}async function Vs(e){return R(`/api/chat/agents`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})}async function Hs(e,t){return R(`/api/chat/agents/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}async function Us(e){return(await R(`/api/chat/model-defaults`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})).modelDefaults}async function Ws(e,t){return R(`/api/chat/agents/${encodeURIComponent(e)}`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify({confirmName:t})})}async function Gs(e,t){return R(`/api/chat/mcp-servers/${encodeURIComponent(e)}/description`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({description:t})})}async function Ks(e){return(await R(`/api/chat/pi-packages`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({source:e})})).package}async function qs(e,t){return(await R(`/api/chat/pi-packages/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})).package}async function Js(e){return(await R(`/api/chat/pi-packages/${encodeURIComponent(e)}`,{method:`DELETE`,headers:{"content-type":`application/json`},body:`{}`})).removedPackage}async function Ys(e){return R(`/api/chat/user-skills/${encodeURIComponent(e)}`)}async function Xs(e){return(await R(`/api/chat/user-skills`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})).skill}async function Zs(e,t){return(await R(`/api/chat/user-skills/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})).skill}async function Qs(e){return R(`/api/chat/user-skills/${encodeURIComponent(e)}`,{method:`DELETE`,headers:{"content-type":`application/json`},body:`{}`})}async function $s(e){return(await R(`/api/chat/user-skills/install`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({url:e})})).skill}async function ec(e){return R(`/api/chat/rooms`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})}async function tc(e,t){return R(`/api/chat/rooms/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}async function nc(e,t){return R(`/api/chat/rooms/${encodeURIComponent(e)}`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify({confirmName:t})})}async function rc(e,t){return R(`/api/chat/sessions/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}async function ic(e,t){return R(`/api/chat/sessions/${encodeURIComponent(e)}`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify({confirmText:t})})}async function ac(e,t,n,r){return R(`/api/chat/message`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({piboSessionId:e,text:t,clientTxnId:n,...r?{roomId:r}:{}})})}async function oc(e,t,n){return R(`/api/chat/action`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({piboSessionId:e,action:t,params:n})})}async function sc(){await fetch(`/api/auth/sign-out`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:`{}`})}async function cc(){let e=location.pathname.startsWith(`/apps/chat`)?`${location.pathname}${location.search}`:`/apps/chat`,t=await fetch(`/api/auth/sign-in/social`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({provider:`google`,callbackURL:e,disableRedirect:!0})}),n=await t.json();if(!t.ok||!n.url)throw Error(n.message||n.error||`Could not start Google sign in.`);location.href=n.url}async function R(e,t){let n=await fetch(e,t),r=await n.json().catch(()=>void 0);if(!n.ok){let e=r&&typeof r==`object`&&`error`in r?String(r.error):`Request failed`,t=Error(e);throw t.status=n.status,t.data=r,t}return r}function lc(e){if(!e.session)throw Error(`Invalid bootstrap response.`);let t=e.sessions??[],n=e.selectedPiboSessionId??e.session.id??t[0]?.piboSessionId??``;return{identity:e.identity??{userId:``},session:e.session,room:e.room,selectedRoomId:e.selectedRoomId??``,selectedPiboSessionId:n,rooms:e.rooms??[],sessions:t,agents:e.agents??[],customAgents:e.customAgents??[],modelDefaults:e.modelDefaults,agentCatalog:e.agentCatalog?{...e.agentCatalog,piboTools:e.agentCatalog.piboTools??[],piPackages:(e.agentCatalog.piPackages??[]).map(e=>({...e,enabled:e.enabled!==!1})),userSkills:e.agentCatalog.userSkills??[]}:e.agentCatalog,capabilities:{actions:e.capabilities?.actions??[]}}}function uc(e){return`"${e}"`}function dc(e){if(!e)return;let t=e.trim();return t.startsWith(`W/`)?dc(t.slice(2)):t.startsWith(`"`)&&t.endsWith(`"`)?t.slice(1,-1):t}var fc=new WeakMap;function pc(e,t,n){let r=n.map(e=>mc(e)),i=bc(r),a=i.length?Math.min(...i.map(e=>e.startTime)):Date.now()*1e3,o=i.flatMap(e=>e.endTime?[e.endTime]:[]),s=o.length?Math.max(...o):void 0,c=i.some(e=>e.status===`UNSET`);return{id:e,name:t,status:i.some(e=>e.status===`ERROR`)?`ERROR`:c?`UNSET`:`OK`,spans:r,startedAt:new Date(a/1e3),completedAt:s?new Date(s/1e3):void 0,totalDurationMs:s?(s-a)/1e3:0}}function mc(e){let t=fc.get(e);if(t)return t;let n=yc(e.startedAt)??Date.now()*1e3,r=yc(e.completedAt),i=vc(e.status),a=hc(e.type),o={id:e.id,parentId:e.parentId,name:gc(e),spanType:a,startTime:n,endTime:r,durationUs:e.durationMs===void 0?void 0:e.durationMs*1e3,attributes:_c(e),status:i,statusMessage:e.error,events:e.error?[{name:`exception`,timestamp:r??n,attributes:{message:e.error}}]:[],children:e.children?.map(mc),pibo:{entryId:e.entryId,linkedPiboSessionId:e.linkedPiboSessionId,traceNodeType:e.type,traceOrder:e.orderKey,stableKey:e.stableKey,source:e.source}};return fc.set(e,o),o}function hc(e){switch(e){case`user.message`:return`user.prompt`;case`assistant.message`:return`model.response`;case`model.reasoning`:return`model.reasoning`;case`tool.call`:return`tool.call`;case`tool.result`:return`tool.result`;case`agent.delegation`:return`agent.delegation`;case`agent.async`:return`agent.async`;case`execution.command`:return`tool.result`;case`yielded.run`:return`yielded.run`;case`agent.turn`:return`agent.run`;case`error`:return`tool.result`}}function gc(e){return e.type===`assistant.message`?`assistant_message`:e.type===`user.message`?`user_prompt`:e.type===`model.reasoning`?`model_reasoning`:e.title||e.type}function _c(e){let t={};return e.summary&&(t.content=e.summary),e.input!==void 0&&(t.input=e.input,t.args=e.input,t.arguments=e.input),e.output!==void 0&&(t.output=e.output,t.result=e.output),e.error&&(t.error=e.error),e.toolCallId&&(t.tool_call_id=e.toolCallId),e.runId&&(t.run_id=e.runId),(e.type===`tool.call`||e.type===`agent.delegation`)&&(t.tool_name=e.title),e.type===`assistant.message`&&(t.content=e.output??e.summary??``),e.type===`user.message`&&(t.content=e.output??e.summary??``),e.type===`model.reasoning`&&(t.reasoning=e.output??e.summary??``),e.type===`agent.delegation`&&(t[`delegation.target_agent`]=e.title.replace(/^pibo_subagent_/,``),t[`delegation.query`]=e.summary??e.input,t[`result.status`]=e.status===`done`?`completed`:e.status,t.linked_pibo_session_id=e.linkedPiboSessionId),e.type===`agent.async`&&(t[`async_agent.target_agent`]=e.title,t[`async_agent.started_by`]=xc(e.input)?e.input.startedBy:`pibo_run_start`,t[`async_agent.query`]=xc(e.input)?e.input.arguments:e.input,t[`result.status`]=e.status===`done`?`started`:e.status,t.linked_pibo_session_id=e.linkedPiboSessionId),e.type===`yielded.run`&&(t[`run.notification`]=!0,t[`run.status`]=e.status),t}function vc(e){return e===`running`?`UNSET`:e===`error`?`ERROR`:`OK`}function yc(e){if(!e)return;let t=new Date(e).getTime();return Number.isFinite(t)?t*1e3:void 0}function bc(e){return e.flatMap(e=>[e,...e.children?bc(e.children):[]])}function xc(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z.apply(null,arguments)}function Sc(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Cc={},wc=(0,I.createContext)(Cc),Tc=(e,t)=>z({},e,t),Ec=()=>(0,I.useContext)(wc),Dc=(0,I.createContext)(()=>{});Dc.displayName=`JVR.DispatchShowTools`;function Oc(){return(0,I.useReducer)(Tc,Cc)}function kc(){return(0,I.useContext)(Dc)}var Ac=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,L.jsx)(wc.Provider,{value:t,children:(0,L.jsx)(Dc.Provider,{value:n,children:r})})};Ac.displayName=`JVR.ShowTools`;var jc={},Mc=(0,I.createContext)(jc),Nc=(e,t)=>z({},e,t),Pc=()=>(0,I.useContext)(Mc),Fc=(0,I.createContext)(()=>{});Fc.displayName=`JVR.DispatchExpands`;function Ic(){return(0,I.useReducer)(Nc,jc)}function Lc(){return(0,I.useContext)(Fc)}var Rc=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,L.jsx)(Mc.Provider,{value:t,children:(0,L.jsx)(Fc.Provider,{value:n,children:r})})};Rc.displayName=`JVR.Expands`;var zc={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},Bc=(0,I.createContext)(zc),Vc=(e,t)=>z({},e,t),Hc=()=>(0,I.useContext)(Bc),Uc=(0,I.createContext)(()=>{});Uc.displayName=`JVR.DispatchTypes`;function Wc(){return(0,I.useReducer)(Vc,zc)}function Gc(){return(0,I.useContext)(Uc)}function Kc(e){var{initial:t,dispatch:n,children:r}=e;return(0,L.jsx)(Bc.Provider,{value:t,children:(0,L.jsx)(Uc.Provider,{value:n,children:r})})}Kc.displayName=`JVR.Types`;var qc=[`style`];function Jc(e){var{style:t}=e,n=Sc(e,qc);return(0,L.jsx)(`svg`,z({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:z({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t)},n,{children:(0,L.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}Jc.displayName=`JVR.TriangleArrow`;var Yc={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,L.jsx)(Jc,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},Xc=(0,I.createContext)(Yc),Zc=(e,t)=>z({},e,t),Qc=()=>(0,I.useContext)(Xc),$c=(0,I.createContext)(()=>{});$c.displayName=`JVR.DispatchSymbols`;function el(){return(0,I.useReducer)(Zc,Yc)}function tl(){return(0,I.useContext)($c)}var nl=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,L.jsx)(Xc.Provider,{value:t,children:(0,L.jsx)($c.Provider,{value:n,children:r})})};nl.displayName=`JVR.Symbols`;var rl={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},il=(0,I.createContext)(rl),al=(e,t)=>z({},e,t),ol=()=>(0,I.useContext)(il),sl=(0,I.createContext)(()=>{});sl.displayName=`JVR.DispatchSection`;function cl(){return(0,I.useReducer)(al,rl)}function ll(){return(0,I.useContext)(sl)}var ul=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,L.jsx)(il.Provider,{value:t,children:(0,L.jsx)(sl.Provider,{value:n,children:r})})};ul.displayName=`JVR.Section`;var dl={objectSortKeys:!1,indentWidth:15},fl=(0,I.createContext)(dl);fl.displayName=`JVR.Context`;var pl=(0,I.createContext)(()=>{});pl.displayName=`JVR.DispatchContext`;function ml(e,t){return z({},e,t)}var hl=()=>(0,I.useContext)(fl),gl=e=>{var{children:t,initialState:n,initialTypes:r}=e,[i,a]=(0,I.useReducer)(ml,Object.assign({},dl,n)),[o,s]=Oc(),[c,l]=Ic(),[u,d]=Wc(),[f,p]=el(),[m,h]=cl();return(0,I.useEffect)(()=>a(z({},n)),[n]),(0,L.jsx)(fl.Provider,{value:i,children:(0,L.jsx)(pl.Provider,{value:a,children:(0,L.jsx)(Ac,{initial:o,dispatch:s,children:(0,L.jsx)(Rc,{initial:c,dispatch:l,children:(0,L.jsx)(Kc,{initial:z({},u,r),dispatch:d,children:(0,L.jsx)(nl,{initial:f,dispatch:p,children:(0,L.jsx)(ul,{initial:m,dispatch:h,children:t})})})})})})})};gl.displayName=`JVR.Provider`;function _l(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var vl=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],yl=[`as`,`render`],bl=[`as`,`render`],xl=[`as`,`render`],Sl=[`as`,`style`,`render`],Cl=[`as`,`render`],wl=[`as`,`render`],Tl=[`as`,`render`],El=[`as`,`render`],Dl=e=>{var{Quote:t={}}=Qc(),{isNumber:n,value:r,parentValue:i,keyName:a,keys:o}=e,s=Sc(e,vl);if(n)return null;var{as:c,render:l}=t,u=Sc(t,yl),d=c||`span`,f=z({},s,u);return typeof f.children==`string`&&(f.children=f.children.trim()||void 0),l&&typeof l==`function`&&l(f,{value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])})||(0,L.jsx)(d,z({},f))};Dl.displayName=`JVR.Quote`;var Ol=e=>{var{ValueQuote:t={}}=Qc(),n=z({},(_l(e),e)),{as:r,render:i}=t,a=Sc(t,bl),o=r||`span`,s=z({},n,a);return i&&typeof i==`function`&&i(s,{})||(0,L.jsx)(o,z({},s))};Ol.displayName=`JVR.ValueQuote`;var kl=e=>{var{value:t,parentValue:n,keyName:r,keys:i}=e,{Colon:a={}}=Qc(),{as:o,render:s}=a,c=Sc(a,xl),l=o||`span`;return s&&typeof s==`function`&&s(c,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,L.jsx)(l,z({},c))};kl.displayName=`JVR.Colon`;var Al=e=>{var{Arrow:t={}}=Qc(),n=Pc(),{expandKey:r,style:i,value:a,parentValue:o,keyName:s,keys:c}=e,l=!!n[r],{as:u,style:d,render:f}=t,p=Sc(t,Sl),m=u||`span`,h=f&&typeof f==`function`,g=z({},p,{"data-expanded":l,style:z({},d,i)});return h&&f(g,{value:a,parentValue:o,keyName:s,keys:c||(s?[s]:[])})||(0,L.jsx)(m,z({},p,{style:z({},d,i)}))};Al.displayName=`JVR.Arrow`;var jl=e=>{var{isBrackets:t,value:n,parentValue:r,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:s={}}=Qc(),c={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:l,render:u}=o,d=Sc(o,Cl),f=l||`span`;return u&&typeof u==`function`&&u(d,c)||(0,L.jsx)(f,z({},d))}var{as:p,render:m}=s,h=Sc(s,wl),g=p||`span`;return m&&typeof m==`function`&&m(h,c)||(0,L.jsx)(g,z({},h))};jl.displayName=`JVR.BracketsOpen`;var Ml=e=>{var{isBrackets:t,isVisiable:n,value:r,parentValue:i,keyName:a,keys:o}=e,s={value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!n)return null;var{BracketsRight:c={},BraceRight:l={}}=Qc();if(t){var{as:u,render:d}=c,f=Sc(c,Tl),p=u||`span`;return d&&typeof d==`function`&&d(f,s)||(0,L.jsx)(p,z({},f))}var{as:m,render:h}=l,g=Sc(l,El),_=m||`span`;return h&&typeof h==`function`&&h(g,s)||(0,L.jsx)(_,z({},g))};Ml.displayName=`JVR.BracketsClose`;var Nl=e=>{var{keyName:t,value:n,expandKey:r,parentValue:i,level:a,keys:o=[]}=e,s=Pc(),{collapsed:c,shouldExpandNodeInitially:l}=hl(),u=typeof c==`boolean`?c:typeof c==`number`?a>c:!1,d=s[r]??(l?!1:u),f=l&&l(!d,{value:n,keys:o,level:a,keyName:t,parentValue:i});if(l&&c===!1){if(s[r]===void 0&&!f)return null}else if(s[r]===void 0&&f)return null;var p=Object.keys(n).length;if(d||p===0)return null;var m={paddingLeft:4},h={keyName:t,value:n,keys:o,parentValue:i},g=Array.isArray(n),_=n instanceof Set;return(0,L.jsx)(`div`,{style:m,children:(0,L.jsx)(Ml,z({isBrackets:g||_},h,{isVisiable:!0}))})};Nl.displayName=`JVR.NestedClose`;var Pl=[`as`,`render`],Fl=[`as`,`render`],Il=[`as`,`render`],Ll=[`as`,`render`],Rl=[`as`,`render`],zl=[`as`,`render`],Bl=[`as`,`render`],Vl=[`as`,`render`],Hl=[`as`,`render`],Ul=[`as`,`render`],Wl=[`as`,`render`],Gl=[`as`,`render`],Kl=[`as`,`render`],ql=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},Jl=e=>{var{value:t,keyName:n}=e,{Set:r={},displayDataTypes:i}=Hc();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=r,s=Sc(r,Pl);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,L.jsx)(a||`span`,z({},s))};Jl.displayName=`JVR.SetComp`;var Yl=e=>{var{value:t,keyName:n}=e,{Map:r={},displayDataTypes:i}=Hc();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=r,s=Sc(r,Fl);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,L.jsx)(a||`span`,z({},s))};Yl.displayName=`JVR.MapComp`;var Xl={opacity:.75,paddingRight:4},Zl=e=>{var{children:t=``,keyName:n,keys:r}=e,{Str:i={},displayDataTypes:a}=Hc(),{shortenTextAfterLength:o=30,stringEllipsis:s=`...`}=hl(),{as:c,render:l}=i,u=Sc(i,Il),d=t,[f,p]=(0,I.useState)(o&&d.length>o);(0,I.useEffect)(()=>p(o&&d.length>o),[o]);var m=c||`span`,h=z({},Xl,i.style||{});o>0&&(u.style=z({},u.style,{cursor:d.length<=o?`initial`:`pointer`}),d.length>o&&(u.onClick=()=>{p(!f)}));var g=f?``+d.slice(0,o)+s:d,_=l&&typeof l==`function`,v=_&&l(z({},u,{style:h}),{type:`type`,value:t,keyName:n,keys:r}),y=f?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,b=_&&l(z({},u,{children:g,className:y}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(v||(0,L.jsx)(m,z({},u,{style:h}))),b||(0,L.jsxs)(I.Fragment,{children:[(0,L.jsx)(Ol,{}),(0,L.jsx)(m,z({},u,{className:y,children:g})),(0,L.jsx)(Ol,{})]})]})};Zl.displayName=`JVR.TypeString`;var Ql=e=>{var{children:t,keyName:n,keys:r}=e,{True:i={},displayDataTypes:a}=Hc(),{as:o,render:s}=i,c=Sc(i,Ll),l=o||`span`,u=z({},Xl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,z({},c,{style:u}))),p||(0,L.jsx)(l,z({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Ql.displayName=`JVR.TypeTrue`;var $l=e=>{var{children:t,keyName:n,keys:r}=e,{False:i={},displayDataTypes:a}=Hc(),{as:o,render:s}=i,c=Sc(i,Rl),l=o||`span`,u=z({},Xl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,z({},c,{style:u}))),p||(0,L.jsx)(l,z({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};$l.displayName=`JVR.TypeFalse`;var eu=e=>{var{children:t,keyName:n,keys:r}=e,{Float:i={},displayDataTypes:a}=Hc(),{as:o,render:s}=i,c=Sc(i,zl),l=o||`span`,u=z({},Xl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,z({},c,{style:u}))),p||(0,L.jsx)(l,z({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};eu.displayName=`JVR.TypeFloat`;var tu=e=>{var{children:t,keyName:n,keys:r}=e,{Int:i={},displayDataTypes:a}=Hc(),{as:o,render:s}=i,c=Sc(i,Bl),l=o||`span`,u=z({},Xl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,z({},c,{style:u}))),p||(0,L.jsx)(l,z({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};tu.displayName=`JVR.TypeInt`;var nu=e=>{var{children:t,keyName:n,keys:r}=e,{Bigint:i={},displayDataTypes:a}=Hc(),{as:o,render:s}=i,c=Sc(i,Vl),l=o||`span`,u=z({},Xl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,z({},c,{style:u}))),p||(0,L.jsx)(l,z({},c,{className:`w-rjv-value`,children:ql(t?.toString())}))]})};nu.displayName=`JVR.TypeFloat`;var ru=e=>{var{children:t,keyName:n,keys:r}=e,{Url:i={},displayDataTypes:a}=Hc(),{as:o,render:s}=i,c=Sc(i,Hl),l=o||`span`,u=z({},Xl,i.style),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,z({},c,{style:u}))),p||(0,L.jsxs)(`a`,z({href:t?.href,target:`_blank`},c,{className:`w-rjv-value`,children:[(0,L.jsx)(Ol,{}),t?.href,(0,L.jsx)(Ol,{})]}))]})};ru.displayName=`JVR.TypeUrl`;var iu=e=>{var{children:t,keyName:n,keys:r}=e,{Date:i={},displayDataTypes:a}=Hc(),{as:o,render:s}=i,c=Sc(i,Ul),l=o||`span`,u=z({},Xl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=t instanceof Date?t.toLocaleString():t,m=d&&s(z({},c,{children:p,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,z({},c,{style:u}))),m||(0,L.jsx)(l,z({},c,{className:`w-rjv-value`,children:p}))]})};iu.displayName=`JVR.TypeDate`;var au=e=>{var{children:t,keyName:n,keys:r}=e,{Undefined:i={},displayDataTypes:a}=Hc(),{as:o,render:s}=i,c=Sc(i,Wl),l=o||`span`,u=z({},Xl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,z({},c,{style:u}))),p||(0,L.jsx)(l,z({},c,{className:`w-rjv-value`,children:`undefined`}))]})};au.displayName=`JVR.TypeUndefined`;var ou=e=>{var{children:t,keyName:n,keys:r}=e,{Null:i={},displayDataTypes:a}=Hc(),{as:o,render:s}=i,c=Sc(i,Gl),l=o||`span`,u=z({},Xl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,z({},c,{style:u}))),p||(0,L.jsx)(l,z({},c,{className:`w-rjv-value`,children:`null`}))]})};ou.displayName=`JVR.TypeNull`;var su=e=>{var{children:t,keyName:n,keys:r}=e,{Nan:i={},displayDataTypes:a}=Hc(),{as:o,render:s}=i,c=Sc(i,Kl),l=o||`span`,u=z({},Xl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,z({},c,{style:u}))),p||(0,L.jsx)(l,z({},c,{className:`w-rjv-value`,children:`NaN`}))]})};su.displayName=`JVR.TypeNan`;var cu=e=>Number(e)===e&&e%1!=0||isNaN(e),lu=e=>{var{value:t,keyName:n,keys:r}=e,i={keyName:n,keys:r};return t instanceof URL?(0,L.jsx)(ru,z({},i,{children:t})):typeof t==`string`?(0,L.jsx)(Zl,z({},i,{children:t})):t===!0?(0,L.jsx)(Ql,z({},i,{children:t})):t===!1?(0,L.jsx)($l,z({},i,{children:t})):t===null?(0,L.jsx)(ou,z({},i,{children:t})):t===void 0?(0,L.jsx)(au,z({},i,{children:t})):t instanceof Date?(0,L.jsx)(iu,z({},i,{children:t})):typeof t==`number`&&isNaN(t)?(0,L.jsx)(su,z({},i,{children:t})):typeof t==`number`&&cu(t)?(0,L.jsx)(eu,z({},i,{children:t})):typeof t==`bigint`?(0,L.jsx)(nu,z({},i,{children:t})):typeof t==`number`?(0,L.jsx)(tu,z({},i,{children:t})):null};lu.displayName=`JVR.Value`;function uu(e,t,n){var r=tl(),i=z({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:z({},e.style,t.style),children:t.children||e.children});(0,I.useEffect)(()=>r({[n]:i}),[t])}function du(e,t,n){var r=Gc(),i=z({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:z({},e.style,t.style),children:t.children||e.children});(0,I.useEffect)(()=>r({[n]:i}),[t])}function fu(e,t,n){var r=ll(),i=z({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:z({},e.style,t.style),children:t.children||e.children});(0,I.useEffect)(()=>r({[n]:i}),[t])}var pu=[`as`,`render`],mu=e=>{var{KeyName:t={}}=ol();return fu(t,e,`KeyName`),null};mu.displayName=`JVR.KeyName`;var hu=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},{KeyName:s={}}=ol(),{as:c,render:l}=s,u=Sc(s,pu);u.style=z({},u.style,o);var d=c||`span`;return l&&typeof l==`function`&&l(z({},u,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,L.jsx)(d,z({},u,{children:t}))};hu.displayName=`JVR.KeyNameComp`;var gu=[`children`,`value`,`parentValue`,`keyName`,`keys`],_u=[`as`,`render`,`children`],vu=e=>{var{Row:t={}}=ol();return fu(t,e,`Row`),null};vu.displayName=`JVR.Row`;var yu=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o=Sc(e,gu),{Row:s={}}=ol(),{as:c,render:l}=s,u=Sc(s,_u),d=c||`div`;return l&&typeof l==`function`&&l(z({},o,u,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,L.jsx)(d,z({},o,u,{children:t}))};yu.displayName=`JVR.RowComp`;function bu(e){var t=(0,I.useRef)();return(0,I.useEffect)(()=>{t.current=e}),t.current}function xu(e){var{value:t,highlightUpdates:n,highlightContainer:r}=e,i=bu(t),a=(0,I.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,I.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var Su=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],Cu=[`as`,`render`],wu=e=>{var{keyName:t,value:n,parentValue:r,expandKey:i,keys:a,beforeCopy:o}=e,s=Sc(e,Su),{onCopied:c,enableClipboard:l,beforeCopy:u}=hl(),d=Ec()[i],[f,p]=(0,I.useState)(!1),{Copied:m={}}=ol(),h=m?.beforeCopy;if(l===!1||!d)return null;var g={style:{display:`inline-flex`},fill:f?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?ql(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?ql(t):t,2);var l=o||h||u;l&&typeof l==`function`&&(s=l(s,t,n,r,i,a)),c&&c(s,n),p(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{p(!1),clearTimeout(e)},3e3)}).catch(e=>{})}},{render:_}=m,v=Sc(m,Cu),y=z({},v,s,g,{style:z({},v.style,s.style,g.style)});return _&&typeof _==`function`&&_(z({},y,{"data-copied":f}),{value:n,keyName:t,keys:a,parentValue:r})||(f?(0,L.jsx)(`svg`,z({viewBox:`0 0 32 36`},y,{children:(0,L.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,L.jsx)(`svg`,z({viewBox:`0 0 32 36`},y,{children:(0,L.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};wu.displayName=`JVR.Copied`;function Tu(){var e=(0,I.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var Eu=e=>{var{keyName:t,value:n,expandKey:r=``,level:i,keys:a=[],parentValue:o}=e,s=Pc(),{objectSortKeys:c,indentWidth:l,collapsed:u,shouldExpandNodeInitially:d}=hl(),f=typeof u==`boolean`?u:typeof u==`number`?i>u:!1,p=s[r]??(d?!1:f),m=d&&d(!p,{value:n,keys:a,level:i,keyName:t,parentValue:o});if(d&&u===!1){if(s[r]===void 0&&!m)return null}else if(s[r]===void 0&&m)return null;if(p)return null;var h=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return c&&(h=c===!0?h.sort((e,t)=>{var[n]=e,[r]=t;return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):h.sort((e,t)=>{var[n,r]=e,[i,a]=t;return typeof n==`string`&&typeof i==`string`?c(n,i,r,a):0})),(0,L.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:l,marginLeft:6},children:h.map((e,t)=>{var[r,o]=e;return(0,L.jsx)(Ou,{parentValue:n,keyName:r,keys:[...a,r],value:o,level:i},t)})})};Eu.displayName=`JVR.KeyValues`;var Du=e=>{var{keyName:t,parentValue:n,keys:r,value:i}=e,{highlightUpdates:a}=hl(),o=typeof t==`number`,s=(0,I.useRef)(null);xu({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,L.jsxs)(I.Fragment,{children:[(0,L.jsxs)(`span`,{ref:s,children:[(0,L.jsx)(Dl,z({isNumber:o,"data-placement":`left`},c)),(0,L.jsx)(hu,z({},c,{children:t})),(0,L.jsx)(Dl,z({isNumber:o,"data-placement":`right`},c))]}),(0,L.jsx)(kl,z({},c))]})};Du.displayName=`JVR.KayName`;var Ou=e=>{var{keyName:t,value:n,parentValue:r,level:i=0,keys:a=[]}=e,o=kc(),s=Tu(),c=Array.isArray(n),l=n instanceof Set,u=n instanceof Map,d=n instanceof Date,f=n instanceof URL;return n&&typeof n==`object`&&!c&&!l&&!u&&!d&&!f||c||l||u?(0,L.jsx)(Hu,{keyName:t,value:l?Array.from(n):u?Object.fromEntries(n):n,parentValue:r,initialValue:n,keys:a,level:i+1}):(0,L.jsxs)(yu,z({className:`w-rjv-line`,value:n,keyName:t,keys:a,parentValue:r},{onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})},{children:[(0,L.jsx)(Du,{keyName:t,value:n,keys:a,parentValue:r}),(0,L.jsx)(lu,{keyName:t,value:n,keys:a}),(0,L.jsx)(wu,{keyName:t,value:n,keys:a,parentValue:r,expandKey:s})]}))};Ou.displayName=`JVR.KeyValuesItem`;var ku=[`value`,`keyName`],Au=[`as`,`render`],ju=e=>{var{CountInfoExtra:t={}}=ol();return fu(t,e,`CountInfoExtra`),null};ju.displayName=`JVR.CountInfoExtra`;var Mu=e=>{var{value:t={},keyName:n}=e,r=Sc(e,ku),{CountInfoExtra:i={}}=ol(),{as:a,render:o}=i,s=Sc(i,Au);if(!o&&!s.children)return null;var c=a||`span`,l=o&&typeof o==`function`,u=z({},s,r);return l&&o(u,{value:t,keyName:n})||(0,L.jsx)(c,z({},u))};Mu.displayName=`JVR.CountInfoExtraComps`;var Nu=[`value`,`keyName`],Pu=[`as`,`render`],Fu=e=>{var{CountInfo:t={}}=ol();return fu(t,e,`CountInfo`),null};Fu.displayName=`JVR.CountInfo`;var Iu=e=>{var{value:t={},keyName:n}=e,r=Sc(e,Nu),{displayObjectSize:i}=hl(),{CountInfo:a={}}=ol();if(!i)return null;var{as:o,render:s}=a,c=Sc(a,Pu),l=o||`span`;c.style=z({},c.style,e.style);var u=Object.keys(t).length;c.children||=u+` item`+(u===1?``:`s`);var d=z({},c,r);return s&&typeof s==`function`&&s(z({},d,{"data-length":u}),{value:t,keyName:n})||(0,L.jsx)(l,z({},d))};Iu.displayName=`JVR.CountInfoComp`;var Lu=[`as`,`render`],Ru=e=>{var{Ellipsis:t={}}=ol();return fu(t,e,`Ellipsis`),null};Ru.displayName=`JVR.Ellipsis`;var zu=e=>{var{isExpanded:t,value:n,keyName:r}=e,{Ellipsis:i={}}=ol(),{as:a,render:o}=i,s=Sc(i,Lu),c=a||`span`;return o&&typeof o==`function`&&o(z({},s,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,L.jsx)(c,z({},s)))};zu.displayName=`JVR.EllipsisComp`;var Bu=e=>{var{keyName:t,expandKey:n,keys:r=[],initialValue:i,value:a,parentValue:o,level:s}=e,c=Pc(),l=Lc(),{onExpand:u,collapsed:d,shouldExpandNodeInitially:f}=hl(),p=typeof d==`boolean`?d:typeof d==`number`?s>d:!1,m=c[n]??(f?!1:p),h=f&&f(!m,{value:a,keys:r,level:s,keyName:t,parentValue:o});c[n]===void 0&&f&&(m=!h);var g=()=>{var e={expand:!m,value:a,keyid:n,keyName:t};u&&u(e),l({[n]:e.expand})},_={display:`inline-flex`,alignItems:`center`},v={transform:`rotate(`+(m?`-90`:`0`)+`deg)`,transition:`all 0.3s`},y=Object.keys(a).length,b=typeof a==`object`,x=Array.isArray(a),S=a instanceof Set,C=y!==0&&(x||S||b),w={style:_};C&&(w.onClick=g);var T={keyName:t,value:a,keys:r,parentValue:o};return(0,L.jsxs)(`span`,z({},w,{children:[C&&(0,L.jsx)(Al,z({style:v,expandKey:n},T)),(t||typeof t==`number`)&&(0,L.jsx)(Du,z({},T)),(0,L.jsx)(Jl,{value:i,keyName:t}),(0,L.jsx)(Yl,{value:i,keyName:t}),(0,L.jsx)(jl,z({isBrackets:x||S},T)),(0,L.jsx)(zu,{keyName:t,value:a,isExpanded:m}),(0,L.jsx)(Ml,z({isVisiable:m||!C,isBrackets:x||S},T)),(0,L.jsx)(Iu,{value:a,keyName:t}),(0,L.jsx)(Mu,{value:a,keyName:t}),(0,L.jsx)(wu,{keyName:t,value:a,expandKey:n,parentValue:o,keys:r})]}))};Bu.displayName=`JVR.NestedOpen`;var Vu=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],Hu=(0,I.forwardRef)((e,t)=>{var{className:n=``,parentValue:r,level:i=1,value:a,initialValue:o,keys:s,keyName:c}=e,l=Sc(e,Vu),u=kc(),d=Tu();return(0,L.jsxs)(`div`,z({className:[n,`w-rjv-inner`].filter(Boolean).join(` `),ref:t},l,{onMouseEnter:()=>u({[d]:!0}),onMouseLeave:()=>u({[d]:!1})},{children:[(0,L.jsx)(Bu,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c,initialValue:o}),(0,L.jsx)(Eu,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c}),(0,L.jsx)(Nl,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c})]}))});Hu.displayName=`JVR.Container`;var Uu=e=>{var{BraceLeft:t={}}=Qc();return uu(t,e,`BraceLeft`),null};Uu.displayName=`JVR.BraceLeft`;var Wu=e=>{var{BraceRight:t={}}=Qc();return uu(t,e,`BraceRight`),null};Wu.displayName=`JVR.BraceRight`;var Gu=e=>{var{BracketsLeft:t={}}=Qc();return uu(t,e,`BracketsLeft`),null};Gu.displayName=`JVR.BracketsLeft`;var Ku=e=>{var{BracketsRight:t={}}=Qc();return uu(t,e,`BracketsRight`),null};Ku.displayName=`JVR.BracketsRight`;var qu=e=>{var{Arrow:t={}}=Qc();return uu(t,e,`Arrow`),null};qu.displayName=`JVR.Arrow`;var Ju=e=>{var{Colon:t={}}=Qc();return uu(t,e,`Colon`),null};Ju.displayName=`JVR.Colon`;var Yu=e=>{var{Quote:t={}}=Qc();return uu(t,e,`Quote`),null};Yu.displayName=`JVR.Quote`;var Xu=e=>{var{ValueQuote:t={}}=Qc();return uu(t,e,`ValueQuote`),null};Xu.displayName=`JVR.ValueQuote`;var Zu=e=>{var{Bigint:t={}}=Hc();return du(t,e,`Bigint`),null};Zu.displayName=`JVR.Bigint`;var Qu=e=>{var{Date:t={}}=Hc();return du(t,e,`Date`),null};Qu.displayName=`JVR.Date`;var $u=e=>{var{False:t={}}=Hc();return du(t,e,`False`),null};$u.displayName=`JVR.False`;var ed=e=>{var{Float:t={}}=Hc();return du(t,e,`Float`),null};ed.displayName=`JVR.Float`;var td=e=>{var{Int:t={}}=Hc();return du(t,e,`Int`),null};td.displayName=`JVR.Int`;var nd=e=>{var{Map:t={}}=Hc();return du(t,e,`Map`),null};nd.displayName=`JVR.Map`;var rd=e=>{var{Nan:t={}}=Hc();return du(t,e,`Nan`),null};rd.displayName=`JVR.Nan`;var id=e=>{var{Null:t={}}=Hc();return du(t,e,`Null`),null};id.displayName=`JVR.Null`;var ad=e=>{var{Set:t={}}=Hc();return du(t,e,`Set`),null};ad.displayName=`JVR.Set`;var od=e=>{var{Str:t={}}=Hc();return du(t,e,`Str`),null};od.displayName=`JVR.StringText`;var sd=e=>{var{True:t={}}=Hc();return du(t,e,`True`),null};sd.displayName=`JVR.True`;var cd=e=>{var{Undefined:t={}}=Hc();return du(t,e,`Undefined`),null};cd.displayName=`JVR.Undefined`;var ld=e=>{var{Url:t={}}=Hc();return du(t,e,`Url`),null};ld.displayName=`JVR.Url`;var ud=e=>{var{Copied:t={}}=ol();return fu(t,e,`Copied`),null};ud.displayName=`JVR.Copied`;var dd=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],fd=(0,I.forwardRef)((e,t)=>{var{className:n=``,style:r,value:i,children:a,collapsed:o=!1,shouldExpandNodeInitially:s,indentWidth:c=15,displayObjectSize:l=!0,shortenTextAfterLength:u=30,stringEllipsis:d,highlightUpdates:f=!0,enableClipboard:p=!0,displayDataTypes:m=!0,objectSortKeys:h=!1,onExpand:g,onCopied:_,beforeCopy:v}=e,y=Sc(e,dd),b=z({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},r),x=[`w-json-view-container`,`w-rjv`,n].filter(Boolean).join(` `);return(0,L.jsxs)(gl,{initialState:{value:i,objectSortKeys:h,indentWidth:c,shouldExpandNodeInitially:o===!1?s:void 0,displayObjectSize:l,collapsed:o,enableClipboard:p,shortenTextAfterLength:u,stringEllipsis:d,highlightUpdates:f,onCopied:_,onExpand:g,beforeCopy:v},initialTypes:{displayDataTypes:m},children:[(0,L.jsx)(Hu,z({value:i},y,{ref:t,className:x,style:b})),a]})});fd.Bigint=Zu,fd.Date=Qu,fd.False=$u,fd.Float=ed,fd.Int=td,fd.Map=nd,fd.Nan=rd,fd.Null=id,fd.Set=ad,fd.String=od,fd.True=sd,fd.Undefined=cd,fd.Url=ld,fd.ValueQuote=Xu,fd.Arrow=qu,fd.Colon=Ju,fd.Quote=Yu,fd.Ellipsis=Ru,fd.BraceLeft=Uu,fd.BraceRight=Wu,fd.BracketsLeft=Gu,fd.BracketsRight=Ku,fd.Copied=ud,fd.CountInfo=Fu,fd.CountInfoExtra=ju,fd.KeyName=mu,fd.Row=vu,fd.displayName=`JVR.JsonView`;var pd={"--w-rjv-font-family":`monospace`,"--w-rjv-color":`#9cdcfe`,"--w-rjv-key-string":`#9cdcfe`,"--w-rjv-background-color":`#1e1e1e`,"--w-rjv-line-color":`#36334280`,"--w-rjv-arrow-color":`#838383`,"--w-rjv-edit-color":`var(--w-rjv-color)`,"--w-rjv-info-color":`#9c9c9c7a`,"--w-rjv-update-color":`#9cdcfe`,"--w-rjv-copied-color":`#9cdcfe`,"--w-rjv-copied-success-color":`#28a745`,"--w-rjv-curlybraces-color":`#d4d4d4`,"--w-rjv-colon-color":`#d4d4d4`,"--w-rjv-brackets-color":`#d4d4d4`,"--w-rjv-quotes-color":`var(--w-rjv-key-string)`,"--w-rjv-quotes-string-color":`var(--w-rjv-type-string-color)`,"--w-rjv-type-string-color":`#ce9178`,"--w-rjv-type-int-color":`#b5cea8`,"--w-rjv-type-float-color":`#b5cea8`,"--w-rjv-type-bigint-color":`#b5cea8`,"--w-rjv-type-boolean-color":`#569cd6`,"--w-rjv-type-date-color":`#b5cea8`,"--w-rjv-type-url-color":`#3b89cf`,"--w-rjv-type-null-color":`#569cd6`,"--w-rjv-type-nan-color":`#859900`,"--w-rjv-type-undefined-color":`#569cd6`};function md({value:e,defaultExpandLevel:t=1,className:n=``,maxHeight:r=`24rem`,showControls:i=!0}){let a=hd(e),[o,s]=(0,I.useState)(t),[c,l]=(0,I.useState)(0),u=(0,I.useCallback)(()=>{s(!1),l(e=>e+1)},[]),d=(0,I.useCallback)(()=>{s(t),l(e=>e+1)},[t]);return a?(0,L.jsxs)(`div`,{className:`min-w-0 max-w-full ${n}`,children:[i?(0,L.jsxs)(`div`,{className:`flex items-center gap-1 mb-1`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:u,className:`flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium text-slate-400 hover:text-slate-200 bg-slate-800/50 hover:bg-slate-700/60 rounded-sm transition-colors`,children:[(0,L.jsx)(Ro,{size:10}),`Expand`]}),(0,L.jsxs)(`button`,{type:`button`,onClick:d,className:`flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium text-slate-400 hover:text-slate-200 bg-slate-800/50 hover:bg-slate-700/60 rounded-sm transition-colors`,children:[(0,L.jsx)(Io,{size:10}),`Collapse`]})]}):null,(0,L.jsx)(`div`,{className:`min-w-0 max-w-full overflow-auto rounded-sm text-xs`,style:{maxHeight:r},children:(0,L.jsx)(fd,{value:a,style:{...pd,background:`transparent`,fontSize:`12px`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`},collapsed:o,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,shortenTextAfterLength:120},c)})]}):(0,L.jsx)(`pre`,{className:`max-w-full overflow-auto whitespace-pre-wrap break-words font-mono text-xs text-slate-300 ${n}`,style:{maxHeight:r},children:typeof e==`string`?e:JSON.stringify(e,null,2)})}function hd(e){if(typeof e==`object`&&e)return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return null;try{let e=JSON.parse(t);return typeof e==`object`&&e?e:null}catch{return null}}var gd={transcript:0,"event-log":1,live:2},_d={"user.message":0,"agent.turn":1,"model.reasoning":2,"tool.call":3,"agent.delegation":3,"agent.async":4,"tool.result":5,"execution.command":6,"yielded.run":7,"assistant.message":8,error:9};function vd(e,t,n){let r=e??2**53-1,i=t??2**53-1;return{sourceRank:gd.live,turnSeq:r,streamId:r,streamFrameIndex:i,phaseRank:_d[n]}}function yd(e){let[t,n]=e.split(`:`);if(t===void 0||n===void 0)return;let r=Number(t),i=Number(n);if(!(!Number.isInteger(r)||r<0)&&!(!Number.isInteger(i)||i<0))return{streamId:r,frameIndex:i}}function bd(e,t){if(e)return{...e,contentPartIndex:(e.contentPartIndex??0)+.1,phaseRank:_d[t]}}function xd(e,t){return!e&&!t?0:e?t?e.turnSeq-t.turnSeq||(e.transcriptIndex??2**53-1)-(t.transcriptIndex??2**53-1)||(e.eventSequence??2**53-1)-(t.eventSequence??2**53-1)||(e.streamId??2**53-1)-(t.streamId??2**53-1)||(e.streamFrameIndex??2**53-1)-(t.streamFrameIndex??2**53-1)||(e.contentPartIndex??0)-(t.contentPartIndex??0)||e.phaseRank-t.phaseRank||e.sourceRank-t.sourceRank:-1:1}var Sd=t(n(((e,t)=>{var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,`__id`,{value:++n}),e.__id},clone:function e(t,n){n||={};var r,a;switch(i.util.type(t)){case`Object`:if(a=i.util.objId(t),n[a])return n[a];for(var o in r={},n[a]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case`Array`:return a=i.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return`none`},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,`gi`),``),e.classList.add(`language-`+n)},currentScript:function(){if(typeof document>`u`)return null;if(document.currentScript&&document.currentScript.tagName===`SCRIPT`)return document.currentScript;try{throw Error()}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName(`script`);for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r||=i.languages;var a=r[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=r[e];return r[e]=o,i.languages.DFS(i.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,r,a){a||={};var o=i.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var c=t[s],l=i.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:`code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code`};i.hooks.run(`before-highlightall`,r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run(`before-all-elements-highlight`,r);for(var a=0,o;o=r.elements[a++];)i.highlightElement(o,t===!0,r.callback)},highlightElement:function(t,n,r){var a=i.util.getLanguage(t),o=i.languages[a];i.util.setLanguage(t,a);var s=t.parentElement;s&&s.nodeName.toLowerCase()===`pre`&&i.util.setLanguage(s,a);var c={element:t,language:a,grammar:o,code:t.textContent};function l(e){c.highlightedCode=e,i.hooks.run(`before-insert`,c),c.element.innerHTML=c.highlightedCode,i.hooks.run(`after-highlight`,c),i.hooks.run(`complete`,c),r&&r.call(c.element)}if(i.hooks.run(`before-sanity-check`,c),s=c.element.parentElement,s&&s.nodeName.toLowerCase()===`pre`&&!s.hasAttribute(`tabindex`)&&s.setAttribute(`tabindex`,`0`),!c.code){i.hooks.run(`complete`,c),r&&r.call(c.element);return}if(i.hooks.run(`before-highlight`,c),!c.grammar){l(i.util.encode(c.code));return}if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){l(e.data)},u.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else l(i.highlight(c.code,c.grammar,c.language))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run(`after-tokenize`,r),a.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new c;return l(i,i.head,e),s(e,i,t,i.head,0),d(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(!(!n||!n.length))for(var r=0,a;a=n[r++];)a(t)}},Token:a};e.Prism=i;function a(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}a.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var r=``;return t.forEach(function(t){r+=e(t,n)}),r}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),i.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`&quot;`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function o(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function s(e,t,n,r,c,d){for(var f in n)if(!(!n.hasOwnProperty(f)||!n[f])){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=r.next,C=c;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof a)){var T=1,E;if(v){if(E=o(x,C,e,_),!E||E.index>=e.length)break;var D=E.index,O=E.index+E[0].length,k=C;for(k+=S.value.length;D>=k;)S=S.next,k+=S.value.length;if(k-=S.value.length,C=k,S.value instanceof a)continue;for(var A=S;A!==t.tail&&(k<O||typeof A.value==`string`);A=A.next)T++,k+=A.value.length;T--,w=e.slice(C,k),E.index-=C}else if(E=o(x,0,w,_),!E)continue;var D=E.index,j=E[0],M=w.slice(0,D),N=w.slice(D+j.length),P=C+w.length;d&&P>d.reach&&(d.reach=P);var F=S.prev;M&&(F=l(t,F,M),C+=M.length),u(t,F,T);var ee=new a(f,g?i.tokenize(j,g):j,y,j);if(S=l(t,F,ee),N&&l(t,S,N),T>1){var te={cause:f+`,`+m,reach:P};s(e,t,n,S.prev,C,te),d&&te.reach>d.reach&&(d.reach=te.reach)}}}}}}function c(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function d(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}if(!e.document)return e.addEventListener&&(i.disableWorkerMessageHandler||e.addEventListener(`message`,function(t){var n=JSON.parse(t.data),r=n.language,a=n.code,o=n.immediateClose;e.postMessage(i.highlight(a,i.languages[r],r)),o&&e.close()},!1)),i;var f=i.util.currentScript();f&&(i.filename=f.src,f.hasAttribute(`data-manual`)&&(i.manual=!0));function p(){i.manual||i.highlightAll()}if(!i.manual){var m=document.readyState;m===`loading`||m===`interactive`&&f&&f.defer?document.addEventListener(`DOMContentLoaded`,p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return i}(typeof window<`u`?window:typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope?self:{});t!==void 0&&t.exports&&(t.exports=n),typeof global<`u`&&(global.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside[`attr-value`].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside[`internal-subset`].inside=n.languages.markup,n.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(n.languages.markup.tag,`addInlined`,{value:function(e,t){var r={};r[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var a={};a[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:i},n.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(n.languages.markup.tag,`addAttribute`,{value:function(e,t){n.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend(`markup`,{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend(`clike`,{"class-name":[n.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),n.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),n.languages.markup&&(n.languages.markup.tag.addInlined(`script`,`javascript`),n.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),n.languages.js=n.languages.javascript,(function(){if(n===void 0||typeof document>`u`)return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=`Loading…`,t=function(e,t){return`✖ Error `+e+` while fetching file: `+t},r=`✖ Error: File does not exist or is empty`,i={js:`javascript`,py:`python`,rb:`ruby`,ps1:`powershell`,psm1:`powershell`,sh:`bash`,bat:`batch`,h:`c`,tex:`latex`},a=`data-src-status`,o=`loading`,s=`loaded`,c=`failed`,l=`pre[data-src]:not([`+a+`="`+s+`"]):not([`+a+`="`+o+`"])`;function u(e,n,i){var a=new XMLHttpRequest;a.open(`GET`,e,!0),a.onreadystatechange=function(){a.readyState==4&&(a.status<400&&a.responseText?n(a.responseText):a.status>=400?i(t(a.status,a.statusText)):i(r))},a.send(null)}function d(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||``);if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}n.hooks.add(`before-highlightall`,function(e){e.selector+=`, `+l}),n.hooks.add(`before-sanity-check`,function(t){var r=t.element;if(r.matches(l)){t.code=``,r.setAttribute(a,o);var f=r.appendChild(document.createElement(`CODE`));f.textContent=e;var p=r.getAttribute(`data-src`),m=t.language;if(m===`none`){var h=(/\.(\w+)$/.exec(p)||[,`none`])[1];m=i[h]||h}n.util.setLanguage(f,m),n.util.setLanguage(r,m);var g=n.plugins.autoloader;g&&g.loadLanguages(m),u(p,function(e){r.setAttribute(a,s);var t=d(r.getAttribute(`data-range`));if(t){var i=e.split(/\r\n?|\n/g),o=t[0],c=t[1]==null?i.length:t[1];o<0&&(o+=i.length),o=Math.max(0,Math.min(o-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(o,c).join(`
11
- `),r.hasAttribute(`data-start`)||r.setAttribute(`data-start`,String(o+1))}f.textContent=e,n.highlightElement(f)},function(e){r.setAttribute(a,c),f.textContent=e})}}),n.plugins.fileHighlight={highlight:function(e){for(var t=(e||document).querySelectorAll(l),r=0,i;i=t[r++];)n.highlightElement(i)}};var f=!1;n.fileHighlight=function(){f||=(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()}))(),1);function Cd(e){return typeof e==`object`&&!!e&&`languages`in e}var wd=globalThis,Td=Cd(wd.Prism)?wd.Prism:Sd.default;wd.Prism=Td,typeof window<`u`&&(window.Prism=Td);var Ed=Object.defineProperty,Dd=(e,t,n)=>t in e?Ed(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Od=(e,t,n)=>Dd(e,typeof t==`symbol`?t:t+``,n),kd=class e{constructor(e=new Map){this.map=e}clone(){return new e(new Map(this.map))}increment(e){let t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let n=this.map.get(e);n!==void 0&&(--n,this.map.set(e,n),n===0&&t())}},Ad=class{constructor(){Od(this,`map`,new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){let n=this.get(e);n!==void 0&&t(n)}delete(e){return this.map.delete(e)}};function jd(e,t){return t(e),e}function Md(){}var Nd=`cell`;function Pd(e,t){return e===t}var Fd=new Map,Id,Ld=class{constructor(e={}){Od(this,`subscriptions`,new Ad),Od(this,`singletonSubscriptions`,new Map),Od(this,`graph`,new Ad),Od(this,`state`,new Map),Od(this,`distinctNodes`,new Map),Od(this,`executionMaps`,new Map),Od(this,`definitionRegistry`,new Set),Od(this,`combinedCells`,[]);for(let t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,n=Symbol()){return this.state.has(n)||this.state.set(n,e),t!==!1&&!this.distinctNodes.has(n)&&this.distinctNodes.set(n,t===!0?Pd:t),n}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?Pd:e),t}sub(e,t){this.register(e);let n=this.subscriptions.getOrCreate(e);return n.add(t),()=>n.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){let n=this.signalInstance();return this.connect({map:e=>(...t)=>{e(t)},sink:n,sources:e}),this.sub(n,t)}pubIn(e){var t;let n=Reflect.ownKeys(e),r=this.getExecutionMap(n),i=r.refCount.clone(),a=r.participatingNodes.slice(),o=new Map(this.state),s=e=>{this.graph.use(e,t=>{for(let{sources:n,sink:r}of t)n.has(e)&&i.decrement(r,()=>{a.splice(a.indexOf(r),1),s(r)})})};for(;;){let n=a.shift();if(n===void 0)break;let i=n,c=!1,l=e=>{let t=this.distinctNodes.get(i);if(t!=null&&t(o.get(i),e)){c=!1;return}c=!0,o.set(i,e),this.state.has(i)&&this.state.set(i,e)};if(Object.prototype.hasOwnProperty.call(e,i)?l(e[i]):r.projections.use(i,e=>{for(let t of e){let e=[...Array.from(t.sources),...Array.from(t.pulls)].map(e=>o.get(e));t.map(l)(...e)}}),c){let e=o.get(i);this.inContext(()=>{this.subscriptions.use(i,t=>{for(let n of t)n(e)})}),(t=this.singletonSubscriptions.get(i))==null||t(e)}else s(i)}}connect({sources:e,pulls:t=[],map:n,sink:r}){let i={map:n,pulls:new Set(t),sink:this.register(r),sources:new Set(e)};for(let n of[...e,...t])this.register(n),this.graph.getOrCreate(n).add(i);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>jd(this.signalInstance(),n=>(this.link(this.pipe(n,...e),t),n))}link(e,t){this.connect({map:e=>t=>{e(t)},sink:t,sources:[e]})}combine(...e){return jd(this.signalInstance(),t=>{this.connect({map:e=>(...t)=>{e(t)},sink:t,sources:e})})}combineCells(...e){let t=this.combinedCells.find(t=>e.length===t.sources.length&&e.every((e,n)=>e===t.sources[n]));if(t)return t.cell;let n=this.cellInstance(e.map(e=>this.getValue(e)),!0);return this.connect({map:e=>(...t)=>{e(t)},sink:n,sources:e}),this.combinedCells.push({sources:e,cell:n}),n}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(e=>this.getValue(e))}register(e){let t=Fd.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),jd(t.type===Nd?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),e=>{this.inContext(()=>{t.init(this,e)})}))}inContext(e){let t=Id;Id=this;let n=e();return Id=t,n}changeWith(e,t,n){this.connect({sources:[t],pulls:[e],sink:e,map:e=>(t,r)=>{e(n(r,t))}})}calculateExecutionMap(e){let t=[],n=new Set,r=new Ad,i=new kd,a=new Ad,o=(e,s=0)=>{i.increment(e),!n.has(e)&&(this.register(e),r.use(e,e=>{s=Math.max(...Array.from(e).map(e=>t.indexOf(e)))+1}),this.graph.use(e,t=>{for(let n of t)n.sources.has(e)?(a.getOrCreate(n.sink).add(n),o(n.sink,s)):r.getOrCreate(n.sink).add(e)}),n.add(e),t.splice(s,0,e))};return e.forEach(o),{participatingNodes:t,pendingPulls:r,projections:a,refCount:i}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];let n=this.executionMaps.get(t);if(n!==void 0)return n}else for(let[t,n]of this.executionMaps.entries())if(Array.isArray(t)&&t.length===e.length&&t.every(t=>e.includes(t)))return n;let n=this.calculateExecutionMap(e);return this.executionMaps.set(t,n),n}combineOperators(...e){return t=>{for(let n of e)t=n(t,this);return t}}};function B(e,t=Md,n=!0){return jd(Symbol(),r=>{Fd.set(r,{type:Nd,distinct:n,initial:e,init:t})})}function Rd(e=Md,t=!1){return jd(Symbol(),n=>{Fd.set(n,{type:`signal`,distinct:t,init:e})})}function zd(e=Md){return jd(Symbol(),t=>{Fd.set(t,{type:`signal`,distinct:!1,init:e})})}var Bd=I.createContext(null);function Vd(){let e=I.useContext(Bd);if(e===null)throw Error(`useRealm must be used within a RealmContextProvider`);return e}function Hd(e){let t=Vd();t.register(e);let n=I.useCallback(n=>t.sub(e,n),[t,e]);return I.useSyncExternalStore(n,()=>t.getValue(e),()=>t.getValue(e))}function Ud(...e){let t=Vd();return Hd(I.useMemo(()=>t.combineCells.apply(t,e),[t,...e]))}function Wd(e){let t=Vd();return t.register(e),I.useCallback(n=>{t.pub(e,n)},[t,e])}function Gd(e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:t=>n=>{t(e(n))},sink:r,sources:[t]}),r}}function Kd(...e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:e=>(...t)=>{e(t)},pulls:e,sink:r,sources:[t]}),r}}function qd(e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:t=>n=>{e(n)&&t(n)},sink:r,sources:[t]}),r}}function Jd(e,t){return(n,r)=>{let i=r.signalInstance();return r.connect({map:n=>r=>{n(t=e(t,r))},sink:i,sources:[n]}),i}}function Yd(e,t){return t(e),e}function Xd(){}function Zd(e){return function(t){return{init:n=>e.init?.call(e,n,t),postInit:n=>e.postInit?.call(e,n,t),update:n=>e.update?.call(e,n,t)}}}function Qd({children:e,plugins:t}){let n=I.useMemo(()=>Yd(new Ld,e=>{var n,r;for(let r of t)(n=r.init)==null||n.call(r,e);for(let n of t)(r=n.postInit)==null||r.call(n,e)}),[]);return I.useEffect(()=>{var e;for(let r of t)(e=r.update)==null||e.call(r,n)}),I.createElement(Bd.Provider,{value:n},e)}var $d=(0,I.createContext)(null);function ef(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t??(n==null?null:n.getTheme())}}}function tf(){let e=(0,I.useContext)($d);return e??function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}function V(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var nf=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,rf=nf&&`documentMode`in document?document.documentMode:null,af=nf&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),of=nf&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),sf=!(!nf||!(`InputEvent`in window)||rf)&&`getTargetRanges`in new window.InputEvent(`input`),cf=nf&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),lf=nf&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,uf=nf&&/Android/.test(navigator.userAgent),df=nf&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ff=nf&&uf&&df,pf=nf&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!df;function mf(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}var hf=1,gf=3,_f=9,vf=11,yf=0,bf=1,xf=2,Sf=0,Cf=1,wf=2,Tf=1,Ef=2,Df=3,Of=4,kf=5,Af=6,jf=cf||lf||pf?`\xA0`:`​`,Mf=`
12
-
13
- `,Nf=of?`\xA0`:jf,Pf={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Ff={directionless:1,unmergeable:2},If={center:Ef,end:Af,justify:Of,left:Tf,right:Df,start:kf},Lf={[Ef]:`center`,[Af]:`end`,[Of]:`justify`,[Tf]:`left`,[Df]:`right`,[kf]:`start`},Rf={normal:0,segmented:2,token:1},zf={[Sf]:`normal`,[wf]:`segmented`,[Cf]:`token`},Bf=`$config`;function Vf(e,t,n,r,i,a){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(G(o)&&Vf(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}var Hf=100,Uf=!1,Wf=0;function Gf(e){Wf=e.timeStamp}function Kf(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&M_(e,n)!==void 0}function qf(e,t,n){let r=Sv(pv(n)),i=null,a=null;r!==null&&r.anchorNode===e&&(i=r.anchorOffset,a=r.focusOffset);let o=e.nodeValue;o!==null&&G_(t,o,i,a,!1)}function Jf(e,t,n){if(U(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return b_(t)&&n.isAttached()}function Yf(e,t,n,r){for(let i=e;i&&!Rv(i);i=cv(i)){let e=M_(i,t);if(e!==void 0){let t=A_(e,n);if(t)return Gg(t)||!Tv(i)?void 0:[i,t]}else if(i===r)return[r,L_(n)]}}function Xf(e,t,n){Uf=!0;let r=performance.now()-Wf>Hf;try{zg(e,(()=>{let i=W()||function(e){return e.getEditorState().read((()=>{let e=W();return e===null?null:e.clone()}))}(e),a=new Map,o=e.getRootElement(),s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n=0;n<t.length;n++){let d=t[n],f=d.type,p=d.target,m=Yf(p,e,s,o);if(!m)continue;let[h,g]=m;if(f===`characterData`)r&&H(g)&&b_(p)&&Jf(i,p,g)&&qf(p,g,e);else if(f===`childList`){l=!0;let t=d.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=j_(r),a=r.parentNode;if(a!=null&&r!==c&&i===null&&!Kf(r,a,e)){if(of){let e=(Tv(r)?r.innerText:null)||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}let n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(Kf(r,p,e)||c===r)&&(p.appendChild(r),t++)}r!==t&&a.set(h,g)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){let n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||Kf(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(l&&R_(i),of&&av(e)&&i.insertRawText(u))}))}finally{Uf=!1}}function Zf(e){let t=e._observer;t!==null&&Xf(e,t.takeRecords(),t)}function Qf(e){(function(e){Wf===0&&pv(e).addEventListener(`textInput`,Gf,!0)})(e),e._observer=new MutationObserver(((t,n)=>{Xf(e,t,n)}))}function $f(e){let t=new Map,n=new Set;for(let r=typeof e==`function`?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){let{ownNodeConfig:e}=Bv(r);if(e&&e.stateConfigs)for(let r of e.stateConfigs){let e;`stateConfig`in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}var ep=class e{constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return rp(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=rp(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function tp(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new ep(t,np(t));return t.__state=n,n}function np(e){return e.__state?e.__state.sharedNodeState:u_(Mv(),e.getType()).sharedNodeState}function rp(e){if(e)for(let t in e)return e}function ip(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function ap(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function op(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function sp(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;if(e&&t&&e.size!==t.size)return!1;let n=new Set;return!(e&&ip(n,e,t)||t&&ip(n,t,e)||e&&ap(n,e,t)||t&&ap(n,t,e))}(c,l))}function cp(e,t){let n=e.mergeWithSibling(t),r=Eg()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function lp(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&H(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(sp(t,r)){r=cp(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&H(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(sp(r,n)){r=cp(r,n);break}break}n.remove()}}else r.remove()}function up(e){return dp(e.anchor),dp(e.focus),e}function dp(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),H(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!G(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var fp,pp,mp,hp,gp,_p,vp,yp,bp,xp,Sp=``,Cp=null,wp=``,Tp=``,Ep=!1,Dp=!1;function Op(e,t){let n=vp.get(e);if(t!==null){let n=Gp(e);n.parentNode===t&&t.removeChild(n)}if(yp.has(e)||pp._keyToDOMMap.delete(e),G(n)){let e=Bp(n,vp);kp(e,0,e.length-1,null)}n!==void 0&&nv(xp,mp,hp,n,`destroyed`)}function kp(e,t,n,r){let i=t;for(;i<=n;++i){let t=e[i];t!==void 0&&Op(t,r)}}function Ap(e,t){e.setProperty(`text-align`,t)}var jp=`40px`;function Mp(e,t){let n=fp.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}let r=getComputedStyle(e).getPropertyValue(`--lexical-indent-base-value`)||jp;e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * ${r})`)}function Np(e,t){let n=e.style;t===0?Ap(n,``):t===Tf?Ap(n,`left`):t===Ef?Ap(n,`center`):t===Df?Ap(n,`right`):t===Of?Ap(n,`justify`):t===kf?Ap(n,`start`):t===Af&&Ap(n,`end`)}function Pp(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(qg(e))return null;let n=e.getParentOrThrow();return qg(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function Fp(e,t){let n=yp.get(e);n===void 0&&V(60);let r=n.createDOM(fp,pp);if(function(e,t,n){let r=n._keyToDOMMap;(function(e,t,n){let r=`__lexicalKey_${t._key}`;e[r]=n})(t,n,e),r.set(e,t)}(e,r,pp),H(n)?r.setAttribute(`data-lexical-text`,`true`):Gg(n)&&r.setAttribute(`data-lexical-decorator`,`true`),G(n)){let e=n.__indent,t=n.__size;if(Pp(r,n),e!==0&&Mp(r,e),t!==0){let e=t-1;Ip(Bp(n,yp),n,0,e,n.getDOMSlot(r))}let i=n.__format;i!==0&&Np(r,i),n.isInline()||Rp(null,n,r),ov(n)&&(Sp+=Mf,Tp+=Mf)}else{let t=n.getTextContent();if(Gg(n)){let t=n.decorate(pp,fp);t!==null&&Hp(e,t),r.contentEditable=`false`}Sp+=t,Tp+=t}return t!==null&&t.insertChild(r),nv(xp,mp,hp,n,`created`),r}function Ip(e,t,n,r,i){let a=Sp;Sp=``;let o=n;for(;o<=r;++o){Fp(e[o],i);let t=yp.get(e[o]);t!==null&&H(t)&&(Cp===null&&(Cp=t.getFormat()),wp===``&&(wp=t.getStyle()))}ov(t)&&(Sp+=Mf),i.element.__lexicalTextContent=Sp,Sp=a+Sp}function Lp(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return gh(e)?`line-break`:Gg(e)&&e.isInline()?`decorator`:null}return`empty`}return null}function Rp(e,t,n){let r=Lp(e,vp),i=Lp(t,yp);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function zp(e,t,n){var r;Cp=null,wp=``,function(e,t,n){let r=Sp,i=e.__size,a=t.__size;Sp=``;let o=n.element;if(i===1&&a===1){let n=e.__first,r=t.__first;if(n===r)Vp(n,o);else{let e=Gp(n),t=Fp(r,null);try{o.replaceChild(t,e)}catch(i){if(typeof i==`object`&&i){let a=`${i.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${r}}, old child: {tag: ${e.tagName}, key: ${n}}.`;throw Error(a)}throw i}Op(n,null)}let i=yp.get(r);H(i)&&(Cp===null&&(Cp=i.getFormat()),wp===``&&(wp=i.getStyle()))}else{let r=Bp(e,vp),s=Bp(t,yp);if(r.length!==i&&V(227),s.length!==a&&V(228),i===0)a!==0&&Ip(s,t,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&n.element.__lexicalLineBreak==null;kp(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else (function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f];if(e===r)u=Up(Vp(r,a.element)),d++,f++;else{c===void 0&&(c=new Set(t)),l===void 0&&(l=new Set(n));let i=l.has(e),o=c.has(r);if(i)if(o){let e=sv(pp,r);e===u?u=Up(Vp(r,a.element)):(a.withBefore(u).insertChild(e),Vp(r,a.element)),d++,f++}else Fp(r,a.withBefore(u)),f++;else u=Up(Gp(e)),Op(e,a.element),d++}let i=yp.get(r);i!==null&&H(i)&&(Cp===null&&(Cp=i.getFormat()),wp===``&&(wp=i.getStyle()))}let p=d>o,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:pp.getElementByKey(t);Ip(n,e,f,s,a.withBefore(r))}else m&&!p&&kp(t,d,o,a.element)})(t,r,s,i,a,n)}ov(t)&&(Sp+=Mf),o.__lexicalTextContent=Sp,Sp=r+Sp}(e,t,t.getDOMSlot(n)),r=t,Cp==null||Cp===r.__textFormat||Dp||r.setTextFormat(Cp),function(e){wp===``||wp===e.__textStyle||Dp||e.setTextStyle(wp)}(t)}function Bp(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t.get(r);e===void 0&&V(101),n.push(r),r=e.__next}return n}function Vp(e,t){let n=vp.get(e),r=yp.get(e);n!==void 0&&r!==void 0||V(61);let i=Ep||_p.has(e)||gp.has(e),a=sv(pp,e);if(n===r&&!i){if(G(n)){let e=a.__lexicalTextContent;e!==void 0&&(Sp+=e,Tp+=e)}else{let e=n.getTextContent();Tp+=e,Sp+=e}return a}if(n!==r&&i&&nv(xp,mp,hp,r,`updated`),r.updateDOM(n,a,fp)){let n=Fp(e,null);return t===null&&V(62),t.replaceChild(n,a),Op(e,null),n}if(G(n)&&G(r)){let e=r.__indent;(Ep||e!==n.__indent)&&Mp(a,e);let t=r.__format;if((Ep||t!==n.__format)&&Np(a,t),i&&(zp(n,r,a),qg(r)||r.isInline()||Rp(n,r,a)),ov(r)&&(Sp+=Mf,Tp+=Mf),(Ep||r.__dir!==n.__dir)&&(Pp(a,r),qg(r)&&!Ep))for(let e of r.getChildren())G(e)&&Pp(sv(pp,e.getKey()),e)}else{let t=r.getTextContent();if(Gg(r)){let t=r.decorate(pp,fp);t!==null&&Hp(e,t)}Sp+=t,Tp+=t}if(!Dp&&qg(r)&&r.__cachedText!==Tp){let e=r.getWritable();e.__cachedText=Tp,r=e}return a}function Hp(e,t){let n=pp._pendingDecorators,r=pp._decorators;if(n===null){if(r[e]===t)return;n=P_(pp)}n[e]=t}function Up(e){let t=e.nextSibling;return t!==null&&t===pp._blockCursorElement&&(t=t.nextSibling),t}function Wp(e,t,n,r,i,a){Sp=``,Tp=``,Ep=r===xf,pp=n,fp=n._config,mp=n._nodes,hp=pp._listeners.mutation,gp=i,_p=a,vp=e._nodeMap,yp=t._nodeMap,Dp=t._readOnly,bp=new Map(n._keyToDOMMap);let o=new Map;return xp=o,Vp(`root`,null),pp=void 0,mp=void 0,gp=void 0,_p=void 0,vp=void 0,yp=void 0,fp=void 0,bp=void 0,xp=void 0,o}function Gp(e){let t=bp.get(e);return t===void 0&&V(75,e),t}function Kp(e){return{type:e}}var qp=Kp(`SELECTION_CHANGE_COMMAND`),Jp=Kp(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),Yp=Kp(`CLICK_COMMAND`),Xp=Kp(`DELETE_CHARACTER_COMMAND`),Zp=Kp(`INSERT_LINE_BREAK_COMMAND`),Qp=Kp(`INSERT_PARAGRAPH_COMMAND`),$p=Kp(`CONTROLLED_TEXT_INSERTION_COMMAND`),em=Kp(`PASTE_COMMAND`),tm=Kp(`REMOVE_TEXT_COMMAND`),nm=Kp(`DELETE_WORD_COMMAND`),rm=Kp(`DELETE_LINE_COMMAND`),im=Kp(`FORMAT_TEXT_COMMAND`),am=Kp(`UNDO_COMMAND`),om=Kp(`REDO_COMMAND`),sm=Kp(`KEYDOWN_COMMAND`),cm=Kp(`KEY_ARROW_RIGHT_COMMAND`),lm=Kp(`MOVE_TO_END`),um=Kp(`KEY_ARROW_LEFT_COMMAND`),dm=Kp(`MOVE_TO_START`),fm=Kp(`KEY_ARROW_UP_COMMAND`),pm=Kp(`KEY_ARROW_DOWN_COMMAND`),mm=Kp(`KEY_ENTER_COMMAND`),hm=Kp(`KEY_SPACE_COMMAND`),gm=Kp(`KEY_BACKSPACE_COMMAND`),_m=Kp(`KEY_ESCAPE_COMMAND`),vm=Kp(`KEY_DELETE_COMMAND`),ym=Kp(`KEY_TAB_COMMAND`),bm=Kp(`INSERT_TAB_COMMAND`),xm=Kp(`INDENT_CONTENT_COMMAND`),Sm=Kp(`OUTDENT_CONTENT_COMMAND`),Cm=Kp(`DROP_COMMAND`),wm=Kp(`FORMAT_ELEMENT_COMMAND`),Tm=Kp(`DRAGSTART_COMMAND`),Em=Kp(`DRAGOVER_COMMAND`),Dm=Kp(`DRAGEND_COMMAND`),Om=Kp(`COPY_COMMAND`),km=Kp(`CUT_COMMAND`),Am=Kp(`SELECT_ALL_COMMAND`),eee=Kp(`CLEAR_EDITOR_COMMAND`),tee=Kp(`CLEAR_HISTORY_COMMAND`),jm=Kp(`CAN_REDO_COMMAND`),Mm=Kp(`CAN_UNDO_COMMAND`),Nm=Kp(`FOCUS_COMMAND`),Pm=Kp(`BLUR_COMMAND`),nee=Kp(`KEY_MODIFIER_COMMAND`),Fm=Object.freeze({}),Im=30,Lm=[[`keydown`,function(e,t){if(Rm=e.timeStamp,zm=e.key,!t.isComposing()&&!K(t,sm,e)&&e.key!=null){if(qm&&Q_(e))return zg(t,(()=>{rh(t,Jm)})),qm=!1,void(Jm=``);if(function(e){return Y_(e,`ArrowRight`,{shiftKey:`any`})}(e))K(t,cm,e);else if(function(e){return Y_(e,`ArrowRight`,X_)}(e))K(t,lm,e);else if(function(e){return Y_(e,`ArrowLeft`,{shiftKey:`any`})}(e))K(t,um,e);else if(function(e){return Y_(e,`ArrowLeft`,X_)}(e))K(t,dm,e);else if(function(e){return Y_(e,`ArrowUp`,{altKey:`any`,shiftKey:`any`})}(e))K(t,fm,e);else if(function(e){return Y_(e,`ArrowDown`,{altKey:`any`,shiftKey:`any`})}(e))K(t,pm,e);else if(function(e){return Y_(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:!0})}(e))Gm=!0,K(t,mm,e);else if(function(e){return e.key===` `}(e))K(t,hm,e);else if(function(e){return af&&Y_(e,`o`,{ctrlKey:!0})}(e))e.preventDefault(),Gm=!0,K(t,Zp,!0);else if(function(e){return Y_(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`})}(e))Gm=!1,K(t,mm,e);else if(function(e){return Y_(e,`Backspace`,{shiftKey:`any`})||af&&Y_(e,`h`,{ctrlKey:!0})}(e))Q_(e)?K(t,gm,e):(e.preventDefault(),K(t,Xp,!0));else if(function(e){return e.key===`Escape`}(e))K(t,_m,e);else if(function(e){return Y_(e,`Delete`,{})||af&&Y_(e,`d`,{ctrlKey:!0})}(e))(function(e){return e.key===`Delete`})(e)?K(t,vm,e):(e.preventDefault(),K(t,Xp,!1));else if(function(e){return Y_(e,`Backspace`,Z_)}(e))e.preventDefault(),K(t,nm,!0);else if(function(e){return Y_(e,`Delete`,Z_)}(e))e.preventDefault(),K(t,nm,!1);else if(function(e){return af&&Y_(e,`Backspace`,{metaKey:!0})}(e))e.preventDefault(),K(t,rm,!0);else if(function(e){return af&&(Y_(e,`Delete`,{metaKey:!0})||Y_(e,`k`,{ctrlKey:!0}))}(e))e.preventDefault(),K(t,rm,!1);else if(function(e){return Y_(e,`b`,X_)}(e))e.preventDefault(),K(t,im,`bold`);else if(function(e){return Y_(e,`u`,X_)}(e))e.preventDefault(),K(t,im,`underline`);else if(function(e){return Y_(e,`i`,X_)}(e))e.preventDefault(),K(t,im,`italic`);else if(function(e){return Y_(e,`Tab`,{shiftKey:`any`})}(e))K(t,ym,e);else if(function(e){return Y_(e,`z`,X_)}(e))e.preventDefault(),K(t,am,void 0);else if(function(e){return af?Y_(e,`z`,{metaKey:!0,shiftKey:!0}):Y_(e,`y`,{ctrlKey:!0})||Y_(e,`z`,{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),K(t,om,void 0);else{let n=t._editorState._selection;n===null||U(n)?$_(e)&&(e.preventDefault(),K(t,Am,e)):function(e){return Y_(e,`c`,X_)}(e)?(e.preventDefault(),K(t,Om,e)):function(e){return Y_(e,`x`,X_)}(e)?(e.preventDefault(),K(t,km,e)):$_(e)&&(e.preventDefault(),K(t,Am,e))}(function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey})(e)&&K(t,nee,e)}}],[`pointerdown`,function(e,t){let n=e.target,r=e.pointerType;Ev(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&zg(t,(()=>{f_(n)||(Wm=!0)}))}],[`compositionstart`,function(e,t){zg(t,(()=>{let n=W();if(U(n)&&!t.isComposing()){let r=n.anchor,i=n.anchor.getNode();O_(r.key),(e.timeStamp<Rm+Im||r.type===`element`||!n.isCollapsed()||i.getFormat()!==n.format||H(i)&&i.getStyle()!==n.style)&&K(t,$p,Nf)}}))}],[`compositionend`,function(e,t){of?Km=!0:lf||!cf&&!pf?zg(t,(()=>{rh(t,e.data)})):(qm=!0,Jm=e.data)}],[`input`,function(e,t){e.stopPropagation(),zg(t,(()=>{if(Tv(e.target)&&f_(e.target))return;let n=W(),r=e.data,i=nh(e);if(r!=null&&U(n)&&Zm(n,i,r,e.timeStamp,!1)){Km&&=(rh(t,r),!1);let i=n.anchor.getNode(),a=Sv(pv(t));if(a===null)return;let o=n.isBackward(),s=o?n.anchor.offset:n.focus.offset,c=o?n.focus.offset:n.anchor.offset;sf&&!n.isCollapsed()&&H(i)&&a.anchorNode!==null&&i.getTextContent().slice(0,s)+r+i.getTextContent().slice(s+c)===U_(a.anchorNode)||K(t,$p,r);let l=r.length;of&&l>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(n.anchor.offset-=l),cf||lf||pf||!t.isComposing()||(Rm=0,O_(null))}else W_(!1,t,r===null?void 0:r),Km&&=(rh(t,r||void 0),!1);(function(){Cg(),Zf(Eg())})()}),{event:e}),Vm=null}],[`click`,function(e,t){zg(t,(()=>{let n=W(),r=Sv(pv(t)),i=ag();if(r){if(U(n)){let t=n.anchor,a=t.getNode();if(t.type===`element`&&t.offset===0&&n.isCollapsed()&&!qg(a)&&I_().getChildrenSize()===1&&a.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&a!==n.focus.getNode()){let e=function(e,t){let n=e;for(;n!==I_()&&n!=null;){if(t(n))return n;n=n.getParent()}return null}(a,(e=>G(e)&&!e.isInline()));G(e)&&e.select(0)}}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=r.anchorNode;(Tv(n)||b_(n))&&R_(ig(i,r,t,e))}}K(t,Yp,e)}))}],[`cut`,Fm],[`copy`,Fm],[`dragstart`,Fm],[`dragover`,Fm],[`dragend`,Fm],[`paste`,Fm],[`focus`,Fm],[`blur`,Fm],[`drop`,Fm]];sf&&Lm.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType,r=nh(e);n===`deleteCompositionText`||of&&av(t)||n!==`insertCompositionText`&&zg(t,(()=>{let i=W();if(n===`deleteContentBackward`){if(i===null){let e=ag();if(!U(e))return;R_(e.clone())}if(U(i)){let n=i.anchor.key===i.focus.key;if(a=e.timeStamp,zm===`MediaLast`&&a<Rm+Im&&t.isComposing()&&n){if(O_(null),Rm=0,setTimeout((()=>{zg(t,(()=>{O_(null)}))}),Im),U(i)){let e=i.anchor.getNode();e.markDirty(),H(e)||V(142),th(i,e)}}else{O_(null),e.preventDefault();let r=i.anchor.getNode(),a=r.getTextContent(),o=r.canInsertTextAfter(),s=i.anchor.offset===0&&i.focus.offset===a.length,c=ff&&n&&!s&&o;if(c&&i.isCollapsed()&&(c=!Gg(iv(i.anchor,!0))),!c){K(t,Xp,!0);let e=W();ff&&U(e)&&e.isCollapsed()&&(Ym=e,setTimeout((()=>Ym=null)))}}return}}var a;if(!U(i))return;let o=e.data;Vm!==null&&W_(!1,t,Vm),i.dirty&&Vm===null||!i.isCollapsed()||qg(i.anchor.getNode())||r===null||i.applyDOMRange(r),Vm=null;let s=i.anchor,c=i.focus,l=s.getNode(),u=c.getNode();if(n!==`insertText`&&n!==`insertTranspose`)switch(e.preventDefault(),n){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:K(t,$p,e);break;case`insertFromComposition`:O_(null),K(t,$p,e);break;case`insertLineBreak`:O_(null),K(t,Zp,!1);break;case`insertParagraph`:O_(null),Gm&&!lf?(Gm=!1,K(t,Zp,!1)):K(t,Qp,void 0);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:K(t,em,e);break;case`deleteByComposition`:(function(e,t){return e!==t||G(e)||G(t)||!v_(e)||!v_(t)})(l,u)&&K(t,tm,e);break;case`deleteByDrag`:case`deleteByCut`:K(t,tm,e);break;case`deleteContent`:K(t,Xp,!1);break;case`deleteWordBackward`:K(t,nm,!0);break;case`deleteWordForward`:K(t,nm,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:K(t,rm,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:K(t,rm,!1);break;case`formatStrikeThrough`:K(t,im,`strikethrough`);break;case`formatBold`:K(t,im,`bold`);break;case`formatItalic`:K(t,im,`italic`);break;case`formatUnderline`:K(t,im,`underline`);break;case`historyUndo`:K(t,am,void 0);break;case`historyRedo`:K(t,om,void 0)}else{if(o===`
14
- `)e.preventDefault(),K(t,Zp,!1);else if(o===Mf)e.preventDefault(),K(t,Qp,void 0);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),i.insertRawText(t)}else o!=null&&Zm(i,r,o,e.timeStamp,!0)?(e.preventDefault(),K(t,$p,o)):Vm=o;Bm=e.timeStamp}}))}(e,t)]);var Rm=0,zm=null,Bm=0,Vm=null,Hm=new WeakMap,Um=!1,Wm=!1,Gm=!1,Km=!1,qm=!1,Jm=``,Ym=null,Xm=[0,``,0,`root`,0];function Zm(e,t,n,r,i){let a=e.anchor,o=e.focus,s=a.getNode(),c=Eg(),l=Sv(pv(c)),u=l===null?null:l.anchorNode,d=a.key,f=c.getElementByKey(d),p=n.length;return d!==o.key||!H(s)||(!i&&(!sf||Bm<r+50)||s.isDirty()&&p<2||B_(n))&&a.offset!==o.offset&&!s.isComposing()||y_(s)||s.isDirty()&&p>1||(i||!sf)&&f!==null&&!s.isComposing()&&u!==S_(f)||l!==null&&t!==null&&(!t.collapsed||t.startContainer!==l.anchorNode||t.startOffset!==l.anchorOffset)||s.getFormat()!==e.format||s.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=v_(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(H(t)||G(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,s)}function Qm(e,t){return b_(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function $m(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=e;Um&&(Um=!1,Qm(r,i)&&Qm(a,o)&&!Ym)||zg(t,(()=>{if(!n)return void R_(null);if(!m_(t,r,a))return;let s=W();if(Ym&&U(s)&&s.isCollapsed()){let e=s.anchor,t=Ym.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(s=Ym.clone(),R_(s))}if(Ym=null,U(s)){let n=s.anchor,r=n.getNode();if(s.isCollapsed()){e.type===`Range`&&e.anchorNode===e.focusNode&&(s.dirty=!0);let i=pv(t).event,a=i?i.timeStamp:performance.now(),[o,c,l,u,d]=Xm,f=I_(),p=!1===t.isComposing()&&f.getTextContent()===``;if(a<d+200&&n.offset===l&&n.key===u)eh(s,o,c);else if(n.type===`text`)H(r)||V(141),th(s,r);else if(n.type===`element`&&!p){G(r)||V(259);let e=n.getNode();e.isEmpty()?function(e,t){eh(e,t.getTextFormat(),t.getTextStyle())}(s,e):eh(s,0,``)}}else{let e=n.key,t=s.focus.key,r=s.getNodes(),a=r.length,c=s.isBackward(),l=c?o:i,u=c?i:o,d=c?t:e,f=c?e:t,p=2047,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(H(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}s.format=m?p:0}}K(t,qp,void 0)}))}function eh(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function th(e,t){eh(e,t.getFormat(),t.getStyle())}function nh(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function rh(e,t){let n=e._compositionKey;if(O_(null),n!==null&&t!=null){if(t===``){let t=A_(n),r=S_(e.getElementByKey(n));r!==null&&r.nodeValue!==null&&H(t)&&G_(t,r.nodeValue,null,null,!0);return}if(t[t.length-1]===`
15
- `){let t=W();if(U(t)){let n=t.focus;t.anchor.set(n.key,n.offset,n.type),K(e,mm,null);return}}}W_(!0,e,t)}function ih(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var ah=new Map;function oh(e){let t=Cv(e.target);if(t===null)return;let n=g_(t.anchorNode);if(n===null)return;Wm&&(Wm=!1,zg(n,(()=>{let r=ag(),i=t.anchorNode;(Tv(i)||b_(i))&&R_(ig(r,t,n,e))})));let r=V_(n),i=r[r.length-1],a=i._key,o=ah.get(a),s=o||i;s!==n&&$m(t,s,!1),$m(t,n,!0),n===i?o&&ah.delete(a):ah.set(a,n)}function sh(e){e._lexicalHandled=!0}function ch(e){return!0===e._lexicalHandled}function lh(e){let t=e.ownerDocument,n=Hm.get(t);if(n===void 0)return;let r=n-1;r>=0||V(164),Hm.set(t,r),r===0&&t.removeEventListener(`selectionchange`,oh);let i=__(e);h_(i)?(function(e){if(e._parentEditor!==null){let t=V_(e),n=t[t.length-1]._key;ah.get(n)===e&&ah.delete(n)}else ah.delete(e._key)}(i),e.__lexicalEditor=null):i&&V(198);let a=ih(e);for(let e=0;e<a.length;e++)a[e]();e.__lexicalEventHandles=[]}function uh(e,t,n){Cg();let r=e.__key,i=e.getParent();if(i===null)return;let a=function(e){let t=W();if(!U(t)||!G(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return dv(i,e)&&n.set(e.__key,0,`element`),dv(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(U(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(cg(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(cg(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else Wh(a)&&t&&e.isSelected()&&e.selectPrevious();if(U(a)&&t&&!o){let t=e.getIndexWithinParent();E_(e),og(a,i,t,-1)}else E_(e);n||hv(i)||i.canBeEmpty()||!i.isEmpty()||uh(i,t),t&&a&&qg(i)&&i.isEmpty()&&i.selectEnd()}function dh(e){return e}var fh=class{static getType(){let{ownNodeType:e}=Bv(this);return e===void 0&&V(64,this.name),e}static clone(e){V(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:n,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,`__state`,{configurable:!0,enumerable:!1,value:void 0,writable:!0}),T_(this,e)}getType(){return this.__type}isInline(){V(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=A_(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){let t=e||W();if(t==null)return!1;let n=t.getNodes().some((e=>e.__key===this.__key));if(H(this))return n;if(U(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(Gg(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:A_(e)}getParentOrThrow(){let e=this.getParent();return e===null&&V(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(hv(t))return G(e)||e===this&&Gg(e)||V(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&V(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:A_(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:A_(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=G(this)?this:this.getParent(),n=G(e)?e:e.getParent(),r=t&&n?_y(t,n):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=_y(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?my(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&V(279),!1)))}isParentOf(e){let t=_y(this,e);return t!==null&&t.type===`ancestor`}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set,i=this;for(;i!==null;){let a=i.__key;if(r.has(a)||(r.add(a),n.push(i)),i===e)break;let o=G(i)?t?i.getFirstChild():i.getLastChild():null;if(o!==null){i=o;continue}let s=t?i.getNextSibling():i.getPreviousSibling();if(s!==null){i=s;continue}let c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===e)break;let l=null,u=c;do{if(u===null&&V(68),l=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),u===null)break;l!==null||r.has(u.__key)||n.push(u)}while(l===null);i=l}return t||n.reverse(),n}isDirty(){let e=Eg()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){let e=A_(this.__key);return e===null&&V(113),e}getWritable(){Cg();let e=Tg(),t=Eg(),n=e._nodeMap,r=this.__key,i=this.getLatest(),a=t._cloneNotNeeded,o=W();if(o!==null&&o.setCachedNodes(null),a.has(r))return D_(i),i;let s=Iv(i);return a.add(r),D_(s),n.set(r,s),s}getTextContent(){return``}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){V(70)}updateDOM(e,t,n){V(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){V(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),r=t.$,i=r;for(let e of np(n).flatKeys)e in t&&(i!==void 0&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&tp(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){uh(this,!0,e)}replace(e,t){Cg();let n=W();n!==null&&(n=n.clone()),vv(this,e);let r=this.getLatest(),i=this.__key,a=e.__key,o=e.getWritable(),s=this.getParentOrThrow().getWritable(),c=s.__size;E_(o);let l=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,f=r.__next,p=r.__parent;if(uh(r,!1,!0),l===null?s.__first=a:l.getWritable().__next=a,o.__prev=d,u===null?s.__last=a:u.getWritable().__prev=a,o.__next=f,o.__parent=p,s.__size=c,t&&(G(this)&&G(o)||V(139),this.getChildren().forEach((e=>{o.append(e)}))),U(n)){R_(n);let e=n.anchor,t=n.focus;e.key===i&&Vh(e,o),t.key===i&&Vh(t,o)}return k_()===i&&O_(a),o}insertAfter(e,t=!0){Cg(),vv(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.getParent(),a=W(),o=!1,s=!1;if(i!==null){let t=e.getIndexWithinParent();if(E_(r),U(a)){let e=i.__key,n=a.anchor,r=a.focus;o=n.type===`element`&&n.key===e&&n.offset===t+1,s=r.type===`element`&&r.key===e&&r.offset===t+1}}let c=this.getNextSibling(),l=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(c===null?l.__last=u:c.getWritable().__prev=u,l.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&U(a)){let e=this.getIndexWithinParent();og(a,l,e+1);let t=l.__key;o&&a.anchor.set(t,e+2,`element`),s&&a.focus.set(t,e+2,`element`)}return e}insertBefore(e,t=!0){Cg(),vv(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.__key;E_(r);let a=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),s=n.__prev,c=this.getIndexWithinParent();a===null?o.__first=i:a.getWritable().__next=i,o.__size++,n.__prev=i,r.__prev=s,r.__next=n.__key,r.__parent=n.__parent;let l=W();return t&&U(l)&&og(l,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return r_()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Cg();let n=this.getPreviousSibling(),r=this.getParentOrThrow();if(n===null)return r.select(0,0);if(G(n))return n.select();if(!H(n)){let e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){Cg();let n=this.getNextSibling(),r=this.getParentOrThrow();if(n===null)return r.select();if(G(n))return n.select(0,0);if(!H(n)){let e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}},ph=class e extends fh{static getType(){return`linebreak`}static clone(t){return new e(t.__key)}constructor(e){super(e)}getTextContent(){return`
16
- `}createDOM(){return document.createElement(`br`)}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>function(e){let t=e.parentElement;if(t!==null&&kv(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&_h(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&_h(n))return!0}}return!1}(e)||function(e){let t=e.parentElement;if(t!==null&&kv(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&_h(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&_h(r))return!0}return!1}(e)?null:{conversion:mh,priority:0}}}static importJSON(e){return hh().updateFromJSON(e)}};function mh(e){return{node:hh()}}function hh(){return _v(new ph)}function gh(e){return e instanceof ph}function _h(e){return b_(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function vh(e,t){return 16&t?`code`:t&128?`mark`:32&t?`sub`:64&t?`sup`:null}function yh(e,t){return 1&t?`strong`:2&t?`em`:`span`}function bh(e,t,n,r,i){let a=r.classList,o=tv(i,`base`);o!==void 0&&a.add(...o),o=tv(i,`underlineStrikethrough`);let s=!1,c=t&8&&t&4;o!==void 0&&(n&8&&n&4?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in Pf){let r=Pf[e];if(o=tv(i,e),o!==void 0)if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}t&r&&(!c||e!==`underline`)&&e!==`strikethrough`||a.add(...o)}else t&r&&a.remove(...o)}}function xh(e,t,n){let r=t.firstChild,i=n.isComposing(),a=e+(i?jf:``);if(r==null)t.textContent=a;else{let e=r.nodeValue;if(e!==a)if(i||of){let[t,n,i]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(e,a);n!==0&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=a}}function Sh(e,t,n,r,i,a){xh(i,e,t);let o=a.theme.text;o!==void 0&&bh(0,0,r,e,o)}function Ch(e,t){let n=document.createElement(t);return n.appendChild(e),n}var wh=class e extends fh{static getType(){return`text`}static clone(t){return new e(t.__text,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return zf[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===k_()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=Pf[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type===`text`&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return C_(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=vh(0,n),i=yh(0,n),a=r===null?i:r,o=document.createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=document.createElement(i),o.appendChild(s)),Sh(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&(o.style.cssText=c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=vh(0,i),s=vh(0,a),c=yh(0,i),l=yh(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??V(48);let i=document.createElement(l);return Sh(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??V(49)),xh(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&bh(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:kh,priority:0}),b:()=>({conversion:Eh,priority:0}),code:()=>({conversion:Mh,priority:0}),em:()=>({conversion:Mh,priority:0}),i:()=>({conversion:Mh,priority:0}),mark:()=>({conversion:Mh,priority:0}),s:()=>({conversion:Mh,priority:0}),span:()=>({conversion:Th,priority:0}),strong:()=>({conversion:Mh,priority:0}),sub:()=>({conversion:Mh,priority:0}),sup:()=>({conversion:Mh,priority:0}),u:()=>({conversion:Mh,priority:0})}}static importJSON(e){return Nh().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return Tv(t)||V(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=Ch(t,`b`)),this.hasFormat(`italic`)&&(t=Ch(t,`i`)),this.hasFormat(`strikethrough`)&&(t=Ch(t,`s`)),this.hasFormat(`underline`)&&(t=Ch(t,`u`)),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?Pf[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?Ff[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=C_(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=Rf[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){Cg();let n=e,r=t,i=W(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!U(i))return tg(o,n,o,r,`text`,`text`);{let e=k_();e!==i.anchor.key&&e!==i.focus.key||O_(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=W();if(r&&U(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Cg();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=k_(),a=n.length;e.sort(((e,t)=>e-t)),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=W();if(U(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=Nh(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=op(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=Nh(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=op(t,n);let a=n.__key;i===r&&O_(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&D_(t),n!==null&&D_(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),U(v)&&og(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||V(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;k_()===r&&O_(n);let o=W();if(U(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&lg(i,t,n,e,a),s!==null&&s.key===r&&lg(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function Th(e){return{forChild:Ph(e.style),node:null}}function Eh(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:Ph(t.style,n?void 0:`bold`),node:null}}var Dh=new WeakMap;function Oh(e){if(!Tv(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function kh(e){let t=e;e.parentElement===null&&V(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=Dh.get(n))===void 0&&!Oh(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)Dh.set(r[e],i);return i}(t)!==null){let e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){let r=e[n];r===`
17
- `||r===`\r
18
- `?t.push(hh()):r===` `?t.push(Ih()):r!==``&&t.push(Nh(r))}return{node:t}}if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=Ah(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=Ah(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:Nh(n)}}function Ah(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,Tv(n)){let e=n.style.display;if(e===``&&!Ov(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(b_(n))return n;if(n.nodeName===`BR`)return null}}var jh={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function Mh(e){let t=jh[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Ph(e.style,t),node:null}}function Nh(e=``){return _v(new wh(e))}function H(e){return e instanceof wh}function Ph(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign;return e=>H(e)?(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}var Fh=class e extends wh{static getType(){return`tab`}static clone(t){return new e(t.__key)}constructor(e){super(` `,e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=tv(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}static importJSON(e){return Ih().updateFromJSON(e)}setTextContent(e){return e!==` `&&e!==``&&V(126),super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||V(286),this}setDetail(e){return e!==2&&V(127),this}setMode(e){return e!==`normal`&&V(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function Ih(){return _v(new Fh)}function Lh(e){return e instanceof Fh}var Rh=class{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:py(Dy(vy(this,`next`)),Dy(vy(e,`next`)))<0}getNode(){let e=A_(this.key);return e===null&&V(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,Sg()||(k_()===a&&O_(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}};function zh(e,t,n){return new Rh(e,t,n)}function Bh(e,t){let n=t.__key,r=e.offset,i=`element`;if(H(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!G(t)){let e=t.getNextSibling();if(H(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function Vh(e,t){if(G(t)){let n=t.getLastDescendant();G(n)||H(n)?Bh(e,n):Bh(e,t)}else Bh(e,t)}var Hh=class e{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Wh(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes(),n=t.length,r=t[n-1],i;if(H(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=A_(e);t!==null&&n.push(t)}return Sg()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes();if((W()||ag())===this&&e[0]){let t=ey(e[0],`next`);by(dy(t,t))}for(let t of e)t.remove()}};function U(e){return e instanceof Uh}var Uh=class e{constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!U(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=new Set;for(let n of e)if(Xv(n)){let{origin:e}=n;t.length===0?i.add(e):(a.add(e),t.push(e))}else{let{origin:e}=n;G(e)&&a.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),Yv(e.focus)&&G(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=iy(e.focus.origin,`previous`);Xv(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=oy(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!G(e)||a.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=Dy(e.anchor),r=Dy(e.anchor.getFlipped()),i=e=>Jv(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(Ay(Sy(this),`next`));return Sg()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`)}getTextContent(){let e=this.getNodes();if(e.length===0)return``;let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,a=r.isBefore(i),[o,s]=Kh(this),c=``,l=!0;for(let u=0;u<e.length;u++){let d=e[u];if(G(d)&&!d.isInline())l||(c+=`
19
- `),l=!d.isEmpty();else if(l=!1,H(d)){let e=d.getTextContent();d===t?d===n?r.type===`element`&&i.type===`element`&&i.offset!==r.offset||(e=o<s?e.slice(o,s):e.slice(s,o)):e=a?e.slice(o):e.slice(s):d===n&&(e=a?e.slice(0,s):e.slice(0,o)),c+=e}else !Gg(d)&&!gh(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){let t=Eg(),n=t.getEditorState()._selection,r=$h(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),up(this)}clone(){let t=this.anchor,n=this.focus;return new e(zh(t.key,t.offset,t.type),zh(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=C_(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=Pf[e];return!!(this.format&t)}insertRawText(e){let t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){let r=t[e];r===`
20
- `||r===`\r
21
- `?n.push(hh()):r===` `?n.push(Ih()):n.push(Nh(r))}this.insertNodes(n)}insertText(e){let t=this.anchor,n=this.focus,r=this.format,i=this.style,a=t,o=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,o=t),a.type===`element`&&function(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=Nh();if(o.setFormat(n),o.setStyle(r),i_(a))a.splice(0,0,[o]);else{let e=qg(i)?r_().append(o):o;a===null?i.append(e):a.insertBefore(e)}e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}(a,o,r,i),o.type===`element`&&yy(o,Dy(vy(o,`next`)));let s=a.offset,c=o.offset,l=this.getNodes(),u=l.length,d=l[0];H(d)||V(26);let f=d.getTextContent().length,p=d.getParentOrThrow(),m=l[u-1];if(u===1&&o.type===`element`&&(c=f,o.set(a.key,c,`text`)),this.isCollapsed()&&s===f&&(y_(d)||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&d.getNextSibling()===null)){let t=d.getNextSibling();if(H(t)&&t.canInsertTextBefore()&&!y_(t)||(t=Nh(),t.setFormat(r),t.setStyle(i),p.canInsertTextAfter()?d.insertAfter(t):p.insertAfter(t)),t.select(0,0),d=t,e!==``)return void this.insertText(e)}else if(this.isCollapsed()&&s===0&&(y_(d)||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&d.getPreviousSibling()===null)){let t=d.getPreviousSibling();if(H(t)&&!y_(t)||(t=Nh(),t.setFormat(r),p.canInsertTextBefore()?d.insertBefore(t):p.insertBefore(t)),t.select(),d=t,e!==``)return void this.insertText(e)}else if(d.isSegmented()&&s!==f){let e=Nh(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&e!==``){let t=m.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||G(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(``),Qh(this.anchor,this.focus,null),void this.insertText(e)}if(u===1){if(v_(d)){let t=Nh(e);t.select(),d.replace(t);return}let t=d.getFormat(),n=d.getStyle();if(s!==c||t===r&&n===i){if(Lh(d)){let t=Nh(e);t.setFormat(r),t.setStyle(i),t.select(),d.replace(t);return}}else{if(d.getTextContent()!==``){let t=Nh(e);if(t.setFormat(r),t.setStyle(i),t.select(),s===0)d.insertBefore(t,!1);else{let[e]=d.splitText(s);e.insertAfter(t,!1)}t.isComposing()&&this.anchor.type===`text`&&(this.anchor.offset-=e.length);return}d.setFormat(r),d.setStyle(i)}let a=c-s;d=d.spliceText(s,a,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=t,this.style=n))}else{let t=new Set([...d.getParentKeys(),...m.getParentKeys()]),n=G(d)?d:d.getParentOrThrow(),r=G(m)?m:m.getParentOrThrow(),i=m;if(!n.is(r)&&r.isInline())do i=r,r=r.getParentOrThrow();while(r.isInline());if(o.type===`text`&&(c!==0||m.getTextContent()===``)||o.type===`element`&&m.getIndexWithinParent()<c)if(H(m)&&!v_(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){let e=Nh(m.getTextContent());m.replace(e),m=e}qg(o.getNode())||o.type!==`text`||(m=m.spliceText(0,c,``)),t.add(m.__key)}else{let e=m.getParentOrThrow();e.canBeEmpty()||e.getChildrenSize()!==1?m.remove():e.remove()}else t.add(m.__key);let a=r.getChildren(),p=new Set(l),h=n.is(r),g=n.isInline()&&d.getNextSibling()===null?n:d;for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.is(d)||G(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(i)?h||g.insertAfter(t,!1):t.remove())}if(!h){let e=r,n=null;for(;e!==null;){let r=e.getChildren(),i=r.length;(i===0||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(v_(d))if(s===f)d.select();else{let t=Nh(e);t.select(),d.replace(t)}else d=d.spliceText(s,f-s,e,!0),d.getTextContent()===``?d.remove():d.isComposing()&&this.anchor.type===`text`&&(this.anchor.offset-=e.length);for(let e=1;e<u;e++){let n=l[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){let e=W()===this;xy(this,Ey(Sy(this))),e&&W()!==this&&R_(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void O_(null);let n=this.getNodes(),r=[];for(let e of n)H(e)&&r.push(e);let i=t=>{n.forEach((n=>{if(G(n)){let r=n.getFormatFlags(e,t);n.setTextFormat(r)}}))},a=r.length;if(a===0)return this.toggleFormat(e),O_(null),void i(t);let o=this.anchor,s=this.focus,c=this.isBackward(),l=c?s:o,u=c?o:s,d=0,f=r[0],p=l.type===`element`?0:l.offset;if(l.type===`text`&&p===f.getTextContentSize()&&(d=1,f=r[1],p=0),f==null)return;let m=f.getFormatFlags(e,t);i(m);let h=a-1,g=r[h],_=u.type===`text`?u.offset:g.getTextContentSize();if(f.is(g)){if(p===_)return;if(y_(f)||p===0&&_===f.getTextContentSize())f.setFormat(m);else{let e=f.splitText(p,_),t=p===0?e[0]:e[1];t.setFormat(m),l.type===`text`&&l.set(t.__key,0,`text`),u.type===`text`&&u.set(t.__key,_-p,`text`)}this.format=m;return}p===0||y_(f)||([,f]=f.splitText(p),p=0),f.setFormat(m);let v=g.getFormatFlags(e,m);_>0&&(_===g.getTextContentSize()||y_(g)||([g]=g.splitText(_)),g.setFormat(v));for(let t=d+1;t<h;t++){let n=r[t],i=n.getFormatFlags(e,v);n.setFormat(i)}l.type===`text`&&l.set(f.__key,p,`text`),u.type===`text`&&u.set(g.__key,_,`text`),this.format=m|v}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key===`root`){this.insertParagraph();let t=W();return U(t)||V(134),t.insertNodes(e)}let t=(this.isBackward()?this.focus:this.anchor).getNode(),n=jv(t,Av),r=e[e.length-1];if(G(n)&&`__language`in n){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let t=pg(this);n.splice(t,0,e),r.selectEnd()}return}if(!e.some((e=>(G(e)||Gg(e))&&!e.isInline()))){G(n)||V(211,t.constructor.name,t.getType());let i=pg(this);n.splice(i,0,e),r.selectEnd();return}let i=function(e){let t=r_(),n=null;for(let r=0;r<e.length;r++){let i=e[r],a=gh(i);if(a||Gg(i)&&i.isInline()||G(i)&&i.isInline()||H(i)||i.isParentRequired()){if(n===null&&(n=i.createParentElementNode(),t.append(n),a))continue;n!==null&&n.append(i)}else t.append(i),n=null}return t}(e),a=i.getLastDescendant(),o=i.getChildren(),s=!G(n)||!n.isEmpty()?this.insertParagraph():null,c=o[o.length-1],l=o[0];var u;G(u=l)&&Av(u)&&!u.isEmpty()&&G(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(G(n)||V(211,t.constructor.name,t.getType()),n.append(...l.getChildren()),l=o[1]),l&&(n===null&&V(212,t.constructor.name,t.getType()),function(e,t,n){let r=t.getParentOrThrow().getLastChild(),i=t,a=[t];for(;i!==r;)i.getNextSibling()||V(140),i=i.getNextSibling(),a.push(i);let o=e;for(let e of a)o=o.insertAfter(e)}(n,l));let d=jv(a,Av);s&&G(d)&&(s.canMergeWhenEmpty()||Av(c))&&(d.append(...s.getChildren()),s.remove()),G(n)&&n.isEmpty()&&n.remove(),a.selectEnd();let f=G(n)?n.getLastChild():null;gh(f)&&d!==n&&f.remove()}insertParagraph(){if(this.anchor.key===`root`){let e=r_();return I_().splice(this.anchor.offset,0,[e]),e.select(),e}let e=pg(this),t=jv(this.anchor.getNode(),Av);G(t)||V(213);let n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(e){let t=hh();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=this.getNodes(),t=e.length,n=t-1,r=this.anchor,i=this.focus,a=e[0],o=e[n],[s,c]=Kh(this);if(t===0)return[];if(t===1){if(H(a)&&!this.isCollapsed()){let e=s>c?c:s,t=s>c?s:c,n=a.splitText(e,t),r=e===0?n[0]:n[1];return r==null?[]:[r]}return[a]}let l=r.isBefore(i);if(H(a)){let t=l?s:c;t===a.getTextContentSize()?e.shift():t!==0&&([,a]=a.splitText(t),e[0]=a)}if(H(o)){let t=o.getTextContent().length,r=l?c:s;r===0?e.pop():r!==t&&([o]=o.splitText(r),e[n]=o)}return e}modify(e,t,n){if(hg(this,e,t,n))return;let r=e===`move`,i=Eg(),a=Sv(pv(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();if(s===null||o===null||!G(c)||c.isInline()||c.canBeEmpty()||xv(o,i,s),this.dirty){let e=sv(i,this.anchor.key),t=sv(i,this.focus.key);this.anchor.type===`text`&&(e=S_(e)),this.focus.type===`text`&&(t=S_(t)),e&&t&&ug(a,e,this.anchor.offset,t,this.focus.offset)}if(function(e,t,n,r){e.modify(t,n,r)}(a,e,t?`backward`:`forward`,n),a.rangeCount>0){let e=a.getRangeAt(0),n=this.anchor.getNode(),i=qg(n)?n:mv(n);if(this.applyDOMRange(e),this.dirty=!0,!r){let n=this.getNodes(),r=[],o=!1;for(let e=0;e<n.length;e++){let t=n[e];dv(t,i)?r.push(t):o=!0}if(o&&r.length>0)if(t){let e=r[0];G(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{let e=r[r.length-1];G(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}a.anchorNode===e.startContainer&&a.anchorOffset===e.startOffset||function(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}(this)}}n===`lineboundary`&&hg(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&G(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(G(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let r=ly(vy(t,e?`previous`:`next`));if(r.getTextSlices().every((e=>e===null||e.distance===0))){let e={type:`initial`};for(let t of r.iterNodeCarets(`shadowRoot`))if(Xv(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(G(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=Dy(t);xy(this,dy(e,e)),r.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(Yv(t)){if(G(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(Gg(t.origin)){if(!t.origin.isIsolated())if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&G(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=rg();e.add(t.origin.getKey()),R_(e)}else t.origin.remove();return}break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return xy(this,dy(!t.origin.isEmpty()&&n.isEmpty()?Cy(ey(n,t.direction)):r.anchor,t)),this.removeText()}}let i=this.focus;if(this.modify(`extend`,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&qh(this,t.getNode()))return}else{let r=i.type===`text`?i.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=i.offset,a=r.getTextContentSize();if(r.is(n)||e&&t!==a||!e&&t!==0)return void Yh(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void Yh(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,a=r.offset,o=e<a,s=o?e:a,c=o?a:e,l=c-1;s!==l&&(function(e){return!(B_(e)||Jh(e))})(i.getTextContent().slice(s,c))&&(t?r.set(r.key,l,r.type):n.set(n.key,l,n.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0){let e=this.anchor.getNode();e.isEmpty()&&qg(e.getParent())&&e.getPreviousSibling()===null&&qh(this,e)}}deleteLine(e){this.isCollapsed()&&this.modify(`extend`,e,`lineboundary`),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify(`extend`,e,`word`)}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function Wh(e){return e instanceof Hh}function Gh(e){let t=e.offset;if(e.type===`text`)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Kh(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,r]=t;return n.type===`element`&&r.type===`element`&&n.key===r.key&&n.offset===r.offset?[0,0]:[Gh(n),Gh(r)]}function qh(e,t){for(let n=t;n;n=n.getParent()){if(G(n)){if(n.collapseAtStart(e))return!0;if(hv(n))break}if(n.getPreviousSibling())break}return!1}var Jh=(()=>{try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1})();function Yh(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function Xh(e,t,n,r){let i,a=t;if(Tv(e)){let o=!1,s=e.childNodes,c=s.length,l=r._blockCursorElement;a===c&&(o=!0,a=c-1);let u=s[a],d=!1;if(u===l)u=s[a+1],d=!0;else if(l!==null){let n=l.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,l)&&a--}if(i=z_(u),H(i))a=ny(i,o?`next`:`previous`);else{let s=z_(e);if(s===null)return null;if(G(s)){let c=r.getElementByKey(s.getKey());c===null&&V(214);let l=s.getDOMSlot(c);[s,a]=l.resolveChildIndex(s,c,e,t),G(s)||V(215),o&&a>=s.getChildrenSize()&&(a=Math.max(0,s.getChildrenSize()-1));let u=s.getChildAtIndex(a);if(G(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=o?u.getLastDescendant():u.getFirstDescendant();e===null?s=u:(u=e,s=G(u)?u:u.getParentOrThrow()),a=0}H(u)?(i=u,s=null,a=ny(u,o?`next`:`previous`)):u!==s&&o&&!d&&(G(s)||V(216),a=Math.min(s.getChildrenSize(),a+1))}else{let n=s.getIndexWithinParent();a=t===0&&Gg(s)&&z_(e)===s?n:n+1,s=s.getParentOrThrow()}if(G(s))return zh(s.__key,a,`element`)}}else i=z_(e);return H(i)?zh(i.__key,ny(i,a,`clamp`),`text`):null}function Zh(e,t,n){let r=e.offset,i=e.getNode();if(r===0){let r=i.getPreviousSibling(),a=i.getParent();if(t){if((n||!t)&&r===null&&G(a)&&a.isInline()){let t=a.getPreviousSibling();H(t)&&e.set(t.__key,t.getTextContent().length,`text`)}}else G(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),`element`):H(r)&&e.set(r.__key,r.getTextContent().length,`text`)}else if(r===i.getTextContent().length){let r=i.getNextSibling(),a=i.getParent();if(t&&G(r)&&r.isInline())e.set(r.__key,0,`element`);else if((n||t)&&r===null&&G(a)&&a.isInline()&&!a.canInsertTextAfter()){let t=a.getNextSibling();H(t)&&e.set(t.__key,0,`text`)}}}function Qh(e,t,n){if(e.type===`text`&&t.type===`text`){let r=e.isBefore(t),i=e.is(t);Zh(e,r,i),Zh(t,!r,i),i&&t.set(e.key,e.offset,e.type);let a=Eg();if(a.isComposing()&&a._compositionKey!==e.key&&U(n)){let r=n.anchor,i=n.focus;e.set(r.key,r.offset,r.type,!0),t.set(i.key,i.offset,i.type,!0)}}}function $h(e,t,n,r,i,a){if(e===null||n===null||!m_(i,e,n))return null;let o=Xh(e,t,U(a)?a.anchor:null,i);if(o===null)return null;let s=Xh(n,r,U(a)?a.focus:null,i);if(s===null)return null;if(o.type===`element`&&s.type===`element`){let t=z_(e),r=z_(n);if(Gg(t)&&Gg(r))return null}return Qh(o,s,a),[o,s]}function eg(e){return G(e)&&!e.isInline()}function tg(e,t,n,r,i,a){let o=Tg(),s=new Uh(zh(e,t,i),zh(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function ng(){return new Uh(zh(`root`,0,`element`),zh(`root`,0,`element`),0,``)}function rg(){return new Hh(new Set)}function ig(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=!Uf&&(s||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),l,u,d,f;if(U(e)&&!c)return e.clone();if(t===null)return null;if(l=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,s&&U(e)&&!m_(n,l,u))return e.clone();let p=$h(l,d,u,f,n,e);if(p===null)return null;let[m,h]=p;return new Uh(m,h,U(e)?e.format:0,U(e)?e.style:``)}function W(){return Tg()._selection}function ag(){return Eg()._editorState._selection}function og(e,t,n,r=1){let i=e.anchor,a=e.focus,o=i.getNode(),s=a.getNode();if(!t.is(o)&&!t.is(s))return;let c=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);i.set(c,n,`element`),a.set(c,n,`element`),sg(e)}}else{let o=e.isBackward(),s=o?a:i,l=s.getNode(),u=o?i:a,d=u.getNode();if(t.is(l)){let e=s.offset;(n<=e&&r>0||n<e&&r<0)&&s.set(c,Math.max(0,e+r),`element`)}if(t.is(d)){let e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(c,Math.max(0,e+r),`element`)}}sg(e)}function sg(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,a=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!G(a))return;let e=a.getChildrenSize(),i=n>=e,o=i?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(H(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,`text`),r.set(o.__key,e,`text`)}}else{if(G(a)){let e=a.getChildrenSize(),r=n>=e,i=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(H(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,`text`)}}if(G(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(H(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,`text`)}}}}function cg(e,t,n,r,i){let a=null,o=0,s=null;r===null?i!==null&&(a=i.__key,H(i)?s=`text`:G(i)&&(s=`element`)):(a=r.__key,H(r)?(o=r.getTextContentSize(),s=`text`):G(r)&&(o=r.getChildrenSize(),s=`element`)),a!==null&&s!==null?e.set(a,o,s):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),e.set(n.__key,o,`element`))}function lg(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function ug(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function dg(e,t,n,r,i,a,o){let s=r.anchorNode,c=r.focusNode,l=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has(`collaboration`)&&d!==a||d!==null&&p_(d))return;if(!U(t))return void(e!==null&&m_(n,s,c)&&r.removeAllRanges());let f=t.anchor,p=t.focus,m=f.key,h=p.key,g=sv(n,m),_=sv(n,h),v=f.offset,y=p.offset,b=t.format,x=t.style,S=t.isCollapsed(),C=g,w=_,T=!1;if(f.type===`text`){C=S_(g);let e=f.getNode();T=e.getFormat()!==b||e.getStyle()!==x}else U(e)&&e.anchor.type===`text`&&(T=!0);var E,D,O,k,A;if((p.type===`text`&&(w=S_(_)),C!==null&&w!==null)&&(S&&(e===null||T||U(e)&&(e.format!==b||e.style!==x))&&(E=b,D=x,O=v,k=m,A=performance.now(),Xm=[E,D,O,k,A]),l!==v||u!==y||s!==C||c!==w||r.type===`Range`&&S||(d!==null&&a.contains(d)||a.focus({preventScroll:!0}),f.type===`element`))){if(ug(r,C,v,w,y),!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===document.activeElement){let e=U(t)&&t.anchor.type===`element`?C.childNodes[v]||null:r.rangeCount>0?r.getRangeAt(0):null;if(e!==null){let t;if(e instanceof Text){let n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();(function(e,t,n){let r=lv(n),i=fv(r);if(r===null||i===null)return;let{top:a,bottom:o}=t,s=0,c=0,l=n;for(;l!==null;){let t=l===r.body;if(t)s=0,c=pv(e).innerHeight;else{let e=l.getBoundingClientRect();s=e.top,c=e.bottom}let n=0;if(a<s?n=-(s-a):o>c&&(n=o-c),n!==0)if(t)i.scrollBy(0,n);else{let e=l.scrollTop;l.scrollTop+=n;let t=l.scrollTop-e;a-=t,o-=t}if(t)break;l=cv(l)}})(n,t,a)}}Um=!0}}function fg(e){let t=W()||ag();t===null&&(t=I_().selectEnd()),t.insertNodes(e)}function pg(e){let t=e;e.isCollapsed()||t.removeText();let n=W();U(n)&&(t=n),U(t)||V(161);let r=t.anchor,i=r.getNode(),a=r.offset;for(;!Av(i);){let e=i;if([i,a]=mg(i,a),e.is(i))break}return a}function mg(e,t){let n=e.getParent();if(!n){let e=r_();return I_().append(e),e.select(),[I_(),0]}if(H(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let i=t===0?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!G(e)||t===0)return[n,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let n=new Uh(zh(e.__key,t,`element`),zh(e.__key,t,`element`),0,``),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function hg(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=vy(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`;if(!Oy(c)){for(let e of c){l=!1;let{origin:t}=e;if(!Gg(t)||t.isIsolated()||(c=e,!o||!t.isInline()))break}if(l)for(let e of ly(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(Xv(e))e.origin.isInline()||(c=e);else{if(G(e.origin))continue;Gg(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&Gg(c.origin)&&c.origin.isKeyboardSelectable()){let e=rg();return e.add(c.origin.getKey()),R_(e),!0}return c=Dy(c),s&&yy(e.anchor,c),yy(e.focus,c),l||!o}var gg=null,_g=null,vg=!1,yg=!1,bg=0,xg={characterData:!0,childList:!0,subtree:!0};function Sg(){return vg||gg!==null&&gg._readOnly}function Cg(){vg&&V(13)}function wg(){bg>99&&V(14)}function Tg(){return gg===null&&V(195,Dg()),gg}function Eg(){return _g===null&&V(196,Dg()),_g}function Dg(){let e=0,t=new Set,n=s_.version;if(typeof window<`u`)for(let r of document.querySelectorAll(`[contenteditable]`)){let i=__(r);if(h_(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function Og(){return _g}function kg(e,t,n){let r=t.__type,i=u_(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function Ag(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function jg(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function Mg(e){return Ng(e,Eg()._nodes)}function Ng(e,t){let n=e.type,r=t.get(n);r===void 0&&V(17,n);let i=r.klass;e.type!==i.getType()&&V(18,i.name);let a=i.importJSON(e),o=e.children;if(G(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=Ng(o[e],t);a.append(n)}return a}function Pg(e,t,n){let r=gg,i=vg,a=_g;gg=t,vg=!0,_g=e;try{return n()}finally{gg=r,vg=i,_g=a}}function Fg(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return;let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==yf,l=gg,u=vg,d=_g,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){_g=e,gg=n,vg=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=Wp(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),yg)throw t;a_(e,null,r,n),Qf(e),e._dirtyType=xf,yg=!0,Fg(e,a),yg=!1;return}finally{p.observe(r,xg),e._updating=f,gg=l,vg=u,_g=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags,y=e._deferred;c&&(e._dirtyType=yf,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=P_(e)),delete r[a])}(e,n);let b=i?null:Sv(pv(e));if(e._editable&&b!==null&&(c||s===null||s.dirty)&&r!==null&&!v.has(`skip-dom-selection`)){_g=e,gg=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&xv(t,e,r),dg(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(U(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(document.activeElement)){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())bv(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);if(t!==null&&bv(t)){let n=t.getPreviousSibling();(n===null||bv(n))&&(s=!0,c=e.getElementByKey(t.__key))}}if(s){let n=e.getElementByKey(a.__key);r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=document.createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=mf(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&xv(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,xg),_g=d,gg=l}}m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a),U(s)||s===null||o!==null&&o.is(s)||e.dispatchCommand(qp,void 0);let x=e._pendingDecorators;x!==null&&(e._decorators=x,e._pendingDecorators=null,Ig(`decorator`,e,!0,x)),function(e,t,n){let r=F_(t),i=F_(n);r!==i&&Ig(`textcontent`,e,!0,i)}(e,t||a,n),Ig(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v}),function(e,t){if(e._deferred=[],t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,y),function(e){let t=e._updates;if(t.length!==0){let n=t.shift();if(n){let[t,r]=n;Rg(e,t,r)}}}(e)}function Ig(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=Array.from(t._listeners[e]);for(let e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=i}}function Lg(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&V(191),a._flushSync=!0),o&&e._deferred.push(o),jg(e,i.tag)),a==null?Rg(e,n,i):n()}}return r}function Rg(e,t,n){let r=e._updateTags,i,a=!1,o=!1;n!==void 0&&(i=n.onUpdate,jg(e,n.tag),a=n.skipTransforms||!1,o=n.discrete||!1),i&&e._deferred.push(i);let s=e._editorState,c=e._pendingEditorState,l=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=Jg(c||s),l=!0),c._flushSync=o;let u=gg,d=vg,f=_g,p=e._updating;gg=c,vg=!1,e._updating=!0,_g=e;let m=e._headless||e.getRootElement()===null;l_(null);try{l&&(m?s._selection!==null&&(c._selection=s._selection.clone()):c._selection=function(e,t){let n=e.getEditorState()._selection,r=Sv(pv(e));return U(n)||n==null?ig(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),a=Lg(e,a),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(U(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(c,e),e._dirtyType!==yf&&(a?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);H(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&lp(t)}}(c,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=k_(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);H(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&lp(r),r!==void 0&&Ag(r,a)&&kg(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){bg++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&Ag(c,a)&&kg(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,bg++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),Lg(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(G(t)&&Vf(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of o)a.delete(e);for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(i.has(e)||n.delete(e),a.delete(e))}}(s,c,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(c._flushSync=!0);let i=c._selection;if(U(i)){let e=c._nodeMap,t=i.anchor.key,n=i.focus.key;e.get(t)!==void 0&&e.get(n)!==void 0||V(19)}else Wh(i)&&i._nodes.size===0&&(c._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=xf,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),Fg(e);return}finally{gg=u,vg=d,_g=f,e._updating=p,bg=0}e._dirtyType!==yf||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(c,e)?c._flushSync?(c._flushSync=!1,Fg(e)):l&&iee((()=>{Fg(e)})):(c._flushSync=!1,l&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function zg(e,t,n){_g===e&&n===void 0?t():Rg(e,t,n)}var Bg=class e{constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&V(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&V(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&V(224),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{let t=e===`decorator`&&(lf||cf);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName===`IMG`?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName===`IMG`))return;this.removeManagedLineBreak()}let n=this.element,r=this.before,i=document.createElement(`br`);if(n.insertBefore(i,r),e){let e=document.createElement(`img`);e.setAttribute(`data-lexical-linebreak`,`true`),e.style.cssText=`display: inline !important; border: 0px !important; margin: 0px !important;`,e.alt=``,n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,r))]}let i=Vg(t,n);i.push(r);let a=Vg(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function Vg(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&V(225),n.reverse()}var Hg=class extends fh{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return Lf[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let e=Eg()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;t!==null;){if(H(t)&&e.push(t),G(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;G(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;G(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return G(e)&&e.getLastDescendant()||e||null}let r=t[e];return G(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:A_(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&V(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:A_(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&V(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=``,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),G(i)&&r!==n-1&&!i.isInline()&&(e+=Mf)}return e}getTextContentSize(){let e=0,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),G(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=If[e];return!!(this.getFormat()&t)}return!1}hasTextFormat(e){let t=Pf[e];return!!(this.getTextFormat()&t)}getFormatFlags(e,t){return C_(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Cg();let n=W(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(H(e)||G(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(H(e)||G(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return U(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):tg(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach((e=>e.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e===``?0:If[e],this}setStyle(e){return this.getWritable().__style=e||``,this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){let r=n.length,i=this.getChildrenSize(),a=this.getWritable();e+t<=i||V(226,String(e),String(t),String(i));let o=a.__key,s=[],c=[],l=this.getChildAtIndex(e+t),u=null,d=i-t+r;if(e!==0)if(e===i)u=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(u=t.getPreviousSibling())}if(t>0){let e=u===null?this.getFirstChild():u.getNextSibling();for(let n=0;n<t;n++){e===null&&V(100);let t=e.getNextSibling(),n=e.__key;E_(e.getWritable()),c.push(n),e=t}}let f=u;for(let e=0;e<r;e++){let t=n[e];f!==null&&t.is(f)&&(u=f=f.getPreviousSibling());let r=t.getWritable();r.__parent===o&&d--,E_(r);let i=t.__key;if(f===null)a.__first=i,r.__prev=null;else{let e=f.getWritable();e.__next=i,r.__prev=e.__key}t.__key===o&&V(76),r.__parent=o,s.push(i),f=t}if(e+t===i)f!==null&&(f.getWritable().__next=null,a.__last=f.__key);else if(l!==null){let e=l.getWritable();if(f!==null){let t=f.getWritable();e.__prev=f.__key,t.__next=l.__key}else e.__prev=null}if(a.__size=d,c.length){let e=W();if(U(e)){let t=new Set(c),n=new Set(s),{anchor:r,focus:i}=e;Ug(r,t,n)&&cg(r,r.getNode(),this,u,l),Ug(i,t,n)&&cg(i,i.getNode(),this,u,l),d!==0||this.canBeEmpty()||hv(this)||this.remove()}}return a}getDOMSlot(e){return new Bg(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(Tv(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return t!==0&&(e.textFormat=t),n!==``&&(e.textStyle=n),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||``)}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=this.getDOMSlot(e),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());i!==null&&(r==null?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}};function G(e){return e instanceof Hg}function Ug(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var Wg=class extends fh{decorate(e,t){V(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Gg(e){return e instanceof Wg}var Kg=class e extends Hg{static getType(){return`root`}static clone(){return new e}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){V(51)}getTextContent(){let e=this.__cachedText;return!Sg()&&Eg()._dirtyType!==yf||e===null?super.getTextContent():e}remove(){V(52)}replace(e){V(53)}insertBefore(e){V(54)}insertAfter(e){V(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)G(e)||Gg(e)||V(282);return super.splice(e,t,n)}static importJSON(e){return I_().updateFromJSON(e)}collapseAtStart(){return!0}};function qg(e){return e instanceof Kg}function Jg(e){return new Zg(new Map(e._nodeMap))}function Yg(){return new Zg(new Map([[`root`,new Kg]]))}function Xg(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&V(130,n.name),G(e)){let r=t.children;Array.isArray(r)||V(59,n.name);let i=e.getChildren();for(let e=0;e<i.length;e++){let t=Xg(i[e]);r.push(t)}}return t}var Zg=class e{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Pg(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return Pg(null,this,(()=>({root:Xg(I_())})))}},Qg=`history-push`,$g=`history-merge`,e_=class extends Hg{static getType(){return`artificial`}createDOM(e){return document.createElement(`div`)}},t_=class e extends Hg{static getType(){return`paragraph`}static clone(t){return new e(t.__key)}createDOM(e){let t=document.createElement(`p`),n=tv(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:n_,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Tv(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return r_().updateFromJSON(e)}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle()}}insertNewAfter(e,t){let n=r_();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(e.length===0||H(e[0])&&e[0].getTextContent().trim()===``){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function n_(e){let t=r_();return e.style&&(t.setFormat(e.style.textAlign),Lv(e,t)),{node:t}}function r_(){return _v(new t_)}function i_(e){return e instanceof t_}function a_(e,t,n,r){let i=e._keyToDOMMap;i.clear(),e._editorState=Yg(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=yf,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let a=e._observer;a!==null&&(a.disconnect(),e._observer=null),t!==null&&(t.textContent=``),n!==null&&(n.textContent=``,i.set(`root`,n))}function o_(e){let t=e||{},n=Og(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=Yg(),s=t.namespace||(i===null?H_():i._config.namespace),c=t.editorState,l=[Kg,wh,ph,Fh,t_,e_,...t.nodes||[]],{onError:u,html:d}=t,f=t.editable===void 0||t.editable,p;if(e===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let e=0;e<l.length;e++){let t=l[e],n=null,r=null;if(typeof t!=`function`){let e=t;t=e.replace,n=e.with,r=e.withKlass||null}let{ownNodeConfig:i}=Bv(t),a=t.getType(),o=t.transform(),s=new Set;i&&i.$transform&&s.add(i.$transform),o!==null&&s.add(o),p.set(a,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,sharedNodeState:$f(l[e]),transforms:s})}}let m=new s_(o,i,p,{disableEvents:a,namespace:s,theme:r},u||console.error,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach((t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)})),t&&i(t),n}(p,d?d.import:void 0),f,e);return c!==void 0&&(m._pendingEditorState=c,m._dirtyType=xf),m}var s_=class{constructor(e,t,n,r,i,a,o,s){this._createEditorArgs=s,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=yf,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=H_(),this._onError=i,this._htmlConversions=a,this._editable=o,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){let t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){let t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){let t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){let t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){let t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){n===void 0&&V(35);let r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);let i=r.get(e);i===void 0&&V(36,String(e));let a=i[n];return a.add(t),()=>{a.delete(t),i.every((e=>e.size===0))&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&V(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=Fv(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=Fv(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update((()=>{for(let e of r)for(let t of e.keys()){let e=A_(t);e&&e.markDirty()}}),e._pendingEditorState===null?{tag:$g}:void 0)}(this,r.map((e=>e.klass.getType()))),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return K(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=tv(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,a_(this,t,e,r),t!==null&&(this._config.disableEvents||lh(t),n!=null&&t.classList.remove(...n)),e!==null){let t=fv(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=xf,Qf(this),this._updateTags.add($g),Fg(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument,r=Hm.get(n);(r===void 0||r<1)&&n.addEventListener(`selectionchange`,oh),Hm.set(n,(r||0)+1),e.__lexicalEditor=t;let i=ih(e);for(let n=0;n<Lm.length;n++){let[r,a]=Lm[n],o=typeof a==`function`?e=>{ch(e)||(sh(e),(t.isEditable()||r===`click`)&&a(e,t))}:e=>{if(ch(e))return;sh(e);let n=t.isEditable();switch(r){case`cut`:return n&&K(t,km,e);case`copy`:return K(t,Om,e);case`paste`:return n&&K(t,em,e);case`dragstart`:return n&&K(t,Tm,e);case`dragover`:return n&&K(t,Em,e);case`dragend`:return n&&K(t,Dm,e);case`focus`:return n&&K(t,Nm,e);case`blur`:return n&&K(t,Pm,e);case`drop`:return n&&K(t,Cm,e)}};e.addEventListener(r,o),i.push((()=>{e.removeEventListener(r,o)}))}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add($g),Fg(this);Ig(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&V(38);let n=e;n._readOnly&&(n=Jg(e),n._selection=e._selection?e._selection.clone():null),Zf(this);let r=this._pendingEditorState,i=this._updateTags,a=t===void 0?null:t.tag;r===null||r.isEmpty()||(a!=null&&i.add(a),Fg(this)),this._pendingEditorState=n,this._dirtyType=xf,this._dirtyElements.set(`root`,!1),this._compositionKey=null,a!=null&&i.add(a),this._updating||Fg(this)}parseEditorState(e,t){return function(e,t,n){let r=Yg(),i=gg,a=vg,o=_g,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,gg=r,vg=!1,_g=t,l_(null);try{let i=t._nodes;Ng(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,gg=i,vg=a,_g=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(e){return Fg(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):Rg(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),zg(this,(()=>{let r=W(),i=I_();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||R_(r.clone()),uv(`focus`),aee((()=>{n.removeAttribute(`autocapitalize`),e&&e()}))})),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=Sv(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Ig(`editable`,this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}};s_.version=`0.35.0+prod.esm`;var c_=null;function l_(e){c_=e}var ree=1;function u_(e,t){let n=d_(e,t);return n===void 0&&V(30,t),n}function d_(e,t){return e._nodes.get(t)}var iee=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function f_(e){return Gg(N_(e))}function p_(e){let t=document.activeElement;if(!Tv(t))return!1;let n=t.nodeName;return Gg(N_(e))&&(n===`INPUT`||n===`TEXTAREA`||t.contentEditable===`true`&&__(t)==null)}function m_(e,t,n){let r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!p_(t)&&g_(t)===e}catch{return!1}}function h_(e){return e instanceof s_}function g_(e){let t=e;for(;t!=null;){let e=__(t);if(h_(e))return e;t=cv(t)}return null}function __(e){return e?e.__lexicalEditor:null}function v_(e){return Lh(e)||e.isToken()}function y_(e){return v_(e)||e.isSegmented()}function b_(e){return Ev(e)&&e.nodeType===gf}function x_(e){return Ev(e)&&e.nodeType===_f}function S_(e){let t=e;for(;t!=null;){if(b_(t))return t;t=t.firstChild}return null}function C_(e,t,n){let r=Pf[t];if(n!==null&&(e&r)==(n&r))return e;let i=e^r;return t===`subscript`?i&=~Pf.superscript:t===`superscript`?i&=~Pf.subscript:t===`lowercase`?(i&=~Pf.uppercase,i&=~Pf.capitalize):t===`uppercase`?(i&=~Pf.lowercase,i&=~Pf.capitalize):t===`capitalize`&&(i&=~Pf.lowercase,i&=~Pf.uppercase),i}function w_(e){return H(e)||gh(e)||Gg(e)}function T_(e,t){let n=function(){let e=c_;return c_=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);Cg(),wg();let r=Eg(),i=Tg(),a=``+ ree++;i._nodeMap.set(a,e),G(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.add(a),r._dirtyType=bf,e.__key=a}function E_(e){let t=e.getParent();if(t!==null){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),o=a===null?null:a.__key,s=i===null?null:i.__key,c=i===null?null:i.getWritable(),l=a===null?null:a.getWritable();i===null&&(r.__first=o),a===null&&(r.__last=s),c!==null&&(c.__next=o),l!==null&&(l.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function D_(e){wg();let t=e.getLatest(),n=t.__parent,r=Tg(),i=Eg(),a=r._nodeMap,o=i._dirtyElements;n!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent}}(n,a,o);let s=t.__key;i._dirtyType=bf,G(e)?o.set(s,!0):i._dirtyLeaves.add(s)}function O_(e){Cg();let t=Eg(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=A_(n);e!==null&&e.getWritable()}if(e!==null){let t=A_(e);t!==null&&t.getWritable()}}}function k_(){return Sg()?null:Eg()._compositionKey}function A_(e,t){let n=(t||Tg())._nodeMap.get(e);return n===void 0?null:n}function j_(e,t){let n=M_(e,Eg());return n===void 0?null:A_(n,t)}function M_(e,t){return e[`__lexicalKey_${t._key}`]}function N_(e,t){let n=e;for(;n!=null;){let e=j_(n,t);if(e!==null)return e;n=cv(n)}return null}function P_(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function F_(e){return e.read((()=>I_().getTextContent()))}function I_(){return L_(Tg())}function L_(e){return e._nodeMap.get(`root`)}function R_(e){Cg();let t=Tg();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function z_(e){let t=Eg(),n=function(e,t){let n=e;for(;n!=null;){let e=M_(n,t);if(e!==void 0)return e;n=cv(n)}return null}(e,t);return n===null?e===t.getRootElement()?A_(`root`):null:A_(n)}function B_(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function V_(e){let t=[],n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function H_(){return Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5)}function U_(e){return b_(e)?e.nodeValue:null}function W_(e,t,n){let r=Sv(pv(t));if(r===null)return;let i=r.anchorNode,{anchorOffset:a,focusOffset:o}=r;if(i!==null){let t=U_(i),r=N_(i);if(t!==null&&H(r)){if(t===jf&&n){let e=n.length;t=n,a=e,o=e}t!==null&&G_(r,t,a,o,e)}}}function G_(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=t;(o||i)&&t[t.length-1]===jf&&(s=t.slice(0,-1));let c=a.getTextContent();if(i||s!==c){if(s===``){if(O_(null),cf||lf||pf)a.remove();else{let e=Eg();setTimeout((()=>{e.update((()=>{a.isAttached()&&a.remove()}))}),20)}return}let t=a.getParent(),i=ag(),c=a.getTextContentSize(),l=k_(),u=a.getKey();if(a.isToken()||l!==null&&u===l&&!o||U(i)&&(t!==null&&!t.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===e.__key&&i.anchor.offset===0&&!a.canInsertTextBefore()&&!o||i.focus.key===e.__key&&i.focus.offset===c&&!a.canInsertTextAfter()&&!o))return void a.markDirty();let d=W();if(!U(d)||n===null||r===null)return void K_(a,s,d);if(d.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=Nh(a.getTextContent());a.replace(e),a=e}K_(a,s,d)}}}function K_(e,t,n){if(e.setTextContent(t),U(n)){let t=e.getKey();for(let r of[`anchor`,`focus`]){let i=n[r];i.type===`text`&&i.key===t&&(i.offset=ny(e,i.offset,`clamp`))}}}function q_(e,t,n){let r=t[n]||!1;return r===`any`||r===e[n]}function J_(e,t){return q_(e,t,`altKey`)&&q_(e,t,`ctrlKey`)&&q_(e,t,`shiftKey`)&&q_(e,t,`metaKey`)}function Y_(e,t,n){return J_(e,n)&&e.key.toLowerCase()===t.toLowerCase()}var X_={ctrlKey:!af,metaKey:af},Z_={altKey:af,ctrlKey:!af};function Q_(e){return e.key===`Backspace`}function $_(e){return Y_(e,`a`,X_)}function ev(e){let t=I_();if(U(e)){let t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),up(e),e}{let e=t.select(0,t.getChildrenSize());return R_(up(e)),e}}function tv(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=mf(i);return n[t]=e,e}return i}function nv(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&V(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function rv(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function iv(e,t){let n=e.offset;if(e.type===`element`)return rv(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?rv(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function av(e){let t=pv(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function K(e,t,n){return function(e,t,n){let r=V_(e);for(let i=4;i>=0;i--)for(let a=0;a<r.length;a++){let o=r[a],s=o._commands.get(t);if(s!==void 0){let t=s[i];if(t!==void 0){let r=Array.from(t),i=r.length,a=!1;if(zg(o,(()=>{for(let t=0;t<i;t++)if(r[t](n,e))return void(a=!0)})),a)return a}}}return!1}(e,t,n)}function ov(e){return!qg(e)&&!e.isLastChild()&&!e.isInline()}function sv(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&V(75,t),n}function cv(e){let t=e.assignedSlot||e.parentElement;return Dv(t)?t.host:t}function lv(e){return x_(e)?e:Tv(e)?e.ownerDocument:null}function uv(e){Cg(),Eg()._updateTags.add(e)}function aee(e){Cg(),Eg()._deferred.push(e)}function dv(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function fv(e){let t=lv(e);return t?t.defaultView:null}function pv(e){let t=e._window;return t===null&&V(78),t}function mv(e){let t=e.getParentOrThrow();for(;t!==null;){if(hv(t))return t;t=t.getParentOrThrow()}return t}function hv(e){return qg(e)||G(e)&&e.isShadowRoot()}function gv(e){let t=e.constructor.clone(e);return T_(t,null),t.afterCloneFrom(e),t}function _v(e){let t=Eg(),n=e.getType(),r=d_(t,n);r===void 0&&V(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||V(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||V(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&V(203,e.constructor.name,n,r.name,r.getType()),t}return e}function vv(e,t){!qg(e.getParent())||G(t)||Gg(t)||V(99)}function yv(e){let t=A_(e);return t===null&&V(63,e),t}function bv(e){return(Gg(e)||G(e)&&!e.canBeEmpty())&&!e.isInline()}function xv(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function Sv(e){return nf?(e||window).getSelection():null}function Cv(e){let t=fv(e);return t?t.getSelection():null}function wv(e){return Tv(e)&&e.tagName===`A`}function Tv(e){return Ev(e)&&e.nodeType===hf}function Ev(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function Dv(e){return Ev(e)&&e.nodeType===vf}function Ov(e){let t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,`i`);return e.nodeName.match(t)!==null}function kv(e){let t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,`i`);return e.nodeName.match(t)!==null}function Av(e){if(Gg(e)&&!e.isInline())return!0;if(!G(e)||hv(e))return!1;let t=e.getFirstChild(),n=t===null||gh(t)||H(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function jv(e,t){let n=e;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function Mv(){return Eg()}var Nv=new WeakMap,Pv=new Map;function Fv(e){if(!e._readOnly&&e.isEmpty())return Pv;e._readOnly||V(192);let t=Nv.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),Nv.set(e,t)),t}function Iv(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function Lv(e,t){let n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function Rv(e){return!0===e.__lexicalUnmanaged}function zv(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==fh[t]}function Bv(e){let t=Bf in e.prototype?e.prototype[Bf]():void 0,n=function(e){return e===Wg||e===Hg||e===fh}(e),r=!n&&zv(e,`getType`)?e.getType():void 0,i,a=r;if(t)if(r)i=t[r];else for(let[e,n]of Object.entries(t))a=e,i=n;if(!n&&a&&(zv(e,`getType`)||(e.getType=()=>a),zv(e,`clone`)||(e.clone=t=>(l_(t),new e)),zv(e,`importJSON`)||(e.importJSON=i&&i.$importJSON||(t=>new e().updateFromJSON(t))),!zv(e,`importDOM`)&&i)){let{importDOM:t}=i;t&&(e.importDOM=()=>t)}return{ownNodeConfig:i,ownNodeType:a}}function Vv(e){let t=Mv();return Cg(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var oee={next:`previous`,previous:`next`},Hv=class{constructor(e){this.origin=e}[Symbol.iterator](){return fy({hasNext:Yv,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return ey(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return ey(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&V(263,Array.from(o).join(` `))}else i.insert(e);i=ey(e,this.direction)}for(let e of o.values())e.remove();return this}},Uv=class e extends Hv{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:iy(e,this.direction)}getParentCaret(e=`root`){return ey(Gv(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Wv(this.direction);return ey(this.getNodeAtCaret(),e)||iy(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},see={root:qg,shadowRoot:hv};function Wv(e){return oee[e]}function Gv(e,t=`root`){return see[t](e)?null:e}var Kv=class e extends Hv{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:ey(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return G(this.origin)?iy(this.origin,this.direction):null}getParentCaret(e=`root`){return ey(Gv(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Wv(this.direction);return ey(this.getNodeAtCaret(),e)||iy(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof qv)&&this.direction===t.direction&&this.origin.is(t.origin)}},qv=class e extends Hv{type=`text`;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:ty(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return ey(Gv(this.getParentAtCaret(),e),this.direction)}getFlipped(){return ty(this.origin,Wv(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Kv||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return ey(this.origin,this.direction)}};function Jv(e){return e instanceof qv}function Yv(e){return e instanceof Kv}function Xv(e){return e instanceof Uv}var Zv={next:class extends qv{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends qv{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Qv={next:class extends Kv{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Kv{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},$v={next:class extends Uv{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Uv{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function ey(e,t){return e?new Qv[t](e):null}function ty(e,t,n){return e?new Zv[t](e,ny(e,n)):null}function ny(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function ry(e,t){return new cy(e,t)}function iy(e,t){return G(e)?new $v[t](e):null}function ay(e){return e&&e.getChildCaret()||e}function oy(e){return e&&ay(e.getAdjacentCaret())}var sy=class e{type=`node-caret-range`;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return Jv(t)?function(e,t){let{direction:n,origin:r}=e;return ry(e,ny(r,t===`focus`?Wv(n):n)-e.offset)}(t,e):null},t=e(`anchor`),n=e(`focus`);if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[ry(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e=`root`){let t=Jv(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=Jv(n),i=t=>t.isSameNodeCaret(n)?null:oy(t)||t.getParentCaret(e);return fy({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},cy=class{type=`slice`;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return ty(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function ly(e){return dy(e,ey(I_(),e.direction))}function uy(e){return dy(e,e)}function dy(e,t){return e.direction!==t.direction&&V(265),new sy(e,t,e.direction)}function fy(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function py(e,t){let n=_y(e.origin,t.origin);switch(n===null&&V(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:{let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return my(n)}}function my(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function hy(e,t){return t.is(e)}function gy(e){return G(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function _y(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=gy(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=gy(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(hy(e,r)||V(276),{commonAncestor:r,type:`ancestor`}):i===null?(hy(t,r)||V(277),{commonAncestor:r,type:`descendant`}):((G(a)||hy(e,a))&&(G(i)||hy(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||V(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function vy(e,t){let{type:n,key:r,offset:i}=e,a=yv(e.key);return n===`text`?(H(a)||V(266,a.getType(),r),ty(a,t,i)):(G(a)||V(267,a.getType(),r),jy(a,e.offset,t))}function yy(e,t){let{origin:n,direction:r}=t,i=r===`next`;Jv(t)?e.set(n.getKey(),t.offset,`text`):Yv(t)?H(n)?e.set(n.getKey(),ny(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(Xv(t)&&G(n)||V(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function by(e){let t=W(),n=U(t)?t:ng();return xy(n,e),R_(n),n}function xy(e,t){yy(e.anchor,t.anchor),yy(e.focus,t.focus)}function Sy(e){let{anchor:t,focus:n}=e,r=vy(t,`next`),i=vy(n,`next`),a=py(r,i)<=0?`next`:`previous`;return dy(ky(r,a),ky(i,a))}function Cy(e){let{direction:t,origin:n}=e,r=ey(n,Wv(t)).getNodeAtCaret();return r?ey(r,t):iy(n.getParentOrThrow(),t)}function wy(e,t=`root`){let n=[e];for(let r=Xv(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(Cy(r));return n}function Ty(e){return!!e&&e.origin.isAttached()}function Ey(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=Ay(e,r),o=wy(a.anchor,n),s=wy(a.focus.getFlipped(),n),c=new Set,l=[];for(let e of a.iterNodeCarets(n))if(Xv(e))c.add(e.origin.getKey());else if(Yv(e)){let{origin:t}=e;G(t)&&!c.has(t.getKey())||l.push(t)}for(let e of l)e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=Cy(ey(t,r)),c=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||c===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(c===`segmented`){let e=t.origin,n=Nh(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=ty(n,r,t.offset)}n.is(o[0].origin)&&(o[0]=t),n.is(s[0].origin)&&(s[0]=t.getFlipped())}}let u,d;for(let e of o)if(Ty(e)){u=Dy(e);break}for(let e of s)if(Ty(e)){d=Dy(e);break}let f=function(e,t,n){if(!e||!t)return null;let r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;let a=r.getParents().reverse();a.push(r);let o=i.getParents().reverse();o.push(i);let s=Math.min(a.length,o.length),c;for(c=0;c<s&&a[c]===o[c];c++);let l=(e,t)=>{let n;for(let r=c;r<e.length;r++){let i=e[r];if(hv(i))return;!n&&t(i)&&(n=i)}return n},u=l(a,Av),d=u&&l(o,(e=>n.has(e.getKey())&&Av(e)));return u&&d?[u,d]:null}(u,d,c);if(f){let[e,t]=f;iy(e,`previous`).splice(0,t.getChildren()),t.remove()}let p=[u,d,...o,...s].find(Ty);if(p)return uy(ky(Dy(p),e.direction));V(269,JSON.stringify(o.map((e=>e.origin.__key))))}function Dy(e){let t=function(e){let t=e;for(;Xv(t);){let e=oy(t);if(!Xv(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(H(t.origin))return Jv(t)?t:ty(t.origin,n,n);let r=t.getAdjacentCaret();return Yv(r)&&H(r.origin)?ty(r.origin,n,Wv(n)):t}function Oy(e){return Jv(e)&&e.offset!==ny(e.origin,e.direction)}function ky(e,t){return e.direction===t?e:e.getFlipped()}function Ay(e,t){return e.direction===t?e:dy(ky(e.focus,t),ky(e.anchor,t))}function jy(e,t,n){let r=iy(e,`next`);for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(e===null)break;r=e}return ky(r,n)}function My(e){let{origin:t,offset:n,direction:r}=e;if(n===ny(t,r))return e.getSiblingCaret();if(n===ny(t,Wv(r)))return Cy(e.getSiblingCaret());let[i]=t.splitText(n);return H(i)||V(281),ky(ey(i,`next`),r)}function Ny(e,t){return!0}function Py(e,{$copyElementNode:t=gv,$splitTextPointCaretNext:n=My,rootMode:r=`shadowRoot`,$shouldSplit:i=Ny}={}){if(Jv(e))return n(e);let a=e.getParentCaret(r);if(a){let{origin:n}=a;if(Xv(e)&&(!n.canBeEmpty()||!i(n,`first`)))return Cy(a);let r=function(e){let t=[];for(let n=e.getAdjacentCaret();n;n=n.getAdjacentCaret())t.push(n.origin);return t}(e);(r.length>0||n.canBeEmpty()&&i(n,`last`))&&a.insert(t(n).splice(0,0,r))}return a}function Fy(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Iy=new Map;function Ly(e){let t={};if(!e)return t;let n=e.split(`;`);for(let e of n)if(e!==``){let[n,r]=e.split(/:([^]+)/);n&&r&&(t[n.trim()]=r.trim())}return t}function Ry(e){let t=Iy.get(e);return t===void 0&&(t=Ly(e),Iy.set(e,t)),t}function zy(e){let t=Mv().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function By(e){return zy(qg(e)?e:e.getParentOrThrow())}function Vy(e){let t=By(e);return t!==null&&t.direction===`rtl`}function Hy(e,t){let n=e.getStartEndPoints();if(t.isSelected(e)&&!y_(t)&&n!==null){let[r,i]=n,a=e.isBackward(),o=r.getNode(),s=i.getNode(),c=t.is(o),l=t.is(s);if(c||l){let[n,r]=Kh(e),i=o.is(s),c=t.is(a?s:o),l=t.is(a?o:s),u,d=0;i?(d=n>r?r:n,u=n>r?n:r):c?(d=a?r:n,u=void 0):l&&(d=0,u=a?n:r),t.__text=t.__text.slice(d,u)}}return t}function Uy(e){if(e.type===`text`)return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return G(t)||Fy(177),e.offset===t.getChildrenSize()}function Wy(e){let t=e.getStyle(),n=Ly(t);Iy.set(t,n)}function Gy(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function Ky(e,t,n=Gy){if(e===null)return;let r=e.getStartEndPoints(),i=new Map,a=null;if(r){let[e,t]=r;a=ng(),a.anchor.set(e.key,e.offset,e.type),a.focus.set(t.key,t.offset,t.type);let n=$y(e.getNode(),Av),o=$y(t.getNode(),Av);G(n)&&i.set(n.getKey(),n),G(o)&&i.set(o.getKey(),o)}for(let t of e.getNodes())if(G(t)&&Av(t))i.set(t.getKey(),t);else if(r===null){let e=$y(t,Av);G(e)&&i.set(e.getKey(),e)}for(let[e,r]of i){let i=t();n(r,i),r.replace(i,!0),a&&(e===a.anchor.key&&a.anchor.set(i.getKey(),a.anchor.offset,a.anchor.type),e===a.focus.key&&a.focus.set(i.getKey(),a.focus.offset,a.focus.type))}a&&e.is(W())&&R_(a)}function qy(e){let t=Jy(e);return t!==null&&t.writingMode===`vertical-rl`}function Jy(e){let t=e.anchor.getNode();return G(t)?zy(t):By(t)}function Yy(e,t){let n=qy(e)?!t:t;Zy(e)&&(n=!n);let r=vy(e.focus,n?`previous`:`next`);if(Oy(r))return!1;for(let e of ly(r)){if(Xv(e))return!e.origin.isInline();if(!G(e.origin)){if(Gg(e.origin))return!0;break}}return!1}function Xy(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function Zy(e){let t=Jy(e);return t!==null&&t.direction===`rtl`}function Qy(e,t,n){let r=Zy(e),i;i=qy(e)||r?!n:n,Xy(e,t,i,`character`)}function $y(e,t){let n=e;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function eb(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var tb=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,cee=tb&&`documentMode`in document?document.documentMode:null;tb&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);var lee=tb&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);!(!tb||!(`InputEvent`in window)||cee)&&`getTargetRanges`in new window.InputEvent(`input`),tb&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),tb&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,tb&&/Android/.test(navigator.userAgent),tb&&/^(?=.*Chrome).*/i.test(navigator.userAgent),tb&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);function nb(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function rb(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}var ib=tb,ab=lee;function ob(e,...t){let n=nb(...t);n.length>0&&e.classList.add(...n)}function sb(e,...t){let n=nb(...t);n.length>0&&e.classList.remove(...n)}function cb(e){return e?e.getAdjacentCaret():null}function lb(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function ub(e){let t=db(e,(e=>G(e)&&!e.isInline()));return G(t)||eb(4,e.__key),t}var db=(e,t)=>{let n=e;for(;n!==I_()&&n!=null;){if(t(n))return n;n=n.getParent()}return null};function fb(e){let t=W()||ag(),n;if(U(t))n=vy(t.focus,`next`);else{if(t!=null){let e=t.getNodes(),r=e[e.length-1];r&&(n=ey(r,`next`))}n||=iy(I_(),`previous`).getFlipped().insert(r_())}let r=pb(e,n),i=oy(r);return by(uy(Xv(i)?Dy(i):r)),e.getLatest()}function pb(e,t,n){let r=ky(t,`next`);for(let e=r;e;e=Py(e,n))r=e;return Jv(r)&&eb(283),r.insert(e.isInline()?r_().append(e):e),ky(ey(e.getLatest(),`next`),t.direction)}function mb(e,t){let n=t();return e.replace(n),n.append(e),n}function hb(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function gb(e,t){let n=[];for(let r=0;r<e.length;r++){let i=t(e[r]);i!==null&&n.push(i)}return n}var _b=!(ab||!ib)&&void 0;function vb(e){let t=1;if(function(){if(_b===void 0){let e=document.createElement(`div`);e.style.cssText=`position: absolute; opacity: 0; width: 100px; left: -1000px;`,document.body.appendChild(e);let t=e.getBoundingClientRect();e.style.setProperty(`zoom`,`2`),_b=e.getBoundingClientRect().width===t.width,document.body.removeChild(e)}return _b}())for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue(`zoom`)),e=e.parentElement;return t}var yb=0,bb=1,xb=2,Sb=0,Cb=1,wb=2,Tb=3,Eb=4;function Db(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return Sb;let a=t._selection,o=e._selection;if(i)return Cb;if(!(U(a)&&U(o)&&o.isCollapsed()&&a.isCollapsed()))return Sb;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||qg(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return Sb;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&H(r)&&r.__text.length===1&&a.anchor.offset===1?wb:Sb}let c=s[0],l=e._nodeMap.get(c.__key);if(!H(l)||!H(c)||l.__mode!==c.__mode)return Sb;let u=l.__text,d=c.__text;if(u===d)return Sb;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return Sb;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?wb:g===-1&&h===m+1?Tb:g===-1&&h===m?Eb:Sb}function Ob(e,t){let n=Date.now(),r=Sb;return(i,a,o,s,c,l)=>{let u=Date.now();if(l.has(`historic`))return r=Sb,n=u,xb;let d=Db(i,a,s,c,e.isComposing()),f=(()=>{let f=o===null||o.editor===e,p=l.has(Qg);if(!p&&f&&l.has(`history-merge`))return yb;if(i===null)return bb;let m=a._selection;return s.size>0||c.size>0?!1===p&&d!==Sb&&d===r&&u<n+t&&f||s.size===1&&function(e,t,n){let r=t._nodeMap.get(e),i=n._nodeMap.get(e),a=t._selection,o=n._selection;return!(U(a)&&U(o)&&a.anchor.type===`element`&&a.focus.type===`element`&&o.anchor.type===`text`&&o.focus.type===`text`||!H(r)||!H(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>i.exportJSON())))}(Array.from(s)[0],i,a)?yb:bb:m===null?xb:yb})();return n=u,r=d,f}}function kb(e){e.undoStack=[],e.redoStack=[],e.current=null}function Ab(e,t,n){let r=Ob(e,n);return rb(e.registerCommand(am,(()=>(function(e,t){let n=t.redoStack,r=t.undoStack;if(r.length!==0){let i=t.current,a=r.pop();i!==null&&(n.push(i),e.dispatchCommand(jm,!0)),r.length===0&&e.dispatchCommand(Mm,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:`historic`})}}(e,t),!0)),0),e.registerCommand(om,(()=>(function(e,t){let n=t.redoStack,r=t.undoStack;if(n.length!==0){let i=t.current;i!==null&&(r.push(i),e.dispatchCommand(Mm,!0));let a=n.pop();n.length===0&&e.dispatchCommand(jm,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:`historic`})}}(e,t),!0)),0),e.registerCommand(eee,(()=>(kb(t),!1)),0),e.registerCommand(tee,(()=>(kb(t),e.dispatchCommand(jm,!1),e.dispatchCommand(Mm,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:i,dirtyLeaves:a,dirtyElements:o,tags:s})=>{let c=t.current,l=t.redoStack,u=t.undoStack,d=c===null?null:c.editorState;if(c!==null&&n===d)return;let f=r(i,n,c,a,o,s);if(f===bb)l.length!==0&&(t.redoStack=[],e.dispatchCommand(jm,!1)),c!==null&&(u.push({...c}),e.dispatchCommand(Mm,!0));else if(f===xb)return;t.current={editor:e,editorState:n}})))}function jb(){return{current:null,redoStack:[],undoStack:[]}}function Mb({delay:e,externalHistoryState:t}){let[n]=tf();return function(e,t,n=1e3){let r=(0,I.useMemo)((()=>t||jb()),[t]);(0,I.useEffect)((()=>Ab(e,r,n)),[n,e,r])}(n,t,e),null}function Nb(e,t){let n=t.body?t.body.childNodes:[],r=[],i=[];for(let t=0;t<n.length;t++){let a=n[t];if(!Ib.has(a.nodeName)){let t=Lb(a,e,i,!1);t!==null&&(r=r.concat(t))}}return function(e){for(let t of e)t.getNextSibling()instanceof e_&&t.insertAfter(hh());for(let t of e){let e=t.getChildren();for(let n of e)t.insertBefore(n);t.remove()}}(i),r}function Pb(e,t){if(typeof document>`u`||typeof window>`u`&&global.window===void 0)throw Error(`To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.`);let n=document.createElement(`div`),r=I_().getChildren();for(let i=0;i<r.length;i++)Fb(e,r[i],n,t);return n.innerHTML}function Fb(e,t,n,r=null){let i=r===null||t.isSelected(r),a=G(t)&&t.excludeFromCopy(`html`),o=t;if(r!==null){let e=Iv(t);e=H(e)&&r!==null?Hy(r,e):e,o=e}let s=G(o)?o.getChildren():[],c=d_(e,o.getType()),l;l=c&&c.exportDOM!==void 0?c.exportDOM(e,o):o.exportDOM(e);let{element:u,after:d}=l;if(!u)return!1;let f=document.createDocumentFragment();for(let n=0;n<s.length;n++){let a=s[n],o=Fb(e,a,f,r);!i&&G(t)&&o&&t.extractWithChild(a,r,`html`)&&(i=!0)}if(i&&!a){if((Tv(u)||Dv(u))&&u.append(f),n.append(u),d){let e=d.call(o,u);e&&(Dv(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(f);return i}var Ib=new Set([`STYLE`,`SCRIPT`]);function Lb(e,t,n,r,i=new Map,a){let o=[];if(Ib.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!hv(s))&&(s!=null&&eg(s)||r);for(let e=0;e<d.length;e++)f.push(...Lb(d[e],t,n,p,new Map(i),s));return u!=null&&(f=u(f)),kv(e)&&(f=Rb(e,f,p?()=>{let e=new e_;return n.push(e),e}:r_)),s==null?f.length>0?o=o.concat(f):kv(e)&&function(e){return e.nextSibling==null||e.previousSibling==null?!1:Ov(e.nextSibling)&&Ov(e.previousSibling)}(e)&&(o=o.concat(hh())):G(s)&&s.append(...f),o}function Rb(e,t,n){let r=e.style.textAlign,i=[],a=[];for(let e=0;e<t.length;e++){let o=t[e];if(eg(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(a.push(o),e===t.length-1||e<t.length-1&&eg(t[e+1])){let e=n();e.setFormat(r),e.append(...a),i.push(e),a=[]}}return i}function zb(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Bb(e,t=W()){return t??zb(166),U(t)&&t.isCollapsed()||t.getNodes().length===0?``:Pb(e,t)}function Vb(e,t=W()){return t??zb(166),U(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(Gb(e,t))}function Hb(e,t,n){let r=e.getData(`application/x-lexical-editor`);if(r)try{let e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return Ub(n,Kb(e.nodes),t)}catch{}let i=e.getData(`text/html`),a=e.getData(`text/plain`);if(i&&a!==i)try{return Ub(n,Nb(n,new DOMParser().parseFromString(function(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy(`lexical`,{createHTML:e=>e}).createHTML(e):e}(i),`text/html`)),t)}catch{}let o=a||e.getData(`text/uri-list`);if(o!=null)if(U(t)){let e=o.split(/(\r?\n|\t)/);e[e.length-1]===``&&e.pop();for(let t=0;t<e.length;t++){let n=W();if(U(n)){let r=e[t];r===`
22
- `||r===`\r
23
- `?n.insertParagraph():r===` `?n.insertNodes([Ih()]):n.insertText(r)}}}else t.insertRawText(o)}function Ub(e,t,n){e.dispatchCommand(Jp,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(U(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=vy(t,`previous`);if(r)if(Jv(r))n=r.origin;else{let e=dy(r,iy(I_(),`next`).getFlipped());for(let t of e){if(H(t.origin)){n=t.origin;break}if(G(t.origin)&&!t.origin.isInline())break}}if(n&&H(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function Wb(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=G(n)&&n.excludeFromCopy(`html`),o=n;if(t!==null){let e=Iv(n);e=H(e)&&t!==null?Hy(t,e):e,o=e}let s=G(o)?o.getChildren():[],c=function(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&zb(58,n.name),G(e)){let e=t.children;Array.isArray(e)||zb(59,n.name)}return t}(o);if(H(o)){let e=o.__text;e.length>0?c.text=e:i=!1}for(let r=0;r<s.length;r++){let a=s[r],o=Wb(e,t,a,c.children);!i&&G(n)&&o&&n.extractWithChild(a,t,`clone`)&&(i=!0)}if(i&&!a)r.push(c);else if(Array.isArray(c.children))for(let e=0;e<c.children.length;e++){let t=c.children[e];r.push(t)}return i}function Gb(e,t){let n=[],r=I_().getChildren();for(let i=0;i<r.length;i++)Wb(e,t,r[i],n);return{namespace:e._config.namespace,nodes:n}}function Kb(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=Mg(r);H(i)&&Wy(i),t.push(i)}return t}var qb=null;async function Jb(e,t,n){if(qb!==null)return!1;if(t!==null)return new Promise(((r,i)=>{e.update((()=>{r(Yb(e,t,n))}))}));let r=e.getRootElement(),i=e._window||window,a=window.document,o=Sv(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.cssText=`position: fixed; top: -1000px;`,s.append(a.createTextNode(`#`)),r.append(s);let c=new Range;return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise(((t,r)=>{let i=e.registerCommand(Om,(r=>(hb(r,ClipboardEvent)&&(i(),qb!==null&&(window.clearTimeout(qb),qb=null),t(Yb(e,r,n))),!0)),4);qb=window.setTimeout((()=>{i(),qb=null,t(!1)}),50),a.execCommand(`copy`),s.remove()}))}function Yb(e,t,n){if(n===void 0){let t=Sv(e._window);if(!t)return!1;let r=t.anchorNode,i=t.focusNode;if(r!==null&&i!==null&&!m_(e,r,i))return!1;let a=W();if(a===null)return!1;n=Zb(a)}t.preventDefault();let r=t.clipboardData;return r!==null&&(Qb(r,n),!0)}var Xb=[[`text/html`,Bb],[`application/x-lexical-editor`,Vb]];function Zb(e=W()){let t={"text/plain":e?e.getTextContent():``};if(e){let n=Mv();for(let[r,i]of Xb){let a=i(n,e);a!==null&&(t[r]=a)}}return t}function Qb(e,t){for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}function $b(e,t){if(document.caretRangeFromPoint!==void 0){let n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!==`undefined`){let n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}var ex=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,tx=ex&&`documentMode`in document?document.documentMode:null,nx=!(!ex||!(`InputEvent`in window)||tx)&&`getTargetRanges`in new window.InputEvent(`input`),rx=ex&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ix=ex&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ax=ex&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ox=ex&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!ax,sx=Kp(`DRAG_DROP_PASTE_FILE`),cx=class e extends Hg{static getType(){return`quote`}static clone(t){return new e(t.__key)}createDOM(e){let t=document.createElement(`blockquote`);return ob(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:mx,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Tv(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return lx().updateFromJSON(e)}insertNewAfter(e,t){let n=r_(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){let e=r_();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function lx(){return _v(new cx)}function ux(e){return e instanceof cx}var dx=class e extends Hg{static getType(){return`heading`}static clone(t){return new e(t.__tag,t.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){let t=this.getWritable();return this.__tag=e,t}createDOM(e){let t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];ob(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:px,priority:0}),h2:e=>({conversion:px,priority:0}),h3:e=>({conversion:px,priority:0}),h4:e=>({conversion:px,priority:0}),h5:e=>({conversion:px,priority:0}),h6:e=>({conversion:px,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&fx(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>fx(e)?{conversion:e=>({node:hx(`h1`)}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Tv(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return hx(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?r_():hx(this.getTag()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),n===0&&!this.isEmpty()&&e){let e=r_();e.select(),this.replace(e,!0)}return i}collapseAtStart(){let e=this.isEmpty()?r_():hx(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}};function fx(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function px(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=hx(t),e.style!==null&&(Lv(e,n),n.setFormat(e.style.textAlign))),{node:n}}function mx(e){let t=lx();return e.style!==null&&(t.setFormat(e.style.textAlign),Lv(e,t)),{node:t}}function hx(e=`h1`){return _v(new dx(e))}function gx(e){return e instanceof dx}function _x(e){let t=null;if(hb(e,DragEvent)?t=e.dataTransfer:hb(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function vx(e){let t=W();if(!U(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){let i=r[t],a=i.getKey();if(n.has(a))continue;let o=db(i,(e=>G(e)&&!e.isInline()));if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}function yx(e){return Gg(N_(e))}function bx(e){for(let t of[`lowercase`,`uppercase`,`capitalize`])e.hasFormat(t)&&e.toggleFormat(t)}function xx(e){return rb(e.registerCommand(Yp,(e=>{let t=W();return!!Wh(t)&&(t.clear(),!0)}),0),e.registerCommand(Xp,(e=>{let t=W();return U(t)?(t.deleteCharacter(e),!0):!!Wh(t)&&(t.deleteNodes(),!0)}),0),e.registerCommand(nm,(e=>{let t=W();return!!U(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(rm,(e=>{let t=W();return!!U(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand($p,(t=>{let n=W();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)Hb(r,n,e);else if(U(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0}),0),e.registerCommand(tm,(()=>{let e=W();return!!U(e)&&(e.removeText(),!0)}),0),e.registerCommand(im,(e=>{let t=W();return!!U(t)&&(t.formatText(e),!0)}),0),e.registerCommand(wm,(e=>{let t=W();if(!U(t)&&!Wh(t))return!1;let n=t.getNodes();for(let t of n){let n=db(t,(e=>G(e)&&!e.isInline()));n!==null&&n.setFormat(e)}return!0}),0),e.registerCommand(Zp,(e=>{let t=W();return!!U(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(Qp,(()=>{let e=W();return!!U(e)&&(e.insertParagraph(),!0)}),0),e.registerCommand(bm,(()=>(fg([Ih()]),!0)),0),e.registerCommand(xm,(()=>vx((e=>{let t=e.getIndent();e.setIndent(t+1)}))),0),e.registerCommand(Sm,(()=>vx((e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}))),0),e.registerCommand(fm,(e=>{let t=W();if(Wh(t)){let e=t.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if(U(t)){let n=iv(t.focus,!0);if(!e.shiftKey&&Gg(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),0),e.registerCommand(pm,(e=>{let t=W();if(Wh(t)){let e=t.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if(U(t)){if(function(e){let t=e.focus;return t.key===`root`&&t.offset===I_().getChildrenSize()}(t))return e.preventDefault(),!0;let n=iv(t.focus,!1);if(!e.shiftKey&&Gg(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),0),e.registerCommand(um,(e=>{let t=W();if(Wh(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),Vy(n[0])?n[0].selectNext(0,0):n[0].selectPrevious(),!0}if(!U(t))return!1;if(Yy(t,!0)){let n=e.shiftKey;return e.preventDefault(),Qy(t,n,!0),!0}return!1}),0),e.registerCommand(cm,(e=>{let t=W();if(Wh(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),Vy(n[0])?n[0].selectPrevious():n[0].selectNext(0,0),!0}if(!U(t))return!1;let n=e.shiftKey;return!!Yy(t,!1)&&(e.preventDefault(),Qy(t,n,!1),!0)}),0),e.registerCommand(gm,(t=>{if(yx(t.target))return!1;let n=W();if(U(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(qg(n))return!1;let r=ub(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(Sm,void 0);if(ix&&navigator.language===`ko-KR`)return!1}else if(!Wh(n))return!1;return t.preventDefault(),e.dispatchCommand(Xp,!0)}),0),e.registerCommand(vm,(t=>{if(yx(t.target))return!1;let n=W();return!(!U(n)&&!Wh(n))&&(t.preventDefault(),e.dispatchCommand(Xp,!1))}),0),e.registerCommand(mm,(t=>{let n=W();if(!U(n))return!1;if(bx(n),t!==null){if((ix||rx||ox)&&nx)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(Zp,!1)}return e.dispatchCommand(Qp,void 0)}),0),e.registerCommand(_m,(()=>!!U(W())&&(e.blur(),!0)),0),e.registerCommand(Cm,(t=>{let[,n]=_x(t);if(n.length>0){let r=$b(t.clientX,t.clientY);if(r!==null){let{offset:t,node:i}=r,a=N_(i);if(a!==null){let e=ng();if(H(a))e.anchor.set(a.getKey(),t,`text`),e.focus.set(a.getKey(),t,`text`);else{let t=a.getParentOrThrow().getKey(),n=a.getIndexWithinParent()+1;e.anchor.set(t,n,`element`),e.focus.set(t,n,`element`)}R_(up(e))}e.dispatchCommand(sx,n)}return t.preventDefault(),!0}return!!U(W())}),0),e.registerCommand(Tm,(e=>{let[t]=_x(e),n=W();return!(t&&!U(n))}),0),e.registerCommand(Em,(e=>{let[t]=_x(e),n=W();if(t&&!U(n))return!1;let r=$b(e.clientX,e.clientY);return r!==null&&Gg(N_(r.node))&&e.preventDefault(),!0}),0),e.registerCommand(Am,(()=>(ev(),!0)),0),e.registerCommand(Om,(t=>(Jb(e,hb(t,ClipboardEvent)?t:null),!0)),0),e.registerCommand(km,(t=>(async function(e,t){await Jb(t,hb(e,ClipboardEvent)?e:null),t.update((()=>{let e=W();U(e)?e.removeText():Wh(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),0),e.registerCommand(em,(t=>{let[,n,r]=_x(t);return n.length>0&&!r?(e.dispatchCommand(sx,n),!0):Ev(t.target)&&p_(t.target)?!1:W()!==null&&(function(e,t){e.preventDefault(),t.update((()=>{let n=W(),r=hb(e,InputEvent)||hb(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&Hb(r,n,t)}),{tag:`paste`})}(t,e),!0)}),0),e.registerCommand(hm,(e=>{let t=W();return U(t)&&bx(t),!1}),0),e.registerCommand(ym,(e=>{let t=W();return U(t)&&bx(t),!1}),0))}function Sx(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Cx(e,t){return e.length>0?(Sx(e,e.length,0,t),e):t}var wx=Fx(/[A-Za-z]/),Tx=Fx(/[\dA-Za-z]/),Ex=Fx(/[#-'*+\--9=?A-Z^-~]/);function Dx(e){return e!==null&&(e<32||e===127)}var Ox=Fx(/\d/),kx=Fx(/[\dA-Fa-f]/),Ax=Fx(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function jx(e){return e!==null&&(e<0||e===32)}function Mx(e){return e===-2||e===-1||e===32}var Nx=Fx(/\p{P}|\p{S}/u),Px=Fx(/\s/);function Fx(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ix(e){if(e===null||jx(e)||Px(e))return 1;if(Nx(e))return 2}function Lx(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}function Rx(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Sx(o,o.length,0,Lx(s,e.slice(r+1,n),t)),Sx(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Sx(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Ix(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Ix(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var zx=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Wx.peek=Gx;function Bx(){return{canContainEols:[`delete`],enter:{strikethrough:Hx},exit:{strikethrough:Ux}}}function Vx(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:zx}],handlers:{delete:Wx}}}function Hx(e){this.enter({type:`delete`,children:[]},e)}function Ux(e){this.exit(e)}function Wx(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Gx(){return`~`}Zx.peek=Qx;var Kx=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],qx={canContainEols:[`highlight`],enter:{highlight:Jx},exit:{highlight:Yx}};function Jx(e){this.enter({type:`highlight`,children:[]},e)}function Yx(e){this.exit(e)}var Xx={unsafe:[{character:`=`,inConstruct:`phrasing`,notInConstruct:Kx}],handlers:{highlight:Zx}};function Zx(e,t,n,r){let i=n.createTracker(r),a=n.enter(`highlight`),o=i.move(`==`);return o+=i.move(n.containerPhrasing(e,{before:o,after:`=`,...i.current()})),o+=i.move(`==`),a(),o}function Qx(){return`=`}function $x(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var eS=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),tS={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function nS(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function uee(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function dee(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function rS(e){return dee(e)||nS(e)}var iS=document.createElement(`i`);function aS(e){let t=`&`+e+`;`;iS.innerHTML=t;let n=iS.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}var fee=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function pee(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?rS:u===`decimal`?nS:uee;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&eS.includes(y)&&(_=y,v=aS(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`?aS(y):!1;e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1))if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):rS(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(mee(e))h(7,S),C=`�`;else if(e in tS)h(6,S),C=tS[e];else{let t=``;hee(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,fee[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function mee(e){return e>=55296&&e<=57343||e>1114111}function hee(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var gee=/["&'<>`]/g,_ee=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,vee=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,yee=/[|\\{}()[\]^$+*?.]/g,oS=new WeakMap;function bee(e,t){if(e=e.replace(t.subset?xee(t.subset):gee,r),t.subset||t.escapeOnly)return e;return e.replace(_ee,n).replace(vee,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function xee(e){let t=oS.get(e);return t||(t=See(e),oS.set(e,t)),t}function See(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(yee,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}function Cee(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function wee(e,t){return bee(e,Object.assign({format:Cee},t))}function sS(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?lS(e.position):`start`in e||`end`in e?lS(e):`line`in e||`column`in e?cS(e):``}function cS(e){return uS(e&&e.line)+`:`+uS(e&&e.column)}function lS(e){return cS(e&&e.start)+`-`+cS(e&&e.end)}function uS(e){return e&&typeof e==`number`?e:1}var dS=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=sS(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};dS.prototype.file=``,dS.prototype.name=``,dS.prototype.reason=``,dS.prototype.message=``,dS.prototype.stack=``,dS.prototype.column=void 0,dS.prototype.line=void 0,dS.prototype.ancestors=void 0,dS.prototype.cause=void 0,dS.prototype.fatal=void 0,dS.prototype.place=void 0,dS.prototype.ruleId=void 0,dS.prototype.source=void 0;var fS=` `;function Tee(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new dS("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new dS(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new dS("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=pee(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new dS("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+sS(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new dS("Expected a closing tag for `"+S(r)+"` ("+sS({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new dS("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+sS(t.end)+") or another opening tag after the start of `"+t.type+"` ("+sS(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function Eee(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=hS,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=mS(pS(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null)if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&$x(e,n)>$x(e,o)?o:n;s=t+wee(e,{subset:[t]})+t}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+fS+m[e];b+=y.move(`
24
- `+m.join(`
25
- `)+`
26
- `+d)}else v&&(b+=y.move(` `+v));return u&&(b+=y.move((i||_?``:` `)+`/`)),b+=y.move(`>`),e.children&&e.children.length>0&&(e.type===`mdxJsxTextElement`?b+=y.move(s.containerPhrasing(e,{...y.current(),before:`>`,after:`<`})):(y.shift(2),b+=y.move(`
27
- `),b+=y.move(Dee(e,s,y.current())),b+=y.move(`
28
- `))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function Dee(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=mS(pS(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
29
- `,after:`
30
- `,...a.current()},u=t.handle(n,e,t,l),d=n.type===`mdxJsxFlowElement`?u:t.indentLines(u,function(e,t,n){return(n?``:o)+e});s.push(a.move(d)),n.type!==`list`&&(t.bulletLastUsed=void 0),c<i.length-1&&s.push(a.move(`
31
-
32
- `))}return r.pop(),s.join(``)}function pS(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function mS(e){return fS.repeat(e)}function hS(){return`<`}var gS=Object.prototype.hasOwnProperty;function _S(e,t,n){for(n of e.keys())if(vS(n,t))return n}function vS(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&vS(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i==`object`&&(i=_S(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i==`object`&&(i=_S(t,i),!i)||!vS(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e==`object`){for(n in r=0,e)if(gS.call(e,n)&&++r&&!gS.call(t,n)||!(n in t)||!vS(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var yS,bS,xS,SS,CS=!0;typeof process<`u`&&({FORCE_COLOR:yS,NODE_DISABLE_COLORS:bS,NO_COLOR:xS,TERM:SS}={},CS=process.stdout&&process.stdout.isTTY);var wS={enabled:!bS&&xS==null&&SS!==`dumb`&&(yS!=null&&yS!==`0`||CS),reset:DS(0,0),bold:DS(1,22),dim:DS(2,22),italic:DS(3,23),underline:DS(4,24),inverse:DS(7,27),hidden:DS(8,28),strikethrough:DS(9,29),black:DS(30,39),red:DS(31,39),green:DS(32,39),yellow:DS(33,39),blue:DS(34,39),magenta:DS(35,39),cyan:DS(36,39),white:DS(37,39),gray:DS(90,39),grey:DS(90,39),bgBlack:DS(40,49),bgRed:DS(41,49),bgGreen:DS(42,49),bgYellow:DS(43,49),bgBlue:DS(44,49),bgMagenta:DS(45,49),bgCyan:DS(46,49),bgWhite:DS(47,49)};function TS(e,t){let n=0,r,i=``,a=``;for(;n<e.length;n++)r=e[n],i+=r.open,a+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+a}function ES(e,t){let n={has:e,keys:t};return n.reset=wS.reset.bind(n),n.bold=wS.bold.bind(n),n.dim=wS.dim.bind(n),n.italic=wS.italic.bind(n),n.underline=wS.underline.bind(n),n.inverse=wS.inverse.bind(n),n.hidden=wS.hidden.bind(n),n.strikethrough=wS.strikethrough.bind(n),n.black=wS.black.bind(n),n.red=wS.red.bind(n),n.green=wS.green.bind(n),n.yellow=wS.yellow.bind(n),n.blue=wS.blue.bind(n),n.magenta=wS.magenta.bind(n),n.cyan=wS.cyan.bind(n),n.white=wS.white.bind(n),n.gray=wS.gray.bind(n),n.grey=wS.grey.bind(n),n.bgBlack=wS.bgBlack.bind(n),n.bgRed=wS.bgRed.bind(n),n.bgGreen=wS.bgGreen.bind(n),n.bgYellow=wS.bgYellow.bind(n),n.bgBlue=wS.bgBlue.bind(n),n.bgMagenta=wS.bgMagenta.bind(n),n.bgCyan=wS.bgCyan.bind(n),n.bgWhite=wS.bgWhite.bind(n),n}function DS(e,t){let n={open:`\x1b[${e}m`,close:`\x1b[${t}m`,rgx:RegExp(`\\x1b\\[${t}m`,`g`)};return function(t){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),t===void 0?this:wS.enabled?TS(this.keys,t+``):t+``):t===void 0?ES([e],[n]):wS.enabled?TS([n],t+``):t+``}}function OS(){}OS.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(kS(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function kS(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}var AS=new OS;function jS(e,t,n){return AS.diff(e,t,n)}var MS=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,NS=/\S/,PS=new OS;PS.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!NS.test(e)&&!NS.test(t)},PS.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&MS.test(t[n])&&MS.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var FS=new OS;FS.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
33
- `));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};function IS(e,t,n){return FS.diff(e,t,n)}var LS=new OS;LS.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var RS=new OS;RS.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function zS(e){"@babel/helpers - typeof";return zS=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},zS(e)}var BS=Object.prototype.toString,VS=new OS;VS.useLongestToken=!0,VS.tokenize=FS.tokenize,VS.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(HS(e,null,null,i),i,` `)},VS.equals=function(e,t){return OS.prototype.equals.call(VS,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`))};function HS(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));var a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(BS.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=HS(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),zS(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)e.hasOwnProperty(c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=HS(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var US=new OS;US.tokenize=function(e){return e.slice()},US.join=US.removeEmpty=function(e){return e};function WS(e,t,n){return US.diff(e,t,n)}var GS={"--":wS.red,"··":wS.grey,"++":wS.green},KS=wS.dim().italic,qS=wS.dim(`→`),JS=wS.dim(`·`),YS=wS.dim(`↵`),XS=(e,t)=>GS[e](e+QS(t))+`
34
- `,ZS=(e,t)=>wS.dim(`L`+String(e).padStart(t,`0`)+` `),QS=e=>e.replace(/[ ]/g,JS).replace(/\t/g,qS).replace(/(\r?\n)/g,YS);function $S(e,t,n){let r=e.removed?`--`:e.added?`++`:`··`,i=e.value.replace(/\r?\n$/,``).split(`
35
- `),a=0,o,s=``;for(e.added?s+=GS[r]().underline(KS(`Expected:`))+`
36
- `:e.removed&&(s+=GS[r]().underline(KS(`Actual:`))+`
37
- `);a<i.length;a++)o=i[a],o!=null&&(t&&(s+=ZS(t+a,n)),s+=XS(r,o||`
38
- `));return s}function eC(e,t){let n=WS(e,t),r=0,i=0,a=0,o,s,c,l,u,d=XS(`··`,`[`);for(;r<n.length;r++)for(c=(o=n[r]).removed?`--`:o.added?`++`:`··`,o.added?d+=GS[c]().underline(KS(`Expected:`))+`
39
- `:o.removed&&(d+=GS[c]().underline(KS(`Actual:`))+`
40
- `),i=0;i<o.value.length;i++)for(l=o.value[i]&&typeof o.value[i]==`object`,s=oC(o.value[i]).split(/\r?\n/g),a=0;a<s.length;)u=` `+s[a++]+(l?``:`,`),l&&a===s.length&&i+1<o.value.length&&(u+=`,`),d+=XS(c,u);return d+XS(`··`,`]`)}function tC(e,t,n=0){let r=0,i,a=``,o=IS(e,t),s=String(t.split(/\r?\n/g).length-n).length;for(;r<o.length;r++)a+=$S(i=o[r],n,s),n&&!i.removed&&(n+=i.count);return a}function nC(e,t){let n=jS(e,t),r=0,i=``,a,o=e.length,s=t.length,c=QS(e),l=QS(t);if(a=n[r],o!==s&&a.removed&&n[r+1]){let i=a.count-n[r+1].count;i==0||(i>0?(t=` `.repeat(i)+t,l=` `.repeat(i)+l,s+=i):i<0&&(e=` `.repeat(-i)+e,c=` `.repeat(-i)+c,o+=-i))}if(i+=rC(c,l,o,s),o===s)for(a=` `;r<o;r++)a+=e[r]===t[r]?` `:`^`;else for(a=` `;r<n.length;r++)a+=(n[r].added||n[r].removed?`^`:` `).repeat(Math.max(n[r].count,0)),r+1<n.length&&(n[r].added&&n[r+1].removed||n[r].removed&&n[r+1].added)&&(n[r+1].count-=n[r].count);return i+wS.red(a)}function rC(e,t,n=String(e).length,r=String(t).length){let i=4,a=Math.max(n,r),o=typeof e,s=typeof t;if(o!==s){i=2;let c=i+a-n,l=i+a-r;e+=` `.repeat(c)+wS.dim(`[${o}]`),t+=` `.repeat(l)+wS.dim(`[${s}]`),n+=c+o.length+2,r+=l+s.length+2,a=Math.max(n,r)}return GS[`++`](`++`+t+` `.repeat(i+a-r)+KS(`(Expected)`))+`
41
- `+GS[`--`](`--`+e+` `.repeat(i+a-n)+KS(`(Actual)`))+`
42
- `}function iC(e,t){var n,r=0,i,a=Array.isArray(e),o=[],s=a?Array(e.length):{};if(a)for(r=0;r<s.length;r++)i=e[r],!i||typeof i!=`object`?s[r]=i:s[r]=iC(i,t[r]);else{for(n in t)o.push(n);for(;r<o.length;r++)Object.prototype.hasOwnProperty.call(e,n=o[r])&&(!(i=e[n])||typeof i!=`object`?s[n]=i:s[n]=iC(i,t[n]));for(n in e)s.hasOwnProperty(n)||(s[n]=e[n])}return s}function aC(){var e=new Set;return function(t,n){return n===void 0?`[__VOID__]`:typeof n==`number`&&n!==n?`[__NAN__]`:typeof n==`bigint`?n.toString():!n||typeof n!=`object`?n:e.has(n)?`[Circular]`:(e.add(n),n)}}function oC(e){return JSON.stringify(e,aC(),2).replace(/"\[__NAN__\]"/g,`NaN`).replace(/"\[__VOID__\]"/g,`undefined`)}function sC(e,t){if(Array.isArray(t)&&Array.isArray(e))return eC(e,t);if(t instanceof RegExp)return nC(``+e,``+t);let n=e&&typeof e==`object`,r=t&&typeof t==`object`;return n&&r&&(e=iC(e,t)),r&&(t=oC(t)),n&&(e=oC(e)),t&&typeof t==`object`&&(e=oC(iC(e,t)),t=oC(t)),n=typeof e==`string`,r=typeof t==`string`,n&&/\r?\n/.test(e)?tC(e,``+t):r&&/\r?\n/.test(t)?tC(``+e,t):n&&r?nC(e,t):rC(e,t)}function cC(e){e=e.replace(/\r?\n/g,`
43
- `);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,i=(t||[]).length;for(;n<i;n++)r=Math.min(r,t[n].length);return i&&r?e.replace(RegExp(`^[ \\t]{${r}}`,`gm`),``):e}var lC=class extends Error{constructor(e={}){super(e.message),this.name=`Assertion`,this.code=`ERR_ASSERTION`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=e.details||!1,this.generated=!!e.generated,this.operator=e.operator,this.expects=e.expects,this.actual=e.actual}};function uC(e,t,n,r,i,a,o){if(e)return;let s=o||a;throw o instanceof Error?o:new lC({actual:t,expects:n,operator:r,message:s,details:i&&i(t,n),generated:!o})}function dC(e,t){uC(!!e,!1,!0,`ok`,!1,`Expected value to be truthy`,t)}function fC(e,t,n){uC(e===t,e,t,`is`,sC,`Expected values to be strictly equal:`,n)}function pC(e,t){uC(!e,!0,!1,`not`,!1,`Expected value to be falsey`,t)}pC.ok=pC,fC.not=function(e,t,n){uC(e!==t,e,t,`is.not`,!1,`Expected values not to be strictly equal`,n)},pC.equal=function(e,t,n){uC(!vS(e,t),e,t,`not.equal`,!1,`Expected values not to be deeply equal`,n)},pC.type=function(e,t,n){let r=typeof e;uC(r!==t,r,t,`not.type`,!1,`Expected "${r}" not to be "${t}"`,n)},pC.instance=function(e,t,n){let r="`"+(t.name||t.constructor.name)+"`";uC(!(e instanceof t),e,t,`not.instance`,!1,`Expected value not to be an instance of ${r}`,n)},pC.snapshot=function(e,t,n){e=cC(e),t=cC(t),uC(e!==t,e,t,`not.snapshot`,!1,`Expected value not to match snapshot`,n)},pC.fixture=function(e,t,n){e=cC(e),t=cC(t),uC(e!==t,e,t,`not.fixture`,!1,`Expected value not to match fixture`,n)},pC.match=function(e,t,n){typeof t==`string`?uC(!e.includes(t),e,t,`not.match`,!1,`Expected value not to include "${t}" substring`,n):uC(!t.test(e),e,t,`not.match`,!1,`Expected value not to match \`${String(t)}\` pattern`,n)},pC.throws=function(e,t,n){!n&&typeof t==`string`&&(n=t,t=null);try{e()}catch(e){typeof t==`function`?uC(!t(e),!0,!1,`not.throws`,!1,`Expected function not to throw matching exception`,n):t instanceof RegExp?uC(!t.test(e.message),!0,!1,`not.throws`,!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,n):t||uC(!1,!0,!1,`not.throws`,!1,`Expected function not to throw`,n)}};var mC={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},hC={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},gC={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},_C=`highlightSequenceTemporary`,vC=`highlightSequence`,yC=`highlight`,bC=`highlightText`;function xC(){let e={name:`highlight`,tokenize:n,resolveAll:t};return{text:{[mC.equalsTo]:e},insideSpan:{null:[e]},attentionMarkers:{null:[mC.equalsTo]}};function t(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===_C&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===_C&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=vC,e[r][1].type=vC;let i={type:yC,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:bC,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Sx(o,o.length,0,Lx(s,e.slice(r+1,n),t)),Sx(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Sx(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===_C&&(e[n][1].type=gC.data);return e}function n(e,t,n){let r=this.previous,i=this.events,a=0;return o;function o(t){return dC(t===mC.equalsTo,"expected `=`"),r===mC.equalsTo&&i[i.length-1][1].type!==gC.characterEscape?n(t):(e.enter(_C),s(t))}function s(i){let o=Ix(r);if(i===mC.equalsTo)return a>1?n(i):(e.consume(i),a++,s);if(a<2)return n(i);let c=e.exit(_C),l=Ix(i);return c._open=!l||l===hC.attentionSideAfter&&!!o,c._close=!o||o===hC.attentionSideAfter&&!!l,t(i)}}}var SC=/[$_\p{ID_Start}]/u,CC=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,wC=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,TC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,EC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,DC={};function OC(e){return e?SC.test(String.fromCodePoint(e)):!1}function kC(e,t){let n=(t||DC).jsx?wC:CC;return e?n.test(String.fromCodePoint(e)):!1}function AC(e,t){return((t||DC).jsx?EC:TC).test(e)}function jC(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Mx(r)?(e.enter(n),s(r)):t(r)}function s(r){return Mx(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function MC(e){return e}var NC={}.hasOwnProperty,PC=Symbol(`continue`),FC=Symbol(`exit`),IC=Symbol(`skip`);function LC(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return zC(e)&&(s.displayName=`node (`+MC(e.type)+`)`),s;function s(){let s=n?RC(n(e,t,a,o)):[];if(s[0]===FC)return s;if(s[0]!==IC){let t;for(t in e)if(NC.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(zC(r)){let e=i(r,t,a,n)();if(e[0]===FC)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(zC(r)){let e=i(r,t,void 0,n)();if(e[0]===FC)return e}}}return r?RC(r(e,t,a,o)):s}}}function RC(e){return Array.isArray(e)?e:typeof e==`number`?[PC,e]:[e]}function zC(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function BC(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=HC(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&VC(m);if(g&&!t.allowEmpty)throw new dS(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g)if(VC(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}if(u){if(u.comments=a,LC(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=UC(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function VC(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function HC(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=WC(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function UC(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function WC(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
44
- `;break;case-3:a=`\r
45
- `;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function GC(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=KC(n.start,r[0]||t.start),a=KC(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function KC(e,t){if(e&&typeof e==`object`){let n=`line`in e?qC(e.line):void 0,r=`column`in e?qC(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:qC(t)}}}function qC(e){return typeof e==`number`&&e>-1?e:void 0}var JC=2,YC=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,XC=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,ZC=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,QC=`#unexpected-type-in-code-expected-an-object-spread-spread`,$C=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,ew=`#could-not-parse-expression-with-acorn`;function tw(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new dS("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=YC+XC,e}if(q(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?nw.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||q(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new dS("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=YC+ZC,e}return Mx(t)?jC(e,_,`linePrefix`,JC+1)(t):_(t)}}function nw(e,t,n,r,i,a,o){let s=BC(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=GC(e),n=new dS("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=YC+QC,n}if(e.expression.properties[1]){let t=new dS(`Unexpected extra content in spread: only a single spread is supported`,{place:GC(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=YC+$C,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=GC(e.expression.properties[0]),n=new dS("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=YC+QC,n}}if(s.error){let e=new dS(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=YC+ew,{type:`nok`,message:e}}return{type:`ok`,estree:c}}var rw=`https://github.com/micromark/micromark-extension-mdx-jsx`;function iw(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j){let M=this,N,P;return F;function F(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),ee}function ee(e){return jx(e)?n(e):(N=te,we(e))}function te(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),N=ne,we;if(t===62)return Ce(t);if(t!==null&&t>=0&&OC(t))return e.enter(d),e.enter(f),e.consume(t),re;De(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function ne(t){if(t===62)return Ce(t);if(t!==null&&t>=0&&OC(t))return e.enter(d),e.enter(f),e.consume(t),re;De(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function re(t){if(t!==null&&t>=0&&kC(t,{jsx:!0}))return e.consume(t),re;if(t===46||t===47||t===58||t===62||t===123||jx(t)||Px(t))return e.exit(f),N=ie,we(t);De(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function ie(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=ae,we;if(t===58)return e.enter(h),e.consume(t),e.exit(h),N=ce,we;if(t===47||t===62||t===123||t!==null&&t>=0&&OC(t))return e.exit(d),de(t);De(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ae(t){if(t!==null&&t>=0&&OC(t))return e.enter(m),e.consume(t),oe;De(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function oe(t){if(t!==null&&t>=0&&kC(t,{jsx:!0}))return e.consume(t),oe;if(t===46||t===47||t===62||t===123||jx(t)||Px(t))return e.exit(m),N=se,we(t);De(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function se(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=ae,we;if(t===47||t===62||t===123||t!==null&&t>=0&&OC(t))return e.exit(d),de(t);De(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ce(t){if(t!==null&&t>=0&&OC(t))return e.enter(g),e.consume(t),le;De(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function le(t){if(t!==null&&t>=0&&kC(t,{jsx:!0}))return e.consume(t),le;if(t===47||t===62||t===123||jx(t)||Px(t))return e.exit(g),N=ue,we(t);De(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ue(t){if(t===47||t===62||t===123||t!==null&&t>=0&&OC(t))return e.exit(d),de(t);De(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function de(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),N=Se,we;if(t===62)return Ce(t);if(t===123)return tw.call(M,e,fe,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&OC(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),pe;De(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function fe(e){return N=de,we(e)}function pe(t){if(t!==null&&t>=0&&kC(t,{jsx:!0}))return e.consume(t),pe;if(t===47||t===58||t===61||t===62||t===123||jx(t)||Px(t))return e.exit(S),N=me,we(t);De(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function me(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),N=he,we;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),N=ve,we;if(t===47||t===62||t===123||jx(t)||Px(t)||t!==null&&t>=0&&OC(t))return e.exit(x),e.exit(b),N=de,we(t);De(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function he(t){if(t!==null&&t>=0&&OC(t))return e.enter(w),e.consume(t),ge;De(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ge(t){if(t!==null&&t>=0&&kC(t,{jsx:!0}))return e.consume(t),ge;if(t===47||t===61||t===62||t===123||jx(t)||Px(t))return e.exit(w),e.exit(x),N=_e,we(t);De(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function _e(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),N=ve,we;if(t===47||t===62||t===123||t!==null&&t>=0&&OC(t))return e.exit(b),de(t);De(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ve(t){if(t===34||t===39)return e.enter(E),e.enter(D),e.consume(t),e.exit(D),P=t,be;if(t===123)return tw.call(M,e,ye,k,A,j,r,i,a,!1,!1,o)(t);De(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function ye(t){return e.exit(b),N=de,we(t)}function be(t){return t===null&&De(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(P)+"`"),t===P?(e.enter(D),e.consume(t),e.exit(D),e.exit(E),e.exit(b),P=void 0,N=de,we):q(t)?(N=be,we(t)):(e.enter(O),xe(t))}function xe(t){return t===null||t===P||q(t)?(e.exit(O),be(t)):(e.consume(t),xe)}function Se(e){if(e===62)return Ce(e);De(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Ce(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function we(t){return q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Ee):Mx(t)||Px(t)?(e.enter(`esWhitespace`),Te(t)):N(t)}function Te(t){return q(t)?(e.exit(`esWhitespace`),we(t)):Mx(t)||Px(t)?(e.consume(t),Te):(e.exit(`esWhitespace`),N(t))}function Ee(e){if(!o&&M.parser.lazy[M.now().line]){let e=new dS("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",M.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=rw+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return we(e)}function De(e,t,n){let r=new dS(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+aw(e)+`)`)+` `+t+`, expected `+n,M.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=rw+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function aw(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function ow(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return iw.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function sw(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return iw.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return Mx(e)?jC(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||q(e)?r(e):i(e)}}}function cw(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:sw(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:ow(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function lw(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}var uw={}.hasOwnProperty;function dw(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&uw.call(t,e)){let n=String(t[e]);i=uw.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var fw={}.hasOwnProperty;function pw(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)pw(e,t.extensions[n]);for(r in t)if(fw.call(t,r))switch(r){case`extensions`:break;case`unsafe`:mw(e[r],t[r]);break;case`join`:mw(e[r],t[r]);break;case`handlers`:hw(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function mw(e,t){t&&e.push(...t)}function hw(e,t){t&&Object.assign(e,t)}function gw(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),_w);return i(),o}function _w(e,t,n){return`>`+(n?``:` `)+e}function vw(e,t){return yw(e,t.inConstruct,!0)&&!yw(e,t.notInConstruct,!1)}function yw(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function bw(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
46
- `&&vw(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
47
- `}function xw(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Sw(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Cw(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function ww(e,t,n,r){let i=Cw(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Sw(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Tw);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(xw(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
48
- `,encode:["`"],...s.current()})),t()}return u+=s.move(`
49
- `),a&&(u+=s.move(a+`
50
- `)),u+=s.move(c),l(),u}function Tw(e,t,n){return(n?``:` `)+e}function Ew(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Dw(e,t,n,r){let i=Ew(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
51
- `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Ow(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function kw(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Aw(e,t,n){let r=Ix(e),i=Ix(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}jw.peek=Mw;function jw(e,t,n,r){let i=Ow(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Aw(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=kw(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Aw(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+kw(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Mw(e,t,n){return n.options.emphasis||`*`}var Nw=(function(e){if(e==null)return Rw;if(typeof e==`function`)return Lw(e);if(typeof e==`object`)return Array.isArray(e)?Pw(e):Fw(e);if(typeof e==`string`)return Iw(e);throw Error(`Expected function, string, or object as test`)});function Pw(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Nw(e[n]);return Lw(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Fw(e){let t=e;return Lw(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Iw(e){return Lw(t);function t(t){return t&&t.type===e}}function Lw(e){return t;function t(t,n,r){return!!(zw(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Rw(){return!0}function zw(e){return typeof e==`object`&&!!e&&`type`in e}function Bw(e){return e}var Vw=[];function Hw(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Nw(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+Bw(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Vw,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Uw(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Uw(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Vw:[e]}function Ww(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Hw(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Gw={};function Kw(e,t){let n=t||Gw;return qw(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function qw(e,t,n){if(Yw(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Jw(e.children,t,n)}return Array.isArray(e)?Jw(e,t,n):``}function Jw(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=qw(e[i],t,n);return r.join(``)}function Yw(e){return!!(e&&typeof e==`object`)}function Xw(e,t){let n=!1;return Ww(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Kw(e)&&(t.options.setext||n))}function Zw(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Xw(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
52
- `,after:`
53
- `});return r(),t(),o+`
54
- `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
55
- `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
56
- `,...a.current()});return/^[\t ]/.test(l)&&(l=kw(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Qw.peek=$w;function Qw(e){return e.value||``}function $w(){return`<`}eT.peek=tT;function eT(e,t,n,r){let i=Ew(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function tT(){return`!`}nT.peek=rT;function nT(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function rT(){return`!`}iT.peek=aT;function iT(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function aT(){return"`"}function oT(e,t){let n=Kw(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}sT.peek=cT;function sT(e,t,n,r){let i=Ew(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(oT(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function cT(e,t,n){return oT(e,n)?`<`:`[`}lT.peek=uT;function lT(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function uT(){return`[`}function dT(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function fT(e){let t=dT(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function pT(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function mT(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function hT(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?pT(n):dT(n),s=e.ordered?o===`.`?`)`:`.`:fT(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),mT(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function gT(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function _T(e,t,n,r){let i=gT(n),a=n.bulletCurrent||dT(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function vT(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var yT=Nw([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function bT(e,t,n,r){return(e.children.some(function(e){return yT(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function xT(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ST.peek=CT;function ST(e,t,n,r){let i=xT(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Aw(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=kw(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Aw(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+kw(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function CT(e,t,n){return n.options.strong||`*`}function wT(e,t,n,r){return n.safe(e.value,r)}function TT(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function ET(e,t,n){let r=(mT(n)+(n.options.ruleSpaces?` `:``)).repeat(TT(n));return n.options.ruleSpaces?r.slice(0,-1):r}var DT={blockquote:gw,break:bw,code:ww,definition:Dw,emphasis:jw,hardBreak:bw,heading:Zw,html:Qw,image:eT,imageReference:nT,inlineCode:iT,link:sT,linkReference:lT,list:hT,listItem:_T,paragraph:vT,root:bT,strong:ST,text:wT,thematicBreak:ET},OT=[kT];function kT(e,t,n,r){if(t.type===`code`&&Sw(t,r)&&(e.type===`list`||e.type===t.type&&Sw(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&Xw(t,r))?void 0:+!!n.spread}var AT=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],jT=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
57
- `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:AT},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
58
- ]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:AT},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
59
- *])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:AT},{atBreak:!0,character:`+`,after:`(?:[ \r
60
- ])`},{atBreak:!0,character:`-`,after:`(?:[ \r
61
- -])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
62
- ]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:AT},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:AT},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:AT},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:AT},{atBreak:!0,character:`~`}];function MT(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var NT=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function PT(e){return e.replace(NT,FT)}function FT(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return MT(n.slice(t?2:1),t?16:10)}return aS(n)||e}function IT(e){return e.label||!e.identifier?e.label||``:PT(e.identifier)}function LT(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function RT(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
63
- `)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=kw(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+kw(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function zT(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
64
- `,after:`
65
- `,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(BT(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function BT(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
66
- `.repeat(1+a);if(a===!1)return`
67
-
68
- <!---->
69
-
70
- `}return`
71
-
72
- `}var VT=/\r?\n|\r/g;function HT(e,t){let n=[],r=0,i=0,a;for(;a=VT.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function UT(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!vw(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(WT);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(GT(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(kw(r.charCodeAt(e))),c++))}return a.push(GT(r.slice(c,l),n.after)),a.join(``)}function WT(e,t){return e-t}function GT(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function KT(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function qT(e,t){let n=t||{},r={associationId:IT,containerPhrasing:ZT,containerFlow:QT,createTracker:KT,compilePattern:LT,enter:a,handlers:{...DT},handle:void 0,indentLines:HT,indexStack:[],join:[...OT],options:{},safe:$T,stack:[],unsafe:[...jT]};pw(r,n),r.options.tightDefinitions&&r.join.push(XT),r.handle=dw(`type`,{invalid:JT,unknown:YT,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
73
- `,after:`
74
- `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
75
- `),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function JT(e){throw Error("Cannot handle value `"+e+"`, expected node")}function YT(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function XT(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function ZT(e,t){return RT(e,this,t)}function QT(e,t){return zT(e,this,t)}function $T(e,t){return UT(this,e,t)}var eE=[`mdxJsxTextElement`,`mdxJsxFlowElement`];function tE(e){return eE.includes(e.type)&&nE.includes(e.name)}var nE=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.input.ins.kbd.label.legend.li.link.main.map.mark.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.section.select.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`);function rE(e,t){let n=iE(e),r=iE(t);return aE({...n,...r})}function iE(e){let t={};return e.split(`;`).filter(e=>e.trim()!==``).forEach(e=>{let[n,r]=e.split(`:`).map(e=>e.trim());t[n]=r}),t}function aE(e){return Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`; `)}function oE(e){return e.children instanceof Array}function sE({root:e,visitors:t,jsxComponentDescriptors:n,jsxIsAvailable:r,addImportStatements:i=!0}){let a=null,o=new Set,s=new Map;t=t.sort((e,t)=>(t.priority??0)-(e.priority??0)),d(e,null);function c(e,t){o.add(e),t&&s.set(e,{...t})}function l(e,n){if(a===null)return a=n,a;if(!oE(e))throw Error(`Attempting to append children to a non-parent`);let r=e.children,i=r.at(-1);if(i){let e=t.find(e=>e.shouldJoin?.call(e,i,n));if(e){let t=e.join(i,n);return r.splice(r.length-1,1,t),t}}return r.push(n),n}function u(e,t){e.getChildren().forEach(e=>{d(e,t)})}function d(e,n,r=null){var i;let a=t.find((t,n)=>r?.has(n)?!1:t.testLexicalNode?.call(t,e));if(!a)throw Error(`no lexical visitor found for ${e.getType()}`,{cause:e});(i=a.visitLexicalNode)==null||i.call(a,{lexicalNode:e,mdastParent:n,actions:{addAndStepInto(t,r={},i=!0){let a={type:t,...r,...i?{children:[]}:{}};l(n,a),G(e)&&i&&u(e,a)},appendToParent:l,visitChildren:u,visit:d,registerReferredComponent:c,nextVisitor(){d(e,n,(r??new Set).add(t.indexOf(a)))}}})}if(a===null)throw Error(`traversal ended with no root element`);let f=new Map,p=new Map;for(let e of o){let t=n.find(t=>t.name===e)??s.get(e)??n.find(e=>e.name===`*`);if(!t)throw Error(`Component ${e} is used but not imported`);if(t.source)if(t.defaultExport)p.set(e,t.source);else{let{source:n}=t,r=f.get(n);r?r.push(e):f.set(n,[e])}}if(!i){for(let[e,t]of f.entries()){let n=t.filter(e=>s.has(e));n.length>0?f.set(e,n):f.delete(e)}for(let e of p.keys())s.has(e)||p.delete(e)}let m=Array.from(f).map(([e,t])=>({type:`mdxjsEsm`,value:`import { ${t.join(`, `)} } from '${e}'`}));m.push(...Array.from(p).map(([e,t])=>({type:`mdxjsEsm`,value:`import ${e} from '${t}'`})));let h=a,g=h.children.find(e=>e.type===`yaml`);return g?h.children.splice(h.children.indexOf(g)+1,0,...m):h.children.unshift(...m),fE(h,[]),cE(h),r||lE(h),h}function cE(e){if(`children`in e&&e.children.length>0){if(tE(e)&&e.children.length===1){let t=e.children[0];t.type===`mdxJsxTextElement`&&t.name===`span`&&(t.attributes.forEach(t=>{if(t.type===`mdxJsxAttribute`){let n=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===t.name);if(n)if(t.name===`className`){let e=new Set([...n.value.split(` `),...t.value.split(` `)]);n.value=Array.from(e).join(` `)}else t.name===`style`&&(n.value=rE(n.value,t.value));else e.attributes.push(t)}}),e.children=t.children)}e.children.forEach(e=>{cE(e)})}}function lE(e){if(Object.hasOwn(e,`children`)){let t=e,n=[];t.children.forEach(e=>{e.type===`mdxJsxTextElement`&&e.name===`u`?n.push({type:`html`,value:`<u>`},...e.children,{type:`html`,value:`</u>`}):(n.push(e),lE(e))}),t.children=n}}var uE=/\s+$/,dE=/^\s+/;function fE(e,t){if(e.type===`strong`||e.type===`emphasis`){let n=e.children.at(-1);if(n?.type===`text`){let r=uE.exec(n.value);if(r){n.value=n.value.replace(uE,``);let i=t.at(-1);i&&(i.children.splice(i.children.indexOf(e)+1,0,{type:`text`,value:r[0]}),fE(i,t.slice(0,-1)))}}let r=e.children.at(0);if(r?.type===`text`){let n=dE.exec(r.value);if(n){r.value=r.value.replace(dE,``);let i=t.at(-1);i&&(i.children.splice(i.children.indexOf(e),0,{type:`text`,value:n[0]}),fE(i,t.slice(0,-1)))}}}if(`children`in e&&e.children.length>0){let n=e;n.children.forEach(e=>{fE(e,[...t,n])})}}function pE({root:e,toMarkdownOptions:t,toMarkdownExtensions:n,visitors:r,jsxComponentDescriptors:i,jsxIsAvailable:a}){return qT(sE({root:e,visitors:r,jsxComponentDescriptors:i,jsxIsAvailable:a}),{extensions:n,...t})+`
76
- `}var mE={}.hasOwnProperty;function hE(e){let t={},n=-1;for(;++n<e.length;)gE(t,e[n]);return t}function gE(e,t){let n;for(n in t){let r=(mE.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){mE.call(r,a)||(r[a]=[]);let e=i[a];_E(r[a],Array.isArray(e)?e:e?[e]:[])}}}function _E(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Sx(e,0,0,r)}function vE(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}function yE(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Tx(e.charCodeAt(n+1))&&Tx(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}var bE={tokenize:xE};function xE(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),jC(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var SE={tokenize:wE},CE={tokenize:TE};function wE(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Sx(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(CE,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(CE,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return q(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Sx(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function TE(e,t,n){return jC(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var EE={name:`attention`,resolveAll:DE,tokenize:OE};function DE(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};kE(d,-c),kE(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Cx(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Cx(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Cx(l,Lx(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Cx(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Cx(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Sx(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function OE(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ix(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Ix(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function kE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var AE={name:`autolink`,tokenize:jE};function jE(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return wx(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Tx(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Tx(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Dx(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Ex(t)?(e.consume(t),l):n(t)}function u(e){return Tx(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Tx(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var ME={partial:!0,tokenize:NE};function NE(e,t,n){return r;function r(t){return Mx(t)?jC(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||q(e)?t(e):n(e)}}var PE={continuation:{tokenize:IE},exit:LE,name:`blockQuote`,tokenize:FE};function FE(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Mx(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function IE(e,t,n){let r=this;return i;function i(t){return Mx(t)?jC(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(PE,t,n)(r)}}function LE(e){e.exit(`blockQuote`)}var RE={name:`characterEscape`,tokenize:zE};function zE(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Ax(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var BE={name:`characterReference`,tokenize:VE};function VE(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Tx,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=kx,u):(e.enter(`characterReferenceValue`),a=7,o=Ox,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Tx&&!aS(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var HE={partial:!0,tokenize:GE},UE={concrete:!0,name:`codeFenced`,tokenize:WE};function WE(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Mx(t)?jC(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(HE,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Mx(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),jC(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Mx(t)?jC(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||q(t)?e.check(HE,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||q(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Mx(t)?jC(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Mx(t)?jC(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function GE(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var KE={name:`codeIndented`,tokenize:JE},qE={partial:!0,tokenize:YE};function JE(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),jC(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):q(t)?e.attempt(qE,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||q(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function YE(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):jC(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):q(e)?i(e):n(e)}}var XE={name:`codeText`,previous:QE,resolve:ZE,tokenize:$E};function ZE(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function QE(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function $E(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||q(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var eD=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&tD(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),tD(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tD(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);tD(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tD(this.left,t.reverse())}}};function tD(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function nD(e){let t={},n=-1,r,i,a,o,s,c,l,u=new eD(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,rD(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Sx(e,0,1/0,u.slice(0)),!l}function rD(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var iD={resolve:oD,tokenize:sD},aD={partial:!0,tokenize:cD};function oD(e){return nD(e),e}function sD(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):q(t)?e.check(aD,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function cD(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),jC(e,a,`linePrefix`)}function a(i){if(i===null||q(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function lD(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Dx(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||q(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||jx(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Dx(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function uD(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):q(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Mx(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function dD(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),jC(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||q(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function fD(e,t){let n;return r;function r(i){return q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Mx(i)?jC(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var pD={name:`definition`,tokenize:hD},mD={partial:!0,tokenize:gD};function hD(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return uD.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=vE(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return jx(t)?fD(e,l)(t):l(t)}function l(t){return lD(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(mD,d,d)(t)}function d(t){return Mx(t)?jC(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function gD(e,t,n){return r;function r(t){return jx(t)?fD(e,i)(t):n(t)}function i(t){return dD(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Mx(t)?jC(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||q(e)?t(e):n(e)}}var _D={name:`hardBreakEscape`,tokenize:Oee};function Oee(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var kee={name:`headingAtx`,resolve:Aee,tokenize:jee};function Aee(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Sx(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function jee(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||jx(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||q(n)?(e.exit(`atxHeading`),t(n)):Mx(n)?jC(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||jx(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Mee=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),vD=[`pre`,`script`,`style`,`textarea`],Nee={concrete:!0,name:`htmlFlow`,resolveTo:Iee,tokenize:Lee},Pee={partial:!0,tokenize:zee},Fee={partial:!0,tokenize:Ree};function Iee(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Lee(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ee):wx(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):wx(a)?(e.consume(a),i=4,r.interrupt?t:ee):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ee):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return wx(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||jx(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&vD.includes(l)?(i=1,r.interrupt?t(s):O(s)):Mee.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Tx(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Mx(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||wx(t)?(e.consume(t),b):Mx(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Tx(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Mx(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Mx(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||q(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||jx(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Mx(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||q(t)?O(t):Mx(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),te):t===63&&i===3?(e.consume(t),ee):t===93&&i===5?(e.consume(t),F):q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Pee,ne,k)(t)):t===null||q(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Fee,A,ne)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||q(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),ee):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return vD.includes(n)?(e.consume(t),te):O(t)}return wx(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),ee):O(t)}function ee(t){return t===62?(e.consume(t),te):t===45&&i===2?(e.consume(t),ee):O(t)}function te(t){return t===null||q(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),te)}function ne(n){return e.exit(`htmlFlow`),t(n)}}function Ree(e,t,n){let r=this;return i;function i(t){return q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function zee(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ME,t,n)}}var Bee={name:`htmlText`,tokenize:Vee};function Vee(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):wx(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):wx(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):q(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):q(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):q(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):q(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return wx(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Tx(t)?(e.consume(t),S):C(t)}function C(t){return q(t)?(o=C,N(t)):Mx(t)?(e.consume(t),C):M(t)}function w(t){return t===45||Tx(t)?(e.consume(t),w):t===47||t===62||jx(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||wx(t)?(e.consume(t),E):q(t)?(o=T,N(t)):Mx(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||Tx(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):q(t)?(o=D,N(t)):Mx(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):q(t)?(o=O,N(t)):Mx(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):q(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||jx(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||jx(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return Mx(t)?jC(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var yD={name:`labelEnd`,resolveAll:Gee,resolveTo:Kee,tokenize:qee},Hee={tokenize:Jee},Uee={tokenize:Yee},Wee={tokenize:Xee};function Gee(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Sx(e,0,e.length,n),e}function Kee(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Cx(s,e.slice(a+1,a+r+3)),s=Cx(s,[[`enter`,u,t]]),s=Cx(s,Lx(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Cx(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Cx(s,e.slice(o+1)),s=Cx(s,[[`exit`,c,t]]),Sx(e,a,e.length,s),e}function qee(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(vE(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Hee,u,o?u:d)(t):t===91?e.attempt(Uee,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Wee,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Jee(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return jx(t)?fD(e,a)(t):a(t)}function a(t){return t===41?u(t):lD(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return jx(t)?fD(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?dD(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return jx(t)?fD(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Yee(e,t,n){let r=this;return i;function i(t){return uD.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(vE(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Xee(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Zee={name:`labelStartImage`,resolveAll:yD.resolveAll,tokenize:Qee};function Qee(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var $ee={name:`labelStartLink`,resolveAll:yD.resolveAll,tokenize:ete};function ete(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var bD={name:`lineEnding`,tokenize:tte};function tte(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),jC(e,t,`linePrefix`)}}var xD={name:`thematicBreak`,tokenize:SD};function SD(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Mx(t)?jC(e,s,`whitespace`)(t):s(t))}}var CD={continuation:{tokenize:ate},exit:ste,name:`list`,tokenize:ite},nte={partial:!0,tokenize:cte},rte={partial:!0,tokenize:ote};function ite(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Ox(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(xD,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Ox(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(ME,r.interrupt?n:u,e.attempt(nte,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Mx(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function ate(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ME,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,jC(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Mx(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(rte,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,jC(e,e.attempt(CD,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ote(e,t,n){let r=this;return jC(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function ste(e){e.exit(this.containerState.type)}function cte(e,t,n){let r=this;return jC(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Mx(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var wD={name:`setextUnderline`,resolveTo:lte,tokenize:ute};function lte(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function ute(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Mx(t)?jC(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var dte={tokenize:fte};function fte(e){let t=this,n=e.attempt(ME,r,e.attempt(this.parser.constructs.flowInitial,i,jC(e,e.attempt(this.parser.constructs.flow,i,e.attempt(iD,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var pte={resolveAll:ED()},mte=TD(`string`),hte=TD(`text`);function TD(e){return{resolveAll:ED(e===`text`?gte:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function ED(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function gte(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var _te=e({attentionMarkers:()=>Tte,contentInitial:()=>yte,disable:()=>Ete,document:()=>vte,flow:()=>xte,flowInitial:()=>bte,insideSpan:()=>wte,string:()=>Ste,text:()=>Cte}),vte={42:CD,43:CD,45:CD,48:CD,49:CD,50:CD,51:CD,52:CD,53:CD,54:CD,55:CD,56:CD,57:CD,62:PE},yte={91:pD},bte={[-2]:KE,[-1]:KE,32:KE},xte={35:kee,42:xD,45:[wD,xD],60:Nee,61:wD,95:xD,96:UE,126:UE},Ste={38:BE,92:RE},Cte={[-5]:bD,[-4]:bD,[-3]:bD,33:Zee,38:BE,42:EE,60:[AE,Bee],91:$ee,92:[_D,RE],93:yD,95:EE,96:XE},wte={null:[EE,pte]},Tte={null:[42,95]},Ete={null:[]};function Dte(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Cx(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Lx(a,l.events,l),l.events):[]}function f(e,t){return kte(p(e),t)}function p(e){return Ote(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){q(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Sx(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ote(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function kte(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
77
- `;break;case-3:o=`\r
78
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function DD(e){let t={constructs:hE([_te,...(e||{}).extensions||[]]),content:n(bE),defined:[],document:n(SE),flow:n(dte),lazy:{},string:n(mte),text:n(hte)};return t;function n(e){return n;function n(n){return Dte(t,e,n)}}}function OD(e){for(;!nD(e););return e}var kD=/[\0\t\n\r]/g;function AD(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(kD.lastIndex=u,c=kD.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var jD={}.hasOwnProperty;function MD(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),ND(n)(OD(DD(n).document().write(AD()(e,t,!0))))}function ND(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ye),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(he),blockQuote:a(ue),characterEscape:T,characterReference:T,codeFenced:a(de),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(de,o),codeText:a(fe,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(pe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(me),hardBreakEscape:a(ge),hardBreakTrailing:a(ge),htmlFlow:a(_e,o),htmlFlowData:T,htmlText:a(_e,o),htmlTextData:T,image:a(ve),label:o,link:a(ye),listItem:a(xe),listItemValue:f,listOrdered:a(be,d),listUnordered:a(be),paragraph:a(Se),reference:re,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(he),strong:a(Ce),thematicBreak:a(Te)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:le,autolinkProtocol:ce,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:oe,characterReference:se,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:ee,resourceTitleString:te,resource:ne,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};FD(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];jD.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||LD).call(a,void 0,e[0])}for(r.position={start:PD(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:PD(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:PD(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||LD).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+sS({start:e.start,end:e.end})+`): it’s not open`);n.position.end=PD(e.end)}function u(){return Kw(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=vE(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=we(),n.position={start:PD(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=PD(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=PD(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=PT(t),n.identifier=vE(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ne(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=vE(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ae(e){this.data.characterReferenceType=e.type}function oe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=MT(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=aS(t);let i=this.stack[this.stack.length-1];i.value+=r}function se(e){let t=this.stack.pop();t.position.end=PD(e.end)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function le(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ue(){return{type:`blockquote`,children:[]}}function de(){return{type:`code`,lang:null,meta:null,value:``}}function fe(){return{type:`inlineCode`,value:``}}function pe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function me(){return{type:`emphasis`,children:[]}}function he(){return{type:`heading`,depth:0,children:[]}}function ge(){return{type:`break`}}function _e(){return{type:`html`,value:``}}function ve(){return{type:`image`,title:null,url:``,alt:null}}function ye(){return{type:`link`,title:null,url:``,children:[]}}function be(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function xe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Se(){return{type:`paragraph`,children:[]}}function Ce(){return{type:`strong`,children:[]}}function we(){return{type:`text`,value:``}}function Te(){return{type:`thematicBreak`}}}function PD(e){return{line:e.line,column:e.column,offset:e.offset}}function FD(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?FD(e,r):ID(e,r)}}function ID(e,t){let n;for(n in t)if(jD.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function LD(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+sS({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sS({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+sS({start:t.start,end:t.end})+`) is still open`)}function RD(e){return e.children instanceof Array}var zD=class extends Error{constructor(e,t){super(e),this.name=`MarkdownParseError`,this.cause=t}},BD=class extends Error{constructor(e){super(e),this.name=`UnrecognizedMarkdownConstructError`}};function VD(e){let t=new Map;return e.type===`root`?(e.children.filter(e=>e.type===`mdxjsEsm`).filter(e=>e.value.startsWith(`import `)).forEach(e=>{(e.data?.estree?.body??[]).forEach(e=>{e.type===`ImportDeclaration`&&e.specifiers.forEach(n=>{t.set(n.local.name,{source:`${e.source.value}`,defaultExport:n.type===`ImportDefaultSpecifier`})})})}),{importDeclarations:Object.fromEntries(t.entries())}):{importDeclarations:{}}}function HD({root:e,markdown:t,visitors:n,syntaxExtensions:r,mdastExtensions:i,...a}){let o;try{o=MD(t,{extensions:r,mdastExtensions:i})}catch(e){throw e instanceof Error?new zD(`Error parsing markdown: ${e.message}`,e):new zD(`Error parsing markdown: ${e}`,e)}o.children.length===0&&o.children.push({type:`paragraph`,children:[]}),o.children.at(-1)?.type!==`paragraph`&&o.children.push({type:`paragraph`,children:[]}),UD({root:e,mdastRoot:o,visitors:n,...a})}function UD({root:e,mdastRoot:t,visitors:n,...r}){let i=new WeakMap,a=new WeakMap,o=VD(t);n=n.sort((e,t)=>(t.priority??0)-(e.priority??0));function s(e,t){if(!RD(e))throw Error(`Attempting to visit children of a non-parent`);e.children.forEach(n=>{c(n,t,e)})}function c(e,t,l,u=null){let d=n.find((t,n)=>u?.has(n)?!1:typeof t.testNode==`string`?t.testNode===e.type:t.testNode(e,r));if(!d)try{throw new BD(`Unsupported markdown syntax: ${qT(e)}`)}catch{throw new BD(`Parsing of the following markdown structure failed: ${JSON.stringify({type:e.type,name:`name`in e?e.name:`N/A`})}`)}d.visitNode({mdastNode:e,lexicalParent:t,mdastParent:l,descriptors:r,metaData:o,actions:{visitChildren:s,nextVisitor(){c(e,t,l,(u??new Set).add(n.indexOf(d)))},addAndStepInto(n){t.append(n),RD(e)&&s(e,n)},addFormatting(t,n){n||RD(e)&&(n=e),n&&i.set(n,t|(i.get(l)??0))},removeFormatting(t,n){n||RD(e)&&(n=e),n&&i.set(n,t^(i.get(l)??0))},getParentFormatting(){return i.get(l)??0},addStyle(t,n){n||RD(e)&&(n=e),n&&a.set(n,t)},getParentStyle(){return a.get(l)??``}}})}c(t,e,null)}var WD=Object.defineProperty,GD=(e,t,n)=>t in e?WD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,KD=(e,t,n)=>(GD(e,typeof t==`symbol`?t:t+``,n),n),qD=`generic-html`,JD=class e extends Hg{constructor(e,t,n,r){super(r),KD(this,`__tag`),KD(this,`__nodeType`),KD(this,`__attributes`),this.__tag=e,this.__nodeType=t,this.__attributes=n}static getType(){return qD}static clone(t){return new e(t.__tag,t.__nodeType,t.__attributes,t.__key)}getTag(){return this.__tag}getNodeType(){return this.__nodeType}getAttributes(){return this.__attributes}updateAttributes(e){let t=this.getWritable();t.__attributes=e}getStyle(){return this.__attributes.find(e=>e.name===`style`)?.value}createDOM(){let e=this.__tag,t=document.createElement(e);return this.__attributes.forEach(e=>{t.setAttribute(e.name,e.value)}),t}updateDOM(){return!1}static importDOM(){return{}}exportDOM(e){let{element:t}=super.exportDOM(e);return{element:t}}static importJSON(e){let t=YD(e.tag,e.mdxType,e.attributes);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),attributes:this.__attributes,mdxType:this.__nodeType,type:qD,version:1}}extractWithChild(){return!0}isInline(){return this.__nodeType===`mdxJsxTextElement`}};function YD(e,t,n){return _v(new JD(e,t,n))}function XD(e){return e instanceof JD}var ZD={testLexicalNode:XD,visitLexicalNode({actions:e,lexicalNode:t}){e.addAndStepInto(`mdxJsxTextElement`,{name:t.getTag(),type:t.getNodeType(),attributes:t.getAttributes()})},priority:-100},QD={testLexicalNode:gh,visitLexicalNode:({mdastParent:e,actions:t})=>{t.appendToParent(e,{type:`text`,value:`
79
- `})}},$D={testLexicalNode:i_,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`paragraph`)}},eO={testLexicalNode:qg,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`root`)}};function tO(e){return e.type===`text`}var nO=[`u`,`span`,`sub`,`sup`],rO={shouldJoin:(e,t)=>{if([`text`,`emphasis`,`strong`,`highlight`].includes(e.type))return e.type===t.type;if(e.type===`mdxJsxTextElement`&&t.type===`mdxJsxTextElement`&&nO.includes(t.name)){let n=t;return e.name===n.name&&JSON.stringify(e.attributes)===JSON.stringify(n.attributes)}return!1},join(e,t){return tO(e)&&tO(t)?{type:`text`,value:e.value+t.value}:{...e,children:[...e.children,...t.children]}},testLexicalNode:H,visitLexicalNode:({lexicalNode:e,mdastParent:t,actions:n})=>{let r=e.getPreviousSibling(),i=H(r)?r.getFormat():0,a=e.getTextContent(),o=e.getFormat(),s=e.getStyle(),c=t;if(s&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`span`,children:[],attributes:[{type:`mdxJsxAttribute`,name:`style`,value:s}]})),i&o&8&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`u`,children:[],attributes:[]})),i&o&64&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`sup`,children:[],attributes:[]})),i&o&32&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`sub`,children:[],attributes:[]})),i&o&2&&(c=n.appendToParent(c,{type:`emphasis`,children:[]})),i&o&1&&(c=n.appendToParent(c,{type:`strong`,children:[]})),i&o&4&&(c=n.appendToParent(c,{type:`delete`,children:[]})),i&o&128&&(c=n.appendToParent(c,{type:`highlight`,children:[]})),o&8&&!(i&8)&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`u`,children:[],attributes:[]})),o&64&&!(i&64)&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`sup`,children:[],attributes:[]})),o&32&&!(i&32)&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`sub`,children:[],attributes:[]})),o&2&&!(i&2)&&(c=n.appendToParent(c,{type:`emphasis`,children:[]})),o&1&&!(i&1)&&(c=n.appendToParent(c,{type:`strong`,children:[]})),o&4&&!(i&4)&&(c=n.appendToParent(c,{type:`delete`,children:[]})),o&128&&!(i&128)&&(c=n.appendToParent(c,{type:`highlight`,children:[]})),o&16){n.appendToParent(c,{type:`inlineCode`,value:a});return}n.appendToParent(c,{type:`text`,value:a})}},iO={testNode:`break`,visitNode:function({lexicalParent:e}){e.append(hh())}};function aO(e,t){return[{testNode:t=>t.type===`mdxJsxTextElement`&&t.name===e,visitNode({actions:e,mdastNode:n,lexicalParent:r}){e.addFormatting(t),e.visitChildren(n,r)}},{testNode:t=>t.type===`html`&&t.value===`<${e}>`,visitNode({actions:e,mdastParent:n}){e.addFormatting(t,n)}},{testNode:t=>t.type===`html`&&t.value===`</${e}>`,visitNode({actions:e,mdastParent:n}){e.removeFormatting(t,n)}}]}var oO={testNode:`delete`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(4),t.visitChildren(e,n)}},sO={testNode:`highlight`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(128),t.visitChildren(e,n)}},cO={testNode:`inlineCode`,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(Nh(e.value).setFormat(t.getParentFormatting()|16))}},Ate=[{testNode:`emphasis`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(2),t.visitChildren(e,n)}},{testNode:`strong`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(1),t.visitChildren(e,n)}},...aO(`u`,8),...aO(`code`,16),cO,oO,sO,...aO(`sup`,64),...aO(`sub`,32)],jte={testNode:tE,visitNode:function({mdastNode:e,actions:t,lexicalParent:n}){e.name===`span`&&e.attributes.length===1&&e.attributes[0].type===`mdxJsxAttribute`&&e.attributes[0].name===`style`?(t.addStyle(e.attributes[0].value,e),t.visitChildren(e,n)):t.addAndStepInto(YD(e.name,e.type,e.attributes))},priority:-100},Mte=[`listitem`,`admonition`],Nte={testNode:`paragraph`,visitNode:function({mdastNode:e,lexicalParent:t,actions:n}){Mte.includes(t.getType())?n.visitChildren(e,t):n.addAndStepInto(r_())}},lO={testNode:`root`,visitNode({actions:e,mdastNode:t,lexicalParent:n}){e.visitChildren(t,n)}},uO={testNode:`text`,visitNode({mdastNode:e,actions:t}){let n=Nh(e.value);n.setFormat(t.getParentFormatting());let r=t.getParentStyle();r!==``&&n.setStyle(r),t.addAndStepInto(n)}},dO=()=>I.createElement(Mb,{externalHistoryState:Hd(Dk)});function fO(e){return{canContainEols:[`comment`],enter:{comment(e){this.buffer()}},exit:{comment(e){this.resume()}}}}var pO=(e,t,n)=>{return r;function r(t){return e.enter(`comment`),e.consume(t),i}function i(t){return t===mC.exclamationMark?(e.consume(t),a):n(t)}function a(t){return t===mC.dash?(e.consume(t),o):n(t)}function o(t){return t===mC.dash?(e.consume(t),s):n(t)}function s(t){return t===mC.greaterThan?n(t):q(t)?u(t):(e.enter(gC.data),t===mC.dash?(e.consume(t),c):l(t))}function c(e){return e===mC.greaterThan?n(e):l(e)}function l(t){return t===mC.eof?n(t):t===mC.dash?(e.consume(t),f):q(t)?(e.exit(gC.data),u(t)):(e.consume(t),l)}function u(t){return e.enter(gC.lineEnding),e.consume(t),e.exit(gC.lineEnding),jC(e,d,gC.linePrefix)}function d(t){return q(t)?u(t):(e.enter(gC.data),l(t))}function f(t){return t===mC.dash?(e.consume(t),p):l(t)}function p(n){return n===mC.greaterThan?(e.exit(gC.data),e.enter(`commentEnd`),e.consume(n),e.exit(`commentEnd`),e.exit(`comment`),t(n)):n===mC.dash?(e.consume(n),p):l(n)}},mO={flow:{60:{tokenize:pO,concrete:!0}},text:{60:{tokenize:pO}}},hO={bold:`_bold_1tncs_10`,italic:`_italic_1tncs_14`,underline:`_underline_1tncs_18`,strikethrough:`_strikethrough_1tncs_34`,underlineStrikethrough:`_underlineStrikethrough_1tncs_38`,subscript:`_subscript_1tncs_42`,superscript:`_superscript_1tncs_47`,code:`_code_1tncs_52`,nestedListItem:`_nestedListItem_1tncs_59`,listitem:`_listitem_1tncs_69`,listItemChecked:`_listItemChecked_1tncs_73`,listItemUnchecked:`_listItemUnchecked_1tncs_74`,admonitionDanger:`_admonitionDanger_1tncs_151`,admonitionInfo:`_admonitionInfo_1tncs_152`,admonitionNote:`_admonitionNote_1tncs_153`,admonitionTip:`_admonitionTip_1tncs_154`,admonitionCaution:`_admonitionCaution_1tncs_155`,mdxExpression:`_mdxExpression_1tncs_188`},gO={text:{bold:hO.bold,italic:hO.italic,underline:hO.underline,code:hO.code,strikethrough:hO.strikethrough,subscript:hO.subscript,superscript:hO.superscript,underlineStrikethrough:hO.underlineStrikethrough},list:{listitem:hO.listitem,listitemChecked:hO.listItemChecked,listitemUnchecked:hO.listItemUnchecked,nested:{listitem:hO.nestedListItem}},admonition:{danger:hO.admonitionDanger,info:hO.admonitionInfo,note:hO.admonitionNote,tip:hO.admonitionTip,caution:hO.admonitionCaution}},_O=Kp(`NESTED_EDITOR_UPDATED_COMMAND`),vO=B(null),yO=B(null),bO=B(``),xO=B(!0),SO=B(!1,e=>{e.sub(e.pipe(SO,Kd(vO)),([e,t])=>{t?.setEditable(!e)})}),CO=B(``),wO=B(!1),TO=B(!1),EO=B(0),DO=B(null),OO=Rd(e=>{e.link(e.pipe(DO,qd(e=>e!==null)),OO)}),kO=Rd(e=>{e.sub(e.pipe(kO,Kd(yO)),([e,t])=>{t?.dispatchCommand(im,e)})}),AO=B(null,e=>{e.sub(e.pipe(AO,Kd(yO)),([t,n])=>{if(!t||!n)return;let r=t.anchor.getNode(),i=r.getKey()===`root`?r:db(r,e=>{let t=e.getParent();return t!==null&&hv(t)});i??=r.getTopLevelElementOrThrow();let a=i.getKey();if(n.getElementByKey(a)!==null){let t=gx(i)?i.getTag():i.getType();e.pub(Ok,t)}})}),jO=B(``),MO=B(``),NO=B(!1),PO=Rd(e=>{e.link(MO,PO),e.sub(jO,t=>{e.pubIn({[NO]:!0,[MO]:t})})}),FO=Rd(e=>{e.link(e.pipe(PO,Kd(tk),qd(([,e])=>!e),Gd(([e])=>e)),FO)},!0),IO=B([]),LO=B([]),RO=B([]),zO=B([]),BO=B([]),VO=B([]),HO=B({}),UO=B(!1),WO=B([]),GO=B([]),KO=B([]),qO=B(null),Pte=B(null),JO=B(null),YO=dk(LO),XO=dk(IO),ZO=dk(RO),QO=dk(zO),$O=dk(BO),ek=dk(VO),tk=B(!1),nk=Rd(e=>{e.sub(e.pipe(nk,Kd(MO,vO,TO),qd(([e,t])=>e.trim()!==t.trim())),([t,,n,r])=>{e.pub(tk,!0),n?.update(()=>{I_().clear(),hk(e,I_(),t),r?n.focus():R_(null)},{onUpdate:()=>{e.pub(tk,!1)}})})}),rk=Rd(e=>{e.sub(e.pipe(rk,Kd(yO,TO)),([t,n,r])=>{n?.update(()=>{let i=W();if(i!==null){let n={children:[],append(e){this.children.push(e)},getType(){return i.getNodes()[0].getType()}};hk(e,n,t),fg(n.children)}r?n.focus():R_(null)})})});function ik(){return Jd((e,[t,n])=>(e.forEach(e=>{if(!e)throw Error(`You have a subscription that does not return a teardown`);e()}),n?t.map(e=>e(n)):[]),[])}var ak=B(null),ok=B([],e=>{e.pipe(e.combine(ok,yO),ik())}),sk=B([],e=>{e.pipe(e.combine(sk,vO),ik())}),ck=B(null,Xd,(e,t)=>!!(e&&t&&e.editorRef===t.editorRef)),lk=Rd(),uk=B(e=>{throw Error(`No icon component for ${e}`)});function dk(e,t){return Rd((n,r)=>{n.changeWith(e,r,(e,t)=>{Array.isArray(t)||(t=[t]);let n=e;for(let r of t)e.includes(r)||(n=[...n,r]);return n}),t?.(n,r)})}function fk(e){let t=W();U(t)&&e.pubIn({[AO]:t,[EO]:t.format})}var pk=dk(sk,(e,t)=>{e.pub(t,[t=>t.registerCommand(qp,(t,n)=>(e.pubIn({[yO]:n,[TO]:!0}),n._parentEditor===null&&n.getEditorState().read(()=>{e.pub(ck,{rootNode:I_(),editorType:`lexical`,editorRef:n})}),fk(e),!1),4),t=>t.registerUpdateListener(({dirtyElements:n,dirtyLeaves:r,editorState:i})=>{if(e.getValue(DO)!==null||n.size===0&&r.size===0)return;let a;i.read(()=>{I_().getLastChild()instanceof Wg&&t.update(()=>{I_().append(r_())},{discrete:!0}),a=pE({root:I_(),visitors:e.getValue(BO),jsxComponentDescriptors:e.getValue(WO),toMarkdownExtensions:e.getValue(VO),toMarkdownOptions:e.getValue(HO),jsxIsAvailable:e.getValue(UO)})}),e.pub(MO,a.trim()),e.pub(NO,!1)}),t=>t.registerCommand(Nm,()=>(e.pub(TO,!0),!1),4)])}),mk=dk(ok,(e,t)=>{e.pub(t,[t=>t.registerUpdateListener(({editorState:t})=>{t.read(()=>{fk(e)})}),t=>t.registerCommand(Pm,t=>{let n=e.getValue(vO);return n&&(n.getRootElement()?.contains(t.relatedTarget)||e.pubIn({[TO]:!1,[lk]:t})),!1},4)])});function hk(e,t,n){try{HD({root:t,visitors:e.getValue(IO),mdastExtensions:e.getValue(zO),markdown:n,syntaxExtensions:e.getValue(RO),jsxComponentDescriptors:e.getValue(WO),directiveDescriptors:e.getValue(GO),codeBlockEditorDescriptors:e.getValue(KO)}),e.pub(DO,null)}catch(t){if(t instanceof zD||t instanceof BD)e.pubIn({[MO]:n,[DO]:{error:t.message,source:n}});else throw t}}var gk=B([]),_k=dk(gk),vk=B([]),yk=dk(vk),bk=B([]),xk=dk(bk),Sk=B([]);dk(Sk);var Ck=dk(B([])),wk=B([]),Tk=dk(wk),Ek=B(!1,e=>{e.link(e.pipe(yO,Gd(e=>[`td`,`th`].includes((e?.getRootElement()?.parentNode)?.nodeName.toLowerCase()??``))),Ek)}),Dk=B(jb()),Ok=B(``);Rd();var kk=Rd(e=>{e.sub(e.pipe(kk,Kd(yO)),([e,t])=>{t?.update(()=>{let n=W();U(n)&&(Ky(n,e),setTimeout(()=>{t.focus()}))})})}),Ak=Rd(e=>{e.sub(e.pipe(Ak,Kd(yO)),([e,t])=>{t?.focus(()=>{t.getEditorState().read(()=>{U(W())&&(t.update(()=>{let t=e();t.isInline()?(fg([t]),hv(t.getParentOrThrow())&&mb(t,r_).selectEnd()):fb(t),setTimeout(()=>{`select`in t&&typeof t.select==`function`&&t.select()})}),setTimeout(()=>{t.dispatchCommand(_O,void 0)}))})},{defaultSelection:`rootEnd`})})}),jk=B(`rich-text`,e=>{function t(){return Jd((e,t)=>({current:e.next,next:t}),{current:`rich-text`,next:`rich-text`})}e.sub(e.pipe(jk,t(),Kd(Mk)),([{current:t},n])=>{(t===`source`||t===`diff`)&&e.pub(nk,n)}),e.sub(e.pipe(jk,t(),qd(e=>e.current===`rich-text`),Kd(yO)),([,e])=>{e?.dispatchCommand(_O,void 0)})}),Mk=B(``,e=>{e.link(MO,Mk),e.link(Mk,PO)},!0),Nk=B([]),Pk=dk(Nk),Fk=B(()=>{throw Error(`No translation function provided`)}),Ik=B(gO),Lk=Zd({init(e,t){let n=t?.initialMarkdown??``;e.register(pk),e.register(mk),e.register(PO),e.register(Mk),e.pubIn({[jO]:t?.trim?n.trim():n,[uk]:t?.iconComponentFor,[XO]:[lO,Nte,uO,iO,...Ate],[YO]:[t_,wh,JD],[$O]:[eO,$D,rO,QD,ZD],[bO]:t?.contentEditableClassName,[xO]:t?.spellCheck,[HO]:t?.toMarkdownOptions,[wO]:t?.autoFocus,[CO]:t?.placeholder,[SO]:t?.readOnly,[Fk]:t?.translation,[QO]:[Bx(),qx],[ZO]:[Rx(),xC()],[ek]:[Eee(),Vx(),Xx],[Ik]:t?.lexicalTheme??gO}),e.singletonSub(OO,t?.onError),e.singletonSub(FO,n=>{t?.onChange(n,e.getValue(NO))}),e.singletonSub(lk,t?.onBlur),t?.suppressHtmlProcessing||e.pubIn({[QO]:[Tee(),fO()],[ZO]:[cw(),lw(),mO],[XO]:jte}),t?.suppressSharedHistory||e.pub(_k,dO)},postInit(e,t){let n=o_({editable:t?.readOnly!==!0,namespace:t?.lexicalEditorNamespace??`MDXEditor`,nodes:[...e.getValue(LO),...t?.additionalLexicalNodes??[]],onError:e=>{throw e},theme:e.getValue(Ik)});t?.editorState!==null&&n.update(()=>{let r=t?.initialMarkdown.trim()??``;hk(e,I_(),r);let i=t?.autoFocus;if(i){if(i===!0){setTimeout(()=>{n.focus(Xd,{defaultSelection:`rootStart`})});return}setTimeout(()=>{n.focus(Xd,{defaultSelection:i.defaultSelection??`rootStart`})})}}),e.pub(vO,n),e.pub(yO,n)},update(e,t){e.pubIn({[bO]:t?.contentEditableClassName,[xO]:t?.spellCheck,[HO]:t?.toMarkdownOptions,[wO]:t?.autoFocus,[CO]:t?.placeholder,[SO]:t?.readOnly}),e.singletonSub(FO,n=>{t?.onChange(n,e.getValue(NO))}),e.singletonSub(lk,t?.onBlur),e.singletonSub(OO,t?.onError)}});function Rk(){return Hd(Fk)}function zk(){return I_().getTextContent()}function Bk(e,t=!0){if(e)return!1;let n=zk();return t&&(n=n.trim()),n===``}function Vk(e){if(!Bk(e,!1))return!1;let t=I_().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){let n=t[e];if(Gg(n))return!1;if(G(n)){if(!i_(n)||n.__indent!==0)return!1;let t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){let n=t[e];if(!H(n))return!1}}}return!0}function Hk(e){return()=>Vk(e)}var Uk=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?I.useLayoutEffect:I.useEffect;function Wk({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:o,ariaInvalid:s,ariaLabel:c,ariaLabelledBy:l,ariaMultiline:u,ariaOwns:d,ariaRequired:f,autoCapitalize:p,className:m,id:h,role:g=`textbox`,spellCheck:_=!0,style:v,tabIndex:y,"data-testid":b,...x},S){let[C,w]=(0,I.useState)(e.isEditable()),T=(0,I.useCallback)((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),E=(0,I.useMemo)((()=>function(...e){return t=>{e.forEach((e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)}))}}(S,T)),[T,S]);return Uk((()=>(w(e.isEditable()),e.registerEditableListener((e=>{w(e)})))),[e]),(0,L.jsx)(`div`,{"aria-activedescendant":C?t:void 0,"aria-autocomplete":C?n:`none`,"aria-controls":C?r:void 0,"aria-describedby":i,...a==null?{}:{"aria-errormessage":a},"aria-expanded":C&&g===`combobox`?!!o:void 0,...s==null?{}:{"aria-invalid":s},"aria-label":c,"aria-labelledby":l,"aria-multiline":u,"aria-owns":C?d:void 0,"aria-readonly":!C||void 0,"aria-required":f,autoCapitalize:p,className:m,contentEditable:C,"data-testid":b,id:h,ref:E,role:g,spellCheck:_,style:v,tabIndex:y,...x})}var Gk=(0,I.forwardRef)(Wk);function Kk(e){return e.getEditorState().read(Hk(e.isComposing()))}var qk=(0,I.forwardRef)(Jk);function Jk(e,t){let{placeholder:n,...r}=e,[i]=tf();return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Gk,{editor:i,...r,ref:t}),n!=null&&(0,L.jsx)(Yk,{editor:i,content:n})]})}function Yk({content:e,editor:t}){let n=function(e){let[t,n]=(0,I.useState)((()=>Kk(e)));return Uk((()=>{function t(){n(Kk(e))}return t(),rb(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),[r,i]=(0,I.useState)(t.isEditable());if((0,I.useLayoutEffect)((()=>(i(t.isEditable()),t.registerEditableListener((e=>{i(e)})))),[t]),!n)return null;let a=null;return typeof e==`function`?a=e(r):e!==null&&(a=e),a===null?null:(0,L.jsx)(`div`,{"aria-hidden":!0,children:a})}function Xk(e,t){return Xk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xk(e,t)}var Zk={error:null},Qk=function(e){var t,n;function r(){for(var t,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).state=Zk,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];t.props.onReset==null||(e=t.props).onReset.apply(e,r),t.reset()},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Xk(t,n),r.getDerivedStateFromError=function(e){return{error:e}};var i=r.prototype;return i.reset=function(){this.setState(Zk)},i.componentDidCatch=function(e,t){var n,r;(n=(r=this.props).onError)==null||n.call(r,e,t)},i.componentDidUpdate=function(e,t){var n,r,i,a,o=this.state.error,s=this.props.resetKeys;o!==null&&t.error!==null&&((i=e.resetKeys)===void 0&&(i=[]),(a=s)===void 0&&(a=[]),i.length!==a.length||i.some((function(e,t){return!Object.is(e,a[t])})))&&((n=(r=this.props).onResetKeysChange)==null||n.call(r,e.resetKeys,s),this.reset())},i.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,r=t.FallbackComponent,i=t.fallback;if(e!==null){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(I.isValidElement(i))return i;if(typeof n==`function`)return n(a);if(r)return I.createElement(r,a);throw Error(`react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop`)}return this.props.children},r}(I.Component);function $k({children:e,onError:t}){return(0,L.jsx)(Qk,{fallback:(0,L.jsx)(`div`,{style:{border:`1px solid #f00`,color:`#f00`,padding:`8px`},children:`An error was thrown.`}),onError:t,children:e})}var eA=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?I.useLayoutEffect:I.useEffect;function tA(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function nA(){return function(e){let[t]=tf(),n=(0,I.useMemo)((()=>e(t)),[t,e]),[r,i]=(0,I.useState)((()=>n.initialValueFn())),a=(0,I.useRef)(r);return eA((()=>{let{initialValueFn:e,subscribe:t}=n,r=e();return a.current!==r&&(a.current=r,i(r)),t((e=>{a.current=e,i(e)}))}),[n,e]),r}(tA)}function rA(e){let t=window.location.origin,n=n=>{if(n.origin!==t)return;let r=e.getRootElement();if(document.activeElement!==r)return;let i=n.data;if(typeof i==`string`){let t;try{t=JSON.parse(i)}catch{return}if(t&&t.protocol===`nuanria_messaging`&&t.type===`request`){let r=t.payload;if(r&&r.functionId===`makeChanges`){let t=r.args;if(t){let[r,i,a,o,s,c]=t;e.update((()=>{let e=W();if(U(e)){let t=e.anchor,c=t.getNode(),l=0,u=0;if(H(c)&&r>=0&&i>=0&&(l=r,u=r+i,e.setTextNodeRange(c,l,c,u)),l===u&&a===``||(e.insertRawText(a),c=t.getNode()),H(c)){l=o,u=o+s;let t=c.getTextContentSize();l=l>t?t:l,u=u>t?t:u,e.setTextNodeRange(c,l,c,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener(`message`,n,!0),()=>{window.removeEventListener(`message`,n,!0)}}var iA=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?I.useLayoutEffect:I.useEffect;function aA(e){return e.getEditorState().read(Hk(e.isComposing()))}function oA({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[r]=tf(),i=function(e,t){let[n,r]=(0,I.useState)((()=>e.getDecorators()));return iA((()=>e.registerDecoratorListener((e=>{(0,Na.flushSync)((()=>{r(e)}))}))),[e]),(0,I.useEffect)((()=>{r(e.getDecorators())}),[e]),(0,I.useMemo)((()=>{let r=[],i=Object.keys(n);for(let a=0;a<i.length;a++){let o=i[a],s=(0,L.jsx)(t,{onError:t=>e._onError(t),children:(0,L.jsx)(I.Suspense,{fallback:null,children:n[o]})}),c=e.getElementByKey(o);c!==null&&r.push((0,Na.createPortal)(s,c,o))}return r}),[t,n,e])}(r,n);return function(e){iA((()=>rb(xx(e),rA(e))),[e])}(r),(0,L.jsxs)(L.Fragment,{children:[e,(0,L.jsx)(sA,{content:t}),i]})}function sA({content:e}){let[t]=tf(),n=function(e){let[t,n]=(0,I.useState)((()=>aA(e)));return iA((()=>{function t(){n(aA(e))}return t(),rb(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),r=nA();return n?typeof e==`function`?e(r):e:null}var cA=n(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()})),lA={undo:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.202 18.5V17H14.3788C15.4224 17 16.3205 16.6554 17.073 15.9663C17.8257 15.2773 18.202 14.4263 18.202 13.4135C18.202 12.4007 17.8257 11.5512 17.073 10.8652C16.3205 10.1794 15.4224 9.8365 14.3788 9.8365H7.35775L10.1402 12.6193L9.0865 13.673L4.5 9.0865L9.0865 4.5L10.1402 5.55375L7.35775 8.3365H14.3788C15.8416 8.3365 17.0945 8.82467 18.1375 9.801C19.1805 10.7773 19.702 11.9815 19.702 13.4135C19.702 14.8455 19.1805 16.0513 18.1375 17.0308C17.0945 18.0103 15.8416 18.5 14.3788 18.5H7.202Z`,fill:`currentColor`})),redo:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.6211 18.5C8.15827 18.5 6.90535 18.0103 5.86235 17.0308C4.81935 16.0513 4.29785 14.8455 4.29785 13.4135C4.29785 11.9815 4.81935 10.7773 5.86235 9.801C6.90535 8.82467 8.15827 8.3365 9.6211 8.3365H16.6421L13.8596 5.55375L14.9134 4.5L19.4999 9.0865L14.9134 13.673L13.8596 12.6193L16.6421 9.8365H9.6211C8.57744 9.8365 7.67935 10.1794 6.92685 10.8652C6.17418 11.5512 5.79785 12.4007 5.79785 13.4135C5.79785 14.4263 6.17418 15.2773 6.92685 15.9663C7.67935 16.6554 8.57744 17 9.6211 17H16.7979V18.5H9.6211Z`,fill:`currentColor`})),format_bold:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.33838 18.625V5.375H12.1999C13.219 5.375 14.1405 5.69233 14.9644 6.327C15.788 6.9615 16.1999 7.816 16.1999 8.8905C16.1999 9.63783 16.0194 10.2471 15.6584 10.7182C15.2975 11.1894 14.9088 11.5314 14.4921 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3158 16.6614 14.0193 16.6614 14.9038C16.6614 16.1819 16.1902 17.1217 15.2479 17.723C14.3055 18.3243 13.3562 18.625 12.3999 18.625H7.33838ZM9.48838 16.6328H12.3191C13.1063 16.6328 13.6627 16.4142 13.9884 15.977C14.314 15.5398 14.4769 15.1206 14.4769 14.7192C14.4769 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8058 12.2729 12.8058H9.48838V16.6328ZM9.48838 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5279 10.3538C13.8835 10.0064 14.0614 9.59042 14.0614 9.10575C14.0614 8.59042 13.8733 8.16925 13.4971 7.84225C13.1208 7.51542 12.6595 7.352 12.1134 7.352H9.48838V10.875Z`,fill:`currentColor`})),format_italic:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.39404 18.625V16.8173H9.21129L12.4518 7.18275H8.63454V5.375H17.7883V7.18275H14.2785L11.0383 16.8173H14.5478V18.625H5.39404Z`,fill:`currentColor`})),format_underlined:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.34619 22.125V20.625H18.6537V22.125H5.34619ZM11.9999 18.5287C10.4448 18.5287 9.23102 18.0566 8.35869 17.1125C7.48619 16.1683 7.04994 14.9032 7.04994 13.3172V5.41345H8.90369V13.4095C8.90369 14.4198 9.17228 15.2295 9.70944 15.8385C10.2466 16.4475 11.0101 16.752 11.9999 16.752C12.9898 16.752 13.7533 16.4475 14.2904 15.8385C14.8276 15.2295 15.0962 14.4198 15.0962 13.4095V5.41345H16.9499V13.3172C16.9499 14.9032 16.5137 16.1683 15.6412 17.1125C14.7689 18.0566 13.5551 18.5287 11.9999 18.5287Z`,fill:`currentColor`})),format_highlight:I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`},I.createElement(`path`,{d:`m9 11-6 6v3h9l3-3`}),I.createElement(`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`})),code:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.99994 17.6537L2.34619 11.9999L7.99994 6.34619L9.06919 7.41544L4.46919 12.0154L9.05369 16.5999L7.99994 17.6537ZM15.9999 17.6537L14.9307 16.5844L19.5307 11.9844L14.9462 7.39994L15.9999 6.34619L21.6537 11.9999L15.9999 17.6537Z`,fill:`currentColor`})),strikeThrough:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M12.15 19.6923C10.9732 19.6923 9.9315 19.359 9.025 18.6923C8.11867 18.0256 7.45525 17.1128 7.03475 15.9538L8.6385 15.2635C8.91667 16.0444 9.3545 16.6867 9.952 17.1905C10.5493 17.6944 11.2923 17.9463 12.1808 17.9463C12.9578 17.9463 13.6744 17.7508 14.3307 17.3598C14.9872 16.9686 15.3155 16.3487 15.3155 15.5C15.3155 15.123 15.2555 14.7968 15.1355 14.5213C15.0157 14.2456 14.8462 13.9885 14.627 13.75H16.677C16.7987 13.9705 16.8932 14.2256 16.9605 14.5153C17.0278 14.8051 17.0615 15.1334 17.0615 15.5C17.0615 16.8372 16.5747 17.8702 15.601 18.599C14.6272 19.3279 13.4768 19.6923 12.15 19.6923ZM2.25 11.75V10.25H21.75V11.75H2.25ZM12.05 4.19629C13.0475 4.19629 13.9123 4.42704 14.6443 4.88854C15.3763 5.35004 15.9673 6.05896 16.4173 7.01529L14.823 7.73079C14.6218 7.26029 14.2978 6.84462 13.851 6.48379C13.4042 6.12279 12.8141 5.94229 12.0808 5.94229C11.2244 5.94229 10.5392 6.16221 10.025 6.60204C9.51083 7.04171 9.264 7.59104 9.2845 8.25004H7.5385C7.50133 7.16421 7.89783 6.21712 8.728 5.40879C9.558 4.60046 10.6653 4.19629 12.05 4.19629Z`,fill:`currentColor`})),superscript:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M16.6924 8V6.2115C16.6924 5.95383 16.7786 5.73875 16.9511 5.56625C17.1235 5.39392 17.3385 5.30775 17.5961 5.30775H19.5001V4.38475H16.6924V3.5H19.4809C19.7385 3.5 19.9536 3.58625 20.1261 3.75875C20.2985 3.93108 20.3846 4.14617 20.3846 4.404V5.2885C20.3846 5.54617 20.2985 5.76125 20.1261 5.93375C19.9536 6.10608 19.7385 6.19225 19.4809 6.19225H17.5771V7.1155H20.3846V8H16.6924ZM4.44238 18.5L8.84638 11.6287L4.77713 5.30775H6.74438L9.95963 10.404H10.0214L13.2501 5.30775H15.2329L11.1194 11.6287L15.5579 18.5H13.5751L10.0214 12.9308H9.95963L6.42513 18.5H4.44238Z`,fill:`currentColor`})),subscript:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M16.6924 20.5V18.7115C16.6924 18.4538 16.7786 18.2387 16.9511 18.0662C17.1235 17.8939 17.3385 17.8077 17.5961 17.8077H19.5001V16.8845H16.6924V16H19.4809C19.7385 16 19.9536 16.0863 20.1261 16.2587C20.2985 16.4311 20.3846 16.6461 20.3846 16.9038V17.7885C20.3846 18.0462 20.2985 18.2612 20.1261 18.4337C19.9536 18.6061 19.7385 18.6923 19.4809 18.6923H17.5771V19.6152H20.3846V20.5H16.6924ZM4.44238 18.6923L8.84638 11.8212L4.77713 5.5H6.74438L9.95963 10.5962H10.0214L13.2501 5.5H15.2329L11.1194 11.8212L15.5579 18.6923H13.5751L10.0214 13.123H9.95963L6.42513 18.6923H4.44238Z`,fill:`currentColor`})),format_list_bulleted:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75005V5.25005H20.5V6.75005H9.30775ZM5.1635 19.6635C4.706 19.6635 4.31442 19.5006 3.98875 19.1748C3.66292 18.8491 3.5 18.4575 3.5 18C3.5 17.5425 3.66292 17.151 3.98875 16.8253C4.31442 16.4995 4.706 16.3365 5.1635 16.3365C5.621 16.3365 6.01258 16.4995 6.33825 16.8253C6.66408 17.151 6.827 17.5425 6.827 18C6.827 18.4575 6.66408 18.8491 6.33825 19.1748C6.01258 19.5006 5.621 19.6635 5.1635 19.6635ZM5.1635 13.6635C4.706 13.6635 4.31442 13.5006 3.98875 13.1748C3.66292 12.8491 3.5 12.4575 3.5 12C3.5 11.5425 3.66292 11.151 3.98875 10.8253C4.31442 10.4995 4.706 10.3365 5.1635 10.3365C5.621 10.3365 6.01258 10.4995 6.33825 10.8253C6.66408 11.151 6.827 11.5425 6.827 12C6.827 12.4575 6.66408 12.8491 6.33825 13.1748C6.01258 13.5006 5.621 13.6635 5.1635 13.6635ZM5.1635 7.66355C4.706 7.66355 4.31442 7.50063 3.98875 7.1748C3.66292 6.84913 3.5 6.45755 3.5 6.00005C3.5 5.54255 3.66292 5.15096 3.98875 4.8253C4.31442 4.49946 4.706 4.33655 5.1635 4.33655C5.621 4.33655 6.01258 4.49946 6.33825 4.8253C6.66408 5.15096 6.827 5.54255 6.827 6.00005C6.827 6.45755 6.66408 6.84913 6.33825 7.1748C6.01258 7.50063 5.621 7.66355 5.1635 7.66355Z`,fill:`currentColor`})),format_list_numbered:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 21.5V20.3078H6V19.25H4.5V18.0577H6V17H3.5V15.8077H6.34625C6.58592 15.8077 6.78683 15.8888 6.949 16.051C7.11117 16.2132 7.19225 16.4141 7.19225 16.6538V17.8462C7.19225 18.0859 7.11117 18.2868 6.949 18.449C6.78683 18.6112 6.58592 18.6923 6.34625 18.6923C6.58592 18.6923 6.78683 18.7733 6.949 18.9355C7.11117 19.0977 7.19225 19.2987 7.19225 19.5385V20.6538C7.19225 20.8936 7.11117 21.0946 6.949 21.2568C6.78683 21.4189 6.58592 21.5 6.34625 21.5H3.5ZM3.5 14.8463V12.25C3.5 12.0103 3.58108 11.8093 3.74325 11.647C3.90542 11.4848 4.10642 11.4038 4.34625 11.4038H6V10.3462H3.5V9.15375H6.34625C6.58592 9.15375 6.78683 9.23483 6.949 9.397C7.11117 9.55933 7.19225 9.76033 7.19225 10V11.75C7.19225 11.9897 7.11117 12.1907 6.949 12.353C6.78683 12.5152 6.58592 12.5963 6.34625 12.5963H4.69225V13.6538H7.19225V14.8463H3.5ZM5 8.19225V3.69225H3.5V2.5H6.19225V8.19225H5ZM9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75V5.25H20.5V6.75H9.30775Z`,fill:`currentColor`})),format_list_checked:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.69425 18.452L2.5 15.2578L3.54425 14.2135L5.66925 16.3385L9.91925 12.0885L10.9635 13.1578L5.69425 18.452ZM5.69425 10.8365L2.5 7.64227L3.54425 6.59802L5.66925 8.72302L9.91925 4.47302L10.9635 5.54227L5.69425 10.8365ZM13.0095 16.5578V15.0578H21.5095V16.5578H13.0095ZM13.0095 8.94227V7.44227H21.5095V8.94227H13.0095Z`,fill:`currentColor`})),link:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M10.8077 16.5385H7.0385C5.78283 16.5385 4.7125 16.096 3.8275 15.211C2.9425 14.3262 2.5 13.256 2.5 12.0005C2.5 10.745 2.9425 9.67471 3.8275 8.78955C4.7125 7.90421 5.78283 7.46155 7.0385 7.46155H10.8077V8.96155H7.0385C6.19867 8.96155 5.48233 9.25805 4.8895 9.85105C4.2965 10.444 4 11.1604 4 12C4 12.8397 4.2965 13.556 4.8895 14.149C5.48233 14.742 6.19867 15.0385 7.0385 15.0385H10.8077V16.5385ZM8.25 12.75V11.25H15.75V12.75H8.25ZM13.1923 16.5385V15.0385H16.9615C17.8013 15.0385 18.5177 14.742 19.1105 14.149C19.7035 13.556 20 12.8397 20 12C20 11.1604 19.7035 10.444 19.1105 9.85105C18.5177 9.25805 17.8013 8.96155 16.9615 8.96155H13.1923V7.46155H16.9615C18.2172 7.46155 19.2875 7.90405 20.1725 8.78905C21.0575 9.67388 21.5 10.744 21.5 11.9995C21.5 13.255 21.0575 14.3254 20.1725 15.2105C19.2875 16.0959 18.2172 16.5385 16.9615 16.5385H13.1923Z`,fill:`currentColor`})),add_photo:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.11537 20.5C4.6182 20.5 4.19262 20.323 3.83862 19.969C3.48462 19.615 3.30762 19.1894 3.30762 18.6922V5.30773C3.30762 4.81056 3.48462 4.38498 3.83862 4.03098C4.19262 3.67698 4.6182 3.49998 5.11537 3.49998H13.8076V4.99998H5.11537C5.02553 4.99998 4.95178 5.02881 4.89412 5.08648C4.83645 5.14415 4.80762 5.2179 4.80762 5.30773V18.6922C4.80762 18.7821 4.83645 18.8558 4.89412 18.9135C4.95178 18.9711 5.02553 19 5.11537 19H18.4999C18.5895 19 18.6633 18.9711 18.7211 18.9135C18.7788 18.8558 18.8076 18.7821 18.8076 18.6922V9.99998H20.3076V18.6922C20.3076 19.1894 20.1306 19.615 19.7766 19.969C19.4226 20.323 18.997 20.5 18.4999 20.5H5.11537ZM17.1921 8.61523V6.61523H15.1921V5.11548H17.1921V3.11548H18.6921V5.11548H20.6921V6.61523H18.6921V8.61523H17.1921ZM6.55762 16.75H17.1344L13.8459 12.3655L11.0384 16.0192L9.03837 13.4615L6.55762 16.75Z`,fill:`currentColor`})),table:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 18.6923V5.30775C3.5 4.81058 3.677 4.385 4.031 4.031C4.385 3.677 4.81058 3.5 5.30775 3.5H18.6923C19.1894 3.5 19.615 3.677 19.969 4.031C20.323 4.385 20.5 4.81058 20.5 5.30775V18.6923C20.5 19.1894 20.323 19.615 19.969 19.969C19.615 20.323 19.1894 20.5 18.6923 20.5H5.30775C4.81058 20.5 4.385 20.323 4.031 19.969C3.677 19.615 3.5 19.1894 3.5 18.6923ZM5 9.077H19V5.30775C19 5.21792 18.9712 5.14417 18.9135 5.0865C18.8558 5.02883 18.7821 5 18.6923 5H5.30775C5.21792 5 5.14417 5.02883 5.0865 5.0865C5.02883 5.14417 5 5.21792 5 5.30775V9.077ZM10.1615 14.0385H13.8385V10.577H10.1615V14.0385ZM10.1615 19H13.8385V15.5385H10.1615V19ZM5 14.0385H8.6615V10.577H5V14.0385ZM15.3385 14.0385H19V10.577H15.3385V14.0385ZM5.30775 19H8.6615V15.5385H5V18.6923C5 18.7821 5.02883 18.8558 5.0865 18.9135C5.14417 18.9712 5.21792 19 5.30775 19ZM15.3385 19H18.6923C18.7821 19 18.8558 18.9712 18.9135 18.9135C18.9712 18.8558 19 18.7821 19 18.6923V15.5385H15.3385V19Z`,fill:`currentColor`})),horizontal_rule:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M4.5 12.75V11.25H19.5V12.75H4.5Z`,fill:`currentColor`})),frontmatter:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M4.5 8.75V7.25H8.5V8.75H4.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M4.5 14.75V13.25H8.5V14.75H4.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M9.5 8.75V7.25H13.5V8.75H9.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M9.5 14.75V13.25H13.5V14.75H9.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M14.5 8.75V7.25H18.5V8.75H14.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M14.5 14.75V13.25H18.5V14.75H14.5Z`,fill:`currentColor`})),frame_source:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M8.6 15.2443L5.35575 12L8.6 8.75575L9.64425 9.825L7.46925 12L9.64425 14.175L8.6 15.2443ZM15.4 15.2443L14.3558 14.175L16.5307 12L14.3558 9.825L15.4 8.75575L18.6443 12L15.4 15.2443ZM5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V15H5V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H9V20.5H5.30775ZM15 20.5V19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V15H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H15ZM3.5 9V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H9V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V9H3.5ZM19 9V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H15V3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V9H19Z`,fill:`currentColor`})),arrow_drop_down:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M11.9999 14.6537L7.59619 10.25H16.4037L11.9999 14.6537Z`,fill:`currentColor`})),admonition:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M12.0001 21.4C11.7654 21.4 11.5385 21.3548 11.3193 21.2645C11.1002 21.174 10.9002 21.0435 10.7193 20.873L3.1271 13.2807C2.9566 13.0999 2.8261 12.8999 2.7356 12.6807C2.64526 12.4616 2.6001 12.2346 2.6001 12C2.6001 11.7653 2.64526 11.5358 2.7356 11.3115C2.8261 11.0871 2.9566 10.8897 3.1271 10.7192L10.7193 3.12698C10.9002 2.94614 11.1002 2.81314 11.3193 2.72798C11.5385 2.64264 11.7654 2.59998 12.0001 2.59998C12.2348 2.59998 12.4643 2.64264 12.6886 2.72798C12.9129 2.81314 13.1103 2.94614 13.2808 3.12698L20.8731 10.7192C21.0539 10.8897 21.1869 11.0871 21.2721 11.3115C21.3574 11.5358 21.4001 11.7653 21.4001 12C21.4001 12.2346 21.3574 12.4616 21.2721 12.6807C21.1869 12.8999 21.0539 13.0999 20.8731 13.2807L13.2808 20.873C13.1103 21.0435 12.9129 21.174 12.6886 21.2645C12.4643 21.3548 12.2348 21.4 12.0001 21.4ZM12.2213 19.8037L19.8039 12.2212C19.8552 12.1699 19.8808 12.0961 19.8808 12C19.8808 11.9038 19.8552 11.8301 19.8039 11.7787L12.2213 4.19623C12.17 4.14489 12.0963 4.11923 12.0001 4.11923C11.9039 4.11923 11.8302 4.14489 11.7788 4.19623L4.19635 11.7787C4.14501 11.8301 4.11935 11.9038 4.11935 12C4.11935 12.0961 4.14501 12.1699 4.19635 12.2212L11.7788 19.8037C11.8302 19.8551 11.9039 19.8807 12.0001 19.8807C12.0963 19.8807 12.17 19.8551 12.2213 19.8037ZM11.2501 13.0865H12.7501V7.47123H11.2501V13.0865ZM12.0001 15.702C12.2258 15.702 12.4168 15.6237 12.5731 15.4672C12.7296 15.3109 12.8078 15.1199 12.8078 14.8942C12.8078 14.6686 12.7296 14.4776 12.5731 14.3212C12.4168 14.1647 12.2258 14.0865 12.0001 14.0865C11.7744 14.0865 11.5834 14.1647 11.4271 14.3212C11.2706 14.4776 11.1923 14.6686 11.1923 14.8942C11.1923 15.1199 11.2706 15.3109 11.4271 15.4672C11.5834 15.6237 11.7744 15.702 12.0001 15.702Z`,fill:`currentColor`})),sandpack:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M12.9999 22.5C12.4947 22.5 12.0671 22.325 11.7171 21.975C11.3671 21.625 11.1921 21.1974 11.1921 20.6922V7.30775C11.1921 6.80258 11.3671 6.375 11.7171 6.025C12.0671 5.675 12.4947 5.5 12.9999 5.5H16.3844C16.8895 5.5 17.3171 5.675 17.6671 6.025C18.0171 6.375 18.1921 6.80258 18.1921 7.30775V20.6922C18.1921 21.1974 18.0171 21.625 17.6671 21.975C17.3171 22.325 16.8895 22.5 16.3844 22.5H12.9999ZM12.6921 7.30775V20.6922C12.6921 20.7692 12.7242 20.8398 12.7884 20.9038C12.8524 20.9679 12.9229 21 12.9999 21H16.3844C16.4614 21 16.5319 20.9679 16.5959 20.9038C16.66 20.8398 16.6921 20.7692 16.6921 20.6922V7.30775C16.6921 7.23075 16.66 7.16025 16.5959 7.09625C16.5319 7.03208 16.4614 7 16.3844 7H12.9999C12.9229 7 12.8524 7.03208 12.7884 7.09625C12.7242 7.16025 12.6921 7.23075 12.6921 7.30775ZM6.61537 18.5C6.1102 18.5 5.68262 18.325 5.33262 17.975C4.98262 17.625 4.80762 17.1974 4.80762 16.6923V3.30775C4.80762 2.80258 4.98262 2.375 5.33262 2.025C5.68262 1.675 6.1102 1.5 6.61537 1.5H9.99987C10.505 1.5 10.9326 1.675 11.2826 2.025C11.6326 2.375 11.8076 2.80258 11.8076 3.30775V16.6923C11.8076 17.1974 11.6326 17.625 11.2826 17.975C10.9326 18.325 10.505 18.5 9.99987 18.5H6.61537ZM6.30762 3.30775V16.6923C6.30762 16.7692 6.3397 16.8398 6.40387 16.9038C6.46787 16.9679 6.53837 17 6.61537 17H9.99987C10.0769 17 10.1474 16.9679 10.2114 16.9038C10.2755 16.8398 10.3076 16.7692 10.3076 16.6923V3.30775C10.3076 3.23075 10.2755 3.16025 10.2114 3.09625C10.1474 3.03208 10.0769 3 9.99987 3H6.61537C6.53837 3 6.46787 3.03208 6.40387 3.09625C6.3397 3.16025 6.30762 3.23075 6.30762 3.30775Z`,fill:`currentColor`})),rich_text:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19ZM6.75 17H17.3268L14 12.3655L11.2308 16.0192L9 13.4615L6.75 17Z`,fill:`currentColor`}),I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M6 12V6.5H9.1925C9.5925 6.5 9.9425 6.65 10.2425 6.95C10.5425 7.25 10.6925 7.6 10.6925 8V8.6925C10.6925 9.03733 10.605 9.32675 10.43 9.56075C10.255 9.79458 10.0168 9.97817 9.7155 10.1115L10.6155 12H9.404L8.504 10.1925H7.1925V12H6ZM9.1925 9H7.1925V7.6925H9.1925C9.26933 7.6925 9.33983 7.7245 9.404 7.7885C9.468 7.85267 9.5 7.92317 9.5 8V8.6925C9.5 8.76933 9.468 8.83983 9.404 8.904C9.33983 8.968 9.26933 9 9.1925 9Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M12.5 7H17.5V8.25H12.5V7Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M12.5 9.25H17.5V10.5H12.5V9.25Z`,fill:`currentColor`})),difference:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z`,fill:`currentColor`}),I.createElement(`rect`,{x:`9`,y:`10`,width:`5.5`,height:`1.5`,fill:`currentColor`}),I.createElement(`rect`,{x:`9`,y:`15`,width:`5.5`,height:`1.5`,fill:`currentColor`}),I.createElement(`rect`,{x:`11`,y:`8`,width:`1.5`,height:`5.5`,fill:`currentColor`})),markdown:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M13 15H11.5V11L9.5 14L7.5 11V15H6V8H7.5L9.5 11L11.5 8H13V15Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M15.9921 15.5833L13.2886 12.8797L14.0546 12.1137L15.4504 13.5016V7.99597L16.5336 7.99993V13.5016L17.9296 12.1137L18.6954 12.8797L15.9921 15.5833Z`,fill:`currentColor`})),open_in_new:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H11.6152V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V12.3848H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM9.71925 15.3345L8.6655 14.2808L17.9462 5H14V3.5H20.5V10H19V6.05375L9.71925 15.3345Z`,fill:`currentColor`})),link_off:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M18.8843 16.1038L17.7498 14.9385C18.4228 14.7552 18.9661 14.3946 19.3796 13.8568C19.7931 13.319 19.9998 12.7 19.9998 12C19.9998 11.1604 19.705 10.444 19.1153 9.85105C18.5255 9.25805 17.8139 8.96155 16.9806 8.96155H13.1728V7.46155H16.9806C18.2293 7.46155 19.2947 7.90422 20.1768 8.78955C21.0588 9.67472 21.4998 10.7449 21.4998 12C21.4998 12.8859 21.262 13.6951 20.7863 14.4278C20.3107 15.1606 19.6767 15.7193 18.8843 16.1038ZM15.5806 12.75L14.0806 11.25H15.7306V12.75H15.5806ZM20.1461 22.2538L1.74609 3.8538L2.79984 2.80005L21.1998 21.2L20.1461 22.2538ZM10.8268 16.5386H7.03834C5.78318 16.5386 4.71301 16.0959 3.82784 15.2105C2.94251 14.3254 2.49984 13.2552 2.49984 12C2.49984 10.8885 2.85784 9.91322 3.57384 9.07405C4.28984 8.23505 5.18826 7.72838 6.26909 7.55405H6.49984L7.90759 8.96155H7.03834C6.19851 8.96155 5.48218 9.25805 4.88934 9.85105C4.29634 10.444 3.99984 11.1604 3.99984 12C3.99984 12.8397 4.29634 13.556 4.88934 14.149C5.48218 14.742 6.19851 15.0385 7.03834 15.0385H10.8268V16.5386ZM8.26909 12.75V11.25H10.2113L11.6863 12.75H8.26909Z`,fill:`currentColor`})),edit:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5 19H6.2615L16.498 8.7635L15.2365 7.502L5 17.7385V19ZM3.5 20.5V17.1155L16.6905 3.93075C16.8417 3.79342 17.0086 3.68733 17.1913 3.6125C17.3741 3.5375 17.5658 3.5 17.7663 3.5C17.9668 3.5 18.1609 3.53558 18.3488 3.60675C18.5367 3.67792 18.7032 3.79108 18.848 3.94625L20.0693 5.18275C20.2244 5.32758 20.335 5.49425 20.401 5.68275C20.467 5.87125 20.5 6.05975 20.5 6.24825C20.5 6.44942 20.4657 6.64133 20.397 6.824C20.3283 7.00683 20.2191 7.17383 20.0693 7.325L6.8845 20.5H3.5ZM15.8562 8.14375L15.2365 7.502L16.498 8.7635L15.8562 8.14375Z`,fill:`currentColor`})),content_copy:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.05775 17.5C8.55258 17.5 8.125 17.325 7.775 16.975C7.425 16.625 7.25 16.1974 7.25 15.6923V4.30775C7.25 3.80258 7.425 3.375 7.775 3.025C8.125 2.675 8.55258 2.5 9.05775 2.5H17.4423C17.9474 2.5 18.375 2.675 18.725 3.025C19.075 3.375 19.25 3.80258 19.25 4.30775V15.6923C19.25 16.1974 19.075 16.625 18.725 16.975C18.375 17.325 17.9474 17.5 17.4423 17.5H9.05775ZM9.05775 16H17.4423C17.5192 16 17.5898 15.9679 17.6538 15.9038C17.7179 15.8398 17.75 15.7692 17.75 15.6923V4.30775C17.75 4.23075 17.7179 4.16025 17.6538 4.09625C17.5898 4.03208 17.5192 4 17.4423 4H9.05775C8.98075 4 8.91025 4.03208 8.84625 4.09625C8.78208 4.16025 8.75 4.23075 8.75 4.30775V15.6923C8.75 15.7692 8.78208 15.8398 8.84625 15.9038C8.91025 15.9679 8.98075 16 9.05775 16ZM5.55775 21C5.05258 21 4.625 20.825 4.275 20.475C3.925 20.125 3.75 19.6974 3.75 19.1923V6.30775H5.25V19.1923C5.25 19.2693 5.28208 19.3398 5.34625 19.4038C5.41025 19.4679 5.48075 19.5 5.55775 19.5H15.4423V21H5.55775Z`,fill:`currentColor`})),more_horiz:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M6.23096 13.5C5.81846 13.5 5.46537 13.3531 5.17171 13.0592C4.87787 12.7656 4.73096 12.4125 4.73096 12C4.73096 11.5875 4.87787 11.2344 5.17171 10.9408C5.46537 10.6469 5.81846 10.5 6.23096 10.5C6.64346 10.5 6.99662 10.6469 7.29046 10.9408C7.58412 11.2344 7.73096 11.5875 7.73096 12C7.73096 12.4125 7.58412 12.7656 7.29046 13.0592C6.99662 13.3531 6.64346 13.5 6.23096 13.5ZM12.0002 13.5C11.5877 13.5 11.2346 13.3531 10.941 13.0592C10.6471 12.7656 10.5002 12.4125 10.5002 12C10.5002 11.5875 10.6471 11.2344 10.941 10.9408C11.2346 10.6469 11.5877 10.5 12.0002 10.5C12.4127 10.5 12.7658 10.6469 13.0595 10.9408C13.3533 11.2344 13.5002 11.5875 13.5002 12C13.5002 12.4125 13.3533 12.7656 13.0595 13.0592C12.7658 13.3531 12.4127 13.5 12.0002 13.5ZM17.7695 13.5C17.357 13.5 17.0038 13.3531 16.71 13.0592C16.4163 12.7656 16.2695 12.4125 16.2695 12C16.2695 11.5875 16.4163 11.2344 16.71 10.9408C17.0038 10.6469 17.357 10.5 17.7695 10.5C18.182 10.5 18.535 10.6469 18.8287 10.9408C19.1225 11.2344 19.2695 11.5875 19.2695 12C19.2695 12.4125 19.1225 12.7656 18.8287 13.0592C18.535 13.3531 18.182 13.5 17.7695 13.5Z`,fill:`currentColor`})),more_vert:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M12 19.2692C11.5875 19.2692 11.2344 19.1223 10.9408 18.8285C10.6469 18.5348 10.5 18.1817 10.5 17.7692C10.5 17.3567 10.6469 17.0035 10.9408 16.7097C11.2344 16.416 11.5875 16.2692 12 16.2692C12.4125 16.2692 12.7656 16.416 13.0592 16.7097C13.3531 17.0035 13.5 17.3567 13.5 17.7692C13.5 18.1817 13.3531 18.5348 13.0592 18.8285C12.7656 19.1223 12.4125 19.2692 12 19.2692ZM12 13.5C11.5875 13.5 11.2344 13.353 10.9408 13.0592C10.6469 12.7655 10.5 12.4125 10.5 12C10.5 11.5875 10.6469 11.2344 10.9408 10.9407C11.2344 10.6469 11.5875 10.5 12 10.5C12.4125 10.5 12.7656 10.6469 13.0592 10.9407C13.3531 11.2344 13.5 11.5875 13.5 12C13.5 12.4125 13.3531 12.7655 13.0592 13.0592C12.7656 13.353 12.4125 13.5 12 13.5ZM12 7.73071C11.5875 7.73071 11.2344 7.58388 10.9408 7.29021C10.6469 6.99638 10.5 6.64321 10.5 6.23071C10.5 5.81821 10.6469 5.46513 10.9408 5.17146C11.2344 4.87763 11.5875 4.73071 12 4.73071C12.4125 4.73071 12.7656 4.87763 13.0592 5.17146C13.3531 5.46513 13.5 5.81821 13.5 6.23071C13.5 6.64321 13.3531 6.99638 13.0592 7.29021C12.7656 7.58388 12.4125 7.73071 12 7.73071Z`,fill:`currentColor`})),close:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M6.39994 18.6538L5.34619 17.6L10.9462 12L5.34619 6.4L6.39994 5.34625L11.9999 10.9463L17.5999 5.34625L18.6537 6.4L13.0537 12L18.6537 17.6L17.5999 18.6538L11.9999 13.0538L6.39994 18.6538Z`,fill:`currentColor`})),settings:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.69225 21.5L9.3115 18.4538C9.04367 18.3641 8.769 18.2385 8.4875 18.077C8.20617 17.9153 7.95459 17.7422 7.73275 17.5577L4.9115 18.75L2.604 14.75L5.04425 12.9058C5.02125 12.7571 5.00492 12.6077 4.99525 12.4578C4.98559 12.3078 4.98075 12.1583 4.98075 12.0095C4.98075 11.8673 4.98559 11.7228 4.99525 11.576C5.00492 11.4292 5.02125 11.2686 5.04425 11.0943L2.604 9.25L4.9115 5.26925L7.723 6.452C7.96417 6.261 8.22159 6.08633 8.49525 5.928C8.76892 5.76967 9.03784 5.64242 9.302 5.54625L9.69225 2.5H14.3078L14.6885 5.55575C14.9885 5.66475 15.2599 5.792 15.5028 5.9375C15.7458 6.083 15.991 6.2545 16.2385 6.452L19.0885 5.26925L21.396 9.25L18.9173 11.123C18.9531 11.2845 18.9727 11.4355 18.976 11.576C18.9792 11.7163 18.9808 11.8577 18.9808 12C18.9808 12.1358 18.9775 12.274 18.971 12.4145C18.9647 12.5548 18.9417 12.7154 18.902 12.8963L21.3615 14.75L19.0538 18.75L16.2385 17.548C15.991 17.7455 15.7384 17.9202 15.4808 18.072C15.2231 18.224 14.959 18.3481 14.6885 18.4443L14.3078 21.5H9.69225ZM11 20H12.9655L13.325 17.3212C13.8353 17.1879 14.3017 16.9985 14.724 16.753C15.1465 16.5073 15.5539 16.1916 15.9463 15.8057L18.4308 16.85L19.4155 15.15L17.2463 13.5155C17.3296 13.2565 17.3863 13.0026 17.4163 12.7537C17.4464 12.5051 17.4615 12.2538 17.4615 12C17.4615 11.7397 17.4464 11.4884 17.4163 11.2463C17.3863 11.0039 17.3296 10.7564 17.2463 10.5038L19.4345 8.85L18.45 7.15L15.9365 8.2095C15.6018 7.85183 15.2009 7.53583 14.7338 7.2615C14.2664 6.98717 13.7937 6.79292 13.3155 6.67875L13 4H11.0155L10.6845 6.66925C10.1743 6.78975 9.70325 6.97433 9.27125 7.223C8.83909 7.47183 8.42684 7.79233 8.0345 8.1845L5.55 7.15L4.5655 8.85L6.725 10.4595C6.64167 10.6968 6.58334 10.9437 6.55 11.2C6.51667 11.4563 6.5 11.7262 6.5 12.0095C6.5 12.2698 6.51667 12.525 6.55 12.775C6.58334 13.025 6.6385 13.2718 6.7155 13.5155L4.5655 15.15L5.55 16.85L8.025 15.8C8.4045 16.1897 8.81025 16.5089 9.24225 16.7578C9.67442 17.0064 10.152 17.1974 10.675 17.3307L11 20ZM12.0115 15C12.8435 15 13.5515 14.708 14.1355 14.124C14.7195 13.54 15.0115 12.832 15.0115 12C15.0115 11.168 14.7195 10.46 14.1355 9.876C13.5515 9.292 12.8435 9 12.0115 9C11.1692 9 10.4586 9.292 9.87975 9.876C9.30092 10.46 9.0115 11.168 9.0115 12C9.0115 12.832 9.30092 13.54 9.87975 14.124C10.4586 14.708 11.1692 15 12.0115 15Z`,fill:`currentColor`})),delete_big:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z`,fill:`currentColor`})),delete_small:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z`,fill:`currentColor`})),format_align_center:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 20.5V19H20.5V20.5H3.5ZM7.5 16.625V15.125H16.5V16.625H7.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM7.5 8.875V7.375H16.5V8.875H7.5ZM3.5 5V3.5H20.5V5H3.5Z`,fill:`currentColor`})),format_align_left:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 20.5V19H20.5V20.5H3.5ZM3.5 16.625V15.125H14.5V16.625H3.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM3.5 8.875V7.375H14.5V8.875H3.5ZM3.5 5V3.5H20.5V5H3.5Z`,fill:`currentColor`})),format_align_right:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 5V3.5H20.5V5H3.5ZM9.5 8.875V7.375H20.5V8.875H9.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM9.5 16.625V15.125H20.5V16.625H9.5ZM3.5 20.5V19H20.5V20.5H3.5Z`,fill:`currentColor`})),add_row:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M4.025 10.2077C4.375 9.85775 4.80258 9.68275 5.30775 9.68275H6.5V11.1827H5.30775C5.21792 11.1827 5.14417 11.2116 5.0865 11.2693C5.02883 11.3269 5 11.4007 5 11.4905V16.1923C5 16.2821 5.02883 16.3558 5.0865 16.4135C5.14417 16.4712 5.21792 16.5 5.30775 16.5H18.6923C18.7821 16.5 18.8558 16.4712 18.9135 16.4135C18.9712 16.3558 19 16.2821 19 16.1923V11.4905C19 11.4007 18.9712 11.3269 18.9135 11.2693C18.8558 11.2116 18.7821 11.1827 18.6923 11.1827H17.6923V9.68275H18.6923C19.1974 9.68275 19.625 9.85775 19.975 10.2077C20.325 10.5577 20.5 10.9853 20.5 11.4905V16.1923C20.5 16.6974 20.325 17.125 19.975 17.475C19.625 17.825 19.1974 18 18.6923 18H5.30775C4.80258 18 4.375 17.825 4.025 17.475C3.675 17.125 3.5 16.6974 3.5 16.1923V11.4905C3.5 10.9853 3.675 10.5577 4.025 10.2077Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M11.3848 9.68275V7.5H12.8848V9.68275H15V11.1827H12.8848V13.2307H11.3848V11.1827H9.26925V9.68275H11.3848Z`,fill:`currentColor`})),add_column:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9.70775 4.025C9.35775 4.375 9.18275 4.80258 9.18275 5.30775V6.5H10.6827V5.30775C10.6827 5.21792 10.7116 5.14417 10.7693 5.0865C10.8269 5.02883 10.9007 5 10.9905 5H15.6923C15.7821 5 15.8558 5.02883 15.9135 5.0865C15.9712 5.14417 16 5.21792 16 5.30775V18.6923C16 18.7821 15.9712 18.8558 15.9135 18.9135C15.8558 18.9712 15.7821 19 15.6923 19H10.9905C10.9007 19 10.8269 18.9712 10.7693 18.9135C10.7116 18.8558 10.6827 18.7821 10.6827 18.6923V17.6923H9.18275V18.6923C9.18275 19.1974 9.35775 19.625 9.70775 19.975C10.0577 20.325 10.4853 20.5 10.9905 20.5H15.6923C16.1974 20.5 16.625 20.325 16.975 19.975C17.325 19.625 17.5 19.1974 17.5 18.6923V5.30775C17.5 4.80258 17.325 4.375 16.975 4.025C16.625 3.675 16.1974 3.5 15.6923 3.5H10.9905C10.4853 3.5 10.0577 3.675 9.70775 4.025Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M9.18275 11.3848H7V12.8848H9.18275V15H10.6827V12.8848H12.7307V11.3848H10.6827V9.26925H9.18275V11.3848Z`,fill:`currentColor`})),insert_col_left:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M13.0001 20.1152H8.67713H8.75388H8.69238H13.0001ZM7.19238 19.8075C7.19238 20.3127 7.36738 20.7402 7.71738 21.0902C8.06738 21.4402 8.49497 21.6152 9.00013 21.6152H12.6924C13.1975 21.6152 13.6251 21.4402 13.9751 21.0902C14.3251 20.7402 14.5001 20.3127 14.5001 19.8075V10.423H13.0001V19.8075C13.0001 19.8973 12.9713 19.9711 12.9136 20.0287C12.856 20.0864 12.7822 20.1152 12.6924 20.1152H9.00013C8.9103 20.1152 8.83655 20.0864 8.77888 20.0287C8.72122 19.9711 8.69238 19.8973 8.69238 19.8075V4.69223C8.26422 4.74357 7.90722 4.93299 7.62138 5.26048C7.33538 5.58798 7.19238 5.97548 7.19238 6.42298V19.8075ZM13.0001 2.49998V4.61523H10.8846V6.11523H13.0001V8.23073H14.5001V6.11523H16.6154V4.61523H14.5001V2.49998H13.0001Z`,fill:`currentColor`})),insert_row_above:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M20.1152 9.99987V14.3229V14.2461V14.3076V9.99987ZM19.8075 15.8076C20.3127 15.8076 20.7402 15.6326 21.0902 15.2826C21.4402 14.9326 21.6152 14.505 21.6152 13.9999V10.3076C21.6152 9.80245 21.4402 9.37487 21.0902 9.02487C20.7402 8.67487 20.3127 8.49987 19.8075 8.49987H10.423V9.99987H19.8075C19.8973 9.99987 19.9711 10.0287 20.0287 10.0864C20.0864 10.144 20.1152 10.2178 20.1152 10.3076V13.9999C20.1152 14.0897 20.0864 14.1635 20.0287 14.2211C19.9711 14.2788 19.8973 14.3076 19.8075 14.3076H4.69223C4.74357 14.7358 4.93299 15.0928 5.26048 15.3786C5.58798 15.6646 5.97548 15.8076 6.42298 15.8076H19.8075ZM2.49998 9.99987H4.61523V12.1154H6.11523V9.99987H8.23073V8.49987H6.11523V6.38462H4.61523V8.49987H2.49998V9.99987Z`,fill:`currentColor`})),insert_row_below:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M20.1152 14.1924V9.86939V9.94614V9.88464V14.1924ZM19.8075 8.38464C20.3127 8.38464 20.7402 8.55964 21.0902 8.90964C21.4402 9.25964 21.6152 9.68723 21.6152 10.1924V13.8846C21.6152 14.3898 21.4402 14.8174 21.0902 15.1674C20.7402 15.5174 20.3127 15.6924 19.8075 15.6924H10.423V14.1924H19.8075C19.8973 14.1924 19.9711 14.1636 20.0287 14.1059C20.0864 14.0482 20.1152 13.9745 20.1152 13.8846V10.1924C20.1152 10.1026 20.0864 10.0288 20.0287 9.97114C19.9711 9.91348 19.8973 9.88464 19.8075 9.88464H4.69223C4.74357 9.45648 4.93299 9.09948 5.26048 8.81364C5.58798 8.52764 5.97548 8.38464 6.42298 8.38464H19.8075ZM2.49998 14.1924H4.61523V12.0769H6.11523V14.1924H8.23073V15.6924H6.11523V17.8076H4.61523V15.6924H2.49998V14.1924Z`,fill:`currentColor`})),insert_col_right:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M10.8075 20.1152H15.1305H15.0537H15.1152H10.8075ZM16.6152 19.8075C16.6152 20.3127 16.4402 20.7402 16.0902 21.0902C15.7402 21.4402 15.3127 21.6152 14.8075 21.6152H11.1152C10.6101 21.6152 10.1825 21.4402 9.83248 21.0902C9.48248 20.7402 9.30748 20.3127 9.30748 19.8075V10.423H10.8075V19.8075C10.8075 19.8973 10.8363 19.9711 10.894 20.0287C10.9517 20.0864 11.0254 20.1152 11.1152 20.1152H14.8075C14.8973 20.1152 14.9711 20.0864 15.0287 20.0287C15.0864 19.9711 15.1152 19.8973 15.1152 19.8075V4.69223C15.5434 4.74357 15.9004 4.93299 16.1862 5.26048C16.4722 5.58798 16.6152 5.97548 16.6152 6.42298V19.8075ZM10.8075 2.49998V4.61523H12.923V6.11523H10.8075V8.23073H9.30748V6.11523H7.19223V4.61523H9.30748V2.49998H10.8075Z`,fill:`currentColor`})),check:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.54983 17.6537L4.21533 12.3192L5.28433 11.25L9.54983 15.5155L18.7153 6.34998L19.7843 7.41923L9.54983 17.6537Z`,fill:`currentColor`}))},J={editorRoot:`_editorRoot_1e2ox_53`,editorWrapper:`_editorWrapper_1e2ox_155`,toolbarRoot:`_toolbarRoot_1e2ox_162`,readOnlyToolbarRoot:`_readOnlyToolbarRoot_1e2ox_189`,toolbarToggleItem:`_toolbarToggleItem_1e2ox_208`,toolbarGroupOfGroups:`_toolbarGroupOfGroups_1e2ox_219`,toolbarToggleSingleGroup:`_toolbarToggleSingleGroup_1e2ox_224`,toolbarButton:`_toolbarButton_1e2ox_239`,activeToolbarButton:`_activeToolbarButton_1e2ox_275`,toolbarButtonDropdownContainer:`_toolbarButtonDropdownContainer_1e2ox_286`,selectContainer:`_selectContainer_1e2ox_288`,selectItem:`_selectItem_1e2ox_301`,toolbarButtonSelectTrigger:`_toolbarButtonSelectTrigger_1e2ox_307`,selectTrigger:`_selectTrigger_1e2ox_308`,selectDropdownArrow:`_selectDropdownArrow_1e2ox_374`,contentEditable:`_contentEditable_1e2ox_380`,codeMirrorWrapper:`_codeMirrorWrapper_1e2ox_392`,sandPackWrapper:`_sandPackWrapper_1e2ox_401`,codeMirrorToolbar:`_codeMirrorToolbar_1e2ox_409`,propertyPanelTitle:`_propertyPanelTitle_1e2ox_431`,propertyEditorTable:`_propertyEditorTable_1e2ox_439`,iconButton:`_iconButton_1e2ox_457`,readOnlyColumnCell:`_readOnlyColumnCell_1e2ox_462`,buttonsFooter:`_buttonsFooter_1e2ox_475`,propertyEditorInput:`_propertyEditorInput_1e2ox_481`,primaryButton:`_primaryButton_1e2ox_507`,secondaryButton:`_secondaryButton_1e2ox_508`,smallButton:`_smallButton_1e2ox_523`,dialogForm:`_dialogForm_1e2ox_535`,linkDialogEditForm:`_linkDialogEditForm_1e2ox_541`,linkDialogInputContainer:`_linkDialogInputContainer_1e2ox_549`,linkDialogInputWrapper:`_linkDialogInputWrapper_1e2ox_555`,linkDialogInput:`_linkDialogInput_1e2ox_549`,linkDialogAnchor:`_linkDialogAnchor_1e2ox_587`,linkDialogPopoverContent:`_linkDialogPopoverContent_1e2ox_601`,tableColumnEditorPopoverContent:`_tableColumnEditorPopoverContent_1e2ox_602`,dialogContent:`_dialogContent_1e2ox_603`,largeDialogContent:`_largeDialogContent_1e2ox_615`,dialogTitle:`_dialogTitle_1e2ox_625`,dialogCloseButton:`_dialogCloseButton_1e2ox_631`,popoverContent:`_popoverContent_1e2ox_638`,popoverArrow:`_popoverArrow_1e2ox_650`,linkDialogPreviewAnchor:`_linkDialogPreviewAnchor_1e2ox_654`,tooltipTrigger:`_tooltipTrigger_1e2ox_677`,tooltipContent:`_tooltipContent_1e2ox_681`,actionButton:`_actionButton_1e2ox_695`,primaryActionButton:`_primaryActionButton_1e2ox_702`,tableEditor:`_tableEditor_1e2ox_714`,toolCell:`_toolCell_1e2ox_725`,tableColumnEditorTrigger:`_tableColumnEditorTrigger_1e2ox_744`,addRowButton:`_addRowButton_1e2ox_746`,addColumnButton:`_addColumnButton_1e2ox_747`,tableColumnEditorToolbar:`_tableColumnEditorToolbar_1e2ox_789`,toggleGroupRoot:`_toggleGroupRoot_1e2ox_802`,tableToolsColumn:`_tableToolsColumn_1e2ox_820`,leftAlignedCell:`_leftAlignedCell_1e2ox_829`,rightAlignedCell:`_rightAlignedCell_1e2ox_833`,centeredCell:`_centeredCell_1e2ox_837`,dialogOverlay:`_dialogOverlay_1e2ox_870`,focusedImage:`_focusedImage_1e2ox_916`,imageWrapper:`_imageWrapper_1e2ox_920`,editImageToolbar:`_editImageToolbar_1e2ox_933`,editImageButton:`_editImageButton_1e2ox_937`,inlineEditor:`_inlineEditor_1e2ox_943`,blockEditor:`_blockEditor_1e2ox_952`,nestedEditor:`_nestedEditor_1e2ox_961`,genericComponentName:`_genericComponentName_1e2ox_980`,diffSourceToggleWrapper:`_diffSourceToggleWrapper_1e2ox_986`,ggDiffSourceToggle:`_ggDiffSourceToggle_1e2ox_994`,diffSourceToggle:`_diffSourceToggle_1e2ox_986`,selectWithLabel:`_selectWithLabel_1e2ox_1012`,toolbarTitleMode:`_toolbarTitleMode_1e2ox_1027`,imageControlWrapperResizing:`_imageControlWrapperResizing_1e2ox_1032`,imageResizer:`_imageResizer_1e2ox_1036`,imageResizerN:`_imageResizerN_1e2ox_1045`,imageResizerNe:`_imageResizerNe_1e2ox_1051`,imageResizerE:`_imageResizerE_1e2ox_1057`,imageResizerSe:`_imageResizerSe_1e2ox_1063`,imageResizerS:`_imageResizerS_1e2ox_1063`,imageResizerSw:`_imageResizerSw_1e2ox_1075`,imageResizerW:`_imageResizerW_1e2ox_1081`,imageResizerNw:`_imageResizerNw_1e2ox_1087`,imagePlaceholder:`_imagePlaceholder_1e2ox_1093`,imageDimensionsContainer:`_imageDimensionsContainer_1e2ox_1101`,placeholder:`_placeholder_1e2ox_1106`,rootContentEditableWrapper:`_rootContentEditableWrapper_1e2ox_1119`,downshiftInputWrapper:`_downshiftInputWrapper_1e2ox_1129`,downshiftInput:`_downshiftInput_1e2ox_1129`,downshiftAutocompleteContainer:`_downshiftAutocompleteContainer_1e2ox_1160`,textInput:`_textInput_1e2ox_1206`,multiFieldForm:`_multiFieldForm_1e2ox_1214`,formField:`_formField_1e2ox_1220`,markdownParseError:`_markdownParseError_1e2ox_1231`,popupContainer:`_popupContainer_1e2ox_1240`,inputSizer:`_inputSizer_1e2ox_1245`},uA=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]),dA=class e extends Hg{static getType(){return`link`}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e=``,t={},n){super(n);let{target:r=null,rel:i=null,title:a=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=a}createDOM(e){let t=document.createElement(`a`);return this.updateLinkDOM(null,t,e),ob(t,e.theme.link),t}updateLinkDOM(e,t,n){if(wv(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let n of[`target`,`rel`,`title`]){let r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:Fte,priority:1})}}static importJSON(e){return fA().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=SA(e);try{let t=new URL(SA(e));if(!uA.has(t.protocol))return`about:blank`}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=fA(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!U(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith(`mailto:`)}isWebSiteURI(){return this.__url.startsWith(`https://`)||this.__url.startsWith(`http://`)}};function Fte(e){let t=null;if(wv(e)){let n=e.textContent;(n!==null&&n!==``||e.children.length>0)&&(t=fA(e.getAttribute(`href`)||``,{rel:e.getAttribute(`rel`),target:e.getAttribute(`target`),title:e.getAttribute(`title`)}))}return{node:t}}function fA(e=``,t){return _v(new dA(e,t))}function pA(e){return e instanceof dA}var mA=class e extends dA{constructor(e=``,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return`autolink`}static clone(t){return new e(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement(`span`):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return hA().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){let n=this.getParentOrThrow().insertNewAfter(e,t);if(G(n)){let e=hA(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(e),e}return null}};function hA(e=``,t){return _v(new mA(e,t))}function gA(e){return e instanceof mA}var _A=Kp(`TOGGLE_LINK_COMMAND`);function vA(e,t){if(e.type===`element`){let n=e.getNode();return G(n)||function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function yA(e,t={}){let{target:n,title:r}=t,i=t.rel===void 0?`noreferrer`:t.rel,a=W();if(a===null||!U(a)&&!Wh(a))return;if(Wh(a)){let t=a.getNodes();if(t.length===0)return;t.forEach((t=>{if(e===null){let e=db(t,(e=>!gA(e)&&pA(e)));e&&(e.insertBefore(t),e.getChildren().length===0&&e.remove())}else{let r=db(t,(e=>!gA(e)&&pA(e)));if(r)r.setURL(e),n!==void 0&&r.setTarget(n),i!==void 0&&r.setRel(i);else{let r=fA(e,{rel:i,target:n});t.insertBefore(r),r.append(t)}}}));return}let o=a.extract();if(e===null)return void o.forEach((e=>{let t=db(e,(e=>!gA(e)&&pA(e)));if(t){let e=t.getChildren();for(let n=0;n<e.length;n++)t.insertBefore(e[n]);t.remove()}}));let s=new Set,c=t=>{s.has(t.getKey())||(s.add(t.getKey()),t.setURL(e),n!==void 0&&t.setTarget(n),i!==void 0&&t.setRel(i),r!==void 0&&t.setTitle(r))};if(o.length===1){let e=bA(o[0],pA);if(e!==null)return c(e)}(function(e){let t=W();if(!U(t))return e();let n=up(t),r=n.isBackward(),i=vA(n.anchor,r?-1:0),a=vA(n.focus,r?0:-1);if(e(),i||a){let e=W();if(U(e)){let t=e.clone();if(i){let e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+ +!!r,`element`)}if(a){let e=a.getParent();e&&t.focus.set(e.getKey(),a.getIndexWithinParent()+ +!r,`element`)}R_(up(t))}}})((()=>{let t=null;for(let a of o){if(!a.isAttached())continue;let o=bA(a,pA);if(o){c(o);continue}if(G(a)){if(!a.isInline())continue;if(pA(a)){if(!(gA(a)||t!==null&&t.getParentOrThrow().isParentOf(a))){c(a),t=a;continue}for(let e of a.getChildren())a.insertBefore(e);a.remove();continue}}let s=a.getPreviousSibling();pA(s)&&s.is(t)?s.append(a):(t=fA(e,{rel:i,target:n,title:r}),a.insertAfter(t),t.append(a))}}))}function bA(e,t){let n=e;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}var xA=/^\+?[0-9\s()-]{5,}$/;function SA(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes(`@`)?`mailto:${e}`:xA.test(e)?`tel:${e}`:`https://${e}`}function CA(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function wA(e){let t=1,n=e.getParent();for(;n!=null;){if(WA(n)){let e=n.getParent();if(ZA(e)){t++,n=e.getParent();continue}CA(40)}return t}return t}function TA(e){let t=e.getParent();ZA(t)||CA(40);let n=t;for(;n!==null;)n=n.getParent(),ZA(n)&&(t=n);return t}function EA(e){let t=[],n=e.getChildren().filter(WA);for(let e=0;e<n.length;e++){let r=n[e],i=r.getFirstChild();ZA(i)?t=t.concat(EA(i)):t.push(r)}return t}function DA(e){return WA(e)&&ZA(e.getFirstChild())}function OA(e){return UA().append(e)}function kA(e,t){return WA(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function AA(e){let t=W();if(t!==null){let n=t.getNodes();if(U(t)){let r=t.getStartEndPoints();r===null&&CA(143);let[i]=r,a=i.getNode(),o=a.getParent();if(hv(a)){let e=a.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=r_();a.append(e),n=e.select().getNodes()}}else if(kA(a,n)){let t=XA(e);if(hv(o)){a.replace(t);let e=UA();G(a)&&(e.setFormat(a.getFormatType()),e.setIndent(a.getIndent())),t.append(e)}else if(WA(a)){let e=a.getParentOrThrow();jA(t,e.getChildren()),e.replace(t)}return}}let r=new Set;for(let t=0;t<n.length;t++){let i=n[t];if(G(i)&&i.isEmpty()&&!WA(i)&&!r.has(i.getKey())){MA(i,e);continue}let a=w_(i)?i.getParent():WA(i)&&i.isEmpty()?i:null;for(;a!=null;){let t=a.getKey();if(ZA(a)){if(!r.has(t)){let n=XA(e);jA(n,a.getChildren()),a.replace(n),r.add(t)}break}{let n=a.getParent();if(hv(n)&&!r.has(t)){r.add(t),MA(a,e);break}a=n}}}}}function jA(e,t){e.splice(e.getChildrenSize(),0,t)}function MA(e,t){if(ZA(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),i=UA(),a;if(jA(i,e.getChildren()),ZA(n)&&t===n.getListType())n.append(i),ZA(r)&&t===r.getListType()&&(jA(n,r.getChildren()),r.remove()),a=n;else if(ZA(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),a=r;else{let n=XA(t);n.append(i),e.replace(n),a=n}return i.setFormat(e.getFormatType()),i.setIndent(e.getIndent()),e.remove(),a}function NA(e,t){let n=e.getLastChild(),r=t.getFirstChild();n&&r&&DA(n)&&DA(r)&&(NA(n.getFirstChild(),r.getFirstChild()),r.remove());let i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function PA(){let e=W();if(U(e)){let t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(kA(r,n))t.add(TA(r));else for(let e=0;e<n.length;e++){let r=n[e];if(w_(r)){let e=lb(r,BA);e!=null&&t.add(TA(e))}}for(let n of t){let t=n,r=EA(n);for(let n of r){let r=r_().setTextStyle(e.style).setTextFormat(e.format);jA(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&yy(e.anchor,Dy(iy(r,`next`))),n.__key===e.focus.key&&yy(e.focus,Dy(iy(r,`next`))),n.remove()}n.remove()}}}function FA(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())WA(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),ZA(r.getFirstChild())||n++)}function IA(e){let t=new Set;if(DA(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(DA(r)&&DA(i)){let n=i.getFirstChild();if(ZA(n)){n.append(e);let i=r.getFirstChild();ZA(i)&&(jA(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(DA(r)){let t=r.getFirstChild();if(ZA(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(DA(i)){let t=i.getFirstChild();ZA(t)&&t.append(e)}else if(ZA(n)){let t=UA().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),a=XA(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function LA(e){if(DA(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(ZA(n?n.getParent():void 0)&&WA(n)&&ZA(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=t.getListType(),i=UA(),a=XA(r);i.append(a),e.getPreviousSiblings().forEach((e=>a.append(e)));let o=UA(),s=XA(r);o.append(s),jA(s,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(o),n.replace(e)}}}function RA(){let e=W();if(!U(e)||!e.isCollapsed())return!1;let t=e.anchor.getNode();if(!WA(t)||t.getChildrenSize()!==0)return!1;let n=TA(t),r=t.getParent();ZA(r)||CA(40);let i=r.getParent(),a;if(hv(i))a=r_(),n.insertAfter(a);else{if(!WA(i))return!1;a=UA(),i.insertAfter(a)}a.setTextStyle(e.style).setTextFormat(e.format).select();let o=t.getNextSiblings();if(o.length>0){let e=XA(r.getListType());if(WA(a)){let t=UA();t.append(e),a.insertAfter(t)}else a.insertAfter(e);e.append(...o)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!WA(e)&&!ZA(e))break;t=e}t.remove()}(t),!0}function zA(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}var BA=class extends Hg{$config(){return this.config(`listitem`,{$transform:e=>{if(e.__checked==null)return;let t=e.getParent();ZA(t)&&t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0)},extends:Hg,importDOM:dh({li:()=>({conversion:VA,priority:0})})})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let t=document.createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){let r=this.getParent();ZA(r)&&r.getListType()===`check`&&function(e,t,n,r){ZA(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),n&&t.__checked===n.__checked||e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))}(t,this,e),t.value=this.__value,function(e,t,n){let r=[],i=[],a=t.list,o=a?a.listitem:void 0,s;if(a&&a.nested&&(s=a.nested.listitem),o!==void 0&&r.push(...zA(o)),a){let e=n.getParent(),t=ZA(e)&&e.getListType()===`check`,o=n.getChecked();t&&!o||i.push(a.listitemUnchecked),t&&o||i.push(a.listitemChecked),t&&r.push(o?a.listitemChecked:a.listitemUnchecked)}if(s!==void 0){let e=zA(s);n.getChildren().some((e=>ZA(e)))?r.push(...e):i.push(...e)}i.length>0&&sb(e,...i),r.length>0&&ob(e,...r)}(t,n.theme,this);let i=e?e.__style:``,a=this.__style;i!==a&&(a===``?t.removeAttribute(`style`):t.style.cssText=a),function(e,t,n){let r=Ry(t.__textStyle);for(let t in r)e.style.setProperty(`--listitem-marker-${t}`,r[t]);if(n)for(let t in Ry(n.__textStyle))t in r||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(G(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(WA(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!ZA(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=XA(n.getListType()),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&(G(e)||CA(139),this.getChildren().forEach((t=>{e.append(t)}))),this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(ZA(n)||CA(39),WA(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),r.length!==0){let i=XA(n.getListType());r.forEach((e=>i.append(e))),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&DA(t)&&DA(n)&&(NA(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){let n=UA().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){let t=r_();this.getChildren().forEach((e=>t.append(e)));let n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=WA(r);if(n.getChildrenSize()===1)if(i)n.remove(),r.select();else{n.insertBefore(t),n.remove();let r=e.anchor,i=e.focus,a=t.getKey();r.type===`element`&&r.getNode().is(this)&&r.set(a,r.offset,`element`),i.type===`element`&&i.getNode().is(this)&&i.set(a,i.offset,`element`)}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return ZA(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;WA(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&CA(117),(e=Math.floor(e))>=0||CA(199);let t=this.getIndent();for(;t!==e;)t<e?(IA(this),t++):(LA(this),t--);return this}canInsertAfter(e){return WA(e)}canReplaceWith(e){return WA(e)}canMergeWith(e){return WA(e)||i_(e)}extractWithChild(e,t){if(!U(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return XA(`bullet`)}canMergeWhenEmpty(){return!0}};function VA(e){if(e.classList.contains(`task-list-item`)){for(let t of e.children)if(t.tagName===`INPUT`)return HA(t)}let t=e.getAttribute(`aria-checked`);return{node:UA(t===`true`||t!==`false`&&void 0)}}function HA(e){return e.getAttribute(`type`)===`checkbox`?{node:UA(e.hasAttribute(`checked`))}:{node:null}}function UA(e){return _v(new BA(void 0,e))}function WA(e){return e instanceof BA}var GA=class extends Hg{$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.getNextSibling();ZA(t)&&e.getListType()===t.getListType()&&NA(e,t)})(e),FA(e)},extends:Hg,importDOM:dh({ol:()=>({conversion:JA,priority:0}),ul:()=>({conversion:JA,priority:0})})})}constructor(e=`number`,t=1,n){super(n);let r=YA[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=document.createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,KA(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||(KA(t,n.theme,this),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let t=this.createDOM(e._config,e);return Tv(t)&&(this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`)),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){let t=n[e];WA(t)||(r===n&&(r=[...n]),r[e]=UA().append(!G(t)||ZA(t)||t.isInline()?t:Nh(t.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return WA(e)}};function KA(e,t,n){let r=[],i=[],a=t.list;if(a!==void 0){let e=a[`${n.__tag}Depth`]||[],t=wA(n)-1,o=t%e.length,s=e[o],c=a[n.__tag],l,u=a.nested,d=a.checklist;if(u!==void 0&&u.list&&(l=u.list),c!==void 0&&r.push(c),d!==void 0&&n.__listType===`check`&&r.push(d),s!==void 0){r.push(...zA(s));for(let t=0;t<e.length;t++)t!==o&&i.push(n.__tag+t)}if(l!==void 0){let e=zA(l);t>1?r.push(...e):i.push(...e)}}i.length>0&&sb(e,...i),r.length>0&&ob(e,...r)}function qA(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(WA(r)){t.push(r);let e=r.getChildren();e.length>1&&e.forEach((e=>{ZA(e)&&t.push(OA(e))}))}else t.push(OA(r))}return t}function JA(e){let t=e.nodeName.toLowerCase(),n=null;return t===`ol`?n=XA(`number`,e.start):t===`ul`&&(n=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`))return!0;for(let t of e.childNodes)if(Tv(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?XA(`check`):XA(`bullet`)),{after:qA,node:n}}var YA={ol:`number`,ul:`bullet`};function XA(e=`number`,t=1){return _v(new GA(e,t))}function ZA(e){return e instanceof GA}var QA=Kp(`INSERT_CHECK_LIST_COMMAND`);function $A(e){return rb(e.registerCommand(QA,(()=>(AA(`check`),!0)),1),e.registerCommand(pm,(t=>ij(t,e,!1)),1),e.registerCommand(fm,(t=>ij(t,e,!0)),1),e.registerCommand(_m,(()=>rj()==null?!1:(e.getRootElement()?.focus(),!0)),1),e.registerCommand(hm,(t=>{let n=rj();return!(n==null||!e.isEditable())&&(e.update((()=>{let e=N_(n);WA(e)&&(t.preventDefault(),e.toggleChecked())})),!0)}),1),e.registerCommand(um,(t=>e.getEditorState().read((()=>{let n=W();if(U(n)&&n.isCollapsed()){let{anchor:r}=n,i=r.type===`element`;if(i||r.offset===0){let n=r.getNode(),a=db(n,(e=>G(e)&&!e.isInline()));if(WA(a)){let r=a.getParent();if(ZA(r)&&r.getListType()===`check`&&(i||a.getFirstDescendant()===n)){let n=e.getElementByKey(a.__key);if(n!=null&&document.activeElement!==n)return n.focus(),t.preventDefault(),!0}}}}return!1}))),1),e.registerRootListener(((e,t)=>{e!==null&&(e.addEventListener(`click`,tj),e.addEventListener(`pointerdown`,nj)),t!==null&&(t.removeEventListener(`click`,tj),t.removeEventListener(`pointerdown`,nj))})))}function ej(e,t){let n=e.target;if(!Tv(n))return;let r=n.firstChild;if(Tv(r)&&(r.tagName===`UL`||r.tagName===`OL`))return;let i=n.parentNode;if(!i||i.__lexicalListType!==`check`)return;let a=n.getBoundingClientRect(),o=vb(n),s=e.clientX/o,c=window.getComputedStyle?window.getComputedStyle(n,`::before`):{width:`0px`},l=parseFloat(c.width),u=e.pointerType===`touch`?32:0;(n.dir===`rtl`?s<a.right+u&&s>a.right-l-u:s>a.left-u&&s<a.left+l+u)&&t()}function tj(e){ej(e,(()=>{if(Tv(e.target)){let t=e.target,n=g_(t);n!=null&&n.isEditable()&&n.update((()=>{let e=N_(t);WA(e)&&(t.focus(),e.toggleChecked())}))}}))}function nj(e){ej(e,(()=>{e.preventDefault()}))}function rj(){let e=document.activeElement;return Tv(e)&&e.tagName===`LI`&&e.parentNode!=null&&e.parentNode.__lexicalListType===`check`?e:null}function ij(e,t,n){let r=rj();return r!=null&&t.update((()=>{let i=N_(r);if(!WA(i))return;let a=function(e,t){let n=t?e.getPreviousSibling():e.getNextSibling(),r=e;for(;n==null&&WA(r);)r=r.getParentOrThrow().getParent(),r!=null&&(n=t?r.getPreviousSibling():r.getNextSibling());for(;WA(n);){let e=t?n.getLastChild():n.getFirstChild();if(!ZA(e))return n;n=t?e.getLastChild():e.getFirstChild()}return null}(i,n);if(a!=null){a.selectStart();let n=t.getElementByKey(a.__key);n!=null&&(e.preventDefault(),setTimeout((()=>{n.focus()}),0))}})),!1}var aj=Kp(`UPDATE_LIST_START_COMMAND`),oj=Kp(`INSERT_UNORDERED_LIST_COMMAND`),sj=Kp(`INSERT_ORDERED_LIST_COMMAND`),cj=Kp(`REMOVE_LIST_COMMAND`);function lj(e){return rb(e.registerCommand(sj,(()=>(AA(`number`),!0)),1),e.registerCommand(aj,(e=>{let{listNodeKey:t,newStart:n}=e,r=A_(t);return!!ZA(r)&&(r.getListType()===`number`&&(r.setStart(n),FA(r)),!0)}),1),e.registerCommand(oj,(()=>(AA(`bullet`),!0)),1),e.registerCommand(cj,(()=>(PA(),!0)),1),e.registerCommand(Qp,(()=>RA()),1),e.registerNodeTransform(BA,(e=>{let t=e.getFirstChild();if(t){if(H(t)){let n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{let t=W();U(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}})),e.registerNodeTransform(wh,(e=>{let t=e.getParent();if(WA(t)&&e.is(t.getFirstChild())){let n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}})))}function uj(e){let t=e=>{let t=e.getParent();if(ZA(e.getFirstChild())||!ZA(t))return;let n=db(e,(e=>WA(e)&&ZA(e.getParent())&&WA(e.getPreviousSibling())));if(n===null&&e.getIndent()>0)e.setIndent(0);else if(WA(n)){let r=n.getPreviousSibling();if(WA(r)){let n=function(e){let t=e,n=t.getFirstChild();for(;ZA(n);){let e=n.getLastChild();if(!WA(e))break;t=e,n=t.getFirstChild()}return t}(r).getParent();if(ZA(n)){let r=wA(n);r+1<wA(t)&&e.setIndent(r)}}}};return e.registerNodeTransform(GA,(e=>{let n=[e];for(;n.length>0;){let e=n.shift();if(ZA(e)){for(let r of e.getChildren())if(WA(r)){t(r);let e=r.getFirstChild();ZA(e)&&n.push(e)}}}}))}function dj(e){try{let t=e.anchor,n=e.focus,r=e.anchor.getNode(),i=e.focus.getNode();return r===i?r:e.isBackward()?Uy(n)?r:i:Uy(t)?r:i}catch{return null}}var fj=[`transform`,`perspective`,`filter`,`backdrop-filter`,`contain`,`container-type`],pj=[`layout`,`paint`,`strict`,`content`];function mj(e){let t=e?.parentElement;for(;t;){let e=window.getComputedStyle(t),n=e.willChange.split(`,`).map(e=>e.trim()).some(e=>fj.includes(e));if(e.transform!==`none`||e.perspective!==`none`||e.filter!==`none`||e.backdropFilter!==`none`||pj.includes(e.contain)||e.containerType!==`normal`||e.contentVisibility===`auto`||n)return t;t=t.parentElement}return null}function hj(e){let t=W(),n=window.getSelection(),r=document.activeElement,i=e.getRootElement();if(t!==null&&n!==null&&i!==null&&i.contains(n.anchorNode)&&e.isEditable()){let e=n.getRangeAt(0),t;if(n.isCollapsed){let e=n.anchorNode;e?.nodeType==3&&(e=e.parentNode),t=e.getBoundingClientRect(),t.width=0}else if(n.anchorNode===i){let e=i;for(;e.firstElementChild!=null;)e=e.firstElementChild;t=e.getBoundingClientRect()}else t=e.getBoundingClientRect();let r=mj(i);if(r){let e=r.getBoundingClientRect();return{top:Math.round(t.top-e.top),left:Math.round(t.left-e.left),width:Math.round(t.width),height:Math.round(t.height)}}return{top:Math.round(t.top),left:Math.round(t.left),width:Math.round(t.width),height:Math.round(t.height)}}else if(r?.className!==`link-input`)return null;return null}function gj(e,t){let n=``;return e.getEditorState().read(()=>{let e=W();if(!e||!U(e)||e.isCollapsed())return;let t=e.getNodes();if(t.length===0)return;let r=new Set;t.forEach(e=>{let t=e;for(;t;){if(gx(t)||WA(t)||t.getType()===`paragraph`||t.getType()===`quote`){G(t)&&r.add(t);break}t=t.getParent()}});let i=r.size>0?Array.from(r):t;function a(e){if(gx(e)){let t=parseInt(e.getTag().replace(`h`,``)),n=e.getChildren().map(e=>a(e)).join(``);return`#`.repeat(t)+` `+n+`
80
-
81
- `}else if(WA(e)){let t=e.getParent();return(t&&ZA(t)&&t.getListType()===`number`?`1. `:`- `)+e.getChildren().map(e=>a(e)).join(``)+`
82
- `}else if(ZA(e))return e.getChildren().map(e=>a(e)).join(``)+`
83
- `;else if(H(e)){let t=e.getTextContent(),n=e.getFormat();return n&16?`\`${t}\``:(n&1&&(t=`**${t}**`),n&2&&(t=`*${t}*`),n&4&&(t=`~~${t}~~`),t)}else if(pA(e)){let t=e.getURL(),n=e.getTitle(),r=e.getChildren().map(e=>a(e)).join(``);return n?`[${r}](${t} "${n}")`:`[${r}](${t})`}else if(G(e))return e.getChildren().map(e=>a(e)).join(``);return e.getTextContent()}n=i.map(e=>a(e)).join(``)}),n.trim()}var _j=t(cA(),1),vj=({children:e})=>{let t=Hd(vO),n=I.useMemo(()=>[t,ef(null,gO)],[t]);return I.createElement($d.Provider,{value:n},e)},yj=()=>{let e=Rk(),t=Wd(JO),n=Wd(ak),r=e=>{n(e),t(e?{current:e}:null)},[i,a,o,s,c,l,u]=Ud(bO,xO,gk,vk,Sk,CO,bk);return I.createElement(I.Fragment,null,s.map((e,t)=>I.createElement(e,{key:t})),I.createElement(Cj,{wrappers:c},I.createElement(`div`,{className:(0,_j.default)(J.rootContentEditableWrapper,`mdxeditor-root-contenteditable`)},I.createElement(oA,{contentEditable:I.createElement(`div`,{ref:r},I.createElement(qk,{className:(0,_j.default)(J.contentEditable,i),ariaLabel:e(`contentArea.editableMarkdown`,`editable markdown`),spellCheck:a})),placeholder:I.createElement(`div`,{className:(0,_j.default)(J.contentEditable,J.placeholder,i)},I.createElement(`p`,null,l)),ErrorBoundary:$k}))),o.map((e,t)=>I.createElement(e,{key:t})),u.map((e,t)=>I.createElement(e,{key:t})))},bj={listItemIndent:`one`},xj=e=>lA[e];function Sj(e,t,n={}){let r=t;for(let[e,t]of Object.entries(n))r=r.replaceAll(`{{${e}}}`,String(t));return r}var Cj=({wrappers:e,children:t})=>{if(e.length===0)return I.createElement(I.Fragment,null,t);let n=e[0];return I.createElement(n,null,I.createElement(Cj,{wrappers:e.slice(1)},t))},wj=({children:e,className:t,overlayContainer:n})=>{let r=I.useRef(null),i=I.useRef(null),a=Wd(qO),o=Wd(Pte);return I.useEffect(()=>{let e=document.createElement(`div`);return e.classList.add(`mdxeditor-popup-container`,J.editorRoot,J.popupContainer,...(t??``).trim().split(` `).filter(Boolean)),(n??document.body).appendChild(e),r.current=e,a(r),o(i),()=>{e.remove()}},[t,r,n,a,o]),I.createElement(`div`,{className:(0,_j.default)(`mdxeditor`,J.editorRoot,J.editorWrapper,t),ref:i},e)},Tj=({mdxRef:e})=>{let t=Vd();return I.useImperativeHandle(e,()=>({getMarkdown:()=>{let e=t.getValue(jk);return e===`source`||e===`diff`?t.getValue(Mk):t.getValue(MO)},setMarkdown:e=>{t.pub(nk,e)},insertMarkdown:e=>{t.pub(rk,e)},focus:(e,n)=>{var r;(r=t.getValue(vO))==null||r.focus(e,n)},getContentEditableHTML:()=>t.getValue(JO)?.current.innerHTML??``,getSelectionMarkdown:()=>{let e=t.getValue(jk);if(e===`source`||e===`diff`)return``;let n=t.getValue(yO);return n?(t.getValue(BO),t.getValue(VO),t.getValue(HO),t.getValue(WO),t.getValue(UO),gj(n)):``}}),[t]),null},Ej=I.forwardRef((e,t)=>I.createElement(Qd,{plugins:[Lk({contentEditableClassName:e.contentEditableClassName??``,spellCheck:e.spellCheck??!0,initialMarkdown:e.markdown,onChange:e.onChange??Xd,onBlur:e.onBlur??Xd,toMarkdownOptions:e.toMarkdownOptions??bj,autoFocus:e.autoFocus??!1,placeholder:e.placeholder??``,readOnly:!!e.readOnly,iconComponentFor:e.iconComponentFor??xj,suppressHtmlProcessing:e.suppressHtmlProcessing??!1,onError:e.onError??Xd,translation:e.translation??Sj,trim:e.trim??!0,lexicalTheme:e.lexicalTheme,...`editorState`in e?{editorState:e.editorState}:{},suppressSharedHistory:e.suppressSharedHistory??!1,additionalLexicalNodes:e.additionalLexicalNodes??[],lexicalEditorNamespace:e.lexicalEditorNamespace??`MDXEditor`}),...e.plugins??[]]},I.createElement(wj,{className:e.className,overlayContainer:e.overlayContainer},I.createElement(vj,null,I.createElement(yj,null))),I.createElement(Tj,{mdxRef:t}))),Dj=typeof window<`u`&&window.document.createElement!==void 0&&(()=>{let e=navigator.userAgentData?.platform;return e?/mac/i.test(e):/Mac|iPod|iPhone|iPad/.test(navigator.userAgent)})();function Oj(e,t){return Dj?e:t}var kj={testLexicalNode:gx,visitLexicalNode:({lexicalNode:e,actions:t})=>{let n=parseInt(e.getTag()[1],10);t.addAndStepInto(`heading`,{depth:n})}},Aj={testNode:`heading`,visitNode:function({mdastNode:e,actions:t}){t.addAndStepInto(hx(`h${e.depth}`))}},jj=[`Digit0`,`Digit1`,`Digit2`,`Digit3`,`Digit4`,`Digit5`,`Digit6`],Mj=[1,2,3,4,5,6],Nj={Digit1:1,Digit2:2,Digit3:3,Digit4:4,Digit5:5,Digit6:6},Pj=B(Mj,e=>{e.pub(pk,t=>t.registerCommand(sm,n=>{let{code:r,ctrlKey:i,metaKey:a,altKey:o}=n;return jj.includes(r)&&Oj(a,i)&&o?(n.preventDefault(),t.update(()=>{if(r===`Digit0`)e.pub(kk,()=>r_());else{let t=e.getValue(Pj),n=Nj[r];t.includes(n)&&e.pub(kk,()=>hx(`h${n}`))}}),!0):!1},1))}),Fj=Zd({init(e){e.pubIn({[Pk]:`headings`,[XO]:Aj,[YO]:dx,[$O]:kj})},update(e,t){e.pub(Pj,t?.allowedHeadingLevels??Mj)}});function Ij(e,t){return e.getEditorState().read((()=>{let e=A_(t);return e!==null&&e.isSelected()}))}function Lj(e){let[t]=tf(),[n,r]=(0,I.useState)((()=>Ij(t,e)));return(0,I.useEffect)((()=>{let n=!0,i=t.registerUpdateListener((()=>{n&&r(Ij(t,e))}));return()=>{n=!1,i()}}),[t,e]),[n,(0,I.useCallback)((n=>{t.update((()=>{let t=W();Wh(t)||(t=rg(),R_(t)),Wh(t)&&(n?t.add(e):t.delete(e))}))}),[t,e]),(0,I.useCallback)((()=>{t.update((()=>{let e=W();Wh(e)&&e.clear()}))}),[t])]}var Rj=Kp(`INSERT_HORIZONTAL_RULE_COMMAND`);function zj({nodeKey:e}){let[t]=tf(),[n,r,i]=Lj(e);return(0,I.useEffect)((()=>rb(t.registerCommand(Yp,(a=>{let o=t.getElementByKey(e);return a.target===o&&(a.shiftKey||i(),r(!n),!0)}),1))),[i,t,n,e,r]),(0,I.useEffect)((()=>{let r=t.getElementByKey(e),i=t._config.theme.hrSelected??`selected`;r!==null&&(n?ob(r,i):sb(r,i))}),[t,n,e]),null}var Bj=class e extends Wg{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return Hj().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:Vj,priority:0})}}exportDOM(){return{element:document.createElement(`hr`)}}createDOM(e){let t=document.createElement(`hr`);return ob(t,e.theme.hr),t}getTextContent(){return`
84
- `}isInline(){return!1}updateDOM(){return!1}decorate(){return(0,L.jsx)(zj,{nodeKey:this.__key})}};function Vj(){return{node:Hj()}}function Hj(){return _v(new Bj)}function Uj(e){return e instanceof Bj}function Wj(){let[e]=tf();return(0,I.useEffect)((()=>e.registerCommand(Rj,(e=>{let t=W();return U(t)?(t.focus.getNode()!==null&&fb(Hj()),!0):!1}),0)),[e]),null}var Gj={testLexicalNode:Uj,visitLexicalNode({actions:e}){e.addAndStepInto(`thematicBreak`)}},Kj={testNode:`thematicBreak`,visitNode({actions:e}){e.addAndStepInto(Hj())}},qj=zd(e=>{e.sub(e.pipe(qj,Kd(yO)),([,e])=>{e?.dispatchCommand(Rj,void 0)})}),Jj=Zd({init(e){e.pubIn({[Pk]:`thematicBreak`,[XO]:Kj,[YO]:Bj,[$O]:Gj,[_k]:Wj})}}),Yj={testNode:`list`,visitNode:function({mdastNode:e,lexicalParent:t,actions:n}){let r=XA(e.children.some(e=>typeof e.checked==`boolean`)?`check`:e.ordered?`number`:`bullet`);if(WA(t)){let e=UA();e.append(r),t.insertAfter(e)}else t.append(r);n.visitChildren(e,r)}},Xj={testNode:`listItem`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){let r=n.getListType()===`check`?e.checked??!1:void 0;t.addAndStepInto(UA(r))}},Zj={testLexicalNode:ZA,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto(`list`,{ordered:e.getListType()===`number`,spread:!1})}},Qj={testLexicalNode:WA,visitLexicalNode:({lexicalNode:e,mdastParent:t,actions:n})=>{let r=e.getChildren(),i=r[0];if(r.length===1&&ZA(i)){let r=t.children.at(-1);r?n.visitChildren(e,r):n.visitChildren(i,t)}else{let r=e.getParent(),i=n.appendToParent(t,{type:`listItem`,checked:r.getListType()===`check`?!!e.getChecked():void 0,spread:!1,children:[]}),a=null;for(let t of e.getChildren())H(t)||gh(t)||t.isInline()&&(G(t)||Gg(t))?(a??=n.appendToParent(i,{type:`paragraph`,children:[]}),n.visit(t,a)):(a=null,n.visit(t,i))}}};function $j(e,t){return rb(e.registerCommand(ym,(t=>{let n=W();if(!U(n))return!1;t.preventDefault();let r=function(e){if(gb(e.getNodes(),(e=>eg(e)&&e.canIndent()?e:null)).length>0)return!0;let t=e.anchor,n=e.focus,r=n.isBefore(t)?n:t,i=ub(r.getNode());if(i.canIndent()){let e=i.getKey(),t=ng();if(t.anchor.set(e,0,`element`),t.focus.set(e,0,`element`),t=up(t),t.anchor.is(r))return!0}return!1}(n)?t.shiftKey?Sm:xm:bm;return e.dispatchCommand(r,void 0)}),0),e.registerCommand(xm,(()=>{if(t==null)return!1;let e=W();if(!U(e))return!1;let n=e.getNodes().map((e=>ub(e).getIndent()));return Math.max(...n)+1>=t}),4))}function eM({maxIndent:e}){let[t]=tf();return(0,I.useEffect)((()=>$j(t,e)),[t,e]),null}function tM(){let[e]=tf();return(0,I.useEffect)((()=>$A(e)),[e]),null}function nM({hasStrictIndent:e=!1}){let[t]=tf();return(0,I.useEffect)((()=>{if(!t.hasNodes([GA,BA]))throw Error(`ListPlugin: ListNode and/or ListItemNode not registered on editor`)}),[t]),(0,I.useEffect)((()=>{if(e)return uj(t)}),[t,e]),function(e){(0,I.useEffect)((()=>lj(e)),[e])}(t),null}var rM={name:`tasklistCheck`,tokenize:aM};function iM(){return{text:{91:rM}}}function aM(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return jx(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return q(r)?t(r):Mx(r)?e.check({tokenize:oM},t,n)(r):n(r)}}function oM(e,t,n){return jC(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function sM(){return{exit:{taskListCheckValueChecked:lM,taskListCheckValueUnchecked:lM,paragraph:uM}}}function cM(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:dM}}}function lM(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function uM(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function dM(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=DT.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}var fM=new Map([[`number`,sj],[`bullet`,oj],[`check`,QA],[``,cj]]),pM=B(``,e=>{e.sub(e.pipe(AO,Kd(yO)),([t,n])=>{if(!t||!n)return;let r=t.anchor.getNode(),i=r.getKey()===`root`?r:db(r,e=>{let t=e.getParent();return t!==null&&hv(t)});i??=r.getTopLevelElementOrThrow();let a=i.getKey();if(n.getElementByKey(a)!==null)if(ZA(i)){let t=lb(r,GA),n=t?t.getListType():i.getListType();e.pub(pM,n)}else e.pub(pM,``)})}),mM=Rd(e=>{e.sub(e.pipe(mM,Kd(yO)),([e,t])=>{t?.dispatchCommand(fM.get(e),void 0)})}),hM=Zd({init(e){var t;(t=e.getValue(vO))==null||t.registerCommand(xm,()=>!_M(7),4),e.pubIn({[Pk]:`lists`,[QO]:sM(),[ZO]:iM(),[XO]:[Yj,Xj],[YO]:[BA,GA],[$O]:[Zj,Qj],[ek]:cM(),[_k]:[eM,nM,tM],[Ck]:[eM,nM,tM]})}});function gM(e){let t=e.getNodes();return t.length===0?new Set([e.anchor.getNode().getParentOrThrow(),e.focus.getNode().getParentOrThrow()]):new Set(t.map(e=>G(e)?e:e.getParentOrThrow()))}function _M(e){let t=W();if(!U(t))return!1;let n=gM(t),r=0;for(let e of n)if(ZA(e))r=Math.max(wA(e)+1,r);else if(WA(e)){let t=e.getParent();if(t?.getChildren().length===1){let e=t.getParent();if(WA(e)&&e.getChildren().length===1)return!1}if(!ZA(t))throw Error(`ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.`);r=Math.max(wA(t)+1,r)}return r<=e}function vM(e){return e.length}function yM(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||vM,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=bM(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=xM(r[d]);else{let e=xM(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
85
- `)}function bM(e){return e==null?``:String(e)}function xM(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function SM(){return{enter:{table:CM,tableData:DM,tableHeader:DM,tableRow:TM},exit:{codeText:OM,table:wM,tableData:EM,tableHeader:EM,tableRow:EM}}}function CM(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function wM(e){this.exit(e),this.data.inTable=void 0}function TM(e){this.enter({type:`tableRow`,children:[]},e)}function EM(e){this.exit(e)}function DM(e){this.enter({type:`tableCell`,children:[]},e)}function OM(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,kM));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function kM(e,t){return t===`|`?t:e}function AM(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
86
- `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
87
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return yM(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=DT.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}var jM=class{constructor(){this.map=[]}add(e,t,n){MM(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function MM(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function NM(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function PM(){return{flow:{null:{name:`table`,tokenize:FM,resolveAll:IM}}}}function FM(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Mx(t)?jC(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||jx(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Mx(t)?jC(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Mx(t)?jC(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Mx(t)?jC(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||q(n)?(e.exit(`tableRow`),t(n)):Mx(n)?jC(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||jx(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function IM(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new jM;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(RM(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=LM(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=LM(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=LM(f,t,o,i,n,d)):(o[0]=o[1],d=LM(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&RM(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=NM(t.events,n))}return e}function LM(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},zM(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=zM(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=zM(t.events,n[2]),a=zM(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},zM(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function RM(e,t,n,r,i){let a=[],o=zM(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function zM(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var BM=[[`Cat`,`rgb(125, 50, 0)`],[`Dog`,`rgb(100, 0, 0)`],[`Rabbit`,`rgb(150, 0, 0)`],[`Frog`,`rgb(200, 0, 0)`],[`Fox`,`rgb(200, 75, 0)`],[`Hedgehog`,`rgb(0, 75, 0)`],[`Pigeon`,`rgb(0, 125, 0)`],[`Squirrel`,`rgb(75, 100, 0)`],[`Bear`,`rgb(125, 100, 0)`],[`Tiger`,`rgb(0, 0, 150)`],[`Leopard`,`rgb(0, 0, 200)`],[`Zebra`,`rgb(0, 0, 250)`],[`Wolf`,`rgb(0, 100, 150)`],[`Owl`,`rgb(0, 100, 100)`],[`Gull`,`rgb(100, 0, 100)`],[`Squid`,`rgb(150, 0, 150)`]],VM=BM[Math.floor(Math.random()*BM.length)],HM=(0,I.createContext)({clientID:0,color:VM[1],isCollabActive:!1,name:VM[0],yjsDocMap:new Map});function UM(e,t){let n=(0,I.useContext)(HM);return e!=null&&(n.name=e),t!=null&&(n.color=t),n}function WM(e){let t=new Set,{ownNodeConfig:n}=Bv(e),r=e.transform();if(n){let e=n.$transform;e&&t.add(e)}return r&&t.add(r),t}function GM({initialEditor:e,children:t,initialNodes:n,initialTheme:r,skipCollabChecks:i,skipEditableListener:a}){let o=(0,I.useRef)(!1),s=(0,I.useContext)($d);s??function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(9);let[c,{getTheme:l}]=s,u=(0,I.useMemo)((()=>{let t=r||l()||void 0,i=ef(s,t);t!==void 0&&(e._config.theme=t),e._parentEditor=e._parentEditor||c;let a=e._createEditorArgs,o=a&&a.namespace;if(n){o||(e._config.namespace=c._config.namespace);for(let t of n){let n=null,r=null;if(typeof t!=`function`){let e=t;t=e.replace,n=e.with,r=e.withKlass||null}let i=d_(e,t.getType());e._nodes.set(t.getType(),{exportDOM:i?i.exportDOM:void 0,klass:t,replace:n,replaceWithKlass:r,sharedNodeState:$f(t),transforms:WM(t)})}}else if(a&&a.nodes)o||(e._config.namespace=c._config.namespace);else{let t=e._nodes=new Map(c._nodes);o||(e._config.namespace=c._config.namespace);for(let[n,r]of t)e._nodes.set(n,{exportDOM:r.exportDOM,klass:r.klass,replace:r.replace,replaceWithKlass:r.replaceWithKlass,sharedNodeState:$f(r.klass),transforms:WM(r.klass)})}return[e,i]}),[]),{isCollabActive:d,yjsDocMap:f}=UM(),p=i||o.current||f.has(e.getKey());return(0,I.useEffect)((()=>{p&&(o.current=!0)}),[p]),(0,I.useEffect)((()=>{if(!a){let t=t=>e.setEditable(t);return t(c.isEditable()),c.registerEditableListener(t)}}),[e,c,a]),(0,L.jsx)($d.Provider,{value:u,children:!d||p?t:null})}typeof window<`u`&&window.document&&window.document.createElement;function KM(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function qM(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function JM(...e){return t=>{let n=!1,r=e.map(e=>{let r=qM(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():qM(e[t],null)}}}}function YM(...e){return I.useCallback(JM(...e),e)}function XM(e,t=[]){let n=[];function r(t,r){let i=I.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=I.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=I.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>I.createContext(e));return function(n){let r=n?.[e]||t;return I.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,ZM(i,...t)]}function ZM(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function QM(e){let t=$M(e),n=I.forwardRef((e,n)=>{let{children:r,...i}=e,a=I.Children.toArray(r),o=a.find(nN);if(o){let e=o.props.children,r=a.map(t=>t===o?I.Children.count(e)>1?I.Children.only(null):I.isValidElement(e)?e.props.children:null:t);return(0,L.jsx)(t,{...i,ref:n,children:I.isValidElement(e)?I.cloneElement(e,void 0,r):null})}return(0,L.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function $M(e){let t=I.forwardRef((e,t)=>{let{children:n,...r}=e;if(I.isValidElement(n)){let e=iN(n),i=rN(r,n.props);return n.type!==I.Fragment&&(i.ref=t?JM(t,e):e),I.cloneElement(n,i)}return I.Children.count(n)>1?I.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var eN=Symbol(`radix.slottable`);function tN(e){let t=({children:e})=>(0,L.jsx)(L.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=eN,t}function nN(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===eN}function rN(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function iN(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var aN=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=QM(`Primitive.${t}`),r=I.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function oN(e,t){e&&Na.flushSync(()=>e.dispatchEvent(t))}function sN(e){let t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>(...e)=>t.current?.(...e),[])}function cN(e,t=globalThis?.document){let n=sN(e);I.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var lN=`DismissableLayer`,uN=`dismissableLayer.update`,dN=`dismissableLayer.pointerDownOutside`,fN=`dismissableLayer.focusOutside`,pN,mN=I.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hN=I.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=I.useContext(mN),[u,d]=I.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=I.useState({}),m=YM(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Lte(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=Rte(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return cN(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),I.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(pN=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),_N(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=pN)}},[u,f,n,l]),I.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),_N())},[u,l]),I.useEffect(()=>{let e=()=>p({});return document.addEventListener(uN,e),()=>document.removeEventListener(uN,e)},[]),(0,L.jsx)(aN.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:KM(e.onFocusCapture,S.onFocusCapture),onBlurCapture:KM(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:KM(e.onPointerDownCapture,x.onPointerDownCapture)})});hN.displayName=lN;var gN=`DismissableLayerBranch`,Ite=I.forwardRef((e,t)=>{let n=I.useContext(mN),r=I.useRef(null),i=YM(t,r);return I.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,L.jsx)(aN.div,{...e,ref:i})});Ite.displayName=gN;function Lte(e,t=globalThis?.document){let n=sN(e),r=I.useRef(!1),i=I.useRef(()=>{});return I.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){vN(dN,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Rte(e,t=globalThis?.document){let n=sN(e),r=I.useRef(!1);return I.useEffect(()=>{let e=e=>{e.target&&!r.current&&vN(fN,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _N(){let e=new CustomEvent(uN);document.dispatchEvent(e)}function vN(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?oN(i,a):i.dispatchEvent(a)}var yN=0;function bN(){I.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??xN()),document.body.insertAdjacentElement(`beforeend`,e[1]??xN()),yN++,()=>{yN===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),yN--}},[])}function xN(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var SN=`focusScope.autoFocusOnMount`,CN=`focusScope.autoFocusOnUnmount`,wN={bubbles:!1,cancelable:!0},zte=`FocusScope`,TN=I.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=I.useState(null),l=sN(i),u=sN(a),d=I.useRef(null),f=YM(t,e=>c(e)),p=I.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;I.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ON(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ON(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ON(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),I.useEffect(()=>{if(s){kN.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(SN,wN);s.addEventListener(SN,l),s.dispatchEvent(t),t.defaultPrevented||(Bte(MN(EN(s)),{select:!0}),document.activeElement===e&&ON(s))}return()=>{s.removeEventListener(SN,l),setTimeout(()=>{let t=new CustomEvent(CN,wN);s.addEventListener(CN,u),s.dispatchEvent(t),t.defaultPrevented||ON(e??document.body,{select:!0}),s.removeEventListener(CN,u),kN.remove(p)},0)}}},[s,l,u,p]);let m=I.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Vte(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ON(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ON(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,L.jsx)(aN.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});TN.displayName=zte;function Bte(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ON(r,{select:t}),document.activeElement!==n)return}function Vte(e){let t=EN(e);return[DN(t,e),DN(t.reverse(),e)]}function EN(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function DN(e,t){for(let n of e)if(!Hte(n,{upTo:t}))return n}function Hte(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Ute(e){return e instanceof HTMLInputElement&&`select`in e}function ON(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ute(e)&&t&&e.select()}}var kN=AN();function AN(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=jN(e,t),e.unshift(t)},remove(t){e=jN(e,t),e[0]?.resume()}}}function jN(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function MN(e){return e.filter(e=>e.tagName!==`A`)}var NN=globalThis?.document?I.useLayoutEffect:()=>{},PN=I.useId||(()=>void 0),FN=0;function IN(e){let[t,n]=I.useState(PN());return NN(()=>{e||n(e=>e??String(FN++))},[e]),e||(t?`radix-${t}`:``)}var LN=[`top`,`right`,`bottom`,`left`],RN=Math.min,zN=Math.max,BN=Math.round,VN=Math.floor,HN=e=>({x:e,y:e}),UN={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function WN(e,t,n){return zN(e,RN(t,n))}function GN(e,t){return typeof e==`function`?e(t):e}function KN(e){return e.split(`-`)[0]}function qN(e){return e.split(`-`)[1]}function JN(e){return e===`x`?`y`:`x`}function YN(e){return e===`y`?`height`:`width`}function XN(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ZN(e){return JN(XN(e))}function QN(e,t,n){n===void 0&&(n=!1);let r=qN(e),i=ZN(e),a=YN(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=sP(o)),[o,sP(o)]}function $N(e){let t=sP(e);return[eP(e),t,eP(t)]}function eP(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var tP=[`left`,`right`],nP=[`right`,`left`],rP=[`top`,`bottom`],iP=[`bottom`,`top`];function aP(e,t,n){switch(e){case`top`:case`bottom`:return n?t?nP:tP:t?tP:nP;case`left`:case`right`:return t?rP:iP;default:return[]}}function oP(e,t,n,r){let i=qN(e),a=aP(KN(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(eP)))),a}function sP(e){let t=KN(e);return UN[t]+e.slice(t.length)}function cP(e){return{top:0,right:0,bottom:0,left:0,...e}}function lP(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:cP(e)}function uP(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function dP(e,t,n){let{reference:r,floating:i}=e,a=XN(t),o=ZN(t),s=YN(o),c=KN(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(qN(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function fP(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=GN(t,e),p=lP(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=uP(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=uP(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var pP=50,mP=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:fP},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=dP(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<pP&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=dP(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},hP=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=GN(e,t)||{};if(l==null)return{};let d=lP(u),f={x:n,y:r},p=ZN(i),m=YN(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=RN(d[_],T),D=RN(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=WN(O,A,k),M=!c.arrow&&qN(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),gP=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=GN(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=KN(r),_=XN(o),v=KN(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[sP(o)]:$N(o)),x=p!==`none`;!d&&x&&b.push(...oP(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=QN(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==XN(t))||T.every(e=>XN(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=XN(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function _P(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vP(e){return LN.some(t=>e[t]>=0)}var yP=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=GN(e,t);switch(i){case`referenceHidden`:{let e=_P(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:vP(e)}}}case`escaped`:{let e=_P(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:vP(e)}}}default:return{}}}}},bP=new Set([`left`,`top`]);async function xP(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=KN(n),s=qN(n),c=XN(n)===`y`,l=bP.has(o)?-1:1,u=a&&c?-1:1,d=GN(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var SP=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await xP(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},CP=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=GN(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=XN(KN(i)),p=JN(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=WN(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=WN(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},wP=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=GN(e,t),u={x:n,y:r},d=XN(i),f=JN(d),p=u[f],m=u[d],h=GN(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=bP.has(KN(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},TP=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=GN(e,t),u=await o.detectOverflow(t,l),d=KN(i),f=qN(i),p=XN(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=RN(h-u[g],v),x=RN(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=zN(u.left,0),t=zN(u.right,0),n=zN(u.top,0),r=zN(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:zN(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:zN(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function EP(){return typeof window<`u`}function DP(e){return AP(e)?(e.nodeName||``).toLowerCase():`#document`}function OP(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function kP(e){return((AP(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function AP(e){return EP()?e instanceof Node||e instanceof OP(e).Node:!1}function jP(e){return EP()?e instanceof Element||e instanceof OP(e).Element:!1}function MP(e){return EP()?e instanceof HTMLElement||e instanceof OP(e).HTMLElement:!1}function NP(e){return!EP()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof OP(e).ShadowRoot}function PP(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=GP(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function FP(e){return/^(table|td|th)$/.test(DP(e))}function IP(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var LP=/transform|translate|scale|rotate|perspective|filter/,RP=/paint|layout|strict|content/,zP=e=>!!e&&e!==`none`,BP;function VP(e){let t=jP(e)?GP(e):e;return zP(t.transform)||zP(t.translate)||zP(t.scale)||zP(t.rotate)||zP(t.perspective)||!UP()&&(zP(t.backdropFilter)||zP(t.filter))||LP.test(t.willChange||``)||RP.test(t.contain||``)}function HP(e){let t=qP(e);for(;MP(t)&&!WP(t);){if(VP(t))return t;if(IP(t))return null;t=qP(t)}return null}function UP(){return BP??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),BP}function WP(e){return/^(html|body|#document)$/.test(DP(e))}function GP(e){return OP(e).getComputedStyle(e)}function KP(e){return jP(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qP(e){if(DP(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||NP(e)&&e.host||kP(e);return NP(t)?t.host:t}function JP(e){let t=qP(e);return WP(t)?e.ownerDocument?e.ownerDocument.body:e.body:MP(t)&&PP(t)?t:JP(t)}function YP(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=JP(e),i=r===e.ownerDocument?.body,a=OP(r);if(i){let e=XP(a);return t.concat(a,a.visualViewport||[],PP(r)?r:[],e&&n?YP(e):[])}else return t.concat(r,YP(r,[],n))}function XP(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ZP(e){let t=GP(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=MP(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=BN(n)!==a||BN(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function QP(e){return jP(e)?e:e.contextElement}function $P(e){let t=QP(e);if(!MP(t))return HN(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ZP(t),o=(a?BN(n.width):n.width)/r,s=(a?BN(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var eF=HN(0);function tF(e){let t=OP(e);return!UP()||!t.visualViewport?eF:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nF(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==OP(e)?!1:t}function rF(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=QP(e),o=HN(1);t&&(r?jP(r)&&(o=$P(r)):o=$P(e));let s=nF(a,n,r)?tF(a):HN(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=OP(a),t=r&&jP(r)?OP(r):r,n=e,i=XP(n);for(;i&&r&&t!==n;){let e=$P(i),t=i.getBoundingClientRect(),r=GP(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=OP(i),i=XP(n)}}return uP({width:u,height:d,x:c,y:l})}function iF(e,t){let n=KP(e).scrollLeft;return t?t.left+n:rF(kP(e)).left+n}function aF(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-iF(e,n),y:n.top+t.scrollTop}}function oF(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=kP(r),s=t?IP(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=HN(1),u=HN(0),d=MP(r);if((d||!d&&!a)&&((DP(r)!==`body`||PP(o))&&(c=KP(r)),d)){let e=rF(r);l=$P(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?aF(o,c):HN(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function sF(e){return Array.from(e.getClientRects())}function cF(e){let t=kP(e),n=KP(e),r=e.ownerDocument.body,i=zN(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=zN(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+iF(e),s=-n.scrollTop;return GP(r).direction===`rtl`&&(o+=zN(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var lF=25;function uF(e,t){let n=OP(e),r=kP(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=UP();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=iF(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=lF&&(a-=o)}else l<=lF&&(a+=l);return{width:a,height:o,x:s,y:c}}function dF(e,t){let n=rF(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=MP(e)?$P(e):HN(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function fF(e,t,n){let r;if(t===`viewport`)r=uF(e,n);else if(t===`document`)r=cF(kP(e));else if(jP(t))r=dF(t,n);else{let n=tF(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return uP(r)}function pF(e,t){let n=qP(e);return n===t||!jP(n)||WP(n)?!1:GP(n).position===`fixed`||pF(n,t)}function mF(e,t){let n=t.get(e);if(n)return n;let r=YP(e,[],!1).filter(e=>jP(e)&&DP(e)!==`body`),i=null,a=GP(e).position===`fixed`,o=a?qP(e):e;for(;jP(o)&&!WP(o);){let t=GP(o),n=VP(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||PP(o)&&!n&&pF(e,o))?r=r.filter(e=>e!==o):i=t,o=qP(o)}return t.set(e,r),r}function hF(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?IP(t)?[]:mF(t,this._c):[].concat(n),r],o=fF(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=fF(t,a[e],i);s=zN(n.top,s),c=RN(n.right,c),l=RN(n.bottom,l),u=zN(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function gF(e){let{width:t,height:n}=ZP(e);return{width:t,height:n}}function _F(e,t,n){let r=MP(t),i=kP(t),a=n===`fixed`,o=rF(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=HN(0);function l(){c.x=iF(i)}if(r||!r&&!a)if((DP(t)!==`body`||PP(i))&&(s=KP(t)),r){let e=rF(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?aF(i,s):HN(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function vF(e){return GP(e).position===`static`}function yF(e,t){if(!MP(e)||GP(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return kP(e)===n&&(n=n.ownerDocument.body),n}function bF(e,t){let n=OP(e);if(IP(e))return n;if(!MP(e)){let t=qP(e);for(;t&&!WP(t);){if(jP(t)&&!vF(t))return t;t=qP(t)}return n}let r=yF(e,t);for(;r&&FP(r)&&vF(r);)r=yF(r,t);return r&&WP(r)&&vF(r)&&!VP(r)?n:r||HP(e)||n}var xF=async function(e){let t=this.getOffsetParent||bF,n=this.getDimensions,r=await n(e.floating);return{reference:_F(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function SF(e){return GP(e).direction===`rtl`}var CF={convertOffsetParentRelativeRectToViewportRelativeRect:oF,getDocumentElement:kP,getClippingRect:hF,getOffsetParent:bF,getElementRects:xF,getClientRects:sF,getDimensions:gF,getScale:$P,isElement:jP,isRTL:SF};function wF(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function TF(e,t){let n=null,r,i=kP(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=VN(d),h=VN(i.clientWidth-(u+f)),g=VN(i.clientHeight-(d+p)),_=VN(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:zN(0,RN(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!wF(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function EF(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=QP(e),u=i||a?[...l?YP(l):[],...t?YP(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?TF(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?rF(e):null;c&&g();function g(){let t=rF(e);h&&!wF(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var DF=SP,OF=CP,kF=gP,AF=TP,jF=yP,MF=hP,NF=wP,PF=(e,t,n)=>{let r=new Map,i={platform:CF,...n},a={...i.platform,_c:r};return mP(e,t,{...i,platform:a})},FF=typeof document<`u`?I.useLayoutEffect:function(){};function IF(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!IF(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!IF(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function LF(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function RF(e,t){let n=LF(e);return Math.round(t*n)/n}function zF(e){let t=I.useRef(e);return FF(()=>{t.current=e}),t}function BF(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=I.useState(r);IF(f,r)||p(r);let[m,h]=I.useState(null),[g,_]=I.useState(null),v=I.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=I.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=I.useRef(null),C=I.useRef(null),w=I.useRef(u),T=c!=null,E=zF(c),D=zF(i),O=zF(l),k=I.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),PF(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!IF(w.current,t)&&(w.current=t,Na.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);FF(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=I.useRef(!1);FF(()=>(A.current=!0,()=>{A.current=!1}),[]),FF(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=I.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=I.useMemo(()=>({reference:b,floating:x}),[b,x]),N=I.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=RF(M.floating,u.x),r=RF(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...LF(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return I.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var VF=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:MF({element:r.current,padding:i}).fn(n):r?MF({element:r,padding:i}).fn(n):{}}}},HF=(e,t)=>{let n=DF(e);return{name:n.name,fn:n.fn,options:[e,t]}},UF=(e,t)=>{let n=OF(e);return{name:n.name,fn:n.fn,options:[e,t]}},WF=(e,t)=>({fn:NF(e).fn,options:[e,t]}),GF=(e,t)=>{let n=kF(e);return{name:n.name,fn:n.fn,options:[e,t]}},KF=(e,t)=>{let n=AF(e);return{name:n.name,fn:n.fn,options:[e,t]}},qF=(e,t)=>{let n=jF(e);return{name:n.name,fn:n.fn,options:[e,t]}},JF=(e,t)=>{let n=VF(e);return{name:n.name,fn:n.fn,options:[e,t]}},YF=`Arrow`,XF=I.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,L.jsx)(aN.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,L.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});XF.displayName=YF;var ZF=XF;function QF(e){let[t,n]=I.useState(void 0);return NN(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var $F=`Popper`,[eI,tI]=XM($F),[nI,rI]=eI($F),iI=e=>{let{__scopePopper:t,children:n}=e,[r,i]=I.useState(null);return(0,L.jsx)(nI,{scope:t,anchor:r,onAnchorChange:i,children:n})};iI.displayName=$F;var aI=`PopperAnchor`,oI=I.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=rI(aI,n),o=I.useRef(null),s=YM(t,o),c=I.useRef(null);return I.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,L.jsx)(aN.div,{...i,ref:s})});oI.displayName=aI;var sI=`PopperContent`,[cI,lI]=eI(sI),uI=I.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=rI(sI,n),[_,v]=I.useState(null),y=YM(t,e=>v(e)),[b,x]=I.useState(null),S=QF(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(mI),altBoundary:O},{refs:A,floatingStyles:j,placement:M,isPositioned:N,middlewareData:P}=BF({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>EF(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[HF({mainAxis:i+w,alignmentAxis:o}),c&&UF({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?WF():void 0,...k}),c&&GF({...k}),KF({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&JF({element:b,padding:s}),hI({arrowWidth:C,arrowHeight:w}),f&&qF({strategy:`referenceHidden`,...k})]}),[F,ee]=gI(M),te=sN(m);NN(()=>{N&&te?.()},[N,te]);let ne=P.arrow?.x,re=P.arrow?.y,ie=P.arrow?.centerOffset!==0,[ae,oe]=I.useState();return NN(()=>{_&&oe(window.getComputedStyle(_).zIndex)},[_]),(0,L.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(cI,{scope:n,placedSide:F,onArrowChange:x,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,L.jsx)(aN.div,{"data-side":F,"data-align":ee,...h,ref:y,style:{...h.style,animation:N?void 0:`none`}})})})});uI.displayName=sI;var dI=`PopperArrow`,fI={top:`bottom`,right:`left`,bottom:`top`,left:`right`},pI=I.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=lI(dI,n),a=fI[i.placedSide];return(0,L.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,L.jsx)(ZF,{...r,ref:t,style:{...r.style,display:`block`}})})});pI.displayName=dI;function mI(e){return e!==null}var hI=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=gI(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function gI(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var _I=iI,vI=oI,yI=uI,bI=pI,xI=`Portal`,SI=I.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=I.useState(!1);NN(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Na.createPortal((0,L.jsx)(aN.div,{...r,ref:t}),o):null});SI.displayName=xI;function CI(e,t){return I.useReducer((e,n)=>t[e][n]??e,e)}var wI=e=>{let{present:t,children:n}=e,r=TI(t),i=typeof n==`function`?n({present:r.isPresent}):I.Children.only(n),a=YM(r.ref,DI(i));return typeof n==`function`||r.isPresent?I.cloneElement(i,{ref:a}):null};wI.displayName=`Presence`;function TI(e){let[t,n]=I.useState(),r=I.useRef(null),i=I.useRef(e),a=I.useRef(`none`),[o,s]=CI(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return I.useEffect(()=>{let e=EI(r.current);a.current=o===`mounted`?e:`none`},[o]),NN(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=EI(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),NN(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=EI(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=EI(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:I.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function EI(e){return e?.animationName||`none`}function DI(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var OI=I.useInsertionEffect||NN;function kI({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=AI({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=I.useRef(e!==void 0);I.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,I.useCallback(t=>{if(s){let n=jI(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function AI({defaultProp:e,onChange:t}){let[n,r]=I.useState(e),i=I.useRef(n),a=I.useRef(t);return OI(()=>{a.current=t},[t]),I.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function jI(e){return typeof e==`function`}var MI=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},NI=new WeakMap,PI=new WeakMap,FI={},II=0,LI=function(e){return e&&(e.host||LI(e.parentNode))},RI=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=LI(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},zI=function(e,t,n,r){var i=RI(t,Array.isArray(e)?e:[e]);FI[n]||(FI[n]=new WeakMap);var a=FI[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(NI.get(e)||0)+1,l=(a.get(e)||0)+1;NI.set(e,c),a.set(e,l),o.push(e),c===1&&i&&PI.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),II++,function(){o.forEach(function(e){var t=NI.get(e)-1,i=a.get(e)-1;NI.set(e,t),a.set(e,i),t||(PI.has(e)||e.removeAttribute(r),PI.delete(e)),i||e.removeAttribute(n)}),II--,II||(NI=new WeakMap,NI=new WeakMap,PI=new WeakMap,FI={})}},BI=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||MI(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),zI(r,i,n,`aria-hidden`)):function(){return null}},VI=function(){return VI=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},VI.apply(this,arguments)};function HI(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function UI(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var WI=`right-scroll-bar-position`,GI=`width-before-scroll-bar`,KI=`with-scroll-bars-hidden`,qI=`--removed-body-scroll-bar-size`;function JI(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function YI(e,t){var n=(0,I.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var XI=typeof window<`u`?I.useLayoutEffect:I.useEffect,ZI=new WeakMap;function QI(e,t){var n=YI(t||null,function(t){return e.forEach(function(e){return JI(e,t)})});return XI(function(){var t=ZI.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||JI(e,null)}),i.forEach(function(e){r.has(e)||JI(e,a)})}ZI.set(n,e)},[e]),n}function $I(e){return e}function eL(e,t){t===void 0&&(t=$I);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function tL(e){e===void 0&&(e={});var t=eL(null);return t.options=VI({async:!0,ssr:!1},e),t}var nL=function(e){var t=e.sideCar,n=HI(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return I.createElement(r,VI({},n))};nL.isSideCarExport=!0;function rL(e,t){return e.useMedium(t),nL}var iL=tL(),aL=function(){},oL=I.forwardRef(function(e,t){var n=I.useRef(null),r=I.useState({onScrollCapture:aL,onWheelCapture:aL,onTouchMoveCapture:aL}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=HI(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=QI([n,t]),C=VI(VI({},b),i);return I.createElement(I.Fragment,null,u&&I.createElement(x,{sideCar:iL,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?I.cloneElement(I.Children.only(s),VI(VI({},C),{ref:S})):I.createElement(v,VI({},C,{className:c,ref:S}),s))});oL.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},oL.classNames={fullWidth:GI,zeroRight:WI};var sL,cL=function(){if(sL)return sL;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function lL(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=cL();return t&&e.setAttribute(`nonce`,t),e}function uL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dL(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var fL=function(){var e=0,t=null;return{add:function(n){e==0&&(t=lL())&&(uL(t,n),dL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pL=function(){var e=fL();return function(t,n){I.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},mL=function(){var e=pL();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},hL={left:0,top:0,right:0,gap:0},gL=function(e){return parseInt(e||``,10)||0},_L=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[gL(n),gL(r),gL(i)]},vL=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return hL;var t=_L(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},yL=mL(),bL=`data-scroll-locked`,xL=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
88
- .${KI} {
89
- overflow: hidden ${r};
90
- padding-right: ${s}px ${r};
91
- }
92
- body[${bL}] {
93
- overflow: hidden ${r};
94
- overscroll-behavior: contain;
95
- ${[t&&`position: relative ${r};`,n===`margin`&&`
96
- padding-left: ${i}px;
97
- padding-top: ${a}px;
98
- padding-right: ${o}px;
99
- margin-left:0;
100
- margin-top:0;
101
- margin-right: ${s}px ${r};
102
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
103
- }
104
-
105
- .${WI} {
106
- right: ${s}px ${r};
107
- }
108
-
109
- .${GI} {
110
- margin-right: ${s}px ${r};
111
- }
112
-
113
- .${WI} .${WI} {
114
- right: 0 ${r};
115
- }
116
-
117
- .${GI} .${GI} {
118
- margin-right: 0 ${r};
119
- }
120
-
121
- body[${bL}] {
122
- ${qI}: ${s}px;
123
- }
124
- `},SL=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},CL=function(){I.useEffect(function(){return document.body.setAttribute(bL,(SL()+1).toString()),function(){var e=SL()-1;e<=0?document.body.removeAttribute(bL):document.body.setAttribute(bL,e.toString())}},[])},wL=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;CL();var a=I.useMemo(function(){return vL(i)},[i]);return I.createElement(yL,{styles:xL(a,!t,i,n?``:`!important`)})},TL=!1;if(typeof window<`u`)try{var EL=Object.defineProperty({},`passive`,{get:function(){return TL=!0,!0}});window.addEventListener(`test`,EL,EL),window.removeEventListener(`test`,EL,EL)}catch{TL=!1}var DL=TL?{passive:!1}:!1,OL=function(e){return e.tagName===`TEXTAREA`},kL=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!OL(e)&&n[t]===`visible`)},AL=function(e){return kL(e,`overflowY`)},jL=function(e){return kL(e,`overflowX`)},ML=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),FL(e,r)){var i=IL(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},NL=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},PL=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},FL=function(e,t){return e===`v`?AL(t):jL(t)},IL=function(e,t){return e===`v`?NL(t):PL(t)},LL=function(e,t){return e===`h`&&t===`rtl`?-1:1},RL=function(e,t,n,r,i){var a=LL(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=IL(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&FL(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},zL=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},BL=function(e){return[e.deltaX,e.deltaY]},VL=function(e){return e&&`current`in e?e.current:e},HL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},UL=function(e){return`
125
- .block-interactivity-${e} {pointer-events: none;}
126
- .allow-interactivity-${e} {pointer-events: all;}
127
- `},WL=0,GL=[];function KL(e){var t=I.useRef([]),n=I.useRef([0,0]),r=I.useRef(),i=I.useState(WL++)[0],a=I.useState(mL)[0],o=I.useRef(e);I.useEffect(function(){o.current=e},[e]),I.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=UI([e.lockRef.current],(e.shards||[]).map(VL),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=I.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=zL(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=ML(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=ML(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return RL(h,t,e,h===`h`?s:c,!0)},[]),c=I.useCallback(function(e){var n=e;if(!(!GL.length||GL[GL.length-1]!==a)){var r=`deltaY`in n?BL(n):zL(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&HL(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(VL).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=I.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:qL(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=I.useCallback(function(e){n.current=zL(e),r.current=void 0},[]),d=I.useCallback(function(t){l(t.type,BL(t),t.target,s(t,e.lockRef.current))},[]),f=I.useCallback(function(t){l(t.type,zL(t),t.target,s(t,e.lockRef.current))},[]);I.useEffect(function(){return GL.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,DL),document.addEventListener(`touchmove`,c,DL),document.addEventListener(`touchstart`,u,DL),function(){GL=GL.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,DL),document.removeEventListener(`touchmove`,c,DL),document.removeEventListener(`touchstart`,u,DL)}},[]);var p=e.removeScrollBar,m=e.inert;return I.createElement(I.Fragment,null,m?I.createElement(a,{styles:UL(i)}):null,p?I.createElement(wL,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function qL(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var JL=rL(iL,KL),YL=I.forwardRef(function(e,t){return I.createElement(oL,VI({},e,{ref:t,sideCar:JL}))});YL.classNames=oL.classNames;var XL=`Popover`,[ZL,Wte]=XM(XL,[tI]),QL=tI(),[$L,eR]=ZL(XL),tR=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=QL(t),c=I.useRef(null),[l,u]=I.useState(!1),[d,f]=kI({prop:r,defaultProp:i??!1,onChange:a,caller:XL});return(0,L.jsx)(_I,{...s,children:(0,L.jsx)($L,{scope:t,contentId:IN(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:I.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:I.useCallback(()=>u(!0),[]),onCustomAnchorRemove:I.useCallback(()=>u(!1),[]),modal:o,children:n})})};tR.displayName=XL;var nR=`PopoverAnchor`,rR=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=eR(nR,n),a=QL(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return I.useEffect(()=>(o(),()=>s()),[o,s]),(0,L.jsx)(vI,{...a,...r,ref:t})});rR.displayName=nR;var iR=`PopoverTrigger`,aR=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=eR(iR,n),a=QL(n),o=YM(t,i.triggerRef),s=(0,L.jsx)(aN.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":bR(i.open),...r,ref:o,onClick:KM(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,L.jsx)(vI,{asChild:!0,...a,children:s})});aR.displayName=iR;var oR=`PopoverPortal`,[sR,cR]=ZL(oR,{forceMount:void 0}),lR=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=eR(oR,t);return(0,L.jsx)(sR,{scope:t,forceMount:n,children:(0,L.jsx)(wI,{present:n||a.open,children:(0,L.jsx)(SI,{asChild:!0,container:i,children:r})})})};lR.displayName=oR;var uR=`PopoverContent`,dR=I.forwardRef((e,t)=>{let n=cR(uR,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=eR(uR,e.__scopePopover);return(0,L.jsx)(wI,{present:r||a.open,children:a.modal?(0,L.jsx)(pR,{...i,ref:t}):(0,L.jsx)(mR,{...i,ref:t})})});dR.displayName=uR;var fR=QM(`PopoverContent.RemoveScroll`),pR=I.forwardRef((e,t)=>{let n=eR(uR,e.__scopePopover),r=I.useRef(null),i=YM(t,r),a=I.useRef(!1);return I.useEffect(()=>{let e=r.current;if(e)return BI(e)},[]),(0,L.jsx)(YL,{as:fR,allowPinchZoom:!0,children:(0,L.jsx)(hR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:KM(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:KM(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:KM(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),mR=I.forwardRef((e,t)=>{let n=eR(uR,e.__scopePopover),r=I.useRef(!1),i=I.useRef(!1);return(0,L.jsx)(hR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),hR=I.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=eR(uR,n),p=QL(n);return bN(),(0,L.jsx)(TN,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(hN,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,L.jsx)(yI,{"data-state":bR(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),gR=`PopoverClose`,_R=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=eR(gR,n);return(0,L.jsx)(aN.button,{type:`button`,...r,ref:t,onClick:KM(e.onClick,()=>i.onOpenChange(!1))})});_R.displayName=gR;var vR=`PopoverArrow`,yR=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=QL(n);return(0,L.jsx)(bI,{...i,...r,ref:t})});yR.displayName=vR;function bR(e){return e?`open`:`closed`}var xR=tR,SR=rR,CR=lR,wR=dR,TR=yR;function ER(e){let t=e+`CollectionProvider`,[n,r]=XM(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=I.useRef(null),a=I.useRef(new Map).current;return(0,L.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=QM(s),l=I.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,L.jsx)(c,{ref:YM(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=QM(u),p=I.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=I.useRef(null),s=YM(t,o),c=a(u,n);return I.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,L.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return I.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var DR=I.createContext(void 0);function OR(e){let t=I.useContext(DR);return e||t||`ltr`}var kR=`rovingFocusGroup.onEntryFocus`,AR={bubbles:!1,cancelable:!0},jR=`RovingFocusGroup`,[MR,NR,PR]=ER(jR),[FR,IR]=XM(jR,[PR]),[LR,RR]=FR(jR),zR=I.forwardRef((e,t)=>(0,L.jsx)(MR.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(MR.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(BR,{...e,ref:t})})}));zR.displayName=jR;var BR=I.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=I.useRef(null),p=YM(t,f),m=OR(a),[h,g]=kI({prop:o,defaultProp:s??null,onChange:c,caller:jR}),[_,v]=I.useState(!1),y=sN(l),b=NR(n),x=I.useRef(!1),[S,C]=I.useState(0);return I.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(kR,y),()=>e.removeEventListener(kR,y)},[y]),(0,L.jsx)(LR,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:I.useCallback(e=>g(e),[g]),onItemShiftTab:I.useCallback(()=>v(!0),[]),onFocusableItemAdd:I.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:I.useCallback(()=>C(e=>e-1),[]),children:(0,L.jsx)(aN.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:KM(e.onMouseDown,()=>{x.current=!0}),onFocus:KM(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(kR,AR);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);KR([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:KM(e.onBlur,()=>v(!1))})})}),VR=`RovingFocusGroupItem`,HR=I.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=IN(),l=a||c,u=RR(VR,n),d=u.currentTabStopId===l,f=NR(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return I.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,L.jsx)(MR.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,L.jsx)(aN.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:KM(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:KM(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:KM(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=GR(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?qR(n,r+1):n.slice(r+1)}setTimeout(()=>KR(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});HR.displayName=VR;var UR={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function WR(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function GR(e,t,n){let r=WR(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return UR[r]}function KR(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qR(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var JR=zR,YR=HR,XR=`Separator`,ZR=`horizontal`,QR=[`horizontal`,`vertical`],$R=I.forwardRef((e,t)=>{let{decorative:n,orientation:r=ZR,...i}=e,a=ez(r)?r:ZR,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,L.jsx)(aN.div,{"data-orientation":a,...o,...i,ref:t})});$R.displayName=XR;function ez(e){return QR.includes(e)}var tz=$R,nz=`Toggle`,rz=I.forwardRef((e,t)=>{let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=kI({prop:n,onChange:i,defaultProp:r??!1,caller:nz});return(0,L.jsx)(aN.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:KM(e.onClick,()=>{e.disabled||s(!o)})})});rz.displayName=nz;var iz=`ToggleGroup`,[az,oz]=XM(iz,[IR]),sz=IR(),cz=I.forwardRef((e,t)=>{let{type:n,...r}=e;if(n===`single`)return(0,L.jsx)(dz,{...r,ref:t});if(n===`multiple`)return(0,L.jsx)(fz,{...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${iz}\``)});cz.displayName=iz;var[lz,uz]=az(iz),dz=I.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=kI({prop:n,defaultProp:r??``,onChange:i,caller:iz});return(0,L.jsx)(lz,{scope:e.__scopeToggleGroup,type:`single`,value:I.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:I.useCallback(()=>s(``),[s]),children:(0,L.jsx)(hz,{...a,ref:t})})}),fz=I.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=kI({prop:n,defaultProp:r??[],onChange:i,caller:iz}),c=I.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=I.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,L.jsx)(lz,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,L.jsx)(hz,{...a,ref:t})})});cz.displayName=iz;var[pz,mz]=az(iz),hz=I.forwardRef((e,t)=>{let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=sz(n),u=OR(o),d={role:`group`,dir:u,...c};return(0,L.jsx)(pz,{scope:n,rovingFocus:i,disabled:r,children:i?(0,L.jsx)(JR,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,L.jsx)(aN.div,{...d,ref:t})}):(0,L.jsx)(aN.div,{...d,ref:t})})}),gz=`ToggleGroupItem`,_z=I.forwardRef((e,t)=>{let n=uz(gz,e.__scopeToggleGroup),r=mz(gz,e.__scopeToggleGroup),i=sz(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=I.useRef(null);return r.rovingFocus?(0,L.jsx)(YR,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,L.jsx)(vz,{...s,ref:t})}):(0,L.jsx)(vz,{...s,ref:t})});_z.displayName=gz;var vz=I.forwardRef((e,t)=>{let{__scopeToggleGroup:n,value:r,...i}=e,a=uz(gz,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0};return(0,L.jsx)(rz,{...a.type===`single`?o:void 0,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})}),yz=cz,bz=_z,xz=`Toolbar`,[Sz,Gte]=XM(xz,[IR,oz]),Cz=IR(),wz=oz(),[Tz,Ez]=Sz(xz),Dz=I.forwardRef((e,t)=>{let{__scopeToolbar:n,orientation:r=`horizontal`,dir:i,loop:a=!0,...o}=e,s=Cz(n),c=OR(i);return(0,L.jsx)(Tz,{scope:n,orientation:r,dir:c,children:(0,L.jsx)(JR,{asChild:!0,...s,orientation:r,dir:c,loop:a,children:(0,L.jsx)(aN.div,{role:`toolbar`,"aria-orientation":r,dir:c,...o,ref:t})})})});Dz.displayName=xz;var Oz=`ToolbarSeparator`,kz=I.forwardRef((e,t)=>{let{__scopeToolbar:n,...r}=e,i=Ez(Oz,n);return(0,L.jsx)(tz,{orientation:i.orientation===`horizontal`?`vertical`:`horizontal`,...r,ref:t})});kz.displayName=Oz;var Az=`ToolbarButton`,jz=I.forwardRef((e,t)=>{let{__scopeToolbar:n,...r}=e,i=Cz(n);return(0,L.jsx)(YR,{asChild:!0,...i,focusable:!e.disabled,children:(0,L.jsx)(aN.button,{type:`button`,...r,ref:t})})});jz.displayName=Az;var Mz=`ToolbarLink`,Nz=I.forwardRef((e,t)=>{let{__scopeToolbar:n,...r}=e,i=Cz(n);return(0,L.jsx)(YR,{asChild:!0,...i,focusable:!0,children:(0,L.jsx)(aN.a,{...r,ref:t,onKeyDown:KM(e.onKeyDown,e=>{e.key===` `&&e.currentTarget.click()})})})});Nz.displayName=Mz;var Pz=`ToolbarToggleGroup`,Fz=I.forwardRef((e,t)=>{let{__scopeToolbar:n,...r}=e,i=Ez(Pz,n),a=wz(n);return(0,L.jsx)(yz,{"data-orientation":i.orientation,dir:i.dir,...a,...r,ref:t,rovingFocus:!1})});Fz.displayName=Pz;var Iz=`ToolbarToggleItem`,Lz=I.forwardRef((e,t)=>{let{__scopeToolbar:n,...r}=e,i=wz(n);return(0,L.jsx)(jz,{asChild:!0,__scopeToolbar:e.__scopeToolbar,children:(0,L.jsx)(bz,{...i,...r,ref:t})})});Lz.displayName=Iz;var Rz=Dz,zz=kz,Bz=jz,Vz=Fz,Hz=Lz;function Uz(e,t){return e===null||e===t?!1:e.dataset.editorDialog!==void 0||e.dataset.toolbarItem!==void 0||e.dataset.editorDropdown?!0:Uz(e.parentElement,t)}function Wz(){let e=[...Array(256).keys()].map(e=>e.toString(16).padStart(2,`0`)),t=crypto.getRandomValues(new Uint8Array(16));return t[6]=t[6]&15|64,t[8]=t[8]&63|128,[...t.entries()].map(([t,n])=>[4,6,8,10].includes(t)?`-${e[n]}`:e[n]).join(``)}var Gz=e=>e===0?`th`:`td`,Kz={center:J.centeredCell,left:J.leftAlignedCell,right:J.rightAlignedCell},qz=({mdastNode:e,parentEditor:t,lexicalTable:n})=>{let[r,i]=I.useState(null),[a,o]=Ud(uk,SO),s=I.useMemo(()=>e=>(e.__cacheKey??=Wz(),e.__cacheKey),[]),c=I.useCallback(e=>{let r=n.getColCount();if(e===null){i(null);return}let[a,o]=e;if(a>r-1&&(a=0,o++),a<0&&(a=r-1,--o),o>n.getRowCount()-1){i(null),t.update(()=>{if(n.getLatest().getNextSibling())n.getLatest().selectNext();else{let e=r_();n.insertAfter(e),e.select()}});return}if(o<0){i(null),t.update(()=>{n.getLatest().selectPrevious()});return}i([a,o])},[n,t]);I.useEffect(()=>{n.focusEmitter.subscribe(c)},[n,c]);let l=I.useCallback(e=>{e.preventDefault(),t.update(()=>{n.addRowToBottom(),i([0,n.getRowCount()])})},[t,n]),u=I.useCallback(e=>{e.preventDefault(),t.update(()=>{n.addColumnToRight(),i([n.getColCount(),0])})},[t,n]),[d,f]=I.useState([-1,-1]),p=I.useCallback(e=>{let t=e.target;for(;t&&![`TH`,`TD`].includes(t.tagName);){if(t===e.currentTarget)return;t=t.parentElement}if(t===null)return;let n=t.parentElement;f([n.parentElement.tagName===`TFOOT`?-1:Array.from(n.children).indexOf(t),t.tagName===`TH`?-1:Array.from(n.parentElement.children).indexOf(n)])},[]),m=Rk();return I.createElement(`table`,{className:J.tableEditor,onMouseOver:p,onMouseLeave:()=>{f([-1,-1])}},I.createElement(`colgroup`,null,o?null:I.createElement(`col`,null),Array.from({length:e.children[0].children.length},(t,n)=>{let r=Kz[(e.align??[])[n]??`left`];return I.createElement(`col`,{key:n,className:r})}),o?null:I.createElement(`col`,null)),o||I.createElement(`thead`,null,I.createElement(`tr`,null,I.createElement(`th`,{className:J.tableToolsColumn}),Array.from({length:e.children[0].children.length},(r,i)=>I.createElement(`th`,{key:i,"data-tool-cell":!0},I.createElement(Xz,{setActiveCellWithBoundaries:c,parentEditor:t,colIndex:i,highlightedCoordinates:d,lexicalTable:n,align:(e.align??[])[i]}))),I.createElement(`th`,{className:J.tableToolsColumn,"data-tool-cell":!0},I.createElement(`button`,{className:J.iconButton,type:`button`,title:m(`table.deleteTable`,`Delete table`),onClick:e=>{e.preventDefault(),t.update(()=>{n.selectNext(),n.remove()})}},a(`delete_small`))))),I.createElement(`tbody`,null,e.children.map((i,l)=>{let f=Gz(l);return I.createElement(`tr`,{key:l},o||I.createElement(f,{className:J.toolCell,"data-tool-cell":!0},I.createElement(Zz,{setActiveCellWithBoundaries:c,parentEditor:t,rowIndex:l,highlightedCoordinates:d,lexicalTable:n})),i.children.map((i,a)=>I.createElement(Jz,{align:e.align?.[a],key:s(i),contents:i.children,setActiveCell:c,rowIndex:l,colIndex:a,lexicalTable:n,parentEditor:t,activeCell:o?[-1,-1]:r})),o||l===0&&I.createElement(`th`,{rowSpan:n.getRowCount(),"data-tool-cell":!0},I.createElement(`button`,{type:`button`,className:J.addColumnButton,onClick:u},a(`add_column`))))})),o||I.createElement(`tfoot`,null,I.createElement(`tr`,null,I.createElement(`th`,null),I.createElement(`th`,{colSpan:n.getColCount(),"data-tool-cell":!0},I.createElement(`button`,{type:`button`,className:J.addRowButton,onClick:l},a(`add_row`))),I.createElement(`th`,null))))},Jz=({align:e,...t})=>{let{activeCell:n,setActiveCell:r}=t,i=!!(n&&n[0]===t.colIndex&&n[1]===t.rowIndex),a=Kz[e??`left`],o=Gz(t.rowIndex);return I.createElement(o,{className:a,"data-active":i,onClick:()=>{r([t.colIndex,t.rowIndex])}},I.createElement(Yz,{...t,focus:i}))},Yz=({focus:e,setActiveCell:t,parentEditor:n,lexicalTable:r,contents:i,colIndex:a,rowIndex:o})=>{let[s,c,l,u,d,f,p,m,h]=Ud(IO,BO,LO,WO,GO,KO,UO,vO,wk),[g]=I.useState(()=>{let e=o_({nodes:l,theme:gO,namespace:`TableCellEditor`});return e.update(()=>{UD({root:I_(),mdastRoot:{type:`root`,children:[{type:`paragraph`,children:i}]},visitors:s,jsxComponentDescriptors:u,directiveDescriptors:d,codeBlockEditorDescriptors:f})}),e}),_=I.useCallback(e=>{g.getEditorState().read(()=>{let e=sE({root:I_(),jsxComponentDescriptors:u,visitors:c,jsxIsAvailable:p});n.update(()=>{r.updateCellContents(a,o,e.children[0].children)},{discrete:!0}),n.dispatchCommand(_O,void 0)}),t(e)},[a,g,c,u,p,r,n,o,t]);return I.useEffect(()=>rb(g.registerCommand(ym,e=>(e.preventDefault(),_(e.shiftKey?[a-1,o]:[a+1,o]),!0),4),g.registerCommand(Nm,()=>(t([a,o]),!1),1),g.registerCommand(mm,e=>(e?.preventDefault(),_(e?.shiftKey?[a,o-1]:[a,o+1]),!0),4),g.registerCommand(Pm,e=>{let t=e.relatedTarget;return Uz(t,m.getRootElement())?!1:(_(null),!0)},0),g.registerCommand(_O,()=>(_(null),!0),0)),[a,g,m,o,_,t]),I.useEffect(()=>{e&&g.focus()},[e,g]),I.createElement(GM,{initialEditor:g},I.createElement(oA,{contentEditable:I.createElement(qk,null),placeholder:I.createElement(`div`,null),ErrorBoundary:$k}),h.map((e,t)=>I.createElement(e,{key:t})),I.createElement(Mb,null))},Xz=({parentEditor:e,highlightedCoordinates:t,align:n,lexicalTable:r,colIndex:i,setActiveCellWithBoundaries:a})=>{let[o,s]=Ud(qO,uk),c=I.useCallback(t=>{e.update(()=>{r.insertColumnAt(t)}),a([t,0])},[e,r,a]),l=I.useCallback(t=>{e.update(()=>{r.deleteColumnAt(t)})},[e,r]),u=I.useCallback((t,n)=>{e.update(()=>{r.setColumnAlign(t,n)})},[e,r]),d=Rk();return I.createElement(xR,null,I.createElement(aR,{className:J.tableColumnEditorTrigger,"data-active":t[0]===i+1,title:d(`table.columnMenu`,`Column menu`)},s(`more_horiz`)),I.createElement(CR,{container:o?.current},I.createElement(dR,{className:(0,_j.default)(J.tableColumnEditorPopoverContent),onOpenAutoFocus:e=>{e.preventDefault()},sideOffset:5,side:`top`},I.createElement(Rz,{className:J.tableColumnEditorToolbar},I.createElement(Vz,{className:J.toggleGroupRoot,onValueChange:e=>{u(i,e)},value:n??`left`,type:`single`,"aria-label":d(`table.textAlignment`,`Text alignment`)},I.createElement(Hz,{value:`left`,title:d(`table.alignLeft`,`Align left`)},s(`format_align_left`)),I.createElement(Hz,{value:`center`,title:d(`table.alignCenter`,`Align center`)},s(`format_align_center`)),I.createElement(Hz,{value:`right`,title:d(`table.alignRight`,`Align right`)},s(`format_align_right`))),I.createElement(zz,null),I.createElement(Bz,{onClick:c.bind(null,i),title:d(`table.insertColumnLeft`,`Insert a column to the left of this one`)},s(`insert_col_left`)),I.createElement(Bz,{onClick:c.bind(null,i+1),title:d(`table.insertColumnRight`,`Insert a column to the right of this one`)},s(`insert_col_right`)),I.createElement(Bz,{onClick:l.bind(null,i),title:d(`table.deleteColumn`,`Delete this column`)},s(`delete_small`))),I.createElement(TR,{className:J.popoverArrow}))))},Zz=({parentEditor:e,highlightedCoordinates:t,lexicalTable:n,rowIndex:r,setActiveCellWithBoundaries:i})=>{let[a,o]=Ud(qO,uk),s=I.useCallback(t=>{e.update(()=>{n.insertRowAt(t)}),i([0,t])},[e,n,i]),c=I.useCallback(t=>{e.update(()=>{n.deleteRowAt(t)})},[e,n]),l=Rk();return I.createElement(xR,null,I.createElement(aR,{className:J.tableColumnEditorTrigger,"data-active":t[1]===r,title:l(`table.rowMenu`,`Row menu`)},o(`more_horiz`)),I.createElement(CR,{container:a?.current},I.createElement(dR,{className:(0,_j.default)(J.tableColumnEditorPopoverContent),onOpenAutoFocus:e=>{e.preventDefault()},sideOffset:5,side:`bottom`},I.createElement(Rz,{className:J.tableColumnEditorToolbar},I.createElement(Bz,{onClick:s.bind(null,r),title:l(`table.insertRowAbove`,`Insert a row above this one`)},o(`insert_row_above`)),I.createElement(Bz,{onClick:s.bind(null,r+1),title:l(`table.insertRowBelow`,`Insert a row below this one`)},o(`insert_row_below`)),I.createElement(Bz,{onClick:c.bind(null,r),title:l(`table.deleteRow`,`Delete this row`)},o(`delete_small`))),I.createElement(TR,{className:J.popoverArrow}))))},Qz=Object.defineProperty,$z=(e,t,n)=>t in e?Qz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eB=(e,t,n)=>($z(e,typeof t==`symbol`?t:t+``,n),n),tB={type:`tableCell`,children:[]};function nB(){let e=Xd;return{publish:t=>{e(t)},subscribe:t=>{e=t}}}var rB=class e extends Wg{constructor(e,t){super(t),eB(this,`__mdastNode`),eB(this,`focusEmitter`,nB()),this.__mdastNode=e??{type:`table`,children:[]}}static getType(){return`table`}static clone(t){return new e(structuredClone(t.__mdastNode),t.__key)}static importJSON(e){return aB(e.mdastNode)}static importDOM(){return{table:()=>({conversion:oB,priority:3})}}exportJSON(){return{mdastNode:structuredClone(this.__mdastNode),type:`table`,version:1}}getMdastNode(){return this.__mdastNode}getRowCount(){return this.__mdastNode.children.length}getColCount(){return this.__mdastNode.children[0]?.children.length||0}createDOM(){return document.createElement(`div`)}updateDOM(){return!1}updateCellContents(e,t,n){let r=this.getWritable().__mdastNode,i=r.children[t],a=i.children,o=a[e],s=Array.from(a),c={...o,children:n},l={...i,children:s};s[e]=c,r.children[t]=l}insertColumnAt(e){let t=this.getWritable().__mdastNode;for(let n=0;n<t.children.length;n++){let r=t.children[n],i=r.children,a=Array.from(i),o={...r,children:a};a.splice(e,0,structuredClone(tB)),t.children[n]=o}t.align&&t.align.length>0&&t.align.splice(e,0,`left`)}deleteColumnAt(e){let t=this.getWritable().__mdastNode;for(let n=0;n<t.children.length;n++){let r=t.children[n],i=r.children,a=Array.from(i),o={...r,children:a};a.splice(e,1),t.children[n]=o}}insertRowAt(e){let t=this.getWritable().__mdastNode,n={type:`tableRow`,children:Array.from({length:this.getColCount()},()=>structuredClone(tB))};t.children.splice(e,0,n)}deleteRowAt(e){this.getRowCount()===1?(this.selectNext(),this.remove()):this.getWritable().__mdastNode.children.splice(e,1)}addRowToBottom(){this.insertRowAt(this.getRowCount())}addColumnToRight(){this.insertColumnAt(this.getColCount())}setColumnAlign(e,t){let n=this.getWritable().__mdastNode;n.align??=[],n.align[e]=t}decorate(e){return I.createElement(qz,{lexicalTable:this,mdastNode:this.__mdastNode,parentEditor:e})}select(e){this.focusEmitter.publish(e??[0,0])}isInline(){return!1}};function iB(e){return e instanceof rB}function aB(e){return new rB(e)}function oB(e){let t=e.querySelectorAll(`tr`);return{node:new rB({type:`table`,children:Array.from(t).map(e=>({type:`tableRow`,children:Array.from(e.querySelectorAll(`td, th`)).map(e=>({type:`tableCell`,children:[{type:`text`,value:e.textContent}]}))}))})}}var sB={testLexicalNode:iB,visitLexicalNode({actions:e,mdastParent:t,lexicalNode:n}){e.appendToParent(t,n.getMdastNode())}},cB={testNode:`table`,visitNode({mdastNode:e,lexicalParent:t}){t.append(aB(e))}};function lB(e=1,t=1){let n={type:`table`,children:[]};for(let r=0;r<e;r++){let e={type:`tableRow`,children:[]};for(let n=0;n<t;n++)e.children.push({type:`tableCell`,children:[]});n.children.push(e)}return n}var uB=Rd(e=>{e.link(e.pipe(uB,Gd(({rows:e,columns:t})=>()=>aB(lB(e,t)))),Ak)}),dB=Zd({init(e,t){e.pubIn({[QO]:SM(),[ZO]:PM(),[XO]:cB,[YO]:rB,[$O]:sB,[ek]:AM({tableCellPadding:t?.tableCellPadding??!0,tablePipeAlign:t?.tablePipeAlign??!0})})}}),fB={testNode:`link`,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(fA(e.url,{title:e.title}))}},pB={testLexicalNode:pA,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto(`link`,{url:e.getURL(),title:e.getTitle()})}};function mB({validateUrl:e,attributes:t}){let[n]=tf();return(0,I.useEffect)((()=>{if(!n.hasNodes([dA]))throw Error(`LinkPlugin: LinkNode not registered on editor`);return rb(n.registerCommand(_A,(n=>{if(n===null)return yA(n),!0;if(typeof n==`string`)return!(e!==void 0&&!e(n))&&(yA(n,t),!0);{let{url:e,target:r,rel:i,title:a}=n;return yA(e,{...t,rel:i,target:r,title:a}),!0}}),1),e===void 0?()=>{}:n.registerCommand(em,(r=>{let i=W();if(!U(i)||i.isCollapsed()||!hb(r,ClipboardEvent)||r.clipboardData===null)return!1;let a=r.clipboardData.getData(`text`);return!!e(a)&&!i.getNodes().some((e=>G(e)))&&(n.dispatchCommand(_A,{...t,url:a}),r.preventDefault(),!0)}),1))}),[n,e,t]),null}function hB(e,t=(e=>e)){return n=>{let r=e.exec(n);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:t(r[0])}}}function gB(e,t){for(let n=0;n<t.length;n++){let r=t[n](e);if(r)return r}return null}var _B=/[.,;\s]/;function vB(e){return _B.test(e)}function yB(e){return vB(e[e.length-1])}function bB(e){return vB(e[0])}function xB(e){let t=e.getPreviousSibling();return G(t)&&(t=t.getLastDescendant()),t===null||gh(t)||H(t)&&yB(t.getTextContent())}function SB(e){let t=e.getNextSibling();return G(t)&&(t=t.getFirstDescendant()),t===null||gh(t)||H(t)&&bB(t.getTextContent())}function CB(e,t,n,r){return(e>0?vB(n[e-1]):xB(r[0]))?t<n.length?vB(n[t]):SB(r[r.length-1]):!1}function wB(e,t,n){let r=[],i=[],a=[],o=0,s=0,c=[...e];for(;c.length>0;){let e=c[0],l=e.getTextContent().length,u=s;s+l<=t?(r.push(e),o+=l):u>=n?a.push(e):i.push(e),s+=l,c.shift()}return[o,r,i,a]}function TB(e,t,n,r){let i=hA(r.url,r.attributes);if(e.length===1){let a,o=e[0];t===0?[a,o]=o.splitText(n):[,a,o]=o.splitText(t,n);let s=Nh(r.text);return s.setFormat(a.getFormat()),s.setDetail(a.getDetail()),s.setStyle(a.getStyle()),i.append(s),a.replace(i),o}if(e.length>1){let r=e[0],a,o=r.getTextContent().length;t===0?a=r:[,a]=r.splitText(t);let s=[],c;for(let t=1;t<e.length;t++){let r=e[t],i=r.getTextContent().length,a=o;if(a<n)if(o+i<=n)s.push(r);else{let[e,t]=r.splitText(n-a);s.push(e),c=t}o+=i}let l=W(),u=l?l.getNodes().find(H):void 0,d=Nh(a.getTextContent());return d.setFormat(a.getFormat()),d.setDetail(a.getDetail()),d.setStyle(a.getStyle()),i.append(d,...s),u&&u===a&&(U(l)?d.select(l.anchor.offset,l.focus.offset):Wh(l)&&d.select(0,d.getTextContent().length)),a.replace(i),c}}function EB(e,t,n){let r=e.getChildren(),i=r.length;for(let t=0;t<i;t++){let i=r[t];if(!H(i)||!i.isSimpleText())return DB(e),void n(null,e.getURL())}let a=e.getTextContent(),o=gB(a,t);if(o===null||o.text!==a||!xB(e)||!SB(e))return DB(e),void n(null,e.getURL());let s=e.getURL();if(s!==o.url&&(e.setURL(o.url),n(o.url,s)),o.attributes){let t=e.getRel();t!==o.attributes.rel&&(e.setRel(o.attributes.rel||null),n(o.attributes.rel||null,t));let r=e.getTarget();r!==o.attributes.target&&(e.setTarget(o.attributes.target||null),n(o.attributes.target||null,r))}}function DB(e){let t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map((e=>e.getLatest()))}function OB(e,t,n){(0,I.useEffect)((()=>{e.hasNodes([mA])||function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(77);let r=(e,t)=>{n&&n(e,t)};return rb(e.registerNodeTransform(wh,(e=>{let n=e.getParentOrThrow(),i=e.getPreviousSibling();gA(n)&&!n.getIsUnlinked()?EB(n,t,r):pA(n)||(e.isSimpleText()&&(bB(e.getTextContent())||!gA(i))&&(function(e,t,n){let r=[...e],i=r.map((e=>e.getTextContent())).join(``),a,o=i,s=0;for(;(a=gB(o,t))&&a!==null;){let e=a.index,t=e+a.length;if(CB(s+e,s+t,i,r)){let[i,,o,c]=wB(r,s+e,s+t),l=TB(o,s+e-i,s+t-i,a);r=l?[l,...c]:c,n(a.url,null),s=0}else s+=t;o=o.substring(t)}})(function(e){let t=[e],n=e.getNextSibling();for(;n!==null&&H(n)&&n.isSimpleText()&&(t.push(n),!/[\s]/.test(n.getTextContent()));)n=n.getNextSibling();return t}(e),t,r),(function(e,t,n){let r=e.getPreviousSibling(),i=e.getNextSibling(),a=e.getTextContent();var o;!gA(r)||r.getIsUnlinked()||bB(a)&&(o=a,!(r.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(o):/^\.[a-zA-Z0-9]{1,}/.test(o)))||(r.append(e),EB(r,t,n),n(null,r.getURL())),!gA(i)||i.getIsUnlinked()||yB(a)||(DB(i),EB(i,t,n),n(null,i.getURL()))})(e,t,r))})),e.registerCommand(_A,(e=>{let t=W();return e!==null||!U(t)||t.extract().forEach((e=>{let t=e.getParent();gA(t)&&(t.setIsUnlinked(!t.getIsUnlinked()),t.markDirty())})),!1}),1))}),[e,t,n])}function kB({matchers:e,onChange:t}){let[n]=tf();return OB(n,e,t),null}var AB=[hB(/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,e=>e.startsWith(`http`)?e:`https://${e}`),hB(/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,e=>`mailto:${e}`)],jB=()=>I.createElement(kB,{matchers:AB}),MB=B(!1),NB=Zd({init(e,t){let n=!!t?.disableAutoLink,r=t?.validateUrl?{validateUrl:t.validateUrl}:{},i=()=>I.createElement(I.Fragment,null,I.createElement(mB,{...r}),n?null:I.createElement(jB,null));e.pubIn({[Pk]:`link`,[XO]:fB,[YO]:[dA,mA],[$O]:pB,[MB]:n,[Ck]:i,[Tk]:i,[_k]:i})}}),PB=e=>e.type===`checkbox`,FB=e=>e instanceof Date,IB=e=>e==null,LB=e=>typeof e==`object`,RB=e=>!IB(e)&&!Array.isArray(e)&&LB(e)&&!FB(e),zB=e=>RB(e)&&e.target?PB(e.target)?e.target.checked:e.target.value:e,BB=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),VB=e=>{let t=e.constructor&&e.constructor.prototype;return RB(t)&&t.hasOwnProperty(`isPrototypeOf`)},HB=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function UB(e){if(e instanceof Date)return new Date(e);let t=typeof FileList<`u`&&e instanceof FileList;if(HB&&(e instanceof Blob||t))return e;let n=Array.isArray(e);if(!n&&!(RB(e)&&VB(e)))return e;let r=n?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=UB(e[t]));return r}var WB=e=>/^\w*$/.test(e),GB=e=>e===void 0,KB=e=>Array.isArray(e)?e.filter(Boolean):[],qB=e=>KB(e.replace(/["|']|\]/g,``).split(/\.|\[/)),Y=(e,t,n)=>{if(!t||!RB(e))return n;let r=(WB(t)?[t]:qB(t)).reduce((e,t)=>IB(e)?void 0:e[t],e);return GB(r)||r===e?GB(e[t])?n:e[t]:r},JB=e=>typeof e==`boolean`,YB=e=>typeof e==`function`,XB=(e,t,n)=>{let r=-1,i=WB(t)?[t]:qB(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=RB(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(t===`__proto__`||t===`constructor`||t===`prototype`)return;e[t]=a,e=e[t]}},ZB={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},QB={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},$B={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},eV=`form`,tV=`root`,nV=I.createContext(null);nV.displayName=`HookFormControlContext`;var rV=()=>I.useContext(nV),iV=(e,t,n,r=!0)=>{let i={defaultValues:t._defaultValues};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==QB.all&&(t._proxyFormState[i]=!r||QB.all),n&&(n[i]=!0),e[i]}});return i},aV=typeof window<`u`?I.useLayoutEffect:I.useEffect;function Kte(e){let t=rV(),{control:n=t,disabled:r,name:i,exact:a}=e||{},[o,s]=I.useState(n._formState),c=I.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return aV(()=>n._subscribe({name:i,formState:c.current,exact:a,callback:e=>{!r&&s({...n._formState,...e})}}),[i,r,a]),I.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),I.useMemo(()=>iV(o,n,c.current,!1),[o,n])}var oV=e=>typeof e==`string`,sV=(e,t,n,r,i)=>oV(e)?(r&&t.watch.add(e),Y(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),Y(n,e))):(r&&(t.watchAll=!0),n),cV=e=>IB(e)||!LB(e);function lV(e,t,n=new WeakSet){if(e===t)return!0;if(cV(e)||cV(t))return Object.is(e,t);if(FB(e)&&FB(t))return Object.is(e.getTime(),t.getTime());let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(let i of r){let r=e[i];if(!(i in t))return!1;if(i!==`ref`){let e=t[i];if(FB(r)&&FB(e)||(RB(r)||Array.isArray(r))&&(RB(e)||Array.isArray(e))?!lV(r,e,n):!Object.is(r,e))return!1}}return!0}function qte(e){let t=rV(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},c=I.useRef(i),l=I.useRef(s),u=I.useRef(void 0),d=I.useRef(n),f=I.useRef(r);l.current=s;let[p,m]=I.useState(()=>{let e=n._getWatch(r,c.current);return l.current?l.current(e):e}),h=I.useCallback(e=>{let t=sV(r,n._names,e||n._formValues,!1,c.current);return l.current?l.current(t):t},[n._formValues,n._names,r]),g=I.useCallback(e=>{if(!a){let t=sV(r,n._names,e||n._formValues,!1,c.current);if(l.current){let e=l.current(t);lV(e,u.current)||(m(e),u.current=e)}else m(t)}},[n._formValues,n._names,a,r]);aV(()=>((d.current!==n||!lV(f.current,r))&&(d.current=n,f.current=r,g()),n._subscribe({name:r,formState:{values:!0},exact:o,callback:e=>{g(e.values)}})),[n,o,r,g]),I.useEffect(()=>n._removeUnmounted());let _=d.current!==n,v=f.current,y=I.useMemo(()=>{if(a)return null;let e=!_&&!lV(v,r);return _||e?h():null},[a,_,r,v,h]);return y===null?p:y}function Jte(e){let t=rV(),{name:n,disabled:r,control:i=t,shouldUnregister:a,defaultValue:o,exact:s=!0}=e,c=BB(i._names.array,n),l=qte({control:i,name:n,defaultValue:I.useMemo(()=>Y(i._formValues,n,Y(i._defaultValues,n,o)),[i,n,o]),exact:s}),u=Kte({control:i,name:n,exact:s}),d=I.useRef(e),f=I.useRef(i.register(n,{...e.rules,value:l,...JB(e.disabled)?{disabled:e.disabled}:{}}));d.current=e;let p=I.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Y(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!Y(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Y(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Y(u.validatingFields,n)},error:{enumerable:!0,get:()=>Y(u.errors,n)}}),[u,n]),m=I.useCallback(e=>f.current.onChange({target:{value:zB(e),name:n},type:ZB.CHANGE}),[n]),h=I.useCallback(()=>f.current.onBlur({target:{value:Y(i._formValues,n),name:n},type:ZB.BLUR}),[n,i._formValues]),g=I.useCallback(e=>{let t=Y(i._fields,n);t&&t._f&&e&&(t._f.ref={focus:()=>YB(e.focus)&&e.focus(),select:()=>YB(e.select)&&e.select(),setCustomValidity:t=>YB(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>YB(e.reportValidity)&&e.reportValidity()})},[i._fields,n]),_=I.useMemo(()=>({name:n,value:l,...JB(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:m,onBlur:h,ref:g}),[n,r,u.disabled,m,h,g,l]);return I.useEffect(()=>{let e=i._options.shouldUnregister||a;i.register(n,{...d.current.rules,...JB(d.current.disabled)?{disabled:d.current.disabled}:{}});let t=(e,t)=>{let n=Y(i._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){let e=UB(Y(i._options.defaultValues,n,d.current.defaultValue));XB(i._defaultValues,n,e),GB(Y(i._formValues,n))&&XB(i._formValues,n,e)}return!c&&i.register(n),()=>{(c?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,c,a]),I.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),I.useMemo(()=>({field:_,formState:u,fieldState:p}),[_,u,p])}var Yte=e=>e.render(Jte(e)),Xte=I.createContext(null);Xte.displayName=`HookFormContext`;var Zte=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},uV=e=>Array.isArray(e)?e:[e],dV=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function fV(e,t){let n={};for(let r in e)if(e.hasOwnProperty(r)){let i=e[r],a=t[r];if(i&&RB(i)&&a){let e=fV(i,a);RB(e)&&(n[r]=e)}else e[r]&&(n[r]=a)}return n}var pV=e=>RB(e)&&!Object.keys(e).length,mV=e=>e.type===`file`,hV=e=>{if(!HB)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},gV=e=>e.type===`select-multiple`,_V=e=>e.type===`radio`,Qte=e=>_V(e)||PB(e),vV=e=>hV(e)&&e.isConnected;function $te(e,t){let n=t.slice(0,-1).length,r=0;for(;r<n;){if(IB(e)){e=void 0;break}e=e[t[r]],r++}return e}function ene(e){for(let t in e)if(e.hasOwnProperty(t)&&!GB(e[t]))return!1;return!0}function yV(e,t){if(oV(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:WB(t)?[t]:qB(t),r=n.length===1?e:$te(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(RB(r)&&pV(r)||Array.isArray(r)&&ene(r))&&yV(e,n.slice(0,-1)),e}var tne=e=>{for(let t in e)if(YB(e[t]))return!0;return!1};function bV(e){return Array.isArray(e)||RB(e)&&!tne(e)}function xV(e,t={}){for(let n in e){let r=e[n];bV(r)?(t[n]=Array.isArray(r)?[]:{},xV(r,t[n])):GB(r)||(t[n]=!0)}return t}function SV(e,t,n){n||=xV(t);for(let r in e){let i=e[r];if(bV(i))GB(t)||cV(n[r])?n[r]=xV(i,Array.isArray(i)?[]:{}):SV(i,IB(t)?{}:t[r],n[r]);else{let e=t[r];n[r]=!lV(i,e)}}return n}var CV={value:!1,isValid:!1},wV={value:!0,isValid:!0},TV=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!GB(e[0].attributes.value)?GB(e[0].value)||e[0].value===``?wV:{value:e[0].value,isValid:!0}:wV:CV}return CV},EV=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>GB(e)?e:t?e===``?NaN:e&&+e:n&&oV(e)?new Date(e):r?r(e):e,DV={isValid:!1,value:null},OV=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,DV):DV;function kV(e){let t=e.ref;return mV(t)?t.files:_V(t)?OV(e.refs).value:gV(t)?[...t.selectedOptions].map(({value:e})=>e):PB(t)?TV(e.refs).value:EV(GB(t.value)?e.ref.value:t.value,e)}var AV=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,jV=(e,t,n,r)=>{let i={};for(let n of e){let e=Y(t,n);e&&XB(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},MV=e=>e instanceof RegExp,NV=e=>GB(e)?e:MV(e)?e.source:RB(e)?MV(e.value)?e.value.source:e.value:e,PV=e=>({isOnSubmit:!e||e===QB.onSubmit,isOnBlur:e===QB.onBlur,isOnChange:e===QB.onChange,isOnAll:e===QB.all,isOnTouch:e===QB.onTouched}),FV=`AsyncFunction`,IV=e=>!!e&&!!e.validate&&!!(YB(e.validate)&&e.validate.constructor.name===FV||RB(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===FV)),LV=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),RV=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))),zV=(e,t,n,r)=>{for(let i of n||Object.keys(e)){let n=Y(e,i);if(n){let{_f:e,...a}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r||e.ref&&t(e.ref,e.name)&&!r)return!0;if(zV(a,t))break}else if(RB(a)&&zV(a,t))break}}};function BV(e,t,n){let r=Y(e,n);if(r||WB(n))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=Y(t,r),o=Y(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var VV=(e,t,n,r)=>{n(e);let{name:i,...a}=e;return pV(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!r||QB.all))},HV=(e,t,n)=>!e||!t||e===t||uV(e).some(e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e))),UV=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,WV=(e,t)=>!KB(Y(e,t)).length&&yV(e,t),GV=(e,t,n)=>{let r=uV(Y(e,n));return XB(r,tV,t[n]),XB(e,n,r),e};function KV(e,t,n=`validate`){if(oV(e)||Array.isArray(e)&&e.every(oV)||JB(e)&&!e)return{type:n,message:oV(e)?e:``,ref:t}}var qV=e=>RB(e)&&!MV(e)?e:{value:e,message:``},JV=async(e,t,n,r,i,a)=>{let{ref:o,refs:s,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:_}=e._f,v=Y(n,h);if(!_||t.has(h))return{};let y=s?s[0]:o,b=e=>{i&&y.reportValidity&&(y.setCustomValidity(JB(e)?``:e||``),y.reportValidity())},x={},S=_V(o),C=PB(o),w=S||C,T=(g||mV(o))&&GB(o.value)&&GB(v)||hV(o)&&o.value===``||v===``||Array.isArray(v)&&!v.length||g&&typeof v==`number`&&isNaN(v),E=Zte.bind(null,h,r,x),D=(e,t,n,r=$B.maxLength,i=$B.minLength)=>{let a=e?t:n;x[h]={type:e?r:i,message:a,ref:o,...E(e?r:i,a)}};if(a?!Array.isArray(v)||!v.length:c&&(!w&&(T||IB(v))||JB(v)&&!v||C&&!TV(s).isValid||S&&!OV(s).isValid)){let{value:e,message:t}=oV(c)?{value:!!c,message:c}:qV(c);if(e&&(x[h]={type:$B.required,message:t,ref:y,...E($B.required,t)},!r))return b(t),x}if(!T&&(!IB(d)||!IB(f))){let e,t,n=qV(f),i=qV(d);if(!IB(v)&&!isNaN(v)){let r=o.valueAsNumber||v&&+v;IB(n.value)||(e=r>n.value),IB(i.value)||(t=r<i.value)}else{let r=o.valueAsDate||new Date(v),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;oV(n.value)&&v&&(e=s?a(v)>a(n.value):c?v>n.value:r>new Date(n.value)),oV(i.value)&&v&&(t=s?a(v)<a(i.value):c?v<i.value:r<new Date(i.value))}if((e||t)&&(D(!!e,n.message,i.message,$B.max,$B.min),!r))return b(x[h].message),x}if((l||u)&&!T&&(oV(v)||a&&Array.isArray(v))){let e=qV(l),t=qV(u),n=!IB(e.value)&&v.length>+e.value,i=!IB(t.value)&&v.length<+t.value;if((n||i)&&(D(n,e.message,t.message),!r))return b(x[h].message),x}if(p&&!T&&oV(v)){let{value:e,message:t}=qV(p);if(MV(e)&&!v.match(e)&&(x[h]={type:$B.pattern,message:t,ref:o,...E($B.pattern,t)},!r))return b(t),x}if(m){if(YB(m)){let e=KV(await m(v,n),y);if(e&&(x[h]={...e,...E($B.validate,e.message)},!r))return b(e.message),x}else if(RB(m)){let e={};for(let t in m){if(!pV(e)&&!r)break;let i=KV(await m[t](v,n),y,t);i&&(e={...i,...E(t,i.message)},b(i.message),r&&(x[h]=e))}if(!pV(e)&&(x[h]={ref:y,...e},!r))return x}}return b(!0),x},YV={mode:QB.onSubmit,reValidateMode:QB.onChange,shouldFocusError:!0};function XV(e={}){let t={...YV,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:YB(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=(RB(t.defaultValues)||RB(t.values))&&UB(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:UB(i),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,l=0,u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...u},f={...d},p={array:dV(),state:dV()},m=t.criteriaMode===QB.all,h=e=>t=>{clearTimeout(l),l=setTimeout(e,t)},g=async e=>{if(!o.keepIsValid&&!t.disabled&&(d.isValid||f.isValid||e)){let e;t.resolver?(e=pV((await T()).errors),_()):e=await O({fields:r,onlyCheckValid:!0,eventType:ZB.VALID}),e!==n.isValid&&p.state.next({isValid:e})}},_=(e,r)=>{!t.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((e||Array.from(s.mount)).forEach(e=>{e&&(r?XB(n.validatingFields,e,r):yV(n.validatingFields,e))}),p.state.next({validatingFields:n.validatingFields,isValidating:!pV(n.validatingFields)}))},v=e=>{let t=SV(i,a),r=AV(e);XB(n.dirtyFields,r,Y(t,r))},y=(e,i=[],s,c,l=!0,u=!0)=>{if(c&&s&&!t.disabled){if(o.action=!0,u&&Array.isArray(Y(r,e))){let t=s(Y(r,e),c.argA,c.argB);l&&XB(r,e,t)}if(u&&Array.isArray(Y(n.errors,e))){let t=s(Y(n.errors,e),c.argA,c.argB);l&&XB(n.errors,e,t),WV(n.errors,e)}if((d.touchedFields||f.touchedFields)&&u&&Array.isArray(Y(n.touchedFields,e))){let t=s(Y(n.touchedFields,e),c.argA,c.argB);l&&XB(n.touchedFields,e,t)}(d.dirtyFields||f.dirtyFields)&&v(e),p.state.next({name:e,isDirty:A(e,i),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else XB(a,e,i)},b=(e,t)=>{XB(n.errors,e,t),p.state.next({errors:n.errors})},x=e=>{n.errors=e,p.state.next({errors:n.errors,isValid:!1})},S=(e,t,n,s)=>{let c=Y(r,e);if(c){let r=Y(a,e,GB(n)?Y(i,e):n);GB(r)||s&&s.defaultChecked||t?XB(a,e,t?r:kV(c._f)):N(e,r),o.mount&&!o.action&&g()}},C=(e,r,a,o,s)=>{let c=!1,l=!1,u={name:e};if(!t.disabled){if(!a||o){(d.isDirty||f.isDirty)&&(l=n.isDirty,n.isDirty=u.isDirty=A(),c=l!==u.isDirty);let t=lV(Y(i,e),r);l=!!Y(n.dirtyFields,e),t?yV(n.dirtyFields,e):XB(n.dirtyFields,e,!0),u.dirtyFields=n.dirtyFields,c||=(d.dirtyFields||f.dirtyFields)&&l!==!t}if(a){let t=Y(n.touchedFields,e);t||(XB(n.touchedFields,e,a),u.touchedFields=n.touchedFields,c||=(d.touchedFields||f.touchedFields)&&t!==a)}c&&s&&p.state.next(u)}return c?u:{}},w=(e,r,i,a)=>{let o=Y(n.errors,e),s=(d.isValid||f.isValid)&&JB(r)&&n.isValid!==r;if(t.delayError&&i?(c=h(()=>b(e,i)),c(t.delayError)):(clearTimeout(l),c=null,i?XB(n.errors,e,i):yV(n.errors,e)),(i?!lV(o,i):o)||!pV(a)||s){let t={...a,...s&&JB(r)?{isValid:r}:{},errors:n.errors,name:e};n={...n,...t},p.state.next(t)}},T=async e=>(_(e,!0),await t.resolver(a,t.context,jV(e||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),E=async e=>{let{errors:t}=await T(e);if(_(e),e)for(let r of e){let e=Y(t,r);e?XB(n.errors,r,e):yV(n.errors,r)}else n.errors=t;return t},D=async({name:t,eventType:r})=>{if(e.validate){let i=await e.validate({formValues:a,formState:n,name:t,eventType:r});if(RB(i))for(let e in i)i[e]&&se(`${eV}.${e}`,{message:oV(i.message)?i.message:``,type:$B.validate});else oV(i)||!i?se(eV,{message:i||``,type:$B.validate}):oe(eV);return i}return!0},O=async({fields:r,onlyCheckValid:i,name:o,eventType:c,context:l={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(l.runRootValidation=!0,!await D({name:o,eventType:c})&&(l.valid=!1,i)))return l.valid;for(let o in r){let u=r[o];if(u){let{_f:r,...f}=u;if(r){let o=s.array.has(r.name),c=u._f&&IV(u._f);c&&d.validatingFields&&_([r.name],!0);let f=await JV(u,s.disabled,a,m,t.shouldUseNativeValidation&&!i,o);if(c&&d.validatingFields&&_([r.name]),f[r.name]&&(l.valid=!1,i)||(!i&&(Y(f,r.name)?o?GV(n.errors,f,r.name):XB(n.errors,r.name,f[r.name]):yV(n.errors,r.name)),e.shouldUseNativeValidation&&f[r.name]))break}!pV(f)&&await O({context:l,onlyCheckValid:i,fields:f,name:o,eventType:c})}}return l.valid},k=()=>{for(let e of s.unMount){let t=Y(r,e);t&&(t._f.refs?t._f.refs.every(e=>!vV(e)):!vV(t._f.ref))&&de(e)}s.unMount=new Set},A=(e,n)=>!t.disabled&&(e&&n&&XB(a,e,n),!lV(ie(),i)),j=(e,t,n)=>sV(e,s,{...o.mount?a:GB(t)?i:oV(e)?{[e]:t}:t},n,t),M=e=>KB(Y(o.mount?a:i,e,t.shouldUnregister?Y(i,e,[]):[])),N=(e,t,n={})=>{let i=Y(r,e),o=t;if(i){let n=i._f;n&&(!n.disabled&&XB(a,e,EV(t,n)),o=hV(n.ref)&&IB(t)?``:t,gV(n.ref)?[...n.ref.options].forEach(e=>e.selected=o.includes(e.value)):n.refs?PB(n.ref)?n.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(Array.isArray(o)?e.checked=!!o.find(t=>t===e.value):e.checked=o===e.value||!!o)}):n.refs.forEach(e=>e.checked=e.value===o):mV(n.ref)?n.ref.value=``:(n.ref.value=o,n.ref.type||p.state.next({name:e,values:UB(a)})))}(n.shouldDirty||n.shouldTouch)&&C(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&re(e)},P=(e,t,n)=>{for(let i in t){if(!t.hasOwnProperty(i))return;let a=t[i],o=e+`.`+i,c=Y(r,o);(s.array.has(e)||RB(a)||c&&!c._f)&&!FB(a)?P(o,a,n):N(o,a,n)}},F=(e,t,i={})=>{let c=Y(r,e),l=s.array.has(e),u=UB(t),d=lV(Y(a,e),u);if(XB(a,e,u),l)p.array.next({name:e,values:UB(a)}),i.shouldDirty&&(v(e),p.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:A(e,u)}));else{let t=Array.isArray(u)&&!u.length||pV(u);!c||c._f||IB(u)||t?N(e,u,i):P(e,u,i)}d||(RV(e,s)?p.state.next({...n,name:e,values:UB(a)}):p.state.next({name:o.mount?e:void 0,values:UB(a)}))},ee=e=>{let t=YB(e)?e(a):e;lV(a,t)||(a={...a,...t},p.state.next({...n,values:a}))},te=async i=>{o.mount=!0;let l=i.target,u=l.name,h=!0,v=Y(r,u),y=e=>{h=Number.isNaN(e)||FB(e)&&isNaN(e.getTime())||lV(e,Y(a,u,e))},b=PV(t.mode),x=PV(t.reValidateMode);if(v){let o,S,E=l.type?kV(v._f):zB(i),k=i.type===ZB.BLUR||i.type===ZB.FOCUS_OUT,A=!LV(v._f)&&!e.validate&&!t.resolver&&!Y(n.errors,u)&&!v._f.deps||UV(k,Y(n.touchedFields,u),n.isSubmitted,x,b),j=RV(u,s,k);XB(a,u,E),k?(!l||!l.readOnly)&&(v._f.onBlur&&v._f.onBlur(i),c&&c(0)):v._f.onChange&&v._f.onChange(i);let M=C(u,E,k),N=!pV(M)||j;if(!k&&p.state.next({name:u,type:i.type,values:UB(a)}),A)return(d.isValid||f.isValid)&&(t.mode===`onBlur`?k&&g():k||g()),N&&p.state.next({name:u,...j?{}:M});if(!t.resolver&&e.validate&&await D({name:u,eventType:i.type}),!k&&j&&p.state.next({...n}),t.resolver){let{errors:e}=await T([u]);if(_([u]),y(E),h){let t=BV(n.errors,r,u),i=BV(e,r,t.name||u);o=i.error,u=i.name,S=pV(e)}}else _([u],!0),o=(await JV(v,s.disabled,a,m,t.shouldUseNativeValidation))[u],_([u]),y(E),h&&(o?S=!1:(d.isValid||f.isValid)&&(S=await O({fields:r,onlyCheckValid:!0,name:u,eventType:i.type})));h&&(v._f.deps&&(!Array.isArray(v._f.deps)||v._f.deps.length>0)&&re(v._f.deps),w(u,S,o,M))}},ne=(e,t)=>{if(Y(n.errors,t)&&e.focus)return e.focus(),1},re=async(e,i={})=>{let a,o,c=uV(e);if(t.resolver){let t=await E(GB(e)?e:c);a=pV(t),o=e?!c.some(e=>Y(t,e)):a}else e?(o=(await Promise.all(c.map(async e=>{let t=Y(r,e);return await O({fields:t&&t._f?{[e]:t}:t,eventType:ZB.TRIGGER})}))).every(Boolean),!(!o&&!n.isValid)&&g()):o=a=await O({fields:r,name:e,eventType:ZB.TRIGGER});return p.state.next({...!oV(e)||(d.isValid||f.isValid)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},errors:n.errors}),i.shouldFocus&&!o&&zV(r,ne,e?c:s.mount),o},ie=(e,t)=>{let r={...o.mount?a:i};return t&&(r=fV(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),GB(e)?r:oV(e)?Y(r,e):e.map(e=>Y(r,e))},ae=(e,t)=>({invalid:!!Y((t||n).errors,e),isDirty:!!Y((t||n).dirtyFields,e),error:Y((t||n).errors,e),isValidating:!!Y(n.validatingFields,e),isTouched:!!Y((t||n).touchedFields,e)}),oe=e=>{let t=e?uV(e):void 0;t?.forEach(e=>yV(n.errors,e)),t?t.forEach(e=>{p.state.next({name:e,errors:n.errors})}):p.state.next({errors:{}})},se=(e,t,i)=>{let a=(Y(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,...l}=Y(n.errors,e)||{};XB(n.errors,e,{...l,...t,ref:a}),p.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},ce=(e,t)=>YB(e)?p.state.subscribe({next:n=>`values`in n&&e(n.values||j(void 0,t),n)}):j(e,t,!0),le=e=>p.state.subscribe({next:t=>{if(HV(e.name,t.name,e.exact)&&VV(t,e.formState||d,xe,e.reRenderRoot)){let r={...a};e.callback({values:r,...n,...t,defaultValues:i})}}}).unsubscribe,ue=e=>(o.mount=!0,f={...f,...e.formState},le({...e,formState:{...u,...e.formState}})),de=(e,o={})=>{for(let c of e?uV(e):s.mount)s.mount.delete(c),s.array.delete(c),o.keepValue||(yV(r,c),yV(a,c)),!o.keepError&&yV(n.errors,c),!o.keepDirty&&yV(n.dirtyFields,c),!o.keepTouched&&yV(n.touchedFields,c),!o.keepIsValidating&&yV(n.validatingFields,c),!t.shouldUnregister&&!o.keepDefaultValue&&yV(i,c);p.state.next({values:UB(a)}),p.state.next({...n,...o.keepDirty?{isDirty:A()}:{}}),!o.keepIsValid&&g()},fe=({disabled:e,name:t})=>{if(JB(e)&&o.mount||e||s.disabled.has(t)){let n=s.disabled.has(t)!==!!e;e?s.disabled.add(t):s.disabled.delete(t),n&&o.mount&&!o.action&&g()}},pe=(e,n={})=>{let a=Y(r,e),c=JB(n.disabled)||JB(t.disabled),l=!s.registerName.has(e)&&a&&a._f&&!a._f.mount;return XB(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),s.mount.add(e),a&&!l?fe({disabled:JB(n.disabled)?n.disabled:t.disabled,name:e}):S(e,!0,n.value),{...c?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!n.required,min:NV(n.min),max:NV(n.max),minLength:NV(n.minLength),maxLength:NV(n.maxLength),pattern:NV(n.pattern)}:{},name:e,onChange:te,onBlur:te,ref:c=>{if(c){s.registerName.add(e),pe(e,n),s.registerName.delete(e),a=Y(r,e);let t=GB(c.value)&&c.querySelectorAll&&c.querySelectorAll(`input,select,textarea`)[0]||c,o=Qte(t),l=a._f.refs||[];if(o?l.find(e=>e===t):t===a._f.ref)return;XB(r,e,{_f:{...a._f,...o?{refs:[...l.filter(vV),t,...Array.isArray(Y(i,e))?[{}]:[]],ref:{type:t.type,name:e}}:{ref:t}}}),S(e,!1,void 0,t)}else a=Y(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(BB(s.array,e)&&o.action)&&s.unMount.add(e)}}},me=()=>t.shouldFocusError&&zV(r,ne,s.mount),he=e=>{JB(e)&&(p.state.next({disabled:e}),zV(r,(t,n)=>{let i=Y(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0,!1))},ge=(e,i)=>async o=>{let c;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let l=UB(a);if(p.state.next({isSubmitting:!0}),t.resolver){let{errors:e,values:t}=await T();_(),n.errors=e,l=UB(t)}else await O({fields:r,eventType:ZB.SUBMIT});if(s.disabled.size)for(let e of s.disabled)yV(l,e);if(yV(n.errors,tV),pV(n.errors)){p.state.next({errors:{}});try{await e(l,o)}catch(e){c=e}}else i&&await i({...n.errors},o),me(),setTimeout(me);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:pV(n.errors)&&!c,submitCount:n.submitCount+1,errors:n.errors}),c)throw c},_e=(e,t={})=>{Y(r,e)&&(GB(t.defaultValue)?F(e,UB(Y(i,e))):(F(e,t.defaultValue),XB(i,e,UB(t.defaultValue))),t.keepTouched||yV(n.touchedFields,e),t.keepDirty||(yV(n.dirtyFields,e),n.isDirty=t.defaultValue?A(e,UB(Y(i,e))):A()),t.keepError||(yV(n.errors,e),d.isValid&&g()),p.state.next({...n}))},ve=(e,c={})=>{let l=e?UB(e):i,u=UB(l),f=pV(e),m=f?i:u;if(c.keepDefaultValues||(i=l),!c.keepValues){if(c.keepDirtyValues){let e=new Set([...s.mount,...Object.keys(SV(i,a))]);for(let t of Array.from(e)){let e=Y(n.dirtyFields,t),r=Y(a,t),i=Y(m,t);e&&!GB(r)?XB(m,t,r):!e&&!GB(i)&&F(t,i)}}else{if(HB&&GB(e))for(let e of s.mount){let t=Y(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(hV(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(c.keepFieldsRef)for(let e of s.mount)F(e,Y(m,e));else r={}}a=t.shouldUnregister?c.keepDefaultValues?UB(i):{}:UB(m),p.array.next({values:{...m}}),p.state.next({values:{...m}})}s={mount:c.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!d.isValid||!!c.keepIsValid||!!c.keepDirtyValues||!t.shouldUnregister&&!pV(m),o.watch=!!t.shouldUnregister,o.keepIsValid=!!c.keepIsValid,o.action=!1,c.keepErrors||(n.errors={}),p.state.next({submitCount:c.keepSubmitCount?n.submitCount:0,isDirty:f?!1:c.keepDirty?n.isDirty:!!(c.keepDefaultValues&&!lV(e,i)),isSubmitted:c.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:f?{}:c.keepDirtyValues?c.keepDefaultValues&&a?SV(i,a):n.dirtyFields:c.keepDefaultValues&&e?SV(i,e):c.keepDirty?n.dirtyFields:{},touchedFields:c.keepTouched?n.touchedFields:{},errors:c.keepErrors?n.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},ye=(e,n)=>ve(YB(e)?e(a):e,{...t.resetOptions,...n}),be=(e,t={})=>{let n=Y(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&YB(e.select)&&e.select()})}},xe=e=>{n={...n,...e}},Se={control:{register:pe,unregister:de,getFieldState:ae,handleSubmit:ge,setError:se,_subscribe:le,_runSchema:T,_updateIsValidating:_,_focusError:me,_getWatch:j,_getDirty:A,_setValid:g,_setFieldArray:y,_setDisabledField:fe,_setErrors:x,_getFieldArray:M,_reset:ve,_resetDefaultValues:()=>YB(t.defaultValues)&&t.defaultValues().then(e=>{ye(e,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:k,_disableForm:he,_subjects:p,_proxyFormState:d,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return s},set _names(e){s=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e}}},subscribe:ue,trigger:re,register:pe,handleSubmit:ge,watch:ce,setValue:F,setValues:ee,getValues:ie,reset:ye,resetField:_e,clearErrors:oe,unregister:de,setError:se,setFocus:be,getFieldState:ae};return{...Se,formControl:Se}}function ZV(e={}){let t=I.useRef(void 0),n=I.useRef(void 0),[r,i]=I.useState({isDirty:!1,isValidating:!1,isLoading:YB(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:YB(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!YB(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...i}=XV(e);t.current={...i,formState:r}}let a=t.current.control;return a._options=e,aV(()=>{let e=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0});return i(e=>({...e,isReady:!0})),a._formState.isReady=!0,e},[a]),I.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),I.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),I.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),I.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),I.useEffect(()=>{if(a._proxyFormState.isDirty){let e=a._getDirty();e!==r.isDirty&&a._subjects.state.next({isDirty:e})}},[a,r.isDirty]),I.useEffect(()=>{e.values&&!lV(e.values,n.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),a._options.resetOptions?.keepIsValid||a._setValid(),n.current=e.values,i(e=>({...e}))):a._resetDefaultValues()},[a,e.values]),I.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=I.useMemo(()=>iV(r,a),[a,r]),t.current}var QV=n(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),$V=n(((e,t)=>{var n=QV();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),eH=n(((e,t)=>{t.exports=$V()()})),tH=n((e=>{if(typeof Symbol==`function`&&Symbol.for){var t=Symbol.for;t(`react.element`),t(`react.portal`),t(`react.fragment`),t(`react.strict_mode`),t(`react.profiler`),t(`react.provider`),t(`react.context`),t(`react.forward_ref`),t(`react.suspense`),t(`react.suspense_list`),t(`react.memo`),t(`react.lazy`),t(`react.block`),t(`react.server.block`),t(`react.fundamental`),t(`react.debug_trace_mode`),t(`react.legacy_hidden`)}})),nH=n(((e,t)=>{t.exports=tH()})),rH=e=>typeof e==`object`&&!!e&&e.nodeType===1,iH=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,aH=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return iH(n.overflowY,t)||iH(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},oH=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,sH=e=>e.parentElement??(e.getRootNode().host||null),cH=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!rH(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;rH(u)&&s(u);){if(u=sH(u),u===c){l.push(u);break}u!=null&&u===document.body&&aH(u)&&!aH(document.documentElement)||u!=null&&aH(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,p=window.scrollX??pageXOffset,m=window.scrollY??pageYOffset,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),x=r===`start`||r===`nearest`?_:r===`end`?y:_+h/2,S=i===`center`?b+g/2:i===`end`?v:b,C=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:w,left:T}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&_>=s&&y<=w&&b>=T&&v<=u)return C;let E=getComputedStyle(t),D=parseInt(E.borderLeftWidth,10),O=parseInt(E.borderTopWidth,10),k=parseInt(E.borderRightWidth,10),A=parseInt(E.borderBottomWidth,10),j=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-D-k:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-O-A:0,F=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,ee=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)j=r===`start`?x:r===`end`?x-f:r===`nearest`?oH(m,m+f,f,O,A,m+x,m+x+h,h):x-f/2,M=i===`start`?S:i===`center`?S-d/2:i===`end`?S-d:oH(p,p+d,d,D,k,p+S,p+S+g,g),j=Math.max(0,j+m),M=Math.max(0,M+p);else{j=r===`start`?x-s-O:r===`end`?x-w+A+P:r===`nearest`?oH(s,w,a,O,A+P,x,x+h,h):x-(s+a/2)+P/2,M=i===`start`?S-T-D:i===`center`?S-(T+o/2)+N/2:i===`end`?S-u+k+N:oH(T,u,o,D,k+N,S,S+g,g);let{scrollLeft:e,scrollTop:n}=t;j=Math.max(0,Math.min(n+j/ee,t.scrollHeight-a/ee+P)),M=Math.max(0,Math.min(e+M/F,t.scrollWidth-o/F+N)),x+=n-j,S+=e-M}C.push({el:t,top:j,left:M})}return C},X=t(eH());nH();var lH=0;function uH(){}function dH(e,t){e&&cH(e,{boundary:t,block:`nearest`,scrollMode:`if-needed`}).forEach(function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r})}function fH(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function pH(e,t){var n;function r(){n&&clearTimeout(n)}function i(){var i=[...arguments];r(),n=setTimeout(function(){n=null,e.apply(void 0,i)},t)}return i.cancel=r,i}function mH(){var e=[...arguments];return function(t){var n=[...arguments].slice(1);return e.some(function(e){return e&&e.apply(void 0,[t].concat(n)),t.preventDownshiftDefault||t.hasOwnProperty(`nativeEvent`)&&t.nativeEvent.preventDownshiftDefault})}}function hH(){var e=[...arguments];return function(t){e.forEach(function(e){typeof e==`function`?e(t):e&&(e.current=t)})}}function gH(){return String(lH++)}function _H(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n===r?``:n+` result`+(n===1?` is`:`s are`)+` available, use up and down arrow keys to navigate. Press Enter key to select.`:`No results are available.`:``}function vH(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=yH(t,r)?t[r]:e[r],n},{})}function yH(e,t){return e[t]!==void 0}function bH(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf(`Arrow`)!==0?`Arrow`+t:t}function xH(e,t,n,r,i){if(i===void 0&&(i=!0),n===0)return-1;var a=n-1;(typeof t!=`number`||t<0||t>=n)&&(t=e>0?-1:a+1);var o=t+e;o<0?o=i?a:0:o>a&&(o=i?0:a);var s=SH(e,o,n,r,i);return s===-1?t>=n?-1:t:s}function SH(e,t,n,r,i){var a=r(t);if(!a||!a.hasAttribute(`disabled`))return t;if(e>0){for(var o=t+1;o<n;o++)if(!r(o).hasAttribute(`disabled`))return o}else for(var s=t-1;s>=0;s--)if(!r(s).hasAttribute(`disabled`))return s;return i?e>0?SH(1,0,n,r,!1):SH(-1,n-1,n,r,!1):-1}function CH(e,t,n,r){return r===void 0&&(r=!0),t.some(function(t){return t&&(fH(t,e,n)||r&&fH(t,n.document.activeElement,n))})}var wH=pH(function(e){EH(e).textContent=``},500);function TH(e,t){var n=EH(t);e&&(n.textContent=e,wH(t))}function EH(e){e===void 0&&(e=document);var t=e.getElementById(`a11y-status-message`);return t||(t=e.createElement(`div`),t.setAttribute(`id`,`a11y-status-message`),t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),t.setAttribute(`aria-relevant`,`additions text`),Object.assign(t.style,{border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`}),e.body.appendChild(t),t)}var DH=[`isInitialMount`,`highlightedIndex`,`items`,`environment`],OH={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:``};function kH(e,t,n){var r=e.props,i=e.type,a={};Object.keys(t).forEach(function(r){AH(r,e,t,n),n[r]!==t[r]&&(a[r]=n[r])}),r.onStateChange&&Object.keys(a).length&&r.onStateChange(z({type:i},a))}function AH(e,t,n,r){var i=t.props,a=t.type,o=`on`+zH(e)+`Change`;i[o]&&r[e]!==void 0&&r[e]!==n[e]&&i[o](z({type:a},r))}function jH(e,t){return t.changes}function MH(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+` has been selected.`:``}var NH=pH(function(e,t){TH(e(),t)},200),PH=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?I.useLayoutEffect:I.useEffect;function FH(e){var t=e.id,n=t===void 0?`downshift-`+gH():t,r=e.labelId,i=e.menuId,a=e.getItemId,o=e.toggleButtonId,s=e.inputId;return(0,I.useRef)({labelId:r||n+`-label`,menuId:i||n+`-menu`,getItemId:a||function(e){return n+`-item-`+e},toggleButtonId:o||n+`-toggle-button`,inputId:s||n+`-input`}).current}function IH(e,t,n,r){var i,a;if(e===void 0){if(t===void 0)throw Error(r);i=n[t],a=t}else a=t===void 0?n.indexOf(e):t,i=e;return[i,a]}function LH(e){return e?String(e):``}function RH(e){return/^\S{1}$/.test(e)}function zH(e){return``+e.slice(0,1).toUpperCase()+e.slice(1)}function BH(e){var t=(0,I.useRef)(e);return t.current=e,t}function VH(e,t,n){var r=(0,I.useRef)(),i=(0,I.useRef)(),a=(0,I.useReducer)((0,I.useCallback)(function(t,n){i.current=n,t=vH(t,n.props);var r=e(t,n);return n.props.stateReducer(t,z({},n,{changes:r}))},[e]),t),o=a[0],s=a[1],c=BH(n),l=(0,I.useCallback)(function(e){return s(z({props:c.current},e))},[c]),u=i.current;return(0,I.useEffect)(function(){u&&r.current&&r.current!==o&&kH(u,vH(r.current,u.props),o),r.current=o},[o,n,u]),[o,l]}function HH(e,t,n){var r=VH(e,t,n),i=r[0],a=r[1];return[vH(i,n),a]}var UH={itemToString:LH,stateReducer:jH,getA11ySelectionMessage:MH,scrollIntoView:dH,environment:typeof window>`u`?{}:window};function WH(e,t,n){n===void 0&&(n=OH);var r=e[`default`+zH(t)];return r===void 0?n[t]:r}function GH(e,t,n){n===void 0&&(n=OH);var r=e[t];if(r!==void 0)return r;var i=e[`initial`+zH(t)];return i===void 0?WH(e,t,n):i}function KH(e){var t=GH(e,`selectedItem`),n=GH(e,`isOpen`),r=GH(e,`highlightedIndex`),i=GH(e,`inputValue`);return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}function qH(e,t,n){var r=e.items,i=e.initialHighlightedIndex,a=e.defaultHighlightedIndex,o=t.selectedItem,s=t.highlightedIndex;return r.length===0?-1:i!==void 0&&s===i?i:a===void 0?o?r.indexOf(o):n===0?-1:n<0?r.length-1:0:a}function JH(e,t,n,r){var i=(0,I.useRef)({isMouseDown:!1,isTouchMove:!1});return(0,I.useEffect)(function(){if(n?.addEventListener!=null){var a=function(){i.current.isMouseDown=!0},o=function(a){i.current.isMouseDown=!1,e&&!CH(a.target,t.map(function(e){return e.current}),n)&&r()},s=function(){i.current.isTouchMove=!1},c=function(){i.current.isTouchMove=!0},l=function(a){e&&!i.current.isTouchMove&&!CH(a.target,t.map(function(e){return e.current}),n,!1)&&r()};return n.addEventListener(`mousedown`,a),n.addEventListener(`mouseup`,o),n.addEventListener(`touchstart`,s),n.addEventListener(`touchmove`,c),n.addEventListener(`touchend`,l),function(){n.removeEventListener(`mousedown`,a),n.removeEventListener(`mouseup`,o),n.removeEventListener(`touchstart`,s),n.removeEventListener(`touchmove`,c),n.removeEventListener(`touchend`,l)}}},[e,n]),i}var YH=function(){return uH};function XH(e,t,n){var r=n.isInitialMount,i=n.highlightedIndex,a=n.items,o=n.environment,s=Sc(n,DH);(0,I.useEffect)(function(){r||NH(function(){return e(z({highlightedIndex:i,highlightedItem:a[i],resultCount:a.length},s))},o.document)},t)}function ZH(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,s=(0,I.useRef)(!0);return PH(function(){t<0||!n||!Object.keys(r.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var QH=uH;function $H(e,t,n){return n===void 0&&(n=!0),z({isOpen:!1,highlightedIndex:-1},e.items?.length&&t>=0&&z({selectedItem:e.items[t],isOpen:WH(e,`isOpen`),highlightedIndex:WH(e,`highlightedIndex`)},n&&{inputValue:e.itemToString(e.items[t])}))}function eU(e,t,n){var r=t.type,i=t.props,a;switch(r){case n.ItemMouseMove:a={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:a={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:qH(i,e,0)};break;case n.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:qH(i,e,0)};break;case n.FunctionCloseMenu:a={isOpen:!1};break;case n.FunctionSetHighlightedIndex:a={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:a={inputValue:t.inputValue};break;case n.FunctionReset:a={highlightedIndex:WH(i,`highlightedIndex`),isOpen:WH(i,`isOpen`),selectedItem:WH(i,`selectedItem`),inputValue:WH(i,`inputValue`)};break;default:throw Error(`Reducer called without proper action type.`)}return z({},e,a)}function tU(e){for(var t=e.keysSoFar,n=e.highlightedIndex,r=e.items,i=e.itemToString,a=e.getItemNodeFromIndex,o=t.toLowerCase(),s=0;s<r.length;s++){var c=(s+n+ +(t.length<2))%r.length,l=r[c];if(l!==void 0&&i(l).toLowerCase().startsWith(o)&&!a(c)?.hasAttribute(`disabled`))return c}return n}X.default.array.isRequired,X.default.func,X.default.func,X.default.func,X.default.number,X.default.number,X.default.number,X.default.bool,X.default.bool,X.default.bool,X.default.any,X.default.any,X.default.any,X.default.string,X.default.string,X.default.string,X.default.func,X.default.string,X.default.func,X.default.func,X.default.func,X.default.func,X.default.func,X.default.shape({addEventListener:X.default.func,removeEventListener:X.default.func,document:X.default.shape({getElementById:X.default.func,activeElement:X.default.any,body:X.default.any})});function nU(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n===r?``:`${n} result${n===1?` is`:`s are`} available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.`:`No results are available.`:``}var rU=VI(VI({},UH),{getA11yStatusMessage:nU}),iU=uH,aU=0,oU=1,sU=2,cU=3,lU=4,uU=5,dU=6,fU=7,pU=8,mU=9,hU=10,gU=11,_U=12,vU=13,yU=14,bU=15,xU=16,SU=17,CU=18,wU=19,TU=20,EU=21,DU=Object.freeze({__proto__:null,ToggleButtonClick:aU,ToggleButtonKeyDownArrowDown:oU,ToggleButtonKeyDownArrowUp:sU,ToggleButtonKeyDownCharacter:cU,ToggleButtonKeyDownEscape:lU,ToggleButtonKeyDownHome:uU,ToggleButtonKeyDownEnd:dU,ToggleButtonKeyDownEnter:fU,ToggleButtonKeyDownSpaceButton:pU,ToggleButtonKeyDownPageUp:mU,ToggleButtonKeyDownPageDown:hU,ToggleButtonBlur:gU,MenuMouseLeave:_U,ItemMouseMove:vU,ItemClick:yU,FunctionToggleMenu:bU,FunctionOpenMenu:xU,FunctionCloseMenu:SU,FunctionSetHighlightedIndex:CU,FunctionSelectItem:wU,FunctionSetInputValue:TU,FunctionReset:EU});function OU(e,t){var n=t.type,r=t.props,i=t.altKey,a;switch(n){case yU:a={isOpen:WH(r,`isOpen`),highlightedIndex:WH(r,`highlightedIndex`),selectedItem:r.items[t.index]};break;case cU:var o=t.key,s=``+e.inputValue+o;a={inputValue:s,highlightedIndex:tU({keysSoFar:s,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.indexOf(e.selectedItem):e.highlightedIndex,items:r.items,itemToString:r.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex}),isOpen:!0};break;case oU:a={highlightedIndex:e.isOpen?xH(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):i&&e.selectedItem==null?-1:qH(r,e,1),isOpen:!0};break;case sU:a=e.isOpen&&i?$H(r,e.highlightedIndex,!1):{highlightedIndex:e.isOpen?xH(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):qH(r,e,-1),isOpen:!0};break;case fU:case pU:a=$H(r,e.highlightedIndex,!1);break;case uU:a={highlightedIndex:SH(1,0,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case dU:a={highlightedIndex:SH(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case mU:a={highlightedIndex:xH(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case hU:a={highlightedIndex:xH(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case lU:a={isOpen:!1,highlightedIndex:-1};break;case gU:a=z({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items?.length&&{selectedItem:r.items[e.highlightedIndex]});break;case wU:a={selectedItem:t.selectedItem};break;default:return eU(e,t,DU)}return z({},e,a)}var kU=[`onMouseLeave`,`refKey`,`onKeyDown`,`onBlur`,`ref`],AU=[`onBlur`,`onClick`,`onPress`,`onKeyDown`,`refKey`,`ref`],jU=[`item`,`index`,`onMouseMove`,`onClick`,`onPress`,`refKey`,`ref`,`disabled`];MU.stateChangeTypes=DU;function MU(e){e===void 0&&(e={}),iU(e,MU);var t=z({},rU,e),n=t.items,r=t.scrollIntoView,i=t.environment,a=t.itemToString,o=t.getA11ySelectionMessage,s=t.getA11yStatusMessage,c=HH(OU,KH(t),t),l=c[0],u=c[1],d=l.isOpen,f=l.highlightedIndex,p=l.selectedItem,m=l.inputValue,h=(0,I.useRef)(null),g=(0,I.useRef)(null),_=(0,I.useRef)({}),v=(0,I.useRef)(null),y=FH(t),b=(0,I.useRef)(),x=(0,I.useRef)(!0),S=BH({state:l,props:t}),C=(0,I.useCallback)(function(e){return _.current[y.getItemId(e)]},[y]);XH(s,[d,f,m,n],z({isInitialMount:x.current,previousResultCount:b.current,items:n,environment:i,itemToString:a},l)),XH(o,[p],z({isInitialMount:x.current,previousResultCount:b.current,items:n,environment:i,itemToString:a},l));var w=ZH({menuElement:g.current,highlightedIndex:f,isOpen:d,itemRefs:_,scrollIntoView:r,getItemNodeFromIndex:C});(0,I.useEffect)(function(){return v.current=pH(function(e){e({type:TU,inputValue:``})},500),function(){v.current.cancel()}},[]),(0,I.useEffect)(function(){m&&v.current(u)},[u,m]),QH({isInitialMount:x.current,props:t,state:l}),(0,I.useEffect)(function(){x.current||(b.current=n.length)});var T=JH(d,[g,h],i,function(){u({type:gU})}),E=YH(`getMenuProps`,`getToggleButtonProps`);(0,I.useEffect)(function(){return x.current=!1,function(){x.current=!0}},[]),(0,I.useEffect)(function(){d||(_.current={})},[d]);var D=(0,I.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),u({type:oU,getItemNodeFromIndex:C,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),u({type:sU,getItemNodeFromIndex:C,altKey:e.altKey})},Home:function(e){e.preventDefault(),u({type:uU,getItemNodeFromIndex:C})},End:function(e){e.preventDefault(),u({type:dU,getItemNodeFromIndex:C})},Escape:function(){S.current.state.isOpen&&u({type:lU})},Enter:function(e){e.preventDefault(),u({type:S.current.state.isOpen?fU:aU})},PageUp:function(e){S.current.state.isOpen&&(e.preventDefault(),u({type:mU,getItemNodeFromIndex:C}))},PageDown:function(e){S.current.state.isOpen&&(e.preventDefault(),u({type:hU,getItemNodeFromIndex:C}))}," ":function(e){e.preventDefault();var t=S.current.state;if(!t.isOpen){u({type:aU});return}t.inputValue?u({type:cU,key:` `,getItemNodeFromIndex:C}):u({type:pU})}}},[u,C,S]),O=(0,I.useCallback)(function(){u({type:bU})},[u]),k=(0,I.useCallback)(function(){u({type:SU})},[u]),A=(0,I.useCallback)(function(){u({type:xU})},[u]),j=(0,I.useCallback)(function(e){u({type:CU,highlightedIndex:e})},[u]),M=(0,I.useCallback)(function(e){u({type:wU,selectedItem:e})},[u]),N=(0,I.useCallback)(function(){u({type:EU})},[u]),P=(0,I.useCallback)(function(e){u({type:TU,inputValue:e})},[u]),F=(0,I.useCallback)(function(e){return z({id:y.labelId,htmlFor:y.toggleButtonId},e)},[y]),ee=(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a;r.onKeyDown,r.onBlur;var s=r.ref,c=Sc(r,kU),l=(t===void 0?{}:t).suppressRefError;return E(`getMenuProps`,l===void 0?!1:l,o,g),z((n={},n[o]=hH(s,function(e){g.current=e}),n.id=y.menuId,n.role=`listbox`,n[`aria-labelledby`]=c&&c[`aria-label`]?void 0:``+y.labelId,n.onMouseLeave=mH(i,function(){u({type:_U})}),n),c)},[u,E,y]);return{getToggleButtonProps:(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onBlur,a=r.onClick;r.onPress;var o=r.onKeyDown,s=r.refKey,c=s===void 0?`ref`:s,l=r.ref,d=Sc(r,AU),f=(t===void 0?{}:t).suppressRefError,p=f===void 0?!1:f,m=S.current.state,g=function(){u({type:aU})},_=function(){m.isOpen&&!T.current.isMouseDown&&u({type:gU})},v=function(e){var t=bH(e);t&&D[t]?D[t](e):RH(t)&&u({type:cU,key:t,getItemNodeFromIndex:C})},b=z((n={},n[c]=hH(l,function(e){h.current=e}),n[`aria-activedescendant`]=m.isOpen&&m.highlightedIndex>-1?y.getItemId(m.highlightedIndex):``,n[`aria-controls`]=y.menuId,n[`aria-expanded`]=S.current.state.isOpen,n[`aria-haspopup`]=`listbox`,n[`aria-labelledby`]=d&&d[`aria-label`]?void 0:``+y.labelId,n.id=y.toggleButtonId,n.role=`combobox`,n.tabIndex=0,n.onBlur=mH(i,_),n),d);return d.disabled||(b.onClick=mH(a,g),b.onKeyDown=mH(o,v)),E(`getToggleButtonProps`,p,c,h),b},[S,y,E,u,T,D,C]),getLabelProps:F,getMenuProps:ee,getItemProps:(0,I.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.item,i=n.index,a=n.onMouseMove,o=n.onClick;n.onPress;var s=n.refKey,c=s===void 0?`ref`:s,l=n.ref,d=n.disabled,f=Sc(n,jU),m=S.current,h=m.state,g=m.props,v=IH(r,i,g.items,`Pass either item or index to getItemProps!`),b=v[0],x=v[1],C=function(){x!==h.highlightedIndex&&(w.current=!1,u({type:vU,index:x,disabled:d}))},T=function(){u({type:yU,index:x})},E=z((t={disabled:d,role:`option`,"aria-selected":``+(b===p),id:y.getItemId(x)},t[c]=hH(l,function(e){e&&(_.current[y.getItemId(x)]=e)}),t),f);return d||(E.onClick=mH(o,T)),E.onMouseMove=mH(a,C),E},[S,p,y,w,u]),toggleMenu:O,openMenu:A,closeMenu:k,setHighlightedIndex:j,selectItem:M,reset:N,setInputValue:P,highlightedIndex:f,isOpen:d,selectedItem:p,inputValue:m}}var NU=0,PU=1,FU=2,IU=3,LU=4,RU=5,zU=6,BU=7,VU=8,HU=9,UU=10,WU=11,GU=12,KU=13,qU=14,JU=15,YU=16,XU=17,ZU=18,QU=19,$U=20,eW=21,tW=22,nW=Object.freeze({__proto__:null,InputKeyDownArrowDown:NU,InputKeyDownArrowUp:PU,InputKeyDownEscape:FU,InputKeyDownHome:IU,InputKeyDownEnd:LU,InputKeyDownPageUp:RU,InputKeyDownPageDown:zU,InputKeyDownEnter:BU,InputChange:VU,InputBlur:HU,InputFocus:UU,MenuMouseLeave:WU,ItemMouseMove:GU,ItemClick:KU,ToggleButtonClick:qU,FunctionToggleMenu:JU,FunctionOpenMenu:YU,FunctionCloseMenu:XU,FunctionSetHighlightedIndex:ZU,FunctionSelectItem:QU,FunctionSetInputValue:$U,FunctionReset:eW,ControlledPropUpdatedSelectedItem:tW});function rW(e){var t=KH(e),n=t.selectedItem,r=t.inputValue;return r===``&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),z({},t,{inputValue:r})}X.default.array.isRequired,X.default.func,X.default.func,X.default.func,X.default.func,X.default.number,X.default.number,X.default.number,X.default.bool,X.default.bool,X.default.bool,X.default.any,X.default.any,X.default.any,X.default.string,X.default.string,X.default.string,X.default.string,X.default.string,X.default.string,X.default.func,X.default.string,X.default.string,X.default.func,X.default.func,X.default.func,X.default.func,X.default.func,X.default.func,X.default.shape({addEventListener:X.default.func,removeEventListener:X.default.func,document:X.default.shape({getElementById:X.default.func,activeElement:X.default.any,body:X.default.any})});function iW(e,t,n){var r=(0,I.useRef)(),i=VH(e,t,n),a=i[0],o=i[1];return(0,I.useEffect)(function(){yH(n,`selectedItem`)&&(n.selectedItemChanged(r.current,n.selectedItem)&&o({type:tW,inputValue:n.itemToString(n.selectedItem)}),r.current=a.selectedItem===r.current?n.selectedItem:a.selectedItem)},[a.selectedItem,n.selectedItem]),[vH(a,n),o]}var aW=uH,oW=z({},UH,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:_H});function sW(e,t){var n=t.type,r=t.props,i=t.altKey,a;switch(n){case KU:a={isOpen:WH(r,`isOpen`),highlightedIndex:WH(r,`highlightedIndex`),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case NU:a=e.isOpen?{highlightedIndex:xH(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:i&&e.selectedItem==null?-1:qH(r,e,1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case PU:a=e.isOpen?i?$H(r,e.highlightedIndex):{highlightedIndex:xH(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:qH(r,e,-1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case BU:a=$H(r,e.highlightedIndex);break;case FU:a=z({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:``});break;case RU:a={highlightedIndex:xH(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case zU:a={highlightedIndex:xH(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case IU:a={highlightedIndex:SH(1,0,r.items.length,t.getItemNodeFromIndex,!1)};break;case LU:a={highlightedIndex:SH(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1)};break;case HU:a=z({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items?.length&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case VU:a={isOpen:!0,highlightedIndex:WH(r,`highlightedIndex`),inputValue:t.inputValue};break;case UU:a={isOpen:!0,highlightedIndex:qH(r,e,0)};break;case QU:a={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case tW:a={inputValue:t.inputValue};break;default:return eU(e,t,nW)}return z({},e,a)}var cW=[`onMouseLeave`,`refKey`,`ref`],lW=[`item`,`index`,`refKey`,`ref`,`onMouseMove`,`onMouseDown`,`onClick`,`onPress`,`disabled`],uW=[`onClick`,`onPress`,`refKey`,`ref`],dW=[`onKeyDown`,`onChange`,`onInput`,`onFocus`,`onBlur`,`onChangeText`,`refKey`,`ref`];fW.stateChangeTypes=nW;function fW(e){e===void 0&&(e={}),aW(e,fW);var t=z({},oW,e),n=t.initialIsOpen,r=t.defaultIsOpen,i=t.items,a=t.scrollIntoView,o=t.environment,s=t.getA11yStatusMessage,c=t.getA11ySelectionMessage,l=t.itemToString,u=iW(sW,rW(t),t),d=u[0],f=u[1],p=d.isOpen,m=d.highlightedIndex,h=d.selectedItem,g=d.inputValue,_=(0,I.useRef)(null),v=(0,I.useRef)({}),y=(0,I.useRef)(null),b=(0,I.useRef)(null),x=(0,I.useRef)(!0),S=FH(t),C=(0,I.useRef)(),w=BH({state:d,props:t}),T=(0,I.useCallback)(function(e){return v.current[S.getItemId(e)]},[S]);XH(s,[p,m,g,i],z({isInitialMount:x.current,previousResultCount:C.current,items:i,environment:o,itemToString:l},d)),XH(c,[h],z({isInitialMount:x.current,previousResultCount:C.current,items:i,environment:o,itemToString:l},d));var E=ZH({menuElement:_.current,highlightedIndex:m,isOpen:p,itemRefs:v,scrollIntoView:a,getItemNodeFromIndex:T});QH({isInitialMount:x.current,props:t,state:d}),(0,I.useEffect)(function(){(n||r||p)&&y.current&&y.current.focus()},[]),(0,I.useEffect)(function(){x.current||(C.current=i.length)});var D=JH(p,[y,_,b],o,function(){f({type:HU,selectItem:!1})}),O=YH(`getInputProps`,`getMenuProps`);(0,I.useEffect)(function(){return x.current=!1,function(){x.current=!0}},[]),(0,I.useEffect)(function(){if(!p)v.current={};else if(o.document?.activeElement!==y.current){var e;y==null||(e=y.current)==null||e.focus()}},[p,o]);var k=(0,I.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),f({type:NU,altKey:e.altKey,getItemNodeFromIndex:T})},ArrowUp:function(e){e.preventDefault(),f({type:PU,altKey:e.altKey,getItemNodeFromIndex:T})},Home:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:IU,getItemNodeFromIndex:T}))},End:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:LU,getItemNodeFromIndex:T}))},Escape:function(e){var t=w.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),f({type:FU}))},Enter:function(e){!w.current.state.isOpen||e.which===229||(e.preventDefault(),f({type:BU,getItemNodeFromIndex:T}))},PageUp:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:RU,getItemNodeFromIndex:T}))},PageDown:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:zU,getItemNodeFromIndex:T}))}}},[f,w,T]),A=(0,I.useCallback)(function(e){return z({id:S.labelId,htmlFor:S.inputId},e)},[S]),j=(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,s=r.ref,c=Sc(r,cW),l=(t===void 0?{}:t).suppressRefError;return O(`getMenuProps`,l===void 0?!1:l,o,_),z((n={},n[o]=hH(s,function(e){_.current=e}),n.id=S.menuId,n.role=`listbox`,n[`aria-labelledby`]=c&&c[`aria-label`]?void 0:``+S.labelId,n.onMouseLeave=mH(i,function(){f({type:WU})}),n),c)},[f,O,S]),M=(0,I.useCallback)(function(e){var t,n,r=e===void 0?{}:e,i=r.item,a=r.index,o=r.refKey,s=o===void 0?`ref`:o,c=r.ref,l=r.onMouseMove,u=r.onMouseDown,d=r.onClick;r.onPress;var p=r.disabled,m=Sc(r,lW),h=w.current,g=h.props,_=h.state,y=IH(i,a,g.items,`Pass either item or index to getItemProps!`)[1],b=`onClick`,x=d;return z((t={},t[s]=hH(c,function(e){e&&(v.current[S.getItemId(y)]=e)}),t.disabled=p,t.role=`option`,t[`aria-selected`]=``+(y===_.highlightedIndex),t.id=S.getItemId(y),t),!p&&(n={},n[b]=mH(x,function(){f({type:KU,index:y})}),n),{onMouseMove:mH(l,function(){y!==_.highlightedIndex&&(E.current=!1,f({type:GU,index:y,disabled:p}))}),onMouseDown:mH(u,function(e){return e.preventDefault()})},m)},[f,w,E,S]),N=(0,I.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.onClick;n.onPress;var i=n.refKey,a=i===void 0?`ref`:i,o=n.ref,s=Sc(n,uW),c=w.current.state;return z((t={},t[a]=hH(o,function(e){b.current=e}),t[`aria-controls`]=S.menuId,t[`aria-expanded`]=c.isOpen,t.id=S.toggleButtonId,t.tabIndex=-1,t),!s.disabled&&z({},{onClick:mH(r,function(){f({type:qU})})}),s)},[f,w,S]),P=(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onKeyDown,a=r.onChange,s=r.onInput,c=r.onFocus,l=r.onBlur;r.onChangeText;var u=r.refKey,d=u===void 0?`ref`:u,p=r.ref,m=Sc(r,dW),h=(t===void 0?{}:t).suppressRefError;O(`getInputProps`,h===void 0?!1:h,d,y);var g=w.current.state,_=function(e){var t=bH(e);t&&k[t]&&k[t](e)},v=function(e){f({type:VU,inputValue:e.target.value})},b=function(e){g.isOpen&&!D.current.isMouseDown&&f({type:HU,selectItem:!(e.relatedTarget===null&&o.document.activeElement!==o.document.body)})},x=function(){g.isOpen||f({type:UU})},C=`onChange`,T={};if(!m.disabled){var E;T=(E={},E[C]=mH(a,s,v),E.onKeyDown=mH(i,_),E.onBlur=mH(l,b),E.onFocus=mH(c,x),E)}return z((n={},n[d]=hH(p,function(e){y.current=e}),n[`aria-activedescendant`]=g.isOpen&&g.highlightedIndex>-1?S.getItemId(g.highlightedIndex):``,n[`aria-autocomplete`]=`list`,n[`aria-controls`]=S.menuId,n[`aria-expanded`]=g.isOpen,n[`aria-labelledby`]=m&&m[`aria-label`]?void 0:``+S.labelId,n.autoComplete=`off`,n.id=S.inputId,n.role=`combobox`,n.value=g.inputValue,n),T,m)},[O,w,S,k,f,D,o]),F=(0,I.useCallback)(function(){f({type:JU})},[f]),ee=(0,I.useCallback)(function(){f({type:XU})},[f]),te=(0,I.useCallback)(function(){f({type:YU})},[f]),ne=(0,I.useCallback)(function(e){f({type:ZU,highlightedIndex:e})},[f]),re=(0,I.useCallback)(function(e){f({type:QU,selectedItem:e})},[f]);return{getItemProps:M,getLabelProps:A,getMenuProps:j,getInputProps:P,getToggleButtonProps:N,toggleMenu:F,openMenu:te,closeMenu:ee,setHighlightedIndex:ne,setInputValue:(0,I.useCallback)(function(e){f({type:$U,inputValue:e})},[f]),selectItem:re,reset:(0,I.useCallback)(function(){f({type:eW})},[f]),highlightedIndex:m,isOpen:p,selectedItem:h,inputValue:g}}var pW={activeIndex:-1,selectedItems:[]};function mW(e,t){return GH(e,t,pW)}function hW(e,t){return WH(e,t,pW)}function gW(e){return{activeIndex:mW(e,`activeIndex`),selectedItems:mW(e,`selectedItems`)}}function _W(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==``&&(t.selectionStart!==0||t.selectionEnd!==0))}function vW(e){var t=e.removedSelectedItem,n=e.itemToString;return n(t)+` has been removed.`}X.default.array,X.default.array,X.default.array,X.default.func,X.default.func,X.default.func,X.default.number,X.default.number,X.default.number,X.default.func,X.default.func,X.default.string,X.default.string,X.default.shape({addEventListener:X.default.func,removeEventListener:X.default.func,document:X.default.shape({getElementById:X.default.func,activeElement:X.default.any,body:X.default.any})});var yW={itemToString:UH.itemToString,stateReducer:UH.stateReducer,environment:UH.environment,getA11yRemovalMessage:vW,keyNavigationNext:`ArrowRight`,keyNavigationPrevious:`ArrowLeft`},bW=uH,xW=0,SW=1,CW=2,wW=3,TW=4,EW=5,DW=6,OW=7,kW=8,AW=9,jW=10,MW=11,NW=12,PW=Object.freeze({__proto__:null,SelectedItemClick:xW,SelectedItemKeyDownDelete:SW,SelectedItemKeyDownBackspace:CW,SelectedItemKeyDownNavigationNext:wW,SelectedItemKeyDownNavigationPrevious:TW,DropdownKeyDownNavigationPrevious:EW,DropdownKeyDownBackspace:DW,DropdownClick:OW,FunctionAddSelectedItem:kW,FunctionRemoveSelectedItem:AW,FunctionSetSelectedItems:jW,FunctionSetActiveIndex:MW,FunctionReset:NW});function FW(e,t){var n=t.type,r=t.index,i=t.props,a=t.selectedItem,o=e.activeIndex,s=e.selectedItems,c;switch(n){case xW:c={activeIndex:r};break;case TW:c={activeIndex:o-1<0?0:o-1};break;case wW:c={activeIndex:o+1>=s.length?-1:o+1};break;case CW:case SW:if(o<0)break;var l=o;s.length===1?l=-1:o===s.length-1&&(l=s.length-2),c=z({selectedItems:[].concat(s.slice(0,o),s.slice(o+1))},{activeIndex:l});break;case EW:c={activeIndex:s.length-1};break;case DW:c={selectedItems:s.slice(0,s.length-1)};break;case kW:c={selectedItems:[].concat(s,[a])};break;case OW:c={activeIndex:-1};break;case AW:var u=o,d=s.indexOf(a);if(d<0)break;s.length===1?u=-1:d===s.length-1&&(u=s.length-2),c={selectedItems:[].concat(s.slice(0,d),s.slice(d+1)),activeIndex:u};break;case jW:c={selectedItems:t.selectedItems};break;case MW:c={activeIndex:t.activeIndex};break;case NW:c={activeIndex:hW(i,`activeIndex`),selectedItems:hW(i,`selectedItems`)};break;default:throw Error(`Reducer called without proper action type.`)}return z({},e,c)}var IW=[`refKey`,`ref`,`onClick`,`onKeyDown`,`selectedItem`,`index`],LW=[`refKey`,`ref`,`onKeyDown`,`onClick`,`preventKeyAction`];RW.stateChangeTypes=PW;function RW(e){e===void 0&&(e={}),bW(e,RW);var t=z({},yW,e),n=t.getA11yRemovalMessage,r=t.itemToString,i=t.environment,a=t.keyNavigationNext,o=t.keyNavigationPrevious,s=HH(FW,gW(t),t),c=s[0],l=s[1],u=c.activeIndex,d=c.selectedItems,f=(0,I.useRef)(!0),p=(0,I.useRef)(null),m=(0,I.useRef)(d),h=(0,I.useRef)();h.current=[];var g=BH({state:c,props:t});(0,I.useEffect)(function(){if(!f.current){if(d.length<m.current.length){var e=m.current.find(function(e){return d.indexOf(e)<0});TH(n({itemToString:r,resultCount:d.length,removedSelectedItem:e,activeIndex:u,activeSelectedItem:d[u]}),i.document)}m.current=d}},[d.length]),(0,I.useEffect)(function(){f.current||(u===-1&&p.current?p.current.focus():h.current[u]&&h.current[u].focus())},[u]),QH({isInitialMount:f.current,props:t,state:c});var _=YH(`getDropdownProps`);(0,I.useEffect)(function(){return f.current=!1,function(){f.current=!0}},[]);var v=(0,I.useMemo)(function(){var e;return e={},e[o]=function(){l({type:TW})},e[a]=function(){l({type:wW})},e.Delete=function(){l({type:SW})},e.Backspace=function(){l({type:CW})},e},[l,a,o]),y=(0,I.useMemo)(function(){var e;return e={},e[o]=function(e){_W(e)&&l({type:EW})},e.Backspace=function(e){_W(e)&&l({type:DW})},e},[l,o]);return{getSelectedItemProps:(0,I.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.refKey,i=r===void 0?`ref`:r,a=n.ref,o=n.onClick,s=n.onKeyDown,c=n.selectedItem,u=n.index,d=Sc(n,IW),f=g.current.state,p=IH(c,u,f.selectedItems,`Pass either item or index to getSelectedItemProps!`)[1],m=p>-1&&p===f.activeIndex;return z((t={},t[i]=hH(a,function(e){e&&h.current.push(e)}),t.tabIndex=m?0:-1,t.onClick=mH(o,function(){l({type:xW,index:p})}),t.onKeyDown=mH(s,function(e){var t=bH(e);t&&v[t]&&v[t](e)}),t),d)},[l,g,v]),getDropdownProps:(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.refKey,a=i===void 0?`ref`:i,o=r.ref,s=r.onKeyDown,c=r.onClick,u=r.preventKeyAction,d=u===void 0?!1:u,f=Sc(r,LW),m=(t===void 0?{}:t).suppressRefError;return _(`getDropdownProps`,m===void 0?!1:m,a,p),z((n={},n[a]=hH(o,function(e){e&&(p.current=e)}),n),!d&&{onKeyDown:mH(s,function(e){var t=bH(e);t&&y[t]&&y[t](e)}),onClick:mH(c,function(){l({type:OW})})},f)},[l,y,_]),addSelectedItem:(0,I.useCallback)(function(e){l({type:kW,selectedItem:e})},[l]),removeSelectedItem:(0,I.useCallback)(function(e){l({type:AW,selectedItem:e})},[l]),setSelectedItems:(0,I.useCallback)(function(e){l({type:jW,selectedItems:e})},[l]),setActiveIndex:(0,I.useCallback)(function(e){l({type:MW,activeIndex:e})},[l]),reset:(0,I.useCallback)(function(){l({type:NW})},[l]),selectedItems:d,activeIndex:u}}var zW=20,BW=e=>e.suggestions.length>0?I.createElement(VW,{...e}):I.createElement(`input`,{className:J.textInput,size:40,autoFocus:!0,...e.register(e.inputName)}),VW=({autofocus:e,suggestions:t,control:n,inputName:r,placeholder:i,initialInputValue:a,setValue:o})=>{let[s,c]=I.useState(t.slice(0,zW)),l=Hd(uk),u=t.length>0,{isOpen:d,getToggleButtonProps:f,getMenuProps:p,getInputProps:m,highlightedIndex:h,getItemProps:g,selectedItem:_}=fW({initialInputValue:a,onInputValueChange({inputValue:e=``}){o(r,e),e=e.toLowerCase()||``;let n=[];for(let r of t)if(r.toLowerCase().includes(e)&&(n.push(r),n.length>=zW))break;c(n)},items:s,itemToString(e){return e??``}}),v=d&&s.length>0;return I.createElement(`div`,{className:J.downshiftAutocompleteContainer},I.createElement(`div`,{"data-visible-dropdown":v,className:J.downshiftInputWrapper},I.createElement(Yte,{name:r,control:n,render:({field:t})=>{let n=m();return I.createElement(`input`,{...n,name:t.name,placeholder:i,className:J.downshiftInput,size:30,"data-editor-dialog":!0,autoFocus:e})}}),u&&I.createElement(`button`,{"aria-label":`toggle menu`,type:`button`,...f()},l(`arrow_drop_down`))),I.createElement(`div`,{className:J.downshiftAutocompleteContainer},I.createElement(`ul`,{...p(),"data-visible":v},s.map((e,t)=>I.createElement(`li`,{"data-selected":_===e,"data-highlighted":h===t,key:`${e}${t}`,...g({item:e,index:t})},e)))))};function HW(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}var UW={testNode:`blockquote`,visitNode({actions:e}){e.addAndStepInto(lx())}},WW={testLexicalNode:ux,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`blockquote`)}},GW=Zd({init(e){e.pubIn({[Pk]:`quote`,[XO]:UW,[YO]:cx,[$O]:WW})}});function KW(){let e=Xd;return{publish:()=>{e()},subscribe:t=>{e=t}}}var qW=Object.defineProperty,JW=(e,t,n)=>t in e?qW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,YW=(e,t,n)=>(JW(e,typeof t==`symbol`?t:t+``,n),n),XW=class e extends Wg{constructor(e,t,n,r){super(r),YW(this,`__code`),YW(this,`__meta`),YW(this,`__language`),YW(this,`__focusEmitter`,KW()),YW(this,`setCode`,e=>{e!==this.__code&&(this.getWritable().__code=e)}),YW(this,`setMeta`,e=>{e!==this.__meta&&(this.getWritable().__meta=e)}),YW(this,`setLanguage`,e=>{e!==this.__language&&(this.getWritable().__language=e)}),YW(this,`select`,()=>{this.__focusEmitter.publish()}),this.__code=e,this.__meta=n,this.__language=t}static getType(){return`codeblock`}static clone(t){return new e(t.__code,t.__language,t.__meta,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__code=e.__code,this.__meta=e.__meta,this.__language=e.__language,this.__focusEmitter=KW()}static importJSON(e){let{code:t,meta:n,language:r}=e;return tG({code:t,language:r,meta:n})}static importDOM(){return{pre:()=>({conversion:rG,priority:3})}}exportJSON(){return{code:this.getCode(),language:this.getLanguage(),meta:this.getMeta(),type:`codeblock`,version:1}}createDOM(e,t){return document.createElement(`div`)}updateDOM(){return!1}getCode(){return this.__code}getMeta(){return this.__meta}getLanguage(){return this.__language}decorate(e){return I.createElement(eG,{parentEditor:e,code:this.getCode(),meta:this.getMeta(),language:this.getLanguage(),codeBlockNode:this,nodeKey:this.getKey(),focusEmitter:this.__focusEmitter})}isInline(){return!1}},ZW=I.createContext(null),QW=({parentEditor:e,lexicalNode:t,children:n})=>{let r=I.useMemo(()=>({lexicalNode:t,parentEditor:e,setCode:n=>{e.update(()=>{t.setCode(n),setTimeout(()=>{e.dispatchCommand(_O,void 0)},0)})},setLanguage:n=>{e.update(()=>{t.setLanguage(n)})},setMeta:n=>{e.update(()=>{t.setMeta(n)})}}),[t,e]);return I.createElement(ZW.Provider,{value:r},n)};function $W(){let e=I.useContext(ZW);if(!e)throw Error(`useCodeBlockEditor must be used within a CodeBlockEditor`);return e}var eG=e=>{let t=Hd(KO),n=Hd(oG),r=t.sort((e,t)=>t.priority-e.priority).find(t=>t.match(e.language||``,e.meta||``));if(r??=t.find(t=>t.match(n||``,e.meta||``)),!r)throw Error(`No CodeBlockEditor registered for language=${e.language} meta=${e.meta}`);let i=r.Editor,{codeBlockNode:a,parentEditor:o,...s}=e;return I.createElement(QW,{parentEditor:e.parentEditor,lexicalNode:e.codeBlockNode},I.createElement(i,{...s}))};function tG(e){let{code:t=``,language:n=``,meta:r=``}=e;return new XW(t,n,r)}function nG(e){return e instanceof XW}function rG(e){let t=e,n=t.textContent,r=e.getAttribute(`class`)??``,i=e.getAttribute(`data-language`)??``,a=/language-(\w+)/.exec(r);return{node:tG({code:n,language:a?a[1]:i,meta:t.getAttribute(`data-meta`)??``})}}var iG={testLexicalNode:nG,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto(`code`,{value:e.getCode(),lang:e.getLanguage(),meta:e.getMeta()})}},aG={testNode:(e,{codeBlockEditorDescriptors:t})=>e.type===`code`?t.find(t=>t.match(e.lang,e.meta))!==void 0:!1,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(tG({code:e.value,language:e.lang??``,meta:e.meta??``}))}},oG=B(``),sG=Rd(e=>{e.link(e.pipe(sG,Kd(oG),Gd(([e,t])=>()=>tG({language:t,...e}))),Ak)}),cG=dk(KO),lG=Zd({update(e,t){e.pub(oG,t?.defaultCodeBlockLanguage??``)},init(e,t){e.pubIn({[Pk]:`codeblock`,[KO]:t?.codeBlockEditorDescriptors??[],[XO]:aG,[YO]:XW,[$O]:iG})}}),uG=`modulepreload`,dG=function(e){return`/apps/chat/`+e},fG={},Z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=dG(t,n),t in fG)return;fG[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:uG,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},pG=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=se(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(bG(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function mG(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function hG(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=mG(t)+mG(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function gG(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:hG(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function _G(e,t){return n=>{for(let t=se(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}var vG=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function yG(e){return e.selection.main.from}function bG(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var xG=_e.define();function SG(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:k.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var CG=new WeakMap;function wG(e){if(!Array.isArray(e))return e;let t=CG.get(e);return t||CG.set(e,t=gG(e)),t}var TG=w.define(),EG=w.define(),DG=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=le(e,t),r=a(n);this.chars.push(n);let i=e.slice(t,t+r),o=i.toUpperCase();this.folded.push(le(o==i?i.toLowerCase():o,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:o}=this;if(t.length==1){let r=le(e,0),i=a(r),o=i==e.length?0:-100;if(r!=t[0])if(r==n[0])o+=-200;else return null;return this.ret(o,[0,i])}let s=e.indexOf(this.pattern);if(s==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let c=t.length,l=0;if(s<0){for(let i=0,o=Math.min(e.length,200);i<o&&l<c;){let o=le(e,i);(o==t[l]||o==n[l])&&(r[l++]=i),i+=a(o)}if(l<c)return null}let u=0,d=0,f=!1,p=0,m=-1,h=-1,g=/[a-z]/.test(e),_=!0;for(let r=0,l=Math.min(e.length,200),v=0;r<l&&d<c;){let l=le(e,r);s<0&&(u<c&&l==t[u]&&(i[u++]=r),p<c&&(l==t[p]||l==n[p]?(p==0&&(m=r),h=r+1,p++):p=0));let b,x=l<255?l>=48&&l<=57||l>=97&&l<=122?2:+(l>=65&&l<=90):(b=y(l))==b.toLowerCase()?b==b.toUpperCase()?0:2:1;(!r||x==1&&g||v==0&&x!=0)&&(t[d]==l||n[d]==l&&(f=!0)?o[d++]=r:o.length&&(_=!1)),v=x,r+=a(l)}return d==c&&o[0]==0&&_?this.result(-100+(f?-200:0),o,e):p==c&&m==0?this.ret(-200-e.length+(h==e.length?0:-100),[0,h]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):p==c?this.ret(-900-e.length,[m,h]):d==c?this.result(-100+(f?-200:0)+-700+(_?0:-1100),o,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?a(le(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},OG=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},kG=Ae.define({combine(e){return ce(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:jG,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>AG(e(n),t(n)),optionClass:(e,t)=>n=>AG(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function AG(e,t){return e?t?e+` `+t:e:t}function jG(e,t,n,r,i,a){let o=e.textDirection==u.RTL,s=o,c=!1,l=`top`,d,f,p=t.left-i.left,m=i.right-t.right,h=r.right-r.left,g=r.bottom-r.top;if(s&&p<Math.min(h,m)?s=!1:!s&&m<Math.min(h,p)&&(s=!0),h<=(s?p:m))d=Math.max(i.top,Math.min(n.top,i.bottom-g))-t.top,f=Math.min(400,s?p:m);else{c=!0,f=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=g||e>t.top?d=n.bottom-t.top:(l=`bottom`,d=t.bottom-n.top)}let _=(t.bottom-t.top)/a.offsetHeight,v=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${d/_}px; max-width: ${f/v}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var MG=w.define();function NG(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function PG(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}var FG=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(kG);this.optionContent=NG(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=PG(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:MG.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(kG).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:EG.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=PG(r.length,i,e.state.facet(kG).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=PG(t.options.length,t.selected,this.view.state.facet(kG).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>ge(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&LG(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(kG).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function IG(e,t){return n=>new FG(n,e,t)}function LG(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function RG(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function zG(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(kG);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new vG(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new OG(n):new DG(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new vG(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):RG(e.completion)>RG(c)&&(s[s.length-1]=e),c=e.completion}return s}var BG=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,GG(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=zG(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(kG).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,GG(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:eK,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},VG=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(KG,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(kG),i=(r.override||n.languageDataAt(`autocomplete`,yG(n)).map(wG)).map(e=>(this.active.find(t=>t.source==e)||new JG(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(ZG));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!HG(i,this.active)||o?a=BG.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new JG(e.source,0):e));for(let e of t.effects)e.is(MG)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?UG:WG}};function HG(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var UG={"aria-autocomplete":`list`},WG={};function GG(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var KG=[];function qG(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(xG);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var JG=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=qG(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(TG))i=new e(i.source,1,n.value);else if(n.is(EG))i=new e(i.source,0);else if(n.is(ZG))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(yG(e.state))}},YG=class e extends JG{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=yG(t.state);if(o>a||!r||n&2&&(yG(t.startState)==this.from||o<this.limit))return new JG(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return XG(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new pG(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??yG(t.state)):new JG(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new JG(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function XG(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):bG(e,!0).test(i)}var ZG=w.define({map(e,t){return e.map(e=>e.map(t))}}),QG=l.define({create(){return VG.start()},update(e,t){return e.update(t)},provide:e=>[F.from(e,e=>e.tooltip),f.contentAttributes.from(e,e=>e.attrs)]});function $G(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(QG).active.find(e=>e.source==t.source);return r instanceof YG?(typeof n==`string`?e.dispatch({...SG(e.state,n,r.from,r.to),annotations:xG.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}var eK=IG(QG,$G);function tK(e,t=`option`){return n=>{let i=n.state.field(QG,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(kG).interactionDelay)return!1;let a=1,o;t==`page`&&(o=r(n,i.open.tooltip))&&(a=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector(`li`).offsetHeight)-1));let{length:s}=i.open.options,c=i.open.selected>-1?i.open.selected+a*(e?1:-1):e?0:s-1;return c<0?c=t==`page`?0:s-1:c>=s&&(c=t==`page`?s-1:0),n.dispatch({effects:MG.of(c)}),!0}}var nK=e=>{let t=e.state.field(QG,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(kG).interactionDelay?!1:$G(e,t.open.options[t.open.selected])},rK=e=>e.state.field(QG,!1)?(e.dispatch({effects:TG.of(!0)}),!0):!1,iK=e=>{let t=e.state.field(QG,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:EG.of(null)}),!0)},aK=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},oK=50,sK=1e3,cK=ve.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(QG).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(QG),n=e.state.facet(kG);if(!e.selectionSet&&!e.docChanged&&e.startState.field(QG)==t)return;let r=e.transactions.some(e=>{let t=qG(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>oK&&Date.now()-n.time>sK){for(let e of n.context.abortListeners)try{e()}catch(e){ge(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(TG)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(QG);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(kG).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new pG(t,yG(t),e.explicit,this.view),r=new aK(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:EG.of(null)}),ge(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(kG).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(kG),n=this.view.state.field(QG);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=yG(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new YG(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new JG(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:ZG.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(QG,!1);if(t&&t.tooltip&&this.view.state.facet(kG).closeOnBlur){let n=t.open&&r(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:EG.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:TG.of(!1)}),20),this.composing=0}}}),lK=typeof navigator==`object`&&/Win/.test(navigator.platform),uK=ke.highest(f.domEventHandlers({keydown(e,t){let n=t.state.field(QG,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(lK&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&$G(t,r),!1}})),dK=f.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),fK=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},pK=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,M.TrackDel),r=t.mapPos(this.to,1,M.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},mK=class e{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],i=e.doc.lineAt(t),a=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=a,o=/^\t*/.exec(i)[0].length;for(let t=0;t<o;t++)n+=e.facet(c);r.push(t+n.length-o),i=n+i.slice(o)}n.push(i),t+=i.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new pK(e.field,r[e.line]+e.from,r[e.line]+e.to))}}static parse(t){let n=[],r=[],i=[],a;for(let e of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);){let t=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1,c=o.replace(/\\[{}]/g,e=>e[1]);for(let e=0;e<n.length;e++)(t==null?c&&n[e].name==c:n[e].seq==t)&&(s=e);if(s<0){let e=0;for(;e<n.length&&(t==null||n[e].seq!=null&&n[e].seq<t);)e++;n.splice(e,0,{seq:t,name:c}),s=e;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new fK(s,r.length,a.index,a.index+c.length)),e=e.slice(0,a.index)+o+e.slice(a.index+a[0].length)}e=e.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(e)}return new e(r,i)}},hK=T.widget({widget:new class extends d{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),gK=T.mark({class:`cm-snippetField`}),_K=class e{constructor(e,t){this.ranges=e,this.active=t,this.deco=T.set(e.map(e=>(e.from==e.to?hK:gK).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}},vK=w.define({map(e,t){return e&&e.map(t)}}),yK=w.define(),bK=l.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(vK))return n.value;if(n.is(yK)&&e)return new _K(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>f.decorations.from(e,e=>e?e.deco:T.none)});function xK(e,t){return k.create(e.filter(e=>e.field==t).map(e=>k.range(e.from,e.to)))}function SK(e){let t=mK.parse(e);return(e,n,r,i)=>{let{text:a,ranges:o}=t.instantiate(e.state,r),{main:c}=e.state.selection,l={changes:{from:r,to:i==c.from?c.to:i,insert:s.of(a)},scrollIntoView:!0,annotations:n?[xG.of(n),_.userEvent.of(`input.complete`)]:void 0};if(o.length&&(l.selection=xK(o,0)),o.some(e=>e.field>0)){let t=new _K(o,0),n=l.effects=[vK.of(t)];e.state.field(bK,!1)===void 0&&n.push(w.appendConfig.of([bK,EK,OK,dK]))}e.dispatch(e.state.update(l))}}function CK(e){return({state:t,dispatch:n})=>{let r=t.field(bK,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:xK(r.ranges,i),effects:vK.of(a?null:new _K(r.ranges,i)),scrollIntoView:!0})),!0}}var wK=[{key:`Tab`,run:CK(1),shift:CK(-1)},{key:`Escape`,run:({state:e,dispatch:t})=>e.field(bK,!1)?(t(e.update({effects:vK.of(null)})),!0):!1}],TK=Ae.define({combine(e){return e.length?e[0]:wK}}),EK=ke.highest(oe.compute([TK],e=>e.facet(TK)));function DK(e,t){return{...t,apply:SK(e)}}var OK=f.domEventHandlers({mousedown(e,t){let n=t.state.field(bK,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:xK(n.ranges,i.field),effects:vK.of(n.ranges.some(e=>e.field>i.field)?new _K(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),kK={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},AK=w.define({map(e,t){return t.mapPos(e,-1,M.TrackAfter)??void 0}}),jK=new class extends De{};jK.startSide=1,jK.endSide=-1;var MK=l.define({create(){return S.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(AK)&&(e=e.update({add:[jK.range(n.value,n.value+1)]}));return e}});function NK(){return[RK,MK]}var PK=`()[]{}<>«»»«[]{}`;function FK(e){for(let t=0;t<16;t+=2)if(PK.charCodeAt(t)==e)return PK.charAt(t+1);return y(e<128?e:e+1)}function IK(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||kK}var LK=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),RK=f.inputHandler.of((e,t,n,r)=>{if((LK?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&a(le(r,0))==1||t!=i.from||n!=i.to)return!1;let o=BK(e.state,r);return o?(e.dispatch(o),!0):!1}),zK=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=IK(e,e.selection.main.head).brackets||kK.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){let r=UK(e.doc,t.head);for(let i of n)if(i==r&&HK(e.doc,t.head)==FK(le(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:k.cursor(t.head-i.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:`delete.backward`})),!r}}];function BK(e,t){let n=IK(e,e.selection.main.head),r=n.brackets||kK.brackets;for(let i of r){let a=FK(le(i,0));if(t==i)return a==i?KK(e,i,r.indexOf(i+i+i)>-1,n):WK(e,i,a,n.before||kK.before);if(t==a&&VK(e,e.selection.main.from))return GK(e,i,a)}return null}function VK(e,t){let n=!1;return e.field(MK).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function HK(e,t){let n=e.sliceString(t,t+2);return n.slice(0,a(le(n,0)))}function UK(e,t){let n=e.sliceString(t-2,t);return a(le(n,0))==n.length?n:n.slice(1)}function WK(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:AK.of(a.to+t.length),range:k.range(a.anchor+t.length,a.head+t.length)};let o=HK(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:AK.of(a.head+t.length),range:k.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function GK(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&HK(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:k.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function KK(e,t,n,r){let i=r.stringPrefixes||kK.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:AK.of(r.to+t.length),range:k.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=HK(e.doc,o),c;if(s==t){if(qK(e,o))return{changes:{insert:t+t,from:o},effects:AK.of(o+t.length),range:k.cursor(o+t.length)};if(VK(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:k.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=YK(e,o-2*t.length,i))>-1&&qK(e,c))return{changes:{insert:t+t+t+t,from:o},effects:AK.of(o+t.length),range:k.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=ie.Word&&YK(e,o,i)>-1&&!JK(e,o,t,i))return{changes:{insert:t+t,from:o},effects:AK.of(o+t.length),range:k.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function qK(e,t){let n=se(e).resolveInner(t+1);return n.parent&&n.from==t}function JK(e,t,n,r){let i=se(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function YK(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=ie.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=ie.Word)return n}return-1}function XK(e={}){return[uK,QG,kG.of(e),cK,QK,dK]}var ZK=[{key:`Ctrl-Space`,run:rK},{mac:"Alt-`",run:rK},{mac:`Alt-i`,run:rK},{key:`Escape`,run:iK},{key:`ArrowDown`,run:tK(!0)},{key:`ArrowUp`,run:tK(!1)},{key:`PageDown`,run:tK(!0,`page`)},{key:`PageUp`,run:tK(!1,`page`)},{key:`Enter`,run:nK}],QK=ke.highest(oe.computeN([kG],e=>e.facet(kG).defaultKeymap?[ZK]:[])),$K=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=iq(e.state,n.from);return r.line?tq(e):r.block?rq(e):!1};function eq(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var tq=eq(lq,0),nq=eq(cq,0),rq=eq((e,t)=>cq(e,t,sq(t)),0);function iq(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var aq=50;function oq(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-aq,r),o=e.sliceDoc(i,i+aq),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*aq?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+aq),d=e.sliceDoc(i-aq,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function sq(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function cq(e,t,n=t.selection.ranges){let r=n.map(e=>iq(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>oq(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function lq(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=iq(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var uq=_e.define(),dq=_e.define(),fq=Ae.define(),pq=Ae.define({combine(e){return ce(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),mq=l.define({create(){return Nq.empty},update(e,t){let n=t.state.facet(pq),r=t.annotation(uq);if(r){let i=xq.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?Sq(o,o.length,n.minDepth,i):Oq(o,t.startState.selection),new Nq(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(dq);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(_.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=xq.fromTransaction(t),o=t.annotation(_.time),s=t.annotation(_.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new Nq(e.done.map(xq.fromJSON),e.undone.map(xq.fromJSON))}});function hq(e={}){return[mq,pq.of(e),f.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?_q:e.inputType==`historyRedo`?vq:null;return n?(e.preventDefault(),n(t)):!1}})]}function gq(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(mq,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var _q=gq(0,!1),vq=gq(1,!1),yq=gq(0,!0),bq=gq(1,!0),xq=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&ae.fromJSON(t.changes),[],t.mapped&&fe.fromJSON(t.mapped),t.startSelection&&k.fromJSON(t.startSelection),t.selectionsAfter.map(k.fromJSON))}static fromTransaction(t,n){let r=Eq;for(let e of t.startState.facet(fq)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Eq)}static selection(t){return new e(void 0,Eq,void 0,void 0,t)}};function Sq(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function Cq(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function wq(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function Tq(e,t){return e.length?t.length?e.concat(t):e:t}var Eq=[],Dq=200;function Oq(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Dq));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),Sq(e,e.length-1,1e9,n.setSelAfter(r)))}else return[xq.selection([t])]}function kq(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function Aq(e,t){if(!e.length)return e;let n=e.length,r=Eq;for(;n;){let i=jq(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[xq.selection(r)]:Eq}function jq(e,t,n){let r=Tq(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):Eq,n);if(!e.changes)return xq.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new xq(i,w.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var Mq=/^(input\.type|delete)($|\.)/,Nq=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||Mq.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,Cq(s.changes,t.changes))||r==`input.type.compose`)?Sq(o,o.length-1,i.minDepth,new xq(t.changes.compose(s.changes),Tq(w.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,Eq)):Sq(o,o.length,i.minDepth,t),new e(o,Eq,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Eq;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&wq(a[a.length-1],t)?this:new e(Oq(this.done,t),this.undone,n,r)}addMapping(t){return new e(Aq(this.done,t),Aq(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:uq.of({side:e,rest:kq(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?Eq:r.slice(0,r.length-1);return i.mapped&&(n=Aq(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:uq.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};Nq.empty=new Nq(Eq,Eq);var Pq=[{key:`Mod-z`,run:_q,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:vq,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:vq,preventDefault:!0},{key:`Mod-u`,run:yq,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:bq,preventDefault:!0}];function Fq(e,t){return k.create(e.ranges.map(t),e.mainIndex)}function Iq(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function Lq({state:e,dispatch:t},n){let r=Fq(e.selection,n);return r.eq(e.selection,!0)?!1:(t(Iq(e,r)),!0)}function Rq(e,t){return k.cursor(t?e.to:e.from)}function zq(e,t){return Lq(e,n=>n.empty?e.moveByChar(n,t):Rq(n,t))}function Bq(e){return e.textDirectionAt(e.state.selection.main.head)==u.LTR}var Vq=e=>zq(e,!Bq(e)),Hq=e=>zq(e,Bq(e));function Uq(e,t){return Lq(e,n=>n.empty?e.moveByGroup(n,t):Rq(n,t))}var Wq=e=>Uq(e,!Bq(e)),Gq=e=>Uq(e,Bq(e));typeof Intl<`u`&&Intl.Segmenter;function Kq(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function qq(e,t,n){let r=se(e).resolveInner(t.head),i=n?p.closedBy:p.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;Kq(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?g(e,r.from,1):g(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,k.cursor(s,n?-1:1)}var Jq=e=>Lq(e,t=>qq(e.state,t,!Bq(e))),Yq=e=>Lq(e,t=>qq(e.state,t,Bq(e)));function Xq(e,t){return Lq(e,n=>{if(!n.empty)return Rq(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var Zq=e=>Xq(e,!1),Qq=e=>Xq(e,!0);function $q(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(f.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function eJ(e,t){let n=$q(e),{state:r}=e,i=Fq(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):Rq(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=f.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(Iq(r,i),{effects:a}),!0}var tJ=e=>eJ(e,!1),nJ=e=>eJ(e,!0);function rJ(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=k.cursor(r.from+n))}return i}var iJ=e=>Lq(e,t=>rJ(e,t,!0)),aJ=e=>Lq(e,t=>rJ(e,t,!1)),oJ=e=>Lq(e,t=>rJ(e,t,!Bq(e))),sJ=e=>Lq(e,t=>rJ(e,t,Bq(e))),cJ=e=>Lq(e,t=>k.cursor(e.lineBlockAt(t.head).from,1)),lJ=e=>Lq(e,t=>k.cursor(e.lineBlockAt(t.head).to,-1));function uJ(e,t,n){let r=!1,i=Fq(e.selection,t=>{let i=g(e,t.head,-1)||g(e,t.head,1)||t.head>0&&g(e,t.head-1,1)||t.head<e.doc.length&&g(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?k.range(t.anchor,a):k.cursor(a)});return r?(t(Iq(e,i)),!0):!1}var dJ=({state:e,dispatch:t})=>uJ(e,t,!1);function fJ(e,t){let n=Fq(e.state.selection,e=>{let n=t(e);return k.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(Iq(e.state,n)),!0)}function pJ(e,t){return fJ(e,n=>e.moveByChar(n,t))}var mJ=e=>pJ(e,!Bq(e)),hJ=e=>pJ(e,Bq(e));function gJ(e,t){return fJ(e,n=>e.moveByGroup(n,t))}var _J=e=>gJ(e,!Bq(e)),vJ=e=>gJ(e,Bq(e)),yJ=e=>fJ(e,t=>qq(e.state,t,!Bq(e))),bJ=e=>fJ(e,t=>qq(e.state,t,Bq(e)));function xJ(e,t){return fJ(e,n=>e.moveVertically(n,t))}var SJ=e=>xJ(e,!1),CJ=e=>xJ(e,!0);function wJ(e,t){return fJ(e,n=>e.moveVertically(n,t,$q(e).height))}var TJ=e=>wJ(e,!1),EJ=e=>wJ(e,!0),DJ=e=>fJ(e,t=>rJ(e,t,!0)),OJ=e=>fJ(e,t=>rJ(e,t,!1)),kJ=e=>fJ(e,t=>rJ(e,t,!Bq(e))),AJ=e=>fJ(e,t=>rJ(e,t,Bq(e))),jJ=e=>fJ(e,t=>k.cursor(e.lineBlockAt(t.head).from)),MJ=e=>fJ(e,t=>k.cursor(e.lineBlockAt(t.head).to)),NJ=({state:e,dispatch:t})=>(t(Iq(e,{anchor:0})),!0),PJ=({state:e,dispatch:t})=>(t(Iq(e,{anchor:e.doc.length})),!0),FJ=({state:e,dispatch:t})=>(t(Iq(e,{anchor:e.selection.main.anchor,head:0})),!0),IJ=({state:e,dispatch:t})=>(t(Iq(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),LJ=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),RJ=({state:e,dispatch:t})=>{let n=rY(e).map(({from:t,to:n})=>k.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:k.create(n),userEvent:`select`})),!0},zJ=({state:e,dispatch:t})=>{let n=Fq(e.selection,t=>{let n=se(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return k.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(Iq(e,n)),!0)};function BJ(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(Iq(n,k.create(i,i.length-1))),!0)}var VJ=e=>BJ(e,!1),HJ=e=>BJ(e,!0),UJ=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=k.create([n.main]):n.main.empty||(r=k.create([k.cursor(n.main.head)])),r?(t(Iq(e,r)),!0):!1};function WJ(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=GJ(e,o,!1)):o>i&&(n=`delete.forward`,o=GJ(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=GJ(e,i,!1),a=GJ(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:k.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?f.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function GJ(e,t,n){if(e instanceof f)for(let r of e.state.facet(f.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var KJ=(e,t,n)=>WJ(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=m(s,a.tabSize)%Oe(a)||Oe(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=h(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=h(o.text,c-o.from,!1,!1)+o.from);return c}),qJ=e=>KJ(e,!1,!0),JJ=e=>KJ(e,!0,!1),YJ=(e,t)=>WJ(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=h(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),XJ=e=>YJ(e,!1),ZJ=e=>YJ(e,!0),QJ=e=>WJ(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),$J=e=>WJ(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),eY=e=>WJ(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),tY=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:s.of([``,``])},range:k.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},nY=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:h(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:h(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:k.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function rY(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function iY(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of rY(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(k.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(k.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:k.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var aY=({state:e,dispatch:t})=>iY(e,t,!1),oY=({state:e,dispatch:t})=>iY(e,t,!0);function sY(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of rY(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var cY=({state:e,dispatch:t})=>sY(e,t,!1),lY=({state:e,dispatch:t})=>sY(e,t,!0),uY=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(rY(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=Fq(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function dY(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=se(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(p.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var fY=mY(!1),pY=mY(!0);function mY(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&dY(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let c=new pe(t,{simulateBreak:r,simulateDoubleBreak:!!o}),l=x(c,r);for(l??=m(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let u=[``,C(t,l)];return o&&u.push(C(t,c.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:s.of(u)},range:k.cursor(r+1+u[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function hY(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:k.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var gY=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new pe(e,{overrideIndentation:e=>n[e]??-1}),i=hY(e,(t,i,a)=>{let o=x(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=C(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},_Y=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(hY(e,(t,n)=>{n.push({from:t.from,insert:e.facet(c)})}),{userEvent:`input.indent`})),!0),vY=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(hY(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=m(r,e.tabSize),a=0,o=C(e,Math.max(0,i-Oe(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),yY=e=>(e.setTabFocusMode(),!0),bY=[{key:`Ctrl-b`,run:Vq,shift:mJ,preventDefault:!0},{key:`Ctrl-f`,run:Hq,shift:hJ},{key:`Ctrl-p`,run:Zq,shift:SJ},{key:`Ctrl-n`,run:Qq,shift:CJ},{key:`Ctrl-a`,run:cJ,shift:jJ},{key:`Ctrl-e`,run:lJ,shift:MJ},{key:`Ctrl-d`,run:JJ},{key:`Ctrl-h`,run:qJ},{key:`Ctrl-k`,run:QJ},{key:`Ctrl-Alt-h`,run:XJ},{key:`Ctrl-o`,run:tY},{key:`Ctrl-t`,run:nY},{key:`Ctrl-v`,run:nJ}],xY=[{key:`ArrowLeft`,run:Vq,shift:mJ,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:Wq,shift:_J,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:oJ,shift:kJ,preventDefault:!0},{key:`ArrowRight`,run:Hq,shift:hJ,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:Gq,shift:vJ,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:sJ,shift:AJ,preventDefault:!0},{key:`ArrowUp`,run:Zq,shift:SJ,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:NJ,shift:FJ},{mac:`Ctrl-ArrowUp`,run:tJ,shift:TJ},{key:`ArrowDown`,run:Qq,shift:CJ,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:PJ,shift:IJ},{mac:`Ctrl-ArrowDown`,run:nJ,shift:EJ},{key:`PageUp`,run:tJ,shift:TJ},{key:`PageDown`,run:nJ,shift:EJ},{key:`Home`,run:aJ,shift:OJ,preventDefault:!0},{key:`Mod-Home`,run:NJ,shift:FJ},{key:`End`,run:iJ,shift:DJ,preventDefault:!0},{key:`Mod-End`,run:PJ,shift:IJ},{key:`Enter`,run:fY,shift:fY},{key:`Mod-a`,run:LJ},{key:`Backspace`,run:qJ,shift:qJ,preventDefault:!0},{key:`Delete`,run:JJ,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:XJ,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:ZJ,preventDefault:!0},{mac:`Mod-Backspace`,run:$J,preventDefault:!0},{mac:`Mod-Delete`,run:eY,preventDefault:!0}].concat(bY.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),SY=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:Jq,shift:yJ},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:Yq,shift:bJ},{key:`Alt-ArrowUp`,run:aY},{key:`Shift-Alt-ArrowUp`,run:cY},{key:`Alt-ArrowDown`,run:oY},{key:`Shift-Alt-ArrowDown`,run:lY},{key:`Mod-Alt-ArrowUp`,run:VJ},{key:`Mod-Alt-ArrowDown`,run:HJ},{key:`Escape`,run:UJ},{key:`Mod-Enter`,run:pY},{key:`Alt-l`,mac:`Ctrl-l`,run:RJ},{key:`Mod-i`,run:zJ,preventDefault:!0},{key:`Mod-[`,run:vY},{key:`Mod-]`,run:_Y},{key:`Mod-Alt-\\`,run:gY},{key:`Shift-Mod-k`,run:uY},{key:`Shift-Mod-\\`,run:dJ},{key:`Mod-/`,run:$K},{key:`Alt-A`,run:nq},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:yY}].concat(xY),CY={key:`Tab`,run:_Y,shift:vY};function wY(e,t,n,r){let i=Hd(yO),a=Wd(ck),o=I.useRef(null),{lexicalNode:s}=$W(),c=I.useRef(!1),l=I.useRef(!1),u=I.useCallback(()=>{a({editorType:t,rootNode:s,editorRef:o.current})},[t,s,a]),d=I.useCallback(t=>{if(t.key===`ArrowDown`){let t=o.current?.getCodemirror()?.state;t&&t.doc.length===t.selection.ranges[0].to&&(c.current?(i?.update(()=>{var t;let n=A_(e);n.getNextSibling()?((t=o.current?.getCodemirror())==null||t.contentDOM.blur(),n.selectNext()):n.insertAfter(r_())}),c.current=!1):c.current=!0)}else if(t.key===`ArrowUp`){let t=o.current?.getCodemirror()?.state;t&&t.selection.ranges[0].from===0&&(l.current?(i?.update(()=>{var t;let n=A_(e);n.getPreviousSibling()&&((t=o.current?.getCodemirror())==null||t.contentDOM.blur(),n.selectPrevious())}),l.current=!1):l.current=!0)}else t.key===`Enter`?t.stopPropagation():(t.key===`Backspace`||t.key===`Delete`)&&(o.current?.getCodemirror()?.state)?.doc.length===0&&i?.update(()=>{A_(e).remove()})},[i,e]);return I.useEffect(()=>{let e=o.current;return setTimeout(()=>{var t,n;(t=e?.getCodemirror())==null||t.contentDOM.addEventListener(`focus`,u),(n=e?.getCodemirror())==null||n.contentDOM.addEventListener(`keydown`,d)},300),()=>{var t,n;(t=e?.getCodemirror())==null||t.contentDOM.removeEventListener(`focus`,u),(n=e?.getCodemirror())==null||n.contentDOM.removeEventListener(`keydown`,d)}},[o,u,d,n]),I.useEffect(()=>{r.subscribe(()=>{var e;(e=o.current?.getCodemirror())==null||e.focus(),u()})},[r,o,e,u]),o}function Q(e){return new he(N.define(e))}function TY(e){return Z(()=>import(`./dist-D2N4-LIc.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([0,1,2]))}var EY=[A.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return Z(()=>import(`./dist-C5YJOwhH.js`).then(e=>e.cpp()),__vite__mapDeps([3,1,2]))}}),A.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return Z(()=>import(`./dist-C5YJOwhH.js`).then(e=>e.cpp()),__vite__mapDeps([3,1,2]))}}),A.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return TY(`Cassandra`)}}),A.of({name:`CSS`,extensions:[`css`],load(){return Z(()=>import(`./dist-CKM5j-iy.js`).then(e=>e.i).then(e=>e.css()),__vite__mapDeps([4,5,1,2]))}}),A.of({name:`Go`,extensions:[`go`],load(){return Z(()=>import(`./dist-CNLWH2qh.js`).then(e=>e.go()),__vite__mapDeps([6,1,2]))}}),A.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return Z(()=>import(`./dist-CqqUC8Ce.js`).then(e=>e.html()),__vite__mapDeps([7,4,5,1,2,8]))}}),A.of({name:`Java`,extensions:[`java`],load(){return Z(()=>import(`./dist--55mTWk3.js`).then(e=>e.java()),__vite__mapDeps([9,1,2]))}}),A.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return Z(()=>import(`./dist-CUqpST5w.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([8,5,1,2]))}}),A.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return Z(()=>import(`./dist-v4pjHlB7.js`).then(e=>e.jinja()),__vite__mapDeps([10,7,4,5,1,2,8]))}}),A.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return Z(()=>import(`./dist-BZ39rB1W.js`).then(e=>e.json()),__vite__mapDeps([11,1,2]))}}),A.of({name:`JSX`,extensions:[`jsx`],load(){return Z(()=>import(`./dist-CUqpST5w.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([8,5,1,2]))}}),A.of({name:`LESS`,extensions:[`less`],load(){return Z(()=>import(`./dist-C5oXtFSP.js`).then(e=>e.less()),__vite__mapDeps([12,4,5,1,2]))}}),A.of({name:`Liquid`,extensions:[`liquid`],load(){return Z(()=>import(`./dist-D9L4MSRF.js`).then(e=>e.liquid()),__vite__mapDeps([13,7,4,5,1,2,8]))}}),A.of({name:`MariaDB SQL`,load(){return TY(`MariaSQL`)}}),A.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return Z(()=>import(`./dist-DNcnQRPF.js`).then(e=>e.markdown()),__vite__mapDeps([14,7,4,5,1,2,8]))}}),A.of({name:`MS SQL`,load(){return TY(`MSSQL`)}}),A.of({name:`MySQL`,load(){return TY(`MySQL`)}}),A.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return Z(()=>import(`./dist-CMZOa5ik.js`).then(e=>e.php()),__vite__mapDeps([15,7,4,5,1,2,8]))}}),A.of({name:`PLSQL`,extensions:[`pls`],load(){return TY(`PLSQL`)}}),A.of({name:`PostgreSQL`,load(){return TY(`PostgreSQL`)}}),A.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return Z(()=>import(`./dist-B7bbI3Qz.js`).then(e=>e.python()),__vite__mapDeps([16,1,2]))}}),A.of({name:`Rust`,extensions:[`rs`],load(){return Z(()=>import(`./dist-CUp9us2q.js`).then(e=>e.rust()),__vite__mapDeps([17,1,2]))}}),A.of({name:`Sass`,extensions:[`sass`],load(){return Z(()=>import(`./dist-DSKQpPaz.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([18,4,5,1,2]))}}),A.of({name:`SCSS`,extensions:[`scss`],load(){return Z(()=>import(`./dist-DSKQpPaz.js`).then(e=>e.sass()),__vite__mapDeps([18,4,5,1,2]))}}),A.of({name:`SQL`,extensions:[`sql`],load(){return TY(`StandardSQL`)}}),A.of({name:`SQLite`,load(){return TY(`SQLite`)}}),A.of({name:`TSX`,extensions:[`tsx`],load(){return Z(()=>import(`./dist-CUqpST5w.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([8,5,1,2]))}}),A.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return Z(()=>import(`./dist-CUqpST5w.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,5,1,2]))}}),A.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return Z(()=>import(`./dist-CZ9T4Cly.js`).then(e=>e.wast()),__vite__mapDeps([19,1,2]))}}),A.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return Z(()=>import(`./dist-Zqt9kNG9.js`).then(e=>e.xml()),__vite__mapDeps([20,1,2]))}}),A.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return Z(()=>import(`./dist-BsedZGJo.js`).then(e=>e.yaml()),__vite__mapDeps([21,1,2]))}}),A.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return Z(()=>import(`./apl-BxEMbctQ.js`).then(e=>Q(e.apl)),[])}}),A.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return Z(()=>import(`./asciiarmor-eFjeGRuZ.js`).then(e=>Q(e.asciiArmor)),[])}}),A.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return Z(()=>import(`./asn1-Cfx-0pt9.js`).then(e=>Q(e.asn1({}))),[])}}),A.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return Z(()=>import(`./asterisk-B5BHTsBr.js`).then(e=>Q(e.asterisk)),[])}}),A.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return Z(()=>import(`./brainfuck-CAA2xofr.js`).then(e=>Q(e.brainfuck)),[])}}),A.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return Z(()=>import(`./cobol-BfgHZgup.js`).then(e=>Q(e.cobol)),[])}}),A.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return Z(()=>import(`./clike-BoDCOLzN.js`).then(e=>Q(e.csharp)),[])}}),A.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return Z(()=>import(`./clojure-kVFSWX0o.js`).then(e=>Q(e.clojure)),[])}}),A.of({name:`ClojureScript`,extensions:[`cljs`],load(){return Z(()=>import(`./clojure-kVFSWX0o.js`).then(e=>Q(e.clojure)),[])}}),A.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return Z(()=>import(`./css-BqOeyZOV.js`).then(e=>Q(e.gss)),[])}}),A.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return Z(()=>import(`./cmake-BUPAhezI.js`).then(e=>Q(e.cmake)),[])}}),A.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return Z(()=>import(`./coffeescript-G1Pe_1AZ.js`).then(e=>Q(e.coffeeScript)),[])}}),A.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return Z(()=>import(`./commonlisp-B3N0CjHn.js`).then(e=>Q(e.commonLisp)),[])}}),A.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return Z(()=>import(`./cypher-KjIKv-wW.js`).then(e=>Q(e.cypher)),[])}}),A.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return Z(()=>import(`./python-C2_X1GpX.js`).then(e=>Q(e.cython)),[])}}),A.of({name:`Crystal`,extensions:[`cr`],load(){return Z(()=>import(`./crystal-C15ndaGM.js`).then(e=>Q(e.crystal)),[])}}),A.of({name:`D`,extensions:[`d`],load(){return Z(()=>import(`./d-BlT5AEC-.js`).then(e=>Q(e.d)),[])}}),A.of({name:`Dart`,extensions:[`dart`],load(){return Z(()=>import(`./clike-BoDCOLzN.js`).then(e=>Q(e.dart)),[])}}),A.of({name:`diff`,extensions:[`diff`,`patch`],load(){return Z(()=>import(`./diff-oF98tbqj.js`).then(e=>Q(e.diff)),[])}}),A.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return Z(()=>import(`./dockerfile-CUaqzcqp.js`).then(e=>Q(e.dockerFile)),__vite__mapDeps([22,23]))}}),A.of({name:`DTD`,extensions:[`dtd`],load(){return Z(()=>import(`./dtd-VCA9yr61.js`).then(e=>Q(e.dtd)),[])}}),A.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return Z(()=>import(`./dylan-O-V5Dw5W.js`).then(e=>Q(e.dylan)),[])}}),A.of({name:`EBNF`,load(){return Z(()=>import(`./ebnf-SPmdBkvT.js`).then(e=>Q(e.ebnf)),[])}}),A.of({name:`ECL`,extensions:[`ecl`],load(){return Z(()=>import(`./ecl-ChfCttfI.js`).then(e=>Q(e.ecl)),[])}}),A.of({name:`edn`,extensions:[`edn`],load(){return Z(()=>import(`./clojure-kVFSWX0o.js`).then(e=>Q(e.clojure)),[])}}),A.of({name:`Eiffel`,extensions:[`e`],load(){return Z(()=>import(`./eiffel-cB9EbjeN.js`).then(e=>Q(e.eiffel)),[])}}),A.of({name:`Elm`,extensions:[`elm`],load(){return Z(()=>import(`./elm-BTiVflBU.js`).then(e=>Q(e.elm)),[])}}),A.of({name:`Erlang`,extensions:[`erl`],load(){return Z(()=>import(`./erlang-egf0TXFm.js`).then(e=>Q(e.erlang)),[])}}),A.of({name:`Esper`,load(){return Z(()=>import(`./sql-D_dieYbr.js`).then(e=>Q(e.esper)),[])}}),A.of({name:`Factor`,extensions:[`factor`],load(){return Z(()=>import(`./factor-C2tAxNob.js`).then(e=>Q(e.factor)),__vite__mapDeps([24,23]))}}),A.of({name:`FCL`,load(){return Z(()=>import(`./fcl-BiCjh1tj.js`).then(e=>Q(e.fcl)),[])}}),A.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return Z(()=>import(`./forth-C4kDGW6u.js`).then(e=>Q(e.forth)),[])}}),A.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return Z(()=>import(`./fortran-DzkLaPnd.js`).then(e=>Q(e.fortran)),[])}}),A.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return Z(()=>import(`./mllike-wTFlPWXS.js`).then(e=>Q(e.fSharp)),[])}}),A.of({name:`Gas`,extensions:[`s`],load(){return Z(()=>import(`./gas-DMOxskQF.js`).then(e=>Q(e.gas)),[])}}),A.of({name:`Gherkin`,extensions:[`feature`],load(){return Z(()=>import(`./gherkin-BPxBpp-k.js`).then(e=>Q(e.gherkin)),[])}}),A.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return Z(()=>import(`./groovy-CkEnc0ZY.js`).then(e=>Q(e.groovy)),[])}}),A.of({name:`Haskell`,extensions:[`hs`],load(){return Z(()=>import(`./haskell-Dadpo9-w.js`).then(e=>Q(e.haskell)),[])}}),A.of({name:`Haxe`,extensions:[`hx`],load(){return Z(()=>import(`./haxe-CDNZL9MW.js`).then(e=>Q(e.haxe)),[])}}),A.of({name:`HXML`,extensions:[`hxml`],load(){return Z(()=>import(`./haxe-CDNZL9MW.js`).then(e=>Q(e.hxml)),[])}}),A.of({name:`HTTP`,load(){return Z(()=>import(`./http-jy9Zxxt3.js`).then(e=>Q(e.http)),[])}}),A.of({name:`IDL`,extensions:[`pro`],load(){return Z(()=>import(`./idl-CGSB6iiy.js`).then(e=>Q(e.idl)),[])}}),A.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return Z(()=>import(`./javascript-DSlzRUd8.js`).then(e=>Q(e.jsonld)),[])}}),A.of({name:`Julia`,extensions:[`jl`],load(){return Z(()=>import(`./julia-DTiF9v6R.js`).then(e=>Q(e.julia)),[])}}),A.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return Z(()=>import(`./clike-BoDCOLzN.js`).then(e=>Q(e.kotlin)),[])}}),A.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return Z(()=>import(`./livescript-Ci8Xxna6.js`).then(e=>Q(e.liveScript)),[])}}),A.of({name:`Lua`,extensions:[`lua`],load(){return Z(()=>import(`./lua-eVxIrt9t.js`).then(e=>Q(e.lua)),[])}}),A.of({name:`mIRC`,extensions:[`mrc`],load(){return Z(()=>import(`./mirc-CtHu9S1B.js`).then(e=>Q(e.mirc)),[])}}),A.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return Z(()=>import(`./mathematica-Da3grj36.js`).then(e=>Q(e.mathematica)),[])}}),A.of({name:`Modelica`,extensions:[`mo`],load(){return Z(()=>import(`./modelica-cKbQ0UXu.js`).then(e=>Q(e.modelica)),[])}}),A.of({name:`MUMPS`,extensions:[`mps`],load(){return Z(()=>import(`./mumps-CKBHkOQq.js`).then(e=>Q(e.mumps)),[])}}),A.of({name:`Mbox`,extensions:[`mbox`],load(){return Z(()=>import(`./mbox-BWBMSafM.js`).then(e=>Q(e.mbox)),[])}}),A.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return Z(()=>import(`./nginx-B00AiQel.js`).then(e=>Q(e.nginx)),[])}}),A.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return Z(()=>import(`./nsis-SMDwKltR.js`).then(e=>Q(e.nsis)),__vite__mapDeps([25,23]))}}),A.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return Z(()=>import(`./ntriples-B_36EBV0.js`).then(e=>Q(e.ntriples)),[])}}),A.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return Z(()=>import(`./clike-BoDCOLzN.js`).then(e=>Q(e.objectiveC)),[])}}),A.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return Z(()=>import(`./clike-BoDCOLzN.js`).then(e=>Q(e.objectiveCpp)),[])}}),A.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return Z(()=>import(`./mllike-wTFlPWXS.js`).then(e=>Q(e.oCaml)),[])}}),A.of({name:`Octave`,extensions:[`m`],load(){return Z(()=>import(`./octave-BXPjzAif.js`).then(e=>Q(e.octave)),[])}}),A.of({name:`Oz`,extensions:[`oz`],load(){return Z(()=>import(`./oz-Dedpat1M.js`).then(e=>Q(e.oz)),[])}}),A.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return Z(()=>import(`./pascal-CMcUg72K.js`).then(e=>Q(e.pascal)),[])}}),A.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return Z(()=>import(`./perl-DoVTbnzt.js`).then(e=>Q(e.perl)),[])}}),A.of({name:`Pig`,extensions:[`pig`],load(){return Z(()=>import(`./pig-CULXT1YV.js`).then(e=>Q(e.pig)),[])}}),A.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return Z(()=>import(`./powershell-Cv5Uhf6b.js`).then(e=>Q(e.powerShell)),[])}}),A.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return Z(()=>import(`./properties-CQ1C2P-M.js`).then(e=>Q(e.properties)),[])}}),A.of({name:`ProtoBuf`,extensions:[`proto`],load(){return Z(()=>import(`./protobuf-SRlvzrl6.js`).then(e=>Q(e.protobuf)),[])}}),A.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return Z(()=>import(`./pug-Bo3wfL-f.js`).then(e=>Q(e.pug)),__vite__mapDeps([26,27]))}}),A.of({name:`Puppet`,extensions:[`pp`],load(){return Z(()=>import(`./puppet-ClSqCGj6.js`).then(e=>Q(e.puppet)),[])}}),A.of({name:`Q`,extensions:[`q`],load(){return Z(()=>import(`./q-B_6Gdyzl.js`).then(e=>Q(e.q)),[])}}),A.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return Z(()=>import(`./r-BD07NGED.js`).then(e=>Q(e.r)),[])}}),A.of({name:`RPM Changes`,load(){return Z(()=>import(`./rpm-CRu5Z2Jl.js`).then(e=>Q(e.rpmChanges)),[])}}),A.of({name:`RPM Spec`,extensions:[`spec`],load(){return Z(()=>import(`./rpm-CRu5Z2Jl.js`).then(e=>Q(e.rpmSpec)),[])}}),A.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return Z(()=>import(`./ruby-dZPnOz8h.js`).then(e=>Q(e.ruby)),[])}}),A.of({name:`SAS`,extensions:[`sas`],load(){return Z(()=>import(`./sas-S2t8_sDI.js`).then(e=>Q(e.sas)),[])}}),A.of({name:`Scala`,extensions:[`scala`],load(){return Z(()=>import(`./clike-BoDCOLzN.js`).then(e=>Q(e.scala)),[])}}),A.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return Z(()=>import(`./scheme-WcyFWLW2.js`).then(e=>Q(e.scheme)),[])}}),A.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return Z(()=>import(`./shell-DUelnYSh.js`).then(e=>Q(e.shell)),[])}}),A.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return Z(()=>import(`./sieve-jDjlVhNh.js`).then(e=>Q(e.sieve)),[])}}),A.of({name:`Smalltalk`,extensions:[`st`],load(){return Z(()=>import(`./smalltalk-ddWDYy10.js`).then(e=>Q(e.smalltalk)),[])}}),A.of({name:`Solr`,load(){return Z(()=>import(`./solr-C7rQhLuW.js`).then(e=>Q(e.solr)),[])}}),A.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return Z(()=>import(`./mllike-wTFlPWXS.js`).then(e=>Q(e.sml)),[])}}),A.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return Z(()=>import(`./sparql--fPCCgVd.js`).then(e=>Q(e.sparql)),[])}}),A.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return Z(()=>import(`./spreadsheet-DjthqD5G.js`).then(e=>Q(e.spreadsheet)),[])}}),A.of({name:`Squirrel`,extensions:[`nut`],load(){return Z(()=>import(`./clike-BoDCOLzN.js`).then(e=>Q(e.squirrel)),[])}}),A.of({name:`Stylus`,extensions:[`styl`],load(){return Z(()=>import(`./stylus-DxF70RNr.js`).then(e=>Q(e.stylus)),[])}}),A.of({name:`Swift`,extensions:[`swift`],load(){return Z(()=>import(`./swift-T0hDoOb-.js`).then(e=>Q(e.swift)),[])}}),A.of({name:`sTeX`,load(){return Z(()=>import(`./stex-rHcFYcA0.js`).then(e=>Q(e.stex)),[])}}),A.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return Z(()=>import(`./stex-rHcFYcA0.js`).then(e=>Q(e.stex)),[])}}),A.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return Z(()=>import(`./verilog-BJOO83gk.js`).then(e=>Q(e.verilog)),[])}}),A.of({name:`Tcl`,extensions:[`tcl`],load(){return Z(()=>import(`./tcl-Dlzy1mPk.js`).then(e=>Q(e.tcl)),[])}}),A.of({name:`Textile`,extensions:[`textile`],load(){return Z(()=>import(`./textile-Dy5rFZe5.js`).then(e=>Q(e.textile)),[])}}),A.of({name:`TiddlyWiki`,load(){return Z(()=>import(`./tiddlywiki-DQP1OymS.js`).then(e=>Q(e.tiddlyWiki)),[])}}),A.of({name:`Tiki wiki`,load(){return Z(()=>import(`./tiki-0vOj3DB2.js`).then(e=>Q(e.tiki)),[])}}),A.of({name:`TOML`,extensions:[`toml`],load(){return Z(()=>import(`./toml-DEltN0lI.js`).then(e=>Q(e.toml)),[])}}),A.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return Z(()=>import(`./troff-CRbBpEqY.js`).then(e=>Q(e.troff)),[])}}),A.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return Z(()=>import(`./ttcn-M5q1nLKg.js`).then(e=>Q(e.ttcn)),[])}}),A.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return Z(()=>import(`./ttcn-cfg-Rmw9NWq9.js`).then(e=>Q(e.ttcnCfg)),[])}}),A.of({name:`Turtle`,extensions:[`ttl`],load(){return Z(()=>import(`./turtle-BCDWhJK0.js`).then(e=>Q(e.turtle)),[])}}),A.of({name:`Web IDL`,extensions:[`webidl`],load(){return Z(()=>import(`./webidl-Ddy6hbV6.js`).then(e=>Q(e.webIDL)),[])}}),A.of({name:`VB.NET`,extensions:[`vb`],load(){return Z(()=>import(`./vb-QQ7LGlOz.js`).then(e=>Q(e.vb)),[])}}),A.of({name:`VBScript`,extensions:[`vbs`],load(){return Z(()=>import(`./vbscript-BiSEdUzz.js`).then(e=>Q(e.vbScript)),[])}}),A.of({name:`Velocity`,extensions:[`vtl`],load(){return Z(()=>import(`./velocity-CzMg5_6w.js`).then(e=>Q(e.velocity)),[])}}),A.of({name:`Verilog`,extensions:[`v`],load(){return Z(()=>import(`./verilog-BJOO83gk.js`).then(e=>Q(e.verilog)),[])}}),A.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return Z(()=>import(`./vhdl-ed4zAZAA.js`).then(e=>Q(e.vhdl)),[])}}),A.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return Z(()=>import(`./xquery-Bw1zwhh6.js`).then(e=>Q(e.xQuery)),[])}}),A.of({name:`Yacas`,extensions:[`ys`],load(){return Z(()=>import(`./yacas-DZdTXy3s.js`).then(e=>Q(e.yacas)),[])}}),A.of({name:`Z80`,extensions:[`z80`],load(){return Z(()=>import(`./z80-DMG02_YV.js`).then(e=>Q(e.z80)),[])}}),A.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return Z(()=>import(`./mscgen-C5pXQCMK.js`).then(e=>Q(e.mscgen)),[])}}),A.of({name:`Xù`,extensions:[`xu`],load(){return Z(()=>import(`./mscgen-C5pXQCMK.js`).then(e=>Q(e.xu)),[])}}),A.of({name:`MsGenny`,extensions:[`msgenny`],load(){return Z(()=>import(`./mscgen-C5pXQCMK.js`).then(e=>Q(e.msgenny)),[])}}),A.of({name:`Vue`,extensions:[`vue`],load(){return Z(()=>import(`./dist-CspjOeBj.js`).then(e=>e.vue()),__vite__mapDeps([28,7,4,5,1,2,8]))}}),A.of({name:`Angular Template`,load(){return Z(()=>import(`./dist-8e4L8ciw.js`).then(e=>e.angular()),__vite__mapDeps([29,7,4,5,1,2,8]))}})],DY=`#2e3440`,OY=`#3b4252`,kY=`#434c5e`,AY=`#4c566a`,jY=`#e5e9f0`,MY=`#eceff4`,NY=`#8fbcbb`,PY=`#88c0d0`,FY=`#81a1c1`,IY=`#5e81ac`,LY=`#bf616a`,RY=`#d08770`,zY=`#ebcb8b`,BY=`#a3be8c`,VY=`#b48ead`,HY=`#d30102`,UY=MY,WY=UY,GY=`#ffffff`,KY=OY,qY=UY,JY=OY,YY=[f.theme({"&":{color:DY,backgroundColor:GY},".cm-content":{caretColor:JY},".cm-cursor, .cm-dropCursor":{borderLeftColor:JY},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:qY},".cm-panels":{backgroundColor:UY,color:AY},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid ${AY}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:jY},".cm-activeLine":{backgroundColor:WY},".cm-selectionMatch":{backgroundColor:jY},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${AY}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:MY},".cm-gutters":{backgroundColor:MY,color:DY,border:`none`},".cm-activeLineGutter":{backgroundColor:WY},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:KY},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:KY,borderBottomColor:KY},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:WY,color:AY}}},{dark:!1}),i(xe.define([{tag:v.keyword,color:IY},{tag:[v.name,v.deleted,v.character,v.propertyName,v.macroName],color:RY},{tag:[v.variableName],color:RY},{tag:[v.function(v.variableName)],color:IY},{tag:[v.labelName],color:FY},{tag:[v.color,v.constant(v.name),v.standard(v.name)],color:IY},{tag:[v.definition(v.name),v.separator],color:BY},{tag:[v.brace],color:NY},{tag:[v.annotation],color:HY},{tag:[v.number,v.changed,v.annotation,v.modifier,v.self,v.namespace],color:PY},{tag:[v.typeName,v.className],color:zY},{tag:[v.operator,v.operatorKeyword],color:BY},{tag:[v.tagName],color:VY},{tag:[v.squareBracket],color:LY},{tag:[v.angleBracket],color:RY},{tag:[v.attributeName],color:zY},{tag:[v.regexp],color:IY},{tag:[v.quote],color:OY},{tag:[v.string],color:RY},{tag:v.link,color:NY,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[v.url,v.escape,v.special(v.string)],color:RY},{tag:[v.meta],color:PY},{tag:[v.comment],color:kY,fontStyle:`italic`},{tag:v.strong,fontWeight:`bold`,color:IY},{tag:v.emphasis,fontStyle:`italic`,color:IY},{tag:v.strikethrough,textDecoration:`line-through`},{tag:v.heading,fontWeight:`bold`,color:IY},{tag:v.special(v.heading1),fontWeight:`bold`,color:IY},{tag:v.heading1,fontWeight:`bold`,color:IY},{tag:[v.heading2,v.heading3,v.heading4],fontWeight:`bold`,color:IY},{tag:[v.heading5,v.heading6],color:IY},{tag:[v.atom,v.bool,v.special(v.variableName)],color:RY},{tag:[v.processingInstruction,v.inserted],color:NY},{tag:[v.contentSeparator],color:zY},{tag:v.invalid,color:kY,borderBottom:`1px dotted ${HY}`}]))],XY=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,ZY=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(XY(e)):XY,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return le(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=y(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=a(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(ZY.prototype[Symbol.iterator]=function(){return this});var QY={from:-1,to:-1,match:/.*/.exec(``),precise:!0},$Y=`gm`+(/x/.unicode==null?``:`u`),eX=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=QY,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new rX(e,t,n,r,i);this.re=new RegExp(t,$Y+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=aX(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=aX(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},tX=new WeakMap,nX=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=tX.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return tX.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),tX.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},rX=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=QY,this.matchPos=aX(e,r),this.re=new RegExp(t,$Y+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=nX.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=aX(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=nX.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(eX.prototype[Symbol.iterator]=rX.prototype[Symbol.iterator]=function(){return this});function iX(e){try{return new RegExp(e,$Y),!0}catch{return!1}}function aX(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var oX=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=de(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,c,l]=i,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),d=Math.round(t.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let p=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),m=k.cursor(p.from+Math.max(0,Math.min(u,p.length)));e.dispatch({effects:[r,f.scrollIntoView(m.from,{y:`center`})],selection:m})}),!0},sX={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},cX=Ae.define({combine(e){return ce(e,sX,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function lX(e){let t=[hX,mX];return e&&t.push(cX.of(e)),t}var uX=T.mark({class:`cm-selectionMatch`}),dX=T.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function fX(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=ie.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=ie.Word)}function pX(e,t,n,r){return e(t.sliceDoc(n,n+1))==ie.Word&&e(t.sliceDoc(r-1,r))==ie.Word}var mX=ve.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(cX),{state:n}=e,r=n.selection;if(r.ranges.length>1)return T.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return T.none;let e=n.wordAt(i.head);if(!e)return T.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return T.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(fX(o,n,i.from,i.to)&&pX(o,n,i.from,i.to)))return T.none}else if(a=n.sliceDoc(i.from,i.to),!a)return T.none}let s=[];for(let r of e.visibleRanges){let e=new ZY(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||fX(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(dX.range(r,a)):(r>=i.to||a<=i.from)&&s.push(uX.range(r,a)),s.length>t.maxMatches))return T.none}}return T.set(s)}},{decorations:e=>e.decorations}),hX=f.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),gX=({state:e,dispatch:t})=>{let{selection:n}=e,r=k.create(n.ranges.map(t=>e.wordAt(t.head)||k.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function _X(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new ZY(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new ZY(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var vX=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return gX({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=_X(e,r);return i?(t(e.update({selection:e.selection.addRange(k.range(i.from,i.to),!1),effects:f.scrollIntoView(i.to)})),!0):!1},yX=Ae.define({combine(e){return ce(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new $X(e),scrollToMatch:e=>f.scrollIntoView(e)})}}),bX=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||iX(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
128
- `:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new jX(this):new TX(this)}getCursor(e,t=0,n){let r=e.doc?e:Te.create({doc:e});return n??=r.doc.length,this.regexp?DX(this,r,t,n):CX(this,r,t,n)}},xX=class{constructor(e){this.spec=e}};function SX(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function CX(e,t,n,r){let i;return e.wholeWord&&(i=wX(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=SX(e.test,t,i)),new ZY(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function wX(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(OX(i,n-a))!=ie.Word||t(kX(i,n-a))!=ie.Word)&&(t(kX(i,r-a))!=ie.Word||t(OX(i,r-a))!=ie.Word))}var TX=class extends xX{constructor(e){super(e)}nextMatch(e,t,n){let r=CX(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=CX(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=CX(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=CX(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=CX(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function EX(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function DX(e,t,n,r){let i;return e.wholeWord&&(i=AX(t.charCategorizer(t.selection.main.head))),e.test&&(i=EX(e.test,t,i)),new eX(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function OX(e,t){return e.slice(h(e,t,!1),t)}function kX(e,t){return e.slice(t,h(e,t))}function AX(e){return(t,n,r)=>!r[0].length||(e(OX(r.input,r.index))!=ie.Word||e(kX(r.input,r.index))!=ie.Word)&&(e(kX(r.input,r.index+r[0].length))!=ie.Word||e(OX(r.input,r.index+r[0].length))!=ie.Word)}var jX=class extends xX{nextMatch(e,t,n){let r=DX(this.spec,e,n,e.doc.length).next();return r.done&&(r=DX(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=DX(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=DX(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=DX(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},MX=w.define(),NX=w.define(),PX=l.define({create(e){return new FX(qX(e).create(),null)},update(e,t){for(let n of t.effects)n.is(MX)?e=new FX(n.value.create(),e.panel):n.is(NX)&&(e=new FX(e.query,n.value?KX:null));return e},provide:e=>Ce.from(e,e=>e.panel)}),FX=class{constructor(e,t){this.query=e,this.panel=t}},IX=T.mark({class:`cm-searchMatch`}),LX=T.mark({class:`cm-searchMatch cm-searchMatch-selected`}),RX=ve.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(PX))}update(e){let t=e.state.field(PX);(t!=e.startState.field(PX)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return T.none;let{view:n}=this,r=new o;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?LX:IX)})}return r.finish()}},{decorations:e=>e.decorations});function zX(e){return t=>{let n=t.state.field(PX,!1);return n&&n.query.spec.valid?e(t,n):XX(t)}}var BX=zX((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=k.single(r.from,r.to),a=e.state.facet(yX);return e.dispatch({selection:i,effects:[rZ(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),YX(e),!0}),VX=zX((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=k.single(i.from,i.to),o=e.state.facet(yX);return e.dispatch({selection:a,effects:[rZ(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),YX(e),!0}),HX=zX((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:k.create(n.map(e=>k.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),UX=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new ZY(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(k.range(t.value.from,t.value.to))}return t(e.update({selection:k.create(a,o),userEvent:`select.search.matches`})),!0},WX=zX((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),u.push(f.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let d=e.state.changes(s);return o&&(c=k.single(o.from,o.to).map(d),u.push(rZ(e,o)),u.push(n.facet(yX).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),GX=zX((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:f.announce.of(r),userEvent:`input.replace.all`}),!0});function KX(e){return e.state.facet(yX).createPanel(e)}function qX(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(yX);return new bX({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function JX(e){let t=b(e,KX);return t&&t.dom.querySelector(`[main-field]`)}function YX(e){let t=JX(e);t&&t==e.root.activeElement&&t.select()}var XX=e=>{let t=e.state.field(PX,!1);if(t&&t.panel){let n=JX(e);if(n&&n!=e.root.activeElement){let r=qX(e.state,t.query.spec);r.valid&&e.dispatch({effects:MX.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[NX.of(!0),t?MX.of(qX(e.state,t.query.spec)):w.appendConfig.of(aZ)]});return!0},ZX=e=>{let t=e.state.field(PX,!1);if(!t||!t.panel)return!1;let n=b(e,KX);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:NX.of(!1)}),!0},QX=[{key:`Mod-f`,run:XX,scope:`editor search-panel`},{key:`F3`,run:BX,shift:VX,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:BX,shift:VX,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:ZX,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:UX},{key:`Mod-Alt-g`,run:oX},{key:`Mod-d`,run:vX,preventDefault:!0}],$X=class{constructor(e){this.view=e;let t=this.query=e.state.field(PX).query.spec;this.commit=this.commit.bind(this),this.searchField=ne(`input`,{value:t.search,placeholder:eZ(e,`Find`),"aria-label":eZ(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=ne(`input`,{value:t.replace,placeholder:eZ(e,`Replace`),"aria-label":eZ(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=ne(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=ne(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=ne(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return ne(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=ne(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>BX(e),[eZ(e,`next`)]),n(`prev`,()=>VX(e),[eZ(e,`previous`)]),n(`select`,()=>HX(e),[eZ(e,`all`)]),ne(`label`,null,[this.caseField,eZ(e,`match case`)]),ne(`label`,null,[this.reField,eZ(e,`regexp`)]),ne(`label`,null,[this.wordField,eZ(e,`by word`)]),...e.state.readOnly?[]:[ne(`br`),this.replaceField,n(`replace`,()=>WX(e),[eZ(e,`replace`)]),n(`replaceAll`,()=>GX(e),[eZ(e,`replace all`)])],ne(`button`,{name:`close`,onclick:()=>ZX(e),"aria-label":eZ(e,`close`),type:`button`},[`×`])])}commit(){let e=new bX({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:MX.of(e)}))}keydown(e){P(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?VX:BX)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),WX(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(MX)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(yX).top}};function eZ(e,t){return e.state.phrase(t)}var tZ=30,nZ=/[\s\.,:;?!]/;function rZ(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-tZ),o=Math.min(i,n+tZ),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<tZ;e++)if(!nZ.test(s[e+1])&&nZ.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-tZ;e--)if(!nZ.test(s[e-1])&&nZ.test(s[e])){s=s.slice(0,e);break}}return f.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var iZ=f.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),aZ=[PX,ke.low(RX),iZ],oZ=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},sZ=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(xZ).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),s=new o,c=[],l=0,u=r.doc.iter(),d=0,f=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!c.length)break;let n,r;if(c.length)n=l,r=c.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>f)break;r=t.to,c.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))c.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,f);let i=!1;if(c.some(e=>e.from==n&&(e.to==r||r==f))&&(i=n==r,!i&&r-n<10)){let e=n-(d+u.value.length);e>0&&(u.next(e),d=n);for(let e=n;;){if(e>=r){i=!0;break}if(!u.lineBreak&&d+u.value.length>e)break;e=d+u.value.length,d+=u.value.length,u.next()}}let o=MZ(c);if(i)s.add(n,n,T.widget({widget:new TZ(o),diagnostics:c.slice()}));else{let e=c.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);s.add(n,r,T.mark({class:`cm-lintRange cm-lintRange-`+o+e,diagnostics:c.slice(),inclusiveEnd:c.some(e=>e.to>r)}))}if(l=r,l==f)break;for(let e=0;e<c.length;e++)c[e].to<=l&&c.splice(e--,1)}let p=s.finish();return new e(p,n,cZ(p))}};function cZ(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new oZ(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new oZ(r.from,n,r.diagnostic)}),r}function lZ(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(xZ).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(dZ))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function uZ(e,t){return e.field(mZ,!1)?t:t.concat(w.appendConfig.of(NZ))}var dZ=w.define(),fZ=w.define(),pZ=w.define(),mZ=l.define({create(){return new sZ(T.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=cZ(n,e.selected.diagnostic,i)||cZ(n,null,i)}!n.size&&i&&t.state.facet(xZ).autoPanel&&(i=null),e=new sZ(n,i,r)}for(let n of t.effects)if(n.is(dZ)){let r=t.state.facet(xZ).autoPanel?n.value.length?DZ.open:null:e.panel;e=sZ.init(n.value,r,t.state)}else n.is(fZ)?e=new sZ(e.diagnostics,n.value?DZ.open:null,e.selected):n.is(pZ)&&(e=new sZ(e.diagnostics,e.panel,n.value));return e},provide:e=>[Ce.from(e,e=>e.panel),f.decorations.from(e,e=>e.diagnostics)]}),hZ=T.mark({class:`cm-lintRange cm-lintRange-active`});function gZ(e,t,n){let{diagnostics:r}=e.state.field(mZ),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(xZ).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:_Z(e,i)}}}:null}function _Z(e,t){return ne(`ul`,{class:`cm-tooltip-lint`},t.map(t=>wZ(e,t,!1)))}var vZ=e=>{let t=e.state.field(mZ,!1);(!t||!t.panel)&&e.dispatch({effects:uZ(e.state,[fZ.of(!0)])});let n=b(e,DZ.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},yZ=e=>{let t=e.state.field(mZ,!1);return!t||!t.panel?!1:(e.dispatch({effects:fZ.of(!1)}),!0)},bZ=[{key:`Mod-Shift-m`,run:vZ,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(mZ,!1);if(!t)return!1;let n=e.state.selection.main,r=cZ(t.diagnostics,null,n.to+1);return!r&&(r=cZ(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],xZ=Ae.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...ce(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:SZ,tooltipFilter:SZ,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function SZ(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function CZ(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function wZ(e,t,n){let r=n?CZ(t.actions):[];return ne(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},ne(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=cZ(e.state.field(mZ).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),ne(`u`,s.slice(c,c+1)),s.slice(c+1)];return ne(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&ne(`div`,{class:`cm-diagnosticSource`},t.source))}var TZ=class extends d{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return ne(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},EZ=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=wZ(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},DZ=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)yZ(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=CZ(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=cZ(this.view.state.field(mZ).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=ne(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=ne(`div`,{class:`cm-panel-lint`},this.list,ne(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>yZ(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(mZ).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(mZ),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new EZ(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new EZ(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=cZ(this.view.state.field(mZ).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:pZ.of(t)})}static open(t){return new e(t)}};function OZ(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function kZ(e){return OZ(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var AZ=f.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:kZ(`#d11`)},".cm-lintRange-warning":{backgroundImage:kZ(`orange`)},".cm-lintRange-info":{backgroundImage:kZ(`#999`)},".cm-lintRange-hint":{backgroundImage:kZ(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function jZ(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function MZ(e){let t=`hint`,n=1;for(let r of e){let e=jZ(r.severity);e>n&&(n=e,t=r.severity)}return t}var NZ=[mZ,f.decorations.compute([mZ],e=>{let{selected:t,panel:n}=e.field(mZ);return!t||!n||t.from==t.to?T.none:T.set([hZ.range(t.from,t.to)])}),ye(gZ,{hideOn:lZ}),AZ],PZ=[j(),Se(),me(),hq(),re(),E(),O(),Te.allowMultipleSelections.of(!0),Ee(),i(te,{fallback:!0}),ue(),NK(),XK(),be(),D(),ee(),lX(),oe.of([...zK,...SY,...QX,...Pq,...we,...ZK,...bZ])];me(),hq(),E(),i(te,{fallback:!0}),oe.of([...SY,...Pq]);function FZ(e,[t,n]){return Math.min(n,Math.max(t,e))}function IZ(e){let t=I.useRef({value:e,previous:e});return I.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var LZ=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),RZ=`VisuallyHidden`,zZ=I.forwardRef((e,t)=>(0,L.jsx)(aN.span,{...e,ref:t,style:{...LZ,...e.style}}));zZ.displayName=RZ;var BZ=zZ,VZ=[` `,`Enter`,`ArrowUp`,`ArrowDown`],HZ=[` `,`Enter`],UZ=`Select`,[WZ,GZ,KZ]=ER(UZ),[qZ,nne]=XM(UZ,[KZ,tI]),JZ=tI(),[YZ,XZ]=qZ(UZ),[ZZ,QZ]=qZ(UZ),$Z=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=JZ(t),[g,_]=I.useState(null),[v,y]=I.useState(null),[b,x]=I.useState(!1),S=OR(l),[C,w]=kI({prop:r,defaultProp:i??!1,onChange:a,caller:UZ}),[T,E]=kI({prop:o,defaultProp:s,onChange:c,caller:UZ}),D=I.useRef(null),O=g?m||!!g.closest(`form`):!0,[k,A]=I.useState(new Set),j=Array.from(k).map(e=>e.props.value).join(`;`);return(0,L.jsx)(_I,{...h,children:(0,L.jsxs)(YZ,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:IN(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[(0,L.jsx)(WZ.Provider,{scope:t,children:(0,L.jsx)(ZZ,{scope:e.__scopeSelect,onNativeOptionAdd:I.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:I.useCallback(e=>{A(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),O?(0,L.jsxs)(JQ,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:e=>E(e.target.value),disabled:f,form:m,children:[T===void 0?(0,L.jsx)(`option`,{value:``}):null,Array.from(k)]},j):null]})})};$Z.displayName=UZ;var eQ=`SelectTrigger`,tQ=I.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=JZ(n),o=XZ(eQ,n),s=o.disabled||r,c=YM(t,o.onTriggerChange),l=GZ(n),u=I.useRef(`touch`),[d,f,p]=XQ(e=>{let t=l().filter(e=>!e.disabled),n=ZQ(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,L.jsx)(vI,{asChild:!0,...a,children:(0,L.jsx)(aN.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":YQ(o.value)?``:void 0,...i,ref:c,onClick:KM(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:KM(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:KM(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&VZ.includes(e.key)&&(m(),e.preventDefault())})})})});tQ.displayName=eQ;var nQ=`SelectValue`,rQ=I.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=XZ(nQ,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=YM(t,c.onValueNodeChange);return NN(()=>{l(u)},[l,u]),(0,L.jsx)(aN.span,{...s,ref:d,style:{pointerEvents:`none`},children:YQ(c.value)?(0,L.jsx)(L.Fragment,{children:o}):a})});rQ.displayName=nQ;var iQ=`SelectIcon`,aQ=I.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,L.jsx)(aN.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});aQ.displayName=iQ;var oQ=`SelectPortal`,sQ=e=>(0,L.jsx)(SI,{asChild:!0,...e});sQ.displayName=oQ;var cQ=`SelectContent`,lQ=I.forwardRef((e,t)=>{let n=XZ(cQ,e.__scopeSelect),[r,i]=I.useState();if(NN(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?Na.createPortal((0,L.jsx)(dQ,{scope:e.__scopeSelect,children:(0,L.jsx)(WZ.Slot,{scope:e.__scopeSelect,children:(0,L.jsx)(`div`,{children:e.children})})}),t):null}return(0,L.jsx)(hQ,{...e,ref:t})});lQ.displayName=cQ;var uQ=10,[dQ,fQ]=qZ(cQ),pQ=`SelectContentImpl`,mQ=QM(`SelectContent.RemoveScroll`),hQ=I.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=XZ(cQ,n),[y,b]=I.useState(null),[x,S]=I.useState(null),C=YM(t,e=>b(e)),[w,T]=I.useState(null),[E,D]=I.useState(null),O=GZ(n),[k,A]=I.useState(!1),j=I.useRef(!1);I.useEffect(()=>{if(y)return BI(y)},[y]),bN();let M=I.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),N=I.useCallback(()=>M([w,y]),[M,w,y]);I.useEffect(()=>{k&&N()},[k,N]);let{onOpenChange:P,triggerPointerDownPosRef:F}=v;I.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||P(!1),document.removeEventListener(`pointermove`,t),F.current=null};return F.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,P,F]),I.useEffect(()=>{let e=()=>P(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[P]);let[ee,te]=XQ(e=>{let t=O().filter(e=>!e.disabled),n=ZQ(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ne=I.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(j.current=!0))},[v.value]),re=I.useCallback(()=>y?.focus(),[y]),ie=I.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),ae=r===`popper`?yQ:_Q,oe=ae===yQ?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,L.jsx)(dQ,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ne,selectedItem:w,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:N,selectedItemText:E,position:r,isPositioned:k,searchRef:ee,children:(0,L.jsx)(YL,{as:mQ,allowPinchZoom:!0,children:(0,L.jsx)(TN,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:KM(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,L.jsx)(hN,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,L.jsx)(ae,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...oe,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:KM(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})});hQ.displayName=pQ;var gQ=`SelectItemAlignedPosition`,_Q=I.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=XZ(cQ,n),o=fQ(cQ,n),[s,c]=I.useState(null),[l,u]=I.useState(null),d=YM(t,e=>u(e)),f=GZ(n),p=I.useRef(!1),m=I.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=I.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-uQ,d=FZ(a,[uQ,Math.max(uQ,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-uQ,d=FZ(a,[uQ,Math.max(uQ,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-uQ*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-uQ,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${uQ}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);NN(()=>y(),[y]);let[b,x]=I.useState();return NN(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,L.jsx)(bQ,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:I.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,L.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,L.jsx)(aN.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});_Q.displayName=gQ;var vQ=`SelectPopperPosition`,yQ=I.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=uQ,...a}=e,o=JZ(n);return(0,L.jsx)(yI,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});yQ.displayName=vQ;var[bQ,xQ]=qZ(cQ,{}),SQ=`SelectViewport`,CQ=I.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=fQ(SQ,n),o=xQ(SQ,n),s=YM(t,a.onViewportChange),c=I.useRef(0);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,L.jsx)(WZ.Slot,{scope:n,children:(0,L.jsx)(aN.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:KM(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-uQ*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});CQ.displayName=SQ;var wQ=`SelectGroup`,[TQ,EQ]=qZ(wQ),DQ=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=IN();return(0,L.jsx)(TQ,{scope:n,id:i,children:(0,L.jsx)(aN.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});DQ.displayName=wQ;var OQ=`SelectLabel`,kQ=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=EQ(OQ,n);return(0,L.jsx)(aN.div,{id:i.id,...r,ref:t})});kQ.displayName=OQ;var AQ=`SelectItem`,[jQ,MQ]=qZ(AQ),NQ=I.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=XZ(AQ,n),c=fQ(AQ,n),l=s.value===r,[u,d]=I.useState(a??``),[f,p]=I.useState(!1),m=YM(t,e=>c.itemRefCallback?.(e,r,i)),h=IN(),g=I.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,L.jsx)(jQ,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:I.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,L.jsx)(WZ.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,L.jsx)(aN.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:KM(o.onFocus,()=>p(!0)),onBlur:KM(o.onBlur,()=>p(!1)),onClick:KM(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:KM(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:KM(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:KM(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:KM(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:KM(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(HZ.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});NQ.displayName=AQ;var PQ=`SelectItemText`,FQ=I.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=XZ(PQ,n),s=fQ(PQ,n),c=MQ(PQ,n),l=QZ(PQ,n),[u,d]=I.useState(null),f=YM(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=I.useMemo(()=>(0,L.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return NN(()=>(h(m),()=>g(m)),[h,g,m]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(aN.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Na.createPortal(a.children,o.valueNode):null]})});FQ.displayName=PQ;var IQ=`SelectItemIndicator`,LQ=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return MQ(IQ,n).isSelected?(0,L.jsx)(aN.span,{"aria-hidden":!0,...r,ref:t}):null});LQ.displayName=IQ;var RQ=`SelectScrollUpButton`,zQ=I.forwardRef((e,t)=>{let n=fQ(RQ,e.__scopeSelect),r=xQ(RQ,e.__scopeSelect),[i,a]=I.useState(!1),o=YM(t,r.onScrollButtonChange);return NN(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,L.jsx)(HQ,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});zQ.displayName=RQ;var BQ=`SelectScrollDownButton`,VQ=I.forwardRef((e,t)=>{let n=fQ(BQ,e.__scopeSelect),r=xQ(BQ,e.__scopeSelect),[i,a]=I.useState(!1),o=YM(t,r.onScrollButtonChange);return NN(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,L.jsx)(HQ,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});VQ.displayName=BQ;var HQ=I.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=fQ(`SelectScrollButton`,n),o=I.useRef(null),s=GZ(n),c=I.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return I.useEffect(()=>()=>c(),[c]),NN(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,L.jsx)(aN.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:KM(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:KM(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:KM(i.onPointerLeave,()=>{c()})})}),UQ=`SelectSeparator`,WQ=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,L.jsx)(aN.div,{"aria-hidden":!0,...r,ref:t})});WQ.displayName=UQ;var GQ=`SelectArrow`,KQ=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=JZ(n),a=XZ(GQ,n),o=fQ(GQ,n);return a.open&&o.position===`popper`?(0,L.jsx)(bI,{...i,...r,ref:t}):null});KQ.displayName=GQ;var qQ=`SelectBubbleInput`,JQ=I.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=I.useRef(null),a=YM(r,i),o=IZ(t);return I.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,L.jsx)(aN.select,{...n,style:{...LZ,...n.style},ref:a,defaultValue:t})});JQ.displayName=qQ;function YQ(e){return e===``||e===void 0}function XQ(e){let t=sN(e),n=I.useRef(``),r=I.useRef(0),i=I.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=I.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function ZQ(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=QQ(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function QQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var $Q=$Z,e$=tQ,t$=rQ,n$=aQ,r$=sQ,i$=lQ,a$=CQ,o$=NQ,s$=FQ,c$=WQ,[l$,rne]=XM(`Tooltip`,[tI]),u$=tI(),d$=`TooltipProvider`,f$=700,p$=`tooltip.open`,[m$,h$]=l$(d$),g$=e=>{let{__scopeTooltip:t,delayDuration:n=f$,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=I.useRef(!0),s=I.useRef(!1),c=I.useRef(0);return I.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,L.jsx)(m$,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:I.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:I.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:I.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};g$.displayName=d$;var _$=`Tooltip`,[v$,y$]=l$(_$),b$=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=h$(_$,e.__scopeTooltip),l=u$(t),[u,d]=I.useState(null),f=IN(),p=I.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=I.useRef(!1),[_,v]=kI({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(p$))):c.onClose(),a?.(e)},caller:_$}),y=I.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=I.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=I.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=I.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return I.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,L.jsx)(_I,{...l,children:(0,L.jsx)(v$,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:I.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:I.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};b$.displayName=_$;var x$=`TooltipTrigger`,S$=I.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=y$(x$,n),a=h$(x$,n),o=u$(n),s=YM(t,I.useRef(null),i.onTriggerChange),c=I.useRef(!1),l=I.useRef(!1),u=I.useCallback(()=>c.current=!1,[]);return I.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,L.jsx)(vI,{asChild:!0,...o,children:(0,L.jsx)(aN.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:KM(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:KM(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:KM(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:KM(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:KM(e.onBlur,i.onClose),onClick:KM(e.onClick,i.onClose)})})});S$.displayName=x$;var C$=`TooltipPortal`,[w$,T$]=l$(C$,{forceMount:void 0}),E$=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=y$(C$,t);return(0,L.jsx)(w$,{scope:t,forceMount:n,children:(0,L.jsx)(wI,{present:n||a.open,children:(0,L.jsx)(SI,{asChild:!0,container:i,children:r})})})};E$.displayName=C$;var D$=`TooltipContent`,O$=I.forwardRef((e,t)=>{let n=T$(D$,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=y$(D$,e.__scopeTooltip);return(0,L.jsx)(wI,{present:r||o.open,children:o.disableHoverableContent?(0,L.jsx)(N$,{side:i,...a,ref:t}):(0,L.jsx)(k$,{side:i,...a,ref:t})})}),k$=I.forwardRef((e,t)=>{let n=y$(D$,e.__scopeTooltip),r=h$(D$,e.__scopeTooltip),i=I.useRef(null),a=YM(t,i),[o,s]=I.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=I.useCallback(()=>{s(null),d(!1)},[d]),p=I.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=L$(r,I$(r,n.getBoundingClientRect())),a=R$(t.getBoundingClientRect());s(B$([...i,...a])),d(!0)},[d]);return I.useEffect(()=>()=>f(),[f]),I.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),I.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!z$(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,L.jsx)(N$,{...e,ref:a})}),[A$,j$]=l$(_$,{isInside:!1}),M$=tN(`TooltipContent`),N$=I.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=y$(D$,n),l=u$(n),{onClose:u}=c;return I.useEffect(()=>(document.addEventListener(p$,u),()=>document.removeEventListener(p$,u)),[u]),I.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,L.jsx)(hN,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,L.jsxs)(yI,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,L.jsx)(M$,{children:r}),(0,L.jsx)(A$,{scope:n,isInside:!0,children:(0,L.jsx)(BZ,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});O$.displayName=D$;var P$=`TooltipArrow`,F$=I.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=u$(n);return j$(P$,n).isInside?null:(0,L.jsx)(bI,{...i,...r,ref:t})});F$.displayName=P$;function I$(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function L$(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function R$(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function z$(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function B$(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),V$(t)}function V$(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var H$=g$,U$=b$,W$=S$,G$=E$,K$=O$,q$=F$,J$=I.forwardRef(({title:e,children:t},n)=>{let r=Hd(qO);return I.createElement(H$,{delayDuration:100},I.createElement(U$,null,I.createElement(W$,{ref:n,asChild:!0},I.createElement(`span`,{className:J.tooltipTrigger},t)),I.createElement(G$,{container:r?.current},I.createElement(K$,{className:(0,_j.default)(J.tooltipContent),sideOffset:10},e))))}),Y$=I.forwardRef(({children:e,className:t,...n},r)=>I.createElement(o$,{...n,ref:r,className:(0,_j.default)(t,J.selectItem)},I.createElement(s$,null,e))),X$=({title:e,placeholder:t,className:n})=>{let[r,i]=Ud(SO,uk);return I.createElement(J$,{title:e},I.createElement(e$,{"aria-label":t,className:(0,_j.default)(J.selectTrigger,n),"data-toolbar-item":!0,disabled:r},I.createElement(t$,{placeholder:t}),I.createElement(n$,{className:J.selectDropdownArrow},i(`arrow_drop_down`))))},Z$=({children:e,className:t=J.selectContainer})=>{let n=Hd(qO);return I.createElement(r$,{container:n?.current},I.createElement(i$,{className:(0,_j.default)(t,`mdxeditor-select-content`),onCloseAutoFocus:e=>{e.preventDefault()},position:`popper`},I.createElement(a$,{"data-editor-dropdown":!0,style:{maxHeight:`var(--radix-select-content-available-height)`}},e)))},Q$=e=>I.createElement($Q,{value:e.value||``,onValueChange:e.onChange,disabled:e.disabled},I.createElement(X$,{title:e.triggerTitle,placeholder:e.placeholder}),I.createElement(Z$,null,e.items.map((e,t)=>e===`separator`?I.createElement(c$,{key:t}):I.createElement(Y$,{key:t,value:e.value},e.label)))),$$=({language:e,nodeKey:t,code:n,focusEmitter:r})=>{let i=Rk(),{parentEditor:a,lexicalNode:o}=$W(),[s,c,l,u,d]=Ud(SO,a1,o1,uk,r1),p=wY(t,`codeblock`,e,r),{setCode:m}=$W(),h=I.useRef(null),g=I.useRef(null),{value:_,items:v}=I.useMemo(()=>n1(d,e),[d,e]),y=I.useRef(m);return y.current=m,p.current={getCodemirror:()=>h.current},I.useEffect(()=>{let t=g.current;return(async()=>{let r=[...c,PZ,YY,j(),oe.of([CY]),f.lineWrapping,f.updateListener.of(({state:e})=>{y.current(e.doc.toString())}),f.domEventHandlers({focus:()=>{a.update(()=>{R_(null)})}})];if(s&&r.push(Te.readOnly.of(!0)),e!==``){let t=d.keyMap[e]??e,n=d.supportMap[t];if(n)r.push(n.extension);else if(l){let t=EY.find(t=>t.name===e||t.alias.includes(e)||t.extensions.includes(e));if(t)try{let e=await t.load();r.push(e.extension)}catch{console.warn(`failed to load language support for`,e)}}}t.innerHTML=``,h.current=new f({parent:t,state:Te.create({doc:n,extensions:r})}),t.addEventListener(`keydown`,e1)})(),()=>{var e;(e=h.current)==null||e.destroy(),h.current=null,t.removeEventListener(`keydown`,e1)}},[s,e,...c]),I.createElement(`div`,{className:J.codeMirrorWrapper},I.createElement(`div`,{className:J.codeMirrorToolbar},I.createElement(Q$,{disabled:s,value:_,onChange:e=>{a.update(()=>{o.setLanguage(e===`__EMPTY_VALUE__`?``:e),setTimeout(()=>{a.update(()=>{o.getLatest().select()})})})},triggerTitle:i(`codeBlock.selectLanguage`,`Select code block language`),placeholder:i(`codeBlock.inlineLanguage`,`Language`),items:v}),I.createElement(`button`,{className:J.iconButton,type:`button`,disabled:s,title:i(`codeblock.delete`,`Delete code block`),onClick:e=>{e.preventDefault(),a.update(()=>{o.remove()})}},u(`delete_small`))),I.createElement(`div`,{ref:g}))};function e1(e){e.stopPropagation()}function t1(e){let t=[],n={},r={};if(Array.isArray(e))for(let i of e){let e=i.alias?.[0]??i.name.toLowerCase(),a=e||`__EMPTY_VALUE__`;if(t.push({value:a,label:i.name}),n[e]=a,i.alias)for(let e of i.alias)n[e]=a;if(i.extensions)for(let e of i.extensions)n[e]=a;n[i.name.toLowerCase()]=a,i.support&&(r[a]=i.support)}else{let r={};for(let[i,a]of Object.entries(e))a in r||(r[a]=i,t.push({value:i||`__EMPTY_VALUE__`,label:a})),n[i]=r[a]||`__EMPTY_VALUE__`}return{items:t,keyMap:n,supportMap:r}}function n1(e,t){let n=e.keyMap[t]??t;return!n||e.items.some(e=>e.value===n)?{value:n,items:e.items}:{value:n,items:[...e.items,{value:n,label:t}]}}var r1=B(t1({js:`JavaScript`,ts:`TypeScript`,tsx:`TypeScript (React)`,jsx:`JavaScript (React)`,css:`CSS`})),i1=Rd(e=>{e.link(e.pipe(i1,Gd(({language:e,code:t})=>({code:t,language:e,meta:``}))),sG)}),a1=B([]),o1=B(!0),s1=Zd({update(e,t){e.pubIn({[r1]:t1(t?.codeBlockLanguages??{}),[a1]:t?.codeMirrorExtensions??[],[o1]:t?.autoLoadLanguageSupport??!0})},init(e,t){let n=t1(t?.codeBlockLanguages??{});e.pubIn({[r1]:n,[a1]:t?.codeMirrorExtensions??[],[cG]:c1(),[o1]:t?.autoLoadLanguageSupport??!0})}});function c1(e){return{match(e,t){return!t},priority:1,Editor:$$}}function l1({url:e,title:t,text:n,onSubmit:r,onCancel:i,linkAutocompleteSuggestions:a,showLinkTitleField:o,showAnchorTextField:s}){let{register:c,handleSubmit:l,control:u,setValue:d,reset:f}=ZV({values:{url:e,title:t,text:n}}),p=Rk();return I.createElement(`form`,{onSubmit:e=>{l(r)(e),e.stopPropagation(),e.preventDefault()},onReset:e=>{e.stopPropagation(),i()},onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),i())},className:(0,_j.default)(J.multiFieldForm,J.linkDialogEditForm)},I.createElement(`div`,{className:J.formField},I.createElement(`label`,{htmlFor:`link-url`},p(`createLink.url`,`URL`)),I.createElement(BW,{register:c,initialInputValue:e,inputName:`url`,suggestions:a,setValue:d,control:u,placeholder:p(`createLink.urlPlaceholder`,`Select or paste an URL`),autofocus:!0})),s?I.createElement(`div`,{className:J.formField},I.createElement(`label`,{htmlFor:`link-text`,title:p(`createLink.textTooltip`,`The text to be displayed for the link`)},p(`createLink.text`,`Anchor text`)),I.createElement(`input`,{id:`link-text`,className:J.textInput,size:40,...c(`text`)})):null,o?I.createElement(`div`,{className:J.formField},I.createElement(`label`,{htmlFor:`link-title`,title:p(`createLink.titleTooltip`,`The link's title attribute, shown on hover`)},p(`createLink.title`,`Link title`)),I.createElement(`input`,{id:`link-title`,className:J.textInput,size:40,...c(`title`)})):null,I.createElement(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:`var(--spacing-2)`}},I.createElement(`button`,{type:`submit`,title:p(`createLink.saveTooltip`,`Set URL`),"aria-label":p(`createLink.saveTooltip`,`Set URL`),className:(0,_j.default)(J.primaryButton)},p(`dialogControls.save`,`Save`)),I.createElement(`button`,{type:`reset`,title:p(`createLink.cancelTooltip`,`Cancel change`),"aria-label":p(`createLink.cancelTooltip`,`Cancel change`),className:(0,_j.default)(J.secondaryButton)},p(`dialogControls.cancel`,`Cancel`))))}var u1=()=>{let[e,t,n,r,i,a,o]=Ud(qO,yO,uk,m1,b1,x1,w1),s=Wd(p1),c=Wd(h1),l=Wd(g1),u=Wd(_1),d=Wd(v1);I.useEffect(()=>{let e=()=>{t?.getEditorState().read(()=>{s(!0)})};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e)}},[t,s]);let[f,p]=I.useState(!1),m=Rk();if(r.type===`inactive`)return null;let h=r.rectangle,g=r.type===`preview`&&r.url.startsWith(`http`);return I.createElement(xR,{open:!0},I.createElement(SR,{"data-visible":r.type===`edit`,className:J.linkDialogAnchor,style:{top:`${h.top}px`,left:`${h.left}px`,width:`${h.width}px`,height:`${h.height}px`}}),I.createElement(CR,{container:e?.current},I.createElement(wR,{className:(0,_j.default)(J.linkDialogPopoverContent),sideOffset:5,onOpenAutoFocus:e=>{e.preventDefault()},key:r.linkNodeKey},r.type===`edit`&&I.createElement(l1,{url:r.url,title:r.title,text:r.text,onSubmit:c,onCancel:l.bind(null),linkAutocompleteSuggestions:i,showLinkTitleField:o,showAnchorTextField:r.withAnchorText}),r.type===`preview`&&I.createElement(I.Fragment,null,I.createElement(`a`,{className:J.linkDialogPreviewAnchor,href:r.url,...g?{target:`_blank`,rel:`noreferrer`}:{},onClick:e=>{a!==null&&(e.preventDefault(),a(r.url))},title:g?m(`linkPreview.open`,`Open {{url}} in new window`,{url:r.url}):r.url},I.createElement(`span`,null,r.url),g&&n(`open_in_new`)),I.createElement(d1,{onClick:()=>{u()},title:m(`linkPreview.edit`,`Edit link URL`),"aria-label":m(`linkPreview.edit`,`Edit link URL`)},n(`edit`)),I.createElement(H$,null,I.createElement(U$,{open:f},I.createElement(W$,{asChild:!0},I.createElement(d1,{title:m(`linkPreview.copyToClipboard`,`Copy to clipboard`),"aria-label":m(`linkPreview.copyToClipboard`,`Copy to clipboard`),onClick:()=>{window.navigator.clipboard.writeText(r.url).then(()=>{p(!0),setTimeout(()=>{p(!1)},1e3)})}},n(f?`check`:`content_copy`))),I.createElement(G$,{container:e?.current},I.createElement(K$,{className:(0,_j.default)(J.tooltipContent),sideOffset:5},m(`linkPreview.copied`,`Copied!`),I.createElement(q$,null))))),I.createElement(d1,{title:m(`linkPreview.remove`,`Remove link`),"aria-label":m(`linkPreview.remove`,`Remove link`),onClick:()=>{d()}},n(`link_off`))),I.createElement(TR,{className:J.popoverArrow}))))},d1=I.forwardRef(({className:e,...t},n)=>I.createElement(`button`,{className:(0,_j.default)(J.actionButton,e),ref:n,...t}));function f1(e){if(!e)return null;let t=dj(e);if(t===null)return null;let n=t.getParent();return pA(n)?n:pA(t)?t:null}var p1=Rd(),m1=B({type:`inactive`},e=>{e.pub(mk,t=>t.registerCommand(_m,()=>e.getValue(m1).type===`preview`?(e.pub(m1,{type:`inactive`}),!0):!1,1)),e.sub(e.pipe(jk),t=>{t!==`rich-text`&&e.pub(m1,{type:`inactive`})}),e.pub(mk,t=>t.registerCommand(sm,t=>t.key===`k`&&(Dj?t.metaKey:t.ctrlKey)&&!e.getValue(SO)&&U(W())?(e.pub(y1),t.stopPropagation(),t.preventDefault(),!0):!1,3)),e.sub(e.pipe(_1,Kd(m1,yO)),([,t,n])=>{if(t.type===`preview`)setTimeout(()=>{n?.getEditorState().read(()=>{let n=A_(t.linkNodeKey),r=pA(n)?n.getTextContent().length>0&&n.getChildrenSize()<=1:!1,i=r&&n?n.getTextContent():``;e.pub(m1,{type:`edit`,initialUrl:t.url,url:t.url,title:t.title,text:i,withAnchorText:r,linkNodeKey:t.linkNodeKey,rectangle:t.rectangle})})});else throw Error(`Cannot switch to edit mode when not in preview mode`)}),e.sub(e.pipe(h1,Kd(yO,m1,AO)),([t,n,r,i])=>{let a=t.text?.trim()??``,o=t.url?.trim()??``,s=t.title?.trim()??``;if(o!==``){if(i?.isCollapsed()){let e=a||s||o;n?.update(()=>{let t=f1(i);if(!t){let t=fA(o,{title:s});t.append(Nh(e)),fg([t]),t.select()}else if(gA(t)){let e=fA(o,{title:s});e.append(Nh(a)),t.replace(e),e.select()}else t.setURL(o),t.setTitle(s),C1(t.getFirstChild(),a)},{discrete:!0})}else n?.update(()=>{C1(i?.anchor.getNode(),a)}),n?.dispatchCommand(_A,{url:o,title:s});e.pub(m1,{type:`preview`,linkNodeKey:r.linkNodeKey,rectangle:r.rectangle,title:s,url:o})}else r.type===`edit`&&r.initialUrl!==``&&n?.dispatchCommand(_A,null),e.pub(m1,{type:`inactive`})}),e.link(e.pipe(g1,Kd(m1,yO),Gd(([,e,t])=>{if(e.type===`edit`)return t?.focus(),e.initialUrl===``?{type:`inactive`}:{type:`preview`,url:e.initialUrl,linkNodeKey:e.linkNodeKey,rectangle:e.rectangle};throw Error(`Cannot cancel edit when not in edit mode`)})),m1),e.link(e.pipe(e.combine(AO,p1),Kd(yO,m1,SO),Gd(([[e],t,n,r])=>{if(U(e)&&t&&!r){let n=f1(e);if(!e.isCollapsed())return{type:`inactive`};if(n){let e=hj(t);return e?{type:`preview`,url:n.getURL(),linkNodeKey:n.getKey(),title:n.getTitle(),rectangle:e}:{type:`inactive`}}else return{type:`inactive`}}else return{type:`inactive`}})),m1)}),h1=Rd(),g1=zd();zd();var _1=zd(),v1=zd(e=>{e.sub(e.pipe(v1,Kd(yO)),([,e])=>{e?.dispatchCommand(_A,null)})}),y1=zd(e=>{e.sub(e.pipe(y1,Kd(AO,yO),qd(([,e])=>U(e))),([,t,n])=>{n?.focus(()=>{setTimeout(()=>{n.getEditorState().read(()=>{let r=f1(t),i=hj(n),a=r?.getURL()??``,o=r?.getURL()??``,s=r?.getTitle()??``,c=r?.getKey()??``,l=r?r.getTextContent().length>0&&r.getChildrenSize()<=1:!!t?.isCollapsed(),u=l&&r?r.getTextContent():``;e.pub(m1,{type:`edit`,initialUrl:a,url:o,title:s,text:u,withAnchorText:l,linkNodeKey:c,rectangle:i})})})})})}),b1=B([]),x1=B(null),S1=B(null,e=>{e.pub(mk,t=>{function n(n){let[r,i]=e.getValues([SO,S1]);!r||i===null||t.update(()=>{let e=N_(n.target);if(e!==null){let t=db(e,e=>e instanceof dA);t!==null&&i(n,t,t.getURL())}})}return t.registerRootListener((e,t)=>{e&&e.addEventListener(`click`,n),t&&t.removeEventListener(`click`,n)})})});function C1(e,t){H(e)&&t&&(e.setTextContent(t),e.selectStart())}var w1=B(!0),T1=Zd({init(e,t){e.pub(_k,t?.LinkDialog??u1),e.pub(x1,t?.onClickLinkCallback??null),e.pub(S1,t?.onReadOnlyClickLinkCallback??null),e.pub(w1,t?.showLinkTitleField??!0)},update(e,t={}){e.pub(b1,t.linkAutocompleteSuggestions??[])}});function E1(e,t){return I.forwardRef((n,r)=>{let i=(0,_j.default)(t.className,n.className);return I.createElement(e,{...t,...n,className:i,ref:r})})}function D1(e){return({title:t,children:n,...r})=>I.createElement(e,{"aria-label":t,...r},I.createElement(J$,{title:t},n))}var O1=({readOnly:e,children:t,className:n})=>I.createElement(Rz,{className:(0,_j.default)(`mdxeditor-toolbar`,J.toolbarRoot,{[J.readOnlyToolbarRoot]:e},n),...e?{tabIndex:-1}:{}},t),k1=D1(E1(Bz,{className:J.toolbarButton,"data-toolbar-item":!0})),A1=E1(Hz,{className:J.toolbarToggleItem,"data-toolbar-item":!0});E1(Vz,{type:`single`,className:J.toolbarToggleSingleGroup});var j1=I.forwardRef(({on:e,title:t,children:n,disabled:r,...i},a)=>I.createElement(Vz,{type:`single`,className:J.toolbarToggleSingleGroup,...i,value:e?`on`:`off`,ref:a},I.createElement(A1,{"aria-label":t,value:`on`,disabled:r},I.createElement(J$,{title:t},n)))),M1=({items:e})=>I.createElement(`div`,{className:J.toolbarGroupOfGroups},e.map((e,t)=>I.createElement(j1,{key:t,title:e.title,on:e.active,onValueChange:t=>{e.onChange(t===`on`)},disabled:e.disabled},e.contents))),N1=({value:e,onChange:t,className:n,ggClassName:r,items:i,disabled:a})=>{let o=Rk();return I.createElement(`div`,{className:(0,_j.default)(J.toolbarGroupOfGroups,r)},I.createElement(Vz,{"aria-label":o(`toolbar.toggleGroup`,`toggle group`),type:`single`,className:(0,_j.default)(J.toolbarToggleSingleGroup,n),onValueChange:t,value:e||``,disabled:a,onFocus:e=>{e.preventDefault()}},i.map((e,t)=>I.createElement(A1,{key:t,"aria-label":e.title,value:e.value},I.createElement(J$,{title:e.title},e.contents)))))},P1=B(()=>null),F1=B(``),I1=()=>"This is an empty toolbar. Pass `{toolbarContents: () => { return <>toolbar components</> }}` to the toolbarPlugin to customize it.",L1=Zd({init(e,t){let n=t?.toolbarPosition===`bottom`?xk:yk;e.pubIn({[P1]:t?.toolbarContents??I1,[F1]:t?.toolbarClassName??``,[n]:()=>{let[e,t,n]=Ud(P1,SO,F1);return I.createElement(O1,{className:n,readOnly:t},e())}})},update(e,t){e.pub(P1,t?.toolbarContents??I1),e.pub(F1,t?.toolbarClassName??``)}});Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend(`clike`,{"class-name":[Prism.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),Prism.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined(`script`,`javascript`),Prism.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside[`attr-value`].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside[`internal-subset`].inside=Prism.languages.markup,Prism.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(Prism.languages.markup.tag,`addInlined`,{value:function(e,t){var n={};n[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r[`language-`+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore(`markup`,`cdata`,i)}}),Object.defineProperty(Prism.languages.markup.tag,`addAttribute`,{value:function(e,t){Prism.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend(`markup`,{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,(function(e){var t=`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var r="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",i=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return r}),a=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`;e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+i+a+`(?:`+i+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+i+a+`)(?:`+i+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+i+`)`+a+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+i+`$`),inside:{"table-header":{pattern:RegExp(r),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:n(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:n(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){if(e.language!==`markdown`&&e.language!==`md`)return;function t(e){if(!(!e||typeof e==`string`))for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.type!==`code`){t(i.content);continue}var a=i.content[1],o=i.content[3];if(a&&o&&a.type===`code-language`&&o.type===`code-block`&&typeof a.content==`string`){var s=a.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`);s=(/[a-z][\w-]*/i.exec(s)||[``])[0].toLowerCase();var c=`language-`+s;o.alias?typeof o.alias==`string`?o.alias=[o.alias,c]:o.alias.push(c):o.alias=[c]}}}t(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],o=/language-(.+)/.exec(a);if(o){n=o[1];break}}var s=e.languages[n];if(s)t.content=e.highlight(l(t.content),s,n);else if(n&&n!==`none`&&e.plugins.autoloader){var c=`md-`+new Date().valueOf()+`-`+Math.floor(Math.random()*0x2386f26fc10000);t.attributes.id=c,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(c);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})}}});var o=RegExp(e.languages.markup.tag.pattern.source,`gi`),s={amp:`&`,lt:`<`,gt:`>`,quot:`"`},c=String.fromCodePoint||String.fromCharCode;function l(e){var t=e.replace(o,``);return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(e,t){return t=t.toLowerCase(),t[0]===`#`?c(t[1]===`x`?parseInt(t.slice(2),16):Number(t.slice(1))):s[t]||e}),t}e.languages.md=e.languages.markdown})(Prism),Prism.languages.c=Prism.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(Prism),Prism.languages.objectivec=Prism.languages.extend(`c`,{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec[`class-name`],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}})(Prism),Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python[`string-interpolation`].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,(function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(Prism),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(`(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^(])|[^\\\\\\r\\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:`punctuation`},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(`(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^#])|[^\\\\\\r\\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:`punctuation`},string:/[\s\S]+/}}],directive:{pattern:RegExp(`#(?:(?:elseif|if)\\b(?:[ ]*(?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \\t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)`),alias:`property`,inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:`constant`},"other-directive":{pattern:/#\w+\b/,alias:`property`},attribute:{pattern:/@\w+/,alias:`atrule`},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:`function`},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:`important`},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:`constant`},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:`keyword`},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift[`string-literal`].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift}),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism),(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=`(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*`,r={pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:r.inside},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)`+n+`[A-Z]\\w*\\b`),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore(`java`,`string`,{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:`string`},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore(`java`,`class-name`,{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:`punctuation`},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)`+n+`(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)`+n+`(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:`static`,inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism),(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])})(Prism);function R1(e,t){for(let n of e.childNodes){if(Tv(n)&&n.tagName===t)return!0;R1(n,t)}return!1}var z1=`data-language`,B1=`data-highlight-language`,V1=`data-theme`,H1=class e extends Hg{static getType(){return`code`}static clone(t){return new e(t.__language,t.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let t=document.createElement(`code`);ob(t,e.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(z1,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(B1,n));let r=this.getTheme();r&&t.setAttribute(V1,r);let i=this.getStyle();return i&&t.setAttribute(`style`,i),t}updateDOM(e,t,n){let r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(z1,r):i&&t.removeAttribute(z1);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&r?r!==i&&t.setAttribute(B1,r):t.removeAttribute(B1):a&&r&&t.setAttribute(B1,r);let o=this.__theme,s=e.__theme;o?o!==s&&t.setAttribute(V1,o):s&&t.removeAttribute(V1);let c=this.__style,l=e.__style;return c?c!==l&&t.setAttribute(`style`,c):l&&t.removeAttribute(`style`),!1}exportDOM(e){let t=document.createElement(`pre`);ob(t,e._config.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(z1,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(B1,n));let r=this.getTheme();r&&t.setAttribute(V1,r);let i=this.getStyle();return i&&t.setAttribute(`style`,i),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||R1(e,`BR`))?{conversion:G1,priority:1}:null,div:()=>({conversion:K1,priority:1}),pre:()=>({conversion:G1,priority:0}),table:e=>X1(e)?{conversion:q1,priority:3}:null,td:e=>{let t=e,n=t.closest(`table`);return t.classList.contains(`js-file-line`)||n&&X1(n)?{conversion:J1,priority:3}:null},tr:e=>{let t=e.closest(`table`);return t&&X1(t)?{conversion:J1,priority:3}:null}}}static importJSON(e){return U1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){let n=this.getChildren(),r=n.length;if(r>=2&&n[r-1].getTextContent()===`
129
- `&&n[r-2].getTextContent()===`
130
- `&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===r){n[r-1].remove(),n[r-2].remove();let e=r_();return this.insertAfter(e,t),e}let{anchor:i,focus:a}=e,o=(i.isBefore(a)?i:a).getNode();if(H(o)){let e=n0(o),t=[];for(;;)if(Lh(e))t.push(Ih()),e=e.getNextSibling();else{if(!e0(e))break;{let n=0,r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&r[n]===` `;)n++;if(n!==0&&t.push($1(` `.repeat(n))),n!==i)break;e=e.getNextSibling()}}let n=o.splitText(i.offset)[0],r=i.offset===0?0:1,a=n.getIndexWithinParent()+r,s=o.getParentOrThrow(),c=[hh(),...t];s.splice(a,0,c);let l=t[t.length-1];l?l.select():i.offset===0?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(W1(o)){let{offset:t}=e.anchor;o.splice(t,0,[hh()]),o.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){let e=r_();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function U1(e,t){return Vv(H1).setLanguage(e).setTheme(t)}function W1(e){return e instanceof H1}function G1(e){return{node:U1(e.getAttribute(z1))}}function K1(e){let t=e,n=Y1(t);return n||function(e){let t=e.parentElement;for(;t!==null;){if(Y1(t))return!0;t=t.parentElement}return!1}(t)?{node:n?U1():null}:{node:null}}function q1(){return{node:U1()}}function J1(){return{node:null}}function Y1(e){return e.style.fontFamily.match(`monospace`)!==null}function X1(e){return e.classList.contains(`js-file-line-container`)}var Z1=class e extends wh{constructor(e=``,t,n){super(e,n),this.__highlightType=t}static getType(){return`code-highlight`}static clone(t){return new e(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e);return ob(t,Q1(e.theme,this.__highlightType)),t}updateDOM(e,t,n){let r=super.updateDOM(e,t,n),i=Q1(n.theme,e.__highlightType),a=Q1(n.theme,this.__highlightType);return i!==a&&(i&&sb(t,i),a&&ob(t,a)),r}static importJSON(e){return $1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return U1()}};function Q1(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function $1(e=``,t){return _v(new Z1(e,t))}function e0(e){return e instanceof Z1}function t0(e,t){let n=e;for(let r=ey(e,t);r&&(e0(r.origin)||Lh(r.origin));r=cb(r))n=r.origin;return n}function n0(e){return t0(e,`previous`)}(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":`-`,"deleted-arrow":`<`,"inserted-sign":`+`,"inserted-arrow":`>`,unchanged:` `,diff:`!`};Object.keys(t).forEach((function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),n===`diff`&&i.push(`bold`),e.languages.diff[n]={pattern:RegExp(`^(?:[`+r+`].*(?:\r
131
- ?|
132
- |(?![\\s\\S])))+`,`m`),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,`PREFIXES`,{value:t})})(Prism),globalThis.Prism||window.Prism;function r0(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function i0(e){let t=r0(e,(e=>e.type));return{element:t.element||[],multilineElement:t[`multiline-element`]||[],textFormat:t[`text-format`]||[],textMatch:t[`text-match`]||[]}}var a0=/[!-/:-@[-`{-~\s]/;function o0(e){return H(e)&&!e.hasFormat(`code`)}function s0(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function c0(e,t,n){let r=n.length;for(let i=t;i>=r;i--){let t=i-r;if(l0(e,t,n,0,r)&&e[t+r]!==` `)return t}return-1}function l0(e,t,n,r,i){for(let a=0;a<i;a++)if(e[t+a]!==n[r+a])return!1;return!0}function u0(e,t=V0){let n=i0(t),r=r0(n.textFormat,(({tag:e})=>e[e.length-1])),i=r0(n.textMatch,(({trigger:e})=>e));for(let n of t){let t=n.type;if(t===`element`||t===`text-match`||t===`multiline-element`){let t=n.dependencies;for(let n of t)e.hasNode(n)||s0(173,n.getType())}}let a=(e,t,a)=>{(function(e,t,n,r){if(!hv(e.getParent())||e.getFirstChild()!==t)return!1;let i=t.getTextContent();if(i[n-1]!==` `)return!1;for(let{regExp:a,replace:o}of r){let r=i.match(a);if(r&&r[0].length===(r[0].endsWith(` `)?n:n-1)){let i=t.getNextSiblings(),[a,s]=t.splitText(n);if(!1!==o(e,s?[s,...i]:i,r,!1))return a.remove(),!0}}return!1})(e,t,a,n.element)||function(e,t,n,r){if(!hv(e.getParent())||e.getFirstChild()!==t)return!1;let i=t.getTextContent();if(i[n-1]!==` `)return!1;for(let{regExpStart:a,replace:o,regExpEnd:s}of r){if(s&&!(`optional`in s)||s&&`optional`in s&&!s.optional)continue;let r=i.match(a);if(r&&r[0].length===(r[0].endsWith(` `)?n:n-1)){let i=t.getNextSiblings(),[a,s]=t.splitText(n);if(!1!==o(e,s?[s,...i]:i,r,null,null,!1))return a.remove(),!0}}return!1}(e,t,a,n.multilineElement)||function(e,t,n){let r=e.getTextContent(),i=n[r[t-1]];if(i==null)return!1;t<r.length&&(r=r.slice(0,t));for(let t of i){if(!t.replace||!t.regExp)continue;let n=r.match(t.regExp);if(n===null)continue;let i=n.index||0,a=i+n[0].length,o;return i===0?[o]=e.splitText(a):[,o]=e.splitText(i,a),o.selectNext(0,0),t.replace(o,n),!0}return!1}(t,a,i)||function(e,t,n){let r=e.getTextContent(),i=t-1,a=r[i],o=n[a];if(!o)return!1;for(let t of o){let{tag:n}=t,o=n.length,s=i-o+1;if(o>1&&!l0(r,s,n,0,o)||r[s-1]===` `)continue;let c=r[i+1];if(!1===t.intraword&&c&&!a0.test(c))continue;let l=e,u=l,d=c0(r,s,n),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!gh(f);)if(H(f)){if(f.hasFormat(`code`))continue;let e=f.getTextContent();u=f,d=c0(e,e.length,n)}if(d<0||u===l&&d+o===s)continue;let p=u.getTextContent();if(d>0&&p[d-1]===a)continue;let m=p[d-1];if(!1===t.intraword&&m&&!a0.test(m))continue;let h=l.getTextContent(),g=h.slice(0,s)+h.slice(i+1);l.setTextContent(g);let _=u===l?g:p;u.setTextContent(_.slice(0,d)+_.slice(d+o));let v=W(),y=ng();R_(y);let b=i-o*(u===l?2:1)+1;y.anchor.set(u.__key,d,`text`),y.focus.set(l.__key,b,`text`);for(let e of t.format)y.hasFormat(e)||y.formatText(e);y.anchor.set(y.focus.key,y.focus.offset,y.focus.type);for(let e of t.format)y.hasFormat(e)&&y.toggleFormat(e);return U(v)&&(y.format=v.format),!0}}(t,a,r)};return e.registerUpdateListener((({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(`collaboration`)||t.has(`historic`)||e.isComposing())return;let o=r.read(W),s=i.read(W);if(!U(s)||!U(o)||!o.isCollapsed()||o.is(s))return;let c=o.anchor.key,l=o.anchor.offset,u=r._nodeMap.get(c);!H(u)||!n.has(c)||l!==1&&l>s.anchor.offset+1||e.update((()=>{if(!o0(u))return;let e=u.getParent();e===null||W1(e)||a(e,u,o.anchor.offset)}))}))}var d0=/^(\s*)(\d{1,})\.\s/,f0=/^(\s*)[-*+]\s/,p0=/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,m0=/^(#{1,6})\s/,h0=/^>\s/,g0=/^[ \t]*```([\w-]+)?/,_0=/[ \t]*```$/,v0=e=>(t,n,r,i)=>{let a=e(r);a.append(...n),t.replace(a),i||a.select(0,0)},y0=e=>(t,n,r,i)=>{let a=t.getPreviousSibling(),o=t.getNextSibling(),s=UA(e===`check`?r[3]===`x`:void 0);if(ZA(o)&&o.getListType()===e){let e=o.getFirstChild();e===null?o.append(s):e.insertBefore(s),t.remove()}else if(ZA(a)&&a.getListType()===e)a.append(s),t.remove();else{let n=XA(e,e===`number`?Number(r[2]):void 0);n.append(s),t.replace(n)}s.append(...n),i||s.select(0,0);let c=function(e){let t=e.match(/\t/g),n=e.match(/ /g),r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);c&&s.setIndent(c)},b0=(e,t,n)=>{let r=[],i=e.getChildren(),a=0;for(let o of i)if(WA(o)){if(o.getChildrenSize()===1){let e=o.getFirstChild();if(ZA(e)){r.push(b0(e,t,n+1));continue}}let i=` `.repeat(4*n),s=e.getListType(),c=s===`number`?`${e.getStart()+a}. `:s===`check`?`- [${o.getChecked()?`x`:` `}] `:`- `;r.push(i+c+t(o)),a++}return r.join(`
133
- `)},x0={dependencies:[dx],export:(e,t)=>{if(!gx(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:m0,replace:v0((e=>hx(`h`+e[1].length))),type:`element`},S0={dependencies:[cx],export:(e,t)=>{if(!ux(e))return null;let n=t(e).split(`
134
- `),r=[];for(let e of n)r.push(`> `+e);return r.join(`
135
- `)},regExp:h0,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if(ux(n))return n.splice(n.getChildrenSize(),0,[hh(),...t]),void e.remove()}let i=lx();i.append(...t),e.replace(i),r||i.select(0,0)},type:`element`},C0={dependencies:[H1],export:e=>{if(!W1(e))return null;let t=e.getTextContent();return"```"+(e.getLanguage()||``)+(t?`
136
- `+t:``)+"\n```"},regExpEnd:{optional:!0,regExp:_0},regExpStart:g0,replace:(e,t,n,r,i,a)=>{let o,s;if(!t&&i){if(i.length===1)r?(o=U1(),s=n[1]+i[0]):(o=U1(n[1]),s=i[0].startsWith(` `)?i[0].slice(1):i[0]);else{if(o=U1(n[1]),i[0].trim().length===0)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(` `)?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();s=i.join(`
137
- `)}let t=Nh(s);o.append(t),e.append(o)}else t&&v0((e=>U1(e?e[1]:void 0)))(e,t,n,a)},type:`multiline-element`},w0={dependencies:[GA,BA],export:(e,t)=>ZA(e)?b0(e,t,0):null,regExp:f0,replace:y0(`bullet`),type:`element`},T0={dependencies:[GA,BA],export:(e,t)=>ZA(e)?b0(e,t,0):null,regExp:p0,replace:y0(`check`),type:`element`},E0={dependencies:[GA,BA],export:(e,t)=>ZA(e)?b0(e,t,0):null,regExp:d0,replace:y0(`number`),type:`element`},D0={format:[`code`],tag:"`",type:`text-format`},O0={format:[`highlight`],tag:`==`,type:`text-format`},k0={format:[`bold`,`italic`],tag:`***`,type:`text-format`},A0={format:[`bold`,`italic`],intraword:!1,tag:`___`,type:`text-format`},j0={format:[`bold`],tag:`**`,type:`text-format`},M0={format:[`bold`],intraword:!1,tag:`__`,type:`text-format`},N0={format:[`strikethrough`],tag:`~~`,type:`text-format`},P0={format:[`italic`],tag:`*`,type:`text-format`},F0={format:[`italic`],intraword:!1,tag:`_`,type:`text-format`},I0={dependencies:[dA],export:(e,t,n)=>{if(!pA(e)||gA(e))return null;let r=e.getTitle(),i=t(e);return r?`[${i}](${e.getURL()} "${r}")`:`[${i}](${e.getURL()})`},importRegExp:/(?:\[(.*?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.*?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{let[,n,r,i]=t,a=fA(r,{title:i}),o=n.split(`[`).length-1,s=n.split(`]`).length-1,c=n,l=``;if(o<s)return;if(o>s){let e=n.split(`[`);l=`[`+e[0],c=e.slice(1).join(`[`)}let u=Nh(c);return u.setFormat(e.getFormat()),a.append(u),e.replace(a),l&&a.insertBefore(Nh(l)),u},trigger:`)`,type:`text-match`},L0=[x0,S0,w0,E0],R0=[C0],z0=[D0,k0,A0,j0,M0,O0,P0,F0,N0],B0=[I0],V0=[...L0,...R0,...z0,...B0],H0=[{dependencies:[Bj],export:e=>Uj(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=Hj();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},type:`element`},...V0];function U0({transformers:e=H0}){let[t]=tf();return(0,I.useEffect)((()=>u0(t,e)),[t,e]),null}var W0=Zd({init(e){let t=e.getValue(Nk),n=J0(t,t.includes(`headings`)?e.getValue(Pj):[]),r=n.filter(e=>!q0.has(e));e.pubIn({[_k]:()=>I.createElement(U0,{transformers:n}),[Ck]:()=>I.createElement(U0,{transformers:n}),[Tk]:()=>I.createElement(U0,{transformers:r})})}}),G0=e=>(t,n,r)=>{let i=e(r);i.append(...n),t.replace(i),i.select(0,0)},K0={dependencies:[Bj],export:e=>Uj(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=Hj();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},type:`element`},q0=new Set([E0,w0,T0]);function J0(e,t){let n=[k0,A0,j0,M0,D0,P0,F0];if(e.includes(`headings`)){let e=Math.min(...t),r=Math.max(...t),i=RegExp(`^(#{${e},${r}})\\s`),a={dependencies:[dx],export:(e,t)=>{if(!gx(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:i,replace:G0(e=>hx(`h${e[1].length}`)),type:`element`};n.push(a)}if(e.includes(`thematicBreak`)&&n.push(K0),e.includes(`quote`)&&n.push(S0),e.includes(`link`)&&n.push(I0),e.includes(`lists`)&&n.push(E0,w0,T0),e.includes(`codeblock`)){let e={...C0,dependencies:[XW],replace:(e,t,n)=>{let r=tG({code:``,language:n[1]??``,meta:``});e.selectPrevious(),e.replace(r),setTimeout(()=>{r.select()},80)}};n.push(e)}return n}var Y0=()=>{let e=Wd(kk),t=Hd(Ok),n=Hd(Nk),r=n.includes(`quote`),i=n.includes(`headings`),a=Rk();if(!r&&!i)return null;let o=[{label:a(`toolbar.blockTypes.paragraph`,`Paragraph`),value:`paragraph`}];if(r&&o.push({label:a(`toolbar.blockTypes.quote`,`Quote`),value:`quote`}),i){let e=Hd(Pj);o.push(...e.map(e=>({label:a(`toolbar.blockTypes.heading`,`Heading {{level}}`,{level:e}),value:`h${e}`})))}return I.createElement(Q$,{value:t,onChange:t=>{switch(t){case`quote`:e(()=>lx());break;case`paragraph`:e(()=>r_());break;case``:break;default:if(t.startsWith(`h`))e(()=>hx(t));else throw Error(`Unknown block type: ${t}`)}},triggerTitle:a(`toolbar.blockTypeSelect.selectBlockTypeTooltip`,`Select block type`),placeholder:a(`toolbar.blockTypeSelect.placeholder`,`Block type`),items:o})},X0=({format:e,addTitle:t,removeTitle:n,icon:r,formatName:i})=>{let[a,o]=Ud(EO,uk),s=Wd(kO),c=(a&e)!==0;return I.createElement(j1,{title:c?n:t,on:c,onValueChange:()=>{s(i)}},o(r))},Z0=({options:e})=>{let t=Rk(),n=e===void 0;return I.createElement(`div`,{className:J.toolbarGroupOfGroups},n||e.includes(`Bold`)?I.createElement(X0,{format:1,addTitle:t(`toolbar.bold`,`Bold`),removeTitle:t(`toolbar.removeBold`,`Remove bold`),icon:`format_bold`,formatName:`bold`}):null,n||e.includes(`Italic`)?I.createElement(X0,{format:2,addTitle:t(`toolbar.italic`,`Italic`),removeTitle:t(`toolbar.removeItalic`,`Remove italic`),icon:`format_italic`,formatName:`italic`}):null,n||e.includes(`Underline`)?I.createElement(X0,{format:8,addTitle:t(`toolbar.underline`,`Underline`),removeTitle:t(`toolbar.removeUnderline`,`Remove underline`),icon:`format_underlined`,formatName:`underline`}):null)},Q0=()=>{let[e,t]=Ud(EO,uk),n=Wd(kO),r=Rk(),i=(e&16)!=0,a=i?r(`toolbar.removeInlineCode`,`Remove code format`):r(`toolbar.inlineCode`,`Inline code format`);return I.createElement(M1,{items:[{title:a,contents:t(`code`),active:i,onChange:n.bind(null,`code`)}]})},$0=()=>{let e=Wd(y1),t=Hd(uk),n=Rk();return I.createElement(k1,{"aria-label":n(`toolbar.link`,`Create link`),title:n(`toolbar.link`,`Create link`),onClick:t=>{e()}},t(`link`))},e2=()=>{let e=Wd(sG),t=Hd(uk),n=Rk();return I.createElement(k1,{title:n(`toolbar.codeBlock`,`Insert Code Block`),onClick:()=>{e({})}},t(`frame_source`))},t2=()=>{let e=Hd(uk),t=Wd(uB),n=Rk(),r=Hd(Ek);return I.createElement(k1,{title:n(`toolbar.table`,`Insert Table`),onClick:()=>{t({rows:3,columns:3})},...r?{"aria-disabled":!0,"data-disabled":!0,disabled:!0}:{}},e(`table`))},n2=()=>{let e=Wd(qj),t=Hd(uk),n=Rk();return I.createElement(k1,{title:n(`toolbar.thematicBreak`,`Insert thematic break`),onClick:()=>{e()}},t(`horizontal_rule`))},r2={bullet:`format_list_bulleted`,number:`format_list_numbered`,check:`format_list_checked`},i2=({options:e=[`bullet`,`number`,`check`]})=>{let[t,n,r]=Ud(pM,uk,Ek),i=Wd(mM),a=Rk(),o={bullet:a(`toolbar.bulletedList`,`Bulleted list`),number:a(`toolbar.numberedList`,`Numbered list`),check:a(`toolbar.checkList`,`Check list`)},s=e.map(e=>({value:e,title:o[e],contents:n(r2[e])}));return I.createElement(N1,{value:t||``,items:s,onChange:i,disabled:r})},a2=()=>{let[e,t]=Ud(uk,yO),[n,r]=I.useState(!1),[i,a]=I.useState(!1),o=Rk();return I.useEffect(()=>{if(t)return rb(t.registerCommand(Mm,e=>(r(e),!1),4),t.registerCommand(jm,e=>(a(e),!1),4))},[t]),I.createElement(M1,{items:[{title:o(`toolbar.undo`,`Undo {{shortcut}}`,{shortcut:Dj?`⌘Z`:`Ctrl+Z`}),disabled:!n,contents:e(`undo`),active:!1,onChange:()=>t?.dispatchCommand(am,void 0)},{title:o(`toolbar.redo`,`Redo {{shortcut}}`,{shortcut:Dj?`⌘Y`:`Ctrl+Y`}),disabled:!i,contents:e(`redo`),active:!1,onChange:()=>t?.dispatchCommand(om,void 0)}]})},o2=900,s2={txt:`Text`,text:`Text`,plaintext:`Plain Text`,md:`Markdown`,ts:`TypeScript`,tsx:`TSX`,js:`JavaScript`,json:`JSON`,css:`CSS`,bash:`Bash`,sh:`Shell`,shell:`Shell`,yaml:`YAML`,yml:`YAML`,toml:`TOML`,cron:`Cron`},c2=(0,I.memo)((0,I.forwardRef)(function({documentKey:e,initialMarkdown:t,onPersist:n,onSaveStateChange:r,readOnly:i=!1},a){let o=(0,I.useRef)(null),s=(0,I.useRef)(e),c=(0,I.useRef)(t),l=(0,I.useRef)(t),u=(0,I.useRef)(null),d=(0,I.useRef)(null),f=(0,I.useRef)(!0),[p,m]=(0,I.useState)(`rich`),[h,g]=(0,I.useState)(t),_=(0,I.useCallback)(()=>{d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),v=(0,I.useCallback)(async()=>{if(i){r(`saved`);return}u.current&&await u.current;let e=c.current;if(e===l.current){r(`saved`);return}r(`saving`);let t=(async()=>{await n(e),l.current=e})();u.current=t;try{if(await t,c.current===l.current){r(`saved`);return}await v()}catch{throw r(`error`),Error(`Autosave failed`)}finally{u.current===t&&(u.current=null)}},[n,r,i]),y=(0,I.useCallback)(()=>{i||(_(),d.current=window.setTimeout(()=>{d.current=null,v()},o2))},[_,v,i]),b=(0,I.useCallback)(e=>{if(f.current){f.current=!1,c.current=e,l.current=e,g(e),r(`saved`);return}if(c.current=e,i){r(`saved`);return}r(`idle`),y()},[r,i,y]),x=(0,I.useMemo)(()=>[Fj(),hM(),GW(),Jj(),NB(),T1(),dB(),lG({defaultCodeBlockLanguage:`txt`,codeBlockEditorDescriptors:[{priority:-10,match:()=>!0,Editor:$$}]}),s1({codeBlockLanguages:s2}),W0(),L1({toolbarContents:()=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(a2,{}),(0,L.jsx)(Z0,{}),(0,L.jsx)(Q0,{}),(0,L.jsx)(Y0,{}),(0,L.jsx)(i2,{}),(0,L.jsx)($0,{}),(0,L.jsx)(t2,{}),(0,L.jsx)(n2,{}),(0,L.jsx)(e2,{})]})})],[]);return(0,I.useImperativeHandle)(a,()=>({flushSave:async()=>{_(),await v()},getMarkdown:()=>c.current})),(0,I.useEffect)(()=>()=>_(),[_]),(0,I.useEffect)(()=>{let n=s.current!==e,i=t!==l.current;!n&&!i||(s.current=e,_(),u.current=null,c.current=t,l.current=t,f.current=!0,g(t),m(`rich`),r(`saved`))},[e,t,r,_]),p===`plain`||i?(0,L.jsxs)(`div`,{className:`context-files-plain-fallback`,children:[(0,L.jsx)(`p`,{className:`context-files-plain-fallback__notice`,children:i?`This document is read-only. Create a managed copy to edit it.`:`The rich editor could not safely load this document. You are editing raw markdown.`}),(0,L.jsx)(`textarea`,{className:`context-files-plain-fallback__textarea`,value:i?t:h,readOnly:i,onChange:e=>{if(i)return;let t=e.currentTarget.value;g(t),c.current=t,r(`idle`),y()},spellCheck:!1})]}):(0,L.jsx)(Ej,{ref:o,markdown:t,onChange:b,onError:e=>{console.error(`MDXEditor error`,e),g(c.current),m(`plain`)},contentEditableClassName:`context-files-mdx-content`,readOnly:i,plugins:x},e)}));function l2({agentProfiles:e,selectedFileKey:t}){let n=(0,I.useMemo)(()=>[...new Set(e)].sort((e,t)=>e.localeCompare(t)),[e]),r=(0,I.useRef)(null),i=(0,I.useRef)(`saved`),[a,o]=(0,I.useState)([]),[s,c]=(0,I.useState)(null),[l,u]=(0,I.useState)(null),[d,f]=(0,I.useState)([]),[p,m]=(0,I.useState)(null),[h,g]=(0,I.useState)(`saved`),[_,v]=(0,I.useState)(null),[y,b]=(0,I.useState)(null),[x,S]=(0,I.useState)(!0),[C,w]=(0,I.useState)(!1),[T,E]=(0,I.useState)(``),[D,O]=(0,I.useState)(`global`),[k,A]=(0,I.useState)(``),[j,M]=(0,I.useState)(``);(0,I.useEffect)(()=>{i.current=h},[h]);let N=(0,I.useCallback)(async e=>{if(u(e),c(e.key),v(null),b(null),!e.managed){f([]),m(null);return}let[t,n]=await Promise.all([Is(e.key),e.sourceRef?Ls(e.key).catch(()=>null):Promise.resolve(null)]);f(t.revisions),m(n)},[]),P=(0,I.useCallback)(async()=>{let e=await ks();o(e),c(t=>t??e[0]?.key??null)},[]),F=(0,I.useCallback)(async e=>{await N(await As(e))},[N]);(0,I.useEffect)(()=>{P().catch(e=>b(e instanceof Error?e.message:String(e))).finally(()=>S(!1))},[P]),(0,I.useEffect)(()=>{if(!s){u(null);return}F(s).catch(e=>b(e instanceof Error?e.message:String(e)))},[s,F]),(0,I.useEffect)(()=>{let e=new EventSource(`/api/context-files/events`);return e.addEventListener(`pibo-product`,e=>{let t=y2(e);if(!t?.type.startsWith(`context-file.`))return;P().catch(e=>b(e instanceof Error?e.message:String(e)));let n=t.payload?.key;if(!(!n||n!==s)&&t.source!==`web`){if(i.current===`idle`||i.current===`saving`){v(`This file changed on disk while you had local edits. Review before saving again.`);return}F(n).catch(e=>b(e instanceof Error?e.message:String(e)))}}),e.onerror=()=>{b(`Live context-file updates disconnected.`)},()=>e.close()},[F,P,s]);let ee=(0,I.useMemo)(()=>a.find(e=>e.key===s)??null,[a,s]);(0,I.useEffect)(()=>{M(l?.agentProfileName??``)},[l?.agentProfileName,l?.key]),(0,I.useEffect)(()=>{D!==`agent`||k||n.length===0||A(n[0])},[n,k,D]);let te=(0,I.useCallback)(async e=>{try{await r.current?.flushSave(),await F(e)}catch(e){b(e instanceof Error?e.message:String(e))}},[F]);(0,I.useEffect)(()=>{if(!t||t===s)return;let e=!1;return(async()=>{try{await r.current?.flushSave(),e||c(t)}catch(t){e||b(t instanceof Error?t.message:String(t))}})(),()=>{e=!0}},[t,s]);let ne=(0,I.useCallback)(async()=>{try{let e=await js({label:T.trim()||void 0,scope:D,agentProfileName:D===`agent`?k.trim():void 0,markdown:``});E(``),A(``),await N(e),await P(),b(null)}catch(e){b(e instanceof Error?e.message:String(e))}},[k,T,D,N,P]),re=(0,I.useCallback)(async e=>{if(l)try{await N(await Ns(l.key,{markdown:e,expectedVersion:l.version})),await P(),v(null),b(null)}catch(e){if(b2(e)){await N(e.data.file),v(`This file changed on disk before your save completed. Reload the latest version and retry.`);return}throw b(e instanceof Error?e.message:String(e)),e}},[l,N,P]),ie=(0,I.useCallback)(async()=>{s&&(await F(s),await P())},[F,P,s]),ae=(0,I.useCallback)(async()=>{if(ee?.removable)try{await Fs(ee.key,!0),c(null),u(null),await P(),b(null)}catch(e){b(e instanceof Error?e.message:String(e))}},[P,ee]),oe=(0,I.useCallback)(async e=>{if(l?.managed){w(!0);try{await N(await Ps(l.key,{scope:e,agentProfileName:e===`agent`&&j.trim()||void 0})),await P(),b(null)}catch(e){b(e instanceof Error?e.message:String(e))}finally{w(!1)}}},[l,N,j,P]),se=(0,I.useCallback)(e=>{M(e),!(!l?.managed||!e||l.scope===`agent`&&e===(l.agentProfileName??``))&&(w(!0),Ps(l.key,{scope:`agent`,agentProfileName:e}).then(async e=>{await N(e),await P(),b(null)}).catch(e=>b(e instanceof Error?e.message:String(e))).finally(()=>w(!1)))},[l,N,P]),ce=(0,I.useCallback)(async()=>{if(!(!ee||ee.source!==`plugin`)){w(!0);try{let e=await Ms(ee.key);await P(),await N(e),b(null)}catch(e){b(e instanceof Error?e.message:String(e))}finally{w(!1)}}},[N,P,ee]),le=(0,I.useCallback)(async()=>{if(!(!l?.managed||!l.sourceRef)){w(!0);try{let e=await Rs(l.key);await P(),await N(e)}catch(e){b(e instanceof Error?e.message:String(e))}finally{w(!1)}}},[l,N,P]),ue=(0,I.useCallback)(async()=>{if(!(!l?.managed||l.linkState!==`linked-stale`)){w(!0);try{let e=await zs(l.key);await P(),await N(e)}catch(e){b(e instanceof Error?e.message:String(e))}finally{w(!1)}}},[l,N,P]),de=(0,I.useCallback)(async e=>{if(l?.managed){w(!0);try{let t=await Bs(l.key,e);await P(),await N(t)}catch(e){b(e instanceof Error?e.message:String(e))}finally{w(!1)}}},[l,N,P]);return(0,L.jsxs)(`div`,{className:`context-files-view grid h-full min-h-0 grid-cols-[minmax(0,1fr)_300px] max-[1120px]:grid-cols-[minmax(0,1fr)_260px]`,children:[(0,L.jsxs)(`main`,{className:`flex min-h-0 flex-col bg-[#101d22]`,children:[(0,L.jsxs)(`div`,{className:`flex h-14 items-center justify-between gap-3 border-b border-slate-800 bg-[#151f24] px-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:ee?h2(ee):`Context File`}),(0,L.jsx)(`h2`,{className:`truncate text-base font-semibold text-slate-100`,children:l?.label||l?.key||`No file selected`}),l?(0,L.jsx)(`div`,{className:`truncate font-mono text-[11px] text-slate-500`,children:l.path}):null]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`span`,{className:`inline-flex h-8 items-center gap-1.5 border px-2.5 text-xs ${f2(h)}`,children:[(0,L.jsx)(cs,{size:14}),d2(h)]}),(0,L.jsx)(`button`,{className:`inline-flex h-8 w-8 items-center justify-center border border-slate-700 text-slate-400 hover:border-[#11a4d4] hover:text-[#7dd3fc]`,type:`button`,title:`Reload`,onClick:()=>void ie(),children:(0,L.jsx)(os,{size:15})}),(0,L.jsx)(`button`,{className:`inline-flex h-8 w-8 items-center justify-center border border-slate-700 text-slate-400 hover:border-red-500 hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-45`,type:`button`,title:`Remove managed file`,disabled:!ee?.removable,onClick:()=>void ae(),children:(0,L.jsx)(fs,{size:15})})]})]}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-4`,children:[y?(0,L.jsx)(u2,{tone:`error`,text:y}):null,_?(0,L.jsx)(u2,{tone:`warning`,text:_}):null,l?(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border border-slate-800 bg-[#151f24] px-3 py-2 text-xs text-slate-400`,children:[(0,L.jsxs)(`div`,{children:[`State: `,(0,L.jsx)(`span`,{className:`text-slate-100`,children:_2(l.linkState)})]}),l.sourceRef?(0,L.jsx)(`div`,{className:`font-mono text-[11px] text-slate-500`,children:l.sourceRef}):null,l.sourceHash?(0,L.jsx)(`div`,{className:`font-mono text-[11px] text-slate-500`,children:l.sourceHash}):null]}):null,l?.source===`plugin`?(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border border-slate-800 bg-[#151f24] p-3 text-xs text-slate-400`,children:[(0,L.jsx)(`div`,{children:`Plugin context files are immutable in Pibo. Create a managed copy before editing.`}),(0,L.jsx)(`button`,{className:`inline-flex h-8 items-center justify-center border border-[#11a4d4] bg-[#11a4d4]/10 px-3 text-xs uppercase tracking-wider text-[#7dd3fc] disabled:opacity-45`,type:`button`,disabled:C,onClick:()=>void ce(),children:`Create Managed Copy`})]}):null,l?.managed?(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border border-slate-800 bg-[#151f24] p-3 text-xs text-slate-400`,children:[(0,L.jsxs)(`div`,{className:`flex gap-1`,children:[(0,L.jsx)(`button`,{type:`button`,className:`inline-flex h-8 items-center justify-center border px-3 uppercase tracking-wider ${l.scope===`global`?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#7dd3fc]`:`border-slate-700 text-slate-400 hover:border-slate-600 hover:text-slate-300`}`,onClick:()=>void oe(`global`),disabled:C,children:`Global`}),(0,L.jsx)(`button`,{type:`button`,className:`inline-flex h-8 items-center justify-center border px-3 uppercase tracking-wider ${l.scope===`agent`?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#7dd3fc]`:`border-slate-700 text-slate-400 hover:border-slate-600 hover:text-slate-300`}`,onClick:()=>void oe(`agent`),disabled:C||!j.trim(),children:`Agent`})]}),(0,L.jsx)(p2,{value:j,options:m2(n,j),placeholder:`Select agent`,disabled:C,onChange:se,compact:!0}),l.sourceRef?(0,L.jsx)(`button`,{className:`inline-flex h-8 items-center justify-center border border-[#11a4d4] bg-[#11a4d4]/10 px-3 uppercase tracking-wider text-[#7dd3fc] disabled:opacity-45`,type:`button`,disabled:C,onClick:()=>void le(),children:`Reset To Source`}):null,l.linkState===`linked-stale`?(0,L.jsx)(`button`,{className:`inline-flex h-8 items-center justify-center border border-amber-400/70 bg-amber-400/10 px-3 uppercase tracking-wider text-amber-100 disabled:opacity-45`,type:`button`,disabled:C,onClick:()=>void ue(),children:`Adopt Source`}):null]}):null,l?.exists?(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto border border-slate-800 bg-[#151f24]`,children:(0,L.jsx)(c2,{ref:r,documentKey:`${l.key}:${l.version??l.updatedAt??``}`,initialMarkdown:l.markdown,onPersist:re,onSaveStateChange:g,readOnly:!l.editable})}):(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border border-dashed border-slate-700 bg-[#151f24] px-4 py-5 text-sm text-slate-400`,children:[(0,L.jsx)(ps,{size:18}),l?`The selected file is missing on disk.`:`Select or create a context file.`]}),l?.managed&&d.length>0?(0,L.jsxs)(`div`,{className:`border border-slate-800 bg-[#151f24] p-3`,children:[(0,L.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Revisions`}),(0,L.jsx)(`div`,{className:`space-y-2`,children:d.map(e=>(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border border-slate-800 bg-[#101d22] px-3 py-2 text-xs text-slate-400`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`text-slate-100`,children:[e.kind,` `,e.active?`(active)`:``]}),(0,L.jsx)(`div`,{children:e.note??e.id}),(0,L.jsx)(`div`,{className:`font-mono text-[11px] text-slate-500`,children:e.createdAt})]}),e.active?null:(0,L.jsx)(`button`,{className:`inline-flex h-8 items-center justify-center border border-slate-700 px-3 uppercase tracking-wider text-slate-300 hover:border-[#11a4d4] hover:text-[#7dd3fc] disabled:opacity-45`,type:`button`,disabled:C,onClick:()=>void de(e.id),children:`Restore`})]},e.id))})]}):null,l?.managed&&p?(0,L.jsxs)(`div`,{className:`border border-slate-800 bg-[#151f24] p-3`,children:[(0,L.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Diff`}),(0,L.jsx)(`div`,{className:`space-y-1 overflow-auto`,children:p.chunks.map((e,t)=>(0,L.jsx)(`pre`,{className:`overflow-auto border px-3 py-2 text-xs ${e.type===`add`?`border-emerald-500/60 bg-emerald-500/10 text-emerald-100`:e.type===`remove`?`border-red-500/60 bg-red-500/10 text-red-100`:`border-slate-800 bg-[#101d22] text-slate-300`}`,children:e.lines.map(t=>`${e.type===`add`?`+`:e.type===`remove`?`-`:` `} ${t}`).join(`
138
- `)},`${e.type}-${t}`))})]}):null]})]}),(0,L.jsxs)(`aside`,{className:`min-h-0 overflow-auto border-l border-slate-800 bg-[#1a262b]`,children:[(0,L.jsxs)(`div`,{className:`border-b border-slate-800 px-4 py-3`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:`Context`}),(0,L.jsx)(`h1`,{className:`mt-1 text-sm font-semibold text-slate-100`,children:`Context Files`})]}),(0,L.jsxs)(`div`,{className:`space-y-3 p-3`,children:[(0,L.jsxs)(`section`,{className:`space-y-2 border border-slate-800 bg-[#151f24] p-3`,children:[(0,L.jsxs)(`div`,{className:`flex gap-1`,children:[(0,L.jsxs)(`button`,{className:`inline-flex h-8 items-center justify-center gap-1.5 border px-3 text-xs uppercase tracking-wider ${D===`global`?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#7dd3fc]`:`border-slate-700 text-slate-400 hover:border-slate-600 hover:text-slate-300`}`,type:`button`,onClick:()=>O(`global`),children:[(0,L.jsx)(Wo,{size:14}),`Global`]}),(0,L.jsxs)(`button`,{className:`inline-flex h-8 items-center justify-center gap-1.5 border px-3 text-xs uppercase tracking-wider ${D===`agent`?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#7dd3fc]`:`border-slate-700 text-slate-400 hover:border-slate-600 hover:text-slate-300`}`,type:`button`,onClick:()=>O(`agent`),children:[(0,L.jsx)(Go,{size:14}),`Agent`]})]}),(0,L.jsx)(`input`,{className:`h-9 w-full border border-slate-700 bg-[#0e1116] px-3 text-sm text-slate-200 outline-none placeholder:text-slate-500 focus:border-[#11a4d4]`,value:T,onChange:e=>E(e.currentTarget.value),placeholder:`Context file name`}),D===`agent`?(0,L.jsx)(p2,{value:k,options:n,placeholder:`Select agent`,onChange:A}):null,(0,L.jsx)(`button`,{className:`inline-flex h-9 items-center justify-center border border-[#11a4d4] bg-[#11a4d4] px-3 text-sm font-medium text-white disabled:cursor-not-allowed disabled:opacity-45`,type:`button`,disabled:!T.trim()||D===`agent`&&!k.trim(),onClick:()=>void ne(),children:`Create File`})]}),(0,L.jsxs)(`section`,{className:`space-y-2`,"aria-label":`Context files`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-1 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:[(0,L.jsx)(Go,{size:13}),(0,L.jsxs)(`span`,{children:[a.length,` Files`]})]}),x?(0,L.jsx)(`div`,{className:`border border-dashed border-slate-700 px-3 py-4 text-xs text-slate-500`,children:`Loading`}):null,(0,L.jsx)(`div`,{className:`space-y-1`,children:a.map(e=>(0,L.jsxs)(`button`,{type:`button`,className:`block w-full border px-3 py-2 text-left ${e.key===s?`border-[#11a4d4] bg-[#101d22]`:`border-transparent text-slate-300 hover:border-slate-700 hover:bg-[#101d22]`}`,onClick:()=>void te(e.key),children:[(0,L.jsx)(`div`,{className:`truncate text-sm font-medium text-slate-100`,children:e.label||e.key}),(0,L.jsx)(`div`,{className:`mt-0.5 overflow-hidden text-ellipsis whitespace-nowrap font-mono text-[11px] text-slate-500`,children:e.path}),(0,L.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:[(0,L.jsx)(`span`,{className:`inline-flex border px-1.5 py-0.5 text-[10px] uppercase tracking-wider ${g2(e)}`,children:h2(e)}),(0,L.jsx)(`span`,{className:`inline-flex border px-1.5 py-0.5 text-[10px] uppercase tracking-wider ${v2(e.linkState)}`,children:_2(e.linkState)}),e.exists?null:(0,L.jsx)(`span`,{className:`inline-flex border border-amber-400/70 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-amber-200`,children:`Missing`})]})]},e.key))}),!x&&a.length===0?(0,L.jsx)(`div`,{className:`border border-dashed border-slate-700 px-3 py-4 text-xs text-slate-500`,children:`No context files registered`}):null]})]})]})]})}function u2({tone:e,text:t}){return(0,L.jsx)(`div`,{className:`border px-3 py-2 text-sm ${e===`error`?`border-red-500/80 bg-red-500/10 text-red-200`:`border-amber-400/80 bg-amber-400/10 text-amber-100`}`,children:t})}function d2(e){return e===`saving`?`Saving`:e===`saved`?`Saved`:e===`error`?`Error`:`Unsaved`}function f2(e){return e===`saving`?`border-orange-400/80 bg-orange-400/10 text-orange-100`:e===`saved`?`border-emerald-500/80 bg-emerald-500/10 text-emerald-100`:e===`error`?`border-red-500/80 bg-red-500/10 text-red-200`:`border-amber-400/80 bg-amber-400/10 text-amber-100`}function p2({value:e,options:t,placeholder:n,disabled:r=!1,onChange:i,compact:a=!1}){return(0,L.jsxs)(`div`,{className:`relative ${a?`min-w-[16rem] flex-1`:``}`,children:[(0,L.jsxs)(`select`,{className:`w-full appearance-none border border-slate-700 bg-[#0e1116] pr-9 text-slate-200 outline-none focus:border-[#11a4d4] disabled:cursor-not-allowed disabled:opacity-60 ${a?`h-8 px-3 text-xs`:`h-9 px-3 text-sm`}`,value:e,disabled:r||t.length===0,onChange:e=>i(e.currentTarget.value),children:[e?null:(0,L.jsx)(`option`,{value:``,children:n}),t.length===0?(0,L.jsx)(`option`,{value:``,children:n}):null,t.map(e=>(0,L.jsx)(`option`,{value:e,children:e},e))]}),(0,L.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 right-3 inline-flex items-center text-slate-500`,children:(0,L.jsx)(Po,{size:14})})]})}function m2(e,t){return!t||e.includes(t)?e:[t,...e]}function h2(e){return e.source===`plugin`?`Plugin Global`:e.scope===`agent`?e.agentProfileName?`Agent ${e.agentProfileName}`:`Agent Local`:`Global`}function g2(e){return e.source===`plugin`?`border-cyan-500/70 text-cyan-200`:e.scope===`agent`?`border-fuchsia-500/70 text-fuchsia-200`:`border-[#11a4d4]/80 text-[#7dd3fc]`}function _2(e){return e===`plugin-only`?`Plugin Only`:e===`linked-clean`?`Linked Clean`:e===`linked-dirty`?`Linked Dirty`:e===`linked-stale`?`Linked Stale`:e===`orphaned`?`Orphaned`:`Managed Unlinked`}function v2(e){return e===`plugin-only`?`border-cyan-500/70 text-cyan-200`:e===`linked-clean`?`border-emerald-500/70 text-emerald-200`:e===`linked-dirty`?`border-orange-400/70 text-orange-100`:e===`linked-stale`?`border-amber-400/70 text-amber-100`:e===`orphaned`?`border-red-500/70 text-red-200`:`border-slate-600 text-slate-300`}function y2(e){try{let t=JSON.parse(e.data);return t&&typeof t.type==`string`?t:void 0}catch{return}}function b2(e){return typeof e==`object`&&!!e&&`status`in e&&e.status===409&&`data`in e&&typeof e.data==`object`&&e.data?.file!==void 0}function x2(){let[e,t]=(0,I.useState)(null),[n,r]=(0,I.useState)(`library`),[i,a]=(0,I.useState)(``),[o,s]=(0,I.useState)(`saved`),[c,l]=(0,I.useState)(!0),[u,d]=(0,I.useState)(!1),[f,p]=(0,I.useState)(null),m=(0,I.useCallback)(async()=>{l(!0);try{let e=await Ss();t(e),r(e.effectiveMode),a(e.custom.exists?e.custom.markdown:e.library.markdown),s(`saved`),p(null)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(!1)}},[]);(0,I.useEffect)(()=>{m()},[m]);let h=(0,I.useMemo)(()=>e?n===`library`?e.library.markdown:i:``,[i,e,n]),g=(0,I.useCallback)(async e=>{d(!0);try{let n=await Cs(e);t(n),r(e),a(n.custom.exists?n.custom.markdown:n.library.markdown),s(`saved`),p(null)}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(!1)}},[]),_=(0,I.useCallback)(async()=>{d(!0),s(`saving`);try{let e=await ws(i);t(e),r(`custom`),a(e.custom.markdown),s(`saved`),p(null)}catch(e){s(`error`),p(e instanceof Error?e.message:String(e))}finally{d(!1)}},[i]),v=e?.effectiveMode===`custom`;return(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-[#101d22]`,children:[(0,L.jsxs)(`div`,{className:`flex h-14 items-center justify-between gap-3 border-b border-slate-800 bg-[#151f24] px-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:`Base Prompt`}),(0,L.jsx)(`h2`,{className:`truncate text-base font-semibold text-slate-100`,children:e?.effectiveMode===`custom`?`Custom Base Prompt`:`Library Base Prompt`}),(0,L.jsx)(`div`,{className:`truncate font-mono text-[11px] text-slate-500`,children:e?e.effectiveMode===`custom`?e.custom.path:e.library.path:`loading`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`span`,{className:`inline-flex h-8 items-center gap-1.5 border px-2.5 text-xs ${v?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#7dd3fc]`:`border-slate-700 bg-[#101d22] text-slate-300`}`,children:[(0,L.jsx)(ko,{size:14}),`Active: `,e?.effectiveMode??`library`]}),(0,L.jsx)(`button`,{type:`button`,title:`Reload`,onClick:()=>void m(),className:`inline-flex h-8 w-8 items-center justify-center border border-slate-700 text-slate-400 hover:border-[#11a4d4] hover:text-[#7dd3fc]`,children:(0,L.jsx)(os,{size:15})})]})]}),(0,L.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[250px_minmax(0,1fr)] max-[980px]:grid-cols-1`,children:[(0,L.jsxs)(`aside`,{className:`border-r border-slate-800 bg-[#151f24] p-3 max-[980px]:border-b max-[980px]:border-r-0`,children:[(0,L.jsx)(`div`,{className:`mb-3 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Source`}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r(`library`),className:`mb-2 w-full border p-2 text-left ${n===`library`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#101d22] hover:border-slate-700`}`,children:[(0,L.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`block text-sm text-slate-200`,children:`Library`}),v?null:(0,L.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-[#7dd3fc]`,children:`Active`})]}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`read-only`})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r(`custom`),className:`mb-4 w-full border p-2 text-left ${n===`custom`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#101d22] hover:border-slate-700`}`,children:[(0,L.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`block text-sm text-slate-200`,children:`Custom`}),v?(0,L.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-[#7dd3fc]`,children:`Active`}):null]}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:e?.custom.exists?`editable`:`not-created`})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(S2,{checked:v,disabled:u||!e,onToggle:()=>void g(v?`library`:`custom`)}),(0,L.jsxs)(`button`,{type:`button`,disabled:u||n!==`custom`,onClick:()=>void _(),className:`inline-flex h-8 w-full items-center justify-center gap-2 border border-slate-700 bg-[#101d22] px-3 text-xs uppercase tracking-wider text-slate-300 hover:border-[#11a4d4] hover:text-[#7dd3fc] disabled:cursor-not-allowed disabled:opacity-45`,children:[(0,L.jsx)(cs,{size:14}),o===`saving`?`Saving`:`Save Custom`]})]})]}),(0,L.jsxs)(`main`,{className:`flex min-h-0 flex-col gap-3 p-4`,children:[f?(0,L.jsx)(`div`,{className:`border border-red-500/50 bg-red-500/10 px-3 py-2 text-sm text-red-200`,children:f}):null,c?(0,L.jsx)(`div`,{className:`border border-slate-800 bg-[#151f24] p-4 text-sm text-slate-400`,children:`Loading base prompt...`}):(0,L.jsx)(`textarea`,{value:h,readOnly:n===`library`,onChange:e=>{a(e.target.value),s(`idle`)},spellCheck:!1,className:`min-h-0 flex-1 resize-none border border-slate-800 bg-[#0e1116] p-4 font-mono text-xs leading-5 text-slate-200 outline-none focus:border-[#11a4d4] read-only:text-slate-400`})]})]})]})}function S2({checked:e,disabled:t,onToggle:n}){return(0,L.jsxs)(`button`,{type:`button`,disabled:t,"aria-pressed":e,onClick:n,className:`flex w-full items-center gap-2 border border-slate-800 bg-[#101d22] p-2 text-left text-sm text-slate-300 hover:border-slate-700 hover:text-slate-100 disabled:cursor-not-allowed disabled:opacity-60`,children:[(0,L.jsx)(C2,{checked:e,disabled:t}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block truncate`,children:`Use custom base prompt`}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:e?`custom active`:`library active`})]})]})}function C2({checked:e,disabled:t}){return(0,L.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border ${e?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#11a4d4]`:`border-slate-600 text-transparent`} ${t?`opacity-70`:``}`,children:e?(0,L.jsx)(No,{size:12}):null})}function w2(){let[e,t]=(0,I.useState)(null),[n,r]=(0,I.useState)(`library`),[i,a]=(0,I.useState)(``),[o,s]=(0,I.useState)(`saved`),[c,l]=(0,I.useState)(!0),[u,d]=(0,I.useState)(!1),[f,p]=(0,I.useState)(null),m=(0,I.useCallback)(async()=>{l(!0);try{let e=await Ts();t(e),r(e.effectiveMode),a(e.custom.exists?e.custom.markdown:e.library.markdown),s(`saved`),p(null)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(!1)}},[]);(0,I.useEffect)(()=>{m()},[m]);let h=(0,I.useMemo)(()=>e?n===`library`?e.library.markdown:i:``,[i,e,n]),g=(0,I.useCallback)(async e=>{d(!0);try{let n=await Es(e);t(n),r(e),a(n.custom.exists?n.custom.markdown:n.library.markdown),s(`saved`),p(null)}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(!1)}},[]),_=(0,I.useCallback)(async()=>{d(!0),s(`saving`);try{let e=await Ds(i);t(e),r(`custom`),a(e.custom.markdown),s(`saved`),p(null)}catch(e){s(`error`),p(e instanceof Error?e.message:String(e))}finally{d(!1)}},[i]),v=e?.effectiveMode===`custom`;return(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-[#101d22]`,children:[(0,L.jsxs)(`div`,{className:`flex h-14 items-center justify-between gap-3 border-b border-slate-800 bg-[#151f24] px-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:`Compaction Prompt`}),(0,L.jsx)(`h2`,{className:`truncate text-base font-semibold text-slate-100`,children:e?.effectiveMode===`custom`?`Custom Compaction Prompt`:`Library Compaction Prompt`}),(0,L.jsx)(`div`,{className:`truncate font-mono text-[11px] text-slate-500`,children:e?e.effectiveMode===`custom`?e.custom.path:e.library.path:`loading`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`span`,{className:`inline-flex h-8 items-center gap-1.5 border px-2.5 text-xs ${v?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#7dd3fc]`:`border-slate-700 bg-[#101d22] text-slate-300`}`,children:[(0,L.jsx)(jo,{size:14}),`Active: `,e?.effectiveMode??`library`]}),(0,L.jsx)(`button`,{type:`button`,title:`Reload`,onClick:()=>void m(),className:`inline-flex h-8 w-8 items-center justify-center border border-slate-700 text-slate-400 hover:border-[#11a4d4] hover:text-[#7dd3fc]`,children:(0,L.jsx)(os,{size:15})})]})]}),(0,L.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[250px_minmax(0,1fr)] max-[980px]:grid-cols-1`,children:[(0,L.jsxs)(`aside`,{className:`border-r border-slate-800 bg-[#151f24] p-3 max-[980px]:border-b max-[980px]:border-r-0`,children:[(0,L.jsx)(`div`,{className:`mb-3 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Source`}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r(`library`),className:`mb-2 w-full border p-2 text-left ${n===`library`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#101d22] hover:border-slate-700`}`,children:[(0,L.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`block text-sm text-slate-200`,children:`Library`}),v?null:(0,L.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-[#7dd3fc]`,children:`Active`})]}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`read-only`})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r(`custom`),className:`mb-4 w-full border p-2 text-left ${n===`custom`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#101d22] hover:border-slate-700`}`,children:[(0,L.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`block text-sm text-slate-200`,children:`Custom`}),v?(0,L.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-[#7dd3fc]`,children:`Active`}):null]}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:e?.custom.exists?`editable`:`not-created`})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(T2,{checked:v,disabled:u||!e,onToggle:()=>void g(v?`library`:`custom`)}),(0,L.jsxs)(`button`,{type:`button`,disabled:u||n!==`custom`,onClick:()=>void _(),className:`inline-flex h-8 w-full items-center justify-center gap-2 border border-slate-700 bg-[#101d22] px-3 text-xs uppercase tracking-wider text-slate-300 hover:border-[#11a4d4] hover:text-[#7dd3fc] disabled:cursor-not-allowed disabled:opacity-45`,children:[(0,L.jsx)(cs,{size:14}),o===`saving`?`Saving`:`Save Custom`]})]})]}),(0,L.jsxs)(`main`,{className:`flex min-h-0 flex-col gap-3 p-4`,children:[f?(0,L.jsx)(`div`,{className:`border border-red-500/50 bg-red-500/10 px-3 py-2 text-sm text-red-200`,children:f}):null,c?(0,L.jsx)(`div`,{className:`border border-slate-800 bg-[#151f24] p-4 text-sm text-slate-400`,children:`Loading compaction prompt...`}):(0,L.jsx)(`textarea`,{value:h,readOnly:n===`library`,onChange:e=>{a(e.target.value),s(`idle`)},spellCheck:!1,className:`min-h-0 flex-1 resize-none border border-slate-800 bg-[#0e1116] p-4 font-mono text-xs leading-5 text-slate-200 outline-none focus:border-[#11a4d4] read-only:text-slate-400`})]})]})]})}function T2({checked:e,disabled:t,onToggle:n}){return(0,L.jsxs)(`button`,{type:`button`,disabled:t,"aria-pressed":e,onClick:n,className:`flex w-full items-center gap-2 border border-slate-800 bg-[#101d22] p-2 text-left text-sm text-slate-300 hover:border-slate-700 hover:text-slate-100 disabled:cursor-not-allowed disabled:opacity-60`,children:[(0,L.jsx)(E2,{checked:e,disabled:t}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block truncate`,children:`Use custom compaction prompt`}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:e?`custom active`:`library active`})]})]})}function E2({checked:e,disabled:t}){return(0,L.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border ${e?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#11a4d4]`:`border-slate-600 text-transparent`} ${t?`opacity-70`:``}`,children:e?(0,L.jsx)(No,{size:12}):null})}function D2(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var O2=/[ \t\n\f\r]/g;function k2(e){return typeof e==`object`?e.type===`text`?A2(e.value):!1:A2(e)}function A2(e){return e.replace(O2,``)===``}var j2=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};j2.prototype.normal={},j2.prototype.property={},j2.prototype.space=void 0;function M2(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new j2(n,r,t)}function N2(e){return e.toLowerCase()}var P2=class{constructor(e,t){this.attribute=t,this.property=e}};P2.prototype.attribute=``,P2.prototype.booleanish=!1,P2.prototype.boolean=!1,P2.prototype.commaOrSpaceSeparated=!1,P2.prototype.commaSeparated=!1,P2.prototype.defined=!1,P2.prototype.mustUseProperty=!1,P2.prototype.number=!1,P2.prototype.overloadedBoolean=!1,P2.prototype.property=``,P2.prototype.spaceSeparated=!1,P2.prototype.space=void 0;var F2=e({boolean:()=>L2,booleanish:()=>R2,commaOrSpaceSeparated:()=>H2,commaSeparated:()=>V2,number:()=>$,overloadedBoolean:()=>z2,spaceSeparated:()=>B2}),I2=0,L2=U2(),R2=U2(),z2=U2(),$=U2(),B2=U2(),V2=U2(),H2=U2();function U2(){return 2**++I2}var W2=Object.keys(F2),G2=class extends P2{constructor(e,t,n,r){let i=-1;if(super(e,t),K2(this,`space`,r),typeof n==`number`)for(;++i<W2.length;){let e=W2[i];K2(this,W2[i],(n&F2[e])===F2[e])}}};G2.prototype.defined=!0;function K2(e,t,n){n&&(e[t]=n)}function q2(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new G2(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[N2(r)]=r,n[N2(a.attribute)]=r}return new j2(t,n,e.space)}var J2=q2({properties:{ariaActiveDescendant:null,ariaAtomic:R2,ariaAutoComplete:null,ariaBusy:R2,ariaChecked:R2,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:B2,ariaCurrent:null,ariaDescribedBy:B2,ariaDetails:null,ariaDisabled:R2,ariaDropEffect:B2,ariaErrorMessage:null,ariaExpanded:R2,ariaFlowTo:B2,ariaGrabbed:R2,ariaHasPopup:null,ariaHidden:R2,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:B2,ariaLevel:$,ariaLive:null,ariaModal:R2,ariaMultiLine:R2,ariaMultiSelectable:R2,ariaOrientation:null,ariaOwns:B2,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:R2,ariaReadOnly:R2,ariaRelevant:null,ariaRequired:R2,ariaRoleDescription:B2,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:R2,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Y2(e,t){return t in e?e[t]:t}function X2(e,t){return Y2(e,t.toLowerCase())}var Z2=q2({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:V2,acceptCharset:B2,accessKey:B2,action:null,allow:null,allowFullScreen:L2,allowPaymentRequest:L2,allowUserMedia:L2,alt:null,as:null,async:L2,autoCapitalize:null,autoComplete:B2,autoFocus:L2,autoPlay:L2,blocking:B2,capture:null,charSet:null,checked:L2,cite:null,className:B2,cols:$,colSpan:null,content:null,contentEditable:R2,controls:L2,controlsList:B2,coords:$|V2,crossOrigin:null,data:null,dateTime:null,decoding:null,default:L2,defer:L2,dir:null,dirName:null,disabled:L2,download:z2,draggable:R2,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:L2,formTarget:null,headers:B2,height:$,hidden:z2,high:$,href:null,hrefLang:null,htmlFor:B2,httpEquiv:B2,id:null,imageSizes:null,imageSrcSet:null,inert:L2,inputMode:null,integrity:null,is:null,isMap:L2,itemId:null,itemProp:B2,itemRef:B2,itemScope:L2,itemType:B2,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:L2,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:L2,muted:L2,name:null,nonce:null,noModule:L2,noValidate:L2,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:L2,optimum:$,pattern:null,ping:B2,placeholder:null,playsInline:L2,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:L2,referrerPolicy:null,rel:B2,required:L2,reversed:L2,rows:$,rowSpan:$,sandbox:B2,scope:null,scoped:L2,seamless:L2,selected:L2,shadowRootClonable:L2,shadowRootDelegatesFocus:L2,shadowRootMode:null,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:R2,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:L2,useMap:null,value:R2,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:B2,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:L2,declare:L2,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:L2,noHref:L2,noShade:L2,noWrap:L2,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:R2,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:L2,disableRemotePlayback:L2,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:X2}),Q2=q2({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:H2,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:B2,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:L2,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:V2,g2:V2,glyphName:V2,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:H2,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:B2,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:H2,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:H2,rev:H2,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:H2,requiredFeatures:H2,requiredFonts:H2,requiredFormats:H2,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:H2,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:H2,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:H2,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Y2}),$2=q2({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),e4=q2({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:X2}),t4=q2({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),n4={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},r4=/[A-Z]/g,i4=/-[a-z]/g,a4=/^data[-\w.:]+$/i;function o4(e,t){let n=N2(t),r=t,i=P2;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&a4.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(i4,c4);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!i4.test(e)){let n=e.replace(r4,s4);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=G2}return new i(r,t)}function s4(e){return`-`+e.toLowerCase()}function c4(e){return e.charAt(1).toUpperCase()}var l4=M2([J2,Z2,$2,e4,t4],`html`),u4=M2([J2,Q2,$2,e4,t4],`svg`);function d4(e){return e.join(` `).trim()}var f4=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
139
- `,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),p4=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(f4());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),m4=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),h4=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(p4()),r=m4();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),g4=v4(`end`),_4=v4(`start`);function v4(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function y4(e){let t=_4(e),n=g4(e);if(t&&n)return{start:t,end:n}}var b4=t(h4(),1),x4={}.hasOwnProperty,S4=new Map,C4=/[A-Z]/g,w4=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),T4=new Set([`td`,`th`]),E4=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function D4(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=R4(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=L4(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?u4:l4,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=O4(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function O4(e,t,n){if(t.type===`element`)return k4(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return A4(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return M4(e,t,n);if(t.type===`mdxjsEsm`)return j4(e,t);if(t.type===`root`)return N4(e,t,n);if(t.type===`text`)return P4(e,t)}function k4(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=u4,e.schema=i),e.ancestors.push(t);let a=W4(e,t.tagName,!1),o=z4(e,t),s=V4(e,t);return w4.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!k2(e):!0})),F4(e,o,a,t),I4(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function A4(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}G4(e,t.position)}function j4(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);G4(e,t.position)}function M4(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=u4,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:W4(e,t.name,!0),o=B4(e,t),s=V4(e,t);return F4(e,o,a,t),I4(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function N4(e,t,n){let r={};return I4(r,V4(e,t)),e.create(t,e.Fragment,r,n)}function P4(e,t){return t.value}function F4(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function I4(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function L4(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function R4(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=_4(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function z4(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&x4.call(t.properties,i)){let a=H4(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&T4.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function B4(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else G4(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else G4(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function V4(e,t){let n=[],r=-1,i=e.passKeys?new Map:S4;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=O4(e,a,o);s!==void 0&&n.push(s)}return n}function H4(e,t,n){let r=o4(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?D2(n):d4(n)),r.property===`style`){let t=typeof n==`object`?n:U4(e,String(n));return e.stylePropertyNameCase===`css`&&(t=K4(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?n4[r.property]||r.property:r.attribute,n]}}function U4(e,t){try{return(0,b4.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new dS("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=E4+`#cannot-parse-style-attribute`,r}}function W4(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=AC(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=AC(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return x4.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);G4(e)}function G4(e,t){let n=new dS("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=E4+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function K4(e){let t={},n;for(n in e)x4.call(e,n)&&(t[q4(n)]=e[n]);return t}function q4(e){let t=e.replace(C4,J4);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function J4(e){return`-`+e.toLowerCase()}var Y4={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]};function X4(e){let t=this;t.parser=n;function n(n){return MD(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Z4(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Q4(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
140
- `}]}function $4(e,t){let n=t.value?t.value+`
141
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function e3(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function t3(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function n3(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=yE(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function r3(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function i3(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function a3(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function o3(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return a3(e,t);let i={src:yE(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function s3(e,t){let n={src:yE(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function c3(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function l3(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return a3(e,t);let i={href:yE(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function u3(e,t){let n={href:yE(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function d3(e,t,n){let r=e.all(t),i=n?f3(n):p3(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
142
- `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
143
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function f3(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=p3(n[r])}return t}function p3(e){return e.spread??e.children.length>1}function m3(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function h3(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function g3(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function _3(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function v3(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=_4(t.children[1]),o=g4(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function y3(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function b3(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var x3=9,S3=32;function C3(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(w3(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(w3(t.slice(i),i>0,!1)),a.join(``)}function w3(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===x3||t===S3;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===x3||t===S3;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function T3(e,t){let n={type:`text`,value:C3(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function E3(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var D3={blockquote:Z4,break:Q4,code:$4,delete:e3,emphasis:t3,footnoteReference:n3,heading:r3,html:i3,imageReference:o3,image:s3,inlineCode:c3,linkReference:l3,link:u3,listItem:d3,list:m3,paragraph:h3,root:g3,strong:_3,table:v3,tableCell:b3,tableRow:y3,text:T3,thematicBreak:E3,toml:O3,yaml:O3,definition:O3,footnoteDefinition:O3};function O3(){}var k3=typeof self==`object`?self:globalThis,A3=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new k3[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new k3[a](o),i)};return r},j3=e=>A3(new Map,e)(0),M3=``,{toString:N3}={},{keys:P3}=Object,F3=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=N3.call(e).slice(8,-1);switch(n){case`Array`:return[1,M3];case`Object`:return[2,M3];case`Date`:return[3,M3];case`RegExp`:return[4,M3];case`Map`:return[5,M3];case`Set`:return[6,M3];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},I3=([e,t])=>e===0&&(t===`function`||t===`symbol`),L3=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=F3(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of P3(r))(e||!I3(F3(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(I3(F3(n))||I3(F3(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!I3(F3(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},R3=(e,{json:t,lossy:n}={})=>{let r=[];return L3(!(t||n),!!t,new Map,r)(e),r},z3=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?j3(R3(e,t)):structuredClone(e):(e,t)=>j3(R3(e,t));function B3(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function V3(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function H3(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||B3,r=e.options.footnoteBackLabel||V3,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=yE(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...z3(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
144
- `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
145
- `}]}}var U3={}.hasOwnProperty,W3={};function G3(e,t){let n=t||W3,r=new Map,i=new Map,a={all:s,applyData:q3,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...D3,...n.handlers},one:o,options:n,patch:K3,wrap:Y3};return Ww(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(U3.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=z3(n);return r.children=a.all(e),r}return z3(e)}return(a.options.unknownHandler||J3)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=X3(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=X3(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function K3(e,t){e.position&&(t.position=y4(e))}function q3(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,z3(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function J3(e,t){let n=t.data||{},r=`value`in t&&!(U3.call(n,`hProperties`)||U3.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Y3(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
146
- `});++r<e.length;)r&&n.push({type:`text`,value:`
147
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
148
- `}),n}function X3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Z3(e,t){let n=G3(e,t),r=n.one(e,void 0),i=H3(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
149
- `},i)),a}function Q3(e,t){return e&&`run`in e?async function(n,r){let i=Z3(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Z3(n,{file:r,...e||t})}}function $3(e){if(e)throw e}var e6=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function t6(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function n6(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?r6(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function r6(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var i6={basename:a6,dirname:o6,extname:s6,join:c6,sep:`/`};function a6(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);d6(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function o6(e){if(d6(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function s6(e){d6(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function c6(...e){let t=-1,n;for(;++t<e.length;)d6(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:l6(n)}function l6(e){d6(e);let t=e.codePointAt(0)===47,n=u6(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function u6(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function d6(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var f6={cwd:p6};function p6(){return`/`}function m6(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function h6(e){if(typeof e==`string`)e=new URL(e);else if(!m6(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return g6(e)}function g6(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var _6=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],v6=class{constructor(e){let t;t=e?m6(e)?{path:e}:typeof e==`string`||S6(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:f6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<_6.length;){let e=_6[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)_6.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?i6.basename(this.path):void 0}set basename(e){b6(e,`basename`),y6(e,`basename`),this.path=i6.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?i6.dirname(this.path):void 0}set dirname(e){x6(this.basename,`dirname`),this.path=i6.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?i6.extname(this.path):void 0}set extname(e){if(y6(e,`extname`),x6(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=i6.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){m6(e)&&(e=h6(e)),b6(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?i6.basename(this.path,this.extname):void 0}set stem(e){b6(e,`stem`),y6(e,`stem`),this.path=i6.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new dS(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function y6(e,t){if(e&&e.includes(i6.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+i6.sep+"`")}function b6(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function x6(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function S6(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var C6=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),w6=t(e6(),1),T6={}.hasOwnProperty,E6=new class e extends C6{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=n6()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,w6.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(k6(`data`,this.frozen),this.namespace[e]=t,this):T6.call(this.namespace,e)&&this.namespace[e]||void 0:e?(k6(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=M6(e),n=this.parser||this.Parser;return D6(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),D6(`process`,this.parser||this.Parser),O6(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=M6(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);P6(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),D6(`processSync`,this.parser||this.Parser),O6(`processSync`,this.compiler||this.Compiler),this.process(e,r),j6(`processSync`,`process`,t),n;function r(e,r){t=!0,$3(e),n=r}}run(e,t,n){A6(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=M6(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),j6(`runSync`,`run`,n),r;function i(e,t){$3(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=M6(t),r=this.compiler||this.Compiler;return O6(`stringify`,r),A6(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(k6(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,w6.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];t6(o)&&t6(r)&&(r=(0,w6.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function D6(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function O6(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function k6(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function A6(e){if(!t6(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function j6(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function M6(e){return N6(e)?e:new v6(e)}function N6(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function P6(e){return typeof e==`string`||F6(e)}function F6(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var I6=[],L6={allowDangerousHtml:!0},R6=/^(https?|ircs?|mailto|xmpp)$/i,z6=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function B6(e){let t=V6(e),n=H6(e);return U6(t.runSync(t.parse(n),n),e)}function V6(e){let t=e.rehypePlugins||I6,n=e.remarkPlugins||I6,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...L6}:L6;return E6().use(X4).use(n).use(Q3,r).use(t)}function H6(e){let t=e.children||``,n=new v6;return typeof t==`string`?n.value=t:``+t,n}function U6(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||W6;for(let e of z6)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Ww(e,l),D4(e,{Fragment:L.Fragment,components:i,ignoreInvalidStyle:!0,jsx:L.jsx,jsxs:L.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Y4)if(Object.hasOwn(Y4,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Y4[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function W6(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||R6.test(e.slice(0,t))?e:``}function G6(e,t,n){let r=Nw((n||{}).ignore||[]),i=K6(t),a=-1;for(;++a<i.length;)Hw(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function K6(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([q6(e[0]),J6(e[1])])}return t}function q6(e){return typeof e==`string`?new RegExp(HW(e),`g`):e}function J6(e){return typeof e==`function`?e:function(){return e}}var Y6=`phrasing`,X6=[`autolink`,`link`,`image`,`label`];function Z6(){return{transforms:[a8],enter:{literalAutolink:$6,literalAutolinkEmail:e8,literalAutolinkHttp:e8,literalAutolinkWww:e8},exit:{literalAutolink:i8,literalAutolinkEmail:r8,literalAutolinkHttp:t8,literalAutolinkWww:n8}}}function Q6(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Y6,notInConstruct:X6},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Y6,notInConstruct:X6},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Y6,notInConstruct:X6}]}}function $6(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function e8(e){this.config.enter.autolinkProtocol.call(this,e)}function t8(e){this.config.exit.autolinkProtocol.call(this,e)}function n8(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function r8(e){this.config.exit.autolinkEmail.call(this,e)}function i8(e){this.exit(e)}function a8(e){G6(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,o8],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,s8]],{ignore:[`link`,`linkReference`]})}function o8(e,t,n,r,i){let a=``;if(!u8(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!c8(n)))return!1;let o=l8(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function s8(e,t,n,r){return!u8(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function c8(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function l8(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=$x(e,`(`),a=$x(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function u8(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Px(n)||Nx(n))&&(!t||n!==47)}b8.peek=y8;function d8(){this.buffer()}function f8(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function p8(){this.buffer()}function m8(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function h8(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vE(this.sliceSerialize(e)).toLowerCase(),n.label=t}function g8(e){this.exit(e)}function _8(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vE(this.sliceSerialize(e)).toLowerCase(),n.label=t}function v8(e){this.exit(e)}function y8(){return`[`}function b8(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function x8(){return{enter:{gfmFootnoteCallString:d8,gfmFootnoteCall:f8,gfmFootnoteDefinitionLabelString:p8,gfmFootnoteDefinition:m8},exit:{gfmFootnoteCallString:h8,gfmFootnoteCall:g8,gfmFootnoteDefinitionLabelString:_8,gfmFootnoteDefinition:v8}}}function S8(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:b8},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
150
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?w8:C8))),s(),o}}function C8(e,t,n){return t===0?e:w8(e,t,n)}function w8(e,t,n){return(n?``:` `)+e}function T8(){return[Z6(),x8(),Bx(),SM(),sM()]}function E8(e){return{extensions:[Q6(),S8(e),Vx(),AM(e),cM()]}}var D8={tokenize:V8,partial:!0},O8={tokenize:H8,partial:!0},k8={tokenize:U8,partial:!0},A8={tokenize:W8,partial:!0},j8={tokenize:G8,partial:!0},M8={name:`wwwAutolink`,tokenize:z8,previous:K8},N8={name:`protocolAutolink`,tokenize:B8,previous:q8},P8={name:`emailAutolink`,tokenize:R8,previous:J8},F8={};function I8(){return{text:F8}}for(var L8=48;L8<123;)F8[L8]=P8,L8++,L8===58?L8=65:L8===91&&(L8=97);F8[43]=P8,F8[45]=P8,F8[46]=P8,F8[95]=P8,F8[72]=[P8,N8],F8[104]=[P8,N8],F8[87]=[P8,M8],F8[119]=[P8,M8];function R8(e,t,n){let r=this,i,a;return o;function o(t){return!Y8(t)||!J8.call(r,r.previous)||X8(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Y8(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(j8,u,l)(t):t===45||t===95||Tx(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&wx(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function z8(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!K8.call(r,r.previous)||X8(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(D8,e.attempt(O8,e.attempt(k8,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function B8(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&q8.call(r,r.previous)&&!X8(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(wx(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Dx(t)||jx(t)||Px(t)||Nx(t)?n(t):e.attempt(O8,e.attempt(k8,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function V8(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function H8(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(A8,c,s)(t):t===null||jx(t)||Px(t)||t!==45&&Nx(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function U8(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(A8,t,a)(o):o===null||jx(o)||Px(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function W8(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||jx(o)||Px(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||jx(e)||Px(e)?t(e):r(e)}function a(e){return wx(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):wx(t)?(e.consume(t),o):n(t)}}function G8(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Tx(e)?n(e):t(e)}}function K8(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||jx(e)}function q8(e){return!wx(e)}function J8(e){return!(e===47||Y8(e))}function Y8(e){return e===43||e===45||e===46||e===95||Tx(e)}function X8(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Z8={tokenize:a5,partial:!0};function Q8(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:n5,continuation:{tokenize:r5},exit:i5}},text:{91:{name:`gfmFootnoteCall`,tokenize:t5},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:$8,resolveTo:e5}}}}function $8(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=vE(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function e5(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function t5(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||jx(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(vE(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return jx(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function n5(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||jx(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=vE(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return jx(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),jC(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function r5(e,t,n){return e.check(ME,t,e.attempt(Z8,t,n))}function i5(e){e.exit(`gfmFootnoteDefinition`)}function a5(e,t,n){let r=this;return jC(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function o5(e){return hE([I8(),Q8(),Rx(e),PM(),iM()])}var s5={};function c5(e){let t=this,n=e||s5,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(o5(n)),a.push(T8()),o.push(E8(n))}(function(e){var t=`\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b`,n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:`punctuation`,inside:null},r={bash:n,environment:{pattern:RegExp(`\\$`+t),alias:`constant`},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp(`(\\{)`+t),lookbehind:!0,alias:`constant`}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:`important`},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:`function`},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:`function`}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:`variable`,lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp(`(^|[\\s;|&]|[<>]\\()`+t),lookbehind:!0,alias:`constant`}},alias:`variable`,lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:`variable`,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp(`\\$?`+t),alias:`constant`},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:`class-name`},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:`important`},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:`important`}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=[`comment`,`function-name`,`for-or-select`,`assign-left`,`parameter`,`string`,`environment`,`function`,`keyword`,`builtin`,`boolean`,`file-descriptor`,`operator`,`punctuation`,`number`],a=r.variable[1].inside,o=0;o<i.length;o++)a[i[o]]=e.languages.bash[i[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(Prism),Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},Prism.languages.webmanifest=Prism.languages.json,(function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \\t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \\t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(Prism);var l5=[`p`,`br`,`strong`,`em`,`a`,`ul`,`ol`,`li`,`blockquote`,`code`,`pre`,`h1`,`h2`,`h3`,`h4`,`hr`,`table`,`thead`,`tbody`,`tr`,`th`,`td`,`input`,`del`],u5={a({href:e,children:t}){return(0,L.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:t})},code({className:e,children:t,node:n,...r}){let i=d5(e),a=String(t).replace(/\n$/,``);if(!i)return(0,L.jsx)(`code`,{className:e,...r,children:t});let o=Td.languages[i];return o?(0,L.jsx)(`code`,{className:`language-${i}`,dangerouslySetInnerHTML:{__html:Td.highlight(a,o,i)},...r}):(0,L.jsx)(`code`,{className:e,...r,children:t})},th({children:e}){return(0,L.jsx)(`th`,{children:e})},td({children:e}){return(0,L.jsx)(`td`,{children:e})},input({checked:e,node:t,...n}){return(0,L.jsx)(`input`,{type:`checkbox`,checked:!!e,readOnly:!0,disabled:!0,...n})}};function d5(e){let t=/language-(\S+)/.exec(e??``);if(!t)return;let n=t[1].toLowerCase();return n===`sh`||n===`shell`?`bash`:n===`js`?`javascript`:n===`ts`?`typescript`:n===`md`?`markdown`:n===`yml`?`yaml`:n}var f5=(e,t,n)=>{if(n.tagName!==`a`||t!==`href`)return``;let r=W6(e);if(!r)return``;if(r.startsWith(`/`)||r.startsWith(`#`))return r;try{let e=new URL(r);return e.protocol===`http:`||e.protocol===`https:`||e.protocol===`mailto:`?r:``}catch{return``}};function p5({children:e}){return(0,L.jsx)(B6,{allowedElements:l5,components:u5,remarkPlugins:[c5],skipHtml:!0,urlTransform:f5,children:e})}function m5({tools:e}){return(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-[#101d22]`,children:[(0,L.jsxs)(`div`,{className:`flex h-14 items-center justify-between gap-3 border-b border-slate-800 bg-[#151f24] px-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:`Context`}),(0,L.jsx)(`h2`,{className:`truncate text-base font-semibold text-slate-100`,children:`Pibo Tools`}),(0,L.jsx)(`div`,{className:`truncate font-mono text-[11px] text-slate-500`,children:`Installed tool hints injected into agent context`})]}),(0,L.jsxs)(`span`,{className:`inline-flex h-8 items-center gap-1.5 border border-slate-700 bg-[#101d22] px-2.5 text-xs text-slate-300`,children:[(0,L.jsx)(gs,{size:14,className:`text-[#11a4d4]`}),e.length,` installed`]})]}),(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:e.length===0?(0,L.jsx)(`div`,{className:`border border-dashed border-slate-700 bg-[#151f24] px-4 py-5 text-sm text-slate-500`,children:`No curated Pibo Tools are currently installed.`}):(0,L.jsxs)(`div`,{className:`grid gap-3`,children:[(0,L.jsx)(`div`,{className:`border border-slate-800 bg-[#151f24] px-4 py-3 text-sm text-slate-400`,children:`These are the short hints injected into agent context for installed curated CLI tools. The CLI remains the source of truth for the full workflow.`}),e.map(e=>(0,L.jsxs)(`section`,{className:`border border-slate-800 bg-[#151f24]`,children:[(0,L.jsxs)(`div`,{className:`border-b border-slate-800 px-4 py-3`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:`Installed Tool`}),(0,L.jsx)(`h3`,{className:`truncate text-sm font-semibold text-slate-100`,children:e.name}),(0,L.jsx)(`p`,{className:`mt-1 text-xs text-slate-500`,children:e.description})]}),(0,L.jsx)(`div`,{className:`px-4 py-4`,children:(0,L.jsx)(`div`,{className:`model-response-markdown text-sm`,children:(0,L.jsx)(p5,{children:e.snippet})})})]},e.name))]})})]})}function h5({servers:e,selectedServerName:t,onServerSaved:n}){let[r,i]=(0,I.useState)({}),[a,o]=(0,I.useState)(null),[s,c]=(0,I.useState)(null),l=(0,I.useMemo)(()=>t?[...e].sort((e,n)=>e.name===t?-1:n.name===t?1:e.name.localeCompare(n.name)):e,[t,e]);(0,I.useEffect)(()=>{i(t=>{let n={...t};for(let t of e)t.name in n||(n[t.name]=t.description??``);return n})},[e]);let u=async e=>{if(!e.editable)return;let t=(r[e.name]??``).trim();if(!t){c(`MCP tool context is required.`);return}o(e.name);try{let r=await Gs(e.name,t);i(t=>({...t,[e.name]:r.server.description??``})),n(r.server),c(null)}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(null)}};return(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-[#101d22]`,children:[(0,L.jsxs)(`div`,{className:`flex h-14 items-center justify-between gap-3 border-b border-slate-800 bg-[#151f24] px-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:`Context`}),(0,L.jsx)(`h2`,{className:`truncate text-base font-semibold text-slate-100`,children:`MCP Tools`}),(0,L.jsx)(`div`,{className:`truncate font-mono text-[11px] text-slate-500`,children:`MCP server hints injected into agent context`})]}),(0,L.jsxs)(`span`,{className:`inline-flex h-8 items-center gap-1.5 border border-slate-700 bg-[#101d22] px-2.5 text-xs text-slate-300`,children:[(0,L.jsx)(us,{size:14,className:`text-[#11a4d4]`}),e.length,` configured`]})]}),(0,L.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:[s?(0,L.jsx)(`div`,{className:`mb-3 border border-red-500/60 bg-red-500/10 px-3 py-2 text-sm text-red-200`,children:s}):null,l.length===0?(0,L.jsx)(`div`,{className:`border border-dashed border-slate-700 bg-[#151f24] px-4 py-5 text-sm text-slate-500`,children:`No MCP servers are configured.`}):(0,L.jsxs)(`div`,{className:`grid gap-3`,children:[(0,L.jsx)(`div`,{className:`border border-slate-800 bg-[#151f24] px-4 py-3 text-sm text-slate-400`,children:`These short descriptions become the model-visible MCP context. Configure the server itself through the MCP CLI.`}),l.map(e=>{let n=r[e.name]??e.description??``,o=n.trim()!==(e.description??``);return(0,L.jsxs)(`section`,{className:`border bg-[#151f24] ${e.name===t?`border-[#11a4d4]`:e.hasDescription?`border-slate-800`:`border-[#f59e0b]/60`}`,children:[(0,L.jsx)(`div`,{className:`border-b border-slate-800 px-4 py-3`,children:(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:`MCP Tool Context`}),(0,L.jsx)(`h3`,{className:`truncate text-sm font-semibold text-slate-100`,children:e.name}),(0,L.jsxs)(`div`,{className:`mt-1 font-mono text-[10px] text-slate-500`,children:[e.transport,e.descriptionSource?` / ${e.descriptionSource}`:``]})]}),e.hasDescription?null:(0,L.jsxs)(`div`,{className:`inline-flex items-center gap-1.5 border border-[#f59e0b]/60 bg-[#f59e0b]/10 px-2 py-1 text-xs text-amber-100`,children:[(0,L.jsx)(ps,{size:13}),`Missing`]})]})}),(0,L.jsxs)(`div`,{className:`grid gap-2 px-4 py-4`,children:[(0,L.jsx)(`textarea`,{value:n,maxLength:480,disabled:!e.editable,onChange:t=>i(n=>({...n,[e.name]:t.target.value})),className:`min-h-[92px] min-w-0 resize-y border border-slate-700 bg-[#0e1116] px-3 py-2 text-sm text-slate-200 outline-none focus:border-[#11a4d4] disabled:opacity-60`,placeholder:`Short agent-facing MCP context`}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(`div`,{className:`text-xs text-slate-500`,children:e.editable?`Stored as Pibo MCP metadata.`:`Registry-provided context is read-only.`}),(0,L.jsx)(`button`,{type:`button`,disabled:!e.editable||a===e.name||!o||!n.trim(),onClick:()=>void u(e),title:`Save MCP Tool Context`,"aria-label":`Save MCP Tool Context`,className:`h-8 w-8 inline-flex items-center justify-center border border-[#11a4d4] bg-[#11a4d4]/10 text-[#11a4d4] disabled:opacity-50`,children:(0,L.jsx)(cs,{size:14})})]})]})]},e.name)})]})]})]})}var g5=[`trace`,`terminal`],_5=`trace`;function v5(e){return typeof e==`string`&&g5.includes(e)}function y5(e){return v5(e)?e:void 0}var b5={"agent.run":{color:`text-[#11a4d4]`,bgColor:`bg-[#11a4d4]/20`,borderColor:`border-[#11a4d4]`,label:`Agent Run`},"tool.call":{color:`text-purple-500`,bgColor:`bg-purple-500/20`,borderColor:`border-purple-500`,label:`Tool Call`},"tool.result":{color:`text-green-500`,bgColor:`bg-green-500/20`,borderColor:`border-green-500`,label:`Tool Result`},"model.request":{color:`text-blue-500`,bgColor:`bg-blue-500/20`,borderColor:`border-blue-500`,label:`Model Request`},"model.response":{color:`text-[#0bda57]`,bgColor:`bg-[#0bda57]/20`,borderColor:`border-[#0bda57]`,label:`Model Response`},"model.reasoning":{color:`text-amber-500`,bgColor:`bg-amber-500/20`,borderColor:`border-amber-500`,label:`Reasoning`},"agent.delegation":{color:`text-orange-500`,bgColor:`bg-orange-500/20`,borderColor:`border-orange-500`,label:`Agent Delegation`},"agent.async":{color:`text-orange-500`,bgColor:`bg-orange-500/20`,borderColor:`border-orange-500`,label:`Async Agent`},"yielded.run":{color:`text-[#11a4d4]`,bgColor:`bg-[#11a4d4]/20`,borderColor:`border-[#11a4d4]`,label:`Yielded Run`},"user.prompt":{color:`text-cyan-500`,bgColor:`bg-cyan-500/20`,borderColor:`border-cyan-500`,label:`User Prompt`},user_input:{color:`text-slate-500`,bgColor:`bg-slate-800`,borderColor:`border-slate-600`,label:`User Input`}},x5=12;function S5(e,t){return t===`all`||e<t}var C5=(0,I.memo)(function e({span:t,startTime:n,depth:r=0,expansionDepth:i,expansionSignal:a,expandThinking:o,onFork:s,onOpenSession:c}){let[l,u]=(0,I.useState)(()=>S5(r,i)),[d,f]=(0,I.useState)(()=>t.spanType===`model.reasoning`?o:S5(r,i));(0,I.useEffect)(()=>{let e=S5(r,i);u(e),f(t.spanType===`model.reasoning`?o:e)},[r,i,a,o,t.spanType]);let p=b5[t.spanType]||b5[`agent.run`],m=t.status===`UNSET`,h=j5(t.status,m),g=t.spanType===`user.prompt`||t.spanType===`user_input`,_=!!t.children?.length,v=P5(t.startTime,n),y=t.durationUs?`${(t.durationUs/1e3).toFixed(1)}ms`:t.endTime?`${((t.endTime-t.startTime)/1e3).toFixed(1)}ms`:null,b=(0,I.useCallback)(()=>{f(e=>!e),_&&u(e=>!e)},[_]);return(0,L.jsx)(`div`,{className:`relative mb-4 group`,style:{marginLeft:r>0?x5:0,width:r>0?`calc(100% - ${x5}px)`:`var(--trace-readable-width)`,maxWidth:`100%`},children:(0,L.jsxs)(`div`,{className:`min-w-0 ${g?`bg-[#11a4d4]/10`:`bg-white dark:bg-[#1a262b]`} border ${h.cardClass} rounded-sm shadow-sm transition-all hover:border-opacity-70 ${m?h.glowClass:``}`,children:[(0,L.jsx)(w5,{span:t,config:p,statusStyles:h,isActive:m,contentExpanded:d,duration:y,relativeTime:v,onToggle:b,onFork:s,onOpenSession:c}),d?(0,L.jsx)(D5,{span:t}):null,_&&l&&d?(0,L.jsx)(`div`,{className:`min-w-0 border-t border-slate-700 bg-slate-900/50 py-4`,children:t.children?.map(t=>(0,L.jsx)(e,{span:t,startTime:n,depth:r+1,expansionDepth:i,expansionSignal:a,expandThinking:o,onFork:s,onOpenSession:c},t.id))}):null]})})});function w5({span:e,config:t,statusStyles:n,isActive:r,contentExpanded:i,duration:a,relativeTime:o,onToggle:s,onFork:c,onOpenSession:l}){let u=e.spanType===`user.prompt`||e.spanType===`user_input`?`bg-[#11a4d4]/10`:n.headerClass;return(0,L.jsx)(`div`,{className:`${i?`border-b ${t.borderColor}/20`:``} ${u}`,children:(0,L.jsxs)(`div`,{className:`box-border flex w-full min-w-0 items-center`,style:{maxWidth:`100%`},children:[(0,L.jsx)(`button`,{type:`button`,className:`min-w-0 flex-1 px-4 py-2 cursor-pointer text-left`,onClick:s,children:(0,L.jsxs)(`span`,{className:`min-w-0 text-xs font-bold ${t.color} uppercase tracking-wider flex items-center gap-2`,children:[i?(0,L.jsx)(Po,{size:12}):(0,L.jsx)(Fo,{size:12}),(0,L.jsx)(T5,{spanType:e.spanType,config:t,isActive:r}),(0,L.jsx)(`span`,{className:`shrink-0`,children:t.label}),e.name?(0,L.jsxs)(`span`,{className:`min-w-0 truncate font-normal text-slate-500 dark:text-slate-400 normal-case`,children:[`: `,e.name]}):null,r?(0,L.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-[#11a4d4] animate-pulse`}):null]})}),(0,L.jsx)(O5,{forkEntryId:e.pibo?.traceNodeType===`user.message`?e.pibo.entryId:void 0,linkedPiboSessionId:e.pibo?.linkedPiboSessionId,onFork:c,onOpenSession:l}),(0,L.jsx)(E5,{duration:a,relativeTime:o})]})})}function T5({spanType:e,config:t,isActive:n}){return(0,L.jsxs)(`span`,{className:`relative inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full ${t.bgColor} border-2 ${t.borderColor} ${n?`shadow-[0_0_10px_rgba(17,164,212,0.4)]`:``}`,children:[(0,L.jsx)(A5,{type:e,className:t.color}),n?(0,L.jsx)(`span`,{className:`absolute -right-0.5 -top-0.5 h-1.5 w-1.5 rounded-full bg-[#11a4d4] animate-pulse`}):null]})}function E5({duration:e,relativeTime:t}){return(0,L.jsxs)(`div`,{className:`ml-2 mr-4 flex w-36 shrink-0 items-center justify-end gap-2 font-mono tabular-nums`,children:[e?(0,L.jsx)(`span`,{className:`text-[10px] text-slate-500 dark:text-slate-400`,children:e}):null,(0,L.jsx)(`span`,{className:`text-xs text-slate-400 dark:text-slate-500`,children:t})]})}var D5=(0,I.memo)(function({span:e}){let[t,n]=(0,I.useState)(!1),{spanType:r,attributes:i,name:a}=e,o=i.content||i.input||i.output||i.message,s=i.tool_name||i.tool?.name||i[`tool.name`],c=typeof s==`string`?s:null,l=i.output||i.result||i[`tool.result`],u=i.arguments||i.args||i[`tool.arguments`],d=e.status===`ERROR`?(0,L.jsxs)(`div`,{className:`mx-4 mt-4 p-3 bg-red-500/10 border border-red-500/20 rounded-sm text-xs`,children:[(0,L.jsx)(`div`,{className:`flex items-center gap-2 font-semibold text-red-500 mb-1`,children:`Error`}),e.statusMessage?(0,L.jsx)(`div`,{className:`font-mono text-red-400 mb-2`,children:e.statusMessage}):null]}):null;if(r===`user.prompt`||r===`user_input`)return(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[d,(0,L.jsx)(`div`,{className:`min-w-0 break-words p-4 font-mono text-sm text-slate-300 whitespace-pre-wrap`,children:typeof o==`string`?o:JSON.stringify(o)})]});if(r===`model.response`)return(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[d,(0,L.jsx)(`div`,{className:`model-response-markdown min-w-0 p-4 text-sm text-slate-200 leading-relaxed`,children:typeof o==`string`?(0,L.jsx)(p5,{children:o}):(0,L.jsx)(md,{value:o})})]});if(r===`tool.result`)return(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[d,(0,L.jsxs)(`div`,{className:`p-4 bg-green-500/5 border-t border-green-500/20`,children:[(0,L.jsxs)(`div`,{className:`text-xs font-medium text-green-400 mb-2`,children:[`Returned from `,c||a,`:`]}),(0,L.jsx)(md,{value:l??o})]})]});if(r===`tool.call`){let e=F5(u)?u:{},r=Object.keys(e).length>0;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`p-4 bg-[#0e1116] border-b border-slate-800`,children:(0,L.jsx)(k5,{name:c??a,args:e})}),l==null?null:(0,L.jsxs)(`div`,{className:`px-4 py-2 bg-[#1a262b] flex items-center gap-2`,children:[(0,L.jsx)(Eo,{size:14,className:`text-slate-400`}),(0,L.jsx)(`span`,{className:`text-xs font-mono text-slate-500`,children:`Output:`}),(0,L.jsx)(`code`,{className:`min-w-0 max-w-md truncate text-xs font-mono text-slate-300`,children:typeof l==`string`?l.slice(0,100):JSON.stringify(l).slice(0,100)})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`w-full px-4 py-1.5 flex items-center gap-1.5 text-[11px] font-medium text-slate-400 hover:text-slate-200 bg-slate-900/40 hover:bg-slate-800/60 border-t border-slate-700/40 transition-colors`,children:[t?(0,L.jsx)(Ho,{size:12}):(0,L.jsx)(Uo,{size:12}),t?`Hide Details`:`Show Details`]}),t?(0,L.jsxs)(`div`,{className:`border-t border-slate-700/40 bg-[#0e1116]`,children:[r?(0,L.jsxs)(`div`,{className:`px-4 pt-3 pb-2`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-semibold text-blue-400 uppercase tracking-wider mb-1.5`,children:`Input`}),(0,L.jsx)(md,{value:e})]}):null,l==null?null:(0,L.jsxs)(`div`,{className:`px-4 pt-2 pb-3 border-t border-slate-700/30`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-semibold text-green-400 uppercase tracking-wider mb-1.5`,children:`Output`}),(0,L.jsx)(md,{value:l})]})]}):null,d]})}if(r===`yielded.run`){let e=F5(l)?l:F5(o)?o:{};return(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[d,(0,L.jsxs)(`div`,{className:`p-4 border-b border-[#11a4d4]/20 bg-[#11a4d4]/5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,L.jsx)(Do,{size:14,className:`text-[#11a4d4]`}),(0,L.jsx)(`span`,{className:`text-sm font-medium text-[#11a4d4]`,children:`Run notification`}),(0,L.jsx)(`span`,{className:`text-xs font-mono text-slate-400`,children:typeof i.content==`string`?i.content:a})]}),(0,L.jsx)(M5,{notification:e})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`w-full px-4 py-1.5 flex items-center gap-1.5 text-[11px] font-medium text-slate-400 hover:text-slate-200 bg-slate-900/40 hover:bg-slate-800/60 border-t border-slate-700/40 transition-colors`,children:[t?(0,L.jsx)(Ho,{size:12}):(0,L.jsx)(Uo,{size:12}),t?`Hide Details`:`Show Details`]}),t?(0,L.jsx)(`div`,{className:`border-t border-slate-700/40 bg-[#0e1116] px-4 py-3`,children:(0,L.jsx)(md,{value:e})}):null]})}if(r===`model.reasoning`){let e=i.reasoning||i[`model.reasoning`]||o;return(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[d,(0,L.jsxs)(`div`,{className:`min-w-0 break-words p-4 font-mono text-sm text-slate-300 bg-amber-500/5 leading-relaxed whitespace-pre-wrap`,children:[(0,L.jsx)(`span`,{className:`text-amber-500 opacity-60`,children:`// Model reasoning`}),(0,L.jsx)(`br`,{}),typeof e==`string`?e:JSON.stringify(e,null,2)]})]})}if(r===`agent.delegation`){let e=i[`delegation.target_agent`],t=i[`delegation.query`],n=i[`result.status`];return(0,L.jsxs)(L.Fragment,{children:[d,(0,L.jsxs)(`div`,{className:`p-4 border-b border-orange-500/20 bg-orange-500/5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,L.jsx)(qo,{size:14,className:`text-orange-500`}),(0,L.jsx)(`span`,{className:`text-sm font-medium text-orange-500`,children:`Delegated to:`}),(0,L.jsxs)(`span`,{className:`text-sm font-semibold text-slate-200`,children:[e||`unknown`,` agent`]}),n?(0,L.jsx)(`span`,{className:`ml-2 px-2 py-0.5 text-[10px] font-bold rounded-sm bg-green-500/20 text-green-500`,children:n.toUpperCase()}):null]}),t?(0,L.jsxs)(`div`,{className:`text-xs text-slate-400 font-mono italic line-clamp-2`,children:[`"`,I5(t),`"`]}):null]})]})}if(r===`agent.async`){let e=i[`async_agent.target_agent`],t=i[`async_agent.query`],n=i[`async_agent.started_by`],r=i.run_id,a=i[`result.status`];return(0,L.jsxs)(L.Fragment,{children:[d,(0,L.jsxs)(`div`,{className:`p-4 border-b border-orange-500/20 bg-orange-500/5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 mb-2`,children:[(0,L.jsx)(qo,{size:14,className:`text-orange-500`}),(0,L.jsx)(`span`,{className:`text-sm font-medium text-orange-500`,children:`Async agent started:`}),(0,L.jsxs)(`span`,{className:`text-sm font-semibold text-slate-200`,children:[e||`unknown`,` agent`]}),a?(0,L.jsx)(`span`,{className:`px-2 py-0.5 text-[10px] font-bold rounded-sm bg-orange-500/15 text-orange-400`,children:a.toUpperCase()}):null]}),(0,L.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-x-3 gap-y-1 font-mono text-[11px] text-slate-500`,children:[(0,L.jsxs)(`span`,{children:[`Started by `,n||`pibo_run_start`]}),r?(0,L.jsx)(`span`,{children:r}):null]}),t?(0,L.jsxs)(`div`,{className:`text-xs text-slate-400 font-mono italic line-clamp-2`,children:[`"`,I5(t),`"`]}):null]})]})}return r===`agent.run`?(0,L.jsx)(`div`,{className:`flex flex-col`,children:d}):(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[d,(0,L.jsx)(`div`,{className:`p-4 font-mono text-sm text-slate-300`,children:(0,L.jsx)(md,{value:i})})]})});function O5({forkEntryId:e,linkedPiboSessionId:t,onFork:n,onOpenSession:r}){let i=e&&n?e:void 0,a=t&&r?t:void 0;return!i&&!a?null:(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[i?(0,L.jsx)(`button`,{type:`button`,onClick:()=>n?.(i),className:`inline-flex h-8 w-8 items-center justify-center rounded-sm border border-slate-700 bg-[#151f24]/80 text-slate-400 transition-colors hover:border-[#11a4d4] hover:text-[#11a4d4]`,title:`Fork user message`,"aria-label":`Fork user message`,children:(0,L.jsx)(qo,{size:14})}):null,a?(0,L.jsx)(`button`,{type:`button`,onClick:()=>r?.(a),className:`inline-flex h-8 w-8 items-center justify-center rounded-sm border border-slate-700 bg-[#151f24]/80 text-slate-400 transition-colors hover:border-[#11a4d4] hover:text-[#11a4d4]`,title:`Open child session`,"aria-label":`Open child session`,children:(0,L.jsx)(Vo,{size:14})}):null]})}function k5({name:e,args:t}){return(0,L.jsxs)(`code`,{className:`font-mono text-xs text-green-400`,children:[(0,L.jsx)(`span`,{className:`text-purple-400`,children:`def`}),` `,(0,L.jsx)(`span`,{className:`text-yellow-300`,children:e}),(0,L.jsxs)(`span`,{children:[`(`,Object.entries(t).map(([e,t],n)=>(0,L.jsxs)(`span`,{children:[n>0?`, `:null,(0,L.jsx)(`span`,{className:`text-blue-400`,children:e}),`=`,(0,L.jsx)(`span`,{className:`text-green-300`,children:typeof t==`string`?`'${t.slice(0,50)}${t.length>50?`...`:``}'`:I5(t).slice(0,50)})]},e)),`)`]})]})}function A5({type:e,className:t}){let n={size:14,className:t};switch(e){case`agent.run`:return(0,L.jsx)(jo,{...n});case`tool.call`:return(0,L.jsx)(Oo,{...n});case`tool.result`:return(0,L.jsx)(Eo,{...n});case`model.request`:return(0,L.jsx)(Ao,{...n});case`model.response`:return(0,L.jsx)(Eo,{...n});case`model.reasoning`:return(0,L.jsx)(Xo,{...n});case`agent.delegation`:return(0,L.jsx)(qo,{...n});case`agent.async`:return(0,L.jsx)(qo,{...n});case`yielded.run`:return(0,L.jsx)(Do,{...n});case`user.prompt`:return(0,L.jsx)(ts,{...n});case`user_input`:return(0,L.jsx)(hs,{...n});default:return(0,L.jsx)(No,{...n})}}function j5(e,t){return e===`ERROR`?{cardClass:`border-[#ff6b00]/50`,headerClass:`bg-[#ff6b00]/5`,glowClass:``}:e===`OK`?{cardClass:`border-[#0bda57]/30`,headerClass:`bg-[#0bda57]/5`,glowClass:``}:t?{cardClass:`border-[#11a4d4]/50`,headerClass:`bg-[#11a4d4]/5`,glowClass:`shadow-[0_0_10px_rgba(17,164,212,0.1)]`}:{cardClass:`border-slate-700`,headerClass:`bg-[#151f24]`,glowClass:``}}function M5({notification:e}){let t=[[`completed`,`text-green-500`,e.completed],[`failed`,`text-red-400`,e.failed],[`cancelled`,`text-slate-400`,e.cancelled],[`running`,`text-[#11a4d4]`,e.running]].map(([e,t,n])=>({name:e,color:t,runs:Array.isArray(n)?n.filter(F5):[]})).filter(e=>e.runs.length>0);return t.length===0?(0,L.jsx)(`div`,{className:`text-xs text-slate-400`,children:`No yielded run updates.`}):(0,L.jsx)(`div`,{className:`grid gap-2`,children:t.map(e=>(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-wider ${e.color}`,children:e.name}),(0,L.jsx)(`div`,{className:`grid gap-1`,children:e.runs.map((t,n)=>(0,L.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] gap-2 rounded-sm border border-slate-700/60 bg-[#0e1116]/60 px-2 py-1.5`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`truncate font-mono text-xs text-slate-200`,children:N5(t.toolName)||`yielded tool`}),(0,L.jsx)(`div`,{className:`truncate font-mono text-[10px] text-slate-500`,children:N5(t.runId)})]}),(0,L.jsx)(`div`,{className:`font-mono text-[10px] uppercase text-slate-400`,children:N5(t.status)||e.name})]},`${e.name}-${n}`))})]},e.name))})}function N5(e){return typeof e==`string`?e:``}function P5(e,t){let n=(e-t)/1e3,r=Math.floor(n/6e4),i=Math.floor(n%6e4/1e3),a=Math.floor(n%1e3);return`${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}.${String(a).padStart(3,`0`)}`}function F5(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function I5(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var L5=e=>e.spanType===`model.request`?!1:(e.spanType,!0);function R5(e){let t=[];for(let n of B5(e))t.push(...z5(n));return t}function z5(e){let t=e.children?R5(e.children):void 0;if(e.spanType===`agent.run`)return t??[];if(e.spanType===`model.response`){let n=e.children?{...e,children:void 0}:e;return B5([...t??[],n])}return L5(e)?t===e.children?[e]:[{...e,children:t}]:t??[]}function B5(e){return[...e].sort(V5)}function V5(e,t){let n=xd(e.pibo?.traceOrder,t.pibo?.traceOrder);return n===0?e.startTime-t.startTime||e.id.localeCompare(t.id):n}var H5={"--trace-readable-width":`min(100%, clamp(36rem, 58vw, 64rem))`},U5=1;function W5({trace:e,isLoading:t=!1,showThinking:n,expandThinking:r,sessionAgentProfile:i,sessionBreadcrumbs:a=[],originSession:o,derivedSessions:s=[],agentProfiles:c=[],sessionProfileChangeDisabled:l=!1,onSessionAgentProfileChange:u,onFork:d,onOpenSession:f}){let p=(0,I.useRef)(null),m=(0,I.useRef)(!0),[h,g]=(0,I.useState)(U5),[_,v]=(0,I.useState)(0),[y,b]=(0,I.useState)(String(U5)),[x,S]=(0,I.useState)(!1),C=(0,I.useMemo)(()=>e?.spans?R5(t7(e.spans,n)):[],[e?.spans,n]),w=(0,I.useMemo)(()=>n7(C),[C]),T=(0,I.useMemo)(()=>w.length?Math.min(...w.map(e=>e.startTime)):0,[w]),E=(0,I.useMemo)(()=>({completed:w.filter(e=>e.status===`OK`).length,error:w.filter(e=>e.status===`ERROR`).length,active:w.filter(e=>e.status===`UNSET`).length}),[w]),D=e?.status===`UNSET`,O=(0,I.useCallback)(()=>{let e=p.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;m.current=t<48,S(t>180)},[]),k=(0,I.useCallback)((e=`smooth`)=>{let t=p.current;t&&(m.current=!0,t.scrollTo({top:t.scrollHeight,behavior:e}),S(!1))},[]);if((0,I.useLayoutEffect)(()=>{m.current=!0;let e=requestAnimationFrame(()=>k(`auto`));return()=>cancelAnimationFrame(e)},[k,e?.id]),(0,I.useLayoutEffect)(()=>{if(!D||!m.current)return;let e=requestAnimationFrame(()=>{p.current&&m.current&&k(`auto`)});return()=>cancelAnimationFrame(e)},[D,k,e?.spans]),!e)return(0,L.jsxs)(`section`,{className:`flex-1 flex flex-col bg-[#0c1214] relative overflow-hidden`,children:[(0,L.jsxs)(`div`,{className:`h-14 px-6 border-b border-slate-800 bg-[#1a262b]/80 flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,L.jsxs)(`h2`,{className:`text-sm font-bold uppercase tracking-wide flex items-center gap-2`,children:[(0,L.jsx)(qo,{size:18,className:`text-[#11a4d4]`}),`Execution Flow`]}),o?(0,L.jsx)(K5,{originSession:o,onOpenSession:f}):null,(0,L.jsx)(G5,{sessions:s,onOpenSession:f})]}),(0,L.jsx)(q5,{items:a,onOpenSession:f})]}),(0,L.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-slate-500`,children:t?(0,L.jsx)(Q5,{}):`No Trace Selected`})]});let A=e=>{g(e),typeof e==`number`&&e>0&&b(String(e)),v(e=>e+1)},j=()=>{let e=Number.parseInt(y,10);A(Number.isFinite(e)&&e>0?e:U5)};return(0,L.jsxs)(`section`,{className:`min-w-0 flex-1 flex flex-col bg-[#0c1214] relative overflow-hidden`,children:[(0,L.jsxs)(`div`,{className:`min-h-14 px-6 py-1.5 border-b border-slate-800 bg-[#1a262b]/80 flex items-center justify-between gap-3 sticky top-0 z-20`,children:[(0,L.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[18px_minmax(0,1fr)] items-start gap-x-4 gap-y-1`,children:[(0,L.jsx)(qo,{size:18,className:`mt-0.5 text-[#11a4d4]`,"aria-label":`Execution flow`}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[t?(0,L.jsx)(Z5,{color:`cyan`,children:`Loading`}):null,E.active>0?(0,L.jsxs)(Z5,{color:`cyan`,children:[E.active,` Active`]}):null,E.completed>0?(0,L.jsxs)(Z5,{color:`green`,children:[E.completed,` Done`]}):null,i?(0,L.jsx)(Z5,{color:`transparent`,children:i}):null,E.error>0?(0,L.jsxs)(Z5,{color:`orange`,children:[E.error,` Errors`]}):null,o?(0,L.jsx)(K5,{originSession:o,onOpenSession:f}):null,(0,L.jsx)(G5,{sessions:s,onOpenSession:f})]}),(0,L.jsx)(`div`,{className:`col-start-2 min-w-0`,children:(0,L.jsx)(q5,{items:a,onOpenSession:f})})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 self-center`,children:[(0,L.jsx)(X5,{title:`Default expansion`,active:h===U5,onClick:()=>A(U5),children:(0,L.jsx)(ss,{size:14})}),(0,L.jsx)(X5,{title:`Collapse all`,active:h===0,onClick:()=>A(0),children:(0,L.jsx)(zo,{size:14})}),(0,L.jsx)(X5,{title:`Expand all`,active:h===`all`,onClick:()=>A(`all`),children:(0,L.jsx)(Lo,{size:14})}),(0,L.jsxs)(`form`,{className:`ml-1 flex h-8 items-center overflow-hidden rounded-sm border border-slate-700 bg-[#151f24]/80 focus-within:border-[#11a4d4]`,onSubmit:e=>{e.preventDefault(),j()},children:[(0,L.jsx)(`input`,{type:`number`,min:1,value:y,onChange:e=>b(e.target.value),title:`Nesting level`,"aria-label":`Nesting level`,className:`h-full w-11 bg-transparent px-1 text-center font-mono text-xs text-slate-300 outline-none`}),(0,L.jsx)(`button`,{type:`submit`,title:`Expand to nesting level`,"aria-label":`Expand to nesting level`,className:`inline-flex h-full w-8 items-center justify-center border-l border-slate-700 text-slate-400 hover:text-[#11a4d4]`,children:(0,L.jsx)(Zo,{size:14})})]})]})]}),(0,L.jsx)(`div`,{ref:p,onScroll:O,className:`min-w-0 flex-1 overflow-y-auto overflow-x-hidden`,children:C.length?(0,L.jsxs)(`div`,{className:`relative w-full min-w-0 max-w-full p-6`,style:H5,children:[C.map(e=>(0,L.jsx)(C5,{span:e,startTime:T,expansionDepth:h,expansionSignal:_,expandThinking:r,onFork:d,onOpenSession:f},e.id)),D?(0,L.jsx)(e7,{}):null]}):(0,L.jsx)($5,{agentProfiles:c,sessionAgentProfile:i,profileChangeDisabled:l,onSelectAgentProfile:u})}),x?(0,L.jsx)(`button`,{type:`button`,onClick:()=>k(),title:`Scroll to latest`,"aria-label":`Scroll to latest`,className:`absolute right-4 bottom-4 z-30 inline-flex h-9 w-9 items-center justify-center rounded-sm border border-[#11a4d4] bg-[#151f24]/95 text-[#11a4d4] shadow-lg shadow-black/30 transition-colors hover:bg-[#11a4d4] hover:text-white`,children:(0,L.jsx)(Po,{size:18})}):null]})}function G5({sessions:e,onOpenSession:t}){let[n,r]=(0,I.useState)(!1);return e.length?(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>r(e=>!e),title:`${e.length} fork${e.length===1?``:`s`} from this session`,"aria-label":`${e.length} fork${e.length===1?``:`s`} from this session`,"aria-expanded":n,className:`inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-sm border border-[#a855f7]/50 bg-[#a855f7]/10 text-[#a855f7] transition-colors hover:border-[#a855f7] hover:bg-[#a855f7]/15`,children:(0,L.jsx)(Jo,{size:13})}),n?(0,L.jsxs)(`div`,{className:`absolute left-0 top-7 z-50 w-72 overflow-hidden rounded-sm border border-slate-700 bg-[#151f24] shadow-xl shadow-black/40`,children:[(0,L.jsx)(`div`,{className:`border-b border-slate-800 px-3 py-2 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Forks`}),(0,L.jsx)(`div`,{className:`max-h-64 overflow-y-auto p-1`,children:e.map(e=>(0,L.jsxs)(`button`,{type:`button`,onClick:()=>{r(!1),t(e.piboSessionId)},className:`grid w-full grid-cols-[8px_minmax(0,1fr)] items-center gap-2 rounded-sm px-2 py-2 text-left text-slate-300 hover:bg-[#1a262b]`,children:[(0,L.jsx)(`span`,{className:`h-2 w-2 rounded-full ${e.status===`running`?`bg-[#0bda57]`:e.status===`error`?`bg-red-500`:`bg-slate-600`}`}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block truncate text-xs font-semibold text-slate-200`,children:e.label}),(0,L.jsxs)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:[e.profile,` · `,e.piboSessionId]})]})]},e.piboSessionId))})]}):null]}):null}function K5({originSession:e,onOpenSession:t}){return(0,L.jsx)(`button`,{type:`button`,onClick:()=>t(e.piboSessionId),title:`Open origin session: ${e.label}`,"aria-label":`Open origin session: ${e.label}`,className:`inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-sm border border-[#f97316]/50 bg-[#f97316]/10 text-[#f97316] transition-colors hover:border-[#f97316] hover:bg-[#f97316]/15`,children:(0,L.jsx)(Jo,{size:13})})}function q5({items:e,onOpenSession:t}){return e.length<=1?null:(0,L.jsx)(`nav`,{"aria-label":`Session hierarchy`,className:`min-w-0`,children:(0,L.jsx)(`ol`,{className:`flex min-w-0 items-center gap-1 overflow-hidden text-[11px] leading-4`,children:J5(e).map((e,n)=>e.type===`ellipsis`?(0,L.jsxs)(`li`,{className:`inline-flex shrink-0 items-center gap-1`,children:[n>0?(0,L.jsx)(Fo,{size:12,className:`shrink-0 text-slate-600`}):null,(0,L.jsx)(`span`,{className:`shrink-0 px-1 font-mono text-slate-500`,children:`...`})]},`ellipsis-${n}`):(0,L.jsxs)(`li`,{className:`inline-flex min-w-0 items-center gap-1`,children:[n>0?(0,L.jsx)(Fo,{size:12,className:`shrink-0 text-slate-600`}):null,e.current?(0,L.jsx)(`span`,{className:`block min-w-0 max-w-56 truncate font-mono text-slate-200`,children:e.item.label}):(0,L.jsx)(`a`,{href:`/sessions/${encodeURIComponent(e.item.piboSessionId)}`,className:`block min-w-0 max-w-48 truncate font-mono text-slate-400 transition-colors hover:text-[#11a4d4]`,onClick:n=>{n.preventDefault(),t(e.item.piboSessionId)},children:e.item.label})]},e.item.piboSessionId))})})}function J5(e){return e.length<=5?e.map((t,n)=>({type:`item`,item:t,current:n===e.length-1})):[{type:`item`,item:e[0],current:!1},{type:`ellipsis`},...e.slice(-2).map((e,t,n)=>({type:`item`,item:e,current:t===n.length-1}))]}function Y5({agentProfiles:e,sessionAgentProfile:t,profileChangeDisabled:n,onSelectAgentProfile:r}){return e.length?(0,L.jsxs)(`div`,{className:`mt-8 w-full max-w-3xl`,children:[(0,L.jsx)(`div`,{className:`mb-3 text-[11px] font-bold uppercase tracking-[0.12em] text-slate-500`,children:`Session Agent`}),(0,L.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:e.map(e=>{let i=e.name===t;return(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r?.(e.name),disabled:n||i,className:`grid min-h-24 w-full grid-cols-[1fr_auto] gap-3 rounded-sm border px-4 py-3 text-left transition-colors ${i?`border-[#11a4d4] bg-[#11a4d4]/10 text-slate-100`:`border-slate-700 bg-[#151f24] text-slate-300 hover:border-[#11a4d4] hover:text-slate-100`} disabled:cursor-default disabled:opacity-100`,children:[(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block truncate font-mono text-sm text-slate-100`,children:e.name}),(0,L.jsx)(`span`,{className:`mt-2 block text-sm leading-6 text-slate-500`,children:e.description||`Use this profile for the first message in this session.`})]}),(0,L.jsx)(`span`,{className:`mt-0.5 inline-flex h-6 min-w-6 items-center justify-center rounded-full border border-current/30 px-2 text-[10px] font-bold uppercase tracking-wide`,children:i?(0,L.jsx)(No,{size:12}):`Set`})]},e.name)})})]}):null}function X5({title:e,active:t,onClick:n,children:r}){return(0,L.jsx)(`button`,{type:`button`,onClick:n,title:e,"aria-label":e,className:`inline-flex h-8 w-8 items-center justify-center rounded-sm border transition-colors ${t?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#11a4d4]`:`border-slate-700 bg-[#151f24]/80 text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`}`,children:r})}function Z5({color:e,children:t}){return(0,L.jsx)(`span`,{className:`max-w-52 truncate rounded-sm px-2 py-0.5 text-xs font-bold ${e===`transparent`?``:`uppercase`} ${e===`cyan`?`bg-[#11a4d4]/20 text-[#11a4d4]`:e===`green`?`bg-[#0bda57]/20 text-[#0bda57]`:e===`orange`?`bg-[#ff6b00]/20 text-[#ff6b00]`:`border border-slate-700 text-slate-300`}`,children:t})}function Q5(){return(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-sm text-[#11a4d4]`,role:`status`,"aria-live":`polite`,children:[(0,L.jsx)(os,{size:16,className:`animate-spin`}),(0,L.jsx)(`span`,{children:`Loading Trace...`})]})}function $5({agentProfiles:e,sessionAgentProfile:t,profileChangeDisabled:n,onSelectAgentProfile:r}){return(0,L.jsx)(`div`,{className:`flex min-h-full items-center justify-center p-6`,children:(0,L.jsxs)(`div`,{className:`flex w-full max-w-3xl flex-col items-center text-center`,children:[(0,L.jsx)(`div`,{className:`mb-4 flex h-12 w-12 items-center justify-center rounded-sm border border-[#11a4d4]/35 bg-[#11a4d4]/10 text-[#11a4d4]`,children:(0,L.jsx)(es,{size:22})}),(0,L.jsx)(`h3`,{className:`text-2xl font-semibold text-slate-200`,children:`No Traces`}),(0,L.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-slate-500`,children:`Send a message to the agent to start an execution trace.`}),(0,L.jsx)(Y5,{agentProfiles:e,sessionAgentProfile:t,profileChangeDisabled:n,onSelectAgentProfile:r})]})})}function e7(){return(0,L.jsx)(`div`,{className:`relative mb-8 w-full`,style:{maxWidth:`var(--trace-readable-width)`},children:(0,L.jsxs)(`div`,{className:`bg-[#1a262b] border border-[#11a4d4]/30 rounded-sm p-4 flex items-center gap-3`,children:[(0,L.jsx)(`span`,{className:`inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[#11a4d4]/20 border-2 border-[#11a4d4] animate-pulse`,children:(0,L.jsx)(os,{size:14,className:`text-[#11a4d4] animate-spin`})}),(0,L.jsx)(`span`,{className:`text-sm text-[#11a4d4]`,children:`Executing...`})]})})}function t7(e,t){return e.flatMap(e=>!t&&e.spanType===`model.reasoning`?[]:[{...e,children:e.children?t7(e.children,t):void 0}])}function n7(e){return e.flatMap(e=>[e,...e.children?n7(e.children):[]])}function ine({selectedTrace:e,isLoading:t,showThinking:n,expandThinking:r,sessionAgentProfile:i,sessionBreadcrumbs:a,originSession:o,derivedSessions:s,agentProfiles:c,sessionProfileChangeDisabled:l,onSessionAgentProfileChange:u,onFork:d,onOpenSession:f}){return(0,L.jsx)(W5,{trace:e,isLoading:t,showThinking:n,expandThinking:r,sessionAgentProfile:i,sessionBreadcrumbs:a,originSession:o,derivedSessions:s,agentProfiles:c,sessionProfileChangeDisabled:l,onSessionAgentProfileChange:u,onFork:d,onOpenSession:f})}function r7(e){if(e==null)return{kind:`empty`};let t=i7(e);return t===void 0?{kind:`json`,value:e}:{kind:`text`,text:t}}function i7(e){if(typeof e==`string`)return e;if(Array.isArray(e)){let t=e.map(i7).filter(e=>e!==void 0);return t.length===e.length&&t.length>0?t.join(``):void 0}if(!a7(e))return;let t=typeof e.type==`string`?e.type:void 0;if(t===`text`&&typeof e.text==`string`)return e.text;if(t===`text`&&typeof e.content==`string`)return e.content;if(t===`output_text`&&typeof e.text==`string`)return e.text;let n=i7(e.content);if(n!==void 0&&ane(e))return n;let r=a7(e.message)?i7(e.message.content):void 0;if(r!==void 0)return r}function ane(e){let t=Object.keys(e).filter(t=>e[t]!==void 0);return t.length===1&&t[0]===`content`||t.every(e=>e===`content`||e===`type`)||t.every(e=>e===`content`||e===`details`||e===`type`)?!0:typeof e.type==`string`&&e.type.includes(`text`)}function a7(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function one({row:e,onOpenSession:t}){return(0,L.jsx)(`div`,{className:`mt-2 border border-[#2a2a2a] bg-[#111111] px-3 py-2 text-[12px] text-[#d4d4d4]`,children:e.detailItems?.length?(0,L.jsx)(`div`,{className:`space-y-3`,children:e.detailItems.map(e=>(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,L.jsx)(`span`,{className:`font-semibold text-[#d4d4d4]`,children:e.label}),e.linkedPiboSessionId?(0,L.jsx)(`button`,{type:`button`,onClick:()=>t(e.linkedPiboSessionId),className:`border border-[#3a3a3a] px-2 py-0.5 text-[#38bdf8] hover:border-[#38bdf8]`,children:`Open Session`}):null]}),(0,L.jsx)(o7,{label:`Input`,value:e.input}),(0,L.jsx)(o7,{label:`Output`,value:e.output}),e.error?(0,L.jsx)(c7,{label:`Error`,value:e.error,tone:`red`}):null]},e.id))}):(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(o7,{label:`Input`,value:e.input}),(0,L.jsx)(o7,{label:`Output`,value:e.output}),e.error?(0,L.jsx)(c7,{label:`Error`,value:e.error,tone:`red`}):null,e.linkedPiboSessionId?(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,L.jsx)(`span`,{className:`text-[#737373]`,children:`Child session`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>t(e.linkedPiboSessionId),className:`border border-[#3a3a3a] px-2 py-0.5 text-[#38bdf8] hover:border-[#38bdf8]`,children:e.linkedPiboSessionId})]}):null]})})}function o7({label:e,value:t}){let n=r7(t);if(n.kind===`empty`)return null;if(n.kind===`text`){let t=l7(n.text);return t?.kind===`json`?(0,L.jsx)(s7,{label:e,value:t.value,meta:t.meta}):t?.kind===`text`?(0,L.jsx)(c7,{label:e,value:t.text}):(0,L.jsx)(c7,{label:e,value:n.text})}return(0,L.jsx)(s7,{label:e,value:n.value})}function s7({label:e,value:t,meta:n}){return(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,L.jsx)(`div`,{className:`text-[11px] font-semibold text-[#737373]`,children:e}),n?(0,L.jsxs)(`div`,{className:`min-w-0 break-words text-[11px] text-[#737373]`,children:[`Status: `,n]}):null]}),(0,L.jsx)(`div`,{className:`compact-terminal-json border border-[#2a2a2a] bg-[#0b0b0b] p-2`,children:(0,L.jsx)(md,{value:t,showControls:!1})})]})}function c7({label:e,value:t,tone:n=`default`}){return(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`div`,{className:`text-[11px] font-semibold text-[#737373]`,children:e}),(0,L.jsx)(`pre`,{className:`m-0 whitespace-pre-wrap break-words border border-[#2a2a2a] bg-[#0b0b0b] p-2 font-mono text-[12px] leading-[1.45] ${n===`red`?`text-[#ef4444]`:`text-[#d4d4d4]`}`,children:t})]})}function l7(e){let t=e.trim();if(!t)return;let n=d7(t);if(n!==void 0)return u7(n);let r=t.split(/\r?\n/);for(let e=1;e<r.length;e+=1){let t=r.slice(e).join(`
151
- `).trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))continue;let n=d7(t);if(n!==void 0)return u7(n,r.slice(0,e).join(` `).trim()||void 0)}}function u7(e,t){let n=r7(e);if(n.kind===`text`){let e=l7(n.text);return e?.kind===`json`?{...e,meta:e.meta??t}:{kind:`text`,text:n.text}}return{kind:`json`,value:e,meta:t}}function d7(e){if(!(!e.startsWith(`{`)&&!e.startsWith(`[`)))try{let t=JSON.parse(e);return typeof t==`object`&&t?t:void 0}catch{return}}function sne({name:e,input:t}){return(0,L.jsxs)(`span`,{className:`compact-terminal-function-call`,children:[(0,L.jsx)(`span`,{className:`text-[#facc15] font-semibold`,children:e}),(0,L.jsx)(`span`,{className:`text-[#d4d4d4]`,children:`(`}),t===void 0?null:(0,L.jsx)(cne,{value:t}),(0,L.jsx)(`span`,{className:`text-[#d4d4d4]`,children:`)`})]})}function cne({value:e}){let[t,n]=(0,I.useState)(()=>new Set([`$`])),[r,i]=(0,I.useState)(()=>new Set);return(0,L.jsx)(f7,{value:e,path:`$`,expandedPaths:t,expandedStrings:r,onTogglePath:e=>{n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},onToggleString:e=>{i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}})}function f7({value:e,path:t,expandedPaths:n,expandedStrings:r,onTogglePath:i,onToggleString:a}){if(Array.isArray(e))return(0,L.jsx)(p7,{value:e,path:t,open:`[`,close:`]`,expandedPaths:n,expandedStrings:r,onTogglePath:i,onToggleString:a});if(une(e))return(0,L.jsx)(p7,{value:e,path:t,open:`{`,close:`}`,expandedPaths:n,expandedStrings:r,onTogglePath:i,onToggleString:a});if(typeof e==`string`){let n=r.has(t),i=e.length>140&&!n,o=i?`${e.slice(0,140)}...`:e,s=(0,L.jsx)(`span`,{className:`text-[#fb923c]`,children:JSON.stringify(o)});return!i&&e.length<=140?s:(0,L.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),a(t)},className:`compact-terminal-json-toggle text-left align-baseline`,title:n?`Collapse string`:`Expand string`,children:s})}return typeof e==`number`||typeof e==`boolean`||e===null?(0,L.jsx)(`span`,{className:`text-[#60a5fa]`,children:String(e)}):(0,L.jsx)(`span`,{className:`text-[#737373]`,children:JSON.stringify(String(e))})}function p7({value:e,path:t,open:n,close:r,expandedPaths:i,expandedStrings:a,onTogglePath:o,onToggleString:s}){let c=Array.isArray(e)?e.map((e,t)=>[String(t),e]):Object.entries(e);return i.has(t)?(0,L.jsxs)(`span`,{children:[(0,L.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o(t)},className:`compact-terminal-json-toggle align-baseline text-[#737373]`,title:`Collapse JSON`,"aria-label":`Collapse JSON at ${t}`,"data-inline-json-path":t,children:[(0,L.jsx)(`span`,{className:`compact-terminal-json-caret`,children:`▾`}),n]}),c.map(([n,r],c)=>{let l=`${t}.${lne(n)}`;return(0,L.jsxs)(`span`,{children:[c>0?(0,L.jsx)(`span`,{className:`text-[#737373]`,children:`, `}):null,Array.isArray(e)?null:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`text-[#d4d4d4]`,children:JSON.stringify(n)}),(0,L.jsx)(`span`,{className:`text-[#737373]`,children:`:`})]}),(0,L.jsx)(f7,{value:r,path:l,expandedPaths:i,expandedStrings:a,onTogglePath:o,onToggleString:s})]},l)}),(0,L.jsx)(`span`,{className:`text-[#737373]`,children:r})]}):(0,L.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o(t)},className:`compact-terminal-json-toggle align-baseline text-[#737373]`,title:`Expand JSON`,"aria-label":`Expand JSON at ${t}`,"data-inline-json-path":t,children:[(0,L.jsx)(`span`,{className:`compact-terminal-json-caret`,children:`▸`}),n,`...`,r]})}function lne(e){return e.replaceAll(`\\`,`\\\\`).replaceAll(`.`,`\\.`)}function une(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function m7({line:e,status:t}){return(0,L.jsxs)(`div`,{className:`grid grid-cols-[1.9rem_minmax(0,1fr)] gap-2 leading-[1.45]`,children:[(0,L.jsx)(`span`,{className:`whitespace-pre ${fne(e.prefix,t)}`,children:dne(e.prefix)}),(0,L.jsxs)(`span`,{className:`min-w-0 whitespace-pre-wrap break-words`,children:[e.tokens.map((e,t)=>(0,L.jsx)(`span`,{className:pne(e),children:e.text},`${t}:${e.text}`)),e.functionCall?(0,L.jsx)(sne,{name:e.functionCall.name,input:e.functionCall.input}):null]})]})}function dne(e=`none`){switch(e){case`bullet`:return`•`;case`detail`:return`└`;case`continuation`:return` `;case`prompt`:return`›`;default:return` `}}function fne(e=`none`,t){if(e===`bullet`){if(t===`running`)return`text-[#38bdf8]`;if(t===`error`)return`text-[#ef4444]`;if(t===`done`)return`text-[#22c55e]`}return`text-[#737373]`}function pne(e){return`${e.tone===`dim`?`text-[#737373]`:e.tone===`cyan`?`text-[#38bdf8]`:e.tone===`green`?`text-[#22c55e]`:e.tone===`red`?`text-[#ef4444]`:e.tone===`magenta`?`text-[#d946ef]`:e.tone===`yellow`?`text-[#facc15]`:e.tone===`blue`?`text-[#60a5fa]`:e.tone===`amber`?`text-[#f59e0b]`:`text-[#d4d4d4]`} ${e.weight===`bold`?`font-bold`:e.weight===`semibold`?`font-semibold`:`font-normal`} ${e.italic?`italic`:``}`.trim()}function mne(e,t){return e?One(h7(e.nodes).flatMap(e=>e.node.type===`agent.turn`||e.node.type===`model.reasoning`&&!t.showThinking?[]:[hne(e.node,e.turnId)])).map(e=>e.row):[]}function h7(e,t){let n=[];for(let r of e)r.type!==`agent.turn`&&n.push({node:r,turnId:t}),n.push(...h7(r.children,r.type===`agent.turn`?r.id:t));return n}function hne(e,t){let n;switch(e.type){case`user.message`:n={row:_ne(e),turnId:t};break;case`assistant.message`:n={row:vne(e),turnId:t};break;case`model.reasoning`:n={row:yne(e),turnId:t};break;case`tool.call`:n=bne(e,t);break;case`tool.result`:n={row:xne(e),turnId:t};break;case`agent.delegation`:n={row:Sne(e),turnId:t};break;case`agent.async`:n={row:Cne(e),turnId:t};break;case`yielded.run`:n={row:wne(e),turnId:t};break;case`execution.command`:n={row:Tne(e),turnId:t};break;case`error`:n={row:Dne(e),turnId:t};break;case`agent.turn`:n={row:{id:e.id,kind:`error`,status:`neutral`,lines:[],sourceNodeIds:[e.id]},turnId:t};break}return{...n,row:{...n.row,...gne(e)}}}function gne(e){return{eventId:e.eventId,runId:e.runId,orderSource:e.source,orderStreamId:e.orderKey?.streamId,orderStreamFrameIndex:e.orderKey?.streamFrameIndex}}function _ne(e){let t=D7(e.output)||D7(e.summary)||e.title;return{id:e.id,kind:`message.user`,status:w7(e.status),lines:[{prefix:`prompt`,tokens:[E7(t)]}],sourceNodeIds:[e.id],forkEntryId:e.entryId,output:t}}function vne(e){return{id:e.id,kind:`message.assistant`,status:w7(e.status),lines:[],sourceNodeIds:[e.id],output:D7(e.output)||D7(e.summary)||``,error:e.error}}function yne(e){let t=y7(e.output??e.summary);return{id:e.id,kind:`reasoning`,status:w7(e.status),lines:[{prefix:`bullet`,tokens:[E7(e.status===`running`?`Thinking`:`Thought`,`amber`,`semibold`)]}],sourceNodeIds:[e.id],markdown:t}}function bne(e,t){let n=x7(e.input);if(n&&Mne(e.title))return{row:Ene(e,n),turnId:t,exploring:void 0};let r=v7(e.error??e.output,4,e.error?`red`:`dim`);return{row:{id:e.id,kind:`tool.call`,status:w7(e.status),lines:[{prefix:`bullet`,tokens:[E7(Nne(e.status),T7(e.status),`semibold`),E7(` `)],functionCall:{name:e.title,input:e.input}},...r.lines],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error},turnId:t,exploring:Ane(e)}}function xne(e){let t=v7(e.error??e.output,4,e.error?`red`:`dim`);return{id:e.id,kind:`tool.call`,status:w7(e.status),lines:[{prefix:`bullet`,tokens:[E7(e.status===`error`?`Tool failed`:`Returned`,T7(e.status),`semibold`),E7(` ${e.title}`)]},...t.lines],sourceNodeIds:[e.id],output:e.output,error:e.error,expandable:e.output!==void 0||!!e.error}}function Sne(e){let t=D7(O7(e.input)?e.input.subagentName:void 0)||e.summary||e.title,n=b7((O7(e.input)?e.input.arguments:void 0)??e.input),r=n?[{prefix:`detail`,tokens:[E7(n,`dim`)]}]:[];return{id:e.id,kind:`agent.delegation`,status:w7(e.status),lines:[{prefix:`bullet`,tokens:[E7(Pne(e.status),T7(e.status),`semibold`),E7(` ${t}`,`cyan`)]},...r],sourceNodeIds:[e.id],linkedPiboSessionId:e.linkedPiboSessionId,input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error}}function Cne(e){let t=v7(e.error??e.output,4,e.error?`red`:`dim`);return{id:e.id,kind:`agent.async`,status:w7(e.status),lines:[{prefix:`bullet`,tokens:[E7(Fne(e.status),T7(e.status),`semibold`),E7(` ${e.title}`,`cyan`)]},...t.lines],sourceNodeIds:[e.id],linkedPiboSessionId:e.linkedPiboSessionId,input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error}}function wne(e){let t=v7(e.output,4);return{id:e.id,kind:`yielded.run`,status:w7(e.status),lines:[{prefix:`bullet`,tokens:[E7(e.status===`running`?`Waiting on runs`:`Run update`,T7(e.status),`semibold`),E7(e.summary?` ${e.summary}`:``)]},...t.lines],sourceNodeIds:[e.id],output:e.output,error:e.error,expandable:e.output!==void 0||!!e.error}}function Tne(e){let t=x7(e.output)??x7(e.input)??e.title,n=v7(e.error??e.output,4,e.error?`red`:`dim`,180);return{id:e.id,kind:`execution.command`,status:w7(e.status),lines:[{prefix:`bullet`,tokens:[E7(`Ran`,T7(e.status),`semibold`),E7(` `),...S7(t)]},...n.lines],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error}}function Ene(e,t){let n=v7(e.error??e.output,4,e.error?`red`:`dim`,180);return{id:e.id,kind:`execution.command`,status:w7(e.status),lines:[{prefix:`bullet`,tokens:[E7(e.status===`running`?`Running`:`Ran`,T7(e.status),`semibold`),E7(` `),...S7(t)]},...n.lines],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error}}function Dne(e){return{id:e.id,kind:`error`,status:`error`,lines:[{prefix:`bullet`,tokens:[E7(`Error`,`red`,`bold`),E7(e.error?` ${e.error}`:``,`red`)]}],sourceNodeIds:[e.id],error:e.error,output:e.output,expandable:e.output!==void 0||!!e.error}}function One(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e[n];if(!r.exploring){t.push(r);continue}let i=[r],a=n+1;for(;a<e.length&&e[a].exploring&&e[a].turnId===r.turnId;)i.push(e[a]),a+=1;if(i.length===1){t.push(r);continue}t.push({row:kne(i),turnId:r.turnId}),n=a-1}return t}function kne(e){let t=e.map(e=>({id:e.row.id,label:e.exploring?.label??e.row.lines[0]?.tokens.map(e=>e.text).join(``)??e.row.id,status:e.row.status,input:e.row.input,output:e.row.output,error:e.row.error,linkedPiboSessionId:e.row.linkedPiboSessionId})),n=e[0]?.row.id??`exploring`,r=e[e.length-1]?.row.id??n,i=e.some(e=>e.row.status===`running`)?`running`:e.some(e=>e.row.status===`error`)?`error`:`done`;return{id:`group:exploring:${n}:${r}`,kind:`tool.group.exploring`,status:i,lines:[{prefix:`bullet`,tokens:[E7(i===`running`?`Exploring`:i===`error`?`Exploring failed`:`Explored`,T7(i),`semibold`)]},...t.map((e,t)=>({prefix:t===0?`detail`:`continuation`,tokens:[E7(e.label,e.status===`error`?`red`:`dim`)]}))],sourceNodeIds:e.flatMap(e=>e.row.sourceNodeIds),detailItems:t,expandable:t.some(e=>e.input!==void 0||e.output!==void 0||!!e.error)}}function Ane(e){let t=e.title.trim().toLowerCase(),n=O7(e.input)?e.input:void 0;if(g7(t,[`read`,`open`]))return{id:e.id,label:`Read ${_7(n)??b7(e.input)}`,status:w7(e.status),input:e.input,output:e.output,error:e.error};if(g7(t,[`list`,`ls`,`glob`]))return{id:e.id,label:`List ${_7(n)??b7(e.input)}`,status:w7(e.status),input:e.input,output:e.output,error:e.error};if(g7(t,[`search`,`find`,`grep`,`rg`])){let t=jne(n),r=_7(n);return{id:e.id,label:`Search ${t??b7(e.input)}${r?` in ${r}`:``}`,status:w7(e.status),input:e.input,output:e.output,error:e.error}}}function g7(e,t){return t.some(t=>e===t||e.startsWith(`${t}_`)||e.endsWith(`_${t}`)||e.includes(t))}function _7(e){if(e)for(let t of[`path`,`file`,`filePath`,`filepath`,`url`,`uri`,`cwd`,`pattern`,`glob`]){let n=D7(e[t]);if(n)return C7(n,80)}}function jne(e){if(e)for(let t of[`query`,`pattern`,`text`,`name`,`q`,`regex`]){let n=D7(e[t]);if(n)return C7(n,80)}}function v7(e,t,n=`dim`,r=160){let i=y7(e);if(!i)return{lines:[],truncated:!1};let a=i.split(/\r?\n/).map(e=>e.trimEnd()).filter((e,t,n)=>e.length>0||n.length===1);if(!a.length)return{lines:[],truncated:!1};let o=a.slice(0,t).map((e,t)=>({prefix:t===0?`detail`:`continuation`,tokens:[E7(C7(e,r),n)]}));return a.length>t&&o.push({prefix:`continuation`,tokens:[E7(`+${a.length-t} more lines`,`dim`,`normal`,!0)]}),{lines:o,truncated:a.length>t}}function y7(e){let t=i7(e);if(t!==void 0)return t.trim();if(typeof e==`string`)return e.trim();if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function b7(e){return C7((typeof e==`string`?e:y7(e)).replace(/\s+/g,` `).trim(),96)}function Mne(e){let t=e.trim().toLowerCase();return t===`shell`||t===`bash`||t===`terminal`}function x7(e){if(O7(e))for(let t of[`cmd`,`command`,`script`]){let n=D7(e[t]);if(n)return n}}function S7(e){let t=e.match(/\s+|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[^\s]+/g)??[e],n=!1;return t.map(e=>/^\s+$/.test(e)?E7(e):/^(?:&&|\|\||[|;<>]|2>&1)$/.test(e)?E7(e,`red`,`semibold`):e.startsWith(`-`)?E7(e,`magenta`):e.startsWith(`$`)||e.includes(`=`)?E7(e,`yellow`):/^['"]/.test(e)?E7(e,`green`):n?e.includes(`/`)||e.startsWith(`.`)?E7(e,`cyan`):E7(e,`default`):(n=!0,E7(e,`green`,`semibold`)))}function C7(e,t){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}…`}function Nne(e){return e===`running`?`Calling`:e===`error`?`Call failed`:`Called`}function Pne(e){return e===`running`?`Spawning`:e===`error`?`Spawn failed`:`Spawned`}function Fne(e){return e===`running`?`Waiting for`:`Finished waiting for`}function w7(e){return e===`running`?`running`:e===`error`?`error`:`done`}function T7(e){return e===`running`?`cyan`:e===`error`?`red`:e===`done`?`green`:`default`}function E7(e,t=`default`,n=`normal`,r=!1){return{text:e,tone:t,weight:n,italic:r}}function D7(e){return typeof e==`string`&&e.trim().length?e:void 0}function O7(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Ine({traceView:e,isLoading:t,showThinking:n,expandThinking:r,sessionAgentProfile:i,sessionBreadcrumbs:a,originSession:o,derivedSessions:s,agentProfiles:c,sessionProfileChangeDisabled:l,onSessionAgentProfileChange:u,onFork:d,onOpenSession:f}){let p=(0,I.useMemo)(()=>mne(e,{showThinking:n}),[n,e]),m=(0,I.useRef)(null),h=(0,I.useRef)(!0),[g,_]=(0,I.useState)(!1),[v,y]=(0,I.useState)(new Set),b=p.filter(e=>e.status===`running`).length,x=p.filter(e=>e.status===`error`).length,S=b>0;(0,I.useEffect)(()=>{y(e=>{let t=new Set;for(let n of p)e.has(n.id)&&t.add(n.id),r&&n.kind===`reasoning`&&n.expandable&&t.add(n.id);return Lne(e,t)?e:t})},[r,p]);let C=()=>{let e=m.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;h.current=t<48,_(t>180)},w=(e=`smooth`)=>{let t=m.current;t&&(h.current=!0,t.scrollTo({top:t.scrollHeight,behavior:e}),_(!1))};return(0,I.useLayoutEffect)(()=>{h.current=!0;let e=requestAnimationFrame(()=>w(`auto`));return()=>cancelAnimationFrame(e)},[e?.piboSessionId]),(0,I.useLayoutEffect)(()=>{if(!S||!h.current)return;let e=requestAnimationFrame(()=>w(`auto`));return()=>cancelAnimationFrame(e)},[S,p]),(0,L.jsxs)(`section`,{className:`min-w-0 flex-1 flex flex-col overflow-hidden bg-[#0b0b0b] text-[#d4d4d4]`,children:[(0,L.jsxs)(`div`,{className:`border-b border-[#2a2a2a] bg-[#111111] px-4 py-2 text-[11px]`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[t?(0,L.jsx)(k7,{tone:`cyan`,children:`Loading`}):null,b>0?(0,L.jsxs)(k7,{tone:`cyan`,children:[b,` running`]}):null,x>0?(0,L.jsxs)(k7,{tone:`red`,children:[x,` errors`]}):null,i?(0,L.jsx)(k7,{tone:`neutral`,children:i}):null,o?(0,L.jsxs)(`button`,{type:`button`,onClick:()=>f(o.piboSessionId),className:`border border-[#3a3a3a] px-2 py-0.5 text-[#38bdf8] hover:border-[#38bdf8]`,children:[`Origin `,o.label]}):null,s.map(e=>(0,L.jsxs)(`button`,{type:`button`,onClick:()=>f(e.piboSessionId),className:`border border-[#3a3a3a] px-2 py-0.5 text-[#38bdf8] hover:border-[#38bdf8]`,children:[`Derived `,e.label]},e.piboSessionId))]}),a.length?(0,L.jsx)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1 text-[#737373]`,children:a.map((e,t)=>(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t>0?(0,L.jsx)(Fo,{size:12,className:`text-[#525252]`}):null,(0,L.jsx)(`button`,{type:`button`,onClick:()=>f(e.piboSessionId),className:`hover:text-[#38bdf8]`,children:e.label})]},e.piboSessionId))}):null]}),(0,L.jsx)(`div`,{ref:m,onScroll:C,className:`min-h-0 flex-1 overflow-y-auto overflow-x-hidden`,children:e?p.length?(0,L.jsxs)(`div`,{className:`px-4 py-3 font-mono text-[12px] leading-[1.45]`,children:[p.map(e=>{let t=v.has(e.id);return(0,L.jsxs)(`div`,{className:e.kind===`message.user`?`group border-b border-[#141414] bg-[#11a4d4]/10 py-2 last:border-b-0 hover:bg-[#11a4d4]/15`:`group border-b border-[#141414] py-2 last:border-b-0 hover:bg-[#161616]`,"data-pibo-terminal-row":`true`,"data-row-id":e.id,"data-row-kind":e.kind,"data-row-status":e.status,"data-trace-node-id":e.sourceNodeIds.join(` `),"data-event-id":e.eventId,"data-run-id":e.runId,"data-order-source":e.orderSource,"data-order-stream-id":e.orderStreamId,"data-order-frame-index":e.orderStreamFrameIndex,children:[(0,L.jsxs)(`div`,{className:`flex gap-3`,children:[(0,L.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.kind===`message.assistant`?(0,L.jsx)(`div`,{className:`ml-[1.9rem] min-w-0`,children:(0,L.jsx)(`div`,{className:`compact-terminal-markdown`,children:(0,L.jsx)(p5,{children:typeof e.output==`string`?e.output:``})})}):e.kind===`reasoning`&&e.markdown?(0,L.jsxs)(L.Fragment,{children:[e.lines.map((t,n)=>(0,L.jsx)(m7,{line:t,status:e.status},`${e.id}:${n}`)),(0,L.jsx)(`div`,{className:`ml-[1.9rem] min-w-0`,children:(0,L.jsx)(`div`,{className:`compact-terminal-markdown compact-terminal-reasoning`,children:(0,L.jsx)(p5,{children:e.markdown})})})]}):e.lines.map((t,n)=>(0,L.jsx)(m7,{line:t,status:e.status},`${e.id}:${n}`))}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-start gap-1 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100`,children:[e.linkedPiboSessionId?(0,L.jsx)(A7,{label:`Open linked session`,onClick:()=>f(e.linkedPiboSessionId),children:`Open`}):null,e.forkEntryId?(0,L.jsx)(A7,{label:`Fork from this message`,onClick:()=>d(e.forkEntryId),children:`Fork`}):null,e.expandable?(0,L.jsx)(A7,{label:t?`Collapse details`:`Expand details`,onClick:()=>y(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),children:t?`Hide`:`Details`}):null]})]}),t?(0,L.jsx)(one,{row:e,onOpenSession:f}):null]},e.id)}),S?(0,L.jsx)(`div`,{className:`pt-2 text-[#737373]`,children:`• Working`}):null]}):(0,L.jsx)(j7,{isLoading:t,agentProfiles:c,disabled:l,onSelectAgentProfile:u,message:`No visible trace rows yet.`}):(0,L.jsx)(j7,{isLoading:t,agentProfiles:c,disabled:l,onSelectAgentProfile:u})}),g?(0,L.jsx)(`button`,{type:`button`,onClick:()=>w(),className:`absolute right-4 bottom-4 border border-[#38bdf8] bg-[#111111] px-2 py-1 font-mono text-[11px] text-[#38bdf8] hover:bg-[#161616]`,children:`Latest`}):null]})}function k7({tone:e,children:t}){return(0,L.jsx)(`span`,{className:`border px-2 py-0.5 ${e===`cyan`?`border-[#1f4960] text-[#38bdf8]`:e===`red`?`border-[#5f2222] text-[#ef4444]`:`border-[#3a3a3a] text-[#d4d4d4]`}`,children:t})}function A7({label:e,onClick:t,children:n}){return(0,L.jsx)(`button`,{type:`button`,onClick:t,"aria-label":e,title:e,className:`min-h-7 min-w-7 border border-[#3a3a3a] px-2 text-[11px] text-[#737373] hover:border-[#38bdf8] hover:text-[#38bdf8]`,children:n})}function j7({isLoading:e,agentProfiles:t,disabled:n,onSelectAgentProfile:r,message:i}){return(0,L.jsxs)(`div`,{className:`flex min-h-full flex-col items-center justify-center gap-4 px-6 py-10 text-center text-[12px] text-[#737373]`,children:[(0,L.jsx)(`div`,{children:e?`Loading trace…`:i??`No trace selected.`}),t.length?(0,L.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:t.map(e=>(0,L.jsx)(`button`,{type:`button`,disabled:n,onClick:()=>r(e.name),className:`border border-[#3a3a3a] px-2 py-1 text-[#d4d4d4] hover:border-[#38bdf8] hover:text-[#38bdf8] disabled:opacity-50`,children:e.name},e.name))}):null]})}function Lne(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var M7=[{id:`trace`,label:`Trace`,description:`Existing nested execution flow view.`,render:e=>(0,L.jsx)(ine,{...e})},{id:`terminal`,label:`Terminal`,description:`Compact Codex-style terminal transcript.`,render:e=>(0,L.jsx)(Ine,{...e})}],N7=new Map(M7.map(e=>[e.id,e]));function Rne(){return M7}function zne(e){return N7.get(e)??N7.get(`trace`)}var Bne=3e4,Vne=30*6e4,Hne=30*6e4;function P7(e,t=!1,n){return[`chat`,`bootstrap`,e??``,t?`archived`:`active`,n??``]}function Une(e=!1,t){return[`chat`,`sessions`,e?`archived`:`active`,t??``]}function F7(e,t={}){return[`chat`,`trace`,e,t.includeRawEvents?`raw`:`compact`,t.rawEventsLimit??80]}function Wne(e){return{roomId:e.selectedRoomId,piboSessionId:e.selectedPiboSessionId,rooms:e.rooms,sessions:e.sessions}}function I7(e,t,n=!1,r){e(Une(n,r??t.selectedRoomId),Wne(t))}function Gne(e){return[`chat`,`trace`,e]}function Kne(e){return!!(e&&typeof e==`object`&&`piboSessionId`in e&&`nodes`in e)}var L7=`pibo.chat.lastSelection`,R7=`pibo.chat.sessionView`,z7=`Delete this session`;async function qne(e,t){let n=P7(t.piboSessionId,t.includeArchived,t.roomId);if(t.markRead){let r=await ys(t.piboSessionId,t.includeArchived,t.roomId,!0);return e.setQueryData(n,r),I7(e.setQueryData.bind(e),r,t.includeArchived,t.roomId),r}t.force&&await e.invalidateQueries({queryKey:n,exact:!0,refetchType:`none`});let r=await e.fetchQuery({queryKey:n,queryFn:()=>ys(t.piboSessionId,t.includeArchived,t.roomId,!1),staleTime:Bne,gcTime:Vne});return I7(e.setQueryData.bind(e),r,t.includeArchived,t.roomId),r}async function Jne(e,t,n={}){let r=F7(t,n),i=e.getQueryData(r),a=await bs(t,{includeRawEvents:n.includeRawEvents,rawEventsLimit:n.rawEventsLimit,knownVersion:i?.version});if(a.notModified&&i)return i;if(!a.trace)throw Error(`Trace response missing payload.`);return a.trace}function Yne({route:e}){let t=ja(),n=Xt(),r=e.area,i=e.area===`sessions`?e.roomId:void 0,a=e.area===`sessions`?e.piboSessionId:void 0,o=e.area===`sessions`?e.sessionViewId:void 0,s=e.area===`settings`?e.panel??`general`:`general`,[c,l]=(0,I.useState)(null),[u,d]=(0,I.useState)(null),[f,p]=(0,I.useState)(null),[m,h]=(0,I.useState)(null),[g,_]=(0,I.useState)(()=>localStorage.getItem(`pibo.chat.showThinking`)!==`false`),[v,y]=(0,I.useState)(()=>localStorage.getItem(`pibo.chat.expandThinking`)!==`false`),[b,x]=(0,I.useState)(()=>localStorage.getItem(`pibo.chat.showRawEvents`)===`true`),[S,C]=(0,I.useState)(()=>localStorage.getItem(`pibo.chat.showArchived`)===`true`),[w,T]=(0,I.useState)(()=>localStorage.getItem(`pibo.chat.showArchivedRooms`)===`true`),[E,D]=(0,I.useState)(()=>localStorage.getItem(`pibo.chat.newSessionProfile`)??``),[O,k]=(0,I.useState)(()=>o??Y9()),[A,j]=(0,I.useState)(``),[M,N]=(0,I.useState)(0),[P,F]=(0,I.useState)(!1),[ee,te]=(0,I.useState)(`context-files`),[ne,re]=(0,I.useState)(null),[ie,ae]=(0,I.useState)(null),[oe,se]=(0,I.useState)(!1),[ce,le]=(0,I.useState)(null),[ue,de]=(0,I.useState)(``),[fe,pe]=(0,I.useState)(!1),[me,he]=(0,I.useState)(null),[ge,_e]=(0,I.useState)(``),[ve,ye]=(0,I.useState)(!1),be=(0,I.useRef)(S),xe=(0,I.useRef)(0),Se=f??c?.selectedRoomId??null,Ce=Se&&c?Q7(c.rooms,Se)??c.room:void 0,we=Ce?t9(Ce):!1;(0,I.useEffect)(()=>{be.current=S},[S]),(0,I.useEffect)(()=>{if(r!==`sessions`)return;let e=o??Y9();k(t=>t===e?t:e)},[r,o]),(0,I.useEffect)(()=>{iie(O)},[O]);let Te=(0,I.useCallback)((e,n=!1,r=O)=>{let i={view:r};if(e.area===`agents`){t({to:`/agents`,replace:n});return}if(e.area===`context`){t({to:`/context`,replace:n});return}if(e.area===`settings`){e.panel===`pi-packages`?t({to:`/settings/pi-packages`,replace:n}):e.panel===`skills`?t({to:`/settings/skills`,replace:n}):t({to:`/settings`,replace:n});return}if(e.roomId&&e.piboSessionId){t({to:`/rooms/$roomId/sessions/$piboSessionId`,params:{roomId:e.roomId,piboSessionId:e.piboSessionId},search:i,replace:n});return}if(e.roomId){t({to:`/rooms/$roomId`,params:{roomId:e.roomId},search:i,replace:n});return}if(e.piboSessionId){t({to:`/sessions/$piboSessionId`,params:{piboSessionId:e.piboSessionId},search:i,replace:n});return}t({to:`/`,search:i,replace:n})},[t,O]),Ee=(0,I.useCallback)((e,t,n=!1)=>{if(!t){Te({area:`sessions`,...e?{roomId:e}:{}},n);return}Te({area:`sessions`,...e?{roomId:e}:{},piboSessionId:t},n)},[Te]),De=(0,I.useCallback)(e=>{re(e),te(`context-files`),Te({area:`context`})},[Te]),Oe=(0,I.useCallback)(e=>{ae(e),te(`mcp-tools`),Te({area:`context`})},[Te]),ke=(0,I.useCallback)(e=>{l(t=>t&&{...t,agentCatalog:t.agentCatalog?{...t.agentCatalog,mcpServers:t.agentCatalog.mcpServers.map(t=>t.name===e.name?e:t)}:t.agentCatalog})},[]),Ae=(0,I.useCallback)(e=>{let t=t=>{if(!t?.agentCatalog)return t;let n=t.agentCatalog.piPackages.filter(t=>t.id!==e.id);return{...t,agentCatalog:{...t.agentCatalog,piPackages:[...n,e].sort((e,t)=>e.name.localeCompare(t.name))}}};l(e=>t(e)??null),n.setQueriesData({queryKey:[`chat`,`bootstrap`]},e=>t(e)??void 0)},[n]),je=(0,I.useCallback)(e=>{let t=t=>t?.agentCatalog?{...t,agentCatalog:{...t.agentCatalog,piPackages:t.agentCatalog.piPackages.filter(t=>t.id!==e.id)}}:t;l(e=>t(e)??null),n.setQueriesData({queryKey:[`chat`,`bootstrap`]},e=>t(e)??void 0)},[n]),Me=(0,I.useCallback)(e=>{let t=t=>{if(!t?.agentCatalog)return t;let n=t.agentCatalog.userSkills.filter(t=>t.id!==e.id);return{...t,agentCatalog:{...t.agentCatalog,userSkills:[...n,e].sort((e,t)=>e.name.localeCompare(t.name))}}};l(e=>t(e)??null),n.setQueriesData({queryKey:[`chat`,`bootstrap`]},e=>t(e)??void 0)},[n]),Ne=(0,I.useCallback)(e=>{let t=t=>t?.agentCatalog?{...t,agentCatalog:{...t.agentCatalog,userSkills:t.agentCatalog.userSkills.filter(t=>t.id!==e)}}:t;l(e=>t(e)??null),n.setQueriesData({queryKey:[`chat`,`bootstrap`]},e=>t(e)??void 0)},[n]),Pe=(0,I.useCallback)(async(e,t=be.current,r,i={})=>{let a=xe.current+1;xe.current=a;let o=P7(e,t,r),s=n.getQueryData(o);s&&a===xe.current&&(I7(n.setQueryData.bind(n),s,t,r),l(s),i.selectSession!==!1&&d(s.selectedPiboSessionId),p(s.selectedRoomId));let c=await qne(n,{piboSessionId:e,includeArchived:t,roomId:r,markRead:i.selectSession!==!1,force:i.force});return a===xe.current?(l(c),i.selectSession!==!1&&d(c.selectedPiboSessionId),p(c.selectedRoomId),c):c},[n]);(0,I.useEffect)(()=>{let t=q9(),n=i?t.sessionsByRoom?.[i]:t.piboSessionId,r=e.area===`sessions`?i??(a?void 0:t.roomId):t.roomId,o=e.area===`sessions`?a??(a?void 0:n):t.piboSessionId,s=(t,n=!0)=>{e.area===`sessions`&&t.selectedPiboSessionId&&(e.roomId===t.selectedRoomId&&e.piboSessionId===t.selectedPiboSessionId||Ee(t.selectedRoomId,t.selectedPiboSessionId,n))};Pe(o,be.current,r).then(e=>{s(e),h(null)}).catch(t=>{if(e.area===`sessions`&&i&&!a&&o){J9(i),Pe(void 0,be.current,i).then(e=>{s(e),h(null)}).catch(e=>h(e instanceof Error?e.message:String(e)));return}if(e.area===`sessions`&&(i||a)||!o&&!r){h(t instanceof Error?t.message:String(t));return}aie(),Pe().then(e=>{s(e),h(null)}).catch(e=>h(e instanceof Error?e.message:String(e)))})},[Pe,Ee,e.area,a,i]),(0,I.useEffect)(()=>{!f&&!u||rie({roomId:f??void 0,piboSessionId:u??void 0})},[u,f]);let Fe=(0,I.useMemo)(()=>Rne(),[]),Ie=(0,I.useMemo)(()=>zne(O),[O]);(0,I.useEffect)(()=>{if(!c?.agents.length)return;let e=E||c.session.profile;if(K9(c.agents,e)){E!==e&&(D(e),localStorage.setItem(`pibo.chat.newSessionProfile`,e));return}let t=K9(c.agents,c.session.profile)?c.session.profile:c.agents[0].name;D(t),localStorage.setItem(`pibo.chat.newSessionProfile`,t)},[c,E]);let Le=(0,I.useCallback)(e=>{D(e),localStorage.setItem(`pibo.chat.newSessionProfile`,e)},[]),Re=(0,I.useCallback)(async e=>{await n.invalidateQueries({queryKey:[`chat`,`trace`,e],refetchType:`none`}),await n.refetchQueries({queryKey:[`chat`,`trace`,e],type:`active`})},[n]),ze=(0,I.useCallback)(()=>u?Re(u):Promise.resolve(),[Re,u]),Be=(0,I.useCallback)(()=>Pe(u??void 0,be.current,f??void 0,{force:!0}),[Pe,u,f]),Ve=(0,I.useCallback)(async e=>{if(!(!u||!c||e===c.session.profile))try{await rc(u,{profile:e}),Le(e);let t=await Pe(u,be.current,f??void 0);r===`sessions`&&Ee(t.selectedRoomId,t.selectedPiboSessionId),await Re(u),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},[r,c,Pe,Ee,Re,u,f,Le]),He=(0,I.useMemo)(()=>{let e=(c?.capabilities.actions??[]).flatMap(e=>e.slashCommands.filter(e=>e!==`tree`).map(t=>({slash:`/${t}`,action:e.name,description:e.description??e.name})));return e.push({slash:`/thinking-show`,action:`thinking-show`,description:`Toggle historical thinking display in this browser.`}),e},[c]),Ue=(0,I.useCallback)(async e=>{d(e);let t=await Pe(e);Ee(t.selectedRoomId,t.selectedPiboSessionId)},[Pe,Ee]),We=(0,I.useCallback)(async e=>{let t=q9().sessionsByRoom?.[e];p(e),d(t??null);try{let n=await Pe(t,be.current,e);Ee(n.selectedRoomId,n.selectedPiboSessionId)}catch(n){if(!t)throw n;J9(e),d(null);let r=await Pe(void 0,be.current,e);Ee(r.selectedRoomId,r.selectedPiboSessionId)}},[Pe,Ee]),Ge=async(e=E)=>{if(!(P||we)){F(!0);try{let t=await xs(e||void 0,f??void 0);d(t.session.id);let n=await Pe(t.session.id,be.current,f??void 0);Ee(n.selectedRoomId,n.selectedPiboSessionId),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}finally{F(!1)}}},Ke=async()=>{let e=!S;C(e),localStorage.setItem(`pibo.chat.showArchived`,String(e));try{let t=await Pe(u??void 0,e,f??void 0);r===`sessions`&&Ee(t.selectedRoomId,t.selectedPiboSessionId),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},qe=async(e,t)=>{try{await rc(e,{title:t});let n=await Pe(u??void 0,be.current,f??void 0);r===`sessions`&&await Re(n.selectedPiboSessionId),r===`sessions`&&Ee(n.selectedRoomId,n.selectedPiboSessionId),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},Je=async(e,t)=>{try{await rc(e,{archived:t});let n=await Pe(t&&!S&&u===e?void 0:u??void 0,be.current,f??void 0);r===`sessions`&&Ee(n.selectedRoomId,n.selectedPiboSessionId),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},Ye=e=>{he(e),_e(``)},Xe=async()=>{if(me){ye(!0);try{let e=await ic(me.piboSessionId,ge),t=u?e.deletedSessionIds.includes(u):!1;t&&d(null);let n=await Pe(t?void 0:u??void 0,be.current,f??void 0);r===`sessions`&&Ee(n.selectedRoomId,n.selectedPiboSessionId),he(null),_e(``),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}finally{ye(!1)}}},Ze=async()=>{if(!oe){se(!0);try{await We((await ec({name:`New Chat`})).room.id),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}finally{se(!1)}}},Qe=async(e,t)=>{try{await tc(e,t);let n=await Pe(u??void 0,be.current,e);r===`sessions`&&Ee(n.selectedRoomId,n.selectedPiboSessionId),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},$e=async(e,t)=>{try{await tc(e,{archived:t}),t&&(T(!0),localStorage.setItem(`pibo.chat.showArchivedRooms`,`true`));let n=await Pe(u??void 0,be.current,f??void 0);r===`sessions`&&Ee(n.selectedRoomId,n.selectedPiboSessionId),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},et=e=>{le(e),de(``)},tt=async()=>{if(ce){pe(!0);try{await nc(ce.id,ue),f===ce.id&&(p(null),d(null));let e=await Pe(void 0,be.current);r===`sessions`&&Ee(e.selectedRoomId,e.selectedPiboSessionId),le(null),de(``),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}finally{pe(!1)}}},nt=(0,I.useCallback)(async e=>{if(!u||we)return!1;let t=e.trim().split(/\s+/)[0],n=He.find(e=>e.slash===t);if(!n)return!1;if(n.action===`thinking-show`){let e=!g;return _(e),localStorage.setItem(`pibo.chat.showThinking`,String(e)),!0}let i=e.match(/^\/thinking\s+(\S+)/)?.[1],a=cie(await oc(u,n.action,i?{level:i}:void 0));if((n.action===`session.clone`||n.action===`session.fork`)&&a)await Ue(a);else{let e=await Pe(u,be.current,f??void 0);r===`sessions`&&Ee(e.selectedRoomId,e.selectedPiboSessionId),await Re(u)}return!0},[r,Pe,Ee,Re,Ue,u,we,f,g,He]),rt=(0,I.useCallback)(async e=>{if(!u||we)return;let t=sie(await oc(u,`session.fork`,{entryId:e}));if(!t?.result.cancelled){if(!t)throw Error(`Unexpected fork action response`);typeof t.result.selectedText==`string`&&(j(t.result.selectedText),N(e=>e+1)),t.result.piboSessionId&&await Ue(t.result.piboSessionId)}},[Ue,u,we]),it=(0,I.useCallback)(e=>void Ue(e),[Ue]),at=(0,I.useCallback)(e=>{k(e),r===`sessions`&&Te({area:`sessions`,...f?{roomId:f}:{},...u?{piboSessionId:u}:{}},!1,e)},[r,Te,u,f]);if(m&&!c)return(0,L.jsx)(Zne,{message:m});if(!c)return(0,L.jsx)(`div`,{className:`min-h-screen bg-[#101d22] text-slate-300 grid place-items-center`,children:`Loading Pibo Chat...`});let ot=!!(c.selectedRoomId||c.room||c.rooms.length),st=X7(c.sessions),ct=u?q7(c.sessions,u):void 0,lt=Z7(c.rooms),ut=$7(c.rooms),dt=[...new Set([...c.agents.map(e=>e.name),...c.customAgents.map(e=>e.profileName)])];return(0,L.jsxs)(`div`,{className:`h-screen overflow-hidden bg-[#101d22] text-slate-200 grid grid-rows-[56px_1fr]`,children:[(0,L.jsxs)(`header`,{className:`flex items-center justify-between gap-3 px-4 bg-[#1a262b] border-b border-slate-800`,children:[(0,L.jsx)(`div`,{className:`font-extrabold tracking-[0.08em] uppercase text-lg`,children:`Pibo Chat`}),(0,L.jsx)(`nav`,{className:`flex gap-1`,children:[`sessions`,`agents`,`context`,`settings`].map(e=>(0,L.jsx)(`button`,{type:`button`,onClick:()=>{if(e===`sessions`){Ee(f??c.selectedRoomId,u??c.selectedPiboSessionId);return}Te({area:e})},className:`h-8 px-3 border rounded-sm text-xs uppercase tracking-wider ${r===e?`border-[#11a4d4] text-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-700 text-slate-400`}`,children:e},e))}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-slate-400 min-w-0`,children:[(0,L.jsx)(ms,{size:14}),(0,L.jsx)(`span`,{className:`truncate`,children:c.identity.email||c.identity.name||c.identity.userId}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void sc().then(()=>location.reload()),className:`p-1 border border-slate-700 rounded-sm`,children:(0,L.jsx)(Qo,{size:14})})]})]}),(0,L.jsx)(`div`,{className:`min-h-0 ${r===`agents`?`h-full overflow-hidden`:`grid ${r===`sessions`&&b?`grid-cols-[300px_minmax(0,1fr)_320px] max-[980px]:grid-cols-[240px_minmax(0,1fr)]`:`grid-cols-[300px_minmax(0,1fr)] max-[980px]:grid-cols-[240px_minmax(0,1fr)]`}`}`,children:r===`agents`?(0,L.jsx)(cre,{agents:c.agents,initialCustomAgents:c.customAgents,initialCatalog:c.agentCatalog,modelCatalog:c.modelCatalog,onSelect:Le,onCreateSession:e=>void Ge(e),onEditContextFile:De,onEditMcpServer:Oe,onAgentsChanged:()=>void Pe(u??void 0,be.current,f??void 0,{selectSession:!1}),creatingSession:P||we}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`aside`,{className:`min-h-0 overflow-auto bg-[#1a262b] border-r border-slate-800`,children:[(0,L.jsxs)(`div`,{className:`h-11 px-3 border-b border-slate-800 flex items-center justify-between text-xs font-bold uppercase tracking-wider`,children:[(0,L.jsx)(`span`,{children:r}),r===`sessions`?(0,L.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,L.jsx)(`button`,{type:`button`,onClick:()=>void Pe(u??void 0,be.current,f??void 0,{force:!0}).then(e=>{u&&Re(u),r===`sessions`&&Ee(e.selectedRoomId,e.selectedPiboSessionId)}),title:`Refresh`,"aria-label":`Refresh`,className:`p-1 border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,L.jsx)(os,{size:13})})}):null]}),r===`sessions`?(0,L.jsxs)(`div`,{className:`p-2 space-y-3`,children:[ot?(0,L.jsxs)(`div`,{children:[lt?(0,L.jsxs)(`div`,{className:`mb-3`,children:[(0,L.jsx)(`div`,{className:`px-1 pb-1 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Personal Chat`}),(0,L.jsx)(W7,{room:lt,selectedRoomId:f,onSelect:e=>void We(e),onUpdate:(e,t)=>void Qe(e,t),onArchive:(e,t)=>void $e(e,t),onDelete:et})]}):null,(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1 pb-1`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Rooms`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>void Ze(),disabled:oe,title:`New Room`,"aria-label":`New Room`,className:`h-6 w-6 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:(0,L.jsx)(rs,{size:12})}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>{let e=!w;T(e),localStorage.setItem(`pibo.chat.showArchivedRooms`,String(e))},title:w?`Hide Archived Rooms`:`Show Archived Rooms`,"aria-label":w?`Hide Archived Rooms`:`Show Archived Rooms`,className:`h-6 w-6 inline-flex items-center justify-center border rounded-sm hover:border-[#11a4d4] hover:text-[#11a4d4] ${w?`border-[#11a4d4] text-[#11a4d4]`:`border-slate-700 text-slate-400`}`,children:w?(0,L.jsx)(wo,{size:12}):(0,L.jsx)(To,{size:12})})]})]}),ut.active.map(e=>(0,L.jsx)(W7,{room:e,selectedRoomId:f,onSelect:e=>void We(e),onUpdate:(e,t)=>void Qe(e,t),onArchive:(e,t)=>void $e(e,t),onDelete:et},e.id)),ut.active.length===0?(0,L.jsx)(`div`,{className:`px-2 py-3 text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm`,children:`No rooms`}):null,w?(0,L.jsxs)(`div`,{className:`mt-3`,children:[(0,L.jsx)(`div`,{className:`px-1 pb-1 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Archived Rooms`}),ut.archived.map(e=>(0,L.jsx)(W7,{room:e,selectedRoomId:f,onSelect:e=>void We(e),onUpdate:(e,t)=>void Qe(e,t),onArchive:(e,t)=>void $e(e,t),onDelete:et},e.id)),ut.archived.length===0?(0,L.jsx)(`div`,{className:`px-2 py-3 text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm`,children:`No archived rooms`}):null]}):null]}):null,(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1 pb-1`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Sessions`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>void Ge(),disabled:P||we,title:`New Session`,"aria-label":`New Session`,className:`h-6 w-6 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:(0,L.jsx)(rs,{size:12})}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void Ke(),title:S?`Hide Archived Sessions`:`Show Archived Sessions`,"aria-label":S?`Hide Archived Sessions`:`Show Archived Sessions`,className:`h-6 w-6 inline-flex items-center justify-center border rounded-sm hover:border-[#11a4d4] hover:text-[#11a4d4] ${S?`border-[#11a4d4] text-[#11a4d4]`:`border-slate-700 text-slate-400`}`,children:S?(0,L.jsx)(wo,{size:12}):(0,L.jsx)(To,{size:12})})]})]}),st.active.map(e=>(0,L.jsx)(G7,{node:e,selectedPiboSessionId:u,onSelect:e=>void Ue(e),onRename:(e,t)=>void qe(e,t),onArchive:(e,t)=>void Je(e,t),onDelete:Ye},e.piboSessionId)),st.active.length===0?(0,L.jsx)(`div`,{className:`px-2 py-3 text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm`,children:`No active sessions`}):null]}),S?(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`px-1 pb-1 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Archived Sessions`}),st.archived.map(e=>(0,L.jsx)(G7,{node:e,selectedPiboSessionId:u,onSelect:e=>void Ue(e),onRename:(e,t)=>void qe(e,t),onArchive:(e,t)=>void Je(e,t),onDelete:Ye},e.piboSessionId)),st.archived.length===0?(0,L.jsx)(`div`,{className:`px-2 py-3 text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm`,children:`No archived sessions`}):null]}):null]}):r===`context`?(0,L.jsx)(xre,{activePanel:ee,onSelect:te,toolCount:c.agentCatalog?.piboTools.length??0,mcpServerCount:c.agentCatalog?.mcpServers.length??0}):(0,L.jsx)(bre,{activePanel:s,onSelect:e=>Te({area:`settings`,panel:e}),piPackageCount:c.agentCatalog?.piPackages.length??0,userSkillCount:c.agentCatalog?.userSkills.length??0})]}),r===`sessions`?(0,L.jsx)(Xne,{bootstrap:c,selectedPiboSessionId:u,selectedRoomId:f,selectedRoomArchived:we,selectedSessionProfile:ct?.profile??c.session.profile,sessionViewId:O,sessionViews:Fe,currentSessionView:Ie,creatingSession:P,showRawEvents:b,showThinking:g,expandThinking:v,commands:He,composerText:A,composerFocusSignal:M,onComposerTextChange:j,onToggleRawEvents:()=>{let e=!b;x(e),localStorage.setItem(`pibo.chat.showRawEvents`,String(e))},onToggleThinking:()=>{let e=!g;_(e),localStorage.setItem(`pibo.chat.showThinking`,String(e))},onToggleExpandThinking:()=>{let e=!v;y(e),localStorage.setItem(`pibo.chat.expandThinking`,String(e))},onSessionAgentProfileChange:e=>void Ve(e),onFork:rt,onOpenSession:it,onSelectSessionView:at,onCommand:nt,onRefreshTrace:ze,onRefreshBootstrap:Be,onSend:async e=>{if(!(!u||we))try{await ac(u,e,sre(),f??void 0),await Pe(u,be.current,f??void 0),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},onError:h}):(0,L.jsx)(`main`,{className:`min-h-0 flex flex-col`,children:r===`context`?ee===`pibo-tools`?(0,L.jsx)(m5,{tools:c.agentCatalog?.piboTools??[]}):ee===`mcp-tools`?(0,L.jsx)(h5,{servers:c.agentCatalog?.mcpServers??[],selectedServerName:ie,onServerSaved:ke}):ee===`base-prompt`?(0,L.jsx)(x2,{}):ee===`compaction-prompt`?(0,L.jsx)(w2,{}):(0,L.jsx)(l2,{agentProfiles:dt,selectedFileKey:ne}):(0,L.jsx)(Pre,{activePanel:s,showThinking:g,setShowThinking:_,expandThinking:v,setExpandThinking:y,modelDefaults:c.modelDefaults,modelCatalog:c.modelCatalog,onModelDefaultsChanged:e=>{l(t=>t&&{...t,modelDefaults:e})},piPackages:c.agentCatalog?.piPackages,onPiPackageChanged:Ae,onPiPackageRemoved:je,userSkills:c.agentCatalog?.userSkills,onUserSkillChanged:Me,onUserSkillRemoved:Ne})}),ce?(0,L.jsx)($ne,{room:ce,confirmName:ue,deleting:fe,onConfirmNameChange:de,onCancel:()=>{le(null),de(``)},onDelete:()=>void tt()}):null,me?(0,L.jsx)(Qne,{session:me,confirmText:ge,deleting:ve,onConfirmTextChange:_e,onCancel:()=>{he(null),_e(``)},onDelete:()=>void Xe()}):null]})})]})}function Xne({bootstrap:e,selectedPiboSessionId:t,selectedRoomId:n,selectedRoomArchived:r,selectedSessionProfile:i,sessionViewId:a,sessionViews:o,currentSessionView:s,creatingSession:c,showRawEvents:l,showThinking:u,expandThinking:d,commands:f,composerText:p,composerFocusSignal:m,onComposerTextChange:h,onToggleRawEvents:g,onToggleThinking:_,onToggleExpandThinking:v,onSessionAgentProfileChange:y,onFork:b,onOpenSession:x,onSelectSessionView:S,onCommand:C,onRefreshTrace:w,onRefreshBootstrap:T,onSend:E,onError:D}){let O=Xt(),k=(0,I.useRef)(new Map),A=(0,I.useRef)(void 0),j=(0,I.useMemo)(()=>t?F7(t,{includeRawEvents:l,rawEventsLimit:80}):null,[t,l]),M=fn({queryKey:j??[`chat`,`trace`,`idle`,`compact`,80],queryFn:()=>{if(!t)throw Error(`Session is required`);return Jne(O,t,{includeRawEvents:l,rawEventsLimit:80})},enabled:!!t,gcTime:Hne,refetchOnWindowFocus:!1,retry:1}),N=M.data??null,P=(0,I.useCallback)(e=>{let t=k.current.get(e);if(!t?.length)return;let n=O.getQueryCache().findAll({queryKey:Gne(e)}),r=n.length===0;for(let i of n)O.setQueryData(i.queryKey,n=>!Kne(n)||n.piboSessionId!==e?n:(r=!0,Wre(n,t)));r&&k.current.delete(e)},[O]),F=(0,I.useCallback)(()=>{A.current!==void 0||!t||(A.current=requestAnimationFrame(()=>{A.current=void 0,P(t)}))},[P,t]),ee=(0,I.useCallback)((e,n,r=!1)=>{let i=k.current.get(e)??[];i.push(n),k.current.set(e,i),r||e!==t?P(e):F()},[P,F,t]);(0,I.useEffect)(()=>()=>{A.current!==void 0&&cancelAnimationFrame(A.current)},[]),(0,I.useEffect)(()=>{if(!t||!j||!N||N.piboSessionId!==t)return;let e=n?new URLSearchParams({roomId:n,piboSessionId:t}):new URLSearchParams({piboSessionId:t});N?.latestStreamId!==void 0&&e.set(`since`,`${N.latestStreamId}:999999`);let r=new EventSource(`/api/chat/events?${e.toString()}`),i,a,o=(e,t=!1)=>{if(i){if(!t)return;clearTimeout(i)}i=setTimeout(()=>{i=void 0,w().catch(e=>D(B7(e)))},e)},s=e=>{a||=setTimeout(()=>{a=void 0,T().catch(e=>D(B7(e)))},e)};return r.addEventListener(`pibo`,e=>{let n=Vre(e);if(!n)return;let r=n.piboSessionId||t;ee(r,n,n.type!==`TEXT_MESSAGE_CONTENT`&&n.type!==`REASONING_MESSAGE_CONTENT`);let i=Hre(n);r===t&&i!==void 0?o(i,!0):r===t&&n.type!==`ready`&&o(1500,!0),Ure(n)&&s(r===t?0:150)}),()=>{i&&clearTimeout(i),a&&clearTimeout(a),r.close()}},[N?.latestStreamId,N?.piboSessionId,ee,D,T,w,t,n,j]);let te=(0,I.useMemo)(()=>N?pc(N.piboSessionId,N.title,N.nodes):null,[N]),ne=(0,I.useMemo)(()=>t?nre(e.sessions,t):[],[e.sessions,t]),re=(0,I.useMemo)(()=>t?ere(e.sessions,t):void 0,[e.sessions,t]),ie=(0,I.useMemo)(()=>t?tre(e.sessions,t):[],[e.sessions,t]),ae=(0,I.useMemo)(()=>l?nie(N?.rawEvents??[]):[],[l,N?.rawEvents]),oe=!!t&&M.isFetching&&!N,se=M.error?B7(M.error):null;return(0,I.useEffect)(()=>{N?.piboSessionId&&P(N.piboSessionId)},[N?.piboSessionId,P]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`main`,{className:`min-h-0 flex flex-col`,children:[(0,L.jsxs)(`div`,{className:`h-14 px-4 bg-[#151f24] border-b border-slate-800 flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`h1`,{className:`text-base font-semibold truncate`,children:N?.title??t??e.room?.name??n}),(0,L.jsxs)(`div`,{className:`font-mono text-[11px] text-slate-500 truncate`,children:[e.room?.name??n??`Room`,` · `,N?.piboSessionId??t??``,` `,N?`· ${N.piSessionId}`:``]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`div`,{className:`flex items-center rounded-sm border border-slate-700 bg-[#0e1116] p-0.5`,children:o.map(e=>(0,L.jsx)(`button`,{type:`button`,onClick:()=>S(e.id),title:e.description??e.label,"aria-label":`Switch to ${e.label} view`,className:`min-w-20 px-2.5 py-1 text-[11px] font-bold tracking-wide ${a===e.id?`bg-[#11a4d4]/10 text-[#11a4d4]`:`text-slate-400 hover:text-[#11a4d4]`}`,children:e.label},e.id))}),(0,L.jsx)(V7,{onClick:g,title:l?`Hide Raw Events`:`Show Raw Events`,ariaLabel:l?`Hide Raw Events`:`Show Raw Events`,active:l,children:(0,L.jsx)(Mo,{size:14})}),(0,L.jsx)(V7,{onClick:_,title:u?`Hide Thinking`:`Show Thinking`,ariaLabel:u?`Hide Thinking`:`Show Thinking`,active:u,children:u?(0,L.jsx)(jo,{size:14}):(0,L.jsx)(Ho,{size:14})}),u?(0,L.jsx)(V7,{onClick:v,title:d?`Collapse Thinking`:`Expand Thinking`,ariaLabel:d?`Collapse Thinking`:`Expand Thinking`,active:d,children:d?(0,L.jsx)(Lo,{size:14}):(0,L.jsx)(zo,{size:14})}):null]})]}),se&&!N?(0,L.jsx)(`div`,{className:`min-h-0 flex-1 p-4 text-sm text-red-200`,children:se}):s.render({traceView:N,selectedTrace:te,isLoading:oe,showThinking:u,expandThinking:d,sessionAgentProfile:i,sessionBreadcrumbs:ne,originSession:re,derivedSessions:ie,agentProfiles:e.agents,sessionProfileChangeDisabled:c||r,onSessionAgentProfileChange:y,onFork:b,onOpenSession:x}),(0,L.jsx)(are,{disabled:!t||r,commands:f,value:p,focusSignal:m,onValueChange:h,onCommand:C,onSend:E})]}),l?(0,L.jsxs)(`aside`,{className:`min-h-0 overflow-auto bg-[#0e1116] border-l border-slate-800 max-[980px]:hidden`,children:[(0,L.jsx)(`div`,{className:`h-11 px-3 border-b border-slate-800 flex items-center text-xs font-bold uppercase tracking-wider`,children:`Raw Events`}),(0,L.jsx)(`div`,{className:`p-3 flex flex-col gap-2`,children:ae.slice(-80).reverse().map(e=>(0,L.jsxs)(`div`,{className:`border-l-2 border-[#11a4d4] bg-[#151f24] p-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-[#11a4d4] font-mono text-[11px] mb-1`,children:[(0,L.jsx)(`span`,{children:e.type}),e.count>1?(0,L.jsxs)(`span`,{className:`text-slate-500`,children:[`x`,e.count]}):null]}),(0,L.jsx)(md,{value:e.payload,showControls:!1})]},e.id))})]}):null]})}function B7(e){return e instanceof Error?e.message:String(e)}function Zne({message:e}){return(0,L.jsx)(`div`,{className:`min-h-screen bg-[#101d22] text-slate-300 grid place-items-center`,children:(0,L.jsxs)(`div`,{className:`border border-slate-700 bg-[#1a262b] p-5 rounded-sm`,children:[(0,L.jsx)(`div`,{className:`mb-4 text-sm text-slate-400`,children:e}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void cc(),className:`px-3 py-2 bg-[#11a4d4] rounded-sm`,children:`Sign in with Google`})]})})}function V7({title:e,ariaLabel:t,active:n,onClick:r,children:i}){return(0,L.jsx)(`button`,{type:`button`,onClick:r,title:e,"aria-label":t,className:`h-8 w-8 inline-flex items-center justify-center border rounded-sm transition-colors ${n?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#11a4d4]`:`border-slate-700 text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`}`,children:i})}function H7({children:e,onClose:t}){return(0,L.jsx)(`div`,{className:`fixed inset-0 z-50 bg-black/70 grid place-items-center p-4`,onClick:t,children:(0,L.jsx)(`div`,{className:`w-full max-w-lg border border-slate-700 bg-[#1a262b] rounded-sm shadow-xl`,onClick:e=>e.stopPropagation(),children:e})})}function Qne({session:e,confirmText:t,deleting:n,onConfirmTextChange:r,onCancel:i,onDelete:a}){return(0,L.jsx)(`div`,{className:`fixed inset-0 z-50 bg-black/70 grid place-items-center p-4`,children:(0,L.jsxs)(`div`,{className:`w-full max-w-lg border border-red-500/70 bg-[#1a262b] rounded-sm shadow-xl`,children:[(0,L.jsxs)(`div`,{className:`px-4 py-3 border-b border-red-500/50 flex items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-sm font-bold uppercase tracking-wider text-red-200`,children:`Delete Session`}),(0,L.jsx)(`div`,{className:`font-mono text-[11px] text-slate-500 truncate`,children:e.piboSessionId})]}),(0,L.jsx)(`button`,{type:`button`,onClick:i,disabled:n,title:`Cancel`,"aria-label":`Cancel`,className:`h-8 w-8 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:(0,L.jsx)(_s,{size:14})})]}),(0,L.jsxs)(`div`,{className:`p-4 grid gap-3`,children:[(0,L.jsx)(`div`,{className:`border border-red-500/60 bg-red-500/10 text-red-100 rounded-sm p-3 text-sm`,children:`This permanently deletes the archived session, its child sessions, and their Chat events. This cannot be undone.`}),(0,L.jsxs)(`div`,{className:`text-sm text-slate-300`,children:[`Type `,(0,L.jsx)(`span`,{className:`font-mono text-red-200`,children:z7}),` to confirm.`]}),(0,L.jsx)(`input`,{value:t,onChange:e=>r(e.target.value),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-red-500`,placeholder:z7,autoFocus:!0}),(0,L.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:i,disabled:n,className:`h-8 inline-flex items-center border border-slate-700 rounded-sm px-3 text-slate-300 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:`Cancel`}),(0,L.jsxs)(`button`,{type:`button`,onClick:a,disabled:n||t!==z7,className:`h-8 inline-flex items-center gap-2 border border-red-500 rounded-sm px-3 text-red-200 bg-red-500/10 disabled:opacity-50`,children:[(0,L.jsx)(fs,{size:14}),`Delete permanently`]})]})]})]})})}function $ne({room:e,confirmName:t,deleting:n,onConfirmNameChange:r,onCancel:i,onDelete:a}){return(0,L.jsx)(`div`,{className:`fixed inset-0 z-50 bg-black/70 grid place-items-center p-4`,children:(0,L.jsxs)(`div`,{className:`w-full max-w-lg border border-red-500/70 bg-[#1a262b] rounded-sm shadow-xl`,children:[(0,L.jsxs)(`div`,{className:`px-4 py-3 border-b border-red-500/50 flex items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-sm font-bold uppercase tracking-wider text-red-200`,children:`Delete Room`}),(0,L.jsx)(`div`,{className:`font-mono text-[11px] text-slate-500 truncate`,children:e.id})]}),(0,L.jsx)(`button`,{type:`button`,onClick:i,disabled:n,title:`Cancel`,"aria-label":`Cancel`,className:`h-8 w-8 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:(0,L.jsx)(_s,{size:14})})]}),(0,L.jsxs)(`div`,{className:`p-4 grid gap-3`,children:[(0,L.jsx)(`div`,{className:`border border-red-500/60 bg-red-500/10 text-red-100 rounded-sm p-3 text-sm`,children:`This permanently deletes the archived room, child rooms, all contained sessions, subagent sessions, and their Chat events. This cannot be undone.`}),(0,L.jsxs)(`div`,{className:`text-sm text-slate-300`,children:[`Type `,(0,L.jsx)(`span`,{className:`font-mono text-red-200`,children:e.name}),` to confirm.`]}),(0,L.jsx)(`input`,{value:t,onChange:e=>r(e.target.value),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-red-500`,placeholder:e.name,autoFocus:!0}),(0,L.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:i,disabled:n,className:`h-8 inline-flex items-center border border-slate-700 rounded-sm px-3 text-slate-300 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:`Cancel`}),(0,L.jsxs)(`button`,{type:`button`,onClick:a,disabled:n||t!==e.name,className:`h-8 inline-flex items-center gap-2 border border-red-500 rounded-sm px-3 text-red-200 bg-red-500/10 disabled:opacity-50`,children:[(0,L.jsx)(fs,{size:14}),`Delete permanently`]})]})]})]})})}function U7({count:e}){if(!e||e<=0)return null;let t=e>99?`99+`:String(e);return(0,L.jsx)(`span`,{className:`min-w-5 h-5 px-1.5 inline-flex items-center justify-center rounded-full bg-[#0bda57] text-[#0e1116] text-[10px] font-bold tabular-nums leading-none`,"aria-label":`${e} unread messages`,title:`${e} unread messages`,children:t})}function W7({room:e,selectedRoomId:t,onSelect:n,onUpdate:r,onArchive:i,onDelete:a,depth:o=0}){let[s,c]=(0,I.useState)(!1),[l,u]=(0,I.useState)(e.name),[d,f]=(0,I.useState)(e.topic??``),[p,m]=(0,I.useState)(e.workspace??``),h=e9(e),g=t9(e);(0,I.useEffect)(()=>{s||(u(e.name),f(e.topic??``),m(e.workspace??``))},[s,e.name,e.topic,e.workspace]);let _=()=>{let t=l.trim();t&&(r(e.id,{name:t,topic:d.trim()||null,workspace:p.trim()||null}),c(!1))};return(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`group mb-1 border rounded-sm ${h?e.id===t?`border-[#0bda57] bg-[#0bda57]/10`:`border-[#0bda57]/50 bg-[#0bda57]/5`:e.id===t?`border-[#11a4d4] bg-[#11a4d4]/10`:g?`border-[#f59e0b]/40 bg-[#f59e0b]/5`:`border-transparent`}`,style:{marginLeft:o*12},title:e.id,children:s&&!h?(0,L.jsxs)(`form`,{className:`grid gap-1 p-1`,onSubmit:e=>{e.preventDefault(),_()},children:[(0,L.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-2 py-1 text-sm outline-none focus:border-[#11a4d4]`,autoFocus:!0}),(0,L.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),placeholder:`Topic`,className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-2 py-1 text-xs outline-none focus:border-[#11a4d4]`}),(0,L.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),placeholder:`Workspace (/absolute/path)`,className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-2 py-1 text-xs font-mono outline-none focus:border-[#11a4d4]`}),(0,L.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,L.jsx)(`button`,{type:`submit`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,L.jsx)(No,{size:13})}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>c(!1),className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,L.jsx)(_s,{size:13})})]})]}):(0,L.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] items-center gap-1 py-1 pr-1`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:`min-w-0 text-left px-2 py-1 grid grid-cols-[auto_minmax(0,1fr)_auto] gap-2 items-center`,children:[(0,L.jsx)(`span`,{className:`h-6 w-6 inline-flex items-center justify-center rounded-sm ${h?`bg-[#0bda57]/15 text-[#0bda57]`:g?`bg-[#f59e0b]/15 text-[#f59e0b]`:`bg-[#151f24] text-slate-500`}`,children:h?(0,L.jsx)($o,{size:13}):g?(0,L.jsx)(To,{size:13}):(0,L.jsx)(Ko,{size:13})}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block text-sm truncate ${g?`text-slate-500`:`text-slate-200`}`,children:e.name}),(0,L.jsx)(`span`,{className:`block text-[10px] font-mono truncate text-slate-500`,children:h?`locked personal room`:g?`archived`:ire(e)})]}),(0,L.jsx)(U7,{count:e.unreadCount})]}),(0,L.jsx)(`div`,{className:`flex items-center gap-1 pr-1 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity`,children:h?(0,L.jsx)(`span`,{title:`Personal Chat is locked`,"aria-label":`Personal Chat is locked`,className:`h-7 w-7 inline-flex items-center justify-center border border-[#0bda57]/50 rounded-sm text-[#0bda57]`,children:(0,L.jsx)($o,{size:13})}):g?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>i(e.id,!1),title:`Restore Room`,"aria-label":`Restore Room`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,L.jsx)(wo,{size:13})}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>a(e),title:`Delete Room`,"aria-label":`Delete Room`,className:`h-7 w-7 inline-flex items-center justify-center border border-red-500/70 rounded-sm text-red-300 hover:bg-red-500/10`,children:(0,L.jsx)(fs,{size:13})})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>c(!0),title:`Edit Room`,"aria-label":`Edit Room`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,L.jsx)(ns,{size:13})}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>i(e.id,!0),title:`Archive Room`,"aria-label":`Archive Room`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,L.jsx)(To,{size:13})})]})})]})}),(e.children??[]).map(e=>(0,L.jsx)(W7,{room:e,selectedRoomId:t,onSelect:n,onUpdate:r,onArchive:i,onDelete:a,depth:o+1},e.id))]})}function G7({node:e,selectedPiboSessionId:t,onSelect:n,onRename:r,onArchive:i,onDelete:a,depth:o=0}){let[s,c]=(0,I.useState)(!1),[l,u]=(0,I.useState)(e.title),d=e.children.length>0,f=t?K7(e.children,t):!1,[p,m]=(0,I.useState)(f);(0,I.useEffect)(()=>{s||u(e.title)},[s,e.title]),(0,I.useEffect)(()=>{f&&m(!0)},[f]);let h=()=>{let t=l.trim();r(e.piboSessionId,t||null),c(!1)};return(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`group w-full grid grid-cols-[1fr_auto] gap-1 items-center mb-1 border rounded-sm ${e.piboSessionId===t?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-transparent`}`,style:{paddingLeft:8+o*14},title:e.piboSessionId,children:[s?(0,L.jsxs)(`form`,{className:`min-w-0 grid grid-cols-[1fr_auto_auto] gap-1 py-1 pr-1`,onSubmit:e=>{e.preventDefault(),h()},children:[(0,L.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),onKeyDown:t=>{t.key===`Escape`&&(t.preventDefault(),c(!1),u(e.title))},autoFocus:!0,className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-2 py-1 text-sm outline-none focus:border-[#11a4d4]`}),(0,L.jsx)(`button`,{type:`submit`,title:`Save Session Title`,"aria-label":`Save Session Title`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,L.jsx)(No,{size:13})}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>{c(!1),u(e.title)},title:`Cancel Rename`,"aria-label":`Cancel Rename`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,L.jsx)(_s,{size:13})})]}):(0,L.jsxs)(`div`,{className:`min-w-0 grid grid-cols-[1fr_auto] gap-2 items-center py-1 pr-1`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>{if(d&&e.piboSessionId===t){m(e=>!e);return}n(e.piboSessionId)},className:`min-w-0 text-left px-1 py-1 grid grid-cols-[minmax(0,1fr)_auto] gap-2 items-center`,children:[(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block text-sm truncate ${e.archived?`text-slate-500`:`text-slate-200`}`,children:e.title}),(0,L.jsx)(`span`,{className:`block text-[10px] font-mono truncate text-slate-500`,children:e.piboSessionId})]}),(0,L.jsx)(U7,{count:e.unreadCount})]}),(0,L.jsxs)(`span`,{className:`grid grid-rows-[16px_16px] place-items-center gap-0.5`,children:[(0,L.jsx)(`span`,{className:`h-2 w-2 rounded-full ${e.status===`running`?`bg-[#0bda57]`:e.status===`error`?`bg-red-500`:`bg-slate-600`}`}),d?(0,L.jsx)(`button`,{type:`button`,onClick:()=>m(e=>!e),"aria-expanded":p,title:p?`Collapse Subsessions`:`Expand Subsessions`,"aria-label":p?`Collapse Subsessions`:`Expand Subsessions`,className:`h-4 w-4 inline-flex items-center justify-center rounded-sm transition-colors ${p?`text-[#0bda57]`:`text-slate-600 hover:text-[#11a4d4]`}`,children:(0,L.jsx)(Yo,{size:13})}):(0,L.jsx)(`span`,{className:`h-4 w-4`})]})]}),s?null:(0,L.jsxs)(`div`,{className:`flex items-center gap-1 pr-1 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>c(!0),title:`Rename Session`,"aria-label":`Rename Session`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,L.jsx)(ns,{size:13})}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>i(e.piboSessionId,!e.archived),title:e.archived?`Restore Session`:`Archive Session`,"aria-label":e.archived?`Restore Session`:`Archive Session`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:e.archived?(0,L.jsx)(wo,{size:13}):(0,L.jsx)(To,{size:13})}),e.archived?(0,L.jsx)(`button`,{type:`button`,onClick:()=>a(e),title:`Delete Session`,"aria-label":`Delete Session`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-red-500 hover:text-red-300`,children:(0,L.jsx)(fs,{size:13})}):null]})]}),p?e.children.map(e=>(0,L.jsx)(G7,{node:e,selectedPiboSessionId:t,onSelect:n,onRename:r,onArchive:i,onDelete:a,depth:o+1},e.piboSessionId)):null]})}function K7(e,t){return e.some(e=>e.piboSessionId===t||K7(e.children,t))}function ere(e,t){let n=q7(e,t);if(!n?.originId)return;let r=q7(e,n.originId);return{piboSessionId:n.originId,label:r?Y7(r,0):n.originId}}function tre(e,t){return q7(e,t)?.derivedSessions.map(e=>({piboSessionId:e.piboSessionId,label:rre(e),profile:e.profile,status:e.status}))??[]}function nre(e,t){return J7(e,t).map((e,t)=>({piboSessionId:e.piboSessionId,label:Y7(e,t)}))}function q7(e,t){for(let n of e){if(n.piboSessionId===t)return n;let e=q7(n.children,t);if(e)return e}}function J7(e,t,n=[]){for(let r of e){let e=[...n,r];if(r.piboSessionId===t)return e;let i=J7(r.children,t,e);if(i.length)return i}return[]}function Y7(e,t){return t?e.subagentName&&e.subagentName!==e.profile?`${e.subagentName} (${e.profile})`:e.profile||e.subagentName||e.title:e.profile||e.title}function rre(e){return e.subagentName&&e.subagentName!==e.profile?`${e.subagentName} (${e.profile})`:e.title||e.profile||e.subagentName||`Untitled Session`}function X7(e){let t=[],n=[];for(let r of e){if(r.archived){n.push(r);continue}let e=X7(r.children);t.push({...r,children:e.active}),n.push(...e.archived)}return{active:t,archived:n}}function Z7(e){for(let t of e){if(e9(t))return t;let e=Z7(t.children??[]);if(e)return e}}function Q7(e,t){for(let n of e){if(n.id===t)return n;let e=Q7(n.children??[],t);if(e)return e}}function $7(e){let t=[],n=[];for(let r of e){if(e9(r)){let e=$7(r.children??[]);t.push(...e.active),n.push(...e.archived);continue}if(t9(r)){n.push(r);continue}let e=$7(r.children??[]);t.push({...r,children:e.active}),n.push(...e.archived)}return{active:t,archived:n}}function e9(e){return e.metadata.default===!0}function t9(e){return typeof e.metadata.chatRoomArchivedAt==`string`}function ire(e){return e.topic&&e.workspace?`${e.topic} | ${e.workspace}`:e.topic?e.topic:e.workspace?e.workspace:e.type}function are({disabled:e=!1,commands:t,value:n,focusSignal:r,onValueChange:i,onCommand:a,onSend:o}){let s=(0,I.useRef)(null),c=(0,I.useRef)(null),[l,u]=(0,I.useState)(0),d=n.trim().startsWith(`/`)?t.filter(e=>e.slash.startsWith(n.trim().split(/\s+/)[0])):[];(0,I.useEffect)(()=>{!d.length||l<d.length||u(0)},[l,d.length]),(0,I.useEffect)(()=>{c.current?.scrollIntoView({block:`nearest`})},[l,d.length]),(0,I.useEffect)(()=>{if(r<=0)return;let e=s.current;if(!e)return;let t=e.value.length;e.focus(),e.setSelectionRange(t,t)},[r]),(0,I.useLayoutEffect)(()=>{ore(s.current)},[n]);let f=async()=>{if(e)return;let r=n.trim();if(r){if(d.length&&!t.some(e=>e.slash===r.split(/\s+/)[0])){i(d[Math.min(l,d.length-1)].slash);return}i(``),!(r.startsWith(`/`)&&await a(r))&&await o(r)}};return(0,L.jsxs)(`div`,{className:`relative p-3 bg-[#151f24] border-t border-slate-800`,children:[d.length?(0,L.jsx)(`div`,{className:`absolute left-3 bottom-full mb-2 w-[min(520px,calc(100%-24px))] max-h-72 overflow-auto bg-[#0e1116] border border-[#11a4d4] rounded-sm shadow-xl`,children:d.map((e,t)=>(0,L.jsxs)(`button`,{ref:t===l?c:null,type:`button`,onClick:()=>{i(e.slash),u(t)},className:`w-full grid grid-cols-[120px_1fr] gap-2 px-3 py-2 text-left border-b border-slate-800 ${t===l?`bg-[#11a4d4]/15`:``}`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[#11a4d4]`,children:e.slash}),(0,L.jsx)(`span`,{className:`text-xs text-slate-400`,children:e.description})]},e.slash))}):null,(0,L.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] items-end gap-2`,children:[(0,L.jsx)(`textarea`,{ref:s,rows:1,value:n,disabled:e,onChange:e=>i(e.target.value),onKeyDown:e=>{if(d.length&&(e.key===`ArrowDown`||e.key===`ArrowUp`)){e.preventDefault(),u(t=>e.key===`ArrowDown`?(t+1)%d.length:(t-1+d.length)%d.length);return}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),f())},placeholder:e?`Select a session to message`:`Message selected session or type /`,className:`h-10 min-h-10 resize-none overflow-hidden bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm leading-5 outline-none focus:border-[#11a4d4] disabled:opacity-50 [scrollbar-gutter:stable]`}),(0,L.jsx)(`button`,{type:`button`,disabled:e,onClick:()=>void f(),title:`Send message`,"aria-label":`Send message`,className:`h-10 w-10 self-end inline-flex items-center justify-center bg-[#11a4d4] rounded-sm text-white disabled:opacity-50`,children:(0,L.jsx)(ls,{size:16})})]})]})}function ore(e){if(!e)return;let t=window.getComputedStyle(e),n=n9(t.lineHeight,20),r=n9(t.borderTopWidth)+n9(t.borderBottomWidth),i=n*5+n9(t.paddingTop)+n9(t.paddingBottom);e.style.height=`auto`;let a=e.scrollHeight,o=a>i;e.style.height=`${Math.min(a,i)+r}px`,e.style.overflowY=o?`auto`:`hidden`,o&&e.selectionStart===e.value.length&&e.selectionEnd===e.value.length&&(e.scrollTop=a)}function n9(e,t=0){let n=Number.parseFloat(e);return Number.isFinite(n)?n:t}function sre(){let e=globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2);return`web-${Date.now().toString(36)}-${e}`}function cre({agents:e,initialCustomAgents:t,initialCatalog:n,modelCatalog:r,onSelect:i,onCreateSession:a,onEditContextFile:o,onEditMcpServer:s,onAgentsChanged:c,creatingSession:l}){let[u,d]=(0,I.useState)(n??null),[f,p]=(0,I.useState)(t),[m,h]=(0,I.useState)(()=>r9(n)),[g,_]=(0,I.useState)(!1),[v,y]=(0,I.useState)(()=>localStorage.getItem(`pibo.chat.showArchivedAgents`)===`true`),[b,x]=(0,I.useState)(``),[S,C]=(0,I.useState)(null),[w,T]=(0,I.useState)(``),[E,D]=(0,I.useState)(`agent`),O=!!u;(0,I.useEffect)(()=>p(t),[t]),(0,I.useEffect)(()=>{n&&d(n)},[n]);let k=(0,I.useMemo)(()=>new Set(f.map(e=>e.profileName)),[f]),A=(0,I.useMemo)(()=>e.filter(e=>!k.has(e.name)),[e,k]),j=(0,I.useMemo)(()=>f.filter(e=>!e.archivedAt),[f]),M=(0,I.useMemo)(()=>f.filter(e=>e.archivedAt),[f]),N=(0,I.useMemo)(()=>ure(e,j),[e,j]),P=!!m.archivedAt,F=m.source===`profile`||P,ee=F?null:dre(m.displayName),te=m.profileName??(ee?`new custom profile`:m.displayName),ne=(0,I.useMemo)(()=>u?.contextFiles.filter(e=>(e.scope??`global`)===`agent`?e.agentProfileName===te||m.contextFiles.includes(e.key):!0)??[],[u,m.contextFiles,te]),re=(0,I.useMemo)(()=>mre(u?.nativeTools??[],m.nativeTools),[u?.nativeTools,m.nativeTools]),ie=(0,I.useMemo)(()=>hre(u?.skills??[],m.skills),[u?.skills,m.skills]),ae=(0,I.useMemo)(()=>gre(ne,m.contextFiles),[ne,m.contextFiles]),oe=async()=>{if(!F){if(ee){C(ee);return}if(!O){C(E9());return}_(!0);try{let e={displayName:m.displayName.trim(),description:(m.description??``).trim()||void 0,nativeTools:m.nativeTools,skills:m.skills,contextFiles:m.contextFiles,subagents:m.subagents.filter(e=>e.name.trim()&&e.targetProfile.trim()),mcpServers:m.mcpServers,piPackages:m.piPackages,mainModel:m.mainModel,subagentModel:m.subagentModel,builtinTools:m.builtinTools,builtinToolNames:m.builtinToolNames,autoContextFiles:m.autoContextFiles,runControl:m.runControl},t=m.id?await Hs(m.id,e):await Vs(e);p(e=>{let n=e.filter(e=>e.id!==t.agent.id);return[t.agent,...n]}),h(i9(t.agent)),i(t.agent.profileName),c(),C(null)}catch(e){let t=e instanceof Error?e.message:String(e);C(jre(t)?E9():t)}finally{_(!1)}}},se=async e=>{if(!(!m.id||m.source!==`custom`)){_(!0);try{let t=await Hs(m.id,{archived:e});e&&(y(!0),localStorage.setItem(`pibo.chat.showArchivedAgents`,`true`)),p(e=>e.map(e=>e.id===t.agent.id?t.agent:e)),h(i9(t.agent)),x(``),c(),C(null)}catch(e){C(e instanceof Error?e.message:String(e))}finally{_(!1)}}},ce=async()=>{if(!(F||!O||!w.trim())){if(ee){C(ee);return}_(!0);try{let e=(await Os({label:w.trim(),scope:E,agentProfileName:E===`agent`?te:void 0,markdown:``})).file;d(t=>t&&{...t,contextFiles:[...t.contextFiles,e]}),h(t=>({...t,contextFiles:t.contextFiles.includes(e.key)?t.contextFiles:[...t.contextFiles,e.key]})),T(``),C(null)}catch(e){C(e instanceof Error?e.message:String(e))}finally{_(!1)}}},le=async()=>{if(!(!m.id||!m.profileName||!P)){_(!0);try{await Ws(m.id,b),p(e=>e.filter(e=>e.id!==m.id)),h(r9(u??void 0)),x(``),c(),C(null)}catch(e){C(e instanceof Error?e.message:String(e))}finally{_(!1)}}};return(0,L.jsxs)(`div`,{className:`h-full min-h-0 overflow-hidden grid grid-cols-[300px_minmax(0,1fr)] max-[920px]:grid-cols-1`,children:[(0,L.jsxs)(`aside`,{className:`border-r border-slate-800 bg-[#1a262b] min-h-0 overflow-auto`,children:[(0,L.jsxs)(`div`,{className:`h-11 px-3 border-b border-slate-800 flex items-center justify-between text-xs font-bold uppercase tracking-wider`,children:[(0,L.jsx)(`span`,{children:`Agents`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>h(r9(u??void 0)),title:`New Agent`,"aria-label":`New Agent`,className:`p-1 border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,L.jsx)(rs,{size:13})}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>{let e=!v;y(e),localStorage.setItem(`pibo.chat.showArchivedAgents`,String(e))},title:v?`Hide Archived Agents`:`Show Archived Agents`,"aria-label":v?`Hide Archived Agents`:`Show Archived Agents`,className:`p-1 border rounded-sm hover:border-[#11a4d4] hover:text-[#11a4d4] ${v?`border-[#11a4d4] text-[#11a4d4]`:`border-slate-700 text-slate-400`}`,children:v?(0,L.jsx)(wo,{size:13}):(0,L.jsx)(To,{size:13})}),(0,L.jsx)(`button`,{type:`button`,onClick:c,title:`Refresh`,"aria-label":`Refresh`,className:`p-1 border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,L.jsx)(os,{size:13})})]})]}),(0,L.jsxs)(`div`,{className:`p-2`,children:[(0,L.jsxs)(m9,{title:`Custom Agents`,children:[j.map(e=>(0,L.jsx)(h9,{title:e.displayName,subtitle:e.profileName,selected:m.source===`custom`&&m.id===e.id,onSelect:()=>{h(i9(e)),i(e.profileName)},onCopy:()=>h(o9(e)),onCreateSession:()=>{i(e.profileName),a(e.profileName)},createSessionDisabled:l},e.id)),j.length===0?(0,L.jsx)(`div`,{className:`px-2 py-3 text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm`,children:`No custom agents`}):null]}),v?(0,L.jsxs)(m9,{title:`Archived Custom Agents`,children:[M.map(e=>(0,L.jsx)(h9,{title:e.displayName,subtitle:e.profileName,selected:m.source===`custom`&&m.id===e.id,onSelect:()=>{h(i9(e))},onCopy:()=>h(o9(e)),onCreateSession:()=>{},createSessionDisabled:!0},e.id)),M.length===0?(0,L.jsx)(`div`,{className:`px-2 py-3 text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm`,children:`No archived agents`}):null]}):null,(0,L.jsx)(m9,{title:`Read-only Profiles`,children:A.map(e=>(0,L.jsx)(h9,{title:e.name,subtitle:e.aliases.join(`, `)||`plugin`,selected:m.source===`profile`&&m.profileName===e.name,onSelect:()=>{h(a9(e,u??void 0)),i(e.name)},onCopy:()=>h(lre(e,u??void 0)),onCreateSession:()=>{i(e.name),a(e.name)},createSessionDisabled:l},e.name))})]})]}),(0,L.jsxs)(`section`,{className:`min-h-0 overflow-auto p-5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`h1`,{className:`text-sm font-bold uppercase tracking-wider`,children:`Agent Designer`}),(0,L.jsx)(`div`,{className:`font-mono text-[11px] text-slate-500 truncate`,children:te}),(0,L.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-slate-500`,children:m.source===`profile`?`read-only plugin profile`:P?`archived custom agent`:`custom agent`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>{m.profileName&&(i(m.profileName),a(m.profileName))},disabled:!m.profileName||l||P,title:`New Session With Agent`,"aria-label":`New Session With Agent`,className:`h-8 w-8 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:(0,L.jsx)(es,{size:14})}),m.source===`custom`&&m.id?(0,L.jsx)(`button`,{type:`button`,onClick:()=>void se(!P),disabled:g,title:P?`Restore Agent`:`Archive Agent`,"aria-label":P?`Restore Agent`:`Archive Agent`,className:`h-8 w-8 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:P?(0,L.jsx)(wo,{size:14}):(0,L.jsx)(To,{size:14})}):null,(0,L.jsx)(`button`,{type:`button`,onClick:()=>void oe(),disabled:F||!O||g||!!ee,title:`Save Agent`,"aria-label":`Save Agent`,className:`h-8 w-8 inline-flex items-center justify-center border border-[#11a4d4] rounded-sm text-[#11a4d4] bg-[#11a4d4]/10 disabled:opacity-50`,children:(0,L.jsx)(cs,{size:14})})]})]}),O?null:(0,L.jsx)(`div`,{className:`mb-3 border border-[#f59e0b]/60 bg-[#f59e0b]/10 text-amber-100 px-3 py-2 text-sm rounded-sm`,children:E9()}),m.source===`profile`?(0,L.jsx)(`div`,{className:`mb-3 border border-slate-700 bg-[#151f24] text-slate-300 px-3 py-2 text-sm rounded-sm`,children:`This profile is registered by a plugin. Copy it to create an editable custom agent.`}):null,P?(0,L.jsx)(`div`,{className:`mb-3 border border-[#f59e0b]/60 bg-[#f59e0b]/10 text-amber-100 px-3 py-2 text-sm rounded-sm`,children:`This agent is archived. Restore it before editing or starting new sessions.`}):null,S?(0,L.jsx)(`div`,{className:`mb-3 border border-red-500/60 bg-red-500/10 text-red-200 px-3 py-2 text-sm rounded-sm`,children:S}):null,(0,L.jsxs)(`div`,{className:`grid gap-4`,children:[(0,L.jsxs)(g9,{title:`Basics`,children:[(0,L.jsx)(`input`,{value:m.displayName,disabled:F,onChange:e=>h(t=>({...t,displayName:e.target.value})),className:`min-w-0 bg-[#0e1116] border rounded-sm px-3 py-2 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60 ${ee?`border-[#f59e0b]`:`border-slate-700`}`,placeholder:`agent-name`}),ee?(0,L.jsx)(`div`,{className:`text-xs text-amber-100`,children:ee}):null,(0,L.jsx)(`textarea`,{value:m.description,disabled:F,onChange:e=>h(t=>({...t,description:e.target.value})),className:`min-h-[72px] bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60`,placeholder:`Description`}),m.source===`profile`&&m.hardPinnedModel?(0,L.jsxs)(`div`,{className:`border border-slate-700 bg-[#151f24] text-slate-300 px-3 py-2 text-xs rounded-sm`,children:[`This plugin profile hard-pins `,(0,L.jsx)(`span`,{className:`font-mono`,children:Ire(m.hardPinnedModel)}),`. Main-agent and subagent defaults do not apply.`]}):null,(0,L.jsx)(D9,{title:`Main Agent Model`,catalog:r,value:m.mainModel,allowUnset:!0,readOnly:F,hint:`Unset to use the settings default.`,onChange:e=>h(t=>({...t,mainModel:e}))}),(0,L.jsx)(D9,{title:`Subagent Model`,catalog:r,value:m.subagentModel,allowUnset:!0,readOnly:F,hint:`Unset to use the settings default.`,onChange:e=>h(t=>({...t,subagentModel:e}))}),(0,L.jsx)(x9,{disabled:F,checked:m.autoContextFiles,title:`Load AGENTS.md / CLAUDE.md`,onToggle:()=>h(e=>({...e,autoContextFiles:!e.autoContextFiles}))}),(0,L.jsx)(Dre,{draft:m,setDraft:h,readOnly:F})]}),(0,L.jsx)(g9,{title:`Tools`,children:(0,L.jsx)(_9,{groups:re,empty:u?(0,L.jsx)(T9,{message:`No native tools registered`}):(0,L.jsx)(T9,{}),renderItem:e=>(0,L.jsx)(v9,{disabled:F,checked:m.nativeTools.includes(e.name),title:e.name,description:e.description,meta:e.yieldable?`yieldable`:`direct only`,onToggle:()=>h(t=>({...t,nativeTools:s9(t.nativeTools,e.name)}))},e.name)})}),(0,L.jsx)(g9,{title:`Skills`,children:(0,L.jsx)(_9,{groups:ie,empty:u?(0,L.jsx)(T9,{message:`No skills registered`}):(0,L.jsx)(T9,{}),renderItem:e=>(0,L.jsx)(v9,{disabled:F,checked:m.skills.includes(e.name),title:e.name,description:e.path,meta:yre(e),metaClass:e.kind===`user`?`text-amber-200`:`text-[#11a4d4]`,onToggle:()=>h(t=>({...t,skills:s9(t.skills,e.name)}))},e.name)})}),(0,L.jsx)(Sre,{title:`Packages`,children:(0,L.jsx)(v9,{disabled:F,checked:m.runControl,title:`pibo-run-control`,description:`Expose pibo_run_* as one package for yielded native tools and subagents.`,meta:`package`,onToggle:()=>h(e=>({...e,runControl:!e.runControl}))})}),(0,L.jsx)(wre,{packages:u?.piPackages,draft:m,setDraft:h,readOnly:F}),(0,L.jsxs)(g9,{title:`Context Files`,children:[m.brokenContextFiles?.length?(0,L.jsxs)(`div`,{className:`border border-red-500/60 bg-red-500/10 rounded-sm p-3 space-y-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-start gap-2 text-red-100`,children:[(0,L.jsx)(ps,{size:14,className:`mt-0.5 shrink-0`}),(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`div`,{className:`text-sm font-medium`,children:`This agent references missing context files.`}),(0,L.jsx)(`div`,{className:`text-xs text-red-200/90`,children:`Remove these broken links and save the agent to persist the cleanup.`})]})]}),(0,L.jsx)(`div`,{className:`grid gap-2`,children:m.brokenContextFiles.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border border-red-500/40 bg-[#2a1417] rounded-sm px-3 py-2`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`truncate text-sm text-red-100`,children:e}),(0,L.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-red-300/80`,children:`Broken link`})]}),(0,L.jsx)(`button`,{type:`button`,disabled:F,onClick:()=>h(t=>({...t,contextFiles:t.contextFiles.filter(t=>t!==e),brokenContextFiles:(t.brokenContextFiles??[]).filter(t=>t!==e)})),className:`h-8 w-8 inline-flex items-center justify-center border border-red-500/60 rounded-sm text-red-200 hover:border-red-400 hover:text-red-100 disabled:opacity-50`,title:`Remove Broken Context File`,"aria-label":`Remove Broken Context File`,children:(0,L.jsx)(_s,{size:14})})]},e))})]}):null,(0,L.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] gap-2`,children:[(0,L.jsx)(`input`,{value:w,disabled:F,onChange:e=>T(e.target.value),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60`,placeholder:`New context file`}),(0,L.jsx)(`button`,{type:`button`,disabled:F||g||!w.trim()||!!ee,onClick:()=>void ce(),title:`Create Context File`,"aria-label":`Create Context File`,className:`h-9 w-9 inline-flex items-center justify-center border border-[#11a4d4] rounded-sm text-[#11a4d4] bg-[#11a4d4]/10 disabled:opacity-50`,children:(0,L.jsx)(rs,{size:14})})]}),(0,L.jsxs)(`div`,{className:`inline-flex w-fit gap-1 border border-slate-800 bg-[#0e1116] rounded-sm p-1`,children:[(0,L.jsx)(`button`,{type:`button`,disabled:F,onClick:()=>D(`agent`),className:`px-2 py-1 text-xs rounded-sm ${E===`agent`?`bg-[#11a4d4]/20 text-sky-100`:`text-slate-500 hover:text-slate-300`}`,children:`Agent`}),(0,L.jsx)(`button`,{type:`button`,disabled:F,onClick:()=>D(`global`),className:`px-2 py-1 text-xs rounded-sm ${E===`global`?`bg-[#11a4d4]/20 text-sky-100`:`text-slate-500 hover:text-slate-300`}`,children:`Global`})]}),(0,L.jsx)(_9,{groups:ae,empty:u?(0,L.jsx)(T9,{message:`No context files registered`}):(0,L.jsx)(T9,{}),renderItem:e=>(0,L.jsx)(v9,{disabled:F,checked:m.contextFiles.includes(e.key),title:e.label??e.key,description:e.path,meta:Ore(e),metaClass:`text-[#11a4d4]`,actionLabel:`Edit`,actionIcon:(0,L.jsx)(ns,{size:12}),onAction:()=>o(e.key),onToggle:()=>h(t=>({...t,contextFiles:s9(t.contextFiles,e.key)}))},e.key)})]}),(0,L.jsx)(Mre,{draft:m,setDraft:h,profileOptions:N,readOnly:F}),(0,L.jsx)(Nre,{servers:u?.mcpServers,draft:m,setDraft:h,readOnly:F,onEditServer:s}),P&&m.profileName?(0,L.jsxs)(g9,{title:`Delete Agent`,children:[(0,L.jsxs)(`div`,{className:`border border-red-500/60 bg-red-500/10 text-red-100 rounded-sm p-3 text-sm`,children:[`Permanently deleting this agent also deletes all Chat sessions that use profile `,(0,L.jsx)(`span`,{className:`font-mono`,children:m.profileName}),`.`]}),(0,L.jsx)(`input`,{value:b,onChange:e=>x(e.target.value),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-red-500`,placeholder:m.profileName}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>void le(),disabled:g||b!==m.profileName,className:`h-8 w-fit inline-flex items-center gap-2 border border-red-500 rounded-sm px-3 text-red-200 bg-red-500/10 disabled:opacity-50`,children:[(0,L.jsx)(fs,{size:14}),`Delete permanently`]})]}):null]})]})]})}function r9(e){return{displayName:`new-agent`,description:``,nativeTools:[],skills:p9(e,`pi-agent-harness`)?[`pi-agent-harness`]:[],contextFiles:[],subagents:[],mcpServers:[],piPackages:[],mainModel:void 0,subagentModel:void 0,builtinTools:`default`,builtinToolNames:[...l9],autoContextFiles:!0,runControl:!1,brokenContextFiles:[],hardPinnedModel:void 0,source:`custom`}}function i9(e){return{id:e.id,profileName:e.profileName,displayName:e.displayName,description:e.description??``,nativeTools:e.nativeTools,skills:e.skills,contextFiles:e.contextFiles,subagents:e.subagents,mcpServers:e.mcpServers,piPackages:e.piPackages??[],mainModel:e.mainModel,subagentModel:e.subagentModel,builtinTools:e.builtinTools,builtinToolNames:c9(e.builtinToolNames,e.builtinTools),autoContextFiles:e.autoContextFiles??!0,runControl:e.runControl,brokenContextFiles:e.brokenContextFiles??[],archivedAt:e.archivedAt,hardPinnedModel:void 0,source:`custom`}}function a9(e,t){return{displayName:e.name,description:e.description??``,nativeTools:e.nativeTools??[],skills:e.skills??(p9(t,`pi-agent-harness`)?[`pi-agent-harness`]:[]),contextFiles:e.contextFiles??[],subagents:e.subagents??[],mcpServers:e.mcpServers??[],piPackages:e.piPackages??[],mainModel:e.mainModel??e.model,subagentModel:e.subagentModel??e.model,builtinTools:e.builtinTools??`default`,builtinToolNames:c9(e.builtinToolNames,e.builtinTools),autoContextFiles:e.autoContextFiles??!0,runControl:e.runControl??!1,brokenContextFiles:[],hardPinnedModel:e.model,profileName:e.name,source:`profile`}}function lre(e,t){return{...a9(e,t),displayName:`${e.name}-copy`,id:void 0,hardPinnedModel:void 0,profileName:void 0,source:`custom`}}function o9(e){return{...i9(e),displayName:`${e.profileName}-copy`,id:void 0,profileName:void 0,archivedAt:void 0,source:`custom`}}function ure(e,t){let n=new Map;for(let t of e)n.set(t.name,t.name);for(let e of t)n.set(e.profileName,e.displayName);return[...n.entries()].map(([e,t])=>({value:e,label:t}))}function dre(e){return e.trim()?e.length>120?`Agent name is too long.`:/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e)?null:`Use lowercase kebab-case only, for example test-agent.`:`Agent name is required.`}function s9(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function c9(e,t=`default`){if(t===`disabled`)return[];let n=new Set(e??l9);return l9.filter(e=>n.has(e))}var fre=new Set([`apply_patch`,`web_search`,`view_image`]),l9=[`read`,`bash`,`edit`,`write`],pre={read:`Read workspace files.`,bash:`Run shell commands.`,edit:`Edit existing files.`,write:`Create or overwrite files.`};function mre(e,t){let n=new Set(t),r=new Map;for(let t of e){let e=t.pluginId??(fre.has(t.name)?`pibo.codex-compat`:void 0),i=t.pluginName??(e===`pibo.codex-compat`?`Codex Compat`:void 0),a=!e||e===`pibo.core`,o=u9(r,a?`builtin`:`plugin:${e}`,{title:a?`Built-in Tools`:f9(e,i),description:a?`Built-in Pibo tool catalog`:e??`plugin`,kind:a?`builtin`:`plugin`});o.items.push(t),n.has(t.name)&&(o.selectedCount+=1),o.totalCount+=1}return d9(r,[`builtin`,`plugin`])}function hre(e,t){let n=new Set(t),r=new Map;for(let t of e){let e=t.kind,i=u9(r,e===`plugin`?`plugin:${t.pluginId??t.name}`:e,{title:_re(t),description:vre(t),kind:t.kind});i.items.push(t),n.has(t.name)&&(i.selectedCount+=1),i.totalCount+=1}return d9(r,[`builtin`,`plugin`,`user`])}function gre(e,t){let n=new Set(t),r=new Map;for(let t of e){let e=!t.pluginId,i=u9(r,e?`custom`:`plugin:${t.pluginId}`,{title:e?`Custom`:f9(t.pluginId,t.pluginName),description:e?`Loose context files without a plugin owner`:t.pluginId??`plugin`,kind:e?`custom`:`plugin`});i.items.push(t),n.has(t.key)&&(i.selectedCount+=1),i.totalCount+=1}return d9(r,[`custom`,`plugin`])}function u9(e,t,n){let r=e.get(t);if(r)return r;let i={key:t,title:n.title,description:n.description,kind:n.kind,items:[],selectedCount:0,totalCount:0,defaultOpen:!1};return e.set(t,i),i}function d9(e,t){let n=new Map(t.map((e,t)=>[e,t])),r=[...e.values()].sort((e,r)=>{let i=n.get(e.kind)??t.length,a=n.get(r.kind)??t.length;return i===a?e.title.localeCompare(r.title):i-a});return r.map((e,t)=>({...e,defaultOpen:e.kind!==`plugin`&&(e.selectedCount>0||t===0&&r.length===1)}))}function f9(e,t){return e===`pibo.codex-compat`?`Codex Compat`:t||(e?(e.split(`.`).filter(Boolean).at(-1)??e).split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):`Plugin`)}function _re(e){return e.kind===`builtin`?`Built-in Skills`:e.kind===`user`?`User Skills`:f9(e.pluginId,e.pluginName)}function vre(e){return e.kind===`builtin`?`Pibo-owned built-in skill catalog`:e.kind===`user`?`User-managed skills`:e.pluginId??`plugin`}function yre(e){return e.kind===`builtin`?`built-in skill`:e.kind===`user`?`user skill`:e.pluginName??e.pluginId??`plugin skill`}function p9(e,t){return e?.skills.some(e=>e.kind===`builtin`&&e.name===t)??!1}function m9({title:e,children:t}){return(0,L.jsxs)(`div`,{className:`mb-4`,children:[(0,L.jsx)(`div`,{className:`px-1 pb-1 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:e}),t]})}function h9({title:e,subtitle:t,selected:n,onSelect:r,onCopy:i,onCreateSession:a,createSessionDisabled:o}){return(0,L.jsx)(`div`,{className:`mb-1 border rounded-sm ${n?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-transparent hover:border-slate-700`}`,children:(0,L.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_auto] items-center gap-1 p-1`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:r,className:`min-w-0 text-left px-1 py-1`,children:[(0,L.jsx)(`span`,{className:`block text-sm truncate text-slate-200`,children:e}),(0,L.jsx)(`span`,{className:`block text-[10px] font-mono truncate text-slate-500`,children:t})]}),i?(0,L.jsx)(`button`,{type:`button`,onClick:i,title:`Copy To Custom Agent`,"aria-label":`Copy To Custom Agent`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,L.jsx)(Bo,{size:13})}):(0,L.jsx)(`span`,{className:`h-7 w-7`}),(0,L.jsx)(`button`,{type:`button`,onClick:a,disabled:o,title:`New Session With Profile`,"aria-label":`New Session With Profile`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:(0,L.jsx)(es,{size:13})})]})})}function bre({activePanel:e,onSelect:t,piPackageCount:n,userSkillCount:r}){return(0,L.jsx)(`div`,{className:`p-2`,children:(0,L.jsxs)(`div`,{className:`mb-4`,children:[(0,L.jsx)(`div`,{className:`px-1 pb-1 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Settings`}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(`general`),className:`mb-1 flex w-full items-center gap-2 border p-2 text-left ${e===`general`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,L.jsx)(ds,{size:13,className:`text-[#11a4d4]`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`General`}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`browser + runtime`})]})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(`pi-packages`),className:`mb-1 flex w-full items-center gap-2 border p-2 text-left ${e===`pi-packages`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,L.jsx)(Yo,{size:13,className:`text-[#11a4d4]`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`Pi Packages`}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`runtime-packages`})]}),(0,L.jsx)(`span`,{className:`inline-flex min-w-6 items-center justify-center border border-slate-700 bg-[#101d22] px-1.5 py-0.5 text-[10px] font-mono text-slate-400`,children:n})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(`skills`),className:`flex w-full items-center gap-2 border p-2 text-left ${e===`skills`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,L.jsx)(gs,{size:13,className:`text-[#11a4d4]`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`Skills`}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`user-managed`})]}),(0,L.jsx)(`span`,{className:`inline-flex min-w-6 items-center justify-center border border-slate-700 bg-[#101d22] px-1.5 py-0.5 text-[10px] font-mono text-slate-400`,children:r})]})]})})}function xre({activePanel:e,onSelect:t,toolCount:n,mcpServerCount:r}){return(0,L.jsx)(`div`,{className:`p-2`,children:(0,L.jsxs)(`div`,{className:`mb-4`,children:[(0,L.jsx)(`div`,{className:`px-1 pb-1 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Context`}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(`context-files`),className:`mb-1 flex w-full items-center gap-2 border p-2 text-left ${e===`context-files`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,L.jsx)(Yo,{size:13,className:`text-[#11a4d4]`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`Context Files`}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`managed-editor`})]})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(`base-prompt`),className:`mb-1 flex w-full items-center gap-2 border p-2 text-left ${e===`base-prompt`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,L.jsx)(ko,{size:13,className:`text-[#11a4d4]`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`Base Prompt`}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`system-prompt`})]})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(`compaction-prompt`),className:`mb-1 flex w-full items-center gap-2 border p-2 text-left ${e===`compaction-prompt`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,L.jsx)(jo,{size:13,className:`text-[#11a4d4]`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`Compaction Prompt`}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`summary-prompt`})]})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(`pibo-tools`),className:`mb-1 flex w-full items-center gap-2 border p-2 text-left ${e===`pibo-tools`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,L.jsx)(gs,{size:13,className:`text-[#11a4d4]`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`Pibo Tools`}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`installed-tool-context`})]}),(0,L.jsx)(`span`,{className:`inline-flex min-w-6 items-center justify-center border border-slate-700 bg-[#101d22] px-1.5 py-0.5 text-[10px] font-mono text-slate-400`,children:n})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(`mcp-tools`),className:`flex w-full items-center gap-2 border p-2 text-left ${e===`mcp-tools`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,L.jsx)(us,{size:13,className:`text-[#11a4d4]`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`MCP Tools`}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`mcp-context`})]}),(0,L.jsx)(`span`,{className:`inline-flex min-w-6 items-center justify-center border border-slate-700 bg-[#101d22] px-1.5 py-0.5 text-[10px] font-mono text-slate-400`,children:r})]})]})})}function g9({title:e,children:t}){return(0,L.jsxs)(`div`,{className:`border border-slate-700 bg-[#1a262b] rounded-sm p-4`,children:[(0,L.jsx)(`div`,{className:`text-xs font-bold uppercase tracking-wider text-slate-400 mb-3`,children:e}),(0,L.jsx)(`div`,{className:`grid gap-3`,children:t})]})}function Sre({title:e,children:t}){return(0,L.jsx)(g9,{title:e,children:(0,L.jsx)(`div`,{className:`grid grid-cols-2 max-[1100px]:grid-cols-1 gap-2`,children:t})})}function _9({groups:e,empty:t,renderItem:n}){return e.length===0?(0,L.jsx)(L.Fragment,{children:t}):(0,L.jsx)(`div`,{className:`grid gap-2`,children:e.map(e=>(0,L.jsx)(Cre,{group:e,renderItem:n},e.key))})}function Cre({group:e,renderItem:t}){let[n,r]=(0,I.useState)(e.defaultOpen),i=e.kind===`custom`||e.kind===`user`?`border-[#f59e0b]/70 text-amber-100 bg-[#f59e0b]/10`:`border-[#11a4d4]/70 text-sky-100 bg-[#11a4d4]/10`;return(0,L.jsxs)(`div`,{className:`border rounded-sm ${n?`border-slate-700 bg-[#101d22]`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex w-full items-center gap-2 p-2 text-left`,children:[(0,L.jsx)(`span`,{className:`h-6 w-6 shrink-0 inline-flex items-center justify-center border rounded-sm ${i}`,children:n?(0,L.jsx)(Po,{size:14}):(0,L.jsx)(Fo,{size:14})}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm font-medium text-slate-100`,children:e.title}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:e.description})]}),(0,L.jsxs)(`span`,{className:`shrink-0 text-right font-mono text-sm font-semibold tabular-nums`,"aria-label":`${e.selectedCount} of ${e.totalCount} selected`,children:[(0,L.jsx)(`span`,{className:`text-[#11a4d4]`,children:e.selectedCount}),(0,L.jsxs)(`span`,{className:`text-slate-500`,children:[`/`,e.totalCount]})]})]}),n?(0,L.jsx)(`div`,{className:`border-t border-slate-800 p-2`,children:(0,L.jsx)(`div`,{className:`grid grid-cols-2 max-[1100px]:grid-cols-1 gap-2`,children:e.items.map(t)})}):null]})}function v9({checked:e,disabled:t,title:n,description:r,meta:i,metaClass:a,actionLabel:o,actionIcon:s,actionDisabled:c,onAction:l,onToggle:u}){return(0,L.jsxs)(`button`,{type:`button`,onClick:()=>{t||u()},"aria-disabled":t,className:`min-w-0 border rounded-sm p-2 text-left grid grid-cols-[18px_1fr] gap-2 ${t&&!l?`opacity-60`:``} ${e?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,L.jsx)(S9,{checked:e,className:`mt-0.5`}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsxs)(`span`,{className:`flex items-start justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,L.jsx)(`span`,{className:`block text-sm truncate text-slate-200`,children:n})}),o&&l?(0,L.jsx)(`span`,{className:`shrink-0`,children:(0,L.jsxs)(`span`,{role:`button`,tabIndex:0,onClick:e=>{e.preventDefault(),e.stopPropagation(),c||l()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&!c&&(e.preventDefault(),e.stopPropagation(),l())},className:`inline-flex h-6 items-center justify-center gap-1 border px-1.5 text-[10px] uppercase tracking-wider ${c?`border-slate-800 text-slate-600`:`border-[#11a4d4]/70 text-[#7dd3fc] hover:border-[#11a4d4] hover:text-sky-100`}`,children:[s,o]})}):null]}),r?(0,L.jsx)(`span`,{className:`block text-xs text-slate-500 truncate`,children:r}):null,i?(0,L.jsx)(`span`,{className:`block font-mono text-[10px] mt-1 ${a??`text-slate-600`}`,children:i}):null]})]})}function wre({packages:e,draft:t,setDraft:n,readOnly:r}){let[i,a]=(0,I.useState)(()=>new Set),o=e??[],s=o.filter(Are),c=s.filter(e=>C9(t.piPackages,e)).length,l=e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,L.jsxs)(g9,{title:`Pi Packages`,children:[(0,L.jsxs)(`div`,{className:`font-mono text-[10px] uppercase tracking-wider text-slate-500`,children:[s.length,` available / `,c,` selected / `,o.length,` registered`]}),e?s.length?(0,L.jsx)(`div`,{className:`grid gap-2`,children:s.map(e=>(0,L.jsx)(Tre,{pkg:e,selected:C9(t.piPackages,e),readOnly:r,expanded:i.has(e.id),busy:!1,onToggleSelected:()=>{r||n(t=>({...t,piPackages:kre(t.piPackages,e)}))},onToggleExpanded:()=>l(e.id)},e.id))}):(0,L.jsx)(T9,{message:`No installed and enabled Pi packages available. Manage Pi Packages in Settings.`}):(0,L.jsx)(T9,{})]})}function Tre({pkg:e,selected:t,readOnly:n,expanded:r,busy:i,onToggleSelected:a,onToggleExpanded:o,onToggleEnabled:s,onUnregister:c}){let l=e.diagnostics.some(e=>e.type===`error`),u=!n&&(e.enabled||t);return(0,L.jsxs)(`div`,{className:`border rounded-sm ${t?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24]`} ${e.enabled?``:`opacity-75`}`,children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] gap-2 p-2`,children:[(0,L.jsxs)(`button`,{type:`button`,disabled:!u,onClick:a,className:`min-w-0 grid grid-cols-[18px_1fr] gap-2 text-left disabled:cursor-not-allowed`,children:[(0,L.jsx)(S9,{checked:t,disabled:!u,className:`mt-0.5`}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate text-sm text-slate-200`,children:e.name}),(0,L.jsx)(`span`,{className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider ${e.enabled?`border-[#11a4d4]/60 text-[#7dd3fc]`:`border-slate-700 text-slate-500`}`,children:e.enabled?`enabled`:`disabled`})]}),(0,L.jsx)(`span`,{className:`block text-xs text-slate-500 truncate`,children:e.description??e.source}),(0,L.jsx)(`span`,{className:`block font-mono text-[10px] mt-1 ${l?`text-[#f59e0b]`:`text-[#11a4d4]`}`,children:w9(e)})]})]}),(0,L.jsxs)(`div`,{className:`flex items-start gap-1`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:o,title:r?`Hide Details`:`Show Details`,"aria-label":r?`Hide Details`:`Show Details`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:r?(0,L.jsx)(Po,{size:13}):(0,L.jsx)(Fo,{size:13})}),s?(0,L.jsx)(`button`,{type:`button`,disabled:i,onClick:s,title:e.enabled?`Disable Package`:`Enable Package`,"aria-label":e.enabled?`Disable Package`:`Enable Package`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:e.enabled?(0,L.jsx)(is,{size:13}):(0,L.jsx)(as,{size:13})}):null,c?(0,L.jsx)(`button`,{type:`button`,disabled:i,onClick:c,title:`Unregister Package`,"aria-label":`Unregister Package`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-red-400 hover:text-red-300 disabled:opacity-50`,children:(0,L.jsx)(fs,{size:13})}):null]})]}),r?(0,L.jsx)(y9,{pkg:e}):null]})}function y9({pkg:e}){return(0,L.jsxs)(`div`,{className:`border-t border-slate-800 p-3 grid gap-3 text-xs text-slate-300`,children:[(0,L.jsx)(Ere,{rows:[[`Source`,e.source],[`Install`,e.installSpec],[`Version`,e.version],[`Added`,e.addedAt],[`Updated`,e.updatedAt]]}),e.repositoryUrl?(0,L.jsxs)(`a`,{href:e.repositoryUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex w-fit items-center gap-1 text-[#7dd3fc] hover:text-sky-100`,children:[(0,L.jsx)(Vo,{size:12}),`Source repository`]}):null,(0,L.jsx)(b9,{title:`Extensions`,values:e.extensionPaths}),(0,L.jsx)(b9,{title:`Skills`,values:e.skillNames}),(0,L.jsx)(b9,{title:`Prompts`,values:e.promptNames}),(0,L.jsx)(b9,{title:`Themes`,values:e.themeNames}),(0,L.jsx)(b9,{title:`Tools`,values:e.discoveredToolNames}),e.diagnostics.length?(0,L.jsxs)(`div`,{className:`grid gap-1`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Diagnostics`}),e.diagnostics.map((e,t)=>(0,L.jsxs)(`div`,{className:`border px-2 py-1 rounded-sm ${e.type===`error`?`border-red-500/50 text-red-200 bg-red-500/10`:e.type===`warning`?`border-[#f59e0b]/50 text-amber-100 bg-[#f59e0b]/10`:`border-slate-700 text-slate-400 bg-[#0e1116]`}`,children:[(0,L.jsx)(`span`,{className:`font-mono uppercase text-[10px] mr-2`,children:e.type}),e.message]},`${e.type}:${t}`))]}):null]})}function Ere({rows:e}){let t=e.filter(([,e])=>e);return t.length===0?null:(0,L.jsx)(`div`,{className:`grid gap-1`,children:t.map(([e,t])=>(0,L.jsxs)(`div`,{className:`grid grid-cols-[84px_minmax(0,1fr)] gap-2`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-slate-500`,children:e}),(0,L.jsx)(`span`,{className:`min-w-0 break-all font-mono text-[11px] text-slate-300`,children:t})]},e))})}function b9({title:e,values:t}){return t?.length?(0,L.jsxs)(`div`,{className:`grid gap-1`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:e}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.map(e=>(0,L.jsx)(`span`,{className:`max-w-full break-all border border-slate-700 bg-[#0e1116] px-2 py-1 font-mono text-[11px] text-slate-300 rounded-sm`,children:e},e))})]}):null}function Dre({draft:e,setDraft:t,readOnly:n}){let r=c9(e.builtinToolNames,e.builtinTools),[i,a]=(0,I.useState)(r.length!==l9.length),o=e=>{t(t=>{let n=s9(c9(t.builtinToolNames,t.builtinTools),e);return{...t,builtinTools:n.length===0?`disabled`:`default`,builtinToolNames:n}})};return(0,L.jsxs)(`div`,{className:`border rounded-sm ${i?`border-slate-700 bg-[#101d22]`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`flex w-full items-center gap-2 p-2 text-left`,children:[(0,L.jsx)(`span`,{className:`h-6 w-6 shrink-0 inline-flex items-center justify-center border rounded-sm border-[#11a4d4]/70 text-sky-100 bg-[#11a4d4]/10`,children:i?(0,L.jsx)(Po,{size:14}):(0,L.jsx)(Fo,{size:14})}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm font-medium text-slate-100`,children:`Pi Built-in Tools`}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`basic model tools`})]}),(0,L.jsxs)(`span`,{className:`shrink-0 text-right font-mono text-sm font-semibold tabular-nums`,"aria-label":`${r.length} of ${l9.length} enabled`,children:[(0,L.jsx)(`span`,{className:`text-[#11a4d4]`,children:r.length}),(0,L.jsxs)(`span`,{className:`text-slate-500`,children:[`/`,l9.length]})]})]}),i?(0,L.jsx)(`div`,{className:`border-t border-slate-800 p-2`,children:(0,L.jsx)(`div`,{className:`grid grid-cols-2 max-[1100px]:grid-cols-1 gap-2`,children:l9.map(e=>(0,L.jsx)(v9,{disabled:n,checked:r.includes(e),title:e,description:pre[e],meta:`built-in`,onToggle:()=>o(e)},e))})}):null]})}function x9({checked:e,disabled:t,title:n,onToggle:r}){return(0,L.jsxs)(`button`,{type:`button`,disabled:t,"aria-pressed":e,onClick:r,className:`inline-flex w-fit items-center gap-2 text-left text-sm text-slate-300 hover:text-slate-100 disabled:opacity-60`,children:[(0,L.jsx)(S9,{checked:e,disabled:t}),(0,L.jsx)(`span`,{children:n})]})}function S9({checked:e,disabled:t,className:n=``}){return(0,L.jsx)(`span`,{className:`h-4 w-4 shrink-0 border rounded-sm inline-flex items-center justify-center ${e?`border-[#11a4d4] text-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-600 text-transparent`} ${t?`opacity-70`:``} ${n}`,children:e?(0,L.jsx)(No,{size:12}):null})}function Ore(e){let t=e.source??`plugin`,n=e.scope??`global`;return t===`plugin`?`plugin global`:n===`agent`?e.agentProfileName?`agent ${e.agentProfileName}`:`agent local`:`managed global`}function C9(e,t){return e.includes(t.id)||e.includes(t.name)}function kre(e,t){return C9(e,t)?e.filter(e=>e!==t.id&&e!==t.name):[...e,t.id]}function Are(e){return e.enabled&&e.installStatus===`installed`}function w9(e){let t=e.resourceTypes.length?e.resourceTypes.join(` + `):`resources pending`,n=e.version?`v${e.version}`:e.installStatus,r=e.diagnostics.some(e=>e.type===`error`)?` / needs attention`:``;return`${t} / ${n} / ${e.enabled?`enabled`:`disabled`}${r}`}function T9({message:e=`Agent Designer API unavailable`}){return(0,L.jsx)(`div`,{className:`text-xs text-amber-100 border border-dashed border-[#f59e0b]/50 bg-[#f59e0b]/10 rounded-sm p-3`,children:e})}function E9(){return`Agent Designer API unavailable. Restart the Pibo web gateway after pulling/building the latest backend.`}function jre(e){return e.toLowerCase().includes(`not found`)||e.includes(`404`)}function Mre({draft:e,setDraft:t,profileOptions:n,readOnly:r}){let i=(e,n)=>{t(t=>({...t,subagents:t.subagents.map((t,r)=>r===e?{...t,...n}:t)}))};return(0,L.jsxs)(g9,{title:`Subagents`,children:[(0,L.jsx)(`div`,{className:`flex justify-end`,children:(0,L.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>t(e=>({...e,subagents:[...e.subagents,{name:`helper`,targetProfile:n[0]?.value??`pibo-minimal`,maxDepth:3}]})),className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,title:`Add Subagent`,"aria-label":`Add Subagent`,children:(0,L.jsx)(rs,{size:13})})}),(0,L.jsxs)(`div`,{className:`grid gap-2`,children:[e.subagents.map((e,a)=>(0,L.jsxs)(`div`,{className:`grid grid-cols-[1fr_1fr_80px_auto] max-[1100px]:grid-cols-1 gap-2 border border-slate-800 bg-[#151f24] p-2 rounded-sm`,children:[(0,L.jsx)(`input`,{value:e.name,disabled:r,onChange:e=>i(a,{name:e.target.value}),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-2 py-1 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60`,placeholder:`name`}),(0,L.jsx)(`select`,{value:e.targetProfile,disabled:r,onChange:e=>i(a,{targetProfile:e.target.value}),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-2 py-1 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60`,children:n.map(e=>(0,L.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,L.jsx)(`input`,{type:`number`,min:1,disabled:r,value:e.maxDepth??3,onChange:e=>i(a,{maxDepth:Number(e.target.value)||1}),className:`bg-[#0e1116] border border-slate-700 rounded-sm px-2 py-1 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60`}),(0,L.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>t(e=>({...e,subagents:e.subagents.filter((e,t)=>t!==a)})),className:`h-8 w-8 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-red-500 hover:text-red-300 disabled:opacity-50`,title:`Remove Subagent`,"aria-label":`Remove Subagent`,children:(0,L.jsx)(_s,{size:14})})]},a)),e.subagents.length===0?(0,L.jsx)(`div`,{className:`text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm p-3`,children:`No subagents configured`}):null]})]})}function Nre({servers:e,draft:t,setDraft:n,readOnly:r,onEditServer:i}){return(0,L.jsx)(g9,{title:`MCP Servers`,children:(0,L.jsxs)(`div`,{className:`grid grid-cols-2 max-[1100px]:grid-cols-1 gap-2`,children:[e?e.map(e=>{let a=r||!e.hasDescription;return(0,L.jsxs)(`div`,{className:`border rounded-sm bg-[#151f24] p-2 ${t.mcpServers.includes(e.name)?`border-[#11a4d4]`:e.hasDescription?`border-slate-800`:`border-[#f59e0b]/60`}`,children:[(0,L.jsxs)(`button`,{type:`button`,disabled:a,onClick:()=>n(t=>({...t,mcpServers:s9(t.mcpServers,e.name)})),className:`grid w-full min-w-0 grid-cols-[18px_1fr] gap-2 text-left disabled:opacity-60`,children:[(0,L.jsx)(S9,{checked:t.mcpServers.includes(e.name),disabled:a,className:`mt-0.5`}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(us,{size:13,className:`text-[#11a4d4]`}),(0,L.jsx)(`span`,{className:`block text-sm truncate text-slate-200`,children:e.name})]}),(0,L.jsxs)(`span`,{className:`block font-mono text-[10px] mt-1 text-slate-600`,children:[e.transport,e.descriptionSource?` / ${e.descriptionSource}`:``]})]})]}),e.hasDescription?(0,L.jsx)(`div`,{className:`mt-2 text-xs text-slate-400`,children:e.description}):(0,L.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 text-xs text-amber-100`,children:[(0,L.jsx)(ps,{size:13}),`Missing agent description`]}),(0,L.jsx)(`div`,{className:`mt-2 flex justify-end`,children:(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(e.name),title:`Edit MCP Tool Context`,"aria-label":`Edit MCP Tool Context`,className:`inline-flex h-6 items-center justify-center gap-1 border border-[#11a4d4]/70 px-1.5 text-[10px] uppercase tracking-wider text-[#7dd3fc] hover:border-[#11a4d4] hover:text-sky-100`,children:[(0,L.jsx)(ns,{size:12}),`Edit`]})})]},e.name)}):(0,L.jsx)(T9,{}),e&&e.length===0?(0,L.jsx)(`div`,{className:`text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm p-3`,children:`No MCP servers configured`}):null]})})}function Pre({activePanel:e,showThinking:t,setShowThinking:n,expandThinking:r,setExpandThinking:i,modelDefaults:a,modelCatalog:o,onModelDefaultsChanged:s,piPackages:c,onPiPackageChanged:l,onPiPackageRemoved:u,userSkills:d,onUserSkillChanged:f,onUserSkillRemoved:p}){return e===`pi-packages`?(0,L.jsxs)(`div`,{className:`p-6 overflow-auto`,children:[(0,L.jsxs)(`h1`,{className:`text-sm font-bold uppercase tracking-wider mb-4 flex items-center gap-2`,children:[(0,L.jsx)(Yo,{size:16}),`Pi Packages`]}),(0,L.jsx)(Lre,{packages:c,onPackageChanged:l,onPackageRemoved:u})]}):e===`skills`?(0,L.jsxs)(`div`,{className:`p-6 overflow-auto`,children:[(0,L.jsxs)(`h1`,{className:`text-sm font-bold uppercase tracking-wider mb-4 flex items-center gap-2`,children:[(0,L.jsx)(gs,{size:16}),`Skills`]}),(0,L.jsx)(Rre,{skills:d,onSkillChanged:f,onSkillRemoved:p})]}):(0,L.jsxs)(`div`,{className:`p-6 overflow-auto`,children:[(0,L.jsxs)(`h1`,{className:`text-sm font-bold uppercase tracking-wider mb-4 flex items-center gap-2`,children:[(0,L.jsx)(ds,{size:16}),`General`]}),(0,L.jsxs)(g9,{title:`General`,children:[(0,L.jsx)(x9,{checked:t,title:`Show thinking blocks`,onToggle:()=>{let e=!t;n(e),localStorage.setItem(`pibo.chat.showThinking`,String(e))}}),(0,L.jsx)(x9,{checked:r,disabled:!t,title:`Expand thinking blocks`,onToggle:()=>{let e=!r;i(e),localStorage.setItem(`pibo.chat.expandThinking`,String(e))}}),(0,L.jsx)(Fre,{modelDefaults:a,modelCatalog:o,onChanged:s})]})]})}function Fre({modelDefaults:e,modelCatalog:t,onChanged:n}){let[r,i]=(0,I.useState)(e??{}),[a,o]=(0,I.useState)(!1),[s,c]=(0,I.useState)(null);(0,I.useEffect)(()=>{i(e??{})},[e]);let l=async e=>{i(e),o(!0);try{n(await Us(e)),c(null)}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}};return(0,L.jsxs)(`div`,{className:`grid gap-3 border-t border-slate-800 pt-3`,children:[(0,L.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Runtime Model Defaults`}),(0,L.jsx)(D9,{title:`Main Agent Default`,catalog:t,value:r.main,allowUnset:!0,readOnly:a,hint:`Unset to use provider fallback.`,onChange:e=>void l({...r,main:e})}),(0,L.jsx)(D9,{title:`Subagent Default`,catalog:t,value:r.subagent,allowUnset:!0,readOnly:a,hint:`Unset to use provider fallback.`,onChange:e=>void l({...r,subagent:e})}),s?(0,L.jsx)(`div`,{className:`text-xs text-amber-100`,children:s}):null]})}function D9({title:e,catalog:t,value:n,allowUnset:r,readOnly:i,hint:a,onChange:o}){let[s,c]=(0,I.useState)(n?.provider??``),[l,u]=(0,I.useState)(n?.id??``),d=t?.providers??[],f=d.find(e=>e.id===s),p=!!s&&!f,m=p?`${s} (unknown provider)`:``,h=f?.models.find(e=>e.id===l),g=!!(s&&l&&f&&!h),_=f?.models??[],v=f?.authConfigured;return(0,I.useEffect)(()=>{c(n?.provider??``),u(n?.id??``)},[n?.id,n?.provider]),(0,L.jsxs)(`div`,{className:`grid gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-slate-500`,children:e}),r?(0,L.jsx)(`button`,{type:`button`,disabled:i||!s&&!l,onClick:()=>{c(``),u(``),o(void 0)},className:`text-[10px] uppercase tracking-wider text-slate-500 hover:text-slate-300 disabled:opacity-50`,children:`Unset`}):null]}),a?(0,L.jsx)(`div`,{className:`text-xs text-slate-500`,children:a}):null,d.length===0?(0,L.jsx)(`div`,{className:`text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm p-3`,children:`Model catalog unavailable.`}):null,(0,L.jsxs)(`div`,{className:`grid grid-cols-2 max-[1100px]:grid-cols-1 gap-2`,children:[(0,L.jsxs)(`select`,{value:s,disabled:i,onChange:e=>{let t=e.target.value;c(t),u(``)},className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60`,children:[(0,L.jsx)(`option`,{value:``,children:`Select provider`}),d.map(e=>(0,L.jsx)(`option`,{value:e.id,children:e.label},e.id)),p?(0,L.jsx)(`option`,{value:s,children:m}):null]}),(0,L.jsxs)(`select`,{value:l,disabled:i,onChange:e=>{let t=e.target.value;u(t),s&&t&&o({provider:s,id:t})},className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60`,children:[(0,L.jsx)(`option`,{value:``,children:s?`Select model`:`Select provider first`}),_.map(e=>(0,L.jsx)(`option`,{value:e.id,children:e.label},e.id)),g?(0,L.jsx)(`option`,{value:l,children:`${l} (unknown model)`}):null]})]}),s?(0,L.jsx)(`div`,{className:`text-xs text-slate-500`,children:p?`Stored provider is no longer present in the catalog.`:v?`Provider auth configured.`:`Provider auth missing.`}):null,g?(0,L.jsx)(`div`,{className:`text-xs text-amber-100`,children:`Stored model is no longer present in the catalog.`}):null]})}function Ire(e){return`${e.provider}/${e.id}`}function Lre({packages:e,onPackageChanged:t,onPackageRemoved:n}){let[r,i]=(0,I.useState)(``),[a,o]=(0,I.useState)(null),[s,c]=(0,I.useState)(null),[l,u]=(0,I.useState)(()=>new Set),d=e??[],f=d.filter(e=>e.installStatus===`installed`).length,p=d.filter(e=>e.enabled).length,m=async()=>{if(!a){o(`add`);try{let e=await Ks(r);t(e),i(``),u(t=>new Set(t).add(e.id)),c(null)}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(null)}}},h=async e=>{if(!a){o(`${e.id}:enabled`);try{t(await qs(e.id,{enabled:!e.enabled})),c(null)}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(null)}}},g=async e=>{if(!a&&window.confirm(`Unregister Pi package "${e.name}"?`)){o(`${e.id}:delete`);try{n(await Js(e.id)),u(t=>{let n=new Set(t);return n.delete(e.id),n}),c(null)}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(null)}}},_=e=>{u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,L.jsxs)(g9,{title:`Pi Package Management`,children:[(0,L.jsxs)(`div`,{className:`grid gap-2`,children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] gap-2`,children:[(0,L.jsx)(`input`,{value:r,disabled:!e||a===`add`,onChange:e=>i(e.target.value),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60`,placeholder:`https://pi.dev/packages/package-name`}),(0,L.jsx)(`button`,{type:`button`,disabled:!e||a===`add`||!r.trim(),onClick:()=>void m(),title:`Add Pi Package`,"aria-label":`Add Pi Package`,className:`h-9 w-9 inline-flex items-center justify-center border border-[#11a4d4] rounded-sm text-[#11a4d4] bg-[#11a4d4]/10 disabled:opacity-50`,children:(0,L.jsx)(rs,{size:14})})]}),(0,L.jsx)(`div`,{className:`text-[11px] text-slate-500`,children:`Extensions execute code in the Pi runtime. Review package source before adding it.`}),s?(0,L.jsx)(`div`,{className:`border border-red-500/60 bg-red-500/10 text-red-200 px-3 py-2 text-sm rounded-sm`,children:s}):null,(0,L.jsxs)(`div`,{className:`font-mono text-[10px] uppercase tracking-wider text-slate-500`,children:[d.length,` registered / `,f,` installed / `,p,` enabled`]})]}),e?d.length?(0,L.jsx)(`div`,{className:`grid gap-2`,children:d.map(e=>(0,L.jsx)(Bre,{pkg:e,expanded:l.has(e.id),busy:a?.startsWith(`${e.id}:`)??!1,onToggleExpanded:()=>_(e.id),onToggleEnabled:()=>void h(e),onUnregister:()=>void g(e)},e.id))}):(0,L.jsx)(T9,{message:`No Pi packages registered`}):(0,L.jsx)(T9,{})]})}function Rre({skills:e,onSkillChanged:t,onSkillRemoved:n}){let[r,i]=(0,I.useState)(!1),[a,o]=(0,I.useState)(!1),[s,c]=(0,I.useState)(null),[l,u]=(0,I.useState)(``),[d,f]=(0,I.useState)(null),[p,m]=(0,I.useState)(null),h=e??[],g=h.filter(e=>e.enabled).length,_=async e=>{if(!d){f(`${e.id}:enabled`);try{t(await Zs(e.id,{enabled:!e.enabled})),m(null)}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(null)}}},v=async e=>{if(!d&&window.confirm(`Delete skill "${e.name}"?`)){f(`${e.id}:delete`);try{await Qs(e.id),n(e.id),m(null)}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(null)}}},y=async e=>{f(`create`);try{t(await Xs(e)),i(!1),m(null)}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(null)}},b=async e=>{f(`install`);try{t(await $s(e)),o(!1),m(null)}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(null)}},x=async(e,n)=>{f(`edit`);try{t(await Zs(e,n)),c(null),m(null)}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(null)}};return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(g9,{title:`Skill Management`,children:[(0,L.jsxs)(`div`,{className:`grid gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsxs)(`button`,{type:`button`,disabled:d===`create`,onClick:()=>i(!0),className:`inline-flex items-center gap-2 border border-[#11a4d4] rounded-sm px-3 py-2 text-sm text-[#11a4d4] bg-[#11a4d4]/10 disabled:opacity-50`,children:[(0,L.jsx)(rs,{size:14}),`Create Skill`]}),(0,L.jsxs)(`button`,{type:`button`,disabled:d===`install`,onClick:()=>o(!0),className:`inline-flex items-center gap-2 border border-slate-700 rounded-sm px-3 py-2 text-sm text-slate-300 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:[(0,L.jsx)(Vo,{size:14}),`Install from URL`]})]}),p?(0,L.jsx)(`div`,{className:`border border-red-500/60 bg-red-500/10 text-red-200 px-3 py-2 text-sm rounded-sm`,children:p}):null,(0,L.jsxs)(`div`,{className:`font-mono text-[10px] uppercase tracking-wider text-slate-500`,children:[h.length,` skills / `,g,` enabled`]})]}),e?h.length?(0,L.jsx)(`div`,{className:`grid gap-2`,children:h.map(e=>(0,L.jsx)(`div`,{className:`border rounded-sm p-2 ${e.enabled?`border-slate-800 bg-[#151f24]`:`border-slate-800 bg-[#151f24] opacity-75`}`,children:(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate text-sm text-slate-200`,children:e.name}),(0,L.jsx)(`span`,{className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider ${e.enabled?`border-[#11a4d4]/60 text-[#7dd3fc]`:`border-slate-700 text-slate-500`}`,children:e.enabled?`enabled`:`disabled`}),(0,L.jsx)(`span`,{className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider border-slate-700 text-slate-500`,children:e.source})]}),(0,L.jsx)(`div`,{className:`truncate text-xs text-slate-500`,children:e.description||e.path})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(`button`,{type:`button`,disabled:d?.startsWith(`${e.id}:`)??!1,onClick:()=>void _(e),className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:e.enabled?(0,L.jsx)(is,{size:13}):(0,L.jsx)(as,{size:13})}),(0,L.jsx)(`button`,{type:`button`,disabled:d?.startsWith(`${e.id}:`)??!1,onClick:async()=>{try{let t=await Ys(e.id);c(e),u(t.markdown)}catch{c(e),u(``)}},className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:(0,L.jsx)(ns,{size:13})}),(0,L.jsx)(`button`,{type:`button`,disabled:d?.startsWith(`${e.id}:`)??!1,onClick:()=>void v(e),className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-red-500 hover:text-red-400 disabled:opacity-50`,children:(0,L.jsx)(fs,{size:13})})]})]})},e.id))}):(0,L.jsx)(T9,{message:`No user skills`}):(0,L.jsx)(T9,{})]}),r?(0,L.jsx)(O9,{title:`Create Skill`,onSave:y,onClose:()=>i(!1),busy:d===`create`}):null,a?(0,L.jsx)(zre,{onInstall:b,onClose:()=>o(!1),busy:d===`install`}):null,s?(0,L.jsx)(O9,{title:`Edit Skill`,initialName:s.name,initialDescription:s.description,initialMarkdown:void 0,onSave:e=>void x(s.id,e),onClose:()=>c(null),busy:d===`edit`}):null]})}function O9({title:e,initialName:t=``,initialDescription:n=``,initialMarkdown:r=``,onSave:i,onClose:a,busy:o}){let[s,c]=(0,I.useState)(t),[l,u]=(0,I.useState)(n),[d,f]=(0,I.useState)(r);return(0,L.jsxs)(H7,{onClose:a,children:[(0,L.jsxs)(`h2`,{className:`text-sm font-bold uppercase tracking-wider mb-3 flex items-center gap-2`,children:[(0,L.jsx)(ns,{size:16}),e]}),(0,L.jsxs)(`div`,{className:`grid gap-3`,children:[(0,L.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),placeholder:`Skill name (kebab-case)`,className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-[#11a4d4]`}),(0,L.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),placeholder:`Short description`,className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-[#11a4d4]`}),(0,L.jsx)(`textarea`,{value:d,onChange:e=>f(e.target.value),placeholder:`Markdown instructions...`,rows:10,className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-[#11a4d4] resize-vertical`}),(0,L.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:a,className:`px-3 py-2 text-sm border border-slate-700 rounded-sm hover:border-slate-500`,children:`Cancel`}),(0,L.jsx)(`button`,{type:`button`,disabled:o||!s.trim(),onClick:()=>i({name:s,description:l,markdown:d}),className:`px-3 py-2 text-sm border border-[#11a4d4] rounded-sm bg-[#11a4d4]/10 text-[#11a4d4] disabled:opacity-50`,children:o?`Saving...`:`Save`})]})]})]})}function zre({onInstall:e,onClose:t,busy:n}){let[r,i]=(0,I.useState)(``);return(0,L.jsxs)(H7,{onClose:t,children:[(0,L.jsxs)(`h2`,{className:`text-sm font-bold uppercase tracking-wider mb-3 flex items-center gap-2`,children:[(0,L.jsx)(Vo,{size:16}),`Install Skill`]}),(0,L.jsxs)(`div`,{className:`grid gap-3`,children:[(0,L.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),placeholder:`https://skills.sh/owner/skills/skill-name`,className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-[#11a4d4]`}),(0,L.jsx)(`div`,{className:`text-[11px] text-slate-500`,children:`Supports skills.sh URLs, GitHub tree URLs, or owner/repo shorthand.`}),(0,L.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:t,className:`px-3 py-2 text-sm border border-slate-700 rounded-sm hover:border-slate-500`,children:`Cancel`}),(0,L.jsx)(`button`,{type:`button`,disabled:n||!r.trim(),onClick:()=>e(r),className:`px-3 py-2 text-sm border border-[#11a4d4] rounded-sm bg-[#11a4d4]/10 text-[#11a4d4] disabled:opacity-50`,children:n?`Installing...`:`Install`})]})]})]})}function Bre({pkg:e,expanded:t,busy:n,onToggleExpanded:r,onToggleEnabled:i,onUnregister:a}){let o=e.diagnostics.some(e=>e.type===`error`);return(0,L.jsxs)(`div`,{className:`border rounded-sm ${e.enabled?`border-slate-800 bg-[#151f24]`:`border-slate-800 bg-[#151f24] opacity-75`}`,children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] gap-2 p-2`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate text-sm text-slate-200`,children:e.name}),(0,L.jsx)(`span`,{className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider ${e.enabled?`border-[#11a4d4]/60 text-[#7dd3fc]`:`border-slate-700 text-slate-500`}`,children:e.enabled?`enabled`:`disabled`}),(0,L.jsx)(`span`,{className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider ${e.installStatus===`installed`?`border-[#0bda57]/50 text-green-300`:`border-[#f59e0b]/50 text-amber-100`}`,children:e.installStatus})]}),(0,L.jsx)(`div`,{className:`truncate text-xs text-slate-500`,children:e.description??e.source}),(0,L.jsx)(`div`,{className:`font-mono text-[10px] mt-1 ${o?`text-[#f59e0b]`:`text-[#11a4d4]`}`,children:w9(e)})]}),(0,L.jsxs)(`div`,{className:`flex items-start gap-1`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:r,title:t?`Hide Details`:`Show Details`,"aria-label":t?`Hide Details`:`Show Details`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:t?(0,L.jsx)(Po,{size:13}):(0,L.jsx)(Fo,{size:13})}),(0,L.jsx)(`button`,{type:`button`,disabled:n,onClick:i,title:e.enabled?`Disable Package`:`Enable Package`,"aria-label":e.enabled?`Disable Package`:`Enable Package`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:e.enabled?(0,L.jsx)(is,{size:13}):(0,L.jsx)(as,{size:13})}),(0,L.jsx)(`button`,{type:`button`,disabled:n,onClick:a,title:`Unregister Package`,"aria-label":`Unregister Package`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-red-400 hover:text-red-300 disabled:opacity-50`,children:(0,L.jsx)(fs,{size:13})})]})]}),t?(0,L.jsx)(y9,{pkg:e}):null]})}function Vre(e){try{let t=JSON.parse(e.data);if(typeof t.type!=`string`)return;let n=e.lastEventId?yd(e.lastEventId):void 0;return{...t,...e.lastEventId?{streamFrameId:e.lastEventId}:{},...n?{streamId:n.streamId,streamFrameIndex:n.frameIndex}:{}}}catch{return}}function Hre(e){if(e.type===`RUN_FINISHED`||e.type===`TEXT_MESSAGE_END`)return 300;if(e.type===`RUN_ERROR`)return 0}function Ure(e){return e.type===`RUN_STARTED`||e.type===`RUN_FINISHED`||e.type===`RUN_ERROR`||e.type===`TEXT_MESSAGE_END`}function k9(e,t){return vd(e.streamId,e.streamFrameIndex,t)}function Wre(e,t){return t.length?t.reduce(Gre,e):e}function Gre(e,t){if(t.type===`ready`||t.streamFrameId&&e.rawEvents.some(e=>e.id===`stream:${t.streamFrameId}`))return e;let n=new Date().toISOString(),r=e.nodes;switch(t.type){case`RUN_STARTED`:r=A9(r,{id:B9(t.runId),piboSessionId:e.piboSessionId,eventId:t.runId,type:`agent.turn`,title:`Agent Turn`,status:`running`,startedAt:n,summary:t.input?.text,input:t.input,source:`live`,stableKey:`turn:${t.runId}`,orderKey:k9(t,`agent.turn`),children:[]});break;case`RUN_FINISHED`:r=P9(r,t.runId,n);break;case`RUN_ERROR`:t.runId&&(r=M9(r,B9(t.runId),e=>({...e,status:`error`,completedAt:n,error:t.message}))),r=j9(r,{id:`event:error:${t.runId??n}`,parentId:t.runId?B9(t.runId):void 0,piboSessionId:e.piboSessionId,eventId:t.runId,type:`error`,title:`Error`,status:`error`,startedAt:n,error:t.message,output:t.message,source:`live`,stableKey:`error:${t.runId??n}`,orderKey:k9(t,`error`),children:[]});break;case`TEXT_MESSAGE_START`:r=A9(r,R9(t.messageId,t.runId,e.piboSessionId,n,k9(t,`assistant.message`)));break;case`TEXT_MESSAGE_CONTENT`:r=F9(r,R9(t.messageId,t.runId,e.piboSessionId,n,k9(t,`assistant.message`)),t.delta);break;case`TEXT_MESSAGE_END`:r=j9(r,{...R9(t.messageId,t.runId,e.piboSessionId,n,k9(t,`assistant.message`)),status:`done`,completedAt:n,...t.finalText===void 0?{}:{summary:t.finalText,output:t.finalText}}),r=M9(r,B9(t.runId??t.messageId),e=>({...e,status:`done`,completedAt:n}));break;case`REASONING_MESSAGE_START`:r=A9(r,z9(t.messageId,t.runId,e.piboSessionId,n,k9(t,`model.reasoning`)));break;case`REASONING_MESSAGE_CONTENT`:r=F9(r,z9(t.messageId,t.runId,e.piboSessionId,n,k9(t,`model.reasoning`)),t.delta);break;case`REASONING_MESSAGE_END`:r=j9(r,{...z9(t.messageId,t.runId,e.piboSessionId,n,k9(t,`model.reasoning`)),status:`done`,completedAt:n,...t.finalText===void 0?{}:{summary:t.finalText,output:t.finalText}});break;case`TOOL_CALL_START`:r=A9(r,{id:V9(t.toolCallId),parentId:t.runId?B9(t.runId):void 0,piboSessionId:e.piboSessionId,eventId:t.runId,toolCallId:t.toolCallId,type:`tool.call`,title:t.toolName,status:`running`,startedAt:n,input:t.args,source:`live`,stableKey:`tool:${t.toolCallId}`,orderKey:k9(t,`tool.call`),children:[]});break;case`TOOL_CALL_ARGS`:r=M9(r,V9(t.toolCallId),e=>({...e,input:t.args}));break;case`TOOL_CALL_RESULT`:r=M9(r,V9(t.toolCallId),r=>({...Zre({...r,status:t.isError?`error`:`done`,completedAt:n,output:t.result,error:t.isError?tie(t.result):r.error},e.piboSessionId,n)}));break;case`AGENT_DELEGATION`:{let i=t.toolCallId?V9(t.toolCallId):`event:subagent:${t.childPiboSessionId}`,a=L9(r,i);if(a&&W9(a)){r=M9(r,i,r=>Xre(r,t,e.piboSessionId,n));break}r=j9(r,{id:i,piboSessionId:e.piboSessionId,toolCallId:t.toolCallId,type:`agent.delegation`,title:t.toolName,status:`running`,startedAt:n,summary:t.subagentName,input:{subagentName:t.subagentName,threadKey:t.threadKey},linkedPiboSessionId:t.childPiboSessionId,source:`live`,stableKey:t.toolCallId?`tool:${t.toolCallId}`:`subagent:${t.childPiboSessionId}`,orderKey:k9(t,`agent.delegation`),children:[]});break}case`EXECUTION_RESULT`:if(eie(t.action))break;r=j9(r,{id:`event:execution_result:${t.runId??t.action}`,piboSessionId:e.piboSessionId,eventId:t.runId,type:`execution.command`,title:t.action,status:`done`,startedAt:n,input:{action:t.action},output:t.result,source:`live`,stableKey:`execution:${t.runId??t.action}`,orderKey:k9(t,`execution.command`),children:[]});break;case`RAW_EVENT`:break}return{...e,nodes:r,rawEvents:qre(e.rawEvents,t,n)}}function A9(e,t){return L9(e,t.id)?e:j9(e,t)}function j9(e,t){if(L9(e,t.id))return M9(e,t.id,e=>({...e,...t,startedAt:e.startedAt??t.startedAt,source:e.source??t.source,stableKey:e.stableKey??t.stableKey,orderKey:e.orderKey??t.orderKey,children:t.children.length?t.children:e.children}));let n=t.parentId?L9(e,t.parentId):void 0;return n?M9(e,n.id,e=>({...e,children:I9([...e.children??[],t])})):I9([...e,t])}function M9(e,t,n){return N9(e,t,n)??e}function N9(e,t,n){for(let r=0;r<e.length;r+=1){let i=e[r];if(i.id===t){let t=n(i);if(t===i)return;let a=e.slice();return a[r]=t,a}let a=N9(i.children??[],t,n);if(a){let t=e.slice();return t[r]={...i,children:a},t}}}function P9(e,t,n){let r=B9(t),i=!1,a=e.map(e=>{let a=e.children.length?P9(e.children,t,n):e.children,o=a!==e.children,s=e.id===r||e.eventId===t||e.parentId===r;return!o&&(!s||e.status!==`running`)?e:(i=!0,{...e,...s&&e.status===`running`?{status:`done`,completedAt:n}:{},children:a})});return i?a:e}function F9(e,t,n){let r=L9(e,t.id);if(!r)return j9(e,{...t,summary:n,output:n});let i=`${typeof r.output==`string`?r.output:``}${n}`;return M9(e,r.id,e=>({...e,status:`running`,summary:i,output:i}))}function I9(e){return[...e].sort(Kre).map(e=>e.children.length?{...e,children:I9(e.children)}:e)}function Kre(e,t){let n=xd(e.orderKey,t.orderKey);return n===0?(e.startedAt??``).localeCompare(t.startedAt??``)||e.id.localeCompare(t.id):n}function L9(e,t){for(let n of e){if(n.id===t)return n;let e=L9(n.children??[],t);if(e)return e}}function R9(e,t,n,r,i){let a=t??e;return{id:Jre(e),parentId:B9(a),piboSessionId:n,eventId:a,type:`assistant.message`,title:`Agent Message`,status:`running`,startedAt:r,summary:``,output:``,source:`live`,stableKey:`assistant:${e}`,orderKey:i,children:[]}}function z9(e,t,n,r,i){let a=t??e;return{id:Yre(e),parentId:B9(a),piboSessionId:n,eventId:a,type:`model.reasoning`,title:`Thinking`,status:`running`,startedAt:r,summary:``,output:``,source:`live`,stableKey:`reasoning:${e}`,orderKey:i,children:[]}}function qre(e,t,n){return[...e.slice(-999),{id:t.streamFrameId?`stream:${t.streamFrameId}`:`stream:${n}:${e.length}`,type:t.type,createdAt:n,payload:t}]}function B9(e){return`event:message:${e}`}function Jre(e){return`event:assistant:${e}`}function Yre(e){return`event:thinking:${e}`}function V9(e){return`tool:${e}`}function Xre(e,t,n,r){let i=U9(e,n,r,{toolName:t.toolName,subagentName:t.subagentName,threadKey:t.threadKey,linkedPiboSessionId:t.childPiboSessionId});return i?H9(e,i):e}function Zre(e,t,n){let r=U9(e,t,n);return r?H9(e,r):e}function H9(e,t){return e.children.find(e=>e.id===t.id)?{...e,children:I9(e.children.map(e=>e.id===t.id?{...e,...t,runId:t.runId??e.runId,linkedPiboSessionId:t.linkedPiboSessionId??e.linkedPiboSessionId,startedAt:e.startedAt??t.startedAt,source:e.source??t.source,stableKey:e.stableKey??t.stableKey,orderKey:e.orderKey??t.orderKey,children:e.children}:e))}:{...e,children:I9([...e.children,t])}}function U9(e,t,n,r){if(!W9(e))return;let i=Qre(e.output),a=Q9(e.input)?e.input:{},o=G9(i?.toolName)||G9(a.toolName)||r?.toolName;if(!o||!o.startsWith(`pibo_subagent_`))return;let s=G9(i?.runId),c=G9(i?.status),l=r?.subagentName||o.slice(14),u=G9(i?.completionPolicy)||G9(a.completionPolicy);return{id:`${e.id}:async-agent`,parentId:e.id,piboSessionId:t,eventId:e.eventId,toolCallId:e.toolCallId,runId:s,type:`agent.async`,title:l,status:$re(e,c),startedAt:n,completedAt:c===`completed`||c===`cancelled`?e.completedAt:void 0,summary:`Started by ${e.title}`,input:{startedBy:e.title,startToolCallId:e.toolCallId,toolName:o,subagentName:l,runId:s,completionPolicy:u,arguments:a.arguments,threadKey:r?.threadKey},output:i,error:e.error,linkedPiboSessionId:r?.linkedPiboSessionId??e.linkedPiboSessionId,source:e.source,stableKey:s?`async-agent:${s}`:`${e.stableKey??e.id}:async-agent`,orderKey:bd(e.orderKey,`agent.async`),children:[]}}function W9(e){return e.type===`tool.call`&&e.title===`pibo_run_start`}function Qre(e){if(Q9(e)){if(typeof e.runId==`string`&&typeof e.toolName==`string`)return e;if(Q9(e.details)&&typeof e.details.runId==`string`&&typeof e.details.toolName==`string`)return e.details}}function G9(e){return typeof e==`string`?e:``}function $re(e,t){return e.status===`error`||t===`failed`?`error`:t===`completed`||t===`cancelled`?`done`:`running`}function eie(e){return e===`session.fork`||e===`session.clone`||e===`session.switch`}function tie(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function nie(e){let t=[];for(let n of e){let e=t[t.length-1];if(e&&oie(e,n)){e.count+=1,e.createdAt=n.createdAt,e.payload={...Q9(e.payload)?e.payload:{},text:`${X9(e.payload)}${X9(n.payload)}`};continue}t.push({...n,count:1})}return t}function K9(e,t){return e.some(e=>e.name===t||e.aliases.includes(t))}function q9(){try{let e=localStorage.getItem(L7);if(!e)return{};let t=JSON.parse(e);if(!Q9(t))return{};let n=Q9(t.sessionsByRoom)?Object.fromEntries(Object.entries(t.sessionsByRoom).filter(e=>typeof e[0]==`string`&&typeof e[1]==`string`&&!!e[1])):void 0;return{roomId:typeof t.roomId==`string`&&t.roomId?t.roomId:void 0,piboSessionId:typeof t.piboSessionId==`string`&&t.piboSessionId?t.piboSessionId:void 0,...n&&Object.keys(n).length?{sessionsByRoom:n}:{}}}catch{return{}}}function rie(e){try{let t={...q9().sessionsByRoom??{},...e.sessionsByRoom??{}};e.roomId&&e.piboSessionId&&(t[e.roomId]=e.piboSessionId),localStorage.setItem(L7,JSON.stringify({roomId:e.roomId,piboSessionId:e.piboSessionId,...Object.keys(t).length?{sessionsByRoom:t}:{}}))}catch{}}function J9(e){try{let t=q9();if(!t.sessionsByRoom?.[e])return;let{[e]:n,...r}=t.sessionsByRoom;localStorage.setItem(L7,JSON.stringify({roomId:t.roomId,piboSessionId:t.piboSessionId,...Object.keys(r).length?{sessionsByRoom:r}:{}}))}catch{}}function Y9(){try{return localStorage.getItem(R7)===`terminal`?`terminal`:_5}catch{return _5}}function iie(e){try{localStorage.setItem(R7,e)}catch{}}function aie(){try{localStorage.removeItem(L7)}catch{}}function oie(e,t){if(e.type!==t.type||e.type!==`assistant_delta`&&e.type!==`thinking_delta`&&e.type!==`TEXT_MESSAGE_CONTENT`&&e.type!==`REASONING_MESSAGE_CONTENT`)return!1;let n=Q9(e.payload)?e.payload:{},r=Q9(t.payload)?t.payload:{};return Z9(n)===Z9(r)}function X9(e){return Q9(e)?typeof e.text==`string`?e.text:typeof e.delta==`string`?e.delta:``:``}function Z9(e){return e.eventId??e.messageId}function sie(e){return!Q9(e)||!Q9(e.result)?null:e}function cie(e){if(!(!Q9(e)||!Q9(e.result)))return typeof e.result.piboSessionId==`string`?e.result.piboSessionId:void 0}function Q9(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}var lie=new Kt({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});function uie(){let e=ho({select:e=>({pathname:e.location.pathname,search:e.location.search})});return(0,L.jsx)(Yne,{route:die(e.pathname,e.search)})}function die(e,t){let n=(e.startsWith(`/apps/chat`)?e.slice(10)||`/`:e).split(`/`).filter(Boolean).map(e=>decodeURIComponent(e)),r=y5(t.view);return n[0]===`context`?{area:`context`}:n[0]===`agents`?{area:`agents`}:n[0]===`settings`?n[1]===`pi-packages`?{area:`settings`,panel:`pi-packages`}:n[1]===`skills`?{area:`settings`,panel:`skills`}:{area:`settings`,panel:`general`}:n[0]===`rooms`&&n[1]&&n[2]===`sessions`&&n[3]?{area:`sessions`,roomId:n[1],piboSessionId:n[3],sessionViewId:r}:n[0]===`rooms`&&n[1]?{area:`sessions`,roomId:n[1],sessionViewId:r}:n[0]===`sessions`&&n[1]?{area:`sessions`,piboSessionId:n[1],sessionViewId:r}:{area:`sessions`,sessionViewId:r}}var $9=Xa({component:uie}),fie=Ja({getParentRoute:()=>$9,path:`/`}),pie=Ja({getParentRoute:()=>$9,path:`sessions/$piboSessionId`}),mie=Ja({getParentRoute:()=>$9,path:`rooms/$roomId`}),hie=Ja({getParentRoute:()=>$9,path:`rooms/$roomId/sessions/$piboSessionId`}),gie=Ja({getParentRoute:()=>$9,path:`agents`}),_ie=Ja({getParentRoute:()=>$9,path:`context`}),vie=Ja({getParentRoute:()=>$9,path:`settings`}),yie=Ja({getParentRoute:()=>$9,path:`settings/pi-packages`}),bie=Ja({getParentRoute:()=>$9,path:`settings/skills`}),xie=uo({routeTree:$9.addChildren([fie,pie,mie,hie,gie,_ie,vie,yie,bie]),basepath:`/apps/chat`});(0,vs.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(I.StrictMode,{children:(0,L.jsx)(Zt,{client:lie,children:(0,L.jsx)(mo,{router:xie})})}));export{DK as i,gG as n,_G as r,pG as t};