@theobourgeois/ytdb 0.2.20 → 0.3.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 (181) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +2 -1
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/react-loadable-manifest.json +12 -1
  6. package/.next/routes-manifest.json +9 -0
  7. package/.next/server/app/[connectionId]/[schema]/[table]/page.js +1 -1
  8. package/.next/server/app/[connectionId]/[schema]/[table]/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/[connectionId]/diff/page.js +2 -2
  10. package/.next/server/app/[connectionId]/diff/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/[connectionId]/migrations/(index)/page.js +1 -1
  12. package/.next/server/app/[connectionId]/migrations/(index)/page_client-reference-manifest.js +1 -1
  13. package/.next/server/app/[connectionId]/migrations/(index)/timeline/page.js +1 -1
  14. package/.next/server/app/[connectionId]/migrations/(index)/timeline/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/[connectionId]/migrations/[setId]/diagram/page.js +1 -0
  16. package/.next/server/app/[connectionId]/migrations/[setId]/diagram/page.js.nft.json +1 -0
  17. package/.next/server/app/[connectionId]/migrations/[setId]/diagram/page_client-reference-manifest.js +1 -0
  18. package/.next/server/app/[connectionId]/migrations/[setId]/page.js +1 -1
  19. package/.next/server/app/[connectionId]/migrations/[setId]/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/[connectionId]/migrations/[setId]/schema/page.js +1 -1
  21. package/.next/server/app/[connectionId]/migrations/[setId]/schema/page_client-reference-manifest.js +1 -1
  22. package/.next/server/app/[connectionId]/migrations/[setId]/timeline/page.js +1 -1
  23. package/.next/server/app/[connectionId]/migrations/[setId]/timeline/page_client-reference-manifest.js +1 -1
  24. package/.next/server/app/[connectionId]/page.js +1 -1
  25. package/.next/server/app/[connectionId]/page_client-reference-manifest.js +1 -1
  26. package/.next/server/app/[connectionId]/query/page.js +1 -1
  27. package/.next/server/app/[connectionId]/query/page_client-reference-manifest.js +1 -1
  28. package/.next/server/app/_global-error/page.js +2 -2
  29. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  30. package/.next/server/app/_global-error.html +1 -1
  31. package/.next/server/app/_global-error.rsc +1 -1
  32. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  33. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  34. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  35. package/.next/server/app/_not-found/page.js +1 -1
  36. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  37. package/.next/server/app/_not-found.html +1 -1
  38. package/.next/server/app/_not-found.rsc +7 -7
  39. package/.next/server/app/_not-found.segments/_full.segment.rsc +7 -7
  40. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +7 -7
  41. package/.next/server/app/_not-found.segments/_tree.segment.rsc +3 -3
  42. package/.next/server/app/api/activity/route.js +2 -2
  43. package/.next/server/app/api/adopt/route.js +1 -1
  44. package/.next/server/app/api/cell/route.js +3 -3
  45. package/.next/server/app/api/definition/route.js +2 -2
  46. package/.next/server/app/api/delete-rows/route.js +1 -1
  47. package/.next/server/app/api/detect/route.js +1 -1
  48. package/.next/server/app/api/health/route.js +1 -1
  49. package/.next/server/app/api/insert-row/route.js +2 -2
  50. package/.next/server/app/api/ledger/route.js +1 -1
  51. package/.next/server/app/api/lookup/route.js +2 -2
  52. package/.next/server/app/api/migrate/route.js +1 -1
  53. package/.next/server/app/api/note/route.js +1 -1
  54. package/.next/server/app/api/query/route.js +2 -2
  55. package/.next/server/app/api/reconcile/route.js +2 -2
  56. package/.next/server/app/api/rehearse/route.js +1 -1
  57. package/.next/server/app/api/related/route.js +2 -2
  58. package/.next/server/app/api/repo/route.js +1 -1
  59. package/.next/server/app/api/rows/route.js +2 -2
  60. package/.next/server/app/api/schema/route.js +1 -1
  61. package/.next/server/app/api/tables/route.js +2 -2
  62. package/.next/server/app/api/timeline/route.js +1 -1
  63. package/.next/server/app/api/update-row/route.js +1 -1
  64. package/.next/server/app/favicon.ico/route.js +1 -1
  65. package/.next/server/app/icon.svg/route.js +1 -1
  66. package/.next/server/app/index.html +1 -1
  67. package/.next/server/app/index.rsc +8 -8
  68. package/.next/server/app/index.segments/__PAGE__.segment.rsc +8 -8
  69. package/.next/server/app/index.segments/_full.segment.rsc +8 -8
  70. package/.next/server/app/index.segments/_tree.segment.rsc +3 -3
  71. package/.next/server/app/page.js +2 -2
  72. package/.next/server/app/page_client-reference-manifest.js +1 -1
  73. package/.next/server/app-paths-manifest.json +2 -1
  74. package/.next/server/chunks/1421.js +1 -1
  75. package/.next/server/chunks/4809.js +1 -1
  76. package/.next/server/chunks/5816.js +1 -1
  77. package/.next/server/chunks/6729.js +1 -1
  78. package/.next/server/chunks/7928.js +1 -1
  79. package/.next/server/middleware-build-manifest.js +1 -1
  80. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  81. package/.next/server/middleware.js +1 -1
  82. package/.next/server/pages/404.html +1 -1
  83. package/.next/server/pages/500.html +1 -1
  84. package/.next/server/server-reference-manifest.json +1 -1
  85. package/.next/static/{XOKG1sVlYC-O8M7Qf5aWE → NB4JOC2i3ctixKpjpc7WH}/_buildManifest.js +1 -1
  86. package/.next/static/chunks/1a258343.4407cfad5d6b3688.js +1 -0
  87. package/.next/static/chunks/{223-a4fca67d979d899d.js → 223-ae41c085e76173d8.js} +1 -1
  88. package/.next/static/chunks/228-332e8b6e327f10da.js +1 -0
  89. package/.next/static/chunks/{544-9e1c454c8313699f.js → 544-624e05bf7e7a38d4.js} +1 -1
  90. package/.next/static/chunks/6090-97474bba31339e8e.js +1 -0
  91. package/.next/static/chunks/9146.9656b5ec316de71a.js +1 -0
  92. package/.next/static/chunks/91dbc596.26f4ecb79a1f7c01.js +1 -0
  93. package/.next/static/chunks/9406.9203511499c8bf43.js +1 -0
  94. package/.next/static/chunks/app/[connectionId]/migrations/(index)/page-e85d6ff71aeabe8d.js +1 -0
  95. package/.next/static/chunks/app/[connectionId]/migrations/(index)/timeline/page-e85d6ff71aeabe8d.js +1 -0
  96. package/.next/static/chunks/app/[connectionId]/migrations/[setId]/diagram/page-e85d6ff71aeabe8d.js +1 -0
  97. package/.next/static/chunks/app/[connectionId]/migrations/[setId]/layout-31e703f1a9beebf7.js +1 -0
  98. package/.next/static/chunks/app/[connectionId]/migrations/[setId]/page-e85d6ff71aeabe8d.js +1 -0
  99. package/.next/static/chunks/app/[connectionId]/migrations/[setId]/schema/page-e85d6ff71aeabe8d.js +1 -0
  100. package/.next/static/chunks/app/[connectionId]/migrations/[setId]/timeline/page-e85d6ff71aeabe8d.js +1 -0
  101. package/.next/static/chunks/app/[connectionId]/page-78a06e32a2658d3b.js +1 -0
  102. package/.next/static/chunks/app/[connectionId]/query/page-53c2d6f97a05d957.js +1 -0
  103. package/.next/static/chunks/app/_global-error/page-e85d6ff71aeabe8d.js +1 -0
  104. package/.next/static/chunks/app/api/activity/route-e85d6ff71aeabe8d.js +1 -0
  105. package/.next/static/chunks/app/api/adopt/route-e85d6ff71aeabe8d.js +1 -0
  106. package/.next/static/chunks/app/api/cell/route-e85d6ff71aeabe8d.js +1 -0
  107. package/.next/static/chunks/app/api/definition/route-e85d6ff71aeabe8d.js +1 -0
  108. package/.next/static/chunks/app/api/delete-rows/route-e85d6ff71aeabe8d.js +1 -0
  109. package/.next/static/chunks/app/api/detect/route-e85d6ff71aeabe8d.js +1 -0
  110. package/.next/static/chunks/app/api/health/route-e85d6ff71aeabe8d.js +1 -0
  111. package/.next/static/chunks/app/api/insert-row/route-e85d6ff71aeabe8d.js +1 -0
  112. package/.next/static/chunks/app/api/ledger/route-e85d6ff71aeabe8d.js +1 -0
  113. package/.next/static/chunks/app/api/lookup/route-e85d6ff71aeabe8d.js +1 -0
  114. package/.next/static/chunks/app/api/migrate/route-e85d6ff71aeabe8d.js +1 -0
  115. package/.next/static/chunks/app/api/note/route-e85d6ff71aeabe8d.js +1 -0
  116. package/.next/static/chunks/app/api/query/route-e85d6ff71aeabe8d.js +1 -0
  117. package/.next/static/chunks/app/api/reconcile/route-e85d6ff71aeabe8d.js +1 -0
  118. package/.next/static/chunks/app/api/rehearse/route-e85d6ff71aeabe8d.js +1 -0
  119. package/.next/static/chunks/app/api/related/route-e85d6ff71aeabe8d.js +1 -0
  120. package/.next/static/chunks/app/api/repo/route-e85d6ff71aeabe8d.js +1 -0
  121. package/.next/static/chunks/app/api/rows/route-e85d6ff71aeabe8d.js +1 -0
  122. package/.next/static/chunks/app/api/schema/route-e85d6ff71aeabe8d.js +1 -0
  123. package/.next/static/chunks/app/api/tables/route-e85d6ff71aeabe8d.js +1 -0
  124. package/.next/static/chunks/app/api/timeline/route-e85d6ff71aeabe8d.js +1 -0
  125. package/.next/static/chunks/app/api/update-row/route-e85d6ff71aeabe8d.js +1 -0
  126. package/.next/static/chunks/app/layout-2ed8b1f837adb32a.js +1 -0
  127. package/.next/static/chunks/next/dist/client/components/builtin/app-error-e85d6ff71aeabe8d.js +1 -0
  128. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-e85d6ff71aeabe8d.js +1 -0
  129. package/.next/static/chunks/next/dist/client/components/builtin/not-found-e85d6ff71aeabe8d.js +1 -0
  130. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-e85d6ff71aeabe8d.js +1 -0
  131. package/.next/static/chunks/webpack-6451386e3f1b2ec9.js +1 -0
  132. package/.next/static/css/0e3fe8b2c0252430.css +1 -0
  133. package/.next/static/css/{e02ab5db9ff2dca2.css → 5df9ea52964d1443.css} +1 -1
  134. package/.next/static/css/6ada1421df91d770.css +21 -0
  135. package/README.md +5 -351
  136. package/bin/ytdb.mjs +4 -9
  137. package/package.json +3 -1
  138. package/.next/static/chunks/228-e9e3a928efbebb89.js +0 -1
  139. package/.next/static/chunks/6090-6764126dba5d4d96.js +0 -1
  140. package/.next/static/chunks/app/[connectionId]/migrations/(index)/page-34cb852b3259a90b.js +0 -1
  141. package/.next/static/chunks/app/[connectionId]/migrations/(index)/timeline/page-34cb852b3259a90b.js +0 -1
  142. package/.next/static/chunks/app/[connectionId]/migrations/[setId]/layout-cdb8e5d125828828.js +0 -1
  143. package/.next/static/chunks/app/[connectionId]/migrations/[setId]/page-34cb852b3259a90b.js +0 -1
  144. package/.next/static/chunks/app/[connectionId]/migrations/[setId]/schema/page-34cb852b3259a90b.js +0 -1
  145. package/.next/static/chunks/app/[connectionId]/migrations/[setId]/timeline/page-34cb852b3259a90b.js +0 -1
  146. package/.next/static/chunks/app/[connectionId]/page-188bdfaba4f04923.js +0 -1
  147. package/.next/static/chunks/app/[connectionId]/query/page-ef40d6213057d671.js +0 -1
  148. package/.next/static/chunks/app/_global-error/page-34cb852b3259a90b.js +0 -1
  149. package/.next/static/chunks/app/api/activity/route-34cb852b3259a90b.js +0 -1
  150. package/.next/static/chunks/app/api/adopt/route-34cb852b3259a90b.js +0 -1
  151. package/.next/static/chunks/app/api/cell/route-34cb852b3259a90b.js +0 -1
  152. package/.next/static/chunks/app/api/definition/route-34cb852b3259a90b.js +0 -1
  153. package/.next/static/chunks/app/api/delete-rows/route-34cb852b3259a90b.js +0 -1
  154. package/.next/static/chunks/app/api/detect/route-34cb852b3259a90b.js +0 -1
  155. package/.next/static/chunks/app/api/health/route-34cb852b3259a90b.js +0 -1
  156. package/.next/static/chunks/app/api/insert-row/route-34cb852b3259a90b.js +0 -1
  157. package/.next/static/chunks/app/api/ledger/route-34cb852b3259a90b.js +0 -1
  158. package/.next/static/chunks/app/api/lookup/route-34cb852b3259a90b.js +0 -1
  159. package/.next/static/chunks/app/api/migrate/route-34cb852b3259a90b.js +0 -1
  160. package/.next/static/chunks/app/api/note/route-34cb852b3259a90b.js +0 -1
  161. package/.next/static/chunks/app/api/query/route-34cb852b3259a90b.js +0 -1
  162. package/.next/static/chunks/app/api/reconcile/route-34cb852b3259a90b.js +0 -1
  163. package/.next/static/chunks/app/api/rehearse/route-34cb852b3259a90b.js +0 -1
  164. package/.next/static/chunks/app/api/related/route-34cb852b3259a90b.js +0 -1
  165. package/.next/static/chunks/app/api/repo/route-34cb852b3259a90b.js +0 -1
  166. package/.next/static/chunks/app/api/rows/route-34cb852b3259a90b.js +0 -1
  167. package/.next/static/chunks/app/api/schema/route-34cb852b3259a90b.js +0 -1
  168. package/.next/static/chunks/app/api/tables/route-34cb852b3259a90b.js +0 -1
  169. package/.next/static/chunks/app/api/timeline/route-34cb852b3259a90b.js +0 -1
  170. package/.next/static/chunks/app/api/update-row/route-34cb852b3259a90b.js +0 -1
  171. package/.next/static/chunks/app/layout-e3fdecae5544dc60.js +0 -1
  172. package/.next/static/chunks/next/dist/client/components/builtin/app-error-34cb852b3259a90b.js +0 -1
  173. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-34cb852b3259a90b.js +0 -1
  174. package/.next/static/chunks/next/dist/client/components/builtin/not-found-34cb852b3259a90b.js +0 -1
  175. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-34cb852b3259a90b.js +0 -1
  176. package/.next/static/chunks/webpack-34eb118f56295776.js +0 -1
  177. package/.next/static/css/ab9c0ea2c2569929.css +0 -1
  178. package/public/screenshots/ytdb-command-palette.png +0 -0
  179. package/public/screenshots/ytdb-connection.png +0 -0
  180. package/public/screenshots/ytdb-explorer.png +0 -0
  181. /package/.next/static/{XOKG1sVlYC-O8M7Qf5aWE → NB4JOC2i3ctixKpjpc7WH}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- <!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-34eb118f56295776.js"/><script src="/_next/static/chunks/4bd1b696-8a4ab4fdf0ae305a.js" async=""></script><script src="/_next/static/chunks/3794-d7cddff008311ab3.js" async=""></script><script src="/_next/static/chunks/main-app-f73ec34e89cb8fdd.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-34eb118f56295776.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[90484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[90484,[],\"ViewportBoundary\"]\na:I[90484,[],\"MetadataBoundary\"]\nc:I[27123,[],\"default\",1]\n7:X\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$7\"]},null,false,\"$7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"XOKG1sVlYC-O8M7Qf5aWE\"}\n"])</script><script>self.__next_f.push([1,"7:C\n9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[]\n"])</script></body></html>
1
+ <!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-6451386e3f1b2ec9.js"/><script src="/_next/static/chunks/4bd1b696-8a4ab4fdf0ae305a.js" async=""></script><script src="/_next/static/chunks/3794-d7cddff008311ab3.js" async=""></script><script src="/_next/static/chunks/main-app-f73ec34e89cb8fdd.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-6451386e3f1b2ec9.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[90484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[90484,[],\"ViewportBoundary\"]\na:I[90484,[],\"MetadataBoundary\"]\nc:I[27123,[],\"default\",1]\n7:X\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$7\"]},null,false,\"$7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"NB4JOC2i3ctixKpjpc7WH\"}\n"])</script><script>self.__next_f.push([1,"7:C\n9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[]\n"])</script></body></html>
@@ -1 +1 @@
1
- {"node":{},"edge":{},"encryptionKey":"4uijSgydctt7DxP47CyAAIqrzB6CT8S/mvOWCj+3zoA="}
1
+ {"node":{},"edge":{},"encryptionKey":"u5umL6u8cwMZB3YjO28sCWMTwoIh1/Y6+pzMoKpXnfE="}
@@ -1 +1 @@
1
- self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:27,errorRate:1e-4,numBits:518,numHashes:14,bitArray:[0,1,0,1,1,0,0,0,1,1,1,1,0,1,1,1,1,0,0,1,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,0,1,0,1,1,1,0,0,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,1,1,1,0,1,1,0,1,0,0,1,1,1,0,0,0,1,0,1,1,1,0,1,0,1,1,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,0,1,0,1,0,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,1,1,0,0,1,1,0,1,1,1,0,1,1,0,1,0,0,1,1,0,1,1,0,1,1,0,0,0,0,0,0,0,1,0,1,0,0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,1,0,1,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,0,0,1,0,0,1,1,1,1,1,1,0,1,1,1,1,0,1,0,0,1,1,1,1,0,0,1,1,1,1,1,0,0,1,0,1,0,1,1,1,0,0,1,0,0,1,0,1,1,1,0,0,0,1,1,0,0,1,0,0,0,0,1,0,0,1,0,1,0,1,0,1,1,1,0,0,1,1,0,0,0,1,0,0,1,1,0,0,0,1,1,0,1,0,1,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1,0,1,1,1,0,1,1,0,0,0,0,1,0,0,1,0,0,1,1,0,1,1,0,1,0,1,0,0,0,1,1,1,1,1,1,0,0,0,1,0,1,1,1,0,1,0,0,0,1,0,0,0,0,1,1,1,0,1,1,0,0,1,1,0,0,1,1,0,1,1,1,0,1,0,1,1,1,1,0,1,1,1,1,1,0,0,0,1,0,0,1,0,1,0,0,1,0,0,1,1,0,0,0,1,1,1,1,1,0,0,1,1,0,1,1,0,0,0,1,1,0,1,0,1,0,0,1,0,1,1,1,1,1,1,0,0,1,0,0,1,0,1,1,0,0,0,1,1,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,1,0,1,1,0,1,0,0,1,0,0]},__routerFilterDynamic:{numItems:9,errorRate:1e-4,numBits:173,numHashes:14,bitArray:[0,0,1,1,0,0,1,1,0,0,1,1,0,1,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,0,1,1,1,0,1,1,0,1,1,0,1,1,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0,1,0,0,0,1,0,0,0,1,1,0,1,1,1,1,1,0,1,1,1,1,0,0,1,0,1,1]},sortedPages:["/_app"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
1
+ self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:27,errorRate:1e-4,numBits:518,numHashes:14,bitArray:[0,1,0,1,1,0,0,0,1,1,1,1,0,1,1,1,1,0,0,1,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,0,1,0,1,1,1,0,0,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,1,1,1,0,1,1,0,1,0,0,1,1,1,0,0,0,1,0,1,1,1,0,1,0,1,1,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,0,1,0,1,0,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,1,1,0,0,1,1,0,1,1,1,0,1,1,0,1,0,0,1,1,0,1,1,0,1,1,0,0,0,0,0,0,0,1,0,1,0,0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,1,1,0,0,0,1,0,1,0,1,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,0,0,1,0,0,1,1,1,1,1,1,0,1,1,1,1,0,1,0,0,1,1,1,1,0,0,1,1,1,1,1,0,0,1,0,1,0,1,1,1,0,0,1,0,0,1,0,1,1,1,0,0,0,1,1,0,0,1,0,0,0,0,1,0,0,1,0,1,0,1,0,1,1,1,0,0,1,1,0,0,0,1,0,0,1,1,0,0,0,1,1,0,1,0,1,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1,0,1,1,1,0,1,1,0,0,0,0,1,0,0,1,0,0,1,1,0,1,1,0,1,0,1,0,0,0,1,1,1,1,1,1,0,0,0,1,0,1,1,1,0,1,0,0,0,1,0,0,0,0,1,1,1,0,1,1,0,0,1,1,0,0,1,1,0,1,1,1,0,1,0,1,1,1,1,0,1,1,1,1,1,0,0,0,1,0,0,1,0,1,0,0,1,0,0,1,1,0,0,0,1,1,1,1,1,0,0,1,1,0,1,1,0,0,0,1,1,0,1,0,1,0,0,1,0,1,1,1,1,1,1,0,0,1,0,0,1,0,1,1,0,0,0,1,1,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,1,0,1,1,0,1,0,0,1,0,0]},__routerFilterDynamic:{numItems:10,errorRate:1e-4,numBits:192,numHashes:14,bitArray:[0,1,1,1,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,1,1,0,1,1,1,0,1,1,1,0,0,1,0,1,1,1,0,1,1,0,0,0,0,1,1,1,1,1,0,1,0,1,1,1,0,0,1,1,1,0,0,1,0,0,0,1,1,1,1,0,0,0,1,0,1,0,1,1,0,1,1,0,1,1,1,0,1,1,1,0,0,0,1,0,1,0,1,1,0,0,0,0,1,1,0,1,0,1,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,0,0,0,1,0,1,0,0,1,1,0,1,0,1,0,0,0,0,1,0,1,1,0,1,1,0,1,0,0,1,1,0,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,0,0,0,1,0,0,0,1,0,1,1,1,0,0,0,0,1,1,0,1]},sortedPages:["/_app"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3862],{81750:(e,t,n)=>{n.d(t,{Bu:()=>tE,Gc:()=>tw,Ln:()=>tb,VH:()=>eo,VS:()=>tA,_5:()=>r,ck:()=>tC,h7:()=>eC,tE:()=>eH});var o,r,i=n(95155),a=n(12115),l=n(69684),s=n(61278),d=n(82282),c=n(94907);n(47650);let u=(0,a.createContext)(null),g=u.Provider,f=s.xc.error001("react");function p(e,t){let n=(0,a.useContext)(u);if(null===n)throw Error(f);return(0,d.n)(n,e,t)}function h(){let e=(0,a.useContext)(u);if(null===e)throw Error(f);return(0,a.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}let m={display:"none"},y={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},S="react-flow__node-desc",b="react-flow__edge-desc",v=e=>e.ariaLiveMessage,x=e=>e.ariaLabelConfig;function w({rfId:e}){let t=p(v);return(0,i.jsx)("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:y,children:t})}function C({rfId:e,disableKeyboardA11y:t}){let n=p(x);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{id:`${S}-${e}`,style:m,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,i.jsx)("div",{id:`${b}-${e}`,style:m,children:n["edge.a11yDescription.default"]}),!t&&(0,i.jsx)(w,{rfId:e})]})}let E=(0,a.forwardRef)(({position:e="top-left",children:t,className:n,style:o,...r},a)=>{let s=`${e}`.split("-");return(0,i.jsx)("div",{className:(0,l.A)(["react-flow__panel",n,...s]),style:o,ref:a,...r,children:t})});E.displayName="Panel";let N="https://reactflow.dev?utm_source=attribution";function k({proOptions:e,position:t="bottom-right"}){return((0,a.useEffect)(()=>{},[]),e?.hideAttribution)?null:(0,i.jsx)(E,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${N}`,children:(0,i.jsx)("a",{href:N,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}let M=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},P=e=>e.id;function D(e,t){return(0,c.x)(e.selectedNodes.map(P),t.selectedNodes.map(P))&&(0,c.x)(e.selectedEdges.map(P),t.selectedEdges.map(P))}function A({onSelectionChange:e}){let t=h(),{selectedNodes:n,selectedEdges:o}=p(M,D);return(0,a.useEffect)(()=>{let r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(e=>e(r))},[n,o,e]),null}let O=e=>!!e.onSelectionChangeHandlers;function R({onSelectionChange:e}){let t=p(O);return e||t?(0,i.jsx)(A,{onSelectionChange:e}):null}let I=[0,0],j={x:0,y:0,zoom:1},_=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode","rfId"],L=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),B={translateExtent:s.ZO,nodeOrigin:I,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function $(e){let{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:l,reset:d,setDefaultNodesAndEdges:u}=p(L,c.x),g=h();(0,a.useEffect)(()=>(u(e.defaultNodes,e.defaultEdges),()=>{f.current=B,d()}),[]);let f=(0,a.useRef)(B);return(0,a.useEffect)(()=>{for(let a of _){let d=e[a];d!==f.current[a]&&void 0!==e[a]&&("nodes"===a?t(d):"edges"===a?n(d):"minZoom"===a?o(d):"maxZoom"===a?r(d):"translateExtent"===a?i(d):"nodeExtent"===a?l(d):"ariaLabelConfig"===a?g.setState({ariaLabelConfig:(0,s.Q6)(d)}):"fitView"===a?g.setState({fitViewQueued:d}):"fitViewOptions"===a?g.setState({fitViewOptions:d}):g.setState({[a]:d}))}f.current=e},_.map(t=>e[t])),null}function z(){return"u"<typeof window||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}let V="u">typeof document?document:null;function T(e=null,t={target:V,actInsideInputWithModifier:!0}){let[n,o]=(0,a.useState)(!1),r=(0,a.useRef)(!1),i=(0,a.useRef)(new Set([])),[l,d]=(0,a.useMemo)(()=>{if(null!==e){let t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.replace(/\+/g,"\n").replace("\n\n","\n+").split("\n")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return(0,a.useEffect)(()=>{let n=t?.target??V,a=t?.actInsideInputWithModifier??!0;if(null!==e){let e=e=>{if(r.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!r.current||r.current&&!a)&&(0,s.v5)(e))return!1;let n=H(e.code,d);if(i.current.add(e[n]),F(l,i.current,!1)){let n=e.composedPath?.()?.[0]||e.target,i=n?.nodeName==="BUTTON"||n?.nodeName==="A";!1!==t.preventDefault&&(r.current||!i)&&e.preventDefault(),o(!0)}},c=e=>{let t=H(e.code,d);F(l,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(e[t]),"Meta"===e.key&&i.current.clear(),r.current=!1},u=()=>{i.current.clear(),o(!1)};return n?.addEventListener("keydown",e),n?.addEventListener("keyup",c),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{n?.removeEventListener("keydown",e),n?.removeEventListener("keyup",c),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[e,o]),n}function F(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function H(e,t){return t.includes(e)?"code":"key"}function X(e,t){let n=[],o=new Map,r=[];for(let t of e)if("add"===t.type){r.push(t);continue}else if("remove"===t.type||"replace"===t.type)o.set(t.id,[t]);else{let e=o.get(t.id);e?e.push(t):o.set(t.id,[t])}for(let e of t){let t=o.get(e.id);if(!t){n.push(e);continue}if("remove"===t[0].type)continue;if("replace"===t[0].type){n.push({...t[0].item});continue}let r={...e};for(let e of t){var i=e,a=r;switch(i.type){case"select":a.selected=i.selected;break;case"position":void 0!==i.position&&(a.position=i.position),void 0!==i.dragging&&(a.dragging=i.dragging);break;case"dimensions":void 0!==i.dimensions&&(a.measured={...i.dimensions},i.setAttributes&&((!0===i.setAttributes||"width"===i.setAttributes)&&(a.width=i.dimensions.width),(!0===i.setAttributes||"height"===i.setAttributes)&&(a.height=i.dimensions.height))),"boolean"==typeof i.resizing&&(a.resizing=i.resizing)}}n.push(r)}return r.length&&r.forEach(e=>{void 0!==e.index?n.splice(e.index,0,{...e.item}):n.push({...e.item})}),n}function Z(e,t){return{id:e,type:"select",selected:t}}function K(e,t=new Set,n=!1){let o=[];for(let[r,i]of e){let e=t.has(r);(void 0!==i.selected||e)&&i.selected!==e&&(n&&(i.selected=e),o.push(Z(i.id,e)))}return o}function W({items:e=[],lookup:t}){let n=[],o=new Map(e.map(e=>[e.id,e]));for(let[o,r]of e.entries()){let e=t.get(r.id),i=e?.internals?.userNode??e;void 0!==i&&i!==r&&n.push({id:r.id,item:r,type:"replace"}),void 0===i&&n.push({item:r,type:"add",index:o})}for(let[e]of t)void 0===o.get(e)&&n.push({id:e,type:"remove"});return n}function Y(e){return{id:e.id,type:"remove"}}let Q=(0,s.kr)("React Flow","https://reactflow.dev/"),U=e=>(0,s.oB)(e);function q(e){return(0,a.forwardRef)(e)}let G="u">typeof window?a.useLayoutEffect:a.useEffect;function J(e){let[t,n]=(0,a.useState)(BigInt(0)),[o]=(0,a.useState)(()=>{var e;let t;return e=()=>n(e=>e+BigInt(1)),t=[],{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}});return G(()=>{let t=o.get();t.length&&(e(t),o.reset())},[t]),o}let ee=(0,a.createContext)(null);function et({children:e}){let t=h(),n=J((0,a.useCallback)(e=>{let{nodes:n=[],setNodes:o,hasDefaultNodes:r,onNodesChange:i,nodeLookup:a,fitViewQueued:l,onNodesChangeMiddlewareMap:s}=t.getState(),d=n;for(let t of e)d="function"==typeof t?t(d):t;let c=W({items:d,lookup:a});for(let e of s.values())c=e(c);r&&o(d),c.length>0?i?.(c):l&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:o}=t.getState();e&&o(n)})},[])),o=J((0,a.useCallback)(e=>{let{edges:n=[],setEdges:o,hasDefaultEdges:r,onEdgesChange:i,edgeLookup:a}=t.getState(),l=n;for(let t of e)l="function"==typeof t?t(l):t;r?o(l):i&&i(W({items:l,lookup:a}))},[])),r=(0,a.useMemo)(()=>({nodeQueue:n,edgeQueue:o}),[]);return(0,i.jsx)(ee.Provider,{value:r,children:e})}let en=e=>!!e.panZoom;function eo(){let e,t=(e=h(),(0,a.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return!!n&&n.scaleBy(1.2,t)},zoomOut:async t=>{let{panZoom:n}=e.getState();return!!n&&n.scaleBy(1/1.2,t)},zoomTo:async(t,n)=>{let{panZoom:o}=e.getState();return!!o&&o.scaleTo(t,n)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[o,r,i],panZoom:a}=e.getState();return!!a&&(await a.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},n),!0)},getViewport:()=>{let[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{let{width:o,height:r,minZoom:i,maxZoom:a,panZoom:l}=e.getState(),d=(0,s.R4)(t,o,r,i,a,n?.padding??.1);return!!l&&(await l.setViewport(d,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0)},screenToFlowPosition:(t,n={})=>{let{transform:o,snapGrid:r,snapToGrid:i,domNode:a}=e.getState();if(!a)return t;let{x:l,y:d}=a.getBoundingClientRect(),c={x:t.x-l,y:t.y-d},u=n.snapGrid??r,g=n.snapToGrid??i;return(0,s.Ff)(c,o,g,u)},flowToScreenPosition:t=>{let{transform:n,domNode:o}=e.getState();if(!o)return t;let{x:r,y:i}=o.getBoundingClientRect(),a=(0,s.zj)(t,n);return{x:a.x+r,y:a.y+i}}}),[])),n=h(),o=function(){let e=(0,a.useContext)(ee);if(!e)throw Error("useBatchContext must be used within a BatchProvider");return e}(),r=p(en),i=(0,a.useMemo)(()=>{let e=e=>n.getState().nodeLookup.get(e),t=e=>{o.nodeQueue.push(e)},r=e=>{o.edgeQueue.push(e)},i=e=>{let{nodeLookup:t,nodeOrigin:o}=n.getState(),r=U(e)?e:t.get(e.id),i=r.parentId?(0,s.us)(r.position,r.measured,r.parentId,t,o):r.position,a={...r,position:i,width:r.measured?.width??r.width,height:r.measured?.height??r.height};return(0,s.kM)(a)},a=(e,n,o={replace:!1})=>{t(t=>t.map(t=>{if(t.id===e){let e="function"==typeof n?n(t):n;return o.replace&&U(e)?e:{...t,...e}}return t}))},l=(e,t,n={replace:!1})=>{r(o=>o.map(o=>{if(o.id===e){let e="function"==typeof t?t(o):t;return n.replace&&(0,s.b$)(e)?e:{...o,...e}}return o}))};return{getNodes:()=>n.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=n.getState();return e.map(e=>({...e}))},getEdge:e=>n.getState().edgeLookup.get(e),setNodes:t,setEdges:r,addNodes:e=>{let t=Array.isArray(e)?e:[e];o.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];o.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:t=[],transform:o}=n.getState(),[r,i,a]=o;return{nodes:e.map(e=>({...e})),edges:t.map(e=>({...e})),viewport:{x:r,y:i,zoom:a}}},deleteElements:async({nodes:e=[],edges:t=[]})=>{let{nodes:o,edges:r,onNodesDelete:i,onEdgesDelete:a,triggerNodeChanges:l,triggerEdgeChanges:d,onDelete:c,onBeforeDelete:u}=n.getState(),{nodes:g,edges:f}=await (0,s.Tq)({nodesToRemove:e,edgesToRemove:t,nodes:o,edges:r,onBeforeDelete:u}),p=f.length>0,h=g.length>0;if(p){let e=f.map(Y);a?.(f),d(e)}if(h){let e=g.map(Y);i?.(g),l(e)}return(h||p)&&c?.({nodes:g,edges:f}),{deletedNodes:g,deletedEdges:f}},getIntersectingNodes:(e,t=!0,o)=>{let r=(0,s.mW)(e),a=r?e:i(e),l=void 0!==o;return a?(o||n.getState().nodes).filter(o=>{let i=n.getState().nodeLookup.get(o.id);if(i&&!r&&(o.id===e.id||!i.internals.positionAbsolute))return!1;let d=(0,s.kM)(l?o:i),c=(0,s.X6)(d,a);return t&&c>0||c>=d.width*d.height||c>=a.width*a.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let o=(0,s.mW)(e)?e:i(e);if(!o)return!1;let r=(0,s.X6)(o,t);return n&&r>0||r>=t.width*t.height||r>=o.width*o.height},updateNode:a,updateNodeData:(e,t,n={replace:!1})=>{a(e,e=>{let o="function"==typeof t?t(e):t;return n.replace?{...e,data:o}:{...e,data:{...e.data,...o}}},n)},updateEdge:l,updateEdgeData:(e,t,n={replace:!1})=>{l(e,e=>{let o="function"==typeof t?t(e):t;return n.replace?{...e,data:o}:{...e,data:{...e.data,...o}}},n)},getNodesBounds:e=>{let{nodeLookup:t,nodeOrigin:o}=n.getState();return(0,s.Jo)(e,{nodeLookup:t,nodeOrigin:o})},getHandleConnections:({type:e,id:t,nodeId:o})=>Array.from(n.getState().connectionLookup.get(`${o}-${e}${t?`-${t}`:""}`)?.values()??[]),getNodeConnections:({type:e,handleId:t,nodeId:o})=>Array.from(n.getState().connectionLookup.get(`${o}${e?t?`-${e}-${t}`:`-${e}`:""}`)?.values()??[]),fitView:async e=>{let t=n.getState().fitViewResolver??(0,s.YN)();return n.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:t}),o.nodeQueue.push(e=>[...e]),t.promise}}},[]);return(0,a.useMemo)(()=>({...i,...t,viewportInitialized:r}),[r])}let er=e=>e.selected,ei="u">typeof window?window:void 0,ea={position:"absolute",width:"100%",height:"100%",top:0,left:0},el=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function es({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panActivationKeyPressed:r,panOnScrollSpeed:l=.5,panOnScrollMode:d=s.ny.Free,zoomOnDoubleClick:u=!0,panOnDrag:g=!0,defaultViewport:f,translateExtent:m,minZoom:y,maxZoom:S,zoomActivationKeyCode:b,preventScrolling:v=!0,children:x,noWheelClassName:w,noPanClassName:C,onViewportChange:E,isControlledViewport:N,paneClickDistance:k,selectionOnDrag:M}){let P,D=h(),A=(0,a.useRef)(null),{userSelectionActive:O,lib:R,connectionInProgress:I}=p(el,c.x),j=T(b),_=(0,a.useRef)();P=h(),(0,a.useEffect)(()=>{let e=()=>{if(!A.current||!(A.current.checkVisibility?.()??!0))return!1;let e=(0,s.Eo)(A.current);(0===e.height||0===e.width)&&P.getState().onError?.("004",s.xc.error004()),P.setState({width:e.width||500,height:e.height||500})};if(A.current){e(),window.addEventListener("resize",e);let t=new ResizeObserver(()=>e());return t.observe(A.current),()=>{window.removeEventListener("resize",e),t&&A.current&&t.unobserve(A.current)}}},[]);let L=(0,a.useCallback)(e=>{E?.({x:e[0],y:e[1],zoom:e[2]}),N||D.setState({transform:e})},[E,N]);return(0,a.useEffect)(()=>{if(A.current){_.current=(0,s.kO)({domNode:A.current,minZoom:y,maxZoom:S,translateExtent:m,viewport:f,onDraggingChange:e=>D.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:o}=D.getState();o?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:o}=D.getState();o?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:o}=D.getState();o?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=_.current.getViewport();return D.setState({panZoom:_.current,transform:[e,t,n],domNode:A.current.closest(".react-flow")}),()=>{_.current?.destroy()}}},[]),(0,a.useEffect)(()=>{_.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panActivationKeyPressed:r,panOnScrollSpeed:l,panOnScrollMode:d,zoomOnDoubleClick:u,panOnDrag:g,zoomActivationKeyPressed:j,preventScrolling:v,noPanClassName:C,userSelectionActive:O,noWheelClassName:w,lib:R,onTransformChange:L,connectionInProgress:I,selectionOnDrag:M,paneClickDistance:k})},[e,t,n,o,r,l,d,u,g,j,v,C,O,w,R,L,I,M,k]),(0,i.jsx)("div",{className:"react-flow__renderer",ref:A,style:ea,children:x})}let ed=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ec(){let{userSelectionActive:e,userSelectionRect:t}=p(ed,c.x);return e&&t?(0,i.jsx)("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}let eu=(e,t)=>n=>{n.target===t.current&&e?.(n)},eg=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function ef({isSelecting:e,selectionKeyPressed:t,selectionMode:n=s.Qc.Full,panOnDrag:o,autoPanOnSelection:r,paneClickDistance:d,selectionOnDrag:u,onSelectionStart:g,onSelectionEnd:f,onPaneClick:m,onPaneContextMenu:y,onPaneScroll:S,onPaneMouseEnter:b,onPaneMouseMove:v,onPaneMouseLeave:x,children:w}){let C=(0,a.useRef)(0),E=h(),{userSelectionActive:N,elementsSelectable:k,dragging:M,panBy:P,autoPanSpeed:D}=p(eg,c.x),A=k&&(e||N),O=(0,a.useRef)(null),R=(0,a.useRef)(),I=(0,a.useRef)(new Set),j=(0,a.useRef)(new Set),_=(0,a.useRef)(!1),L=(0,a.useRef)(!1),B=(0,a.useRef)({x:0,y:0}),$=(0,a.useRef)(!1),z=e=>{if(L.current||_.current||E.getState().connection.inProgress){L.current=!1,_.current=!1;return}m?.(e),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})};function V(e,t){let{userSelectionRect:o}=E.getState();if(!o)return;let{transform:r,nodeLookup:i,edgeLookup:a,connectionLookup:l,triggerNodeChanges:d,triggerEdgeChanges:c,defaultEdgeOptions:u}=E.getState(),g={x:o.startX,y:o.startY},{x:f,y:p}=(0,s.zj)(g,r),h={startX:g.x,startY:g.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},m=I.current,y=j.current;I.current=new Set((0,s.U$)(i,h,r,n===s.Qc.Partial,!0).map(e=>e.id)),j.current=new Set;let S=u?.selectable??!0;for(let e of I.current){let t=l.get(e);if(t)for(let{edgeId:e}of t.values()){let t=a.get(e);t&&(t.selectable??S)&&j.current.add(e)}}(0,s._s)(m,I.current)||d(K(i,I.current,!0)),(0,s._s)(y,j.current)||c(K(a,j.current)),E.setState({userSelectionRect:h,userSelectionActive:!0,nodesSelectionActive:!1})}let T=()=>{cancelAnimationFrame(C.current),C.current=0,$.current=!1};(0,a.useEffect)(()=>()=>T(),[]);let F=!0===o||Array.isArray(o)&&o.includes(0);return(0,i.jsxs)("div",{className:(0,l.A)(["react-flow__pane",{draggable:F,dragging:M,selection:e}]),onClick:A?void 0:eu(z,O),onContextMenu:eu(e=>{Array.isArray(o)&&o?.includes(2)?e.preventDefault():y?.(e)},O),onWheel:eu(S?e=>S(e):void 0,O),onPointerEnter:A?void 0:b,onPointerMove:A?e=>{let{userSelectionRect:n,transform:o,resetSelectedElements:i}=E.getState();if(!R.current||!n)return;let{x:a,y:l}=(0,s.q1)(e.nativeEvent,R.current);B.current={x:a,y:l};let c=(0,s.zj)({x:n.startX,y:n.startY},o);if(!L.current){if(Math.hypot(a-c.x,l-c.y)<=(t?0:d))return;i(),g?.(e)}L.current=!0,$.current||(!function e(){if(!r||!R.current)return;let[t,n]=(0,s._7)(B.current,R.current,D);P({x:t,y:n}).then(t=>{if(!L.current||!t){C.current=requestAnimationFrame(e);return}let{x:n,y:o}=B.current;V(n,o),C.current=requestAnimationFrame(e)})}(),$.current=!0),V(a,l)}:v,onPointerUp:e=>{if(!A){e.target===O.current&&E.getState().connection.inProgress&&(_.current=!0);return}0===e.button&&(e.target?.releasePointerCapture?.(e.pointerId),!N&&e.target===O.current&&E.getState().userSelectionRect&&z?.(e),E.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(f?.(e),E.setState({nodesSelectionActive:I.current.size>0})),T())},onPointerCancel:A?e=>{e.target?.releasePointerCapture?.(e.pointerId),T()}:void 0,onPointerDownCapture:A?n=>{if("touch"===n.pointerType&&!1!==o&&!t)return;let{domNode:r,transform:i}=E.getState();if(R.current=r?.getBoundingClientRect(),!R.current)return;let a=n.target===O.current;if(!a&&n.target.closest(".nokey")||!e||!(u&&a||t)||0!==n.button||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),L.current=!1;let{x:l,y:d}=(0,s.q1)(n.nativeEvent,R.current),c=(0,s.Ff)({x:l,y:d},i);E.setState({userSelectionRect:{width:0,height:0,startX:c.x,startY:c.y,x:l,y:d}}),a||(n.stopPropagation(),n.preventDefault())}:void 0,onClickCapture:A?e=>{L.current&&(e.stopPropagation(),L.current=!1)}:void 0,onPointerLeave:x,ref:O,style:ea,children:[w,(0,i.jsx)(ec,{})]})}function ep({id:e,store:t,unselect:n=!1,nodeRef:o}){let{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:l,onError:d}=t.getState(),c=l.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&a)&&(i({nodes:[c],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])):d?.("012",s.xc.error012(e))}function eh({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:i,nodeClickDistance:l}){let d=h(),[c,u]=(0,a.useState)(!1),g=(0,a.useRef)();return(0,a.useEffect)(()=>{if(!t)return g.current=(0,s.I$)({getStoreItems:()=>d.getState(),onNodeMouseDown:t=>{ep({id:t,store:d,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}}),()=>{g.current?.destroy(),g.current=void 0}},[t,d,e]),(0,a.useEffect)(()=>{!t&&e.current&&g.current&&g.current.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:l})},[n,o,t,i,e,r,l]),c}function em(){let e=h();return(0,a.useCallback)(t=>{let{nodeExtent:n,snapToGrid:o,snapGrid:r,nodesDraggable:i,onError:a,updateNodePositions:l,nodeLookup:d,nodeOrigin:c}=e.getState(),u=new Map,g=e=>e.selected&&(e.draggable||i&&void 0===e.draggable),f=o?r[0]:5,p=o?r[1]:5,h=t.direction.x*f*t.factor,m=t.direction.y*p*t.factor;for(let[,e]of d){if(!g(e))continue;let t={x:e.internals.positionAbsolute.x+h,y:e.internals.positionAbsolute.y+m};o&&(t=(0,s.s_)(t,r));let{position:i,positionAbsolute:l}=(0,s.aE)({nodeId:e.id,nextPosition:t,nodeLookup:d,nodeExtent:n,nodeOrigin:c,onError:a});e.position=i,e.internals.positionAbsolute=l,u.set(e.id,e)}l(u)},[])}let ey=(0,a.createContext)(null),eS=ey.Provider;ey.Consumer;let eb=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),ev=(0,a.createContext)(null);function ex({children:e}){let t=p(eb,c.x);return(0,i.jsx)(ev.Provider,{value:t,children:e})}let ew={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},eC=(0,a.memo)(q(function({type:e="source",position:t=s.yX.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:d=!0,id:u,onConnect:g,children:f,className:m,onMouseDown:y,onTouchStart:S,...b},v){let x=u||null,w="target"===e,C=h(),E=(0,a.useContext)(ey),{connectOnClick:N,noPanClassName:k,rfId:M}=function(){let e=(0,a.useContext)(ev);if(!e)throw Error("useHandleConfig must be used within a HandleConfigProvider");return e}(),{connectingFrom:P,connectingTo:D,clickConnecting:A,isPossibleEndHandle:O,connectionInProcess:R,clickConnectionInProcess:I,valid:j}=p(t=>{let{connectionClickStartHandle:n,connectionMode:o,connection:r}=t,{fromHandle:i,toHandle:a,isValid:l}=r;if(!i&&!n)return ew;let d=a?.nodeId===E&&a?.id===x&&a?.type===e;return{connectingFrom:i?.nodeId===E&&i?.id===x&&i?.type===e,connectingTo:d,clickConnecting:n?.nodeId===E&&n?.id===x&&n?.type===e,isPossibleEndHandle:o===s.WZ.Strict?i?.type!==e:E!==i?.nodeId||x!==i?.id,connectionInProcess:!!i,clickConnectionInProcess:!!n,valid:d&&l}},c.x);E||C.getState().onError?.("010",s.xc.error010());let _=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:o}=C.getState(),r={...t,...e};if(o){let{edges:e,setEdges:t,onError:n}=C.getState();t(function(e,t,n={}){return(0,s.rN)(e,t,{...n,onError:n.onError??Q})}(r,e,{onError:n}))}n?.(r),g?.(r)},L=e=>{if(!E)return;let t=(0,s.Er)(e.nativeEvent);if(r&&(t&&0===e.button||!t)){let t=C.getState();s.aQ.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:w,handleId:x,nodeId:E,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>C.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:_,isValidConnection:n||((...e)=>C.getState().isValidConnection?.(...e)??!0),getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?y?.(e):S?.(e)};return(0,i.jsx)("div",{"data-handleid":x,"data-nodeid":E,"data-handlepos":t,"data-id":`${M}-${E}-${x}-${e}`,className:(0,l.A)(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",k,m,{source:!w,target:w,connectable:o,connectablestart:r,connectableend:d,clickconnecting:A,connectingfrom:P,connectingto:D,valid:j,connectionindicator:o&&(!R||O)&&(R||I?d:r)}]),onMouseDown:L,onTouchStart:L,onClick:N?t=>{let{onClickConnectStart:o,onClickConnectEnd:i,connectionClickStartHandle:a,connectionMode:l,isValidConnection:d,lib:c,rfId:u,nodeLookup:g,connection:f}=C.getState();if(!E||!a&&!r)return;if(!a){o?.(t.nativeEvent,{nodeId:E,handleId:x,handleType:e}),C.setState({connectionClickStartHandle:{nodeId:E,type:e,id:x}});return}let p=(0,s.oj)(t.target),h=n||d,{connection:m,isValid:y}=s.aQ.isValid(t.nativeEvent,{handle:{nodeId:E,id:x,type:e},connectionMode:l,fromNodeId:a.nodeId,fromHandleId:a.id||null,fromType:a.type,isValidConnection:h,flowId:u,doc:p,lib:c,nodeLookup:g});y&&m&&_(m);let S=structuredClone(f);delete S.inProgress,S.toPosition=S.toHandle?S.toHandle.position:null,i?.(t,S),C.setState({connectionClickStartHandle:null})}:void 0,ref:v,...b,children:f})})),eE={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},eN={input:function({data:e,isConnectable:t,sourcePosition:n=s.yX.Bottom}){return(0,i.jsxs)(i.Fragment,{children:[e?.label,(0,i.jsx)(eC,{type:"source",position:n,isConnectable:t})]})},default:function({data:e,isConnectable:t,targetPosition:n=s.yX.Top,sourcePosition:o=s.yX.Bottom}){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eC,{type:"target",position:n,isConnectable:t}),e?.label,(0,i.jsx)(eC,{type:"source",position:o,isConnectable:t})]})},output:function({data:e,isConnectable:t,targetPosition:n=s.yX.Top}){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eC,{type:"target",position:n,isConnectable:t}),e?.label]})},group:function(){return null}},ek=e=>{let{width:t,height:n,x:o,y:r}=(0,s.aZ)(e.nodeLookup,{filter:e=>!!e.selected});return{width:(0,s.kf)(t)?t:null,height:(0,s.kf)(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function eM({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let o=h(),{width:r,height:s,transformString:d,userSelectionActive:u}=p(ek,c.x),g=em(),f=(0,a.useRef)(null);(0,a.useEffect)(()=>{n||f.current?.focus({preventScroll:!0})},[n]);let m=!u&&null!==r&&null!==s;if(eh({nodeRef:f,disabled:!m}),!m)return null;let y=e?t=>{e(t,o.getState().nodes.filter(e=>e.selected))}:void 0;return(0,i.jsx)("div",{className:(0,l.A)(["react-flow__nodesselection","react-flow__container",t]),style:{transform:d},children:(0,i.jsx)("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(eE,e.key)&&(e.preventDefault(),g({direction:eE[e.key],factor:e.shiftKey?4:1}))},style:{width:r,height:s}})})}let eP="u">typeof window?window:void 0,eD=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function eA({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:l,onPaneScroll:s,paneClickDistance:d,deleteKeyCode:u,selectionKeyCode:g,selectionOnDrag:f,selectionMode:m,onSelectionStart:y,onSelectionEnd:S,multiSelectionKeyCode:b,panActivationKeyCode:v,zoomActivationKeyCode:x,elementsSelectable:w,zoomOnScroll:C,zoomOnPinch:E,panOnScroll:N,panOnScrollSpeed:k,panOnScrollMode:M,zoomOnDoubleClick:P,panOnDrag:D,autoPanOnSelection:A,defaultViewport:O,translateExtent:R,minZoom:I,maxZoom:j,preventScrolling:_,onSelectionContextMenu:L,noWheelClassName:B,noPanClassName:$,disableKeyboardA11y:z,onViewportChange:V,isControlledViewport:F}){let{nodesSelectionActive:H,userSelectionActive:X}=p(eD,c.x),Z=T(g,{target:eP}),K=T(v,{target:eP}),W=K||D,Y=K||N,Q=f&&!0!==W,U=Z||X||Q;return!function({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=h(),{deleteElements:o}=eo(),r=T(e,{actInsideInputWithModifier:!1}),i=T(t,{target:ei});(0,a.useEffect)(()=>{if(r){let{edges:e,nodes:t}=n.getState();o({nodes:t.filter(er),edges:e.filter(er)}),n.setState({nodesSelectionActive:!1})}},[r]),(0,a.useEffect)(()=>{n.setState({multiSelectionActive:i})},[i])}({deleteKeyCode:u,multiSelectionKeyCode:b}),(0,i.jsx)(es,{onPaneContextMenu:l,elementsSelectable:w,zoomOnScroll:C,zoomOnPinch:E,panOnScroll:Y,panActivationKeyPressed:K,panOnScrollSpeed:k,panOnScrollMode:M,zoomOnDoubleClick:P,panOnDrag:!Z&&W,defaultViewport:O,translateExtent:R,minZoom:I,maxZoom:j,zoomActivationKeyCode:x,preventScrolling:_,noWheelClassName:B,noPanClassName:$,onViewportChange:V,isControlledViewport:F,paneClickDistance:d,selectionOnDrag:Q,children:(0,i.jsxs)(ef,{onSelectionStart:y,onSelectionEnd:S,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:l,onPaneScroll:s,panOnDrag:W,autoPanOnSelection:A,isSelecting:!!U,selectionMode:m,selectionKeyPressed:Z,paneClickDistance:d,selectionOnDrag:Q,children:[e,H&&(0,i.jsx)(eM,{onSelectionContextMenu:L,noPanClassName:$,disableKeyboardA11y:z})]})})}eA.displayName="FlowRenderer";let eO=(0,a.memo)(eA),eR=e=>e.updateNodeInternals;var eI=(0,a.memo)(function({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:r,onContextMenu:d,onDoubleClick:u,nodesDraggable:g,elementsSelectable:f,nodesConnectable:m,nodesFocusable:y,resizeObserver:b,noDragClassName:v,noPanClassName:x,disableKeyboardA11y:w,rfId:C,nodeTypes:E,nodeClickDistance:N,onError:k}){let{node:M,internals:P,isParent:D}=p(t=>{let n=t.nodeLookup.get(e),o=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:o}},c.x),A=M.type||"default",O=E?.[A]||eN[A];void 0===O&&(k?.("003",s.xc.error003(A)),A="default",O=E?.default||eN.default);let R=!!(M.draggable||g&&void 0===M.draggable),I=!!(M.selectable||f&&void 0===M.selectable),j=!!(M.connectable||m&&void 0===M.connectable),_=!!(M.focusable||y&&void 0===M.focusable),L=h(),B=(0,s.QE)(M),$=function({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){let r=h(),i=(0,a.useRef)(null),l=(0,a.useRef)(null),s=(0,a.useRef)(e.sourcePosition),d=(0,a.useRef)(e.targetPosition),c=(0,a.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,a.useEffect)(()=>{!i.current||e.hidden||u&&l.current===i.current||(l.current&&o?.unobserve(l.current),o?.observe(i.current),l.current=i.current)},[u,e.hidden]),(0,a.useEffect)(()=>()=>{l.current&&(o?.unobserve(l.current),l.current=null)},[]),(0,a.useEffect)(()=>{if(i.current){let n=c.current!==t,o=s.current!==e.sourcePosition,a=d.current!==e.targetPosition;(n||o||a)&&(c.current=t,s.current=e.sourcePosition,d.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}({node:M,nodeType:A,hasDimensions:B,resizeObserver:b}),z=eh({nodeRef:$,disabled:M.hidden||!R,noDragClassName:v,handleSelector:M.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:N}),V=em();if(M.hidden)return null;let T=(0,s.uD)(M),F=void 0===M.internals.handleBounds?{width:M.width??M.initialWidth??M.style?.width,height:M.height??M.initialHeight??M.style?.height}:{width:M.width??M.style?.width,height:M.height??M.style?.height},H=I||R||t||n||o||r,X=n?e=>n(e,{...P.userNode}):void 0,Z=o?e=>o(e,{...P.userNode}):void 0,K=r?e=>r(e,{...P.userNode}):void 0,W=d?e=>d(e,{...P.userNode}):void 0,Y=u?e=>u(e,{...P.userNode}):void 0;return(0,i.jsx)("div",{className:(0,l.A)(["react-flow__node",`react-flow__node-${A}`,{[x]:R},M.className,{selected:M.selected,selectable:I,parent:D,draggable:R,dragging:z}]),ref:$,style:{zIndex:P.z,transform:`translate(${P.positionAbsolute.x}px,${P.positionAbsolute.y}px)`,pointerEvents:H?"all":"none",visibility:B?"visible":"hidden",...M.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:X,onMouseMove:Z,onMouseLeave:K,onContextMenu:W,onClick:n=>{let{selectNodesOnDrag:o,nodeDragThreshold:r}=L.getState();I&&(!o||!R||r>0)&&ep({id:e,store:L,nodeRef:$}),t&&t(n,{...P.userNode})},onDoubleClick:Y,onKeyDown:_?t=>{if(!(0,s.v5)(t.nativeEvent)&&!w){if(s.tn.includes(t.key)&&I)ep({id:e,store:L,unselect:"Escape"===t.key,nodeRef:$});else if(R&&M.selected&&Object.prototype.hasOwnProperty.call(eE,t.key)){t.preventDefault();let{ariaLabelConfig:e}=L.getState();L.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:t.key.replace("Arrow","").toLowerCase(),x:~~P.positionAbsolute.x,y:~~P.positionAbsolute.y})}),V({direction:eE[t.key],factor:t.shiftKey?4:1})}}}:void 0,tabIndex:_?0:void 0,onFocus:_?()=>{if(w||!$.current?.matches(":focus-visible"))return;let{transform:t,width:n,height:o,autoPanOnNodeFocus:r,setCenter:i}=L.getState();!r||(0,s.U$)(new Map([[e,M]]),{x:0,y:0,width:n,height:o},t,!0).length>0||i(M.position.x+T.width/2,M.position.y+T.height/2,{zoom:t[2]})}:void 0,role:M.ariaRole??(_?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${S}-${C}`,"aria-label":M.ariaLabel,...M.domAttributes,children:(0,i.jsx)(eS,{value:e,children:(0,i.jsx)(O,{id:e,data:M.data,type:A,positionAbsoluteX:P.positionAbsolute.x,positionAbsoluteY:P.positionAbsolute.y,selected:M.selected??!1,selectable:I,draggable:R,deletable:M.deletable??!0,isConnectable:j,sourcePosition:M.sourcePosition,targetPosition:M.targetPosition,dragging:z,dragHandle:M.dragHandle,zIndex:P.z,parentId:M.parentId,...T})})})});let ej=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function e_(e){var t;let{nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,onError:l}=p(ej,c.x),d=(t=e.onlyRenderVisibleElements,p((0,a.useCallback)(e=>t?(0,s.U$)(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(e=>e.id):Array.from(e.nodeLookup.keys()),[t]),c.x)),u=function(){let e=p(eR),[t]=(0,a.useState)(()=>"u"<typeof ResizeObserver?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute("data-id");n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,a.useEffect)(()=>()=>{t?.disconnect()},[t]),t}();return(0,i.jsx)("div",{className:"react-flow__nodes",style:ea,children:d.map(t=>(0,i.jsx)(eI,{id:t,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:u,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:l},t))})}e_.displayName="NodeRenderer";let eL=(0,a.memo)(e_),eB={[s.TG.Arrow]:({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,i.jsx)("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},[s.TG.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,i.jsx)("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})}},e$=({id:e,type:t,color:n,width:o=12.5,height:r=12.5,markerUnits:l="strokeWidth",strokeWidth:d,orient:c="auto-start-reverse"})=>{let u,g=(u=h(),(0,a.useMemo)(()=>Object.prototype.hasOwnProperty.call(eB,t)?eB[t]:(u.getState().onError?.("009",s.xc.error009(t)),null),[t]));return g?(0,i.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:c,refX:"0",refY:"0",children:(0,i.jsx)(g,{color:n,strokeWidth:d})}):null},ez=({defaultColor:e,rfId:t})=>{let n=p(e=>e.edges),o=p(e=>e.defaultEdgeOptions),r=(0,a.useMemo)(()=>(0,s.Hm)(n,{id:t,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,t,e]);return r.length?(0,i.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,i.jsx)("defs",{children:r.map(e=>(0,i.jsx)(e$,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};ez.displayName="MarkerDefinitions";var eV=(0,a.memo)(ez);function eT({x:e,y:t,label:n,labelStyle:o,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:d=[2,4],labelBgBorderRadius:c=2,children:u,className:g,...f}){let[p,h]=(0,a.useState)({x:1,y:0,width:0,height:0}),m=(0,l.A)(["react-flow__edge-textwrapper",g]),y=(0,a.useRef)(null);return((0,a.useEffect)(()=>{if(y.current){let e=y.current.getBBox();h({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n)?(0,i.jsxs)("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:m,visibility:p.width?"visible":"hidden",...f,children:[r&&(0,i.jsx)("rect",{width:p.width+2*d[0],x:-d[0],y:-d[1],height:p.height+2*d[1],className:"react-flow__edge-textbg",style:s,rx:c,ry:c}),(0,i.jsx)("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:y,style:o,children:n}),u]}):null}eT.displayName="EdgeText";let eF=(0,a.memo)(eT);function eH({path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:a,labelBgStyle:d,labelBgPadding:c,labelBgBorderRadius:u,interactionWidth:g=20,...f}){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{...f,d:e,fill:"none",className:(0,l.A)(["react-flow__edge-path",f.className])}),g?(0,i.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}):null,o&&(0,s.kf)(t)&&(0,s.kf)(n)?(0,i.jsx)(eF,{x:t,y:n,label:o,labelStyle:r,labelShowBg:a,labelBgStyle:d,labelBgPadding:c,labelBgBorderRadius:u}):null]})}function eX({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===s.yX.Left||e===s.yX.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function eZ({sourceX:e,sourceY:t,sourcePosition:n=s.yX.Bottom,targetX:o,targetY:r,targetPosition:i=s.yX.Top}){let[a,l]=eX({pos:n,x1:e,y1:t,x2:o,y2:r}),[d,c]=eX({pos:i,x1:o,y1:r,x2:e,y2:t}),[u,g,f,p]=(0,s.e_)({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:d,targetControlY:c});return[`M${e},${t} C${a},${l} ${d},${c} ${o},${r}`,u,g,f,p]}function eK(e){return(0,a.memo)(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:a,sourcePosition:l,targetPosition:s,label:d,labelStyle:c,labelShowBg:u,labelBgStyle:g,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:y,interactionWidth:S})=>{let[b,v,x]=eZ({sourceX:n,sourceY:o,sourcePosition:l,targetX:r,targetY:a,targetPosition:s}),w=e.isInternal?void 0:t;return(0,i.jsx)(eH,{id:w,path:b,labelX:v,labelY:x,label:d,labelStyle:c,labelShowBg:u,labelBgStyle:g,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:y,interactionWidth:S})})}let eW=eK({isInternal:!1}),eY=eK({isInternal:!0});function eQ(e){return(0,a.memo)(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:a,label:l,labelStyle:d,labelShowBg:c,labelBgStyle:u,labelBgPadding:g,labelBgBorderRadius:f,style:p,sourcePosition:h=s.yX.Bottom,targetPosition:m=s.yX.Top,markerEnd:y,markerStart:S,pathOptions:b,interactionWidth:v})=>{let[x,w,C]=(0,s.oN)({sourceX:n,sourceY:o,sourcePosition:h,targetX:r,targetY:a,targetPosition:m,borderRadius:b?.borderRadius,offset:b?.offset,stepPosition:b?.stepPosition}),E=e.isInternal?void 0:t;return(0,i.jsx)(eH,{id:E,path:x,labelX:w,labelY:C,label:l,labelStyle:d,labelShowBg:c,labelBgStyle:u,labelBgPadding:g,labelBgBorderRadius:f,style:p,markerEnd:y,markerStart:S,interactionWidth:v})})}eW.displayName="SimpleBezierEdge",eY.displayName="SimpleBezierEdgeInternal";let eU=eQ({isInternal:!1}),eq=eQ({isInternal:!0});function eG(e){return(0,a.memo)(({id:t,...n})=>{let o=e.isInternal?void 0:t;return(0,i.jsx)(eU,{...n,id:o,pathOptions:(0,a.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}eU.displayName="SmoothStepEdge",eq.displayName="SmoothStepEdgeInternal";let eJ=eG({isInternal:!1}),e0=eG({isInternal:!0});function e1(e){return(0,a.memo)(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:a,label:l,labelStyle:d,labelShowBg:c,labelBgStyle:u,labelBgPadding:g,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:y})=>{let[S,b,v]=(0,s.ah)({sourceX:n,sourceY:o,targetX:r,targetY:a}),x=e.isInternal?void 0:t;return(0,i.jsx)(eH,{id:x,path:S,labelX:b,labelY:v,label:l,labelStyle:d,labelShowBg:c,labelBgStyle:u,labelBgPadding:g,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:y})})}eJ.displayName="StepEdge",e0.displayName="StepEdgeInternal";let e2=e1({isInternal:!1}),e5=e1({isInternal:!0});function e4(e){return(0,a.memo)(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:a,sourcePosition:l=s.yX.Bottom,targetPosition:d=s.yX.Top,label:c,labelStyle:u,labelShowBg:g,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:m,markerEnd:y,markerStart:S,pathOptions:b,interactionWidth:v})=>{let[x,w,C]=(0,s.Fp)({sourceX:n,sourceY:o,sourcePosition:l,targetX:r,targetY:a,targetPosition:d,curvature:b?.curvature}),E=e.isInternal?void 0:t;return(0,i.jsx)(eH,{id:E,path:x,labelX:w,labelY:C,label:c,labelStyle:u,labelShowBg:g,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:m,markerEnd:y,markerStart:S,interactionWidth:v})})}e2.displayName="StraightEdge",e5.displayName="StraightEdgeInternal";let e6=e4({isInternal:!1}),e7=e4({isInternal:!0});e6.displayName="BezierEdge",e7.displayName="BezierEdgeInternal";let e8={default:e7,straight:e5,step:e0,smoothstep:eq,simplebezier:eY},e9={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},e3="react-flow__edgeupdater";function te({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:a,onMouseOut:d,type:c}){return(0,i.jsx)("circle",{onMouseDown:r,onMouseEnter:a,onMouseOut:d,className:(0,l.A)([e3,`${e3}-${c}`]),cx:e===s.yX.Left?t-o:e===s.yX.Right?t+o:t,cy:e===s.yX.Top?n-o:e===s.yX.Bottom?n+o:n,r:o,stroke:"transparent",fill:"transparent"})}function tt({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:r,targetX:a,targetY:l,sourcePosition:d,targetPosition:c,onReconnect:u,onReconnectStart:g,onReconnectEnd:f,setReconnecting:p,setUpdateHover:m}){let y=h(),S=(e,t)=>{if(0!==e.button)return;let{autoPanOnConnect:o,domNode:r,connectionMode:i,connectionRadius:a,lib:l,onConnectStart:d,cancelConnection:c,nodeLookup:h,rfId:m,panBy:S,updateConnection:b}=y.getState(),v="target"===t.type;s.aQ.onPointerDown(e.nativeEvent,{autoPanOnConnect:o,connectionMode:i,connectionRadius:a,domNode:r,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:v,edgeUpdaterType:t.type,lib:l,flowId:m,cancelConnection:c,panBy:S,isValidConnection:(...e)=>y.getState().isValidConnection?.(...e)??!0,onConnect:e=>u?.(n,e),onConnectStart:(o,r)=>{p(!0),g?.(e,n,t.type),d?.(o,r)},onConnectEnd:(...e)=>y.getState().onConnectEnd?.(...e),onReconnectEnd:(e,o)=>{p(!1),f?.(e,n,t.type,o)},updateConnection:b,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},b=()=>m(!0),v=()=>m(!1);return(0,i.jsxs)(i.Fragment,{children:[(!0===e||"source"===e)&&(0,i.jsx)(te,{position:d,centerX:o,centerY:r,radius:t,onMouseDown:e=>S(e,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),onMouseEnter:b,onMouseOut:v,type:"source"}),(!0===e||"target"===e)&&(0,i.jsx)(te,{position:c,centerX:a,centerY:l,radius:t,onMouseDown:e=>S(e,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),onMouseEnter:b,onMouseOut:v,type:"target"})]})}var tn=(0,a.memo)(function({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:r,onDoubleClick:d,onContextMenu:u,onMouseEnter:g,onMouseMove:f,onMouseLeave:m,reconnectRadius:y,onReconnect:S,onReconnectStart:v,onReconnectEnd:x,rfId:w,edgeTypes:C,noPanClassName:E,onError:N,disableKeyboardA11y:k}){let M=p(t=>t.edgeLookup.get(e)),P=p(e=>e.defaultEdgeOptions),D=(M=P?{...P,...M}:M).type||"default",A=C?.[D]||e8[D];void 0===A&&(N?.("011",s.xc.error011(D)),D="default",A=C?.default||e8.default);let O=!!(M.focusable||t&&void 0===M.focusable),R=void 0!==S&&(M.reconnectable||n&&void 0===M.reconnectable),I=!!(M.selectable||o&&void 0===M.selectable),j=(0,a.useRef)(null),[_,L]=(0,a.useState)(!1),[B,$]=(0,a.useState)(!1),z=h(),{zIndex:V=M.zIndex,sourceX:T,sourceY:F,targetX:H,targetY:X,sourcePosition:Z,targetPosition:K}=p((0,a.useCallback)(t=>{let n=t.nodeLookup.get(M.source),o=t.nodeLookup.get(M.target);if(!n||!o)return e9;let r=(0,s.b5)({id:e,sourceNode:n,targetNode:o,sourceHandle:M.sourceHandle||null,targetHandle:M.targetHandle||null,connectionMode:t.connectionMode,onError:N}),i=(0,s.qX)({selected:M.selected,zIndex:M.zIndex,sourceNode:n,targetNode:o,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...r||e9,zIndex:i}},[M.source,M.target,M.sourceHandle,M.targetHandle,M.selected,M.zIndex,N]),c.x),W=(0,a.useMemo)(()=>M.markerStart?`url('#${(0,s.aW)(M.markerStart,w)}')`:void 0,[M.markerStart,w]),Y=(0,a.useMemo)(()=>M.markerEnd?`url('#${(0,s.aW)(M.markerEnd,w)}')`:void 0,[M.markerEnd,w]);if(M.hidden||null===T||null===F||null===H||null===X)return null;let Q=d?e=>{d(e,{...M})}:void 0,U=u?e=>{u(e,{...M})}:void 0,q=g?e=>{g(e,{...M})}:void 0,G=f?e=>{f(e,{...M})}:void 0,J=m?e=>{m(e,{...M})}:void 0;return(0,i.jsx)("svg",{style:{zIndex:V},children:(0,i.jsxs)("g",{className:(0,l.A)(["react-flow__edge",`react-flow__edge-${D}`,M.className,E,{selected:M.selected,animated:M.animated,inactive:!I&&!r,updating:_,selectable:I}]),onClick:t=>{let{addSelectedEdges:n,unselectNodesAndEdges:o,multiSelectionActive:i}=z.getState();I&&(z.setState({nodesSelectionActive:!1}),M.selected&&i?(o({nodes:[],edges:[M]}),j.current?.blur()):n([e])),r&&r(t,M)},onDoubleClick:Q,onContextMenu:U,onMouseEnter:q,onMouseMove:G,onMouseLeave:J,onKeyDown:O?t=>{if(!k&&s.tn.includes(t.key)&&I){let{unselectNodesAndEdges:n,addSelectedEdges:o}=z.getState();"Escape"===t.key?(j.current?.blur(),n({edges:[M]})):o([e])}}:void 0,tabIndex:O?0:void 0,role:M.ariaRole??(O?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":null===M.ariaLabel?void 0:M.ariaLabel||`Edge from ${M.source} to ${M.target}`,"aria-describedby":O?`${b}-${w}`:void 0,ref:j,...M.domAttributes,children:[!B&&(0,i.jsx)(A,{id:e,source:M.source,target:M.target,type:M.type,selected:M.selected,animated:M.animated,selectable:I,deletable:M.deletable??!0,label:M.label,labelStyle:M.labelStyle,labelShowBg:M.labelShowBg,labelBgStyle:M.labelBgStyle,labelBgPadding:M.labelBgPadding,labelBgBorderRadius:M.labelBgBorderRadius,sourceX:T,sourceY:F,targetX:H,targetY:X,sourcePosition:Z,targetPosition:K,data:M.data,style:M.style,sourceHandleId:M.sourceHandle,targetHandleId:M.targetHandle,markerStart:W,markerEnd:Y,pathOptions:"pathOptions"in M?M.pathOptions:void 0,interactionWidth:M.interactionWidth}),R&&(0,i.jsx)(tt,{edge:M,isReconnectable:R,reconnectRadius:y,onReconnect:S,onReconnectStart:v,onReconnectEnd:x,sourceX:T,sourceY:F,targetX:H,targetY:X,sourcePosition:Z,targetPosition:K,setUpdateHover:L,setReconnecting:$})]})})});let to=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function tr({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:r,onReconnect:l,onEdgeContextMenu:d,onEdgeMouseEnter:u,onEdgeMouseMove:g,onEdgeMouseLeave:f,onEdgeClick:h,reconnectRadius:m,onEdgeDoubleClick:y,onReconnectStart:S,onReconnectEnd:b,disableKeyboardA11y:v}){let{edgesFocusable:x,edgesReconnectable:w,elementsSelectable:C,onError:E}=p(to,c.x),N=p((0,a.useCallback)(e=>{if(!t)return e.edges.map(e=>e.id);let n=[];if(e.width&&e.height)for(let t of e.edges){let o=e.nodeLookup.get(t.source),r=e.nodeLookup.get(t.target);o&&r&&(0,s.uj)({sourceNode:o,targetNode:r,width:e.width,height:e.height,transform:e.transform})&&n.push(t.id)}return n},[t]),c.x);return(0,i.jsxs)("div",{className:"react-flow__edges",children:[(0,i.jsx)(eV,{defaultColor:e,rfId:n}),N.map(e=>(0,i.jsx)(tn,{id:e,edgesFocusable:x,edgesReconnectable:w,elementsSelectable:C,noPanClassName:r,onReconnect:l,onContextMenu:d,onMouseEnter:u,onMouseMove:g,onMouseLeave:f,onClick:h,reconnectRadius:m,onDoubleClick:y,onReconnectStart:S,onReconnectEnd:b,rfId:n,onError:E,edgeTypes:o,disableKeyboardA11y:v},e))]})}tr.displayName="EdgeRenderer";let ti=(0,a.memo)(tr),ta=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function tl({children:e}){let t=h(),n=(0,a.useRef)(null),[o]=(0,a.useState)(()=>t.getState().transform);return G(()=>{let e=null,o=()=>{let o=t.getState().transform;(!e||o[0]!==e[0]||o[1]!==e[1]||o[2]!==e[2])&&(e=o,n.current&&(n.current.style.transform=ta(o)))};return o(),t.subscribe(o)},[t]),(0,i.jsx)("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:ta(o)},children:e})}let ts=e=>e.panZoom?.syncViewport;function td(e){return e.connection.inProgress?{...e.connection,to:(0,s.Ff)(e.connection.to,e.transform)}:{...e.connection}}let tc=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function tu({containerStyle:e,style:t,type:n,component:o}){let{nodesConnectable:r,width:a,height:d,isValid:u,inProgress:g}=p(tc,c.x);return a&&r&&g?(0,i.jsx)("svg",{style:e,width:a,height:d,className:"react-flow__connectionline react-flow__container",children:(0,i.jsx)("g",{className:(0,l.A)(["react-flow__connection",(0,s.HF)(u)]),children:(0,i.jsx)(tg,{style:t,type:n,CustomComponent:o,isValid:u})})}):null}let tg=({style:e,type:t=s.Do.Bezier,CustomComponent:n,isValid:o})=>{let{inProgress:r,from:a,fromNode:l,fromHandle:d,fromPosition:u,to:g,toNode:f,toHandle:h,toPosition:m,pointer:y}=p(td,c.x);if(!r)return;if(n)return(0,i.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:d,fromX:a.x,fromY:a.y,toX:g.x,toY:g.y,fromPosition:u,toPosition:m,connectionStatus:(0,s.HF)(o),toNode:f,toHandle:h,pointer:y});let S="",b={sourceX:a.x,sourceY:a.y,sourcePosition:u,targetX:g.x,targetY:g.y,targetPosition:m};switch(t){case s.Do.Bezier:[S]=(0,s.Fp)(b);break;case s.Do.SimpleBezier:[S]=eZ(b);break;case s.Do.Step:[S]=(0,s.oN)({...b,borderRadius:0});break;case s.Do.SmoothStep:[S]=(0,s.oN)(b);break;default:[S]=(0,s.ah)(b)}return(0,i.jsx)("path",{d:S,fill:"none",className:"react-flow__connection-path",style:e})};tg.displayName="ConnectionLine";let tf={};function tp(e=tf){(0,a.useRef)(e),h(),(0,a.useEffect)(()=>{},[e])}function th({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:r,onNodeDoubleClick:l,onEdgeDoubleClick:s,onNodeMouseEnter:d,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:g,onSelectionContextMenu:f,onSelectionStart:m,onSelectionEnd:y,connectionLineType:S,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:x,selectionKeyCode:w,selectionOnDrag:C,selectionMode:E,multiSelectionKeyCode:N,panActivationKeyCode:k,zoomActivationKeyCode:M,deleteKeyCode:P,onlyRenderVisibleElements:D,elementsSelectable:A,defaultViewport:O,translateExtent:R,minZoom:I,maxZoom:j,preventScrolling:_,defaultMarkerColor:L,zoomOnScroll:B,zoomOnPinch:$,panOnScroll:z,panOnScrollSpeed:V,panOnScrollMode:T,zoomOnDoubleClick:F,panOnDrag:H,autoPanOnSelection:X,onPaneClick:Z,onPaneMouseEnter:K,onPaneMouseMove:W,onPaneMouseLeave:Y,onPaneScroll:Q,onPaneContextMenu:U,paneClickDistance:q,nodeClickDistance:G,onEdgeContextMenu:J,onEdgeMouseEnter:ee,onEdgeMouseMove:et,onEdgeMouseLeave:en,reconnectRadius:er,onReconnect:ei,onReconnectStart:ea,onReconnectEnd:el,noDragClassName:es,noWheelClassName:ed,noPanClassName:ec,disableKeyboardA11y:eu,nodeExtent:eg,rfId:ef,viewport:ep,onViewportChange:eh,nodesDraggable:em}){let ey,eS,eb,ev;return tp(e),tp(t),h(),(0,a.useRef)(!1),(0,a.useEffect)(()=>{},[]),ey=eo(),eS=(0,a.useRef)(!1),(0,a.useEffect)(()=>{!eS.current&&ey.viewportInitialized&&n&&(setTimeout(()=>n(ey),1),eS.current=!0)},[n,ey.viewportInitialized]),eb=p(ts),ev=h(),(0,a.useEffect)(()=>{ep&&(eb?.(ep),ev.setState({transform:[ep.x,ep.y,ep.zoom]}))},[ep,eb]),(0,i.jsx)(eO,{onPaneClick:Z,onPaneMouseEnter:K,onPaneMouseMove:W,onPaneMouseLeave:Y,onPaneContextMenu:U,onPaneScroll:Q,paneClickDistance:q,deleteKeyCode:P,selectionKeyCode:w,selectionOnDrag:C,selectionMode:E,onSelectionStart:m,onSelectionEnd:y,multiSelectionKeyCode:N,panActivationKeyCode:k,zoomActivationKeyCode:M,elementsSelectable:A,zoomOnScroll:B,zoomOnPinch:$,zoomOnDoubleClick:F,panOnScroll:z,panOnScrollSpeed:V,panOnScrollMode:T,panOnDrag:H,autoPanOnSelection:X,defaultViewport:O,translateExtent:R,minZoom:I,maxZoom:j,onSelectionContextMenu:f,preventScrolling:_,noDragClassName:es,noWheelClassName:ed,noPanClassName:ec,disableKeyboardA11y:eu,onViewportChange:eh,isControlledViewport:!!ep,children:(0,i.jsxs)(tl,{children:[(0,i.jsx)(ti,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:ei,onReconnectStart:ea,onReconnectEnd:el,onlyRenderVisibleElements:D,onEdgeContextMenu:J,onEdgeMouseEnter:ee,onEdgeMouseMove:et,onEdgeMouseLeave:en,reconnectRadius:er,defaultMarkerColor:L,noPanClassName:ec,disableKeyboardA11y:eu,rfId:ef}),(0,i.jsx)(tu,{style:b,type:S,component:v,containerStyle:x}),(0,i.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,i.jsx)(eL,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:g,nodeClickDistance:G,onlyRenderVisibleElements:D,noPanClassName:ec,noDragClassName:es,disableKeyboardA11y:eu,nodeExtent:eg,rfId:ef,nodesDraggable:em}),(0,i.jsx)("div",{className:"react-flow__viewport-portal"})]})})}th.displayName="GraphView";let tm=(0,a.memo)(th),ty=(0,s.kr)("React Flow","https://reactflow.dev/"),tS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:a,fitViewOptions:l,minZoom:d=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:g,zIndexMode:f="basic"}={})=>{let p=new Map,h=new Map,m=new Map,y=new Map,S=o??t??[],b=n??e??[],v=u??[0,0],x=g??s.ZO;(0,s.qn)(m,y,S);let{nodesInitialized:w}=(0,s.bi)(b,p,h,{nodeOrigin:v,nodeExtent:x,zIndexMode:f}),C=[0,0,1];if(a&&r&&i){let e=(0,s.aZ)(p,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),{x:t,y:n,zoom:o}=(0,s.R4)(e,r,i,d,c,l?.padding??.1);C=[t,n,o]}return{rfId:"1",width:r??0,height:i??0,transform:C,nodes:b,nodesInitialized:w,nodeLookup:p,parentLookup:h,edges:S,edgeLookup:y,connectionLookup:m,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==n,hasDefaultEdges:void 0!==o,panZoom:null,minZoom:d,maxZoom:c,translateExtent:s.ZO,nodeExtent:x,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:s.WZ.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:l,fitViewResolver:null,connection:{...s.bK},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ty,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:s.tM,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}};function tb({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:r,initialHeight:l,initialMinZoom:c,initialMaxZoom:u,initialFitViewOptions:f,fitView:p,nodeOrigin:h,nodeExtent:m,zIndexMode:y,children:S}){let[b]=(0,a.useState)(()=>(({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:g,nodeExtent:f,zIndexMode:p})=>(0,d.h)((d,h)=>{async function m(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:o,width:r,height:i,minZoom:a,maxZoom:l}=h();t&&(await (0,s.IO)({nodes:e,width:r,height:i,panZoom:t,minZoom:a,maxZoom:l},n),o?.resolve(!0),d({fitViewResolver:null}))}return{...tS({nodes:e,edges:t,width:r,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:g,nodeExtent:f,defaultNodes:n,defaultEdges:o,zIndexMode:p}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:o,nodeExtent:r,elevateNodesOnSelect:i,fitViewQueued:a,zIndexMode:l,nodesSelectionActive:c}=h(),{nodesInitialized:u,hasSelectedNodes:g}=(0,s.bi)(e,t,n,{nodeOrigin:o,nodeExtent:r,elevateNodesOnSelect:i,checkEquality:!0,zIndexMode:l}),f=c&&g;a&&u?(m(),d({nodes:e,nodesInitialized:u,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:f})):d({nodes:e,nodesInitialized:u,nodesSelectionActive:f})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=h();(0,s.qn)(t,n,e),d({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=h();t(e),d({hasDefaultNodes:!0})}if(t){let{setEdges:e}=h();e(t),d({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:o,domNode:r,nodeOrigin:i,nodeExtent:a,debug:l,fitViewQueued:c,zIndexMode:u}=h(),{changes:g,updatedInternals:f}=(0,s.uL)(e,n,o,r,i,a,u);f&&((0,s.vS)(n,o,{nodeOrigin:i,nodeExtent:a,zIndexMode:u}),c?(m(),d({fitViewQueued:!1,fitViewOptions:void 0})):d({}),g?.length>0&&(l&&console.log("React Flow: trigger node changes",g),t?.(g)))},updateNodePositions:(e,t=!1)=>{let n=[],o=[],{nodeLookup:r,triggerNodeChanges:i,connection:a,updateConnection:l,onNodesChangeMiddlewareMap:d}=h();for(let[i,d]of e){let e=r.get(i),c=!!(e?.expandParent&&e?.parentId&&d?.position),u={id:i,type:"position",position:c?{x:Math.max(0,d.position.x),y:Math.max(0,d.position.y)}:d.position,dragging:t};if(e&&a.inProgress&&a.fromNode.id===e.id){let t=(0,s.M_)(e,a.fromHandle,s.yX.Left,!0);l({...a,from:t})}c&&e.parentId&&n.push({id:i,parentId:e.parentId,rect:{...d.internals.positionAbsolute,width:d.measured.width??0,height:d.measured.height??0}}),o.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=h(),i=(0,s.r8)(n,r,e,t);o.push(...i)}for(let e of d.values())o=e(o);i(o)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:o,hasDefaultNodes:r,debug:i}=h();e?.length&&(r&&n(X(e,o)),i&&console.log("React Flow: trigger node changes",e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:o,hasDefaultEdges:r,debug:i}=h();e?.length&&(r&&n(X(e,o)),i&&console.log("React Flow: trigger edge changes",e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:o,triggerNodeChanges:r,triggerEdgeChanges:i}=h();t?r(e.map(e=>Z(e,!0))):(r(K(o,new Set([...e]),!0)),i(K(n)))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:o,triggerNodeChanges:r,triggerEdgeChanges:i}=h();t?i(e.map(e=>Z(e,!0))):(i(K(n,new Set([...e]))),r(K(o,new Set,!0)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:o,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=h(),l=[];for(let t of e||o){if(!t.selected)continue;let e=r.get(t.id);e&&(e.selected=!1),l.push(Z(t.id,!1))}let s=[];for(let e of t||n)e.selected&&s.push(Z(e.id,!1));i(l),a(s)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=h();t?.setScaleExtent([e,n]),d({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=h();t?.setScaleExtent([n,e]),d({maxZoom:e})},setTranslateExtent:e=>{h().panZoom?.setTranslateExtent(e),d({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:o,elementsSelectable:r}=h();if(!r)return;let i=t.reduce((e,t)=>t.selected?[...e,Z(t.id,!1)]:e,[]),a=e.reduce((e,t)=>t.selected?[...e,Z(t.id,!1)]:e,[]);n(i),o(a)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:o,nodeOrigin:r,elevateNodesOnSelect:i,nodeExtent:a,zIndexMode:l}=h();(e[0][0]!==a[0][0]||e[0][1]!==a[0][1]||e[1][0]!==a[1][0]||e[1][1]!==a[1][1])&&((0,s.bi)(t,n,o,{nodeOrigin:r,nodeExtent:e,elevateNodesOnSelect:i,checkEquality:!1,zIndexMode:l}),d({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:o,panZoom:r,translateExtent:i}=h();return(0,s.No)({delta:e,panZoom:r,transform:t,translateExtent:i,width:n,height:o})},setCenter:async(e,t,n)=>{let{width:o,height:r,maxZoom:i,panZoom:a}=h();if(!a)return!1;let l=void 0!==n?.zoom?n.zoom:i;return await a.setViewport({x:o/2-e*l,y:r/2-t*l,zoom:l},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{d({connection:{...s.bK}})},updateConnection:e=>{d({connection:e})},reset:()=>d({...tS()})}},Object.is))({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:l,fitView:p,minZoom:c,maxZoom:u,fitViewOptions:f,nodeOrigin:h,nodeExtent:m,zIndexMode:y}));return(0,i.jsx)(g,{value:b,children:(0,i.jsx)(et,{children:(0,i.jsx)(ex,{children:S})})})}function tv({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:r,width:l,height:s,fitView:d,fitViewOptions:c,minZoom:g,maxZoom:f,nodeOrigin:p,nodeExtent:h,zIndexMode:m}){return(0,a.useContext)(u)?(0,i.jsx)(i.Fragment,{children:e}):(0,i.jsx)(tb,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:r,initialWidth:l,initialHeight:s,fitView:d,initialFitViewOptions:c,initialMinZoom:g,initialMaxZoom:f,nodeOrigin:p,nodeExtent:h,zIndexMode:m,children:e})}let tx={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var tw=q(function({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:d,edgeTypes:c,onNodeClick:u,onEdgeClick:g,onInit:f,onMove:p,onMoveStart:h,onMoveEnd:m,onConnect:y,onConnectStart:S,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:x,onNodeMouseEnter:w,onNodeMouseMove:E,onNodeMouseLeave:N,onNodeContextMenu:M,onNodeDoubleClick:P,onNodeDragStart:D,onNodeDrag:A,onNodeDragStop:O,onNodesDelete:_,onEdgesDelete:L,onDelete:B,onSelectionChange:V,onSelectionDragStart:T,onSelectionDrag:F,onSelectionDragStop:H,onSelectionContextMenu:X,onSelectionStart:Z,onSelectionEnd:K,onBeforeDelete:W,connectionMode:Y,connectionLineType:Q=s.Do.Bezier,connectionLineStyle:U,connectionLineComponent:q,connectionLineContainerStyle:G,deleteKeyCode:J="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:et=!1,selectionMode:en=s.Qc.Full,panActivationKeyCode:eo="Space",multiSelectionKeyCode:er=(0,s.Ue)()?"Meta":"Control",zoomActivationKeyCode:ei=(0,s.Ue)()?"Meta":"Control",snapToGrid:ea,snapGrid:el,onlyRenderVisibleElements:es=!1,selectNodesOnDrag:ed,nodesDraggable:ec,autoPanOnNodeFocus:eu,nodesConnectable:eg,nodesFocusable:ef,nodeOrigin:ep=I,edgesFocusable:eh,edgesReconnectable:em,elementsSelectable:ey=!0,defaultViewport:eS=j,minZoom:eb=.5,maxZoom:ev=2,translateExtent:ex=s.ZO,preventScrolling:ew=!0,nodeExtent:eC,defaultMarkerColor:eE="#b1b1b7",zoomOnScroll:eN=!0,zoomOnPinch:ek=!0,panOnScroll:eM=!1,panOnScrollSpeed:eP=.5,panOnScrollMode:eD=s.ny.Free,zoomOnDoubleClick:eA=!0,panOnDrag:eO=!0,onPaneClick:eR,onPaneMouseEnter:eI,onPaneMouseMove:ej,onPaneMouseLeave:e_,onPaneScroll:eL,onPaneContextMenu:eB,paneClickDistance:e$=1,nodeClickDistance:ez=0,children:eV,onReconnect:eT,onReconnectStart:eF,onReconnectEnd:eH,onEdgeContextMenu:eX,onEdgeDoubleClick:eZ,onEdgeMouseEnter:eK,onEdgeMouseMove:eW,onEdgeMouseLeave:eY,reconnectRadius:eQ=10,onNodesChange:eU,onEdgesChange:eq,noDragClassName:eG="nodrag",noWheelClassName:eJ="nowheel",noPanClassName:e0="nopan",fitView:e1,fitViewOptions:e2,connectOnClick:e5,attributionPosition:e4,proOptions:e6,defaultEdgeOptions:e7,elevateNodesOnSelect:e8=!0,elevateEdgesOnSelect:e9=!1,disableKeyboardA11y:e3=!1,autoPanOnConnect:te,autoPanOnNodeDrag:tt,autoPanOnSelection:tn=!0,autoPanSpeed:to,connectionRadius:tr,isValidConnection:ti,onError:ta,style:tl,id:ts,nodeDragThreshold:td,connectionDragThreshold:tc,viewport:tu,onViewportChange:tg,width:tf,height:tp,colorMode:th="light",debug:ty,onScroll:tS,ariaLabelConfig:tb,zIndexMode:tw="basic",...tC},tE){let tN=ts||"1",tk=function(e){let[t,n]=(0,a.useState)("system"===e?null:e);return(0,a.useEffect)(()=>{if("system"!==e)return void n(e);let t=z(),o=()=>n(t?.matches?"dark":"light");return o(),t?.addEventListener("change",o),()=>{t?.removeEventListener("change",o)}},[e]),null!==t?t:z()?.matches?"dark":"light"}(th),tM=(0,a.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),tS?.(e)},[tS]);return(0,i.jsx)("div",{"data-testid":"rf__wrapper",...tC,onScroll:tM,style:{...tl,...tx},ref:tE,className:(0,l.A)(["react-flow",r,tk]),id:ts,role:"application",children:(0,i.jsxs)(tv,{nodes:e,edges:t,width:tf,height:tp,fitView:e1,fitViewOptions:e2,minZoom:eb,maxZoom:ev,nodeOrigin:ep,nodeExtent:eC,zIndexMode:tw,children:[(0,i.jsx)($,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:y,onConnectStart:S,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:x,nodesDraggable:ec,autoPanOnNodeFocus:eu,nodesConnectable:eg,nodesFocusable:ef,edgesFocusable:eh,edgesReconnectable:em,elementsSelectable:ey,elevateNodesOnSelect:e8,elevateEdgesOnSelect:e9,minZoom:eb,maxZoom:ev,nodeExtent:eC,onNodesChange:eU,onEdgesChange:eq,snapToGrid:ea,snapGrid:el,connectionMode:Y,translateExtent:ex,connectOnClick:e5,defaultEdgeOptions:e7,fitView:e1,fitViewOptions:e2,onNodesDelete:_,onEdgesDelete:L,onDelete:B,onNodeDragStart:D,onNodeDrag:A,onNodeDragStop:O,onSelectionDrag:F,onSelectionDragStart:T,onSelectionDragStop:H,onMove:p,onMoveStart:h,onMoveEnd:m,noPanClassName:e0,nodeOrigin:ep,rfId:tN,autoPanOnConnect:te,autoPanOnNodeDrag:tt,autoPanSpeed:to,onError:ta,connectionRadius:tr,isValidConnection:ti,selectNodesOnDrag:ed,nodeDragThreshold:td,connectionDragThreshold:tc,onBeforeDelete:W,debug:ty,ariaLabelConfig:tb,zIndexMode:tw}),(0,i.jsx)(tm,{onInit:f,onNodeClick:u,onEdgeClick:g,onNodeMouseEnter:w,onNodeMouseMove:E,onNodeMouseLeave:N,onNodeContextMenu:M,onNodeDoubleClick:P,nodeTypes:d,edgeTypes:c,connectionLineType:Q,connectionLineStyle:U,connectionLineComponent:q,connectionLineContainerStyle:G,selectionKeyCode:ee,selectionOnDrag:et,selectionMode:en,deleteKeyCode:J,multiSelectionKeyCode:er,panActivationKeyCode:eo,zoomActivationKeyCode:ei,onlyRenderVisibleElements:es,defaultViewport:eS,translateExtent:ex,minZoom:eb,maxZoom:ev,preventScrolling:ew,zoomOnScroll:eN,zoomOnPinch:ek,zoomOnDoubleClick:eA,panOnScroll:eM,panOnScrollSpeed:eP,panOnScrollMode:eD,panOnDrag:eO,autoPanOnSelection:tn,onPaneClick:eR,onPaneMouseEnter:eI,onPaneMouseMove:ej,onPaneMouseLeave:e_,onPaneScroll:eL,onPaneContextMenu:eB,paneClickDistance:e$,nodeClickDistance:ez,onSelectionContextMenu:X,onSelectionStart:Z,onSelectionEnd:K,onReconnect:eT,onReconnectStart:eF,onReconnectEnd:eH,onEdgeContextMenu:eX,onEdgeDoubleClick:eZ,onEdgeMouseEnter:eK,onEdgeMouseMove:eW,onEdgeMouseLeave:eY,reconnectRadius:eQ,defaultMarkerColor:eE,noDragClassName:eG,noWheelClassName:eJ,noPanClassName:e0,rfId:tN,disableKeyboardA11y:e3,nodeExtent:eC,viewport:tu,onViewportChange:tg,nodesDraggable:ec}),(0,i.jsx)(R,{onSelectionChange:V}),eV,(0,i.jsx)(k,{proOptions:e6,position:e4}),(0,i.jsx)(C,{rfId:tN,disableKeyboardA11y:e3})]})})});function tC(e){let[t,n]=(0,a.useState)(e),o=(0,a.useCallback)(e=>n(t=>X(e,t)),[]);return[t,n,o]}function tE(e={includeHiddenNodes:!1}){return p(t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(0===t.nodeLookup.size)return!1;for(let[,{internals:e}]of t.nodeLookup)if(void 0===e.handleBounds||!(0,s.QE)(e.userNode))return!1;return!0})}function tN({dimensions:e,lineWidth:t,variant:n,className:o}){return(0,i.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:(0,l.A)(["react-flow__background-pattern",n,o])})}function tk({radius:e,className:t}){return(0,i.jsx)("circle",{cx:e,cy:e,r:e,className:(0,l.A)(["react-flow__background-pattern","dots",t])})}s.xc.error014(),(o=r||(r={})).Lines="lines",o.Dots="dots",o.Cross="cross";let tM={[r.Dots]:1,[r.Lines]:1,[r.Cross]:6},tP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function tD({id:e,variant:t=r.Dots,gap:n=20,size:o,lineWidth:s=1,offset:d=0,color:u,bgColor:g,style:f,className:h,patternClassName:m}){let y=(0,a.useRef)(null),{transform:S,patternId:b}=p(tP,c.x),v=o||tM[t],x=t===r.Dots,w=t===r.Cross,C=Array.isArray(n)?n:[n,n],E=[C[0]*S[2]||1,C[1]*S[2]||1],N=v*S[2],k=Array.isArray(d)?d:[d,d],M=w?[N,N]:E,P=[k[0]*S[2]+M[0]/2,k[1]*S[2]+M[1]/2],D=`${b}${e||""}`;return(0,i.jsxs)("svg",{className:(0,l.A)(["react-flow__background",h]),style:{...f,...ea,"--xy-background-color-props":g,"--xy-background-pattern-color-props":u},ref:y,"data-testid":"rf__background",children:[(0,i.jsx)("pattern",{id:D,x:S[0]%E[0],y:S[1]%E[1],width:E[0],height:E[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${P[0]},-${P[1]})`,children:x?(0,i.jsx)(tk,{radius:N/2,className:m}):(0,i.jsx)(tN,{dimensions:M,lineWidth:s,variant:t,className:m})}),(0,i.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}tD.displayName="Background";let tA=(0,a.memo)(tD),tO=(0,a.memo)(function({id:e,x:t,y:n,width:o,height:r,style:a,color:s,strokeColor:d,strokeWidth:c,className:u,borderRadius:g,shapeRendering:f,selected:p,onClick:h}){let{background:m,backgroundColor:y}=a||{};return(0,i.jsx)("rect",{className:(0,l.A)(["react-flow__minimap-node",{selected:p},u]),x:t,y:n,rx:g,ry:g,width:o,height:r,style:{fill:s||m||y,stroke:d,strokeWidth:c},shapeRendering:f,onClick:h?t=>h(t,e):void 0})}),tR=e=>e.nodes.map(e=>e.id),tI=e=>e instanceof Function?e:()=>e,tj=(0,a.memo)(function({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:r,nodeStrokeWidth:a,shapeRendering:l,NodeComponent:d,onClick:u}){let{node:g,x:f,y:h,width:m,height:y}=p(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let o=n.internals.userNode,{x:r,y:i}=n.internals.positionAbsolute,{width:a,height:l}=(0,s.uD)(o);return{node:o,x:r,y:i,width:a,height:l}},c.x);return g&&!g.hidden&&(0,s.QE)(g)?(0,i.jsx)(d,{x:f,y:h,width:m,height:y,style:g.style,selected:!!g.selected,className:o(g),color:t(g),borderRadius:r,strokeColor:n(g),strokeWidth:a,shapeRendering:l,onClick:u,id:g.id}):null});s.xN.Line,s.xN.Handle}}]);
@@ -1,2 +1,2 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[223],{1934:(e,t,s)=>{"use strict";s.d(t,{v:()=>o});var i=s(12115);let n=e=>{let t,s=new Set,i=(e,i)=>{let n="function"==typeof e?e(t):e;if(!Object.is(n,t)){let e=t;t=(null!=i?i:"object"!=typeof n||null===n)?n:Object.assign({},t,n),s.forEach(s=>s(t,e))}},n=()=>t,r={setState:i,getState:n,getInitialState:()=>o,subscribe:e=>(s.add(e),()=>s.delete(e))},o=t=e(i,n,r);return r},r=e=>{let t=e?n(e):n,s=e=>(function(e,t=e=>e){let s=i.useSyncExternalStore(e.subscribe,i.useCallback(()=>t(e.getState()),[e,t]),i.useCallback(()=>t(e.getInitialState()),[e,t]));return i.useDebugValue(s),s})(t,e);return Object.assign(s,t),s},o=e=>e?r(e):r},31692:(e,t,s)=>{"use strict";function i(e,t){let s;try{s=e()}catch(e){return}return{getItem:e=>{var i;let n=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),r=null!=(i=s.getItem(e))?i:null;return r instanceof Promise?r.then(n):n(r)},setItem:(e,i)=>s.setItem(e,JSON.stringify(i,null==t?void 0:t.replacer)),removeItem:e=>s.removeItem(e)}}s.d(t,{KU:()=>i,Zr:()=>r});let n=e=>t=>{try{let s=e(t);if(s instanceof Promise)return s;return{then:e=>n(e)(s),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>n(t)(e)}}},r=(e,t)=>(s,r,o)=>{let a,u={storage:i(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},h=!1,l=0,c=new Set,d=new Set,g=u.storage;if(!g)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${u.name}', the given storage is currently unavailable.`),s(...e)},r,o);let f=()=>{let e=u.partialize({...r()});return g.setItem(u.name,{state:e,version:u.version})},y=o.setState;o.setState=(e,t)=>(y(e,t),f());let p=e((...e)=>(s(...e),f()),r,o);o.getInitialState=()=>p;let m=()=>{var e,t;if(!g)return;let i=++l;h=!1,c.forEach(e=>{var t;return e(null!=(t=r())?t:p)});let o=(null==(t=u.onRehydrateStorage)?void 0:t.call(u,null!=(e=r())?e:p))||void 0;return n(g.getItem.bind(g))(u.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===u.version)return[!1,e.state];else{if(u.migrate){let t=u.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;if(i!==l)return;let[n,o]=e;if(s(a=u.merge(o,null!=(t=r())?t:p),!0),n)return f()}).then(()=>{i===l&&(null==o||o(r(),void 0),a=r(),h=!0,d.forEach(e=>e(a)))}).catch(e=>{i===l&&(null==o||o(void 0,e))})};return o.persist={setOptions:e=>{u={...u,...e},e.storage&&(g=e.storage)},clearStorage:()=>{++l,null==g||g.removeItem(u.name)},getOptions:()=>u,rehydrate:()=>m(),hasHydrated:()=>h,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(d.add(e),()=>{d.delete(e)})},u.skipHydration||m(),a||p}},34244:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_246ccd",variable:"__variable_246ccd"}},64939:e=>{e.exports={style:{fontFamily:"'Geist Mono', 'Geist Mono Fallback'",fontStyle:"normal"},className:"__className_c29908",variable:"__variable_c29908"}},73321:(e,t,s)=>{"use strict";var i=s(74645);s.o(i,"useParams")&&s.d(t,{useParams:function(){return i.useParams}}),s.o(i,"usePathname")&&s.d(t,{usePathname:function(){return i.usePathname}}),s.o(i,"useRouter")&&s.d(t,{useRouter:function(){return i.useRouter}})},92328:(e,t,s)=>{"use strict";let i;s.d(t,{hD:()=>eW,eH:()=>eD});for(var n,r,o=s(12115),a=[],u=[],h=Uint8Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,d=l.length;c<d;++c)a[c]=l[c],u[l.charCodeAt(c)]=c;function g(e){var t,s,i=function(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var s=e.indexOf("=");-1===s&&(s=t);var i=s===t?0:4-s%4;return[s,i]}(e),n=i[0],r=i[1],o=new h((n+r)*3/4-r),a=0,l=r>0?n-4:n;for(s=0;s<l;s+=4)t=u[e.charCodeAt(s)]<<18|u[e.charCodeAt(s+1)]<<12|u[e.charCodeAt(s+2)]<<6|u[e.charCodeAt(s+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=255&t;return 2===r&&(t=u[e.charCodeAt(s)]<<2|u[e.charCodeAt(s+1)]>>4,o[a++]=255&t),1===r&&(t=u[e.charCodeAt(s)]<<10|u[e.charCodeAt(s+1)]<<4|u[e.charCodeAt(s+2)]>>2,o[a++]=t>>8&255,o[a++]=255&t),o}function f(e){for(var t,s=e.length,i=s%3,n=[],r=0,o=s-i;r<o;r+=16383)n.push(function(e,t,s){for(var i,n=[],r=t;r<s;r+=3)i=(e[r]<<16&0xff0000)+(e[r+1]<<8&65280)+(255&e[r+2]),n.push(a[i>>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return n.join("")}(e,r,r+16383>o?o:r+16383));return 1===i?n.push(a[(t=e[s-1])>>2]+a[t<<4&63]+"=="):2===i&&n.push(a[(t=(e[s-2]<<8)+e[s-1])>>10]+a[t>>4&63]+a[t<<2&63]+"="),n.join("")}function y(e){if(void 0===e)return{};if(!p(e))throw Error(`The arguments to a Convex function must be an object. Received: ${e}`);return e}function p(e){let t="object"==typeof e,s=Object.getPrototypeOf(e),i=null===s||s===Object.prototype||s?.constructor?.name==="Object";return t&&i}u[45]=62,u[95]=63;let m=BigInt("-9223372036854775808"),v=BigInt("9223372036854775807"),b=BigInt("0"),S=BigInt("8"),k=BigInt("256"),w="This commit timestamp is unresolved: its value is assigned when the mutation commits. Read the document after the mutation completes to get its value.";class R{[Symbol.toPrimitive](e){if("string"===e)return this.toString();throw Error(w)}valueOf(){throw Error(w)}toJSON(){throw Error(w)}toString(){return"[unresolved commit timestamp]"}}let C=new R;function T(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}let A=DataView.prototype.setBigInt64?function(e){if(e<m||v<e)throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);let t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),f(new Uint8Array(t))}:function(e){e<b&&(e-=m+m);let t=e.toString(16);t.length%2==1&&(t="0"+t);let s=new Uint8Array(new ArrayBuffer(8)),i=0;for(let n of t.match(/.{2}/g).reverse())s.set([parseInt(n,16)],i++),e>>=S;return f(s)},q=DataView.prototype.getBigInt64?function(e){let t=g(e);if(8!==t.byteLength)throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);return new DataView(t.buffer).getBigInt64(0,!0)}:function(e){let t=g(e);if(8!==t.byteLength)throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let s=b,i=b;for(let e of t)s+=BigInt(e)*k**i,i++;return s>v&&(s+=m+m),s};function M(e){if(e.length>1024)throw Error(`Field name ${e} exceeds maximum field name length 1024.`);if(e.startsWith("$"))throw Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){let s=e.charCodeAt(t);if(s<32||s>=127)throw Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}function I(e){if(null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e)return e;if(Array.isArray(e))return e.map(e=>I(e));if("object"!=typeof e)throw Error(`Unexpected type of ${e}`);let t=Object.entries(e);if(1===t.length){let s=t[0][0];if("$bytes"===s){if("string"!=typeof e.$bytes)throw Error(`Malformed $bytes field on ${e}`);return g(e.$bytes).buffer}if("$integer"===s){if("string"!=typeof e.$integer)throw Error(`Malformed $integer field on ${e}`);return q(e.$integer)}if("$float"===s){if("string"!=typeof e.$float)throw Error(`Malformed $float field on ${e}`);let t=g(e.$float);if(8!==t.byteLength)throw Error(`Received ${t.byteLength} bytes, expected 8 for $float`);let s=new DataView(t.buffer).getFloat64(0,!0);if(!T(s))throw Error(`Float ${s} should be encoded as a number`);return s}if("$commitTs"===s){if(null!==e.$commitTs)throw Error(`Malformed $commitTs field on ${e}`);return C}if("$set"===s)throw Error("Received a Set which is no longer supported as a Convex type.");if("$map"===s)throw Error("Received a Map which is no longer supported as a Convex type.")}let s={};for(let[t,i]of Object.entries(e))M(t),s[t]=I(i);return s}function $(e){let t=JSON.stringify(e,(e,t)=>void 0===t?"undefined":"bigint"==typeof t?`${t.toString()}n`:t);if(t.length>16384){let e="[...truncated]",s=16384-e.length,i=t.codePointAt(s-1);return void 0!==i&&i>65535&&(s-=1),t.substring(0,s)+e}return t}function Q(e,t,s,i){return e?`${t}${$(s)} is not a supported Convex type (present at path ${e} in original object ${$(i)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${$(s)} is not a supported Convex type.`}function O(e){return function e(t,s,i,n){if(void 0===t){let e=i&&` (present at path ${i} in original object ${$(s)})`;throw Error(`undefined is not a valid Convex value${e}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(null===t)return t;if("bigint"==typeof t){if(t<m||v<t)throw Error(`BigInt ${t} does not fit into a 64-bit signed integer.`);return{$integer:A(t)}}if("number"==typeof t)if(!T(t))return t;else{let e=new ArrayBuffer(8);return new DataView(e).setFloat64(0,t,!0),{$float:f(new Uint8Array(e))}}if("boolean"==typeof t||"string"==typeof t)return t;if(t instanceof ArrayBuffer)return{$bytes:f(new Uint8Array(t))};if(t instanceof R)return{$commitTs:null};if(Array.isArray(t))return t.map((t,n)=>e(t,s,i+`[${n}]`,!1));if(t instanceof Set)throw Error(Q(i,"Set",[...t],s));if(t instanceof Map)throw Error(Q(i,"Map",[...t],s));if(!p(t)){let e=t?.constructor?.name;throw Error(Q(i,e?`${e} `:"",t,s))}let r={},o=Object.entries(t);for(let[t,a]of(o.sort(([e,t],[s,i])=>e===s?0:e<s?-1:1),o))void 0!==a?(M(t),r[t]=e(a,s,i+`.${t}`,!1)):n&&(M(t),r[t]=function(t,s,i){if(void 0===t)return{$undefined:null};if(void 0===s)throw Error(`Programming error. Current value is ${$(t)} but original value is undefined`);return e(t,s,i,!1)}(a,s,i+`.${t}`));return r}(e,e,"",!1)}var x=Object.defineProperty,E=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?x(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s};let P=Symbol.for("ConvexError");class V extends(r=Error,n=P,r){constructor(e){super("string"==typeof e?e:$(e)),E(this,"name","ConvexError"),E(this,"data"),E(this,n,!0),this.data=e}}let L=()=>Array.from({length:4},()=>0);L(),L();let _="1.45.0";var N=Object.defineProperty,F=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?N(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s};function B(e){switch(e){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}class U{constructor(e){F(this,"_onLogLineFuncs"),F(this,"_verbose"),this._onLogLineFuncs={},this._verbose=e.verbose}addLogLineListener(e){let t=Math.random().toString(36).substring(2,15);for(let e=0;e<10&&void 0!==this._onLogLineFuncs[t];e++)t=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[t]=e,()=>{delete this._onLogLineFuncs[t]}}logVerbose(...e){if(this._verbose)for(let t of Object.values(this._onLogLineFuncs))t("debug",`${new Date().toISOString()}`,...e)}log(...e){for(let t of Object.values(this._onLogLineFuncs))t("info",...e)}warn(...e){for(let t of Object.values(this._onLogLineFuncs))t("warn",...e)}error(...e){for(let t of Object.values(this._onLogLineFuncs))t("error",...e)}}function D(e){let t=new U(e);return t.addLogLineListener((e,...t)=>{switch(e){case"debug":console.debug(...t);break;case"info":default:console.log(...t);break;case"warn":console.warn(...t);break;case"error":console.error(...t)}}),t}function j(e,t,s,i,n){let r=B(s);if("object"==typeof n&&(n=`ConvexError ${JSON.stringify(n.errorData,null,2)}`),"info"===t){let t=n.match(/^\[.*?\] /);if(null===t)return void e.error(`[CONVEX ${r}(${i})] Could not parse console.log`);let s=n.slice(1,t[0].length-2),o=n.slice(t[0].length);e.log(`%c[CONVEX ${r}(${i})] [${s}]`,"color:rgb(0, 145, 255)",o)}else e.error(`[CONVEX ${r}(${i})] ${n}`)}function W(e,t,s){let i=B(e);return`[CONVEX ${i}(${t})] ${s.errorMessage}
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[223],{1934:(e,t,s)=>{"use strict";s.d(t,{v:()=>o});var i=s(12115);let n=e=>{let t,s=new Set,i=(e,i)=>{let n="function"==typeof e?e(t):e;if(!Object.is(n,t)){let e=t;t=(null!=i?i:"object"!=typeof n||null===n)?n:Object.assign({},t,n),s.forEach(s=>s(t,e))}},n=()=>t,r={setState:i,getState:n,getInitialState:()=>o,subscribe:e=>(s.add(e),()=>s.delete(e))},o=t=e(i,n,r);return r},r=e=>{let t=e?n(e):n,s=e=>(function(e,t=e=>e){let s=i.useSyncExternalStore(e.subscribe,i.useCallback(()=>t(e.getState()),[e,t]),i.useCallback(()=>t(e.getInitialState()),[e,t]));return i.useDebugValue(s),s})(t,e);return Object.assign(s,t),s},o=e=>e?r(e):r},31692:(e,t,s)=>{"use strict";function i(e,t){let s;try{s=e()}catch(e){return}return{getItem:e=>{var i;let n=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),r=null!=(i=s.getItem(e))?i:null;return r instanceof Promise?r.then(n):n(r)},setItem:(e,i)=>s.setItem(e,JSON.stringify(i,null==t?void 0:t.replacer)),removeItem:e=>s.removeItem(e)}}s.d(t,{KU:()=>i,Zr:()=>r});let n=e=>t=>{try{let s=e(t);if(s instanceof Promise)return s;return{then:e=>n(e)(s),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>n(t)(e)}}},r=(e,t)=>(s,r,o)=>{let a,u={storage:i(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},h=!1,l=0,c=new Set,d=new Set,g=u.storage;if(!g)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${u.name}', the given storage is currently unavailable.`),s(...e)},r,o);let f=()=>{let e=u.partialize({...r()});return g.setItem(u.name,{state:e,version:u.version})},y=o.setState;o.setState=(e,t)=>(y(e,t),f());let p=e((...e)=>(s(...e),f()),r,o);o.getInitialState=()=>p;let m=()=>{var e,t;if(!g)return;let i=++l;h=!1,c.forEach(e=>{var t;return e(null!=(t=r())?t:p)});let o=(null==(t=u.onRehydrateStorage)?void 0:t.call(u,null!=(e=r())?e:p))||void 0;return n(g.getItem.bind(g))(u.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===u.version)return[!1,e.state];else{if(u.migrate){let t=u.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;if(i!==l)return;let[n,o]=e;if(s(a=u.merge(o,null!=(t=r())?t:p),!0),n)return f()}).then(()=>{i===l&&(null==o||o(r(),void 0),a=r(),h=!0,d.forEach(e=>e(a)))}).catch(e=>{i===l&&(null==o||o(void 0,e))})};return o.persist={setOptions:e=>{u={...u,...e},e.storage&&(g=e.storage)},clearStorage:()=>{++l,null==g||g.removeItem(u.name)},getOptions:()=>u,rehydrate:()=>m(),hasHydrated:()=>h,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(d.add(e),()=>{d.delete(e)})},u.skipHydration||m(),a||p}},34244:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_8eaea4",variable:"__variable_8eaea4"}},64939:e=>{e.exports={style:{fontFamily:"'Geist Mono', 'Geist Mono Fallback'",fontStyle:"normal"},className:"__className_8c25df",variable:"__variable_8c25df"}},73321:(e,t,s)=>{"use strict";var i=s(74645);s.o(i,"useParams")&&s.d(t,{useParams:function(){return i.useParams}}),s.o(i,"usePathname")&&s.d(t,{usePathname:function(){return i.usePathname}}),s.o(i,"useRouter")&&s.d(t,{useRouter:function(){return i.useRouter}})},92328:(e,t,s)=>{"use strict";let i;s.d(t,{hD:()=>eW,eH:()=>eD});for(var n,r,o=s(12115),a=[],u=[],h=Uint8Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,d=l.length;c<d;++c)a[c]=l[c],u[l.charCodeAt(c)]=c;function g(e){var t,s,i=function(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var s=e.indexOf("=");-1===s&&(s=t);var i=s===t?0:4-s%4;return[s,i]}(e),n=i[0],r=i[1],o=new h((n+r)*3/4-r),a=0,l=r>0?n-4:n;for(s=0;s<l;s+=4)t=u[e.charCodeAt(s)]<<18|u[e.charCodeAt(s+1)]<<12|u[e.charCodeAt(s+2)]<<6|u[e.charCodeAt(s+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=255&t;return 2===r&&(t=u[e.charCodeAt(s)]<<2|u[e.charCodeAt(s+1)]>>4,o[a++]=255&t),1===r&&(t=u[e.charCodeAt(s)]<<10|u[e.charCodeAt(s+1)]<<4|u[e.charCodeAt(s+2)]>>2,o[a++]=t>>8&255,o[a++]=255&t),o}function f(e){for(var t,s=e.length,i=s%3,n=[],r=0,o=s-i;r<o;r+=16383)n.push(function(e,t,s){for(var i,n=[],r=t;r<s;r+=3)i=(e[r]<<16&0xff0000)+(e[r+1]<<8&65280)+(255&e[r+2]),n.push(a[i>>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return n.join("")}(e,r,r+16383>o?o:r+16383));return 1===i?n.push(a[(t=e[s-1])>>2]+a[t<<4&63]+"=="):2===i&&n.push(a[(t=(e[s-2]<<8)+e[s-1])>>10]+a[t>>4&63]+a[t<<2&63]+"="),n.join("")}function y(e){if(void 0===e)return{};if(!p(e))throw Error(`The arguments to a Convex function must be an object. Received: ${e}`);return e}function p(e){let t="object"==typeof e,s=Object.getPrototypeOf(e),i=null===s||s===Object.prototype||s?.constructor?.name==="Object";return t&&i}u[45]=62,u[95]=63;let m=BigInt("-9223372036854775808"),v=BigInt("9223372036854775807"),b=BigInt("0"),S=BigInt("8"),k=BigInt("256"),w="This commit timestamp is unresolved: its value is assigned when the mutation commits. Read the document after the mutation completes to get its value.";class R{[Symbol.toPrimitive](e){if("string"===e)return this.toString();throw Error(w)}valueOf(){throw Error(w)}toJSON(){throw Error(w)}toString(){return"[unresolved commit timestamp]"}}let C=new R;function T(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}let A=DataView.prototype.setBigInt64?function(e){if(e<m||v<e)throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);let t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),f(new Uint8Array(t))}:function(e){e<b&&(e-=m+m);let t=e.toString(16);t.length%2==1&&(t="0"+t);let s=new Uint8Array(new ArrayBuffer(8)),i=0;for(let n of t.match(/.{2}/g).reverse())s.set([parseInt(n,16)],i++),e>>=S;return f(s)},q=DataView.prototype.getBigInt64?function(e){let t=g(e);if(8!==t.byteLength)throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);return new DataView(t.buffer).getBigInt64(0,!0)}:function(e){let t=g(e);if(8!==t.byteLength)throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let s=b,i=b;for(let e of t)s+=BigInt(e)*k**i,i++;return s>v&&(s+=m+m),s};function M(e){if(e.length>1024)throw Error(`Field name ${e} exceeds maximum field name length 1024.`);if(e.startsWith("$"))throw Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){let s=e.charCodeAt(t);if(s<32||s>=127)throw Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}function I(e){if(null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e)return e;if(Array.isArray(e))return e.map(e=>I(e));if("object"!=typeof e)throw Error(`Unexpected type of ${e}`);let t=Object.entries(e);if(1===t.length){let s=t[0][0];if("$bytes"===s){if("string"!=typeof e.$bytes)throw Error(`Malformed $bytes field on ${e}`);return g(e.$bytes).buffer}if("$integer"===s){if("string"!=typeof e.$integer)throw Error(`Malformed $integer field on ${e}`);return q(e.$integer)}if("$float"===s){if("string"!=typeof e.$float)throw Error(`Malformed $float field on ${e}`);let t=g(e.$float);if(8!==t.byteLength)throw Error(`Received ${t.byteLength} bytes, expected 8 for $float`);let s=new DataView(t.buffer).getFloat64(0,!0);if(!T(s))throw Error(`Float ${s} should be encoded as a number`);return s}if("$commitTs"===s){if(null!==e.$commitTs)throw Error(`Malformed $commitTs field on ${e}`);return C}if("$set"===s)throw Error("Received a Set which is no longer supported as a Convex type.");if("$map"===s)throw Error("Received a Map which is no longer supported as a Convex type.")}let s={};for(let[t,i]of Object.entries(e))M(t),s[t]=I(i);return s}function $(e){let t=JSON.stringify(e,(e,t)=>void 0===t?"undefined":"bigint"==typeof t?`${t.toString()}n`:t);if(t.length>16384){let e="[...truncated]",s=16384-e.length,i=t.codePointAt(s-1);return void 0!==i&&i>65535&&(s-=1),t.substring(0,s)+e}return t}function Q(e,t,s,i){return e?`${t}${$(s)} is not a supported Convex type (present at path ${e} in original object ${$(i)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${$(s)} is not a supported Convex type.`}function O(e){return function e(t,s,i,n){if(void 0===t){let e=i&&` (present at path ${i} in original object ${$(s)})`;throw Error(`undefined is not a valid Convex value${e}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(null===t)return t;if("bigint"==typeof t){if(t<m||v<t)throw Error(`BigInt ${t} does not fit into a 64-bit signed integer.`);return{$integer:A(t)}}if("number"==typeof t)if(!T(t))return t;else{let e=new ArrayBuffer(8);return new DataView(e).setFloat64(0,t,!0),{$float:f(new Uint8Array(e))}}if("boolean"==typeof t||"string"==typeof t)return t;if(t instanceof ArrayBuffer)return{$bytes:f(new Uint8Array(t))};if(t instanceof R)return{$commitTs:null};if(Array.isArray(t))return t.map((t,n)=>e(t,s,i+`[${n}]`,!1));if(t instanceof Set)throw Error(Q(i,"Set",[...t],s));if(t instanceof Map)throw Error(Q(i,"Map",[...t],s));if(!p(t)){let e=t?.constructor?.name;throw Error(Q(i,e?`${e} `:"",t,s))}let r={},o=Object.entries(t);for(let[t,a]of(o.sort(([e,t],[s,i])=>e===s?0:e<s?-1:1),o))void 0!==a?(M(t),r[t]=e(a,s,i+`.${t}`,!1)):n&&(M(t),r[t]=function(t,s,i){if(void 0===t)return{$undefined:null};if(void 0===s)throw Error(`Programming error. Current value is ${$(t)} but original value is undefined`);return e(t,s,i,!1)}(a,s,i+`.${t}`));return r}(e,e,"",!1)}var x=Object.defineProperty,E=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?x(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s};let P=Symbol.for("ConvexError");class V extends(r=Error,n=P,r){constructor(e){super("string"==typeof e?e:$(e)),E(this,"name","ConvexError"),E(this,"data"),E(this,n,!0),this.data=e}}let L=()=>Array.from({length:4},()=>0);L(),L();let _="1.45.0";var N=Object.defineProperty,F=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?N(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s};function B(e){switch(e){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}class U{constructor(e){F(this,"_onLogLineFuncs"),F(this,"_verbose"),this._onLogLineFuncs={},this._verbose=e.verbose}addLogLineListener(e){let t=Math.random().toString(36).substring(2,15);for(let e=0;e<10&&void 0!==this._onLogLineFuncs[t];e++)t=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[t]=e,()=>{delete this._onLogLineFuncs[t]}}logVerbose(...e){if(this._verbose)for(let t of Object.values(this._onLogLineFuncs))t("debug",`${new Date().toISOString()}`,...e)}log(...e){for(let t of Object.values(this._onLogLineFuncs))t("info",...e)}warn(...e){for(let t of Object.values(this._onLogLineFuncs))t("warn",...e)}error(...e){for(let t of Object.values(this._onLogLineFuncs))t("error",...e)}}function D(e){let t=new U(e);return t.addLogLineListener((e,...t)=>{switch(e){case"debug":console.debug(...t);break;case"info":default:console.log(...t);break;case"warn":console.warn(...t);break;case"error":console.error(...t)}}),t}function j(e,t,s,i,n){let r=B(s);if("object"==typeof n&&(n=`ConvexError ${JSON.stringify(n.errorData,null,2)}`),"info"===t){let t=n.match(/^\[.*?\] /);if(null===t)return void e.error(`[CONVEX ${r}(${i})] Could not parse console.log`);let s=n.slice(1,t[0].length-2),o=n.slice(t[0].length);e.log(`%c[CONVEX ${r}(${i})] [${s}]`,"color:rgb(0, 145, 255)",o)}else e.error(`[CONVEX ${r}(${i})] ${n}`)}function W(e,t,s){let i=B(e);return`[CONVEX ${i}(${t})] ${s.errorMessage}
2
2
  Called by client`}function K(e,t){return t.data=e.errorData,t}function H(e){let t,s,i=e.split(":");return 1===i.length?(t=i[0],s="default"):(t=i.slice(0,i.length-1).join(":"),s=i[i.length-1]),t.endsWith(".js")&&(t=t.slice(0,-3)),`${t}:${s}`}function J(e,t){return JSON.stringify({udfPath:H(e),args:O(t)})}function z(e,t,s){let{initialNumItems:i,id:n}=s;return JSON.stringify({type:"paginated",udfPath:H(e),args:O(t),options:O({initialNumItems:i,id:n})})}var G=Object.defineProperty,X=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?G(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s};class Y{constructor(){X(this,"nextQueryId"),X(this,"querySetVersion"),X(this,"querySet"),X(this,"queryIdToToken"),X(this,"identityVersion"),X(this,"auth"),X(this,"outstandingQueriesOlderThanRestart"),X(this,"outstandingAuthOlderThanRestart"),X(this,"paused"),X(this,"pendingQuerySetModifications"),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return 0===this.outstandingQueriesOlderThanRestart.size&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(e,t,s,i){let n=H(e),r=J(n,t),o=this.querySet.get(r);if(void 0!==o)return o.numSubscribers+=1,{queryToken:r,modification:null,unsubscribe:()=>this.removeSubscriber(r)};{let e=this.nextQueryId++;this.querySet.set(r,{id:e,canonicalizedUdfPath:n,args:t,numSubscribers:1,journal:s,componentPath:i}),this.queryIdToToken.set(e,r);let o=this.querySetVersion,a=this.querySetVersion+1,u={type:"Add",queryId:e,udfPath:n,args:[O(t)],journal:s,componentPath:i};return this.paused?this.pendingQuerySetModifications.set(e,u):this.querySetVersion=a,{queryToken:r,modification:{type:"ModifyQuerySet",baseVersion:o,newVersion:a,modifications:[u]},unsubscribe:()=>this.removeSubscriber(r)}}}transition(e){for(let t of e.modifications)switch(t.type){case"QueryUpdated":case"QueryFailed":{this.outstandingQueriesOlderThanRestart.delete(t.queryId);let e=t.journal;if(void 0!==e){let s=this.queryIdToToken.get(t.queryId);void 0!==s&&(this.querySet.get(s).journal=e)}break}case"QueryRemoved":this.outstandingQueriesOlderThanRestart.delete(t.queryId);break;default:throw Error(`Invalid modification ${t.type}`)}}queryId(e,t){let s=J(H(e),t),i=this.querySet.get(s);return void 0!==i?i.id:null}isCurrentOrNewerAuthVersion(e){return e>=this.identityVersion}getAuth(){return this.auth}setAuth(e){this.auth={tokenType:"User",value:e};let t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:"Authenticate",baseVersion:t,...this.auth}}setAdminAuth(e,t){let s={tokenType:"Admin",value:e,impersonating:t};this.auth=s;let i=this.identityVersion;return this.paused||(this.identityVersion=i+1),{type:"Authenticate",baseVersion:i,...s}}clearAuth(){this.auth=void 0,this.markAuthCompletion();let e=this.identityVersion;return this.paused||(this.identityVersion=e+1),{type:"Authenticate",tokenType:"None",baseVersion:e}}hasAuth(){return!!this.auth}isNewAuth(e){return this.auth?.value!==e}queryPath(e){let t=this.queryIdToToken.get(e);return t?this.querySet.get(t).canonicalizedUdfPath:null}queryArgs(e){let t=this.queryIdToToken.get(e);return t?this.querySet.get(t).args:null}queryToken(e){return this.queryIdToToken.get(e)??null}queryJournal(e){return this.querySet.get(e)?.journal}restart(){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();let e=[];for(let t of this.querySet.values()){let s={type:"Add",queryId:t.id,udfPath:t.canonicalizedUdfPath,args:[O(t.args)],journal:t.journal,componentPath:t.componentPath};e.push(s),this.outstandingQueriesOlderThanRestart.add(t.id)}this.querySetVersion=1;let t={type:"ModifyQuerySet",baseVersion:0,newVersion:1,modifications:e};if(!this.auth)return this.identityVersion=0,[t,void 0];this.outstandingAuthOlderThanRestart=!0;let s={type:"Authenticate",baseVersion:0,...this.auth};return this.identityVersion=1,[t,s]}pause(){this.paused=!0}resume(){let e=this.pendingQuerySetModifications.size>0?{type:"ModifyQuerySet",baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,t=void 0!==this.auth?{type:"Authenticate",baseVersion:this.identityVersion++,...this.auth}:void 0;return this.unpause(),[e,t]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(e){let t=this.querySet.get(e);if(t.numSubscribers>1)return t.numSubscribers-=1,null;{this.querySet.delete(e),this.queryIdToToken.delete(t.id),this.outstandingQueriesOlderThanRestart.delete(t.id);let s=this.querySetVersion,i=this.querySetVersion+1,n={type:"Remove",queryId:t.id};return this.paused?this.pendingQuerySetModifications.has(t.id)?this.pendingQuerySetModifications.delete(t.id):this.pendingQuerySetModifications.set(t.id,n):this.querySetVersion=i,{type:"ModifyQuerySet",baseVersion:s,newVersion:i,modifications:[n]}}}}var Z=Object.defineProperty,ee=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?Z(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s};class et{constructor(e,t){this.logger=e,this.markConnectionStateDirty=t,ee(this,"inflightRequests"),ee(this,"requestsOlderThanRestart"),ee(this,"inflightMutationsCount",0),ee(this,"inflightActionsCount",0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(e,t){let s=new Promise(s=>{this.inflightRequests.set(e.requestId,{message:e,status:{status:t?"Requested":"NotSent",requestedAt:new Date,onResult:s}}),"Mutation"===e.type?this.inflightMutationsCount++:"Action"===e.type&&this.inflightActionsCount++});return this.markConnectionStateDirty(),s}onResponse(e){let t,s,i=this.inflightRequests.get(e.requestId);if(void 0===i||"Completed"===i.status.status)return null;let n="Mutation"===i.message.type?"mutation":"action",r=i.message.udfPath;for(let t of e.logLines)j(this.logger,"info",n,r,t);let o=i.status;if(e.success)t={success:!0,logLines:e.logLines,value:I(e.result)},s=()=>o.onResult(t);else{let i=e.result,{errorData:a}=e;j(this.logger,"error",n,r,i),t={success:!1,errorMessage:i,errorData:void 0!==a?I(a):void 0,logLines:e.logLines},s=()=>o.onResult(t)}return"ActionResponse"!==e.type&&e.success?(i.status={status:"Completed",result:t,ts:e.ts,onResolve:s},null):(s(),this.inflightRequests.delete(e.requestId),this.requestsOlderThanRestart.delete(e.requestId),"Action"===i.message.type?this.inflightActionsCount--:"Mutation"===i.message.type&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:e.requestId,result:t})}removeCompleted(e){let t=new Map;for(let[s,i]of this.inflightRequests.entries()){let n=i.status;"Completed"===n.status&&n.ts.lessThanOrEqual(e)&&(n.onResolve(),t.set(s,n.result),"Mutation"===i.message.type?this.inflightMutationsCount--:"Action"===i.message.type&&this.inflightActionsCount--,this.inflightRequests.delete(s),this.requestsOlderThanRestart.delete(s))}return t.size>0&&this.markConnectionStateDirty(),t}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());let e=[];for(let[t,s]of this.inflightRequests){if("NotSent"===s.status.status){s.status.status="Requested",e.push(s.message);continue}if("Mutation"===s.message.type)e.push(s.message);else if("Action"===s.message.type){if(this.inflightRequests.delete(t),this.requestsOlderThanRestart.delete(t),this.inflightActionsCount--,"Completed"===s.status.status)throw Error("Action should never be in 'Completed' state");s.status.onResult({success:!1,errorMessage:"Connection lost while action was in flight",logLines:[]})}}return this.markConnectionStateDirty(),e}resume(){let e=[];for(let[,t]of this.inflightRequests)if("NotSent"===t.status.status){t.status.status="Requested",e.push(t.message);continue}return e}hasIncompleteRequests(){for(let e of this.inflightRequests.values())if("Requested"===e.status.status)return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return 0===this.requestsOlderThanRestart.size}timeOfOldestInflightRequest(){if(0===this.inflightRequests.size)return null;let e=Date.now();for(let t of this.inflightRequests.values())"Completed"!==t.status.status&&t.status.requestedAt.getTime()<e&&(e=t.status.requestedAt.getTime());return new Date(e)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}}let es=Symbol.for("functionName"),ei=Symbol.for("toReferencePath");function en(e){let t=function(e){let t;if("string"==typeof e)t=e.startsWith("function://")?{functionHandle:e}:{name:e};else if(e[es])t={name:e[es]};else{let s=e[ei]??null;if(!s)throw Error(`${e} is not a functionReference`);t={reference:s}}return t}(e);if(void 0===t.name){if(void 0!==t.functionHandle)throw Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`);if(void 0!==t.reference)throw Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`);throw Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`)}if("string"==typeof e)return e;let s=e[es];if(!s)throw Error(`${e} is not a functionReference`);return s}!function e(t=[]){return new Proxy({},{get(s,i){if("string"==typeof i)return e([...t,i]);if(i===es){if(t.length<2){let e=["api",...t].join(".");throw Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${e}\``)}let e=t.slice(0,-1).join("/"),s=t[t.length-1];return"default"===s?e:e+":"+s}return i===Symbol.toStringTag?"FunctionReference":void 0}})}();var er=Object.defineProperty,eo=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?er(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s};class ea{constructor(e){eo(this,"queryResults"),eo(this,"modifiedQueries"),this.queryResults=e,this.modifiedQueries=[]}getQuery(e,...t){let s=y(t[0]),i=en(e),n=this.queryResults.get(J(i,s));if(void 0!==n)return ea.queryValue(n.result)}getAllQueries(e){let t=[],s=en(e);for(let e of this.queryResults.values())e.udfPath===H(s)&&t.push({args:e.args,value:ea.queryValue(e.result)});return t}setQuery(e,t,s){let i=y(t),n=en(e),r=J(n,i);this.queryResults.set(r,{udfPath:n,args:i,result:void 0===s?void 0:{success:!0,value:s,logLines:[]}}),this.modifiedQueries.push(r)}static queryValue(e){return void 0===e?void 0:e.success?e.value:void 0}}class eu{constructor(){eo(this,"queryResults"),eo(this,"optimisticUpdates"),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(e,t){this.optimisticUpdates=this.optimisticUpdates.filter(e=>!t.has(e.mutationId));let s=this.queryResults;this.queryResults=new Map(e);let i=new ea(this.queryResults);for(let e of this.optimisticUpdates)e.update(i);let n=[];for(let[e,t]of this.queryResults){let i=s.get(e);(void 0===i||i.result!==t.result)&&n.push(e)}return n}applyOptimisticUpdate(e,t){this.optimisticUpdates.push({update:e,mutationId:t});let s=new ea(this.queryResults);return e(s),s.modifiedQueries}rawQueryResult(e){let t=this.queryResults.get(e);if(void 0!==t)return t.result}queryResult(e){let t=this.queryResults.get(e);if(void 0===t)return;let s=t.result;if(void 0!==s){if(s.success)return s.value;if(void 0!==s.errorData)throw K(s,new V(W("query",t.udfPath,s)));throw Error(W("query",t.udfPath,s))}}hasQueryResult(e){return void 0!==this.queryResults.get(e)}queryLogs(e){let t=this.queryResults.get(e);return t?.result?.logLines}}var eh=Object.defineProperty,el=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?eh(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s};class ec{constructor(e,t){el(this,"low"),el(this,"high"),el(this,"__isUnsignedLong__"),this.low=0|e,this.high=0|t,this.__isUnsignedLong__=!0}static isLong(e){return!0===(e&&e.__isUnsignedLong__)}static fromBytesLE(e){return new ec(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24)}toBytesLE(){let e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]}static fromNumber(e){return isNaN(e)||e<0?ed:e>=ef?ey:new ec(e%eg|0,e/eg|0)}toString(){return(BigInt(this.high)*BigInt(eg)+BigInt(this.low)).toString()}equals(e){return ec.isLong(e)||(e=ec.fromValue(e)),(this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low}notEquals(e){return!this.equals(e)}comp(e){return(ec.isLong(e)||(e=ec.fromValue(e)),this.equals(e))?0:e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(e){return 0>=this.comp(e)}static fromValue(e){return"number"==typeof e?ec.fromNumber(e):new ec(e.low,e.high)}}let ed=new ec(0,0),eg=0x100000000,ef=0xffffffffffffffff,ey=new ec(-1,-1);var ep=Object.defineProperty,em=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?ep(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s};class ev{constructor(e,t){em(this,"version"),em(this,"remoteQuerySet"),em(this,"queryPath"),em(this,"logger"),this.version={querySet:0,ts:ec.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=e,this.logger=t}transition(e){let t=e.startVersion;if(this.version.querySet!==t.querySet||this.version.ts.notEquals(t.ts)||this.version.identity!==t.identity)throw Error(`Invalid start version: ${t.ts.toString()}:${t.querySet}:${t.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(let t of e.modifications)switch(t.type){case"QueryUpdated":{let e=this.queryPath(t.queryId);if(e)for(let s of t.logLines)j(this.logger,"info","query",e,s);let s=I(t.value??null);this.remoteQuerySet.set(t.queryId,{success:!0,value:s,logLines:t.logLines});break}case"QueryFailed":{let e=this.queryPath(t.queryId);if(e)for(let s of t.logLines)j(this.logger,"info","query",e,s);let{errorData:s}=t;this.remoteQuerySet.set(t.queryId,{success:!1,errorMessage:t.errorMessage,errorData:void 0!==s?I(s):void 0,logLines:t.logLines});break}case"QueryRemoved":this.remoteQuerySet.delete(t.queryId);break;default:throw Error(`Invalid modification ${t.type}`)}this.version=e.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}}function eb(e){let t=g(e);return ec.fromBytesLE(Array.from(t))}function eS(e){switch(e.type){case"FatalError":case"AuthError":case"ActionResponse":case"TransitionChunk":case"Ping":return{...e};case"MutationResponse":if(e.success)return{...e,ts:eb(e.ts)};return{...e};case"Transition":return{...e,startVersion:{...e.startVersion,ts:eb(e.startVersion.ts)},endVersion:{...e.endVersion,ts:eb(e.endVersion.ts)}}}}var ek=Object.defineProperty,ew=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?ek(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s};function eR(){return(void 0===i&&(i=Date.now()),"u"<typeof performance||!performance.now)?Date.now():Math.round(i+performance.now())}function eC(){return`t=${Math.round((eR()-i)/100)/10}s`}let eT={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};class eA{constructor(e,t,s,i,n,r){this.markConnectionStateDirty=n,this.debug=r,ew(this,"socket"),ew(this,"connectionCount"),ew(this,"_hasEverConnected",!1),ew(this,"lastCloseReason"),ew(this,"transitionChunkBuffer",null),ew(this,"defaultInitialBackoff"),ew(this,"maxBackoff"),ew(this,"retries"),ew(this,"serverInactivityThreshold"),ew(this,"reconnectDueToServerInactivityTimeout"),ew(this,"scheduledReconnect",null),ew(this,"networkOnlineHandler",null),ew(this,"pendingNetworkRecoveryInfo",null),ew(this,"uri"),ew(this,"onOpen"),ew(this,"onResume"),ew(this,"onMessage"),ew(this,"webSocketConstructor"),ew(this,"logger"),ew(this,"onServerDisconnectError"),this.webSocketConstructor=s,this.socket={state:"disconnected"},this.connectionCount=0,this.lastCloseReason="InitialConnect",this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=e,this.onOpen=t.onOpen,this.onResume=t.onResume,this.onMessage=t.onMessage,this.onServerDisconnectError=t.onServerDisconnectError,this.logger=i,this.setupNetworkListener(),this.connect()}setSocketState(e){this.socket=e,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}setupNetworkListener(){"u"<typeof window||"function"!=typeof window.addEventListener||null===this.networkOnlineHandler&&(this.networkOnlineHandler=()=>{this._logVerbose("network online event detected"),this.tryReconnectImmediately()},window.addEventListener("online",this.networkOnlineHandler),this._logVerbose("network online event listener registered"))}cleanupNetworkListener(){this.networkOnlineHandler&&"u">typeof window&&"function"==typeof window.removeEventListener&&(window.removeEventListener("online",this.networkOnlineHandler),this.networkOnlineHandler=null,this._logVerbose("network online event listener removed"))}assembleTransition(e){if(e.partNumber<0||e.partNumber>=e.totalParts||0===e.totalParts||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==e.totalParts||this.transitionChunkBuffer.transitionId!==e.transitionId))throw this.transitionChunkBuffer=null,Error("Invalid TransitionChunk");if(null===this.transitionChunkBuffer&&(this.transitionChunkBuffer={chunks:[],totalParts:e.totalParts,transitionId:e.transitionId}),e.partNumber!==this.transitionChunkBuffer.chunks.length){let t=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,Error(`TransitionChunk received out of order: expected part ${t}, got ${e.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(e.chunk),this.transitionChunkBuffer.chunks.length===e.totalParts){let e=this.transitionChunkBuffer.chunks.join("");this.transitionChunkBuffer=null;let t=eS(JSON.parse(e));if("Transition"!==t.type)throw Error(`Expected Transition, got ${t.type} after assembling chunks`);return t}return null}connect(){if("terminated"===this.socket.state)return;if("disconnected"!==this.socket.state&&"stopped"!==this.socket.state)throw Error("Didn't start connection from disconnected state: "+this.socket.state);let e=new this.webSocketConstructor(this.uri);this._logVerbose("constructed WebSocket"),this.setSocketState({state:"connecting",ws:e,paused:"no"}),this.resetServerInactivityTimeout(),e.onopen=()=>{if(this.logger.logVerbose("begin ws.onopen"),"connecting"!==this.socket.state)throw Error("onopen called with socket not in connecting state");if(this.setSocketState({state:"ready",ws:e,paused:"yes"===this.socket.paused?"uninitialized":"no"}),this.resetServerInactivityTimeout(),"no"===this.socket.paused&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:eR()})),"InitialConnect"!==this.lastCloseReason&&(this.lastCloseReason?this.logger.log("WebSocket reconnected at",eC(),"after disconnect due to",this.lastCloseReason):this.logger.log("WebSocket reconnected at",eC())),this.connectionCount+=1,this.lastCloseReason=null,null!==this.pendingNetworkRecoveryInfo){let{timeSavedMs:e}=this.pendingNetworkRecoveryInfo;this.pendingNetworkRecoveryInfo=null,this.sendMessage({type:"Event",eventType:"NetworkRecoveryReconnect",event:{timeSavedMs:e}}),this.logger.log(`Network recovery reconnect saved ~${Math.round(e/1e3)}s of waiting`)}},e.onerror=e=>{this.transitionChunkBuffer=null;let t=e.message;t&&this.logger.log(`WebSocket error message: ${t}`)},e.onmessage=e=>{this.resetServerInactivityTimeout();let t=e.data.length,s=eS(JSON.parse(e.data));if(this._logVerbose(`received ws message with type ${s.type}`),"Ping"!==s.type){if("TransitionChunk"===s.type){let e=this.assembleTransition(s);if(!e)return;s=e,this._logVerbose(`assembled full ws message of type ${s.type}`)}null!==this.transitionChunkBuffer&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${s.type} while buffering TransitionChunks`)),"Transition"===s.type&&this.reportLargeTransition({messageLength:t,transition:s}),this.onMessage(s).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())}},e.onclose=e=>{if(this._logVerbose("begin ws.onclose"),this.transitionChunkBuffer=null,null===this.lastCloseReason&&(this.lastCloseReason=e.reason||`closed with code ${e.code}`),1e3!==e.code&&1001!==e.code&&1005!==e.code&&4040!==e.code){let t=`WebSocket closed with code ${e.code}`;e.reason&&(t+=`: ${e.reason}`),this.logger.log(t),this.onServerDisconnectError&&e.reason&&this.onServerDisconnectError(t)}let t=function(e){if(void 0===e)return"Unknown";for(let t of Object.keys(eT))if(e.startsWith(t))return t;return"Unknown"}(e.reason);this.scheduleReconnect(t)}}socketState(){return this.socket.state}sendMessage(e){let t={type:e.type,..."Authenticate"===e.type&&"User"===e.tokenType?{value:`...${e.value.slice(-7)}`}:{}};if("ready"===this.socket.state&&"no"===this.socket.paused){let s=JSON.stringify(function(e){switch(e.type){case"Authenticate":case"ModifyQuerySet":case"Mutation":case"Action":case"Event":return{...e};case"Connect":if(void 0===e.maxObservedTimestamp)return{...e,maxObservedTimestamp:void 0};return{...e,maxObservedTimestamp:f(new Uint8Array(e.maxObservedTimestamp.toBytesLE()))}}}(e)),i=!1;try{this.socket.ws.send(s),i=!0}catch(e){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${e}`),this.closeAndReconnect("FailedToSendMessage")}return this._logVerbose(`${i?"sent":"failed to send"} message with type ${e.type}: ${JSON.stringify(t)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}): ${JSON.stringify(t)}`),!1}resetServerInactivityTimeout(){"terminated"!==this.socket.state&&(null!==this.reconnectDueToServerInactivityTimeout&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect("InactiveServer")},this.serverInactivityThreshold))}scheduleReconnect(e){this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.socket={state:"disconnected"};let t=this.nextBackoff(e);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(t)}ms`);let s=eR(),i=setTimeout(()=>{this.scheduledReconnect?.timeout===i&&(this.scheduledReconnect=null,this.connect())},t);this.scheduledReconnect={timeout:i,scheduledAt:s,backoffMs:t}}closeAndReconnect(e){switch(this._logVerbose(`begin closeAndReconnect with reason ${e}`),this.socket.state){case"disconnected":case"terminated":case"stopped":return;case"connecting":case"ready":this.lastCloseReason=e,this.close(),this.scheduleReconnect("client");return;default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case"disconnected":case"terminated":case"stopped":return Promise.resolve();case"connecting":{let e=this.socket.ws;return e.onmessage=e=>{this._logVerbose("Ignoring message received after close")},new Promise(t=>{e.onclose=()=>{this._logVerbose("Closed after connecting"),t()},e.onopen=()=>{this._logVerbose("Opened after connecting"),e.close()}})}case"ready":{this._logVerbose("ws.close called");let e=this.socket.ws;e.onmessage=e=>{this._logVerbose("Ignoring message received after close")};let t=new Promise(t=>{e.onclose=()=>{t()}});return e.close(),t}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.cleanupNetworkListener(),this.socket.state){case"terminated":case"stopped":case"disconnected":case"connecting":case"ready":{let e=this.close();return this.setSocketState({state:"terminated"}),e}default:throw this.socket,Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case"terminated":return Promise.resolve();case"connecting":case"stopped":case"disconnected":case"ready":{this.cleanupNetworkListener();let e=this.close();return this.socket={state:"stopped"},e}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case"stopped":break;case"terminated":case"connecting":case"ready":case"disconnected":this.logger.logVerbose("Restart called without stopping first");return;default:this.socket}this.setupNetworkListener(),this.connect()}pause(){switch(this.socket.state){case"disconnected":case"stopped":case"terminated":return;case"connecting":case"ready":this.socket={...this.socket,paused:"yes"};return;default:return void this.socket}}tryReconnectImmediately(){if(this._logVerbose("tryReconnectImmediately called"),"disconnected"!==this.socket.state)return void this._logVerbose(`tryReconnectImmediately called but socket state is ${this.socket.state}, no action taken`);let e=null;if(this.scheduledReconnect){let t=eR()-this.scheduledReconnect.scheduledAt;e=Math.max(0,this.scheduledReconnect.backoffMs-t),this._logVerbose(`would have waited ${Math.round(e)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(t)}ms)`),clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null,this._logVerbose("canceled scheduled reconnect")}this.logger.log("Network recovery detected, reconnecting immediately"),this.pendingNetworkRecoveryInfo=null!==e?{timeSavedMs:e}:null,this.connect()}resume(){switch(this.socket.state){case"connecting":this.socket={...this.socket,paused:"no"};return;case"ready":"uninitialized"===this.socket.paused?(this.socket={...this.socket,paused:"no"},this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:eR()})):"yes"===this.socket.paused&&(this.socket={...this.socket,paused:"no"},this.onResume());return;case"terminated":case"stopped":case"disconnected":return;default:this.socket}this.connect()}connectionState(){return{isConnected:"ready"===this.socket.state,hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(e){this.logger.logVerbose(e)}nextBackoff(e){let t=("client"===e?100:"Unknown"===e?this.defaultInitialBackoff:eT[e].timeout)*Math.pow(2,this.retries);this.retries+=1;let s=Math.min(t,this.maxBackoff),i=s*(Math.random()-.5);return s+i}reportLargeTransition({transition:e,messageLength:t}){if(void 0===e.clientClockSkew||void 0===e.serverTs)return;let s=eR()-e.clientClockSkew-e.serverTs/1e6,i=`${Math.round(s)}ms`,n=`${Math.round(t/1e4)/100}MB`,r=t/(s/1e3),o=`${Math.round(r/1e4)/100}MB per second`;this._logVerbose(`received ${n} transition in ${i} at ${o}`),t>2e7?this.logger.log(`received query results totaling more that 20MB (${n}) which will take a long time to download on slower connections`):s>2e4&&this.logger.log(`received query results totaling ${n} which took more than 20s to arrive (${i})`),this.debug&&this.sendMessage({type:"Event",eventType:"ClientReceivedTransition",event:{transitionTransitTime:s,messageLength:t}})}}class eq extends Error{}function eM(e,t){let s;if("string"!=typeof e)throw new eq("Invalid token specified: must be a string");t||(t={});let i=+(!0!==t.header),n=e.split(".")[i];if("string"!=typeof n)throw new eq(`Invalid token specified: missing part #${i+1}`);try{s=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var s;return s=t,decodeURIComponent(atob(s).replace(/(.)/g,(e,t)=>{let s=t.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}catch{return atob(t)}}(n)}catch(e){throw new eq(`Invalid token specified: invalid base64 for part #${i+1} (${e.message})`)}try{return JSON.parse(s)}catch(e){throw new eq(`Invalid token specified: invalid json for part #${i+1} (${e.message})`)}}eq.prototype.name="InvalidTokenError";var eI=Object.defineProperty,e$=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?eI(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s};class eQ{constructor(e,t,s){e$(this,"authState",{state:"noAuth"}),e$(this,"configVersion",0),e$(this,"syncState"),e$(this,"authenticate"),e$(this,"stopSocket"),e$(this,"tryRestartSocket"),e$(this,"pauseSocket"),e$(this,"resumeSocket"),e$(this,"clearAuth"),e$(this,"logger"),e$(this,"refreshTokenLeewaySeconds"),e$(this,"initialAuthTokenReuse"),e$(this,"lastRefreshChange"),e$(this,"tokenConfirmationAttempts",0),this.syncState=e,this.authenticate=t.authenticate,this.stopSocket=t.stopSocket,this.tryRestartSocket=t.tryRestartSocket,this.pauseSocket=t.pauseSocket,this.resumeSocket=t.resumeSocket,this.clearAuth=t.clearAuth,this.logger=s.logger,this.refreshTokenLeewaySeconds=s.refreshTokenLeewaySeconds,this.initialAuthTokenReuse=s.initialAuthTokenReuse,this.lastRefreshChange=!1}notifyRefreshChange(e){"noAuth"!==this.authState.state&&"initialRefetch"!==this.authState.state&&this.authState.config.onRefreshChange&&this.lastRefreshChange!==e&&(this.lastRefreshChange=e,this.authState.config.onRefreshChange(e))}async setConfig(e,t,s){this.resetAuthState(),this._logVerbose("pausing WS for auth token fetch"),this.pauseSocket();let i=await this.fetchTokenAndGuardAgainstRace(e,{forceRefreshToken:!1});if(i.isFromOutdatedConfig)return;let n={fetchToken:e,onAuthChange:t,onRefreshChange:s};i.value?(this.setAuthState({state:"waitingForServerConfirmationOfCachedToken",config:n,hasRetried:!1}),this.authenticate(i.value)):(this.setAuthState({state:"initialRefetch",config:n}),await this.refetchToken()),this._logVerbose("resuming WS after auth token fetch"),this.resumeSocket()}onTransition(e){if(this.syncState.isCurrentOrNewerAuthVersion(e.endVersion.identity)&&!(e.endVersion.identity<=e.startVersion.identity)){if(this._logVerbose(`auth state is ${this.authState.state} when handling transition`),this.syncState.markAuthCompletion(),"waitingForServerConfirmationOfCachedToken"===this.authState.state){this._logVerbose("server confirmed auth token is valid");let t=this.syncState.getAuth()?.value;this.initialAuthTokenReuse&&t?this.scheduleTokenRefetch(t,e.clientClockSkew):this.refetchToken(),this.authState.config.onAuthChange(!0);return}"waitingForServerConfirmationOfFreshToken"===this.authState.state&&(this._logVerbose("server confirmed new auth token is valid"),this.notifyRefreshChange(!1),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(e){if(!1===e.authUpdateAttempted&&("waitingForServerConfirmationOfFreshToken"===this.authState.state||"waitingForServerConfirmationOfCachedToken"===this.authState.state))return void this._logVerbose("ignoring non-auth token expired error");let{baseVersion:t}=e;this.syncState.isCurrentOrNewerAuthVersion(t+1)?this.tryToReauthenticate(e):this._logVerbose("ignoring auth error for previous auth attempt")}async tryToReauthenticate(e){if(this._logVerbose(`attempting to reauthenticate: ${e.error}`),"noAuth"===this.authState.state||"waitingForServerConfirmationOfFreshToken"===this.authState.state&&this.tokenConfirmationAttempts>=2){this.logger.error(`Failed to authenticate: "${e.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),"noAuth"!==this.authState.state&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}if("waitingForServerConfirmationOfFreshToken"===this.authState.state&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${2-this.tokenConfirmationAttempts} attempts remaining`)),this.notifyRefreshChange(!0),await this.stopSocket(),"noAuth"===this.authState.state)return;let t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value&&this.syncState.isNewAuth(t.value)?(this.authenticate(t.value),this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",config:this.authState.config,token:t.value,hadAuth:"notRefetching"===this.authState.state||"waitingForScheduledRefetch"===this.authState.state})):(this._logVerbose("reauthentication failed, could not fetch a new token"),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if("noAuth"===this.authState.state)return;this._logVerbose("refetching auth token");let e=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});e.isFromOutdatedConfig||(e.value?this.syncState.isNewAuth(e.value)?(this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",hadAuth:this.syncState.hasAuth(),token:e.value,config:this.authState.config}),this.authenticate(e.value)):this.setAuthState({state:"notRefetching",config:this.authState.config}):(this._logVerbose("refetching token failed"),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose("restarting WS after auth token fetch (if currently stopped)"),this.tryRestartSocket())}scheduleTokenRefetch(e,t){let s;if("noAuth"===this.authState.state)return;let i=this.decodeToken(e);if(!i)return void this.logger.error("Auth token is not a valid JWT, cannot refetch the token");let{iat:n,exp:r}=i;if(!n||!r)return void this.logger.error("Auth token does not have required fields, cannot refetch the token");let o=r-n;if(o<=2)return void this.logger.error("Auth token does not live long enough, cannot refetch the token");void 0!==t?(s=r-(Date.now()-t)/1e3)<=0&&(s=0):s=o;let a=Math.min(1728e6,(s-this.refreshTokenLeewaySeconds)*1e3);a<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${s}s`),a=0);let u=setTimeout(()=>{this._logVerbose("running scheduled token refetch"),this.refetchToken()},a);this.setAuthState({state:"waitingForScheduledRefetch",refetchTokenTimeoutId:u,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${a}ms`)}async fetchTokenAndGuardAgainstRace(e,t){let s=++this.configVersion;this._logVerbose(`fetching token with config version ${s}`);let i=await e(t);return this.configVersion!==s?(this._logVerbose(`stale config version, expected ${s}, got ${this.configVersion}`),{isFromOutdatedConfig:!0}):{isFromOutdatedConfig:!1,value:i}}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(e){e(!1),this.resetAuthState()}resetAuthState(){this.notifyRefreshChange(!1),this.setAuthState({state:"noAuth"})}setAuthState(e){let t="waitingForServerConfirmationOfFreshToken"===e.state?{hadAuth:e.hadAuth,state:e.state,token:`...${e.token.slice(-7)}`}:{state:e.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(t)}`),e.state){case"waitingForScheduledRefetch":case"notRefetching":case"noAuth":this.tokenConfirmationAttempts=0}"waitingForScheduledRefetch"===this.authState.state&&clearTimeout(this.authState.refetchTokenTimeoutId),this.authState=e}decodeToken(e){try{return eM(e)}catch(e){return this._logVerbose(`Error decoding token: ${e instanceof Error?e.message:"Unknown error"}`),null}}_logVerbose(e){this.logger.logVerbose(`${e} [v${this.configVersion}]`)}}let eO=["convexClientConstructed","convexWebSocketOpen","convexFirstMessageReceived"];function ex(e){let t=e.name.slice(6);return{name:t=t.charAt(0).toLowerCase()+t.slice(1),startTime:e.startTime}}var eE=Object.defineProperty,eP=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?eE(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s};class eV{constructor(e,t,s){let i;if(eP(this,"address"),eP(this,"state"),eP(this,"requestManager"),eP(this,"webSocketManager"),eP(this,"authenticationManager"),eP(this,"remoteQuerySet"),eP(this,"optimisticQueryResults"),eP(this,"_transitionHandlerCounter",0),eP(this,"_nextRequestId"),eP(this,"_onTransitionFns",new Map),eP(this,"_sessionId"),eP(this,"firstMessageReceived",!1),eP(this,"debug"),eP(this,"logger"),eP(this,"maxObservedTimestamp"),eP(this,"connectionStateSubscribers",new Map),eP(this,"nextConnectionStateSubscriberId",0),eP(this,"_lastPublishedConnectionState"),eP(this,"markConnectionStateDirty",()=>{Promise.resolve().then(()=>{let e=this.connectionState();if(JSON.stringify(e)!==JSON.stringify(this._lastPublishedConnectionState))for(let t of(this._lastPublishedConnectionState=e,this.connectionStateSubscribers.values()))t(e)})}),eP(this,"mark",e=>{var t;this.debug&&(t=this.sessionId,"u">typeof performance&&performance.mark&&performance.mark(e,{detail:{sessionId:t}}))}),"object"==typeof e)throw Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");s?.skipConvexDeploymentUrlCheck!==!0&&function(e){if(void 0===e)throw Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if("string"!=typeof e)throw Error(`Invalid deployment address: found ${e}".`);if(!(e.startsWith("http:")||e.startsWith("https:")))throw Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);try{new URL(e)}catch{throw Error(`Invalid deployment address: "${e}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(e.endsWith(".convex.site"))throw Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}(e);const n=(s={...s}).authRefreshTokenLeewaySeconds??10;let r=s.webSocketConstructor;if(!r&&"u"<typeof WebSocket)throw Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");r=r||WebSocket,this.debug=s.reportDebugInfoToConvex??!1,this.address=e,this.logger=!1===s.logger?function(e){return new U(e)}({verbose:s.verbose??!1}):!0!==s.logger&&s.logger?s.logger:D({verbose:s.verbose??!1});const o=e.search("://");if(-1===o)throw Error("Provided address was not an absolute URL.");const a=e.substring(o+3),u=e.substring(0,o);if("http"===u)i="ws";else if("https"===u)i="wss";else throw Error(`Unknown parent protocol ${u}`);const h=`${i}://${a}/api/${_}/sync`;this.state=new Y,this.remoteQuerySet=new ev(e=>this.state.queryPath(e),this.logger),this.requestManager=new et(this.logger,this.markConnectionStateDirty);const l=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new eQ(this.state,{authenticate:e=>{let t=this.state.setAuth(e);return this.webSocketManager.sendMessage(t),t.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:l,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:n,initialAuthTokenReuse:s.initialAuthTokenReuse??!1}),this.optimisticQueryResults=new eu,this.addOnTransitionHandler(e=>{t(e.queries.map(e=>e.token))}),this._nextRequestId=0,this._sessionId="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)});const{unsavedChangesWarning:c}=s;if("u"<typeof window||void 0===window.addEventListener){if(!0===c)throw Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.")}else!1!==c&&window.addEventListener("beforeunload",e=>{if(this.requestManager.hasIncompleteRequests()){e.preventDefault();let t="Are you sure you want to leave? Your changes may not be saved.";return(e||window.event).returnValue=t,t}});this.webSocketManager=new eA(h,{onOpen:e=>{this.mark("convexWebSocketOpen"),this.webSocketManager.sendMessage({...e,type:"Connect",sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp}),this.remoteQuerySet=new ev(e=>this.state.queryPath(e),this.logger);let[t,s]=this.state.restart();for(let e of(s&&this.webSocketManager.sendMessage(s),this.webSocketManager.sendMessage(t),this.requestManager.restart()))this.webSocketManager.sendMessage(e)},onResume:()=>{let[e,t]=this.state.resume();for(let s of(t&&this.webSocketManager.sendMessage(t),e&&this.webSocketManager.sendMessage(e),this.requestManager.resume()))this.webSocketManager.sendMessage(s)},onMessage:e=>{switch(!this.firstMessageReceived&&(this.firstMessageReceived=!0,this.mark("convexFirstMessageReceived"),this.reportMarks()),e.type){case"Transition":{this.observedTimestamp(e.endVersion.ts),this.authenticationManager.onTransition(e),this.remoteQuerySet.transition(e),this.state.transition(e);let t=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(t);break}case"MutationResponse":{e.success&&this.observedTimestamp(e.ts);let t=this.requestManager.onResponse(e);null!==t&&this.notifyOnQueryResultChanges(new Map([[t.requestId,t.result]]));break}case"ActionResponse":this.requestManager.onResponse(e);break;case"AuthError":this.authenticationManager.onAuthError(e);break;case"FatalError":{var t,s;let i,n=(t=this.logger,s=e.error,i=`[CONVEX FATAL ERROR] ${s}`,t.error(i),Error(i));throw this.webSocketManager.terminate(),n}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:s.onServerDisconnectError},r,this.logger,this.markConnectionStateDirty,this.debug),this.mark("convexClientConstructed"),s.expectAuth&&l()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()&&this.state.hasSyncedPastLastReconnect()}observedTimestamp(e){(void 0===this.maxObservedTimestamp||this.maxObservedTimestamp.lessThanOrEqual(e))&&(this.maxObservedTimestamp=e)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(e){let t=this.remoteQuerySet.remoteQueryResults(),s=new Map;for(let[e,i]of t){let t=this.state.queryToken(e);if(null!==t){let n={result:i,udfPath:this.state.queryPath(e),args:this.state.queryArgs(e)};s.set(t,n)}}let i=this.optimisticQueryResults.ingestQueryResultsFromServer(s,new Set(e.keys()));this.handleTransition({queries:i.map(e=>{let t=this.optimisticQueryResults.rawQueryResult(e);return{token:e,modification:{kind:"Updated",result:t}}}),reflectedMutations:Array.from(e).map(([e,t])=>({requestId:e,result:t})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(e){for(let t of this._onTransitionFns.values())t(e)}addOnTransitionHandler(e){let t=this._transitionHandlerCounter++;return this._onTransitionFns.set(t,e),()=>this._onTransitionFns.delete(t)}getCurrentAuthClaims(){let e=this.state.getAuth(),t={};if(e&&"User"===e.tokenType){try{t=e?eM(e.value):{}}catch{t={}}return{token:e.value,decoded:t}}}setAuth(e,t,s){this.authenticationManager.setConfig(e,t,s)}hasAuth(){return this.state.hasAuth()}setAdminAuth(e,t){let s=this.state.setAdminAuth(e,t);this.webSocketManager.sendMessage(s)}clearAuth(){let e=this.state.clearAuth();this.webSocketManager.sendMessage(e)}subscribe(e,t,s){let i=y(t),{modification:n,queryToken:r,unsubscribe:o}=this.state.subscribe(e,i,s?.journal,s?.componentPath);return null!==n&&this.webSocketManager.sendMessage(n),{queryToken:r,unsubscribe:()=>{let e=o();e&&this.webSocketManager.sendMessage(e)}}}localQueryResult(e,t){let s=J(e,y(t));return this.optimisticQueryResults.queryResult(s)}localQueryResultByToken(e){return this.optimisticQueryResults.queryResult(e)}hasLocalQueryResultByToken(e){return this.optimisticQueryResults.hasQueryResult(e)}localQueryLogs(e,t){let s=J(e,y(t));return this.optimisticQueryResults.queryLogs(s)}queryJournal(e,t){let s=J(e,y(t));return this.state.queryJournal(s)}connectionState(){let e=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:e.isConnected,hasEverConnected:e.hasEverConnected,connectionCount:e.connectionCount,connectionRetries:e.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(e){let t=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(t,e),()=>{this.connectionStateSubscribers.delete(t)}}async mutation(e,t,s){let i=await this.mutationInternal(e,t,s);if(!i.success){if(void 0!==i.errorData)throw K(i,new V(W("mutation",e,i)));throw Error(W("mutation",e,i))}return i.value}async mutationInternal(e,t,s,i){let{mutationPromise:n}=this.enqueueMutation(e,t,s,i);return n}enqueueMutation(e,t,s,i){let n=y(t);this.tryReportLongDisconnect();let r=this.nextRequestId;if(this._nextRequestId++,void 0!==s){let e=s.optimisticUpdate;if(void 0!==e){let t=t=>{e(t,n)instanceof Promise&&this.logger.warn("Optimistic update handler returned a Promise. Optimistic updates should be synchronous.")},s=this.optimisticQueryResults.applyOptimisticUpdate(t,r).map(e=>{let t=this.localQueryResultByToken(e);return{token:e,modification:{kind:"Updated",result:void 0===t?void 0:{success:!0,value:t,logLines:[]}}}});this.handleTransition({queries:s,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}let o={type:"Mutation",requestId:r,udfPath:e,componentPath:i,args:[O(n)]},a=this.webSocketManager.sendMessage(o);return{requestId:r,mutationPromise:this.requestManager.request(o,a)}}async action(e,t){let s=await this.actionInternal(e,t);if(!s.success){if(void 0!==s.errorData)throw K(s,new V(W("action",e,s)));throw Error(W("action",e,s))}return s.value}async actionInternal(e,t,s){let i=y(t),n=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();let r={type:"Action",requestId:n,udfPath:e,componentPath:s,args:[O(i)]},o=this.webSocketManager.sendMessage(r);return this.requestManager.request(r,o)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){let e=function(e){if("u"<typeof performance||!performance.getEntriesByName)return[];let t=[];for(let s of eO){let i=performance.getEntriesByName(s).filter(e=>"mark"===e.entryType).filter(t=>t.detail.sessionId===e);t.push(...i)}return t.map(ex)}(this.sessionId);this.webSocketManager.sendMessage({type:"Event",eventType:"ClientConnect",event:e})}}tryReportLongDisconnect(){if(!this.debug)return;let e=this.connectionState().timeOfOldestInflightRequest;null===e||Date.now()-e.getTime()<=6e4||fetch(`${this.address}/api/debug_event`,{method:"POST",headers:{"Content-Type":"application/json","Convex-Client":`npm-${_}`},body:JSON.stringify({event:"LongWebsocketDisconnect"})}).then(e=>{e.ok||this.logger.warn("Analytics request failed with response:",e.body)}).catch(e=>{this.logger.warn("Analytics response failed with error:",e)})}}function eL(e){if("object"!=typeof e||null===e||!Array.isArray(e.page)||"boolean"!=typeof e.isDone||"string"!=typeof e.continueCursor)throw Error(`Not a valid paginated query result: ${e?.toString()}`);return e}var e_=Object.defineProperty,eN=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?e_(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s};class eF{constructor(e,t){this.client=e,this.onTransition=t,eN(this,"paginatedQuerySet",new Map),eN(this,"lastTransitionTs"),this.lastTransitionTs=ec.fromNumber(0),this.client.addOnTransitionHandler(e=>this.onBaseTransition(e))}subscribe(e,t,s){let i=H(e),n=z(i,t,s),r=()=>this.removePaginatedQuerySubscriber(n),o=this.paginatedQuerySet.get(n);return o?o.numSubscribers+=1:(this.paginatedQuerySet.set(n,{token:n,canonicalizedUdfPath:i,args:t,numSubscribers:1,options:{initialNumItems:s.initialNumItems},nextPageKey:0,pageKeys:[],pageKeyToQuery:new Map,ongoingSplits:new Map,skip:!1,id:s.id}),this.addPageToPaginatedQuery(n,null,s.initialNumItems)),{paginatedQueryToken:n,unsubscribe:r}}localQueryResult(e,t,s){let i=z(H(e),t,s);return this.localQueryResultByToken(i)}localQueryResultByToken(e){let t,s=this.paginatedQuerySet.get(e);if(!s)return;let i=this.activePageQueryTokens(s);if(0===i.length)return{results:[],status:"LoadingFirstPage",loadMore:t=>this.loadMoreOfPaginatedQuery(e,t)};let n=[],r=!1,o=!1;for(let e of i){let t=this.client.localQueryResultByToken(e);if(void 0===t){r=!0,o=!1;continue}let s=eL(t);n=n.concat(s.page),o=!!s.isDone}return t=r?0===n.length?"LoadingFirstPage":"LoadingMore":o?"Exhausted":"CanLoadMore",{results:n,status:t,loadMore:t=>this.loadMoreOfPaginatedQuery(e,t)}}onBaseTransition(e){let t=e.queries.map(e=>e.token),s=this.queriesContainingTokens(t),i=[];s.length>0&&(this.processPaginatedQuerySplits(s,e=>this.client.localQueryResultByToken(e)),i=s.map(e=>({token:e,modification:{kind:"Updated",result:this.localQueryResultByToken(e)}})));let n={...e,paginatedQueries:i};this.onTransition(n)}loadMoreOfPaginatedQuery(e,t){this.mustGetPaginatedQuery(e);let s=this.queryTokenForLastPageOfPaginatedQuery(e),i=this.client.localQueryResultByToken(s);if(!i)return!1;let n=eL(i);if(n.isDone)return!1;this.addPageToPaginatedQuery(e,n.continueCursor,t);let r={timestamp:this.lastTransitionTs,reflectedMutations:[],queries:[],paginatedQueries:[{token:e,modification:{kind:"Updated",result:this.localQueryResultByToken(e)}}]};return this.onTransition(r),!0}queriesContainingTokens(e){if(0===e.length)return[];let t=[],s=new Set(e);for(let[e,i]of this.paginatedQuerySet)for(let n of this.allQueryTokens(i))if(s.has(n)){t.push(e);break}return t}processPaginatedQuerySplits(e,t){for(let s of e){let e=this.mustGetPaginatedQuery(s),{ongoingSplits:i,pageKeyToQuery:n,pageKeys:r}=e;for(let[s,[r,o]]of i)void 0!==t(n.get(r).queryToken)&&void 0!==t(n.get(o).queryToken)&&this.completePaginatedQuerySplit(e,s,r,o);for(let s of r){if(i.has(s))continue;let r=n.get(s);if(!r)throw Error(`No page query for active pageKey ${s}`);let o=t(r.queryToken);if(!o)continue;let a=eL(o);a.splitCursor&&("SplitRecommended"===a.pageStatus||"SplitRequired"===a.pageStatus||a.page.length>2*e.options.initialNumItems)&&this.splitPaginatedQueryPage(e,s,r.cursor,a.splitCursor,a.continueCursor)}}}splitPaginatedQueryPage(e,t,s,i,n){let r=e.nextPageKey++,o=e.nextPageKey++,a={numItems:e.options.initialNumItems,id:e.id},u=this.client.subscribe(e.canonicalizedUdfPath,{...e.args,paginationOpts:{...a,cursor:s,endCursor:i}});e.pageKeyToQuery.set(r,{...u,cursor:s});let h=this.client.subscribe(e.canonicalizedUdfPath,{...e.args,paginationOpts:{...a,cursor:i,endCursor:n}});e.pageKeyToQuery.set(o,{...h,cursor:i}),e.ongoingSplits.set(t,[r,o])}addPageToPaginatedQuery(e,t,s){let i=this.mustGetPaginatedQuery(e),n=i.nextPageKey++,r={cursor:t,numItems:s,id:i.id},o={...i.args,paginationOpts:r},a=this.client.subscribe(i.canonicalizedUdfPath,o);return i.pageKeys.push(n),i.pageKeyToQuery.set(n,{...a,cursor:t}),a}removePaginatedQuerySubscriber(e){let t=this.paginatedQuerySet.get(e);if(t&&(t.numSubscribers-=1,!(t.numSubscribers>0))){for(let e of t.pageKeyToQuery.values())e.unsubscribe();this.paginatedQuerySet.delete(e)}}completePaginatedQuerySplit(e,t,s,i){let n=e.pageKeyToQuery.get(t);e.pageKeyToQuery.delete(t);let r=e.pageKeys.indexOf(t);e.pageKeys.splice(r,1,s,i),e.ongoingSplits.delete(t),n.unsubscribe()}activePageQueryTokens(e){return e.pageKeys.map(t=>e.pageKeyToQuery.get(t).queryToken)}allQueryTokens(e){return Array.from(e.pageKeyToQuery.values()).map(e=>e.queryToken)}queryTokenForLastPageOfPaginatedQuery(e){let t=this.mustGetPaginatedQuery(e),s=t.pageKeys[t.pageKeys.length-1];if(void 0===s)throw Error(`No pages for paginated query ${e}`);return t.pageKeyToQuery.get(s).queryToken}mustGetPaginatedQuery(e){let t=this.paginatedQuerySet.get(e);if(!t)throw Error("paginated query no longer exists for token "+e);return t}}var eB=Object.defineProperty,eU=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?eB(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s};if(void 0===o)throw Error("Required dependency 'react' not found");class eD{constructor(e,t){if(eU(this,"address"),eU(this,"cachedSync"),eU(this,"cachedPaginatedQueryClient"),eU(this,"listeners"),eU(this,"options"),eU(this,"closed",!1),eU(this,"_logger"),eU(this,"adminAuth"),eU(this,"fakeUserIdentity"),void 0===e)throw Error("No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated.");if("string"!=typeof e)throw Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof e} instead.`);if(!e.includes("://"))throw Error("Provided address was not an absolute URL.");this.address=e,this.listeners=new Map,this._logger=t?.logger===!1?function(e){return new U(e)}({verbose:t?.verbose??!1}):t?.logger!==!0&&t?.logger?t.logger:D({verbose:t?.verbose??!1}),this.options={...t,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw Error("ConvexReactClient has already been closed.");return this.cachedSync||(this.cachedSync=this.options.baseClient??new eV(this.address,()=>{},this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedPaginatedQueryClient=new eF(this.cachedSync,e=>this.handleTransition(e))),this.cachedSync}get paginatedQueryClient(){if(this.sync,this.cachedPaginatedQueryClient)return this.cachedPaginatedQueryClient;throw Error("Should already be instantiated")}setAuth(e,t,s){if("string"==typeof e)throw Error("Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.");this.sync.setAuth(e,t??(()=>{}),s)}clearAuth(){this.sync.clearAuth()}setAdminAuth(e,t){if(this.adminAuth=e,this.fakeUserIdentity=t,this.closed)throw Error("ConvexReactClient has already been closed.");this.cachedSync&&this.sync.setAdminAuth(e,t)}watchQuery(e,...t){let[s,i]=t,n=en(e);return{onUpdate:e=>{let{queryToken:t,unsubscribe:r}=this.sync.subscribe(n,s,i),o=this.listeners.get(t);return void 0!==o?o.add(e):this.listeners.set(t,new Set([e])),()=>{if(this.closed)return;let s=this.listeners.get(t);s.delete(e),0===s.size&&this.listeners.delete(t),r()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(n,s)},localQueryLogs:()=>{if(this.cachedSync)return this.cachedSync.localQueryLogs(n,s)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(n,s)}}}prewarmQuery(e){let t=e.extendSubscriptionFor??5e3;setTimeout(this.watchQuery(e.query,e.args||{}).onUpdate(()=>{}),t)}watchPaginatedQuery(e,t,s){let i=en(e);return{onUpdate:e=>{let{paginatedQueryToken:n,unsubscribe:r}=this.paginatedQueryClient.subscribe(i,t||{},s),o=this.listeners.get(n);return void 0!==o?o.add(e):this.listeners.set(n,new Set([e])),()=>{if(this.closed)return;let t=this.listeners.get(n);t.delete(e),0===t.size&&this.listeners.delete(n),r()}},localQueryResult:()=>this.paginatedQueryClient.localQueryResult(i,t,s)}}mutation(e,...t){let[s,i]=t,n=en(e);return this.sync.mutation(n,s,i)}action(e,...t){let s=en(e);return this.sync.action(s,...t)}query(e,...t){let s=this.watchQuery(e,...t),i=s.localQueryResult();return void 0!==i?Promise.resolve(i):new Promise((e,t)=>{let i=s.onUpdate(()=>{i();try{e(s.localQueryResult())}catch(e){t(e)}})})}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(e){return this.sync.subscribeToConnectionState(e)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedPaginatedQueryClient&&(this.cachedPaginatedQueryClient=void 0),this.cachedSync){let e=this.cachedSync;this.cachedSync=void 0,await e.close()}}handleTransition(e){let t=e.queries.map(e=>e.token),s=e.paginatedQueries.map(e=>e.token);this.transition([...t,...s])}transition(e){for(let t of e){let e=this.listeners.get(t);if(e)for(let t of e)t()}}}let ej=o.createContext(void 0),eW=({client:e,children:t})=>o.createElement(ej.Provider,{value:e},t);Symbol("includePageKeys"),Symbol("page"),(0,o.createContext)(void 0)}}]);