orcaq 1.1.4 → 1.1.6

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 (339) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/27ZsWTm2.js +1 -0
  3. package/.output/public/_nuxt/{e04t7nee.js → 3jfBYqJb.js} +1 -1
  4. package/.output/public/_nuxt/{DZ9fd-xA.js → 4LC09zKL.js} +1 -1
  5. package/.output/public/_nuxt/4OV_5qQE.js +1 -0
  6. package/.output/public/_nuxt/6NXhlm49.js +1 -0
  7. package/.output/public/_nuxt/6wO6CbCo.js +1 -0
  8. package/.output/public/_nuxt/{BqZGP9WI.js → 7nPLTDFM.js} +1 -1
  9. package/.output/public/_nuxt/B10QBDL6.js +1 -0
  10. package/.output/public/_nuxt/{DaiufW99.js → B3iNzG14.js} +1 -1
  11. package/.output/public/_nuxt/B5HZeat4.js +1 -0
  12. package/.output/public/_nuxt/B5rxJs06.js +1 -0
  13. package/.output/public/_nuxt/{DdW7QNKl.js → BAasx5OS.js} +1 -1
  14. package/.output/public/_nuxt/{DHnV-0Qj.js → BCa-NKh0.js} +1 -1
  15. package/.output/public/_nuxt/{CxSk31iP.js → BCazdlgN.js} +1 -1
  16. package/.output/public/_nuxt/{DQCTvlJf.js → BEvswgw7.js} +1 -1
  17. package/.output/public/_nuxt/{DmpCN34M.js → BJ8qQpib.js} +1 -1
  18. package/.output/public/_nuxt/{_Od8x2z5.js → BJoSd_uV.js} +1 -1
  19. package/.output/public/_nuxt/BKAEFZqP.js +1 -0
  20. package/.output/public/_nuxt/BTvOPFKG.js +1 -0
  21. package/.output/public/_nuxt/{g4lEPr__.js → BWg3wiuc.js} +3 -3
  22. package/.output/public/_nuxt/{xoY3RXI7.js → B_hWP06g.js} +1 -1
  23. package/.output/public/_nuxt/{DKhuBYhy.js → Bap1X7GD.js} +1 -1
  24. package/.output/public/_nuxt/{DynamicTable.B3c2woGb.css → BaseDataGrid.C2ywM2-T.css} +1 -1
  25. package/.output/public/_nuxt/{B_J4rjuT.js → BbLqUOHs.js} +1 -1
  26. package/.output/public/_nuxt/{BdaSWOzD.js → BbawOYVr.js} +1 -1
  27. package/.output/public/_nuxt/Bf2bW_MY.js +7 -0
  28. package/.output/public/_nuxt/{BxdkXfb_.js → Bgj8Q52i.js} +1 -1
  29. package/.output/public/_nuxt/BhzzQZRC.js +1 -0
  30. package/.output/public/_nuxt/{CwgI7YXL.js → Bibtvqd8.js} +1 -1
  31. package/.output/public/_nuxt/{BYY9MB0h.js → BmEIj9l9.js} +1 -1
  32. package/.output/public/_nuxt/BnZ5qYkP.js +39 -0
  33. package/.output/public/_nuxt/BoUZO_NV.js +1 -0
  34. package/.output/public/_nuxt/Bok35x_B.js +1 -0
  35. package/.output/public/_nuxt/{D65Keo_g.js → BuSZbOQO.js} +1 -1
  36. package/.output/public/_nuxt/BusLuQ4Q.js +1 -0
  37. package/.output/public/_nuxt/{DryPPXlb.js → BxZgIpkD.js} +1 -1
  38. package/.output/public/_nuxt/{C5zTeLKh.js → C4-wpUAK.js} +1 -1
  39. package/.output/public/_nuxt/{ziSTJBFH.js → C445d10Z.js} +1 -1
  40. package/.output/public/_nuxt/{2XEGje4L.js → C6CFIGob.js} +1 -1
  41. package/.output/public/_nuxt/{CYaqLaPZ.js → C6bwwZAc.js} +1 -1
  42. package/.output/public/_nuxt/C7C1kq_N.js +1 -0
  43. package/.output/public/_nuxt/{DijSUoYv.js → C9ZBCJdc.js} +1 -1
  44. package/.output/public/_nuxt/{BQFJwqXj.js → CBjcd4cE.js} +1 -1
  45. package/.output/public/_nuxt/{DKJfWiWm.js → CCK1so3F.js} +1 -1
  46. package/.output/public/_nuxt/CCOlJAKS.js +2 -0
  47. package/.output/public/_nuxt/{C6yADG7D.js → CE0zlNDo.js} +1 -1
  48. package/.output/public/_nuxt/CEoM97rJ.js +1 -0
  49. package/.output/public/_nuxt/CHAVZu6b.js +2 -0
  50. package/.output/public/_nuxt/CN8b9qPP.js +1 -0
  51. package/.output/public/_nuxt/{DYqNroD1.js → CNPNWuzz.js} +1 -1
  52. package/.output/public/_nuxt/{DEsdpKnm.js → CO0Pa76w.js} +1 -1
  53. package/.output/public/_nuxt/CP-7VdtS.js +1 -0
  54. package/.output/public/_nuxt/{MC96ynYQ.js → CROH8wgk.js} +1 -1
  55. package/.output/public/_nuxt/CUws2Uv7.js +1 -0
  56. package/.output/public/_nuxt/CZLVBTJx.js +1 -0
  57. package/.output/public/_nuxt/{BqjMHuu8.js → Cf6n9dsT.js} +1 -1
  58. package/.output/public/_nuxt/{BWphy0Pi.js → Ci7hrFNN.js} +1 -1
  59. package/.output/public/_nuxt/{BVl8VKr5.js → Cl3VX8Um.js} +1 -1
  60. package/.output/public/_nuxt/Cl5p4EQY.js +1 -0
  61. package/.output/public/_nuxt/CnQob-tn.js +1 -0
  62. package/.output/public/_nuxt/{u7qmw6wa.js → CoQ_oOia.js} +2 -2
  63. package/.output/public/_nuxt/CoX1_N4R.js +1 -0
  64. package/.output/public/_nuxt/CvDZBOay.js +1 -0
  65. package/.output/public/_nuxt/{CFOJLBf2.js → Cvkyd5iW.js} +1 -1
  66. package/.output/public/_nuxt/D29mzs5t.js +1 -0
  67. package/.output/public/_nuxt/D9MMtvTu.js +52 -0
  68. package/.output/public/_nuxt/{-lZvfnzr.js → D9Ycznwo.js} +1 -1
  69. package/.output/public/_nuxt/{C2kyA9ZS.js → DDsaDrGo.js} +1 -1
  70. package/.output/public/_nuxt/{5cKDQgbQ.js → DHyymmeR.js} +1 -1
  71. package/.output/public/_nuxt/{Bp1mKnR0.js → DLA-ioQ4.js} +1 -1
  72. package/.output/public/_nuxt/DM8LJTsg.js +1 -0
  73. package/.output/public/_nuxt/{Ef-1UUMy.js → DP6Az3fC.js} +1 -1
  74. package/.output/public/_nuxt/{DNpk_jbU.js → DRX1aIGD.js} +1 -1
  75. package/.output/public/_nuxt/{DDS9xPxH.js → DViCRsmA.js} +1 -1
  76. package/.output/public/_nuxt/{CmzTcheK.js → DYPm3mWQ.js} +1 -1
  77. package/.output/public/_nuxt/{BXp87mMj.js → DYqShb5v.js} +4 -4
  78. package/.output/public/_nuxt/DZFq5yqu.js +1 -0
  79. package/.output/public/_nuxt/DZVfXu09.js +1 -0
  80. package/.output/public/_nuxt/{DT4w6IwV.js → Dd89Vyx8.js} +1 -1
  81. package/.output/public/_nuxt/DdbhVPqD.js +1 -0
  82. package/.output/public/_nuxt/{l12ZvGEh.js → DeVs4gEL.js} +1 -1
  83. package/.output/public/_nuxt/{D9SUnmGh.js → Df4wU3r0.js} +1 -1
  84. package/.output/public/_nuxt/{BfSmOVMj.js → DgGwe7jd.js} +180 -180
  85. package/.output/public/_nuxt/DlymFQ5D.js +26 -0
  86. package/.output/public/_nuxt/DoNLWeqB.js +20 -0
  87. package/.output/public/_nuxt/Dpm6rnHk.js +1 -0
  88. package/.output/public/_nuxt/DsPClaxV.js +1 -0
  89. package/.output/public/_nuxt/DtOg0Asw.js +1 -0
  90. package/.output/public/_nuxt/DyDU0wFf.js +1 -0
  91. package/.output/public/_nuxt/{CRX1CszZ.js → EZ0owjER.js} +1 -1
  92. package/.output/public/_nuxt/F8eHh68O.js +9 -0
  93. package/.output/public/_nuxt/{bpGjU0QQ.js → FHx3Ejt6.js} +1 -1
  94. package/.output/public/_nuxt/{default.B0xlD4Sl.css → FileTree.CtTH3U6l.css} +1 -1
  95. package/.output/public/_nuxt/G40WRC_L.js +1 -0
  96. package/.output/public/_nuxt/{N6_KTIJr.js → Lh0RfwhV.js} +1 -1
  97. package/.output/public/_nuxt/NMm6Vanu.js +1 -0
  98. package/.output/public/_nuxt/ORit_vRp.js +1 -0
  99. package/.output/public/_nuxt/P_2SRa71.js +2 -0
  100. package/.output/public/_nuxt/PreviewRelationTable.BA0i90jA.css +1 -0
  101. package/.output/public/_nuxt/{HP3PGEjt.js → Un5zjlKE.js} +1 -1
  102. package/.output/public/_nuxt/W-4KVxy4.js +22 -0
  103. package/.output/public/_nuxt/XETGYn3c.js +1 -0
  104. package/.output/public/_nuxt/{BlRPNODF.js → ZNDxw-7x.js} +1 -1
  105. package/.output/public/_nuxt/ZVYA9HBl.js +1 -0
  106. package/.output/public/_nuxt/ZhP2FY6Y.js +1 -0
  107. package/.output/public/_nuxt/_TExiQQQ.js +3 -0
  108. package/.output/public/_nuxt/__PEYcIB.js +9 -0
  109. package/.output/public/_nuxt/{_fileId_.DDOcnoDQ.css → _fileId_.DxhkUVGK.css} +1 -1
  110. package/.output/public/_nuxt/builds/latest.json +1 -1
  111. package/.output/public/_nuxt/builds/meta/47c294b1-d6b3-4974-bd50-5046ae0a393e.json +1 -0
  112. package/.output/public/_nuxt/dDqgUqt5.js +16 -0
  113. package/.output/public/_nuxt/dSX5D8ur.js +28 -0
  114. package/.output/public/_nuxt/default.DixIpIal.css +1 -0
  115. package/.output/public/_nuxt/entry.CGwcggc4.css +1 -0
  116. package/.output/public/_nuxt/{BsA8eQHh.js → habs8oz6.js} +1 -1
  117. package/.output/public/_nuxt/{index.P0q-dO_S.css → index.C4HrDOPM.css} +1 -1
  118. package/.output/public/_nuxt/o60RgyTd.js +1 -0
  119. package/.output/public/_nuxt/{DNgNuAci.js → uDsvlLN0.js} +1 -1
  120. package/.output/public/_nuxt/{Brupmvos.js → wH-P-_6A.js} +1 -1
  121. package/.output/public/_nuxt/{Cih6uwf6.js → wrneOCBW.js} +1 -1
  122. package/.output/public/_nuxt/{BN9sUptU.js → x85BV7y_.js} +1 -1
  123. package/.output/public/_nuxt/{CrNrSEll.js → yLATXAxG.js} +1 -1
  124. package/.output/server/chunks/_/create-adapter.mjs +2 -1
  125. package/.output/server/chunks/_/create-adapter.mjs.map +1 -1
  126. package/.output/server/chunks/_/database-client-type.mjs +27 -0
  127. package/.output/server/chunks/_/database-client-type.mjs.map +1 -0
  128. package/.output/server/chunks/_/database-error.mjs +1 -1
  129. package/.output/server/chunks/_/database-roles.factory.mjs +1 -1
  130. package/.output/server/chunks/_/db-connection.mjs +6 -27
  131. package/.output/server/chunks/_/db-connection.mjs.map +1 -1
  132. package/.output/server/chunks/_/functions.factory.mjs +1 -1
  133. package/.output/server/chunks/_/instance-insights.factory.mjs +2 -1
  134. package/.output/server/chunks/_/instance-insights.factory.mjs.map +1 -1
  135. package/.output/server/chunks/_/metadata.factory.mjs +1 -1
  136. package/.output/server/chunks/_/native-backup-jobs.mjs +9 -179
  137. package/.output/server/chunks/_/native-backup-jobs.mjs.map +1 -1
  138. package/.output/server/chunks/_/native-backup.mjs +339 -0
  139. package/.output/server/chunks/_/native-backup.mjs.map +1 -0
  140. package/.output/server/chunks/_/query.factory.mjs +2 -1
  141. package/.output/server/chunks/_/query.factory.mjs.map +1 -1
  142. package/.output/server/chunks/_/redis.client.mjs +1 -1
  143. package/.output/server/chunks/_/sql-mutation-statements.mjs +496 -0
  144. package/.output/server/chunks/_/sql-mutation-statements.mjs.map +1 -0
  145. package/.output/server/chunks/_/tables.factory.mjs +58 -30
  146. package/.output/server/chunks/_/tables.factory.mjs.map +1 -1
  147. package/.output/server/chunks/_/type-alias.constants.mjs +1 -1
  148. package/.output/server/chunks/_/views.factory.mjs +1 -1
  149. package/.output/server/chunks/build/client.manifest.mjs +808 -703
  150. package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
  151. package/.output/server/chunks/nitro/nitro.mjs +687 -664
  152. package/.output/server/chunks/routes/api/ai/agent.mjs +2 -1
  153. package/.output/server/chunks/routes/api/ai/agent.mjs.map +1 -1
  154. package/.output/server/chunks/routes/api/database-backup/capability.get.mjs +33 -0
  155. package/.output/server/chunks/routes/api/database-backup/capability.get.mjs.map +1 -0
  156. package/.output/server/chunks/routes/api/database-export/export-database.mjs +7 -5
  157. package/.output/server/chunks/routes/api/database-export/export-database.mjs.map +1 -1
  158. package/.output/server/chunks/routes/api/database-export/jobs/_jobId/download.get.mjs +5 -3
  159. package/.output/server/chunks/routes/api/database-export/jobs/_jobId/download.get.mjs.map +1 -1
  160. package/.output/server/chunks/routes/api/database-export/jobs/_jobId_.get.mjs +5 -3
  161. package/.output/server/chunks/routes/api/database-export/jobs/_jobId_.get.mjs.map +1 -1
  162. package/.output/server/chunks/routes/api/database-import/import-database.mjs +8 -6
  163. package/.output/server/chunks/routes/api/database-import/import-database.mjs.map +1 -1
  164. package/.output/server/chunks/routes/api/database-import/jobs/_jobId_.get.mjs +5 -3
  165. package/.output/server/chunks/routes/api/database-import/jobs/_jobId_.get.mjs.map +1 -1
  166. package/.output/server/chunks/routes/api/database-roles/create-role.mjs +3 -2
  167. package/.output/server/chunks/routes/api/database-roles/create-role.mjs.map +1 -1
  168. package/.output/server/chunks/routes/api/database-roles/delete-role.mjs +3 -2
  169. package/.output/server/chunks/routes/api/database-roles/delete-role.mjs.map +1 -1
  170. package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs +3 -2
  171. package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs.map +1 -1
  172. package/.output/server/chunks/routes/api/database-roles/get-databases.mjs +3 -2
  173. package/.output/server/chunks/routes/api/database-roles/get-databases.mjs.map +1 -1
  174. package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs +3 -2
  175. package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs.map +1 -1
  176. package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs +3 -2
  177. package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs.map +1 -1
  178. package/.output/server/chunks/routes/api/database-roles/get-role.mjs +3 -2
  179. package/.output/server/chunks/routes/api/database-roles/get-role.mjs.map +1 -1
  180. package/.output/server/chunks/routes/api/database-roles/get-roles.mjs +3 -2
  181. package/.output/server/chunks/routes/api/database-roles/get-roles.mjs.map +1 -1
  182. package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs +3 -2
  183. package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs.map +1 -1
  184. package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs +3 -2
  185. package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs.map +1 -1
  186. package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs +3 -2
  187. package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs.map +1 -1
  188. package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs +3 -2
  189. package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs.map +1 -1
  190. package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs +3 -2
  191. package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs.map +1 -1
  192. package/.output/server/chunks/routes/api/functions/definition.post.mjs +3 -2
  193. package/.output/server/chunks/routes/api/functions/definition.post.mjs.map +1 -1
  194. package/.output/server/chunks/routes/api/functions/delete.post.mjs +3 -2
  195. package/.output/server/chunks/routes/api/functions/delete.post.mjs.map +1 -1
  196. package/.output/server/chunks/routes/api/functions/overview.post.mjs +3 -2
  197. package/.output/server/chunks/routes/api/functions/overview.post.mjs.map +1 -1
  198. package/.output/server/chunks/routes/api/functions/rename.post.mjs +3 -2
  199. package/.output/server/chunks/routes/api/functions/rename.post.mjs.map +1 -1
  200. package/.output/server/chunks/routes/api/functions/signature.post.mjs +3 -2
  201. package/.output/server/chunks/routes/api/functions/signature.post.mjs.map +1 -1
  202. package/.output/server/chunks/routes/api/functions/update.post.mjs +3 -2
  203. package/.output/server/chunks/routes/api/functions/update.post.mjs.map +1 -1
  204. package/.output/server/chunks/routes/api/index.post.mjs +5 -4
  205. package/.output/server/chunks/routes/api/index.post.mjs.map +1 -1
  206. package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs +2 -1
  207. package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs.map +1 -1
  208. package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs +2 -1
  209. package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs.map +1 -1
  210. package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs +2 -1
  211. package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs.map +1 -1
  212. package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs +2 -1
  213. package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs.map +1 -1
  214. package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs +2 -1
  215. package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs.map +1 -1
  216. package/.output/server/chunks/routes/api/instance-insights/state.post.mjs +2 -1
  217. package/.output/server/chunks/routes/api/instance-insights/state.post.mjs.map +1 -1
  218. package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs +2 -1
  219. package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs.map +1 -1
  220. package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs +2 -1
  221. package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs.map +1 -1
  222. package/.output/server/chunks/routes/api/instance-insights/view.post.mjs +2 -1
  223. package/.output/server/chunks/routes/api/instance-insights/view.post.mjs.map +1 -1
  224. package/.output/server/chunks/routes/api/managment-connection/health-check.mjs +1 -0
  225. package/.output/server/chunks/routes/api/managment-connection/health-check.mjs.map +1 -1
  226. package/.output/server/chunks/routes/api/metadata/erd.post.mjs +4 -3
  227. package/.output/server/chunks/routes/api/metadata/erd.post.mjs.map +1 -1
  228. package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs +4 -3
  229. package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs.map +1 -1
  230. package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs +4 -3
  231. package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs.map +1 -1
  232. package/.output/server/chunks/routes/api/metrics/monitor.post.mjs +2 -1
  233. package/.output/server/chunks/routes/api/metrics/monitor.post.mjs.map +1 -1
  234. package/.output/server/chunks/routes/api/query/execute.post.mjs +3 -2
  235. package/.output/server/chunks/routes/api/query/execute.post.mjs.map +1 -1
  236. package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs +2 -1
  237. package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs.map +1 -1
  238. package/.output/server/chunks/routes/api/query/raw-execute.post.mjs +3 -2
  239. package/.output/server/chunks/routes/api/query/raw-execute.post.mjs.map +1 -1
  240. package/.output/server/chunks/routes/api/redis/browser/value.patch.mjs +1 -1
  241. package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs +21 -12
  242. package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs.map +1 -1
  243. package/.output/server/chunks/routes/api/tables/bulk-insert.post.mjs +90 -0
  244. package/.output/server/chunks/routes/api/tables/bulk-insert.post.mjs.map +1 -0
  245. package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs +53 -11
  246. package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs.map +1 -1
  247. package/.output/server/chunks/routes/api/tables/ddl.post.mjs +3 -2
  248. package/.output/server/chunks/routes/api/tables/ddl.post.mjs.map +1 -1
  249. package/.output/server/chunks/routes/api/tables/export.post.mjs +4 -3
  250. package/.output/server/chunks/routes/api/tables/export.post.mjs.map +1 -1
  251. package/.output/server/chunks/routes/api/tables/indexes.post.mjs +3 -2
  252. package/.output/server/chunks/routes/api/tables/indexes.post.mjs.map +1 -1
  253. package/.output/server/chunks/routes/api/tables/meta.post.mjs +3 -2
  254. package/.output/server/chunks/routes/api/tables/meta.post.mjs.map +1 -1
  255. package/.output/server/chunks/routes/api/tables/overview.post.mjs +3 -2
  256. package/.output/server/chunks/routes/api/tables/overview.post.mjs.map +1 -1
  257. package/.output/server/chunks/routes/api/tables/rls.post.mjs +3 -2
  258. package/.output/server/chunks/routes/api/tables/rls.post.mjs.map +1 -1
  259. package/.output/server/chunks/routes/api/tables/rules.post.mjs +3 -2
  260. package/.output/server/chunks/routes/api/tables/rules.post.mjs.map +1 -1
  261. package/.output/server/chunks/routes/api/tables/size.post.mjs +3 -2
  262. package/.output/server/chunks/routes/api/tables/size.post.mjs.map +1 -1
  263. package/.output/server/chunks/routes/api/tables/structure.post.mjs +3 -2
  264. package/.output/server/chunks/routes/api/tables/structure.post.mjs.map +1 -1
  265. package/.output/server/chunks/routes/api/tables/triggers.post.mjs +3 -2
  266. package/.output/server/chunks/routes/api/tables/triggers.post.mjs.map +1 -1
  267. package/.output/server/chunks/routes/api/views/definition.post.mjs +3 -2
  268. package/.output/server/chunks/routes/api/views/definition.post.mjs.map +1 -1
  269. package/.output/server/chunks/routes/api/views/dependencies.post.mjs +3 -2
  270. package/.output/server/chunks/routes/api/views/dependencies.post.mjs.map +1 -1
  271. package/.output/server/chunks/routes/api/views/explain.post.mjs +3 -2
  272. package/.output/server/chunks/routes/api/views/explain.post.mjs.map +1 -1
  273. package/.output/server/chunks/routes/api/views/indexes.post.mjs +3 -2
  274. package/.output/server/chunks/routes/api/views/indexes.post.mjs.map +1 -1
  275. package/.output/server/chunks/routes/api/views/meta.post.mjs +3 -2
  276. package/.output/server/chunks/routes/api/views/meta.post.mjs.map +1 -1
  277. package/.output/server/chunks/routes/api/views/overview.post.mjs +3 -2
  278. package/.output/server/chunks/routes/api/views/overview.post.mjs.map +1 -1
  279. package/.output/server/chunks/routes/renderer.mjs +1 -1
  280. package/.output/server/package.json +1 -2
  281. package/package.json +1 -1
  282. package/.output/public/_nuxt/-sZwfgN3.js +0 -1
  283. package/.output/public/_nuxt/1iqadsOZ.js +0 -1
  284. package/.output/public/_nuxt/2WkPV7Mp.js +0 -22
  285. package/.output/public/_nuxt/B8rT4ISg.js +0 -2
  286. package/.output/public/_nuxt/B9Yq_mZo.js +0 -1
  287. package/.output/public/_nuxt/BCFLQ_rL.js +0 -9
  288. package/.output/public/_nuxt/BIHJR--x.js +0 -39
  289. package/.output/public/_nuxt/BNkZeak0.js +0 -1
  290. package/.output/public/_nuxt/BNqd1Zca.js +0 -1
  291. package/.output/public/_nuxt/BOZgY48g.js +0 -1
  292. package/.output/public/_nuxt/BSBcOKKj.js +0 -1
  293. package/.output/public/_nuxt/BYav_5oM.js +0 -1
  294. package/.output/public/_nuxt/B_U4hCvn.js +0 -7
  295. package/.output/public/_nuxt/BdCzQG_z.js +0 -1
  296. package/.output/public/_nuxt/BdX6JvdH.js +0 -20
  297. package/.output/public/_nuxt/BiMJOLHR.js +0 -1
  298. package/.output/public/_nuxt/BmREJclf.js +0 -1
  299. package/.output/public/_nuxt/Bwe8I9vL.js +0 -1
  300. package/.output/public/_nuxt/C20WaARR.js +0 -1
  301. package/.output/public/_nuxt/C4HRDaS8.js +0 -1
  302. package/.output/public/_nuxt/C6r_nDJz.js +0 -2
  303. package/.output/public/_nuxt/CBfQCVFf.js +0 -1
  304. package/.output/public/_nuxt/CDPrFhDR.js +0 -67
  305. package/.output/public/_nuxt/CJhlBUX_.js +0 -1
  306. package/.output/public/_nuxt/CLXbv9E5.js +0 -1
  307. package/.output/public/_nuxt/CMT3TfI0.js +0 -1
  308. package/.output/public/_nuxt/CS5akSNT.js +0 -1
  309. package/.output/public/_nuxt/CyEWn2V2.js +0 -1
  310. package/.output/public/_nuxt/D-pZQQ02.js +0 -1
  311. package/.output/public/_nuxt/D0mrO5vS.js +0 -1
  312. package/.output/public/_nuxt/D3ujZRkc.js +0 -1
  313. package/.output/public/_nuxt/D4PtOV7Y.js +0 -1
  314. package/.output/public/_nuxt/D6c_aTbv.js +0 -1
  315. package/.output/public/_nuxt/DDIVwUV6.js +0 -1
  316. package/.output/public/_nuxt/DIoeBtoF.js +0 -10
  317. package/.output/public/_nuxt/DLTvS7Vr.js +0 -2
  318. package/.output/public/_nuxt/DQf3b-ld.js +0 -1
  319. package/.output/public/_nuxt/DUqYnCG7.js +0 -1
  320. package/.output/public/_nuxt/DdRczQp2.js +0 -3
  321. package/.output/public/_nuxt/Ddtv9Dxp.js +0 -1
  322. package/.output/public/_nuxt/Dfzgj0Oq.js +0 -1
  323. package/.output/public/_nuxt/DgRHzRny.js +0 -1
  324. package/.output/public/_nuxt/Dm-rJ5VH.js +0 -1
  325. package/.output/public/_nuxt/DoB1FFC2.js +0 -1
  326. package/.output/public/_nuxt/Dp2UQPgO.js +0 -1
  327. package/.output/public/_nuxt/DyCQWd5B.js +0 -12
  328. package/.output/public/_nuxt/KK3goksi.js +0 -1
  329. package/.output/public/_nuxt/QuickQuery.CJ7tNjo4.css +0 -1
  330. package/.output/public/_nuxt/TKeZJpIw.js +0 -1
  331. package/.output/public/_nuxt/UHOKyE8O.js +0 -1
  332. package/.output/public/_nuxt/Z42SRPvO.js +0 -1
  333. package/.output/public/_nuxt/builds/meta/9b89410f-7683-420e-9dea-d15741f0e6ce.json +0 -1
  334. package/.output/public/_nuxt/doR1dsEF.js +0 -15
  335. package/.output/public/_nuxt/entry.DEE2Ngsu.css +0 -1
  336. package/.output/server/chunks/routes/api/ai/chat.mjs +0 -77
  337. package/.output/server/chunks/routes/api/ai/chat.mjs.map +0 -1
  338. package/.output/server/node_modules/ag-grid-community/dist/package/main.esm.mjs +0 -50065
  339. package/.output/server/node_modules/ag-grid-community/package.json +0 -113
@@ -0,0 +1,39 @@
1
+ import{d as me,e as ue,o as W,n as Le,g as I,j as Ra,D as Re,d9 as Qr,aE as Ha,f as K,w as le,m as ve,br as Jr,$ as Rt,da as jr,an as be,aK as En,r as ye,db as wi,l as Me,k as Ee,p as dn,F as Ie,c as j,bo as Va,ao as $t,s as Mt,a8 as Se,ar as it,aJ as es,dc as Fa,au as we,t as ze,av as La,bp as Ln,dd as Ya,q as ts,z as Be,aL as zt,de as ns,as as _e,aG as ge,i as It,al as Ga,df as Xa,aH as Ua,cO as ln,dg as yt,dh as Uo,aR as Wa,aS as Za,aU as qa,di as Ka,aD as Qa,W as os,aQ as fn,A as Te,bc as Ja,dj as is,a4 as Ue,dk as Vi,dl as Fi,cg as ja,a7 as at,a9 as lt,aa as ut,cG as Li,dm as Yi,dn as Yn,aI as el,cz as tl,dp as nl,bh as ol,cA as il,dq as rl,dr as sl,ds as al,dt as ll,X as ul}from"./DgGwe7jd.js";import{F as cl}from"./dDqgUqt5.js";const dl=me({__name:"KbdGroup",props:{class:{}},setup(e){const t=e;return(n,o)=>(W(),ue("kbd",{"data-slot":"kbd-group",class:Le(I(Ra)("inline-flex items-center gap-1",t.class))},[Re(n.$slots,"default")],2))}});function vo(e){return Jr()?(Ln(e),!0):!1}function et(e){return typeof e=="function"?e():I(e)}const fl=typeof window<"u"&&typeof document<"u",hl=e=>typeof e<"u",gl=Object.prototype.toString,pl=e=>gl.call(e)==="[object Object]",vl=()=>{};function ml(e,t){function n(...o){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(r)})}return n}const rs=e=>e();function yl(e=rs){const t=ye(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...r)=>{t.value&&e(...r)};return{isActive:Ua(t),pause:n,resume:o,eventFilter:i}}function Gi(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function wl(e,t,n={}){const{eventFilter:o=rs,...i}=n;return be(e,ml(o,t),i)}function Ht(e,t,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:s,resume:a,isActive:l}=yl(o);return{stop:wl(e,t,{...i,eventFilter:r}),pause:s,resume:a,isActive:l}}function _l(e,t={}){if(!It(e))return Ga(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=Xa(()=>({get(){return e.value[o]},set(i){var r;if((r=et(t.replaceRef))!=null?r:!0)if(Array.isArray(e.value)){const a=[...e.value];a[o]=i,e.value=a}else{const a={...e.value,[o]:i};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[o]=i}}));return n}function Wo(e,t=!1){function n(d,{flush:h="sync",deep:g=!1,timeout:E,throwOnTimeout:x}={}){let y=null;const S=[new Promise(_=>{y=be(e,N=>{d(N)!==t&&(y==null||y(),_(N))},{flush:h,deep:g,immediate:!0})})];return E!=null&&S.push(Gi(E,x).then(()=>et(e)).finally(()=>y==null?void 0:y())),Promise.race(S)}function o(d,h){if(!It(d))return n(N=>N===d,h);const{flush:g="sync",deep:E=!1,timeout:x,throwOnTimeout:y}=h??{};let m=null;const _=[new Promise(N=>{m=be([e,d],([P,O])=>{t!==(P===O)&&(m==null||m(),N(P))},{flush:g,deep:E,immediate:!0})})];return x!=null&&_.push(Gi(x,y).then(()=>et(e)).finally(()=>(m==null||m(),et(e)))),Promise.race(_)}function i(d){return n(h=>!!h,d)}function r(d){return o(null,d)}function s(d){return o(void 0,d)}function a(d){return n(Number.isNaN,d)}function l(d,h){return n(g=>{const E=Array.from(g);return E.includes(d)||E.includes(et(d))},h)}function u(d){return c(1,d)}function c(d=1,h){let g=-1;return n(()=>(g+=1,g>=d),h)}return Array.isArray(et(e))?{toMatch:n,toContains:l,changed:u,changedTimes:c,get not(){return Wo(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:a,toBeUndefined:s,changed:u,changedTimes:c,get not(){return Wo(e,!t)}}}function Zo(e){return Wo(e)}function bl(e){var t;const n=et(e);return(t=n==null?void 0:n.$el)!=null?t:n}const ss=fl?window:void 0;function as(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=ss):[t,n,o,i]=e,!t)return vl;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],s=()=>{r.forEach(c=>c()),r.length=0},a=(c,d,h,g)=>(c.addEventListener(d,h,g),()=>c.removeEventListener(d,h,g)),l=be(()=>[bl(t),et(i)],([c,d])=>{if(s(),!c)return;const h=pl(d)?{...d}:d;r.push(...n.flatMap(g=>o.map(E=>a(c,g,E,h))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return vo(u),u}function $l(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Xi(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=ss,eventName:r="keydown",passive:s=!1,dedupe:a=!1}=o,l=$l(t);return as(i,r,c=>{c.repeat&&et(a)||l(c)&&n(c)},s)}function xl(e){return JSON.parse(JSON.stringify(e))}function To(e,t,n,o={}){var i,r,s;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:h}=o,g=En(),E=n||(g==null?void 0:g.emit)||((i=g==null?void 0:g.$emit)==null?void 0:i.bind(g))||((s=(r=g==null?void 0:g.proxy)==null?void 0:r.$emit)==null?void 0:s.bind(g==null?void 0:g.proxy));let x=u;t||(t="modelValue"),x=x||`update:${t.toString()}`;const y=_=>a?typeof a=="function"?a(_):xl(_):_,m=()=>hl(e[t])?y(e[t]):d,S=_=>{h?h(_)&&E(x,_):E(x,_)};if(l){const _=m(),N=ye(_);let P=!1;return be(()=>e[t],O=>{P||(P=!0,N.value=y(O),it(()=>P=!1))}),be(N,O=>{!P&&(O!==e[t]||c)&&S(O)},{deep:c}),N}else return j({get(){return m()},set(_){S(_)}})}var El={value:()=>{}};function mo(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Gn(n)}function Gn(e){this._=e}function Sl(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Gn.prototype=mo.prototype={constructor:Gn,on:function(e,t){var n=this._,o=Sl(e+"",n),i,r=-1,s=o.length;if(arguments.length<2){for(;++r<s;)if((i=(e=o[r]).type)&&(i=Nl(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<s;)if(i=(e=o[r]).type)n[i]=Ui(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ui(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Gn(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)}};function Nl(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function Ui(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=El,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var qo="http://www.w3.org/1999/xhtml";const Wi={svg:"http://www.w3.org/2000/svg",xhtml:qo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function yo(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Wi.hasOwnProperty(t)?{space:Wi[t],local:e}:e}function Cl(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===qo&&t.documentElement.namespaceURI===qo?t.createElement(e):t.createElementNS(n,e)}}function kl(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ls(e){var t=yo(e);return(t.local?kl:Cl)(t)}function Ml(){}function _i(e){return e==null?Ml:function(){return this.querySelector(e)}}function Il(e){typeof e!="function"&&(e=_i(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=new Array(s),l,u,c=0;c<s;++c)(l=r[c])&&(u=e.call(l,l.__data__,c,r))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new Pe(o,this._parents)}function Tl(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Al(){return[]}function us(e){return e==null?Al:function(){return this.querySelectorAll(e)}}function Dl(e){return function(){return Tl(e.apply(this,arguments))}}function zl(e){typeof e=="function"?e=Dl(e):e=us(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var s=t[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(o.push(e.call(l,l.__data__,u,s)),i.push(l));return new Pe(o,i)}function cs(e){return function(){return this.matches(e)}}function ds(e){return function(t){return t.matches(e)}}var Pl=Array.prototype.find;function Ol(e){return function(){return Pl.call(this.children,e)}}function Bl(){return this.firstElementChild}function Rl(e){return this.select(e==null?Bl:Ol(typeof e=="function"?e:ds(e)))}var Hl=Array.prototype.filter;function Vl(){return Array.from(this.children)}function Fl(e){return function(){return Hl.call(this.children,e)}}function Ll(e){return this.selectAll(e==null?Vl:Fl(typeof e=="function"?e:ds(e)))}function Yl(e){typeof e!="function"&&(e=cs(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new Pe(o,this._parents)}function fs(e){return new Array(e.length)}function Gl(){return new Pe(this._enter||this._groups.map(fs),this._parents)}function Jn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Jn.prototype={constructor:Jn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Xl(e){return function(){return e}}function Ul(e,t,n,o,i,r){for(var s=0,a,l=t.length,u=r.length;s<u;++s)(a=t[s])?(a.__data__=r[s],o[s]=a):n[s]=new Jn(e,r[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function Wl(e,t,n,o,i,r,s){var a,l,u=new Map,c=t.length,d=r.length,h=new Array(c),g;for(a=0;a<c;++a)(l=t[a])&&(h[a]=g=s.call(l,l.__data__,a,t)+"",u.has(g)?i[a]=l:u.set(g,l));for(a=0;a<d;++a)g=s.call(e,r[a],a,r)+"",(l=u.get(g))?(o[a]=l,l.__data__=r[a],u.delete(g)):n[a]=new Jn(e,r[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(h[a])===l&&(i[a]=l)}function Zl(e){return e.__data__}function ql(e,t){if(!arguments.length)return Array.from(this,Zl);var n=t?Wl:Ul,o=this._parents,i=this._groups;typeof e!="function"&&(e=Xl(e));for(var r=i.length,s=new Array(r),a=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],d=i[u],h=d.length,g=Kl(e.call(c,c&&c.__data__,u,o)),E=g.length,x=a[u]=new Array(E),y=s[u]=new Array(E),m=l[u]=new Array(h);n(c,d,x,y,m,g,t);for(var S=0,_=0,N,P;S<E;++S)if(N=x[S]){for(S>=_&&(_=S+1);!(P=y[_])&&++_<E;);N._next=P||null}}return s=new Pe(s,o),s._enter=a,s._exit=l,s}function Kl(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ql(){return new Pe(this._exit||this._groups.map(fs),this._parents)}function Jl(e,t,n){var o=this.enter(),i=this,r=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function jl(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,s=Math.min(i,r),a=new Array(i),l=0;l<s;++l)for(var u=n[l],c=o[l],d=u.length,h=a[l]=new Array(d),g,E=0;E<d;++E)(g=u[E]||c[E])&&(h[E]=g);for(;l<i;++l)a[l]=n[l];return new Pe(a,this._parents)}function eu(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],s;--i>=0;)(s=o[i])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function tu(e){e||(e=nu);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var s=n[r],a=s.length,l=i[r]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new Pe(i,this._parents).order()}function nu(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ou(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function iu(){return Array.from(this)}function ru(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length;i<r;++i){var s=o[i];if(s)return s}return null}function su(){let e=0;for(const t of this)++e;return e}function au(){return!this.node()}function lu(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,s=i.length,a;r<s;++r)(a=i[r])&&e.call(a,a.__data__,r,i);return this}function uu(e){return function(){this.removeAttribute(e)}}function cu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function du(e,t){return function(){this.setAttribute(e,t)}}function fu(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function hu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function gu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function pu(e,t){var n=yo(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?cu:uu:typeof t=="function"?n.local?gu:hu:n.local?fu:du)(n,t))}function hs(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function vu(e){return function(){this.style.removeProperty(e)}}function mu(e,t,n){return function(){this.style.setProperty(e,t,n)}}function yu(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function wu(e,t,n){return arguments.length>1?this.each((t==null?vu:typeof t=="function"?yu:mu)(e,t,n??"")):Gt(this.node(),e)}function Gt(e,t){return e.style.getPropertyValue(t)||hs(e).getComputedStyle(e,null).getPropertyValue(t)}function _u(e){return function(){delete this[e]}}function bu(e,t){return function(){this[e]=t}}function $u(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function xu(e,t){return arguments.length>1?this.each((t==null?_u:typeof t=="function"?$u:bu)(e,t)):this.node()[e]}function gs(e){return e.trim().split(/^|\s+/)}function bi(e){return e.classList||new ps(e)}function ps(e){this._node=e,this._names=gs(e.getAttribute("class")||"")}ps.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function vs(e,t){for(var n=bi(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function ms(e,t){for(var n=bi(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function Eu(e){return function(){vs(this,e)}}function Su(e){return function(){ms(this,e)}}function Nu(e,t){return function(){(t.apply(this,arguments)?vs:ms)(this,e)}}function Cu(e,t){var n=gs(e+"");if(arguments.length<2){for(var o=bi(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Nu:t?Eu:Su)(n,t))}function ku(){this.textContent=""}function Mu(e){return function(){this.textContent=e}}function Iu(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Tu(e){return arguments.length?this.each(e==null?ku:(typeof e=="function"?Iu:Mu)(e)):this.node().textContent}function Au(){this.innerHTML=""}function Du(e){return function(){this.innerHTML=e}}function zu(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Pu(e){return arguments.length?this.each(e==null?Au:(typeof e=="function"?zu:Du)(e)):this.node().innerHTML}function Ou(){this.nextSibling&&this.parentNode.appendChild(this)}function Bu(){return this.each(Ou)}function Ru(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Hu(){return this.each(Ru)}function Vu(e){var t=typeof e=="function"?e:ls(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Fu(){return null}function Lu(e,t){var n=typeof e=="function"?e:ls(e),o=t==null?Fu:typeof t=="function"?t:_i(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Yu(){var e=this.parentNode;e&&e.removeChild(this)}function Gu(){return this.each(Yu)}function Xu(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Uu(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Wu(e){return this.select(e?Uu:Xu)}function Zu(e){return arguments.length?this.property("__data__",e):this.node().__data__}function qu(e){return function(t){e.call(this,t,this.__data__)}}function Ku(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Qu(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,r;n<i;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++o]=r;++o?t.length=o:delete this.__on}}}function Ju(e,t,n){return function(){var o=this.__on,i,r=qu(t);if(o){for(var s=0,a=o.length;s<a;++s)if((i=o[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=t;return}}this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}function ju(e,t,n){var o=Ku(e+""),i,r=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(i=0,c=a[l];i<r;++i)if((s=o[i]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?Ju:Qu,i=0;i<r;++i)this.each(a(o[i],t,n));return this}function ys(e,t,n){var o=hs(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function ec(e,t){return function(){return ys(this,e,t)}}function tc(e,t){return function(){return ys(this,e,t.apply(this,arguments))}}function nc(e,t){return this.each((typeof t=="function"?tc:ec)(e,t))}function*oc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,s;i<r;++i)(s=o[i])&&(yield s)}var ws=[null];function Pe(e,t){this._groups=e,this._parents=t}function Sn(){return new Pe([[document.documentElement]],ws)}function ic(){return this}Pe.prototype=Sn.prototype={constructor:Pe,select:Il,selectAll:zl,selectChild:Rl,selectChildren:Ll,filter:Yl,data:ql,enter:Gl,exit:Ql,join:Jl,merge:jl,selection:ic,order:eu,sort:tu,call:ou,nodes:iu,node:ru,size:su,empty:au,each:lu,attr:pu,style:wu,property:xu,classed:Cu,text:Tu,html:Pu,raise:Bu,lower:Hu,append:Vu,insert:Lu,remove:Gu,clone:Wu,datum:Zu,on:ju,dispatch:nc,[Symbol.iterator]:oc};function He(e){return typeof e=="string"?new Pe([[document.querySelector(e)]],[document.documentElement]):new Pe([[e]],ws)}function rc(e){let t;for(;t=e.sourceEvent;)e=t;return e}function We(e,t){if(e=rc(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const sc={passive:!1},hn={capture:!0,passive:!1};function Ao(e){e.stopImmediatePropagation()}function Vt(e){e.preventDefault(),e.stopImmediatePropagation()}function _s(e){var t=e.document.documentElement,n=He(e).on("dragstart.drag",Vt,hn);"onselectstart"in t?n.on("selectstart.drag",Vt,hn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function bs(e,t){var n=e.document.documentElement,o=He(e).on("dragstart.drag",null);t&&(o.on("click.drag",Vt,hn),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const In=e=>()=>e;function Ko(e,{sourceEvent:t,subject:n,target:o,identifier:i,active:r,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}Ko.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ac(e){return!e.ctrlKey&&!e.button}function lc(){return this.parentNode}function uc(e,t){return t??{x:e.x,y:e.y}}function cc(){return navigator.maxTouchPoints||"ontouchstart"in this}function dc(){var e=ac,t=lc,n=uc,o=cc,i={},r=mo("start","drag","end"),s=0,a,l,u,c,d=0;function h(N){N.on("mousedown.drag",g).filter(o).on("touchstart.drag",y).on("touchmove.drag",m,sc).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(N,P){if(!(c||!e.call(this,N,P))){var O=_(this,t.call(this,N,P),N,P,"mouse");O&&(He(N.view).on("mousemove.drag",E,hn).on("mouseup.drag",x,hn),_s(N.view),Ao(N),u=!1,a=N.clientX,l=N.clientY,O("start",N))}}function E(N){if(Vt(N),!u){var P=N.clientX-a,O=N.clientY-l;u=P*P+O*O>d}i.mouse("drag",N)}function x(N){He(N.view).on("mousemove.drag mouseup.drag",null),bs(N.view,u),Vt(N),i.mouse("end",N)}function y(N,P){if(e.call(this,N,P)){var O=N.changedTouches,z=t.call(this,N,P),R=O.length,G,V;for(G=0;G<R;++G)(V=_(this,z,N,P,O[G].identifier,O[G]))&&(Ao(N),V("start",N,O[G]))}}function m(N){var P=N.changedTouches,O=P.length,z,R;for(z=0;z<O;++z)(R=i[P[z].identifier])&&(Vt(N),R("drag",N,P[z]))}function S(N){var P=N.changedTouches,O=P.length,z,R;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),z=0;z<O;++z)(R=i[P[z].identifier])&&(Ao(N),R("end",N,P[z]))}function _(N,P,O,z,R,G){var V=r.copy(),L=We(G||O,P),M,Z,f;if((f=n.call(N,new Ko("beforestart",{sourceEvent:O,target:h,identifier:R,active:s,x:L[0],y:L[1],dx:0,dy:0,dispatch:V}),z))!=null)return M=f.x-L[0]||0,Z=f.y-L[1]||0,function k(p,T,C){var D=L,A;switch(p){case"start":i[R]=k,A=s++;break;case"end":delete i[R],--s;case"drag":L=We(C||T,P),A=s;break}V.call(p,N,new Ko(p,{sourceEvent:T,subject:f,target:h,identifier:R,active:A,x:L[0]+M,y:L[1]+Z,dx:L[0]-D[0],dy:L[1]-D[1],dispatch:V}),z)}}return h.filter=function(N){return arguments.length?(e=typeof N=="function"?N:In(!!N),h):e},h.container=function(N){return arguments.length?(t=typeof N=="function"?N:In(N),h):t},h.subject=function(N){return arguments.length?(n=typeof N=="function"?N:In(N),h):n},h.touchable=function(N){return arguments.length?(o=typeof N=="function"?N:In(!!N),h):o},h.on=function(){var N=r.on.apply(r,arguments);return N===r?h:N},h.clickDistance=function(N){return arguments.length?(d=(N=+N)*N,h):Math.sqrt(d)},h}function $i(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function $s(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Nn(){}var gn=.7,jn=1/gn,Ft="\\s*([+-]?\\d+)\\s*",pn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ze="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fc=/^#([0-9a-f]{3,8})$/,hc=new RegExp(`^rgb\\(${Ft},${Ft},${Ft}\\)$`),gc=new RegExp(`^rgb\\(${Ze},${Ze},${Ze}\\)$`),pc=new RegExp(`^rgba\\(${Ft},${Ft},${Ft},${pn}\\)$`),vc=new RegExp(`^rgba\\(${Ze},${Ze},${Ze},${pn}\\)$`),mc=new RegExp(`^hsl\\(${pn},${Ze},${Ze}\\)$`),yc=new RegExp(`^hsla\\(${pn},${Ze},${Ze},${pn}\\)$`),Zi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};$i(Nn,vn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qi,formatHex:qi,formatHex8:wc,formatHsl:_c,formatRgb:Ki,toString:Ki});function qi(){return this.rgb().formatHex()}function wc(){return this.rgb().formatHex8()}function _c(){return xs(this).formatHsl()}function Ki(){return this.rgb().formatRgb()}function vn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=fc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Qi(t):n===3?new Ae(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Tn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Tn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=hc.exec(e))?new Ae(t[1],t[2],t[3],1):(t=gc.exec(e))?new Ae(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=pc.exec(e))?Tn(t[1],t[2],t[3],t[4]):(t=vc.exec(e))?Tn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=mc.exec(e))?er(t[1],t[2]/100,t[3]/100,1):(t=yc.exec(e))?er(t[1],t[2]/100,t[3]/100,t[4]):Zi.hasOwnProperty(e)?Qi(Zi[e]):e==="transparent"?new Ae(NaN,NaN,NaN,0):null}function Qi(e){return new Ae(e>>16&255,e>>8&255,e&255,1)}function Tn(e,t,n,o){return o<=0&&(e=t=n=NaN),new Ae(e,t,n,o)}function bc(e){return e instanceof Nn||(e=vn(e)),e?(e=e.rgb(),new Ae(e.r,e.g,e.b,e.opacity)):new Ae}function Qo(e,t,n,o){return arguments.length===1?bc(e):new Ae(e,t,n,o??1)}function Ae(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}$i(Ae,Qo,$s(Nn,{brighter(e){return e=e==null?jn:Math.pow(jn,e),new Ae(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?gn:Math.pow(gn,e),new Ae(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ae(Tt(this.r),Tt(this.g),Tt(this.b),eo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ji,formatHex:Ji,formatHex8:$c,formatRgb:ji,toString:ji}));function Ji(){return`#${Ct(this.r)}${Ct(this.g)}${Ct(this.b)}`}function $c(){return`#${Ct(this.r)}${Ct(this.g)}${Ct(this.b)}${Ct((isNaN(this.opacity)?1:this.opacity)*255)}`}function ji(){const e=eo(this.opacity);return`${e===1?"rgb(":"rgba("}${Tt(this.r)}, ${Tt(this.g)}, ${Tt(this.b)}${e===1?")":`, ${e})`}`}function eo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ct(e){return e=Tt(e),(e<16?"0":"")+e.toString(16)}function er(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ve(e,t,n,o)}function xs(e){if(e instanceof Ve)return new Ve(e.h,e.s,e.l,e.opacity);if(e instanceof Nn||(e=vn(e)),!e)return new Ve;if(e instanceof Ve)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),s=NaN,a=r-i,l=(r+i)/2;return a?(t===r?s=(n-o)/a+(n<o)*6:n===r?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?r+i:2-r-i,s*=60):a=l>0&&l<1?0:s,new Ve(s,a,l,e.opacity)}function xc(e,t,n,o){return arguments.length===1?xs(e):new Ve(e,t,n,o??1)}function Ve(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}$i(Ve,xc,$s(Nn,{brighter(e){return e=e==null?jn:Math.pow(jn,e),new Ve(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?gn:Math.pow(gn,e),new Ve(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new Ae(Do(e>=240?e-240:e+120,i,o),Do(e,i,o),Do(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Ve(tr(this.h),An(this.s),An(this.l),eo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=eo(this.opacity);return`${e===1?"hsl(":"hsla("}${tr(this.h)}, ${An(this.s)*100}%, ${An(this.l)*100}%${e===1?")":`, ${e})`}`}}));function tr(e){return e=(e||0)%360,e<0?e+360:e}function An(e){return Math.max(0,Math.min(1,e||0))}function Do(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Es=e=>()=>e;function Ec(e,t){return function(n){return e+n*t}}function Sc(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function Nc(e){return(e=+e)==1?Ss:function(t,n){return n-t?Sc(t,n,e):Es(isNaN(t)?n:t)}}function Ss(e,t){var n=t-e;return n?Ec(e,n):Es(isNaN(e)?t:e)}const nr=function e(t){var n=Nc(t);function o(i,r){var s=n((i=Qo(i)).r,(r=Qo(r)).r),a=n(i.g,r.g),l=n(i.b,r.b),u=Ss(i.opacity,r.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return o.gamma=e,o}(1);function ht(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Jo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zo=new RegExp(Jo.source,"g");function Cc(e){return function(){return e}}function kc(e){return function(t){return e(t)+""}}function Mc(e,t){var n=Jo.lastIndex=zo.lastIndex=0,o,i,r,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=Jo.exec(e))&&(i=zo.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),a[s]?a[s]+=r:a[++s]=r),(o=o[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:ht(o,i)})),n=zo.lastIndex;return n<t.length&&(r=t.slice(n),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?kc(l[0].x):Cc(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}var or=180/Math.PI,jo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ns(e,t,n,o,i,r){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*or,skewX:Math.atan(l)*or,scaleX:s,scaleY:a}}var Dn;function Ic(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?jo:Ns(t.a,t.b,t.c,t.d,t.e,t.f)}function Tc(e){return e==null||(Dn||(Dn=document.createElementNS("http://www.w3.org/2000/svg","g")),Dn.setAttribute("transform",e),!(e=Dn.transform.baseVal.consolidate()))?jo:(e=e.matrix,Ns(e.a,e.b,e.c,e.d,e.e,e.f))}function Cs(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,d,h,g,E){if(u!==d||c!==h){var x=g.push("translate(",null,t,null,n);E.push({i:x-4,x:ht(u,d)},{i:x-2,x:ht(c,h)})}else(d||h)&&g.push("translate("+d+t+h+n)}function s(u,c,d,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:d.push(i(d)+"rotate(",null,o)-2,x:ht(u,c)})):c&&d.push(i(d)+"rotate("+c+o)}function a(u,c,d,h){u!==c?h.push({i:d.push(i(d)+"skewX(",null,o)-2,x:ht(u,c)}):c&&d.push(i(d)+"skewX("+c+o)}function l(u,c,d,h,g,E){if(u!==d||c!==h){var x=g.push(i(g)+"scale(",null,",",null,")");E.push({i:x-4,x:ht(u,d)},{i:x-2,x:ht(c,h)})}else(d!==1||h!==1)&&g.push(i(g)+"scale("+d+","+h+")")}return function(u,c){var d=[],h=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,d,h),s(u.rotate,c.rotate,d,h),a(u.skewX,c.skewX,d,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,h),u=c=null,function(g){for(var E=-1,x=h.length,y;++E<x;)d[(y=h[E]).i]=y.x(g);return d.join("")}}}var Ac=Cs(Ic,"px, ","px)","deg)"),Dc=Cs(Tc,", ",")",")"),zc=1e-12;function ir(e){return((e=Math.exp(e))+1/e)/2}function Pc(e){return((e=Math.exp(e))-1/e)/2}function Oc(e){return((e=Math.exp(2*e))-1)/(e+1)}const Bc=function e(t,n,o){function i(r,s){var a=r[0],l=r[1],u=r[2],c=s[0],d=s[1],h=s[2],g=c-a,E=d-l,x=g*g+E*E,y,m;if(x<zc)m=Math.log(h/u)/t,y=function(z){return[a+z*g,l+z*E,u*Math.exp(t*z*m)]};else{var S=Math.sqrt(x),_=(h*h-u*u+o*x)/(2*u*n*S),N=(h*h-u*u-o*x)/(2*h*n*S),P=Math.log(Math.sqrt(_*_+1)-_),O=Math.log(Math.sqrt(N*N+1)-N);m=(O-P)/t,y=function(z){var R=z*m,G=ir(P),V=u/(n*S)*(G*Oc(t*R+P)-Pc(P));return[a+V*g,l+V*E,u*G/ir(t*R+P)]}}return y.duration=m*1e3*t/Math.SQRT2,y}return i.rho=function(r){var s=Math.max(.001,+r),a=s*s,l=a*a;return e(s,a,l)},i}(Math.SQRT2,2,4);var Xt=0,nn=0,Jt=0,ks=1e3,to,on,no=0,Pt=0,wo=0,mn=typeof performance=="object"&&performance.now?performance:Date,Ms=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function xi(){return Pt||(Ms(Rc),Pt=mn.now()+wo)}function Rc(){Pt=0}function oo(){this._call=this._time=this._next=null}oo.prototype=Is.prototype={constructor:oo,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?xi():+n)+(t==null?0:+t),!this._next&&on!==this&&(on?on._next=this:to=this,on=this),this._call=e,this._time=n,ei()},stop:function(){this._call&&(this._call=null,this._time=1/0,ei())}};function Is(e,t,n){var o=new oo;return o.restart(e,t,n),o}function Hc(){xi(),++Xt;for(var e=to,t;e;)(t=Pt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Xt}function rr(){Pt=(no=mn.now())+wo,Xt=nn=0;try{Hc()}finally{Xt=0,Fc(),Pt=0}}function Vc(){var e=mn.now(),t=e-no;t>ks&&(wo-=t,no=e)}function Fc(){for(var e,t=to,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:to=n);on=e,ei(o)}function ei(e){if(!Xt){nn&&(nn=clearTimeout(nn));var t=e-Pt;t>24?(e<1/0&&(nn=setTimeout(rr,e-mn.now()-wo)),Jt&&(Jt=clearInterval(Jt))):(Jt||(no=mn.now(),Jt=setInterval(Vc,ks)),Xt=1,Ms(rr))}}function sr(e,t,n){var o=new oo;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var Lc=mo("start","end","cancel","interrupt"),Yc=[],Ts=0,ar=1,ti=2,Xn=3,lr=4,ni=5,Un=6;function _o(e,t,n,o,i,r){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Gc(e,n,{name:t,index:o,group:i,on:Lc,tween:Yc,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ts})}function Ei(e,t){var n=Ye(e,t);if(n.state>Ts)throw new Error("too late; already scheduled");return n}function Ke(e,t){var n=Ye(e,t);if(n.state>Xn)throw new Error("too late; already running");return n}function Ye(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Gc(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=Is(r,0,n.time);function r(u){n.state=ar,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,h,g;if(n.state!==ar)return l();for(c in o)if(g=o[c],g.name===n.name){if(g.state===Xn)return sr(s);g.state===lr?(g.state=Un,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete o[c]):+c<t&&(g.state=Un,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete o[c])}if(sr(function(){n.state===Xn&&(n.state=lr,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=ti,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ti){for(n.state=Xn,i=new Array(h=n.tween.length),c=0,d=-1;c<h;++c)(g=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=g);i.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=ni,1),d=-1,h=i.length;++d<h;)i[d].call(e,c);n.state===ni&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Un,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function Wn(e,t){var n=e.__transition,o,i,r=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){r=!1;continue}i=o.state>ti&&o.state<ni,o.state=Un,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}r&&delete e.__transition}}function Xc(e){return this.each(function(){Wn(this,e)})}function Uc(e,t){var n,o;return function(){var i=Ke(this,e),r=i.tween;if(r!==n){o=n=r;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}i.tween=o}}function Wc(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=Ke(this,e),s=r.tween;if(s!==o){i=(o=s).slice();for(var a={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=a;break}l===u&&i.push(a)}r.tween=i}}function Zc(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Ye(this.node(),n).tween,i=0,r=o.length,s;i<r;++i)if((s=o[i]).name===e)return s.value;return null}return this.each((t==null?Uc:Wc)(n,e,t))}function Si(e,t,n){var o=e._id;return e.each(function(){var i=Ke(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ye(i,o).value[t]}}function As(e,t){var n;return(typeof t=="number"?ht:t instanceof vn?nr:(n=vn(t))?(t=n,nr):Mc)(e,t)}function qc(e){return function(){this.removeAttribute(e)}}function Kc(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Qc(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttribute(e);return s===i?null:s===o?r:r=t(o=s,n)}}function Jc(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===o?r:r=t(o=s,n)}}function jc(e,t,n){var o,i,r;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a)))}}function ed(e,t,n){var o,i,r;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a)))}}function td(e,t){var n=yo(e),o=n==="transform"?Dc:As;return this.attrTween(e,typeof t=="function"?(n.local?ed:jc)(n,o,Si(this,"attr."+e,t)):t==null?(n.local?Kc:qc)(n):(n.local?Jc:Qc)(n,o,t))}function nd(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function od(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function id(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&od(e,r)),n}return i._value=t,i}function rd(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&nd(e,r)),n}return i._value=t,i}function sd(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=yo(e);return this.tween(n,(o.local?id:rd)(o,t))}function ad(e,t){return function(){Ei(this,e).delay=+t.apply(this,arguments)}}function ld(e,t){return t=+t,function(){Ei(this,e).delay=t}}function ud(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ad:ld)(t,e)):Ye(this.node(),t).delay}function cd(e,t){return function(){Ke(this,e).duration=+t.apply(this,arguments)}}function dd(e,t){return t=+t,function(){Ke(this,e).duration=t}}function fd(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cd:dd)(t,e)):Ye(this.node(),t).duration}function hd(e,t){if(typeof t!="function")throw new Error;return function(){Ke(this,e).ease=t}}function gd(e){var t=this._id;return arguments.length?this.each(hd(t,e)):Ye(this.node(),t).ease}function pd(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ke(this,e).ease=n}}function vd(e){if(typeof e!="function")throw new Error;return this.each(pd(this._id,e))}function md(e){typeof e!="function"&&(e=cs(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new rt(o,this._parents,this._name,this._id)}function yd(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,r=Math.min(o,i),s=new Array(o),a=0;a<r;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),h,g=0;g<c;++g)(h=l[g]||u[g])&&(d[g]=h);for(;a<o;++a)s[a]=t[a];return new rt(s,this._parents,this._name,this._id)}function wd(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function _d(e,t,n){var o,i,r=wd(t)?Ei:Ke;return function(){var s=r(this,e),a=s.on;a!==o&&(i=(o=a).copy()).on(t,n),s.on=i}}function bd(e,t){var n=this._id;return arguments.length<2?Ye(this.node(),n).on.on(e):this.each(_d(n,e,t))}function $d(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function xd(){return this.on("end.remove",$d(this._id))}function Ed(e){var t=this._name,n=this._id;typeof e!="function"&&(e=_i(e));for(var o=this._groups,i=o.length,r=new Array(i),s=0;s<i;++s)for(var a=o[s],l=a.length,u=r[s]=new Array(l),c,d,h=0;h<l;++h)(c=a[h])&&(d=e.call(c,c.__data__,h,a))&&("__data__"in c&&(d.__data__=c.__data__),u[h]=d,_o(u[h],t,n,h,u,Ye(c,n)));return new rt(r,this._parents,t,n)}function Sd(e){var t=this._name,n=this._id;typeof e!="function"&&(e=us(e));for(var o=this._groups,i=o.length,r=[],s=[],a=0;a<i;++a)for(var l=o[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var h=e.call(c,c.__data__,d,l),g,E=Ye(c,n),x=0,y=h.length;x<y;++x)(g=h[x])&&_o(g,t,n,x,h,E);r.push(h),s.push(c)}return new rt(r,s,t,n)}var Nd=Sn.prototype.constructor;function Cd(){return new Nd(this._groups,this._parents)}function kd(e,t){var n,o,i;return function(){var r=Gt(this,e),s=(this.style.removeProperty(e),Gt(this,e));return r===s?null:r===n&&s===o?i:i=t(n=r,o=s)}}function Ds(e){return function(){this.style.removeProperty(e)}}function Md(e,t,n){var o,i=n+"",r;return function(){var s=Gt(this,e);return s===i?null:s===o?r:r=t(o=s,n)}}function Id(e,t,n){var o,i,r;return function(){var s=Gt(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Gt(this,e))),s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a))}}function Td(e,t){var n,o,i,r="style."+t,s="end."+r,a;return function(){var l=Ke(this,e),u=l.on,c=l.value[r]==null?a||(a=Ds(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(s,i=c),l.on=o}}function Ad(e,t,n){var o=(e+="")=="transform"?Ac:As;return t==null?this.styleTween(e,kd(e,o)).on("end.style."+e,Ds(e)):typeof t=="function"?this.styleTween(e,Id(e,o,Si(this,"style."+e,t))).each(Td(this._id,e)):this.styleTween(e,Md(e,o,t),n).on("end.style."+e,null)}function Dd(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function zd(e,t,n){var o,i;function r(){var s=t.apply(this,arguments);return s!==i&&(o=(i=s)&&Dd(e,s,n)),o}return r._value=t,r}function Pd(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,zd(e,t,n??""))}function Od(e){return function(){this.textContent=e}}function Bd(e){return function(){var t=e(this);this.textContent=t??""}}function Rd(e){return this.tween("text",typeof e=="function"?Bd(Si(this,"text",e)):Od(e==null?"":e+""))}function Hd(e){return function(t){this.textContent=e.call(this,t)}}function Vd(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Hd(i)),t}return o._value=e,o}function Fd(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Vd(e))}function Ld(){for(var e=this._name,t=this._id,n=zs(),o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=Ye(l,t);_o(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new rt(o,this._parents,e,n)}function Yd(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,s){var a={value:s},l={value:function(){--i===0&&r()}};n.each(function(){var u=Ke(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),i===0&&r()})}var Gd=0;function rt(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function zs(){return++Gd}var Je=Sn.prototype;rt.prototype={constructor:rt,select:Ed,selectAll:Sd,selectChild:Je.selectChild,selectChildren:Je.selectChildren,filter:md,merge:yd,selection:Cd,transition:Ld,call:Je.call,nodes:Je.nodes,node:Je.node,size:Je.size,empty:Je.empty,each:Je.each,on:bd,attr:td,attrTween:sd,style:Ad,styleTween:Pd,text:Rd,textTween:Fd,remove:xd,tween:Zc,delay:ud,duration:fd,ease:gd,easeVarying:vd,end:Yd,[Symbol.iterator]:Je[Symbol.iterator]};function Xd(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ud={time:null,delay:0,duration:250,ease:Xd};function Wd(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Zd(e){var t,n;e instanceof rt?(t=e._id,e=e._name):(t=zs(),(n=Ud).time=xi(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&_o(l,e,t,u,s,n||Wd(l,t));return new rt(o,this._parents,e,t)}Sn.prototype.interrupt=Xc;Sn.prototype.transition=Zd;const zn=e=>()=>e;function qd(e,{sourceEvent:t,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function tt(e,t,n){this.k=e,this.x=t,this.y=n}tt.prototype={constructor:tt,scale:function(e){return e===1?this:new tt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new tt(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ut=new tt(1,0,0);tt.prototype;function Po(e){e.stopImmediatePropagation()}function jt(e){e.preventDefault(),e.stopImmediatePropagation()}function Kd(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Qd(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ur(){return this.__zoom||Ut}function Jd(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function jd(){return navigator.maxTouchPoints||"ontouchstart"in this}function ef(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function tf(){var e=Kd,t=Qd,n=ef,o=Jd,i=jd,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Bc,u=mo("start","zoom","end"),c,d,h,g=500,E=150,x=0,y=10;function m(f){f.property("__zoom",ur).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",G).on("dblclick.zoom",V).filter(i).on("touchstart.zoom",L).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",Z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(f,k,p,T){var C=f.selection?f.selection():f;C.property("__zoom",ur),f!==C?P(f,k,p,T):C.interrupt().each(function(){O(this,arguments).event(T).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},m.scaleBy=function(f,k,p,T){m.scaleTo(f,function(){var C=this.__zoom.k,D=typeof k=="function"?k.apply(this,arguments):k;return C*D},p,T)},m.scaleTo=function(f,k,p,T){m.transform(f,function(){var C=t.apply(this,arguments),D=this.__zoom,A=p==null?N(C):typeof p=="function"?p.apply(this,arguments):p,H=D.invert(A),X=typeof k=="function"?k.apply(this,arguments):k;return n(_(S(D,X),A,H),C,s)},p,T)},m.translateBy=function(f,k,p,T){m.transform(f,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof p=="function"?p.apply(this,arguments):p),t.apply(this,arguments),s)},null,T)},m.translateTo=function(f,k,p,T,C){m.transform(f,function(){var D=t.apply(this,arguments),A=this.__zoom,H=T==null?N(D):typeof T=="function"?T.apply(this,arguments):T;return n(Ut.translate(H[0],H[1]).scale(A.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof p=="function"?-p.apply(this,arguments):-p),D,s)},T,C)};function S(f,k){return k=Math.max(r[0],Math.min(r[1],k)),k===f.k?f:new tt(k,f.x,f.y)}function _(f,k,p){var T=k[0]-p[0]*f.k,C=k[1]-p[1]*f.k;return T===f.x&&C===f.y?f:new tt(f.k,T,C)}function N(f){return[(+f[0][0]+ +f[1][0])/2,(+f[0][1]+ +f[1][1])/2]}function P(f,k,p,T){f.on("start.zoom",function(){O(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event(T).end()}).tween("zoom",function(){var C=this,D=arguments,A=O(C,D).event(T),H=t.apply(C,D),X=p==null?N(H):typeof p=="function"?p.apply(C,D):p,ee=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),F=C.__zoom,Y=typeof k=="function"?k.apply(C,D):k,q=l(F.invert(X).concat(ee/F.k),Y.invert(X).concat(ee/Y.k));return function(ie){if(ie===1)ie=Y;else{var ae=q(ie),re=ee/ae[2];ie=new tt(re,X[0]-ae[0]*re,X[1]-ae[1]*re)}A.zoom(null,ie)}})}function O(f,k,p){return!p&&f.__zooming||new z(f,k)}function z(f,k){this.that=f,this.args=k,this.active=0,this.sourceEvent=null,this.extent=t.apply(f,k),this.taps=0}z.prototype={event:function(f){return f&&(this.sourceEvent=f),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(f,k){return this.mouse&&f!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&f!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&f!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(f){var k=He(this.that).datum();u.call(f,this.that,new qd(f,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),k)}};function R(f,...k){if(!e.apply(this,arguments))return;var p=O(this,k).event(f),T=this.__zoom,C=Math.max(r[0],Math.min(r[1],T.k*Math.pow(2,o.apply(this,arguments)))),D=We(f);if(p.wheel)(p.mouse[0][0]!==D[0]||p.mouse[0][1]!==D[1])&&(p.mouse[1]=T.invert(p.mouse[0]=D)),clearTimeout(p.wheel);else{if(T.k===C)return;p.mouse=[D,T.invert(D)],Wn(this),p.start()}jt(f),p.wheel=setTimeout(A,E),p.zoom("mouse",n(_(S(T,C),p.mouse[0],p.mouse[1]),p.extent,s));function A(){p.wheel=null,p.end()}}function G(f,...k){if(h||!e.apply(this,arguments))return;var p=f.currentTarget,T=O(this,k,!0).event(f),C=He(f.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",ee,!0),D=We(f,p),A=f.clientX,H=f.clientY;_s(f.view),Po(f),T.mouse=[D,this.__zoom.invert(D)],Wn(this),T.start();function X(F){if(jt(F),!T.moved){var Y=F.clientX-A,q=F.clientY-H;T.moved=Y*Y+q*q>x}T.event(F).zoom("mouse",n(_(T.that.__zoom,T.mouse[0]=We(F,p),T.mouse[1]),T.extent,s))}function ee(F){C.on("mousemove.zoom mouseup.zoom",null),bs(F.view,T.moved),jt(F),T.event(F).end()}}function V(f,...k){if(e.apply(this,arguments)){var p=this.__zoom,T=We(f.changedTouches?f.changedTouches[0]:f,this),C=p.invert(T),D=p.k*(f.shiftKey?.5:2),A=n(_(S(p,D),T,C),t.apply(this,k),s);jt(f),a>0?He(this).transition().duration(a).call(P,A,T,f):He(this).call(m.transform,A,T,f)}}function L(f,...k){if(e.apply(this,arguments)){var p=f.touches,T=p.length,C=O(this,k,f.changedTouches.length===T).event(f),D,A,H,X;for(Po(f),A=0;A<T;++A)H=p[A],X=We(H,this),X=[X,this.__zoom.invert(X),H.identifier],C.touch0?!C.touch1&&C.touch0[2]!==X[2]&&(C.touch1=X,C.taps=0):(C.touch0=X,D=!0,C.taps=1+!!c);c&&(c=clearTimeout(c)),D&&(C.taps<2&&(d=X[0],c=setTimeout(function(){c=null},g)),Wn(this),C.start())}}function M(f,...k){if(this.__zooming){var p=O(this,k).event(f),T=f.changedTouches,C=T.length,D,A,H,X;for(jt(f),D=0;D<C;++D)A=T[D],H=We(A,this),p.touch0&&p.touch0[2]===A.identifier?p.touch0[0]=H:p.touch1&&p.touch1[2]===A.identifier&&(p.touch1[0]=H);if(A=p.that.__zoom,p.touch1){var ee=p.touch0[0],F=p.touch0[1],Y=p.touch1[0],q=p.touch1[1],ie=(ie=Y[0]-ee[0])*ie+(ie=Y[1]-ee[1])*ie,ae=(ae=q[0]-F[0])*ae+(ae=q[1]-F[1])*ae;A=S(A,Math.sqrt(ie/ae)),H=[(ee[0]+Y[0])/2,(ee[1]+Y[1])/2],X=[(F[0]+q[0])/2,(F[1]+q[1])/2]}else if(p.touch0)H=p.touch0[0],X=p.touch0[1];else return;p.zoom("touch",n(_(A,H,X),p.extent,s))}}function Z(f,...k){if(this.__zooming){var p=O(this,k).event(f),T=f.changedTouches,C=T.length,D,A;for(Po(f),h&&clearTimeout(h),h=setTimeout(function(){h=null},g),D=0;D<C;++D)A=T[D],p.touch0&&p.touch0[2]===A.identifier?delete p.touch0:p.touch1&&p.touch1[2]===A.identifier&&delete p.touch1;if(p.touch1&&!p.touch0&&(p.touch0=p.touch1,delete p.touch1),p.touch0)p.touch0[1]=this.__zoom.invert(p.touch0[0]);else if(p.end(),p.taps===2&&(A=We(A,this),Math.hypot(d[0]-A[0],d[1]-A[1])<y)){var H=He(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return m.wheelDelta=function(f){return arguments.length?(o=typeof f=="function"?f:zn(+f),m):o},m.filter=function(f){return arguments.length?(e=typeof f=="function"?f:zn(!!f),m):e},m.touchable=function(f){return arguments.length?(i=typeof f=="function"?f:zn(!!f),m):i},m.extent=function(f){return arguments.length?(t=typeof f=="function"?f:zn([[+f[0][0],+f[0][1]],[+f[1][0],+f[1][1]]]),m):t},m.scaleExtent=function(f){return arguments.length?(r[0]=+f[0],r[1]=+f[1],m):[r[0],r[1]]},m.translateExtent=function(f){return arguments.length?(s[0][0]=+f[0][0],s[1][0]=+f[1][0],s[0][1]=+f[0][1],s[1][1]=+f[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(f){return arguments.length?(n=f,m):n},m.duration=function(f){return arguments.length?(a=+f,m):a},m.interpolate=function(f){return arguments.length?(l=f,m):l},m.on=function(){var f=u.on.apply(u,arguments);return f===u?m:f},m.clickDistance=function(f){return arguments.length?(x=(f=+f)*f,m):Math.sqrt(x)},m.tapDistance=function(f){return arguments.length?(y=+f,m):y},m}var te=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(te||{}),Ni=(e=>(e.Partial="partial",e.Full="full",e))(Ni||{}),Et=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(Et||{}),_t=(e=>(e.Strict="strict",e.Loose="loose",e))(_t||{}),oi=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(oi||{}),un=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(un||{});const nf=["INPUT","SELECT","TEXTAREA"];function ii(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,i=typeof(o==null?void 0:o.hasAttribute)=="function"?o.hasAttribute("contenteditable"):!1,r=typeof(o==null?void 0:o.closest)=="function"?o.closest(".nokey"):null;return nf.includes(o==null?void 0:o.nodeName)||i||!!r}function of(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function cr(e,t,n,o){const i=t.replace("+",`
2
+ `).replace(`
3
+
4
+ `,`
5
+ +`).split(`
6
+ `).map(s=>s.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const r=i.every((s,a)=>n.has(s)&&Array.from(n.values())[a]===i[a]);return o&&n.delete(e.toLowerCase()),r}function rf(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=sf(n.code,e);return Array.isArray(e)?e.some(i=>cr(n[o],i,t,n.type==="keyup")):cr(n[o],e,t,n.type==="keyup")}}function sf(e,t){return t.includes(e)?"code":"key"}function cn(e,t){const n=we(()=>ge(t==null?void 0:t.actInsideInputWithModifier)??!1),o=we(()=>ge(t==null?void 0:t.target)??window),i=we(()=>ge(t==null?void 0:t.preventDefault)??!0),r=ye(ge(e)===!0);let s=!1;const a=new Set;let l=c(ge(e));be(()=>ge(e),(d,h)=>{typeof h=="boolean"&&typeof d!="boolean"&&u(),l=c(d)},{immediate:!0}),as(["blur","contextmenu"],u),Xi((...d)=>l(...d),d=>{var h,g;if(s=of(d),(!s||s&&!n.value)&&ii(d))return;const x=((g=(h=d.composedPath)==null?void 0:h.call(d))==null?void 0:g[0])||d.target,y=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";!i.value&&(s||!y)&&d.preventDefault(),r.value=!0},{eventName:"keydown",target:o}),Xi((...d)=>l(...d),d=>{if(r.value){if((!s||s&&!n.value)&&ii(d))return;s=!1,r.value=!1}},{eventName:"keyup",target:o});function u(){s=!1,a.clear(),r.value=ge(e)===!0}function c(d){return d===null?(u(),()=>!1):typeof d=="boolean"?(u(),r.value=d,()=>!1):Array.isArray(d)||typeof d=="string"?rf(d,a):d}return r}const Ps="vue-flow__node-desc",Os="vue-flow__edge-desc",af="vue-flow__aria-live",Bs=["Enter"," ","Escape"],Lt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function io(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function ro(e,t){const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)}function bo(e){return{width:e.offsetWidth,height:e.offsetHeight}}function Ot(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function Rs(e,t){return{x:Ot(e.x,t[0][0],t[1][0]),y:Ot(e.y,t[0][1],t[1][1])}}function dr(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function bt(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function At(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!bt(e)}function rn(e){return At(e)&&"computedPosition"in e}function Pn(e){return!Number.isNaN(e)&&Number.isFinite(e)}function lf(e){return Pn(e.width)&&Pn(e.height)&&Pn(e.x)&&Pn(e.y)}function uf(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:ln({width:0,height:0}),computedPosition:ln({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:Ne(e.data)?e.data:{},events:ln(Ne(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function Hs(e,t,n){var o,i;const r={id:e.id.toString(),type:e.type??(t==null?void 0:t.type)??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=e.targetHandle)==null?void 0:i.toString(),updatable:e.updatable??(n==null?void 0:n.updatable),selectable:e.selectable??(n==null?void 0:n.selectable),focusable:e.focusable??(n==null?void 0:n.focusable),data:Ne(e.data)?e.data:{},events:ln(Ne(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??(n==null?void 0:n.interactionWidth),...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function Vs(e,t,n,o){const i=typeof e=="string"?e:e.id,r=new Set,s=o==="source"?"target":"source";for(const a of n)a[s]===i&&r.add(a[o]);return t.filter(a=>r.has(a.id))}function cf(...e){if(e.length===3){const[r,s,a]=e;return Vs(r,s,a,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>bt(r)&&r.source===o).map(r=>n.find(s=>At(s)&&s.id===r.target))}function df(...e){if(e.length===3){const[r,s,a]=e;return Vs(r,s,a,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>bt(r)&&r.target===o).map(r=>n.find(s=>At(s)&&s.id===r.source))}function Fs({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function ff(e,t){return t.some(n=>bt(n)&&n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle))}function ri({x:e,y:t},{x:n,y:o,zoom:i}){return{x:e*i+n,y:t*i+o}}function yn({x:e,y:t},{x:n,y:o,zoom:i},r=!1,s=[1,1]){const a={x:(e-n)/i,y:(t-o)/i};return r?$o(a,s):a}function Ls(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function so({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function Ys({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function hf(e,t){return Ys(Ls(so(e),so(t)))}function Ci(e){let t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<e.length;n++){const o=e[n];t=Ls(t,so({...o.computedPosition,...o.dimensions}))}return Ys(t)}function Gs(e,t,n={x:0,y:0,zoom:1},o=!1,i=!1){const r={...yn(t,n),width:t.width/n.zoom,height:t.height/n.zoom},s=[];for(const a of e){const{dimensions:l,selectable:u=!0,hidden:c=!1}=a,d=l.width??a.width??null,h=l.height??a.height??null;if(i&&!u||c)continue;const g=ro(r,io(a)),E=d===null||h===null,x=o&&g>0,y=(d??0)*(h??0);(E||x||g>=y||a.dragging)&&s.push(a)}return s}function St(e,t){const n=new Set;if(typeof e=="string")n.add(e);else if(e.length>=1)for(const o of e)n.add(o.id);return t.filter(o=>n.has(o.source)||n.has(o.target))}function fr(e,t,n,o,i,r=.1,s={x:0,y:0}){const a=t/(e.width*(1+r)),l=n/(e.height*(1+r)),u=Math.min(a,l),c=Ot(u,o,i),d=e.x+e.width/2,h=e.y+e.height/2,g=t/2-d*c+(s.x??0),E=n/2-h*c+(s.y??0);return{x:g,y:E,zoom:c}}function gf(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function Xs(e,t){if(!e.parentNode)return!1;const n=t(e.parentNode);return n?n.selected?!0:Xs(n,t):!1}function wn(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function hr(e,t,n){return e<t?Ot(Math.abs(e-t),1,t)/t:e>n?-Ot(Math.abs(e-n),1,t)/t:0}function Us(e,t,n=15,o=40){const i=hr(e.x,o,t.width-o)*n,r=hr(e.y,o,t.height-o)*n;return[i,r]}function Oo(e,t){if(t){const n=e.position.x+e.dimensions.width-t.dimensions.width,o=e.position.y+e.dimensions.height-t.dimensions.height;if(n>0||o>0||e.position.x<0||e.position.y<0){let i={};if(typeof t.style=="function"?i={...t.style(t)}:t.style&&(i={...t.style}),i.width=i.width??`${t.dimensions.width}px`,i.height=i.height??`${t.dimensions.height}px`,n>0)if(typeof i.width=="string"){const r=Number(i.width.replace("px",""));i.width=`${r+n}px`}else i.width+=n;if(o>0)if(typeof i.height=="string"){const r=Number(i.height.replace("px",""));i.height=`${r+o}px`}else i.height+=o;if(e.position.x<0){const r=Math.abs(e.position.x);if(t.position.x=t.position.x-r,typeof i.width=="string"){const s=Number(i.width.replace("px",""));i.width=`${s+r}px`}else i.width+=r;e.position.x=0}if(e.position.y<0){const r=Math.abs(e.position.y);if(t.position.y=t.position.y-r,typeof i.height=="string"){const s=Number(i.height.replace("px",""));i.height=`${s+r}px`}else i.height+=r;e.position.y=0}t.dimensions.width=Number(i.width.toString().replace("px","")),t.dimensions.height=Number(i.height.toString().replace("px","")),typeof t.style=="function"?t.style=r=>{const s=t.style;return{...s(r),...i}}:t.style={...t.style,...i}}}}function gr(e,t){var n,o;const i=e.filter(s=>s.type==="add"||s.type==="remove");for(const s of i)if(s.type==="add")t.findIndex(l=>l.id===s.item.id)===-1&&t.push(s.item);else if(s.type==="remove"){const a=t.findIndex(l=>l.id===s.id);a!==-1&&t.splice(a,1)}const r=t.map(s=>s.id);for(const s of t)for(const a of e)if(a.id===s.id)switch(a.type){case"select":s.selected=a.selected;break;case"position":if(rn(s)&&(typeof a.position<"u"&&(s.position=a.position),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&s.parentNode)){const l=t[r.indexOf(s.parentNode)];l&&rn(l)&&Oo(s,l)}break;case"dimensions":if(rn(s)&&(typeof a.dimensions<"u"&&(s.dimensions=a.dimensions),typeof a.updateStyle<"u"&&a.updateStyle&&(s.style={...s.style||{},width:`${(n=a.dimensions)==null?void 0:n.width}px`,height:`${(o=a.dimensions)==null?void 0:o.height}px`}),typeof a.resizing<"u"&&(s.resizing=a.resizing),s.expandParent&&s.parentNode)){const l=t[r.indexOf(s.parentNode)];l&&rn(l)&&(!!l.dimensions.width&&!!l.dimensions.height?Oo(s,l):it(()=>{Oo(s,l)}))}break}return t}function dt(e,t){return{id:e,type:"select",selected:t}}function pr(e){return{item:e,type:"add"}}function vr(e){return{id:e,type:"remove"}}function mr(e,t,n,o,i){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function gt(e,t=new Set,n=!1){const o=[];for(const[i,r]of e){const s=t.has(i);!(r.selected===void 0&&!s)&&r.selected!==s&&(n&&(r.selected=s),o.push(dt(r.id,s)))}return o}function U(e){const t=new Set;let n=!1;const o=()=>t.size>0;e&&(n=!0,t.add(e));const i=a=>{t.delete(a)};return{on:a=>{e&&n&&t.delete(e),t.add(a);const l=()=>{i(a),e&&n&&t.add(e)};return vo(l),{off:l}},off:i,trigger:a=>Promise.all(Array.from(t).map(l=>l(a))),hasListeners:o,fns:t}}function yr(e,t,n){let o=e;do{if(o&&o.matches(t))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function pf(e,t,n,o,i){var r,s;const a=[];for(const l of e)(l.selected||l.id===i)&&(!l.parentNode||!Xs(l,o))&&(l.draggable||t&&typeof l.draggable>"u")&&a.push(ln({id:l.id,position:l.position||{x:0,y:0},distance:{x:n.x-((r=l.computedPosition)==null?void 0:r.x)||0,y:n.y-((s=l.computedPosition)==null?void 0:s.y)||0},from:l.computedPosition,extent:l.extent,parentNode:l.parentNode,dimensions:l.dimensions,expandParent:l.expandParent}));return a}function Bo({id:e,dragItems:t,findNode:n}){const o=[];for(const i of t){const r=n(i.id);r&&o.push(r)}return[e?o.find(i=>i.id===e):o[0],o]}function Ws(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function vf(e,t,n){const[o,i,r,s]=typeof e!="string"?Ws(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+s,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function mf(e,t,n,o){let i=e.extent||n;if((i==="parent"||!Array.isArray(i)&&(i==null?void 0:i.range)==="parent")&&!e.expandParent)if(e.parentNode&&o&&e.dimensions.width&&e.dimensions.height){const r=vf(i,e,o);r&&(i=r)}else t(new ke(Ce.NODE_EXTENT_INVALID,e.id)),i=n;else if(Array.isArray(i)){const r=(o==null?void 0:o.computedPosition.x)||0,s=(o==null?void 0:o.computedPosition.y)||0;i=[[i[0][0]+r,i[0][1]+s],[i[1][0]+r,i[1][1]+s]]}else if(i!=="parent"&&(i!=null&&i.range)&&Array.isArray(i.range)){const[r,s,a,l]=Ws(i.padding),u=(o==null?void 0:o.computedPosition.x)||0,c=(o==null?void 0:o.computedPosition.y)||0;i=[[i.range[0][0]+u+l,i.range[0][1]+c+r],[i.range[1][0]+u-s,i.range[1][1]+c-a]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function yf({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function ki(e,t,n,o,i){const r=yf(e.dimensions,mf(e,n,o,i)),s=Rs(t,r);return{position:{x:s.x-((i==null?void 0:i.computedPosition.x)||0),y:s.y-((i==null?void 0:i.computedPosition.y)||0)},computedPosition:s}}function Wt(e,t,n=te.Left,o=!1){const i=((t==null?void 0:t.x)??0)+e.computedPosition.x,r=((t==null?void 0:t.y)??0)+e.computedPosition.y,{width:s,height:a}=t??$f(e);if(o)return{x:i+s/2,y:r+a/2};switch((t==null?void 0:t.position)??n){case te.Top:return{x:i+s/2,y:r};case te.Right:return{x:i+s,y:r+a/2};case te.Bottom:return{x:i+s/2,y:r+a};case te.Left:return{x:i,y:r+a/2}}}function wr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function wf({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:s,height:a,viewport:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+o,t.y+r)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=so({x:(0-l.x)/l.zoom,y:(0-l.y)/l.zoom,width:s/l.zoom,height:a/l.zoom}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),h=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*h)>0}function _f(e,t,n=!1){const o=typeof e.zIndex=="number";let i=o?e.zIndex:0;const r=t(e.source),s=t(e.target);return!r||!s?0:(n&&(i=o?e.zIndex:Math.max(r.computedPosition.z||0,s.computedPosition.z||0)),i)}var Ce=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(Ce||{});const _r={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid
7
+ Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
8
+ Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
9
+ Node: ${e}
10
+ Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
11
+ Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
12
+ Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
13
+ Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
14
+ Edge: ${e}
15
+ Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
16
+ Edge: ${e}
17
+ Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
18
+ Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
19
+ Edge: ${e}
20
+ Source: ${t}
21
+ Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
22
+ Edge: ${e}
23
+ Source: ${t}
24
+ Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
25
+ Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
26
+ Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class ke extends Error{constructor(t,...n){var o;super((o=_r[t])==null?void 0:o.call(_r,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function Mi(e){return"clientX"in e}function bf(e){return"sourceEvent"in e}function wt(e,t){const n=Mi(e);let o,i;return n?(o=e.clientX,i=e.clientY):"touches"in e&&e.touches.length>0?(o=e.touches[0].clientX,i=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(o=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(o=0,i=0),{x:o-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}}const ao=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function $f(e){var t,n;return{width:((t=e.dimensions)==null?void 0:t.width)??e.width??0,height:((n=e.dimensions)==null?void 0:n.height)??e.height??0}}function $o(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const xf=()=>!0;function Ro(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function Ef(e,t,n){const o=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const r of t.values())ro(i,io(r))>0&&o.push(r);return o}const Sf=250;function Nf(e,t,n,o){var i,r;let s=[],a=Number.POSITIVE_INFINITY;const l=Ef(e,n,t+Sf);for(const u of l){const c=[...((i=u.handleBounds)==null?void 0:i.source)??[],...((r=u.handleBounds)==null?void 0:r.target)??[]];for(const d of c){if(o.nodeId===d.nodeId&&o.type===d.type&&o.id===d.id)continue;const{x:h,y:g}=Wt(u,d,d.position,!0),E=Math.sqrt((h-e.x)**2+(g-e.y)**2);E>t||(E<a?(s=[{...d,x:h,y:g}],a=E):E===a&&s.push({...d,x:h,y:g}))}}if(!s.length)return null;if(s.length>1){const u=o.type==="source"?"target":"source";return s.find(c=>c.type===u)??s[0]}return s[0]}function br(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:r,doc:s,lib:a,flowId:l,isValidConnection:u=xf},c,d,h){const g=r==="target",E=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x,y}=wt(e),m=s.elementFromPoint(x,y),S=m!=null&&m.classList.contains(`${a}-flow__handle`)?m:E,_={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const N=Zs(void 0,S),P=S.getAttribute("data-nodeid"),O=S.getAttribute("data-handleid"),z=S.classList.contains("connectable"),R=S.classList.contains("connectableend");if(!P||!N)return _;const G={source:g?P:o,sourceHandle:g?O:i,target:g?o:P,targetHandle:g?i:O};_.connection=G;const L=z&&R&&(n===_t.Strict?g&&N==="source"||!g&&N==="target":P!==o||O!==i);_.isValid=L&&u(G,{nodes:d,edges:c,sourceNode:h(o),targetNode:h(P)}),_.toHandle=t}return _}function Zs(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Cf(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function kf(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function Mf(e,t,n,o,i,r=!1){var s,a,l;const u=o.get(e);if(!u)return null;const c=i===_t.Strict?(s=u.handleBounds)==null?void 0:s[t]:[...((a=u.handleBounds)==null?void 0:a.source)??[],...((l=u.handleBounds)==null?void 0:l.target)??[]],d=(n?c==null?void 0:c.find(h=>h.id===n):c==null?void 0:c[0])??null;return d&&r?{...d,...Wt(u,d,d.position,!0)}:d}const si={[te.Left]:te.Right,[te.Right]:te.Left,[te.Top]:te.Bottom,[te.Bottom]:te.Top},If=["production","prod"];function xo(e,...t){qs()&&console.warn(`[Vue Flow]: ${e}`,...t)}function qs(){return!If.includes("production")}function $r(e,t,n,o,i){const r=t.querySelectorAll(`.vue-flow__handle.${e}`);return r!=null&&r.length?Array.from(r).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...bo(s)}}):null}function ai(e,t,n,o,i,r=!1,s){i.value=!1,e.selected?(r||e.selected&&t)&&(o([e]),it(()=>{s.blur()})):n([e])}function Ne(e){return typeof I(e)<"u"}function Tf(e,t,n,o){if(!e||!e.source||!e.target)return n(new ke(Ce.EDGE_INVALID,(e==null?void 0:e.id)??"[ID UNKNOWN]")),!1;let i;return bt(e)?i=e:i={...e,id:Fs(e)},i=Hs(i,void 0,o),ff(i,t)?!1:i}function Af(e,t,n,o,i){if(!t.source||!t.target)return i(new ke(Ce.EDGE_INVALID,e.id)),!1;if(!n)return i(new ke(Ce.EDGE_NOT_FOUND,e.id)),!1;const{id:r,...s}=e;return{...s,id:o?Fs(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function xr(e,t,n){const o={},i=[];for(let r=0;r<e.length;++r){const s=e[r];if(!At(s)){n(new ke(Ce.NODE_INVALID,s==null?void 0:s.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const a=uf(s,t(s.id),s.parentNode);s.parentNode&&(o[s.parentNode]=!0),i[r]=a}for(const r of i){const s=t(r.parentNode)||i.find(a=>a.id===r.parentNode);r.parentNode&&!s&&n(new ke(Ce.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),s&&(s.isParent=!0))}return i}function Er(e,t,n,o,i,r){let s=i;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${i}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),r){s=`${i}-${e}-${r}`;const u=o.get(s)||new Map;o.set(s,u.set(n,t))}}function Ho(e,t,n){e.clear();for(const o of n){const{source:i,target:r,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:i,target:r,sourceHandle:s,targetHandle:a},u=`${i}-${s}--${r}-${a}`,c=`${r}-${a}--${i}-${s}`;Er("source",l,c,e,i,s),Er("target",l,u,e,r,a)}}function Sr(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Vo(e,t,n,o,i,r,s,a){const l=[];for(const u of e){const c=bt(u)?u:Tf(u,a,i,r);if(!c)continue;const d=n(c.source),h=n(c.target);if(!d||!h){i(new ke(Ce.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){i(new ke(Ce.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!h){i(new ke(Ce.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:a,nodes:s,sourceNode:d,targetNode:h})){i(new ke(Ce.EDGE_INVALID,c.id));continue}const g=o(c.id);l.push({...Hs(c,g,r),sourceNode:d,targetNode:h})}return l}const Nr=Symbol("vueFlow"),Ks=Symbol("nodeId"),Qs=Symbol("nodeRef"),Df=Symbol("edgeId"),zf=Symbol("edgeRef"),Eo=Symbol("slots");function Js(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:i,nodes:r,nodeExtent:s,nodeDragThreshold:a,viewport:l,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:d,panBy:h,findNode:g,multiSelectionActive:E,nodesSelectionActive:x,selectNodesOnDrag:y,removeSelectedElements:m,addSelectedNodes:S,updateNodePositions:_,emits:N}=$e(),{onStart:P,onDrag:O,onStop:z,onClick:R,el:G,disabled:V,id:L,selectable:M,dragHandle:Z}=e,f=ye(!1);let k=[],p,T=null,C={x:void 0,y:void 0},D={x:0,y:0},A=null,H=!1,X=0,ee=!1;const F=Bf(),Y=({x:oe,y:ce})=>{C={x:oe,y:ce};let de=!1;if(k=k.map(w=>{const v={x:oe-w.distance.x,y:ce-w.distance.y},{computedPosition:$}=ki(w,n.value?$o(v,o.value):v,N.error,s.value,w.parentNode?g(w.parentNode):void 0);return de=de||w.position.x!==$.x||w.position.y!==$.y,w.position=$,w}),!!de&&(_(k,!0,!0),f.value=!0,A)){const[w,v]=Bo({id:L,dragItems:k,findNode:g});O({event:A,node:w,nodes:v})}},q=()=>{if(!T)return;const[oe,ce]=Us(D,T,c.value);if(oe!==0||ce!==0){const de={x:(C.x??0)-oe/l.value.zoom,y:(C.y??0)-ce/l.value.zoom};h({x:oe,y:ce})&&Y(de)}X=requestAnimationFrame(q)},ie=(oe,ce)=>{H=!0;const de=g(L);!y.value&&!E.value&&de&&(de.selected||m()),de&&ge(M)&&y.value&&ai(de,E.value,S,m,x,!1,ce);const w=F(oe.sourceEvent);if(C=w,k=pf(r.value,d.value,w,g,L),k.length){const[v,$]=Bo({id:L,dragItems:k,findNode:g});P({event:oe.sourceEvent,node:v,nodes:$})}},ae=(oe,ce)=>{var de;oe.sourceEvent.type==="touchmove"&&oe.sourceEvent.touches.length>1||(a.value===0&&ie(oe,ce),C=F(oe.sourceEvent),T=((de=t.value)==null?void 0:de.getBoundingClientRect())||null,D=wt(oe.sourceEvent,T))},re=(oe,ce)=>{const de=F(oe.sourceEvent);if(!ee&&H&&u.value&&(ee=!0,q()),!H){const w=de.xSnapped-(C.x??0),v=de.ySnapped-(C.y??0);Math.sqrt(w*w+v*v)>a.value&&ie(oe,ce)}(C.x!==de.xSnapped||C.y!==de.ySnapped)&&k.length&&H&&(A=oe.sourceEvent,D=wt(oe.sourceEvent,T),Y(de))},pe=oe=>{let ce=!1;if(!H&&!f.value&&!E.value){const de=oe.sourceEvent,w=F(de),v=w.xSnapped-(C.x??0),$=w.ySnapped-(C.y??0),b=Math.sqrt(v*v+$*$);b!==0&&b<=a.value&&(R==null||R(de),ce=!0)}if(k.length&&!ce){_(k,!1,!1);const[de,w]=Bo({id:L,dragItems:k,findNode:g});z({event:oe.sourceEvent,node:de,nodes:w})}k=[],f.value=!1,ee=!1,H=!1,C={x:void 0,y:void 0},cancelAnimationFrame(X)};return be([()=>ge(V),G],([oe,ce],de,w)=>{if(ce){const v=He(ce);oe||(p=dc().on("start",$=>ae($,ce)).on("drag",$=>re($,ce)).on("end",$=>pe($)).filter($=>{const b=$.target,B=ge(Z);return!$.button&&(!i.value||!yr(b,`.${i.value}`,ce)&&(!B||yr(b,B,ce)))}),v.call(p)),w(()=>{v.on(".drag",null),p&&(p.on("start",null),p.on("drag",null),p.on("end",null))})}}),f}function Pf(){return{doubleClick:U(),click:U(),mouseEnter:U(),mouseMove:U(),mouseLeave:U(),contextMenu:U(),updateStart:U(),update:U(),updateEnd:U()}}function Of(e,t){const n=Pf();return n.doubleClick.on(o=>{var i,r;t.edgeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.edgeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.edgeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.edgeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.edgeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.edgeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.updateStart.on(o=>{var i,r;t.edgeUpdateStart(o),(r=(i=e.events)==null?void 0:i.updateStart)==null||r.call(i,o)}),n.update.on(o=>{var i,r;t.edgeUpdate(o),(r=(i=e.events)==null?void 0:i.update)==null||r.call(i,o)}),n.updateEnd.on(o=>{var i,r;t.edgeUpdateEnd(o),(r=(i=e.events)==null?void 0:i.updateEnd)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function Bf(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=$e();return i=>{var r;const s=((r=o.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},a=bf(i)?i.sourceEvent:i,{x:l,y:u}=wt(a,s),c=yn({x:l,y:u},e.value),{x:d,y:h}=n.value?$o(c,t.value):c;return{xSnapped:d,ySnapped:h,...c}}}function On(){return!0}function js({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:s}){const{id:a,vueFlowRef:l,connectionMode:u,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:h,nodesConnectable:g,autoPanOnConnect:E,autoPanSpeed:x,findNode:y,panBy:m,startConnection:S,updateConnection:_,endConnection:N,emits:P,viewport:O,edges:z,nodes:R,isValidConnection:G,nodeLookup:V}=$e();let L=null,M=!1,Z=null;function f(p){var T;const C=ge(n)==="target",D=Mi(p),A=dr(p.target);if(D&&p.button===0||!D){let H=function(se){w=wt(se,oe),Y=Nf(yn(w,O.value,!1,[1,1]),c.value,V.value,b),v||($(),v=!0);const fe=br(se,{handle:Y,connectionMode:u.value,fromNodeId:ge(t),fromHandleId:ge(e),fromType:C?"target":"source",isValidConnection:F,doc:A,lib:"vue",flowId:a,nodeLookup:V.value},z.value,R.value,y);Z=fe.handleDomNode,L=fe.connection,M=kf(!!Y,fe.isValid);const he={...J,isValid:M,to:Y&&M?ri({x:Y.x,y:Y.y},O.value):w,toHandle:fe.toHandle,toPosition:M&&fe.toHandle?fe.toHandle.position:si[b.position],toNode:fe.toHandle?V.value.get(fe.toHandle.nodeId):null};if(!(M&&Y&&(J!=null&&J.toHandle)&&he.toHandle&&J.toHandle.type===he.toHandle.type&&J.toHandle.nodeId===he.toHandle.nodeId&&J.toHandle.id===he.toHandle.id&&J.to.x===he.to.x&&J.to.y===he.to.y)){if(_(Y&&M?ri({x:Y.x,y:Y.y},O.value):w,fe.toHandle,Cf(!!Y,M)),J=he,!Y&&!M&&!Z)return Ro(de);L&&L.source!==L.target&&Z&&(Ro(de),de=Z,Z.classList.add("connecting","vue-flow__handle-connecting"),Z.classList.toggle("valid",!!M),Z.classList.toggle("vue-flow__handle-valid",!!M))}},X=function(se){(Y||Z)&&L&&M&&(r?r(se,L):P.connect(L)),P.connectEnd(se),i&&(s==null||s(se)),Ro(de),cancelAnimationFrame(q),N(se),v=!1,M=!1,L=null,Z=null,A.removeEventListener("mousemove",H),A.removeEventListener("mouseup",X),A.removeEventListener("touchmove",H),A.removeEventListener("touchend",X)};const ee=y(ge(t));let F=ge(o)||G.value||On;!F&&ee&&(F=(C?ee.isValidSourcePos:ee.isValidTargetPos)||On);let Y,q=0;const{x:ie,y:ae}=wt(p),re=A==null?void 0:A.elementFromPoint(ie,ae),pe=Zs(ge(i),re),oe=(T=l.value)==null?void 0:T.getBoundingClientRect();if(!oe||!pe)return;const ce=Mf(ge(t),pe,ge(e),V.value,u.value);if(!ce)return;let de,w=wt(p,oe),v=!1;const $=()=>{if(!E.value)return;const[se,fe]=Us(w,oe,x.value);m({x:se,y:fe}),q=requestAnimationFrame($)},b={...ce,nodeId:ge(t),type:pe,position:ce.position},B=V.value.get(ge(t)),Q={inProgress:!0,isValid:null,from:Wt(B,b,te.Left,!0),fromHandle:b,fromPosition:b.position,fromNode:B,to:w,toHandle:null,toPosition:si[b.position],toNode:null};S({nodeId:ge(t),id:ge(e),type:pe,position:(re==null?void 0:re.getAttribute("data-handlepos"))||te.Top},{x:ie-oe.left,y:ae-oe.top}),P.connectStart({event:p,nodeId:ge(t),handleId:ge(e),handleType:pe});let J=Q;A.addEventListener("mousemove",H),A.addEventListener("mouseup",X),A.addEventListener("touchmove",H),A.addEventListener("touchend",X)}}function k(p){var T,C;if(!d.value)return;const D=ge(n)==="target";if(!h.value){P.clickConnectStart({event:p,nodeId:ge(t),handleId:ge(e)}),S({nodeId:ge(t),type:ge(n),id:ge(e),position:te.Top},void 0,!0);return}let A=ge(o)||G.value||On;const H=y(ge(t));if(!A&&H&&(A=(D?H.isValidSourcePos:H.isValidTargetPos)||On),H&&(typeof H.connectable>"u"?g.value:H.connectable)===!1)return;const X=dr(p.target),ee=br(p,{handle:{nodeId:ge(t),id:ge(e),type:ge(n),position:te.Top},connectionMode:u.value,fromNodeId:h.value.nodeId,fromHandleId:h.value.id||null,fromType:h.value.type,isValidConnection:A,doc:X,lib:"vue",flowId:a,nodeLookup:V.value},z.value,R.value,y),F=((T=ee.connection)==null?void 0:T.source)===((C=ee.connection)==null?void 0:C.target);ee.isValid&&ee.connection&&!F&&P.connect(ee.connection),P.clickConnectEnd(p),N(p,!0)}return{handlePointerDown:f,handleClick:k}}function Rf(){return Rt(Ks,"")}function ea(e){const t=e??Rf()??"",n=Rt(Qs,ye(null)),{findNode:o,edges:i,emits:r}=$e(),s=o(t);return s||r.error(new ke(Ce.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:j(()=>o(s.parentNode)),connectedEdges:j(()=>St([s],i.value))}}function Hf(){return{doubleClick:U(),click:U(),mouseEnter:U(),mouseMove:U(),mouseLeave:U(),contextMenu:U(),dragStart:U(),drag:U(),dragStop:U()}}function Vf(e,t){const n=Hf();return n.doubleClick.on(o=>{var i,r;t.nodeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.nodeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.nodeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.nodeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.nodeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.nodeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.dragStart.on(o=>{var i,r;t.nodeDragStart(o),(r=(i=e.events)==null?void 0:i.dragStart)==null||r.call(i,o)}),n.drag.on(o=>{var i,r;t.nodeDrag(o),(r=(i=e.events)==null?void 0:i.drag)==null||r.call(i,o)}),n.dragStop.on(o=>{var i,r;t.nodeDragStop(o),(r=(i=e.events)==null?void 0:i.dragStop)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function ta(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:r,nodesDraggable:s,emits:a}=$e();return(l,u=!1)=>{const c=r.value?i.value[0]:5,d=r.value?i.value[1]:5,h=u?4:1,g=l.x*c*h,E=l.y*d*h,x=[];for(const y of e.value)if(y.draggable||s&&typeof y.draggable>"u"){const m={x:y.computedPosition.x+g,y:y.computedPosition.y+E},{computedPosition:S}=ki(y,m,a.error,t.value,y.parentNode?o(y.parentNode):void 0);x.push({id:y.id,position:S,from:y.position,distance:{x:l.x,y:l.y},dimensions:y.dimensions})}n(x,!0,!1)}}const Fo=.1;function ct(){return xo("Viewport not initialized yet."),Promise.resolve(!1)}const Ff={zoomIn:ct,zoomOut:ct,zoomTo:ct,fitView:ct,setCenter:ct,fitBounds:ct,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:ct,setTransform:ct,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Lf(e){function t(o,i){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.scaleBy(Lo(e.d3Selection,i,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,s){return new Promise(a=>{const{x:l,y:u}=Rs({x:-o,y:-i},e.translateExtent),c=Ut.translate(-l,-u).scale(r);e.d3Selection&&e.d3Zoom?e.d3Zoom.transform(Lo(e.d3Selection,s,()=>{a(!0)}),c):a(!1)})}return j(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:i=>t(1.2,i==null?void 0:i.duration),zoomOut:i=>t(1/1.2,i==null?void 0:i.duration),zoomTo:(i,r)=>new Promise(s=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.scaleTo(Lo(e.d3Selection,r==null?void 0:r.duration,()=>{s(!0)}),i):s(!1)}),setViewport:(i,r)=>n(i.x,i.y,i.zoom,r==null?void 0:r.duration),setTransform:(i,r)=>n(i.x,i.y,i.zoom,r==null?void 0:r.duration),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(i={padding:Fo,includeHiddenNodes:!1,duration:0})=>{var r,s;const a=[];for(const h of e.nodes)h.dimensions.width&&h.dimensions.height&&((i==null?void 0:i.includeHiddenNodes)||!h.hidden)&&(!((r=i.nodes)!=null&&r.length)||(s=i.nodes)!=null&&s.length&&i.nodes.includes(h.id))&&a.push(h);if(!a.length)return Promise.resolve(!1);const l=Ci(a),{x:u,y:c,zoom:d}=fr(l,e.dimensions.width,e.dimensions.height,i.minZoom??e.minZoom,i.maxZoom??e.maxZoom,i.padding??Fo,i.offset);return n(u,c,d,i==null?void 0:i.duration)},setCenter:(i,r,s)=>{const a=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:e.maxZoom,l=e.dimensions.width/2-i*a,u=e.dimensions.height/2-r*a;return n(l,u,a,s==null?void 0:s.duration)},fitBounds:(i,r={padding:Fo})=>{const{x:s,y:a,zoom:l}=fr(i,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding);return n(s,a,l,r==null?void 0:r.duration)},project:i=>yn(i,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:i.x-r,y:i.y-s};return yn(a,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:i.x+r,y:i.y+s};return ri(a,e.viewport)}return{x:0,y:0}}}:Ff)}function Lo(e,t=0,n){return e.transition().duration(t).on("end",n)}function Yf(e,t,n){const o=jr(!0);return o.run(()=>{const i=()=>{o.run(()=>{let x,y,m=!!(n.nodes.value.length||n.edges.value.length);x=Ht([e.modelValue,()=>{var S,_;return(_=(S=e.modelValue)==null?void 0:S.value)==null?void 0:_.length}],([S])=>{S&&Array.isArray(S)&&(y==null||y.pause(),n.setElements(S),!y&&!m&&S.length?m=!0:y==null||y.resume())}),y=Ht([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([S,_])=>{var N;(N=e.modelValue)!=null&&N.value&&Array.isArray(e.modelValue.value)&&(x==null||x.pause(),e.modelValue.value=[...S,..._],it(()=>{x==null||x.resume()}))},{immediate:m}),Ln(()=>{x==null||x.stop(),y==null||y.stop()})})},r=()=>{o.run(()=>{let x,y,m=!!n.nodes.value.length;x=Ht([e.nodes,()=>{var S,_;return(_=(S=e.nodes)==null?void 0:S.value)==null?void 0:_.length}],([S])=>{S&&Array.isArray(S)&&(y==null||y.pause(),n.setNodes(S),!y&&!m&&S.length?m=!0:y==null||y.resume())}),y=Ht([n.nodes,()=>n.nodes.value.length],([S])=>{var _;(_=e.nodes)!=null&&_.value&&Array.isArray(e.nodes.value)&&(x==null||x.pause(),e.nodes.value=[...S],it(()=>{x==null||x.resume()}))},{immediate:m}),Ln(()=>{x==null||x.stop(),y==null||y.stop()})})},s=()=>{o.run(()=>{let x,y,m=!!n.edges.value.length;x=Ht([e.edges,()=>{var S,_;return(_=(S=e.edges)==null?void 0:S.value)==null?void 0:_.length}],([S])=>{S&&Array.isArray(S)&&(y==null||y.pause(),n.setEdges(S),!y&&!m&&S.length?m=!0:y==null||y.resume())}),y=Ht([n.edges,()=>n.edges.value.length],([S])=>{var _;(_=e.edges)!=null&&_.value&&Array.isArray(e.edges.value)&&(x==null||x.pause(),e.edges.value=[...S],it(()=>{x==null||x.resume()}))},{immediate:m}),Ln(()=>{x==null||x.stop(),y==null||y.stop()})})},a=()=>{o.run(()=>{be(()=>t.maxZoom,()=>{t.maxZoom&&Ne(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{be(()=>t.minZoom,()=>{t.minZoom&&Ne(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{be(()=>t.translateExtent,()=>{t.translateExtent&&Ne(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{be(()=>t.nodeExtent,()=>{t.nodeExtent&&Ne(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{be(()=>t.applyDefault,()=>{Ne(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const x=async y=>{let m=y;typeof t.autoConnect=="function"&&(m=await t.autoConnect(y)),m!==!1&&n.addEdges([m])};be(()=>t.autoConnect,()=>{Ne(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),be(n.autoConnect,(y,m,S)=>{y?n.onConnect(x):n.hooks.value.connect.off(x),S(()=>{n.hooks.value.connect.off(x)})},{immediate:!0})})},g=()=>{const x=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const y of Object.keys(t)){const m=y;if(!x.includes(m)){const S=we(()=>t[m]),_=n[m];It(_)&&o.run(()=>{be(S,N=>{Ne(N)&&(_.value=N)},{immediate:!0})})}}};(()=>{i(),r(),s(),l(),a(),u(),c(),d(),h(),g()})()}),()=>o.stop()}function Gf(){return{edgesChange:U(),nodesChange:U(),nodeDoubleClick:U(),nodeClick:U(),nodeMouseEnter:U(),nodeMouseMove:U(),nodeMouseLeave:U(),nodeContextMenu:U(),nodeDragStart:U(),nodeDrag:U(),nodeDragStop:U(),nodesInitialized:U(),miniMapNodeClick:U(),miniMapNodeDoubleClick:U(),miniMapNodeMouseEnter:U(),miniMapNodeMouseMove:U(),miniMapNodeMouseLeave:U(),connect:U(),connectStart:U(),connectEnd:U(),clickConnectStart:U(),clickConnectEnd:U(),paneReady:U(),init:U(),move:U(),moveStart:U(),moveEnd:U(),selectionDragStart:U(),selectionDrag:U(),selectionDragStop:U(),selectionContextMenu:U(),selectionStart:U(),selectionEnd:U(),viewportChangeStart:U(),viewportChange:U(),viewportChangeEnd:U(),paneScroll:U(),paneClick:U(),paneContextMenu:U(),paneMouseEnter:U(),paneMouseMove:U(),paneMouseLeave:U(),edgeContextMenu:U(),edgeMouseEnter:U(),edgeMouseMove:U(),edgeMouseLeave:U(),edgeDoubleClick:U(),edgeClick:U(),edgeUpdateStart:U(),edgeUpdate:U(),edgeUpdateEnd:U(),updateNodeInternals:U(),error:U(e=>xo(e.message))}}function Xf(e,t){Va(()=>{for(const[n,o]of Object.entries(t.value)){const i=r=>{e(n,r)};o.fns.add(i),vo(()=>{o.off(i)})}})}function na(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:Ni.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:un.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:Et.Bezier,style:{}},connectionMode:_t.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:ao()?"Meta":"Control",zoomActivationKeyCode:ao()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Gf(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const Uf=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Wf(e,t,n){const o=Lf(e),i=w=>{const v=w??[];e.hooks.updateNodeInternals.trigger(v)},r=w=>df(w,e.nodes,e.edges),s=w=>cf(w,e.nodes,e.edges),a=w=>St(w,e.edges),l=({id:w,type:v,nodeId:$})=>{var b;return Array.from(((b=e.connectionLookup.get(`${$}-${v}-${w??null}`))==null?void 0:b.values())??[])},u=w=>{if(w)return t.value.get(w)},c=w=>{if(w)return n.value.get(w)},d=(w,v,$)=>{var b,B;const ne=[];for(const Q of w){const J={id:Q.id,type:"position",dragging:$,from:Q.from};if(v&&(J.position=Q.position,Q.parentNode)){const se=u(Q.parentNode);J.position={x:J.position.x-(((b=se==null?void 0:se.computedPosition)==null?void 0:b.x)??0),y:J.position.y-(((B=se==null?void 0:se.computedPosition)==null?void 0:B.y)??0)}}ne.push(J)}ne!=null&&ne.length&&e.hooks.nodesChange.trigger(ne)},h=w=>{if(!e.vueFlowRef)return;const v=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!v)return;const $=window.getComputedStyle(v),{m22:b}=new window.DOMMatrixReadOnly($.transform),B=[];for(const ne of w){const Q=ne,J=u(Q.id);if(J){const se=bo(Q.nodeElement);if(!!(se.width&&se.height&&(J.dimensions.width!==se.width||J.dimensions.height!==se.height||Q.forceUpdate))){const he=Q.nodeElement.getBoundingClientRect();J.dimensions=se,J.handleBounds.source=$r("source",Q.nodeElement,he,b,J.id),J.handleBounds.target=$r("target",Q.nodeElement,he,b,J.id),B.push({id:J.id,type:"dimensions",dimensions:se})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),B.length&&e.hooks.nodesChange.trigger(B)},g=(w,v)=>{const $=new Set,b=new Set;for(const Q of w)At(Q)?$.add(Q.id):bt(Q)&&b.add(Q.id);const B=gt(t.value,$,!0),ne=gt(n.value,b);if(e.multiSelectionActive){for(const Q of $)B.push(dt(Q,v));for(const Q of b)ne.push(dt(Q,v))}B.length&&e.hooks.nodesChange.trigger(B),ne.length&&e.hooks.edgesChange.trigger(ne)},E=w=>{if(e.multiSelectionActive){const v=w.map($=>dt($.id,!0));e.hooks.nodesChange.trigger(v);return}e.hooks.nodesChange.trigger(gt(t.value,new Set(w.map(v=>v.id)),!0)),e.hooks.edgesChange.trigger(gt(n.value))},x=w=>{if(e.multiSelectionActive){const v=w.map($=>dt($.id,!0));e.hooks.edgesChange.trigger(v);return}e.hooks.edgesChange.trigger(gt(n.value,new Set(w.map(v=>v.id)))),e.hooks.nodesChange.trigger(gt(t.value,new Set,!0))},y=w=>{g(w,!0)},m=w=>{const $=(w||e.nodes).map(b=>(b.selected=!1,dt(b.id,!1)));e.hooks.nodesChange.trigger($)},S=w=>{const $=(w||e.edges).map(b=>(b.selected=!1,dt(b.id,!1)));e.hooks.edgesChange.trigger($)},_=w=>{if(!w||!w.length)return g([],!1);const v=w.reduce(($,b)=>{const B=dt(b.id,!1);return At(b)?$.nodes.push(B):$.edges.push(B),$},{nodes:[],edges:[]});v.nodes.length&&e.hooks.nodesChange.trigger(v.nodes),v.edges.length&&e.hooks.edgesChange.trigger(v.edges)},N=w=>{var v;(v=e.d3Zoom)==null||v.scaleExtent([w,e.maxZoom]),e.minZoom=w},P=w=>{var v;(v=e.d3Zoom)==null||v.scaleExtent([e.minZoom,w]),e.maxZoom=w},O=w=>{var v;(v=e.d3Zoom)==null||v.translateExtent(w),e.translateExtent=w},z=w=>{e.nodeExtent=w,i()},R=w=>{var v;(v=e.d3Zoom)==null||v.clickDistance(w)},G=w=>{e.nodesDraggable=w,e.nodesConnectable=w,e.elementsSelectable=w},V=w=>{const v=w instanceof Function?w(e.nodes):w;!e.initialized&&!v.length||(e.nodes=xr(v,u,e.hooks.error.trigger))},L=w=>{const v=w instanceof Function?w(e.edges):w;if(!e.initialized&&!v.length)return;const $=Vo(v,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Ho(e.connectionLookup,n.value,$),e.edges=$},M=w=>{const v=w instanceof Function?w([...e.nodes,...e.edges]):w;!e.initialized&&!v.length||(V(v.filter(At)),L(v.filter(bt)))},Z=w=>{let v=w instanceof Function?w(e.nodes):w;v=Array.isArray(v)?v:[v];const $=xr(v,u,e.hooks.error.trigger),b=[];for(const B of $)b.push(pr(B));b.length&&e.hooks.nodesChange.trigger(b)},f=w=>{let v=w instanceof Function?w(e.edges):w;v=Array.isArray(v)?v:[v];const $=Vo(v,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),b=[];for(const B of $)b.push(pr(B));b.length&&e.hooks.edgesChange.trigger(b)},k=(w,v=!0,$=!1)=>{const b=w instanceof Function?w(e.nodes):w,B=Array.isArray(b)?b:[b],ne=[],Q=[];function J(fe){const he=a(fe);for(const xe of he)(!Ne(xe.deletable)||xe.deletable)&&Q.push(mr(xe.id,xe.source,xe.target,xe.sourceHandle,xe.targetHandle))}function se(fe){const he=[];for(const xe of e.nodes)xe.parentNode===fe&&he.push(xe);if(he.length){for(const xe of he)ne.push(vr(xe.id));v&&J(he);for(const xe of he)se(xe.id)}}for(const fe of B){const he=typeof fe=="string"?u(fe):fe;he&&(Ne(he.deletable)&&!he.deletable||(ne.push(vr(he.id)),v&&J([he]),$&&se(he.id)))}Q.length&&e.hooks.edgesChange.trigger(Q),ne.length&&e.hooks.nodesChange.trigger(ne)},p=w=>{const v=w instanceof Function?w(e.edges):w,$=Array.isArray(v)?v:[v],b=[];for(const B of $){const ne=typeof B=="string"?c(B):B;ne&&(Ne(ne.deletable)&&!ne.deletable||b.push(mr(typeof B=="string"?B:B.id,ne.source,ne.target,ne.sourceHandle,ne.targetHandle)))}e.hooks.edgesChange.trigger(b)},T=(w,v,$=!0)=>{const b=c(w.id);if(!b)return!1;const B=e.edges.indexOf(b),ne=Af(w,v,b,$,e.hooks.error.trigger);if(ne){const[Q]=Vo([ne],e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((J,se)=>se===B?Q:J),Ho(e.connectionLookup,n.value,[Q]),Q}return!1},C=(w,v,$={replace:!1})=>{const b=c(w);if(!b)return;const B=typeof v=="function"?v(b):v;b.data=$.replace?B:{...b.data,...B}},D=w=>gr(w,e.nodes),A=w=>{const v=gr(w,e.edges);return Ho(e.connectionLookup,n.value,v),v},H=(w,v,$={replace:!1})=>{const b=u(w);if(!b)return;const B=typeof v=="function"?v(b):v;$.replace?e.nodes.splice(e.nodes.indexOf(b),1,B):Object.assign(b,B)},X=(w,v,$={replace:!1})=>{const b=u(w);if(!b)return;const B=typeof v=="function"?v(b):v;b.data=$.replace?B:{...b.data,...B}},ee=(w,v,$=!1)=>{$?e.connectionClickStartHandle=w:e.connectionStartHandle=w,e.connectionEndHandle=null,e.connectionStatus=null,v&&(e.connectionPosition=v)},F=(w,v=null,$=null)=>{e.connectionStartHandle&&(e.connectionPosition=w,e.connectionEndHandle=v,e.connectionStatus=$)},Y=(w,v)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,v?e.connectionClickStartHandle=null:e.connectionStartHandle=null},q=w=>{const v=lf(w),$=v?null:rn(w)?w:u(w.id);return!v&&!$?[null,null,v]:[v?w:io($),$,v]},ie=(w,v=!0,$=e.nodes)=>{const[b,B,ne]=q(w);if(!b)return[];const Q=[];for(const J of $||e.nodes){if(!ne&&(J.id===B.id||!J.computedPosition))continue;const se=io(J),fe=ro(se,b);(v&&fe>0||fe>=Number(b.width)*Number(b.height))&&Q.push(J)}return Q},ae=(w,v,$=!0)=>{const[b]=q(w);if(!b)return!1;const B=ro(b,v);return $&&B>0||B>=Number(b.width)*Number(b.height)},re=w=>{const{viewport:v,dimensions:$,d3Zoom:b,d3Selection:B,translateExtent:ne}=e;if(!b||!B||!w.x&&!w.y)return!1;const Q=Ut.translate(v.x+w.x,v.y+w.y).scale(v.zoom),J=[[0,0],[$.width,$.height]],se=b.constrain()(Q,J,ne),fe=e.viewport.x!==se.x||e.viewport.y!==se.y||e.viewport.zoom!==se.k;return b.transform(B,se),fe},pe=w=>{const v=w instanceof Function?w(e):w,$=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Ne(v.defaultEdgeOptions)&&(e.defaultEdgeOptions=v.defaultEdgeOptions);const b=v.modelValue||v.nodes||v.edges?[]:void 0;b&&(v.modelValue&&b.push(...v.modelValue),v.nodes&&b.push(...v.nodes),v.edges&&b.push(...v.edges),M(b));const B=()=>{Ne(v.maxZoom)&&P(v.maxZoom),Ne(v.minZoom)&&N(v.minZoom),Ne(v.translateExtent)&&O(v.translateExtent)};for(const ne of Object.keys(v)){const Q=ne,J=v[Q];![...Uf,...$].includes(Q)&&Ne(J)&&(e[Q]=J)}Zo(()=>e.d3Zoom).not.toBeNull().then(B),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:h,setElements:M,setNodes:V,setEdges:L,addNodes:Z,addEdges:f,removeNodes:k,removeEdges:p,findNode:u,findEdge:c,updateEdge:T,updateEdgeData:C,updateNode:H,updateNodeData:X,applyEdgeChanges:A,applyNodeChanges:D,addSelectedElements:y,addSelectedNodes:E,addSelectedEdges:x,setMinZoom:N,setMaxZoom:P,setTranslateExtent:O,setNodeExtent:z,setPaneClickDistance:R,removeSelectedElements:_,removeSelectedNodes:m,removeSelectedEdges:S,startConnection:ee,updateConnection:F,endConnection:Y,setInteractive:G,setState:pe,getIntersectingNodes:ie,getIncomers:r,getOutgoers:s,getConnectedEdges:a,getHandleConnections:l,isNodeIntersecting:ae,panBy:re,fitView:w=>o.value.fitView(w),zoomIn:w=>o.value.zoomIn(w),zoomOut:w=>o.value.zoomOut(w),zoomTo:(w,v)=>o.value.zoomTo(w,v),setViewport:(w,v)=>o.value.setViewport(w,v),setTransform:(w,v)=>o.value.setTransform(w,v),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(w,v,$)=>o.value.setCenter(w,v,$),fitBounds:(w,v)=>o.value.fitBounds(w,v),project:w=>o.value.project(w),screenToFlowCoordinate:w=>o.value.screenToFlowCoordinate(w),flowToScreenCoordinate:w=>o.value.flowToScreenCoordinate(w),toObject:()=>{const w=[],v=[];for(const $ of e.nodes){const{computedPosition:b,handleBounds:B,selected:ne,dimensions:Q,isParent:J,resizing:se,dragging:fe,events:he,...xe}=$;w.push(xe)}for(const $ of e.edges){const{selected:b,sourceNode:B,targetNode:ne,events:Q,...J}=$;v.push(J)}return JSON.parse(JSON.stringify({nodes:w,edges:v,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:w=>new Promise(v=>{const{nodes:$,edges:b,position:B,zoom:ne,viewport:Q}=w;if($&&V($),b&&L(b),Q!=null&&Q.x&&(Q!=null&&Q.y)||B){const J=(Q==null?void 0:Q.x)||B[0],se=(Q==null?void 0:Q.y)||B[1],fe=(Q==null?void 0:Q.zoom)||ne||e.viewport.zoom;return Zo(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:J,y:se,zoom:fe}).then(()=>{v(!0)})})}else v(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{const w=na();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const v=Ut.translate(w.defaultViewport.x??0,w.defaultViewport.y??0).scale(Ot(w.defaultViewport.zoom??1,w.minZoom,w.maxZoom)),$=e.viewportRef.getBoundingClientRect(),b=[[0,0],[$.width,$.height]],B=e.d3Zoom.constrain()(v,b,w.translateExtent);e.d3Zoom.transform(e.d3Selection,B)}pe(w)},$destroy:()=>{}}}const Zf=["data-id","data-handleid","data-nodeid","data-handlepos"],qf={name:"Handle",compatConfig:{MODE:3}},Zt=me({...qf,props:{id:{default:null},type:{},position:{default:()=>te.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:t}){const n=Ya(e,["position","connectable","connectableStart","connectableEnd","id"]),o=we(()=>n.type??"source"),i=we(()=>n.isValidConnection??null),{id:r,connectionStartHandle:s,connectionClickStartHandle:a,connectionEndHandle:l,vueFlowRef:u,nodesConnectable:c,noDragClassName:d,noPanClassName:h}=$e(),{id:g,node:E,nodeEl:x,connectedEdges:y}=ea(),m=ye(),S=we(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),_=we(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),N=we(()=>{var L,M,Z,f,k,p;return((L=s.value)==null?void 0:L.nodeId)===g&&((M=s.value)==null?void 0:M.id)===e.id&&((Z=s.value)==null?void 0:Z.type)===o.value||((f=l.value)==null?void 0:f.nodeId)===g&&((k=l.value)==null?void 0:k.id)===e.id&&((p=l.value)==null?void 0:p.type)===o.value}),P=we(()=>{var L,M,Z;return((L=a.value)==null?void 0:L.nodeId)===g&&((M=a.value)==null?void 0:M.id)===e.id&&((Z=a.value)==null?void 0:Z.type)===o.value}),{handlePointerDown:O,handleClick:z}=js({nodeId:g,handleId:e.id,isValidConnection:i,type:o}),R=j(()=>typeof e.connectable=="string"&&e.connectable==="single"?!y.value.some(L=>{const M=L[`${o.value}Handle`];return L[o.value]!==g?!1:M?M===e.id:!0}):typeof e.connectable=="number"?y.value.filter(L=>{const M=L[`${o.value}Handle`];return L[o.value]!==g?!1:M?M===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(E,y.value):Ne(e.connectable)?e.connectable:c.value);$t(()=>{var L;if(!E.dimensions.width||!E.dimensions.height)return;const M=(L=E.handleBounds[o.value])==null?void 0:L.find(D=>D.id===e.id);if(!u.value||M)return;const Z=u.value.querySelector(".vue-flow__transformationpane");if(!x.value||!m.value||!Z||!e.id)return;const f=x.value.getBoundingClientRect(),k=m.value.getBoundingClientRect(),p=window.getComputedStyle(Z),{m22:T}=new window.DOMMatrixReadOnly(p.transform),C={id:e.id,position:e.position,x:(k.left-f.left)/T,y:(k.top-f.top)/T,type:o.value,nodeId:g,...bo(m.value)};E.handleBounds[o.value]=[...E.handleBounds[o.value]??[],C]});function G(L){const M=Mi(L);R.value&&S.value&&(M&&L.button===0||!M)&&O(L)}function V(L){!g||!a.value&&!S.value||R.value&&z(L)}return t({handleClick:z,handlePointerDown:O,onClick:V,onPointerDown:G}),(L,M)=>(W(),ue("div",{ref_key:"handle",ref:m,"data-id":`${I(r)}-${I(g)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":I(g),"data-handlepos":L.position,class:Le(["vue-flow__handle",[`vue-flow__handle-${L.position}`,`vue-flow__handle-${e.id}`,I(d),I(h),o.value,{connectable:R.value,connecting:P.value,connectablestart:S.value,connectableend:_.value,connectionindicator:R.value&&(S.value&&!N.value||_.value&&N.value)}]]),onMousedown:G,onTouchstartPassive:G,onClick:V},[Re(L.$slots,"default",{id:L.id})],42,Zf))}}),So=function({sourcePosition:e=te.Bottom,targetPosition:t=te.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:s}){const a=s.label||n;return[_e(Zt,{type:"target",position:t,connectable:o,isValidConnection:i}),typeof a!="string"&&a?_e(a):_e(Ie,[a]),_e(Zt,{type:"source",position:e,connectable:o,isValidConnection:r})]};So.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];So.inheritAttrs=!1;So.compatConfig={MODE:3};const Kf=So,No=function({targetPosition:e=te.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:i}){const r=i.label||t;return[_e(Zt,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof r!="string"&&r?_e(r):_e(Ie,[r])]};No.props=["targetPosition","label","isValidTargetPos","connectable","data"];No.inheritAttrs=!1;No.compatConfig={MODE:3};const Qf=No,Co=function({sourcePosition:e=te.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:i}){const r=i.label||t;return[typeof r!="string"&&r?_e(r):_e(Ie,[r]),_e(Zt,{type:"source",position:e,connectable:n,isValidConnection:o})]};Co.props=["sourcePosition","label","isValidSourcePos","connectable","data"];Co.inheritAttrs=!1;Co.compatConfig={MODE:3};const Jf=Co,jf=["transform"],eh=["width","height","x","y","rx","ry"],th=["y"],nh={name:"EdgeText",compatConfig:{MODE:3}},oh=me({...nh,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=ye({x:0,y:0,width:0,height:0}),n=ye(null),o=j(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);$t(i),be([()=>e.x,()=>e.y,n,()=>e.label],i);function i(){if(!n.value)return;const r=n.value.getBBox();(r.width!==t.value.width||r.height!==t.value.height)&&(t.value=r)}return(r,s)=>(W(),ue("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(W(),ue("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*r.labelBgPadding[0]}px`,height:`${t.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:Se(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,eh)):Me("",!0),ve("text",dn(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:r.labelStyle}),[Re(r.$slots,"default",{},()=>[typeof r.label!="string"?(W(),Ee(ts(r.label),{key:0})):(W(),ue(Ie,{key:1},[Be(ze(r.label),1)],64))])],16,th)],8,jf))}}),ih=["id","d","marker-end","marker-start"],rh=["d","stroke-width"],sh={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Cn=me({...sh,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=ye(null),o=ye(null),i=ye(null),r=wi();return t({pathEl:n,interactionEl:o,labelEl:i}),(s,a)=>(W(),ue(Ie,null,[ve("path",dn(I(r),{id:s.id,ref_key:"pathEl",ref:n,d:s.path,class:"vue-flow__edge-path","marker-end":s.markerEnd,"marker-start":s.markerStart}),null,16,ih),s.interactionWidth?(W(),ue("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:s.path,"stroke-width":s.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,rh)):Me("",!0),s.label&&s.labelX&&s.labelY?(W(),Ee(oh,{key:1,ref_key:"labelEl",ref:i,x:s.labelX,y:s.labelY,label:s.label,"label-show-bg":s.labelShowBg,"label-bg-style":s.labelBgStyle,"label-bg-padding":s.labelBgPadding,"label-bg-border-radius":s.labelBgBorderRadius,"label-style":s.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):Me("",!0)],64))}});function oa({sourceX:e,sourceY:t,targetX:n,targetY:o}){const i=Math.abs(n-e)/2,r=n<e?n+i:n-i,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[r,a,i,s]}function ia({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:s,targetControlY:a}){const l=e*.125+i*.375+s*.375+n*.125,u=t*.125+r*.375+a*.375+o*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}function Bn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Cr({pos:e,x1:t,y1:n,x2:o,y2:i,c:r}){let s,a;switch(e){case te.Left:s=t-Bn(t-o,r),a=n;break;case te.Right:s=t+Bn(o-t,r),a=n;break;case te.Top:s=t,a=n-Bn(n-i,r);break;case te.Bottom:s=t,a=n+Bn(i-n,r);break}return[s,a]}function Ii(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:s=te.Top,curvature:a=.25}=e,[l,u]=Cr({pos:o,x1:t,y1:n,x2:i,y2:r,c:a}),[c,d]=Cr({pos:s,x1:i,y1:r,x2:t,y2:n,c:a}),[h,g,E,x]=ia({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${t},${n} C${l},${u} ${c},${d} ${i},${r}`,h,g,E,x]}function kr({pos:e,x1:t,y1:n,x2:o,y2:i}){let r,s;switch(e){case te.Left:case te.Right:r=.5*(t+o),s=n;break;case te.Top:case te.Bottom:r=t,s=.5*(n+i);break}return[r,s]}function ra(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:s=te.Top}=e,[a,l]=kr({pos:o,x1:t,y1:n,x2:i,y2:r}),[u,c]=kr({pos:s,x1:i,y1:r,x2:t,y2:n}),[d,h,g,E]=ia({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${t},${n} C${a},${l} ${u},${c} ${i},${r}`,d,h,g,E]}const Mr={[te.Left]:{x:-1,y:0},[te.Right]:{x:1,y:0},[te.Top]:{x:0,y:-1},[te.Bottom]:{x:0,y:1}};function ah({source:e,sourcePosition:t=te.Bottom,target:n}){return t===te.Left||t===te.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1}}function Ir(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function lh({source:e,sourcePosition:t=te.Bottom,target:n,targetPosition:o=te.Top,center:i,offset:r}){const s=Mr[t],a=Mr[o],l={x:e.x+s.x*r,y:e.y+s.y*r},u={x:n.x+a.x*r,y:n.y+a.y*r},c=ah({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",h=c[d];let g,E,x;const y={x:0,y:0},m={x:0,y:0},[S,_,N,P]=oa({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){E=i.x??S,x=i.y??_;const z=[{x:E,y:l.y},{x:E,y:u.y}],R=[{x:l.x,y:x},{x:u.x,y:x}];s[d]===h?g=d==="x"?z:R:g=d==="x"?R:z}else{const z=[{x:l.x,y:u.y}],R=[{x:u.x,y:l.y}];if(d==="x"?g=s.x===h?R:z:g=s.y===h?z:R,t===o){const Z=Math.abs(e[d]-n[d]);if(Z<=r){const f=Math.min(r-1,r-Z);s[d]===h?y[d]=(l[d]>e[d]?-1:1)*f:m[d]=(u[d]>n[d]?-1:1)*f}}if(t!==o){const Z=d==="x"?"y":"x",f=s[d]===a[Z],k=l[Z]>u[Z],p=l[Z]<u[Z];(s[d]===1&&(!f&&k||f&&p)||s[d]!==1&&(!f&&p||f&&k))&&(g=d==="x"?z:R)}const G={x:l.x+y.x,y:l.y+y.y},V={x:u.x+m.x,y:u.y+m.y},L=Math.max(Math.abs(G.x-g[0].x),Math.abs(V.x-g[0].x)),M=Math.max(Math.abs(G.y-g[0].y),Math.abs(V.y-g[0].y));L>=M?(E=(G.x+V.x)/2,x=g[0].y):(E=g[0].x,x=(G.y+V.y)/2)}return[[e,{x:l.x+y.x,y:l.y+y.y},...g,{x:u.x+m.x,y:u.y+m.y},n],E,x,N,P]}function uh(e,t,n,o){const i=Math.min(Ir(e,t)/2,Ir(t,n)/2,o),{x:r,y:s}=t;if(e.x===r&&r===n.x||e.y===s&&s===n.y)return`L${r} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${r+i*u},${s}Q ${r},${s} ${r},${s+i*c}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${r},${s+i*l}Q ${r},${s} ${r+i*a},${s}`}function li(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:s=te.Top,borderRadius:a=5,centerX:l,centerY:u,offset:c=20}=e,[d,h,g,E,x]=lh({source:{x:t,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:s,center:{x:l,y:u},offset:c});return[d.reduce((m,S,_)=>{let N;return _>0&&_<d.length-1?N=uh(d[_-1],S,d[_+1],a):N=`${_===0?"M":"L"}${S.x} ${S.y}`,m+=N,m},""),h,g,E,x]}function ch(e){const{sourceX:t,sourceY:n,targetX:o,targetY:i}=e,[r,s,a,l]=oa({sourceX:t,sourceY:n,targetX:o,targetY:i});return[`M ${t},${n}L ${o},${i}`,r,s,a,l]}const dh=me({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=ch(e);return _e(Cn,{path:n,labelX:o,labelY:i,...t,...e})}}}),fh=dh,hh=me({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=li({...e,sourcePosition:e.sourcePosition??te.Bottom,targetPosition:e.targetPosition??te.Top});return _e(Cn,{path:n,labelX:o,labelY:i,...t,...e})}}}),sa=hh,gh=me({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>_e(sa,{...e,...t,borderRadius:0})}}),ph=gh,vh=me({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=Ii({...e,sourcePosition:e.sourcePosition??te.Bottom,targetPosition:e.targetPosition??te.Top});return _e(Cn,{path:n,labelX:o,labelY:i,...t,...e})}}}),mh=vh,yh=me({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=ra({...e,sourcePosition:e.sourcePosition??te.Bottom,targetPosition:e.targetPosition??te.Top});return _e(Cn,{path:n,labelX:o,labelY:i,...t,...e})}}}),wh=yh,_h={input:Jf,default:Kf,output:Qf},bh={default:mh,straight:fh,step:ph,smoothstep:sa,simplebezier:wh};function $h(e,t,n){const o=j(()=>x=>t.value.get(x)),i=j(()=>x=>n.value.get(x)),r=j(()=>{const x={...bh,...e.edgeTypes},y=Object.keys(x);for(const m of e.edges)m.type&&!y.includes(m.type)&&(x[m.type]=m.type);return x}),s=j(()=>{const x={..._h,...e.nodeTypes},y=Object.keys(x);for(const m of e.nodes)m.type&&!y.includes(m.type)&&(x[m.type]=m.type);return x}),a=j(()=>e.onlyRenderVisibleElements?Gs(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=j(()=>{if(e.onlyRenderVisibleElements){const x=[];for(const y of e.edges){const m=t.value.get(y.source),S=t.value.get(y.target);wf({sourcePos:m.computedPosition||{x:0,y:0},targetPos:S.computedPosition||{x:0,y:0},sourceWidth:m.dimensions.width,sourceHeight:m.dimensions.height,targetWidth:S.dimensions.width,targetHeight:S.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&x.push(y)}return x}return e.edges}),u=j(()=>[...a.value,...l.value]),c=j(()=>{const x=[];for(const y of e.nodes)y.selected&&x.push(y);return x}),d=j(()=>{const x=[];for(const y of e.edges)y.selected&&x.push(y);return x}),h=j(()=>[...c.value,...d.value]),g=j(()=>{const x=[];for(const y of e.nodes)y.dimensions.width&&y.dimensions.height&&y.handleBounds!==void 0&&x.push(y);return x}),E=j(()=>a.value.length>0&&g.value.length===a.value.length);return{getNode:o,getEdge:i,getElements:u,getEdgeTypes:r,getNodeTypes:s,getEdges:l,getNodes:a,getSelectedElements:h,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:g,areNodesInitialized:E}}class Nt{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=En())==null?void 0:t.appContext.app,o=(n==null?void 0:n.config.globalProperties.$vueFlowStorage)??Nt.instance;return Nt.instance=o??new Nt,n&&(n.config.globalProperties.$vueFlowStorage=Nt.instance),Nt.instance}set(t,n){return this.flows.set(t,n)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,n){const o=na(),i=La(o),r={};for(const[h,g]of Object.entries(i.hooks)){const E=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;r[E]=g.on}const s={};for(const[h,g]of Object.entries(i.hooks))s[h]=g.trigger;const a=j(()=>{const h=new Map;for(const g of i.nodes)h.set(g.id,g);return h}),l=j(()=>{const h=new Map;for(const g of i.edges)h.set(g.id,g);return h}),u=$h(i,a,l),c=Wf(i,a,l);c.setState({...i,...n});const d={...r,...u,...c,..._l(i),nodeLookup:a,edgeLookup:l,emits:s,id:t,vueFlowVersion:"1.43.1",$destroy:()=>{this.remove(t)}};return this.set(t,d),d}getId(){return`vue-flow-${this.currentId++}`}}function $e(e){const t=Nt.getInstance(),n=Jr(),o=typeof e=="object",i=o?e:{id:e},r=i.id,s=r??(n==null?void 0:n.vueFlowId);let a;if(n){const l=Rt(Nr,null);typeof l<"u"&&l!==null&&(!s||l.id===s)&&(a=l)}if(a||s&&(a=t.get(s)),!a||s&&a.id!==s){const l=r??t.getId(),u=t.create(l,i);a=u,(n??jr(!0)).run(()=>{be(u.applyDefault,(d,h,g)=>{const E=y=>{u.applyNodeChanges(y)},x=y=>{u.applyEdgeChanges(y)};d?(u.onNodesChange(E),u.onEdgesChange(x)):(u.hooks.value.nodesChange.off(E),u.hooks.value.edgesChange.off(x)),g(()=>{u.hooks.value.nodesChange.off(E),u.hooks.value.edgesChange.off(x)})},{immediate:!0}),vo(()=>{if(a){const d=t.get(a.id);d?d.$destroy():xo(`No store instance found for id ${a.id} in storage.`)}})})}else o&&a.setState(i);if(n&&(zt(Nr,a),n.vueFlowId=a.id),o){const l=En();(l==null?void 0:l.type.name)!=="VueFlow"&&a.emits.error(new ke(Ce.USEVUEFLOW_OPTIONS))}return a}function xh(e){const{emits:t,dimensions:n}=$e();let o;$t(()=>{const i=e.value,r=()=>{if(!i)return;const s=bo(i);(s.width===0||s.height===0)&&t.error(new ke(Ce.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:s.width||500,height:s.height||500}};r(),window.addEventListener("resize",r),i&&(o=new ResizeObserver(()=>r()),o.observe(i)),es(()=>{window.removeEventListener("resize",r),o&&i&&o.unobserve(i)})})}const Eh={name:"UserSelection",compatConfig:{MODE:3}},Sh=me({...Eh,props:{userSelectionRect:{}},setup(e){return(t,n)=>(W(),ue("div",{class:"vue-flow__selection vue-flow__container",style:Se({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),Nh=["tabIndex"],Ch={name:"NodesSelection",compatConfig:{MODE:3}},kh=me({...Ch,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:s}=$e(),a=ta(),l=ye(null),u=Js({el:l,onStart(E){t.selectionDragStart(E)},onDrag(E){t.selectionDrag(E)},onStop(E){t.selectionDragStop(E)}});$t(()=>{var E;r.value||(E=l.value)==null||E.focus({preventScroll:!0})});const c=j(()=>Ci(o.value)),d=j(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function h(E){t.selectionContextMenu({event:E,nodes:o.value})}function g(E){r||Lt[E.key]&&(E.preventDefault(),a({x:Lt[E.key].x,y:Lt[E.key].y},E.shiftKey))}return(E,x)=>!I(s)&&c.value.width&&c.value.height?(W(),ue("div",{key:0,class:Le(["vue-flow__nodesselection vue-flow__container",I(i)]),style:Se({transform:`translate(${I(n).x}px,${I(n).y}px) scale(${I(n).zoom})`})},[ve("div",{ref_key:"el",ref:l,class:Le([{dragging:I(u)},"vue-flow__nodesselection-rect"]),style:Se(d.value),tabIndex:I(r)?void 0:-1,onContextmenu:h,onKeydown:g},null,46,Nh)],6)):Me("",!0)}});function Mh(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const Ih={name:"Pane",compatConfig:{MODE:3}},Th=me({...Ih,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:s,userSelectionRect:a,elementsSelectable:l,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:d,removeNodes:h,removeEdges:g,selectionMode:E,deleteKeyCode:x,multiSelectionKeyCode:y,multiSelectionActive:m,edgeLookup:S,nodeLookup:_,connectionLookup:N,defaultEdgeOptions:P,connectionStartHandle:O}=$e(),z=ye(null),R=ye(new Set),G=ye(new Set),V=ye(),L=we(()=>l.value&&(e.isSelecting||r.value)),M=we(()=>O.value!==null);let Z=!1,f=!1;const k=cn(x,{actInsideInputWithModifier:!1}),p=cn(y);be(k,F=>{F&&(h(d.value),g(c.value),u.value=!1)}),be(p,F=>{m.value=F});function T(F,Y){return q=>{q.target===Y&&(F==null||F(q))}}function C(F){if(Z||M.value){Z=!1;return}i.paneClick(F),s(),u.value=!1}function D(F){F.preventDefault(),F.stopPropagation(),i.paneContextMenu(F)}function A(F){i.paneScroll(F)}function H(F){var Y,q,ie;if(V.value=(Y=t.value)==null?void 0:Y.getBoundingClientRect(),!l.value||!e.isSelecting||F.button!==0||F.target!==z.value||!V.value)return;(ie=(q=F.target)==null?void 0:q.setPointerCapture)==null||ie.call(q,F.pointerId);const{x:ae,y:re}=Mh(F,V.value);f=!0,Z=!1,s(),a.value={width:0,height:0,startX:ae,startY:re,x:ae,y:re},i.selectionStart(F)}function X(F){var Y;if(!V.value||!a.value)return;Z=!0;const{x:q,y:ie}=wt(F,V.value),{startX:ae=0,startY:re=0}=a.value,pe={startX:ae,startY:re,x:q<ae?q:ae,y:ie<re?ie:re,width:Math.abs(q-ae),height:Math.abs(ie-re)},oe=R.value,ce=G.value;R.value=new Set(Gs(n.value,pe,o.value,E.value===Ni.Partial,!0).map(w=>w.id)),G.value=new Set;const de=((Y=P.value)==null?void 0:Y.selectable)??!0;for(const w of R.value){const v=N.value.get(w);if(v)for(const{edgeId:$}of v.values()){const b=S.value.get($);b&&(b.selectable??de)&&G.value.add($)}}if(!Sr(oe,R.value)){const w=gt(_.value,R.value,!0);i.nodesChange(w)}if(!Sr(ce,G.value)){const w=gt(S.value,G.value);i.edgesChange(w)}a.value=pe,r.value=!0,u.value=!1}function ee(F){var Y;F.button!==0||!f||((Y=F.target)==null||Y.releasePointerCapture(F.pointerId),!r.value&&a.value&&F.target===z.value&&C(F),r.value=!1,a.value=null,u.value=R.value.size>0,i.selectionEnd(F),e.selectionKeyPressed&&(Z=!1),f=!1)}return(F,Y)=>(W(),ue("div",{ref_key:"container",ref:z,class:Le(["vue-flow__pane vue-flow__container",{selection:F.isSelecting}]),onClick:Y[0]||(Y[0]=q=>L.value?void 0:T(C,z.value)(q)),onContextmenu:Y[1]||(Y[1]=q=>T(D,z.value)(q)),onWheelPassive:Y[2]||(Y[2]=q=>T(A,z.value)(q)),onPointerenter:Y[3]||(Y[3]=q=>L.value?void 0:I(i).paneMouseEnter(q)),onPointerdown:Y[4]||(Y[4]=q=>L.value?H(q):I(i).paneMouseMove(q)),onPointermove:Y[5]||(Y[5]=q=>L.value?X(q):I(i).paneMouseMove(q)),onPointerup:Y[6]||(Y[6]=q=>L.value?ee(q):void 0),onPointerleave:Y[7]||(Y[7]=q=>I(i).paneMouseLeave(q))},[Re(F.$slots,"default"),I(r)&&I(a)?(W(),Ee(Sh,{key:0,"user-selection-rect":I(a)},null,8,["user-selection-rect"])):Me("",!0),I(u)&&I(d).length?(W(),Ee(kh,{key:1})):Me("",!0)],34))}}),Ah={name:"Transform",compatConfig:{MODE:3}},Dh=me({...Ah,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=$e(),i=j(()=>n.value?!o.value:!1),r=j(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(s,a)=>(W(),ue("div",{class:"vue-flow__transformationpane vue-flow__container",style:Se({transform:r.value,opacity:i.value?0:void 0})},[Re(s.$slots,"default")],4))}}),zh={name:"Viewport",compatConfig:{MODE:3}},Ph=me({...zh,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:h,zoomOnPinch:g,zoomOnScroll:E,preventScrolling:x,noWheelClassName:y,noPanClassName:m,emits:S,connectionStartHandle:_,userSelectionActive:N,paneDragging:P,d3Zoom:O,d3Selection:z,d3ZoomHandler:R,viewport:G,viewportRef:V,paneClickDistance:L}=$e();xh(V);const M=ye(!1),Z=ye(!1);let f=null,k=!1,p=0,T={x:0,y:0,zoom:0};const C=cn(a),D=cn(s),A=cn(r),H=we(()=>(!D.value||D.value&&s.value===!0)&&(C.value||d.value)),X=we(()=>C.value||l.value),ee=we(()=>D.value||s.value===!0&&H.value!==!0);$t(()=>{if(!V.value){xo("Viewport element is missing");return}const re=V.value,pe=re.getBoundingClientRect(),oe=tf().clickDistance(L.value).scaleExtent([t.value,n.value]).translateExtent(i.value),ce=He(re).call(oe),de=ce.on("wheel.zoom"),w=Ut.translate(o.value.x??0,o.value.y??0).scale(Ot(o.value.zoom??1,t.value,n.value)),v=[[0,0],[pe.width,pe.height]],$=oe.constrain()(w,v,i.value);oe.transform(ce,$),oe.wheelDelta(Y),O.value=oe,z.value=ce,R.value=de,G.value={x:$.x,y:$.y,zoom:$.k},oe.on("start",b=>{var B;if(!b.sourceEvent)return null;p=b.sourceEvent.button,M.value=!0;const ne=ie(b.transform);((B=b.sourceEvent)==null?void 0:B.type)==="mousedown"&&(P.value=!0),T=ne,S.viewportChangeStart(ne),S.moveStart({event:b,flowTransform:ne})}),oe.on("end",b=>{if(!b.sourceEvent)return null;if(M.value=!1,P.value=!1,F(H.value,p??0)&&!k&&S.paneContextMenu(b.sourceEvent),k=!1,q(T,b.transform)){const B=ie(b.transform);T=B,S.viewportChangeEnd(B),S.moveEnd({event:b,flowTransform:B})}}),oe.filter(b=>{var B;const ne=A.value||E.value,Q=g.value&&b.ctrlKey,J=b.button;if(J===1&&b.type==="mousedown"&&(ae(b,"vue-flow__node")||ae(b,"vue-flow__edge")))return!0;if(!H.value&&!ne&&!X.value&&!h.value&&!g.value||N.value||!h.value&&b.type==="dblclick"||ae(b,y.value)&&b.type==="wheel"||ae(b,m.value)&&(b.type!=="wheel"||X.value&&b.type==="wheel"&&!A.value)||!g.value&&b.ctrlKey&&b.type==="wheel"||!ne&&!X.value&&!Q&&b.type==="wheel")return!1;if(!g&&b.type==="touchstart"&&((B=b.touches)==null?void 0:B.length)>1)return b.preventDefault(),!1;if(!H.value&&(b.type==="mousedown"||b.type==="touchstart")||s.value===!0&&Array.isArray(d.value)&&d.value.includes(0)&&J===0||Array.isArray(d.value)&&!d.value.includes(J)&&(b.type==="mousedown"||b.type==="touchstart"))return!1;const se=Array.isArray(d.value)&&d.value.includes(J)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!J||J<=1;return(!b.ctrlKey||C.value||b.type==="wheel")&&se}),be([N,H],()=>{N.value&&!M.value?oe.on("zoom",null):N.value||oe.on("zoom",b=>{G.value={x:b.transform.x,y:b.transform.y,zoom:b.transform.k};const B=ie(b.transform);k=F(H.value,p??0),S.viewportChange(B),S.move({event:b,flowTransform:B})})},{immediate:!0}),be([N,X,u,A,g,x,y],()=>{X.value&&!A.value&&!N.value?ce.on("wheel.zoom",b=>{if(ae(b,y.value))return!1;const B=A.value||E.value,ne=g.value&&b.ctrlKey;if(!(!x.value||X.value||B||ne))return!1;b.preventDefault(),b.stopImmediatePropagation();const J=ce.property("__zoom").k||1,se=ao();if(!C.value&&b.ctrlKey&&g.value&&se){const Qt=We(b),Oa=Y(b),Ba=J*2**Oa;oe.scaleTo(ce,Ba,Qt,b);return}const fe=b.deltaMode===1?20:1;let he=u.value===un.Vertical?0:b.deltaX*fe,xe=u.value===un.Horizontal?0:b.deltaY*fe;!se&&b.shiftKey&&u.value!==un.Vertical&&!he&&xe&&(he=xe,xe=0),oe.translateBy(ce,-(he/J)*c.value,-(xe/J)*c.value);const Xe=ie(ce.property("__zoom"));f&&clearTimeout(f),Z.value?(S.move({event:b,flowTransform:Xe}),S.viewportChange(Xe),f=setTimeout(()=>{S.moveEnd({event:b,flowTransform:Xe}),S.viewportChangeEnd(Xe),Z.value=!1},150)):(Z.value=!0,S.moveStart({event:b,flowTransform:Xe}),S.viewportChangeStart(Xe))},{passive:!1}):typeof de<"u"&&ce.on("wheel.zoom",function(b,B){const ne=!x.value&&b.type==="wheel"&&!b.ctrlKey,Q=A.value||E.value,J=g.value&&b.ctrlKey;if(!Q&&!l.value&&!J&&b.type==="wheel"||ne||ae(b,y.value))return null;b.preventDefault(),de.call(this,b,B)},{passive:!1})},{immediate:!0})});function F(re,pe){return pe===2&&Array.isArray(re)&&re.includes(2)}function Y(re){const pe=re.ctrlKey&&ao()?10:1;return-re.deltaY*(re.deltaMode===1?.05:re.deltaMode?1:.002)*pe}function q(re,pe){return re.x!==pe.x&&!Number.isNaN(pe.x)||re.y!==pe.y&&!Number.isNaN(pe.y)||re.zoom!==pe.k&&!Number.isNaN(pe.k)}function ie(re){return{x:re.x,y:re.y,zoom:re.k}}function ae(re,pe){return re.target.closest(`.${pe}`)}return(re,pe)=>(W(),ue("div",{ref_key:"viewportRef",ref:V,class:"vue-flow__viewport vue-flow__container"},[K(Th,{"is-selecting":ee.value,"selection-key-pressed":I(D),class:Le({connecting:!!I(_),dragging:I(P),draggable:I(d)===!0||Array.isArray(I(d))&&I(d).includes(0)})},{default:le(()=>[K(Dh,null,{default:le(()=>[Re(re.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),Oh=["id"],Bh=["id"],Rh=["id"],Hh={name:"A11yDescriptions",compatConfig:{MODE:3}},Vh=me({...Hh,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=$e();return(i,r)=>(W(),ue(Ie,null,[ve("div",{id:`${I(Ps)}-${I(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+ze(I(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,Oh),ve("div",{id:`${I(Os)}-${I(t)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,Bh),I(n)?Me("",!0):(W(),ue("div",{key:0,id:`${I(af)}-${I(t)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},ze(I(o)),9,Rh))],64))}});function Fh(){const e=$e();be(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Lh(e,t,n){return n===te.Left?e-t:n===te.Right?e+t:e}function Yh(e,t,n){return n===te.Top?e-t:n===te.Bottom?e+t:e}const Ti=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=te.Top,type:i}){return _e("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:Lh(t,e,o),cy:Yh(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};Ti.props=["radius","centerX","centerY","position","type"];Ti.compatConfig={MODE:3};const Tr=Ti,Gh=me({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:s,noPanClassName:a,getEdgeTypes:l,removeSelectedEdges:u,findEdge:c,findNode:d,isValidConnection:h,multiSelectionActive:g,disableKeyboardA11y:E,elementsSelectable:x,edgesUpdatable:y,edgesFocusable:m,hooks:S}=$e(),_=j(()=>c(e.id)),{emit:N,on:P}=Of(_.value,r),O=Rt(Eo),z=En(),R=ye(!1),G=ye(!1),V=ye(""),L=ye(null),M=ye("source"),Z=ye(null),f=we(()=>typeof _.value.selectable>"u"?x.value:_.value.selectable),k=we(()=>typeof _.value.updatable>"u"?y.value:_.value.updatable),p=we(()=>typeof _.value.focusable>"u"?m.value:_.value.focusable);zt(Df,e.id),zt(zf,Z);const T=j(()=>_.value.class instanceof Function?_.value.class(_.value):_.value.class),C=j(()=>_.value.style instanceof Function?_.value.style(_.value):_.value.style),D=j(()=>{const v=_.value.type||"default",$=O==null?void 0:O[`edge-${v}`];if($)return $;let b=_.value.template??l.value[v];if(typeof b=="string"&&z){const B=Object.keys(z.appContext.components);B&&B.includes(v)&&(b=ns(v,!1))}return b&&typeof b!="string"?b:(r.error(new ke(Ce.EDGE_TYPE_MISSING,b)),!1)}),{handlePointerDown:A}=js({nodeId:V,handleId:L,type:M,isValidConnection:h,edgeUpdaterType:M,onEdgeUpdate:ee,onEdgeUpdateEnd:F});return()=>{const v=d(_.value.source),$=d(_.value.target),b="pathOptions"in _.value?_.value.pathOptions:{};if(!v&&!$)return r.error(new ke(Ce.EDGE_SOURCE_TARGET_MISSING,_.value.id,_.value.source,_.value.target)),null;if(!v)return r.error(new ke(Ce.EDGE_SOURCE_MISSING,_.value.id,_.value.source)),null;if(!$)return r.error(new ke(Ce.EDGE_TARGET_MISSING,_.value.id,_.value.target)),null;if(!_.value||_.value.hidden||v.hidden||$.hidden)return null;let B;o.value===_t.Strict?B=v.handleBounds.source:B=[...v.handleBounds.source||[],...v.handleBounds.target||[]];const ne=wr(B,_.value.sourceHandle);let Q;o.value===_t.Strict?Q=$.handleBounds.target:Q=[...$.handleBounds.target||[],...$.handleBounds.source||[]];const J=wr(Q,_.value.targetHandle),se=(ne==null?void 0:ne.position)||te.Bottom,fe=(J==null?void 0:J.position)||te.Top,{x:he,y:xe}=Wt(v,ne,se),{x:Xe,y:Qt}=Wt($,J,fe);return _.value.sourceX=he,_.value.sourceY=xe,_.value.targetX=Xe,_.value.targetY=Qt,_e("g",{ref:Z,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${D.value===!1?"default":_.value.type||"default"}`,a.value,T.value,{updating:R.value,selected:_.value.selected,animated:_.value.animated,inactive:!f.value&&!S.value.edgeClick.hasListeners()}],onClick:q,onContextmenu:ie,onDblclick:ae,onMouseenter:re,onMousemove:pe,onMouseleave:oe,onKeyDown:p.value?w:void 0,tabIndex:p.value?0:void 0,"aria-label":_.value.ariaLabel===null?void 0:_.value.ariaLabel||`Edge from ${_.value.source} to ${_.value.target}`,"aria-describedby":p.value?`${Os}-${t}`:void 0,role:p.value?"button":"img"},[G.value?null:_e(D.value===!1?l.value.default:D.value,{id:e.id,sourceNode:v,targetNode:$,source:_.value.source,target:_.value.target,type:_.value.type,updatable:k.value,selected:_.value.selected,animated:_.value.animated,label:_.value.label,labelStyle:_.value.labelStyle,labelShowBg:_.value.labelShowBg,labelBgStyle:_.value.labelBgStyle,labelBgPadding:_.value.labelBgPadding,labelBgBorderRadius:_.value.labelBgBorderRadius,data:_.value.data,events:{..._.value.events,...P},style:C.value,markerStart:`url('#${wn(_.value.markerStart,t)}')`,markerEnd:`url('#${wn(_.value.markerEnd,t)}')`,sourcePosition:se,targetPosition:fe,sourceX:he,sourceY:xe,targetX:Xe,targetY:Qt,sourceHandleId:_.value.sourceHandle,targetHandleId:_.value.targetHandle,interactionWidth:_.value.interactionWidth,...b}),[k.value==="source"||k.value===!0?[_e("g",{onMousedown:ce,onMouseenter:H,onMouseout:X},_e(Tr,{position:se,centerX:he,centerY:xe,radius:i.value,type:"source","data-type":"source"}))]:null,k.value==="target"||k.value===!0?[_e("g",{onMousedown:de,onMouseenter:H,onMouseout:X},_e(Tr,{position:fe,centerX:Xe,centerY:Qt,radius:i.value,type:"target","data-type":"target"}))]:null]])};function H(){R.value=!0}function X(){R.value=!1}function ee(v,$){N.update({event:v,edge:_.value,connection:$})}function F(v){N.updateEnd({event:v,edge:_.value}),G.value=!1}function Y(v,$){v.button===0&&(G.value=!0,V.value=$?_.value.target:_.value.source,L.value=($?_.value.targetHandle:_.value.sourceHandle)??null,M.value=$?"target":"source",N.updateStart({event:v,edge:_.value}),A(v))}function q(v){var $;const b={event:v,edge:_.value};f.value&&(s.value=!1,_.value.selected&&g.value?(u([_.value]),($=Z.value)==null||$.blur()):n([_.value])),N.click(b)}function ie(v){N.contextMenu({event:v,edge:_.value})}function ae(v){N.doubleClick({event:v,edge:_.value})}function re(v){N.mouseEnter({event:v,edge:_.value})}function pe(v){N.mouseMove({event:v,edge:_.value})}function oe(v){N.mouseLeave({event:v,edge:_.value})}function ce(v){Y(v,!0)}function de(v){Y(v,!1)}function w(v){var $;!E.value&&Bs.includes(v.key)&&f.value&&(v.key==="Escape"?(($=Z.value)==null||$.blur(),u([c(e.id)])):n([c(e.id)]))}}}),Xh=Gh,Uh=me({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:s,connectionLineStyle:a,connectionLineOptions:l,connectionStatus:u,viewport:c,findNode:d}=$e(),h=(e=Rt(Eo))==null?void 0:e["connection-line"],g=j(()=>{var S;return d((S=o.value)==null?void 0:S.nodeId)}),E=j(()=>{var S;return d((S=i.value)==null?void 0:S.nodeId)??null}),x=j(()=>({x:(r.value.x-c.value.x)/c.value.zoom,y:(r.value.y-c.value.y)/c.value.zoom})),y=j(()=>l.value.markerStart?`url(#${wn(l.value.markerStart,t)})`:""),m=j(()=>l.value.markerEnd?`url(#${wn(l.value.markerEnd,t)})`:"");return()=>{var S,_,N;if(!g.value||!o.value)return null;const P=o.value.id,O=o.value.type,z=g.value.handleBounds;let R=(z==null?void 0:z[O])??[];if(n.value===_t.Loose){const C=(z==null?void 0:z[O==="source"?"target":"source"])??[];R=[...R,...C]}if(!R)return null;const G=(P?R.find(C=>C.id===P):R[0])??null,V=(G==null?void 0:G.position)??te.Top,{x:L,y:M}=Wt(g.value,G,V);let Z=null;E.value&&(n.value===_t.Strict?Z=((S=E.value.handleBounds[O==="source"?"target":"source"])==null?void 0:S.find(C=>{var D;return C.id===((D=i.value)==null?void 0:D.id)}))||null:Z=((_=[...E.value.handleBounds.source??[],...E.value.handleBounds.target??[]])==null?void 0:_.find(C=>{var D;return C.id===((D=i.value)==null?void 0:D.id)}))||null);const f=((N=i.value)==null?void 0:N.position)??(V?si[V]:null);if(!V||!f)return null;const k=s.value??l.value.type??Et.Bezier;let p="";const T={sourceX:L,sourceY:M,sourcePosition:V,targetX:x.value.x,targetY:x.value.y,targetPosition:f};return k===Et.Bezier?[p]=Ii(T):k===Et.Step?[p]=li({...T,borderRadius:0}):k===Et.SmoothStep?[p]=li(T):k===Et.SimpleBezier?[p]=ra(T):p=`M${L},${M} ${x.value.x},${x.value.y}`,_e("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},_e("g",{class:"vue-flow__connection"},h?_e(h,{sourceX:L,sourceY:M,sourcePosition:V,targetX:x.value.x,targetY:x.value.y,targetPosition:f,sourceNode:g.value,sourceHandle:G,targetNode:E.value,targetHandle:Z,markerEnd:m.value,markerStart:y.value,connectionStatus:u.value}):_e("path",{d:p,class:[l.value.class,u,"vue-flow__connection-path"],style:{...a.value,...l.value.style},"marker-end":m.value,"marker-start":y.value})))}}}),Wh=Uh,Zh=["id","markerWidth","markerHeight","markerUnits","orient"],qh={name:"MarkerType",compatConfig:{MODE:3}},Kh=me({...qh,props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(e){return(t,n)=>(W(),ue("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===I(oi).ArrowClosed?(W(),ue("polyline",{key:0,style:Se({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):Me("",!0),t.type===I(oi).Arrow?(W(),ue("polyline",{key:1,style:Se({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):Me("",!0)],8,Zh))}}),Qh={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Jh={name:"MarkerDefinitions",compatConfig:{MODE:3}},jh=me({...Jh,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=$e(),r=j(()=>{const s=new Set,a=[],l=u=>{if(u){const c=wn(u,t);s.has(c)||(typeof u=="object"?a.push({...u,id:c,color:u.color||i.value}):a.push({id:c,color:i.value,type:u}),s.add(c))}};for(const u of[o.value.markerEnd,o.value.markerStart])l(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])l(c);return a.sort((u,c)=>u.id.localeCompare(c.id))});return(s,a)=>(W(),ue("svg",Qh,[ve("defs",null,[(W(!0),ue(Ie,null,Mt(r.value,l=>(W(),Ee(Kh,{id:l.id,key:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,"stroke-width":l.strokeWidth,orient:l.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),eg={name:"Edges",compatConfig:{MODE:3}},tg=me({...eg,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=$e();return(i,r)=>(W(),ue(Ie,null,[K(jh),(W(!0),ue(Ie,null,Mt(I(n),s=>(W(),ue("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Se({zIndex:I(_f)(s,I(t),I(o))})},[K(I(Xh),{id:s.id},null,8,["id"])],4))),128)),K(I(Wh))],64))}}),ng=me({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:s,removeSelectedNodes:a,addSelectedNodes:l,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:h,elevateNodesOnSelect:g,disableKeyboardA11y:E,ariaLiveMessage:x,snapToGrid:y,snapGrid:m,nodeDragThreshold:S,nodesDraggable:_,elementsSelectable:N,nodesConnectable:P,nodesFocusable:O,hooks:z}=$e(),R=ye(null);zt(Qs,R),zt(Ks,e.id);const G=Rt(Eo),V=En(),L=ta(),{node:M,parentNode:Z}=ea(e.id),{emit:f,on:k}=Vf(M,s),p=we(()=>typeof M.draggable>"u"?_.value:M.draggable),T=we(()=>typeof M.selectable>"u"?N.value:M.selectable),C=we(()=>typeof M.connectable>"u"?P.value:M.connectable),D=we(()=>typeof M.focusable>"u"?O.value:M.focusable),A=we(()=>T.value||p.value||z.value.nodeClick.hasListeners()||z.value.nodeDoubleClick.hasListeners()||z.value.nodeMouseEnter.hasListeners()||z.value.nodeMouseMove.hasListeners()||z.value.nodeMouseLeave.hasListeners()),H=we(()=>!!M.dimensions.width&&!!M.dimensions.height),X=j(()=>{const $=M.type||"default",b=G==null?void 0:G[`node-${$}`];if(b)return b;let B=M.template||d.value[$];if(typeof B=="string"&&V){const ne=Object.keys(V.appContext.components);ne&&ne.includes($)&&(B=ns($,!1))}return B&&typeof B!="string"?B:(s.error(new ke(Ce.NODE_TYPE_MISSING,B)),!1)}),ee=Js({id:e.id,el:R,disabled:()=>!p.value,selectable:T,dragHandle:()=>M.dragHandle,onStart($){f.dragStart($)},onDrag($){f.drag($)},onStop($){f.dragStop($)},onClick($){w($)}}),F=j(()=>M.class instanceof Function?M.class(M):M.class),Y=j(()=>{const $=(M.style instanceof Function?M.style(M):M.style)||{},b=M.width instanceof Function?M.width(M):M.width,B=M.height instanceof Function?M.height(M):M.height;return!$.width&&b&&($.width=typeof b=="string"?b:`${b}px`),!$.height&&B&&($.height=typeof B=="string"?B:`${B}px`),$}),q=we(()=>Number(M.zIndex??Y.value.zIndex??0));return c($=>{($.includes(e.id)||!$.length)&&ae()}),$t(()=>{be(()=>M.hidden,($=!1,b,B)=>{!$&&R.value&&(e.resizeObserver.observe(R.value),B(()=>{R.value&&e.resizeObserver.unobserve(R.value)}))},{immediate:!0,flush:"post"})}),be([()=>M.type,()=>M.sourcePosition,()=>M.targetPosition],()=>{it(()=>{u([{id:e.id,nodeElement:R.value,forceUpdate:!0}])})}),be([()=>M.position.x,()=>M.position.y,()=>{var $;return($=Z.value)==null?void 0:$.computedPosition.x},()=>{var $;return($=Z.value)==null?void 0:$.computedPosition.y},()=>{var $;return($=Z.value)==null?void 0:$.computedPosition.z},q,()=>M.selected,()=>M.dimensions.height,()=>M.dimensions.width,()=>{var $;return($=Z.value)==null?void 0:$.dimensions.height},()=>{var $;return($=Z.value)==null?void 0:$.dimensions.width}],([$,b,B,ne,Q,J])=>{const se={x:$,y:b,z:J+(g.value&&M.selected?1e3:0)};typeof B<"u"&&typeof ne<"u"?M.computedPosition=gf({x:B,y:ne,z:Q},se):M.computedPosition=se},{flush:"post",immediate:!0}),be([()=>M.extent,h],([$,b],[B,ne])=>{($!==B||b!==ne)&&ie()}),M.extent==="parent"||typeof M.extent=="object"&&"range"in M.extent&&M.extent.range==="parent"?Zo(()=>H).toBe(!0).then(ie):ie(),()=>M.hidden?null:_e("div",{ref:R,"data-id":M.id,class:["vue-flow__node",`vue-flow__node-${X.value===!1?"default":M.type||"default"}`,{[n.value]:p.value,dragging:ee==null?void 0:ee.value,draggable:p.value,selected:M.selected,selectable:T.value,parent:M.isParent},F.value],style:{visibility:H.value?"visible":"hidden",zIndex:M.computedPosition.z??q.value,transform:`translate(${M.computedPosition.x}px,${M.computedPosition.y}px)`,pointerEvents:A.value?"all":"none",...Y.value},tabIndex:D.value?0:void 0,role:D.value?"button":void 0,"aria-describedby":E.value?void 0:`${Ps}-${t}`,"aria-label":M.ariaLabel,onMouseenter:re,onMousemove:pe,onMouseleave:oe,onContextmenu:ce,onClick:w,onDblclick:de,onKeydown:v},[_e(X.value===!1?d.value.default:X.value,{id:M.id,type:M.type,data:M.data,events:{...M.events,...k},selected:M.selected,resizing:M.resizing,dragging:ee.value,connectable:C.value,position:M.computedPosition,dimensions:M.dimensions,isValidTargetPos:M.isValidTargetPos,isValidSourcePos:M.isValidSourcePos,parent:M.parentNode,parentNodeId:M.parentNode,zIndex:M.computedPosition.z??q.value,targetPosition:M.targetPosition,sourcePosition:M.sourcePosition,label:M.label,dragHandle:M.dragHandle,onUpdateNodeInternals:ae})]);function ie(){const $=M.computedPosition,{computedPosition:b,position:B}=ki(M,y.value?$o($,m.value):$,s.error,h.value,Z.value);(M.computedPosition.x!==b.x||M.computedPosition.y!==b.y)&&(M.computedPosition={...M.computedPosition,...b}),(M.position.x!==B.x||M.position.y!==B.y)&&(M.position=B)}function ae(){R.value&&u([{id:e.id,nodeElement:R.value,forceUpdate:!0}])}function re($){ee!=null&&ee.value||f.mouseEnter({event:$,node:M})}function pe($){ee!=null&&ee.value||f.mouseMove({event:$,node:M})}function oe($){ee!=null&&ee.value||f.mouseLeave({event:$,node:M})}function ce($){return f.contextMenu({event:$,node:M})}function de($){return f.doubleClick({event:$,node:M})}function w($){T.value&&(!o.value||!p.value||S.value>0)&&ai(M,r.value,l,a,i,!1,R.value),f.click({event:$,node:M})}function v($){if(!(ii($)||E.value))if(Bs.includes($.key)&&T.value){const b=$.key==="Escape";ai(M,r.value,l,a,i,b,R.value)}else p.value&&M.selected&&Lt[$.key]&&($.preventDefault(),x.value=`Moved selected node ${$.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~M.position.x}, y: ${~~M.position.y}`,L({x:Lt[$.key].x,y:Lt[$.key].y},$.shiftKey))}}}),og=ng;function ig(e={includeHiddenNodes:!1}){const{nodes:t}=$e();return j(()=>{if(t.value.length===0)return!1;for(const n of t.value)if((e.includeHiddenNodes||!n.hidden)&&((n==null?void 0:n.handleBounds)===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const rg={class:"vue-flow__nodes vue-flow__container"},sg={name:"Nodes",compatConfig:{MODE:3}},ag=me({...sg,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=$e(),i=ig(),r=ye();return be(i,s=>{s&&it(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),$t(()=>{r.value=new ResizeObserver(s=>{const a=s.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));it(()=>n(a))})}),es(()=>{var s;return(s=r.value)==null?void 0:s.disconnect()}),(s,a)=>(W(),ue("div",rg,[r.value?(W(!0),ue(Ie,{key:0},Mt(I(t),(l,u,c,d)=>{const h=[l.id];if(d&&d.key===l.id&&Fa(d,h))return d;const g=(W(),Ee(I(og),{id:l.id,key:l.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return g.memo=h,g},a,0),128)):Me("",!0)]))}});function lg(){const{emits:e}=$e();$t(()=>{if(qs()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new ke(Ce.MISSING_STYLES))}})}const ug=ve("div",{class:"vue-flow__edge-labels"},null,-1),cg={name:"VueFlow",compatConfig:{MODE:3}},dg=me({...cg,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const o=e,i=Qr(),r=To(o,"modelValue",n),s=To(o,"nodes",n),a=To(o,"edges",n),l=$e(o),u=Yf({modelValue:r,nodes:s,edges:a},o,l);return Xf(n,l.hooks),Fh(),lg(),zt(Eo,i),Ha(()=>{u()}),t(l),(c,d)=>(W(),ue("div",{ref:I(l).vueFlowRef,class:"vue-flow"},[K(Ph,null,{default:le(()=>[K(tg),ug,K(ag),Re(c.$slots,"zoom-pane")]),_:3}),Re(c.$slots,"default"),K(Vh)],512))}}),fg={name:"Panel",compatConfig:{MODE:3}},hg=me({...fg,props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=$e(),o=j(()=>`${t.position}`.split("-"));return(i,r)=>(W(),ue("div",{class:Le(["vue-flow__panel",o.value]),style:Se({pointerEvents:I(n)?"none":"all"})},[Re(i.$slots,"default")],6))}}),{HORIZONTAL_STEP:aa,VERTICAL_STEP:lo}=qa,gg=e=>{const t={};for(const n of e){const o=`${n.schema}.${n.table}`;t[o]||(t[o]={connections:new Set,degree:0});for(const i of n.foreign_keys){const r=`${i.reference_schema}.${i.reference_table}`;t[r]||(t[r]={connections:new Set,degree:0}),t[o].connections.add(r),t[r].connections.add(o)}}for(const[n,o]of Object.entries(t))o.degree=o.connections.size;return t},pg=e=>{const t=Object.entries(e);return t.length===0?"":t.sort((n,o)=>o[1].degree-n[1].degree)[0][0]},vg=(e,t)=>{const n={},o=[{id:t,depth:0}],i=new Set;for(;o.length>0;){const{id:r,depth:s}=o.shift();if(!i.has(r)&&(i.add(r),n[r]=s,e[r]))for(const a of e[r].connections)i.has(a)||o.push({id:a,depth:s+1})}return n},mg=(e,t,n)=>{var s;const o={},i=new Map(n.map(a=>[`${a.schema}.${a.table}`,a])),r={};for(const[a,l]of Object.entries(t))r[l]||(r[l]=[]),r[l].push(a);for(const[a,l]of Object.entries(r)){const u=Number(a);l.sort((h,g)=>e[g].degree-e[h].degree);let d=-l.reduce((h,g)=>{var y;const E=i.get(g),x=(((y=E==null?void 0:E.columns)==null?void 0:y.length)||0)*yt+Uo+lo;return h+x},0)/2;for(const h of l){const g=i.get(h),E=(((s=g==null?void 0:g.columns)==null?void 0:s.length)||0)*yt+Uo+lo;o[h]={x:u*aa,y:d+E/2},d+=E}}return o},B0=e=>{var l;if(!e.length)return{nodes:[],edges:[],centerId:""};const t=gg(e),n=pg(t),o=vg(t,n),i=mg(t,o,e),r=e.filter(u=>{const c=`${u.schema}.${u.table}`,d=t[c];return!d||d.connections.size===0});if(r.length>0){const u=Math.max(...Object.values(i).map(h=>h.x));let d=Math.min(...Object.values(i).map(h=>h.y))-lo;for(const h of r){const g=`${h.schema}.${h.table}`,E=(((l=h.columns)==null?void 0:l.length)||0)*yt+Uo;i[g]={x:u+aa*1.5,y:d},d-=E+lo}}const s=Wa(e,i),a=Za(e);return{nodes:s,edges:a,centerId:n}},pt=(e,t)=>`${e}-${t}`,xt=(e,t,n,o)=>{const{id:i,sourceHandle:r,targetHandle:s,sourceNode:a,targetNode:l,selectable:u}=e,c=t||(o==null?void 0:o.edgeId)===i||(n==null?void 0:n.edgeIds.has(i))||!1;e.animated=c;const d=(y,m,S)=>{if(!y||!m)return;y.label||(y.label=new Map);const _=y.label;S?_.set(m,!0):_.delete(m)},h=pt(a==null?void 0:a.id,r),g=pt(l==null?void 0:l.id,s),E=c||u||(n==null?void 0:n.relatedColumnIds.has(h))||(o==null?void 0:o.sourceId)===h||t,x=c||u||(n==null?void 0:n.relatedColumnIds.has(g))||(o==null?void 0:o.targetId)===g||t;d(a,r,!!E),d(l,s,!!x)},ui=({findNode:e,fitView:t,getViewport:n,nodeId:o})=>{if(!e(o))return;const r=n().zoom;t({nodes:[o],maxZoom:r,minZoom:r,duration:Ka})},Ar=e=>(e||0)*yt-yt/2-1+2+10+yt;var nt=(e=>(e.Lines="lines",e.Dots="dots",e))(nt||{});const la=function({dimensions:e,size:t,color:n}){return _e("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},ua=function({radius:e,color:t}){return _e("circle",{cx:e,cy:e,r:e,fill:t})};nt.Lines+"",nt.Dots+"";const yg={[nt.Dots]:"#81818a",[nt.Lines]:"#eee"},wg=["id","x","y","width","height","patternTransform"],_g={key:2,height:"100",width:"100"},bg=["fill"],$g=["x","y","fill"],xg={name:"Background",compatConfig:{MODE:3}},Eg=me({...xg,props:{id:{},variant:{default:()=>nt.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:n}=$e(),o=j(()=>{const s=n.value.zoom,[a,l]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],u=[a*s||1,l*s||1],c=e.size*s,[d,h]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],g=[d*s||1+u[0]/2,h*s||1+u[1]/2];return{scaledGap:u,offset:g,size:c}}),i=we(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),r=we(()=>e.color||e.patternColor||yg[e.variant||nt.Dots]);return(s,a)=>(W(),ue("svg",{class:"vue-flow__background vue-flow__container",style:Se({height:`${s.height>100?100:s.height}%`,width:`${s.width>100?100:s.width}%`})},[Re(s.$slots,"pattern-container",{id:i.value},()=>[ve("pattern",{id:i.value,x:I(n).x%o.value.scaledGap[0],y:I(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[Re(s.$slots,"pattern",{},()=>[s.variant===I(nt).Lines?(W(),Ee(I(la),{key:0,size:s.lineWidth,color:r.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):s.variant===I(nt).Dots?(W(),Ee(I(ua),{key:1,color:r.value,radius:o.value.size/2},null,8,["color","radius"])):Me("",!0),s.bgColor?(W(),ue("svg",_g,[ve("rect",{width:"100%",height:"100%",fill:s.bgColor},null,8,bg)])):Me("",!0)])],8,wg)]),ve("rect",{x:s.x,y:s.y,width:"100%",height:"100%",fill:`url(#${i.value})`},null,8,$g),Re(s.$slots,"default",{id:i.value})],4))}});var Sg={value:()=>{}};function Ai(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Zn(n)}function Zn(e){this._=e}function Ng(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Zn.prototype=Ai.prototype={constructor:Zn,on:function(e,t){var n=this._,o=Ng(e+"",n),i,r=-1,s=o.length;if(arguments.length<2){for(;++r<s;)if((i=(e=o[r]).type)&&(i=Cg(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<s;)if(i=(e=o[r]).type)n[i]=Dr(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Dr(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Zn(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)}};function Cg(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function Dr(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=Sg,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var ci="http://www.w3.org/1999/xhtml";const zr={svg:"http://www.w3.org/2000/svg",xhtml:ci,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ko(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),zr.hasOwnProperty(t)?{space:zr[t],local:e}:e}function kg(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ci&&t.documentElement.namespaceURI===ci?t.createElement(e):t.createElementNS(n,e)}}function Mg(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ca(e){var t=ko(e);return(t.local?Mg:kg)(t)}function Ig(){}function Di(e){return e==null?Ig:function(){return this.querySelector(e)}}function Tg(e){typeof e!="function"&&(e=Di(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=new Array(s),l,u,c=0;c<s;++c)(l=r[c])&&(u=e.call(l,l.__data__,c,r))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new Oe(o,this._parents)}function Ag(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Dg(){return[]}function da(e){return e==null?Dg:function(){return this.querySelectorAll(e)}}function zg(e){return function(){return Ag(e.apply(this,arguments))}}function Pg(e){typeof e=="function"?e=zg(e):e=da(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var s=t[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(o.push(e.call(l,l.__data__,u,s)),i.push(l));return new Oe(o,i)}function fa(e){return function(){return this.matches(e)}}function ha(e){return function(t){return t.matches(e)}}var Og=Array.prototype.find;function Bg(e){return function(){return Og.call(this.children,e)}}function Rg(){return this.firstElementChild}function Hg(e){return this.select(e==null?Rg:Bg(typeof e=="function"?e:ha(e)))}var Vg=Array.prototype.filter;function Fg(){return Array.from(this.children)}function Lg(e){return function(){return Vg.call(this.children,e)}}function Yg(e){return this.selectAll(e==null?Fg:Lg(typeof e=="function"?e:ha(e)))}function Gg(e){typeof e!="function"&&(e=fa(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new Oe(o,this._parents)}function ga(e){return new Array(e.length)}function Xg(){return new Oe(this._enter||this._groups.map(ga),this._parents)}function uo(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}uo.prototype={constructor:uo,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Ug(e){return function(){return e}}function Wg(e,t,n,o,i,r){for(var s=0,a,l=t.length,u=r.length;s<u;++s)(a=t[s])?(a.__data__=r[s],o[s]=a):n[s]=new uo(e,r[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function Zg(e,t,n,o,i,r,s){var a,l,u=new Map,c=t.length,d=r.length,h=new Array(c),g;for(a=0;a<c;++a)(l=t[a])&&(h[a]=g=s.call(l,l.__data__,a,t)+"",u.has(g)?i[a]=l:u.set(g,l));for(a=0;a<d;++a)g=s.call(e,r[a],a,r)+"",(l=u.get(g))?(o[a]=l,l.__data__=r[a],u.delete(g)):n[a]=new uo(e,r[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(h[a])===l&&(i[a]=l)}function qg(e){return e.__data__}function Kg(e,t){if(!arguments.length)return Array.from(this,qg);var n=t?Zg:Wg,o=this._parents,i=this._groups;typeof e!="function"&&(e=Ug(e));for(var r=i.length,s=new Array(r),a=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],d=i[u],h=d.length,g=Qg(e.call(c,c&&c.__data__,u,o)),E=g.length,x=a[u]=new Array(E),y=s[u]=new Array(E),m=l[u]=new Array(h);n(c,d,x,y,m,g,t);for(var S=0,_=0,N,P;S<E;++S)if(N=x[S]){for(S>=_&&(_=S+1);!(P=y[_])&&++_<E;);N._next=P||null}}return s=new Oe(s,o),s._enter=a,s._exit=l,s}function Qg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Jg(){return new Oe(this._exit||this._groups.map(ga),this._parents)}function jg(e,t,n){var o=this.enter(),i=this,r=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function ep(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,s=Math.min(i,r),a=new Array(i),l=0;l<s;++l)for(var u=n[l],c=o[l],d=u.length,h=a[l]=new Array(d),g,E=0;E<d;++E)(g=u[E]||c[E])&&(h[E]=g);for(;l<i;++l)a[l]=n[l];return new Oe(a,this._parents)}function tp(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],s;--i>=0;)(s=o[i])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function np(e){e||(e=op);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var s=n[r],a=s.length,l=i[r]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new Oe(i,this._parents).order()}function op(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ip(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function rp(){return Array.from(this)}function sp(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length;i<r;++i){var s=o[i];if(s)return s}return null}function ap(){let e=0;for(const t of this)++e;return e}function lp(){return!this.node()}function up(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,s=i.length,a;r<s;++r)(a=i[r])&&e.call(a,a.__data__,r,i);return this}function cp(e){return function(){this.removeAttribute(e)}}function dp(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fp(e,t){return function(){this.setAttribute(e,t)}}function hp(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function gp(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function pp(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function vp(e,t){var n=ko(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?dp:cp:typeof t=="function"?n.local?pp:gp:n.local?hp:fp)(n,t))}function pa(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function mp(e){return function(){this.style.removeProperty(e)}}function yp(e,t,n){return function(){this.style.setProperty(e,t,n)}}function wp(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function _p(e,t,n){return arguments.length>1?this.each((t==null?mp:typeof t=="function"?wp:yp)(e,t,n??"")):qt(this.node(),e)}function qt(e,t){return e.style.getPropertyValue(t)||pa(e).getComputedStyle(e,null).getPropertyValue(t)}function bp(e){return function(){delete this[e]}}function $p(e,t){return function(){this[e]=t}}function xp(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Ep(e,t){return arguments.length>1?this.each((t==null?bp:typeof t=="function"?xp:$p)(e,t)):this.node()[e]}function va(e){return e.trim().split(/^|\s+/)}function zi(e){return e.classList||new ma(e)}function ma(e){this._node=e,this._names=va(e.getAttribute("class")||"")}ma.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ya(e,t){for(var n=zi(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function wa(e,t){for(var n=zi(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function Sp(e){return function(){ya(this,e)}}function Np(e){return function(){wa(this,e)}}function Cp(e,t){return function(){(t.apply(this,arguments)?ya:wa)(this,e)}}function kp(e,t){var n=va(e+"");if(arguments.length<2){for(var o=zi(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Cp:t?Sp:Np)(n,t))}function Mp(){this.textContent=""}function Ip(e){return function(){this.textContent=e}}function Tp(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Ap(e){return arguments.length?this.each(e==null?Mp:(typeof e=="function"?Tp:Ip)(e)):this.node().textContent}function Dp(){this.innerHTML=""}function zp(e){return function(){this.innerHTML=e}}function Pp(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Op(e){return arguments.length?this.each(e==null?Dp:(typeof e=="function"?Pp:zp)(e)):this.node().innerHTML}function Bp(){this.nextSibling&&this.parentNode.appendChild(this)}function Rp(){return this.each(Bp)}function Hp(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Vp(){return this.each(Hp)}function Fp(e){var t=typeof e=="function"?e:ca(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Lp(){return null}function Yp(e,t){var n=typeof e=="function"?e:ca(e),o=t==null?Lp:typeof t=="function"?t:Di(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Gp(){var e=this.parentNode;e&&e.removeChild(this)}function Xp(){return this.each(Gp)}function Up(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Wp(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Zp(e){return this.select(e?Wp:Up)}function qp(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Kp(e){return function(t){e.call(this,t,this.__data__)}}function Qp(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Jp(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,r;n<i;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++o]=r;++o?t.length=o:delete this.__on}}}function jp(e,t,n){return function(){var o=this.__on,i,r=Kp(t);if(o){for(var s=0,a=o.length;s<a;++s)if((i=o[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=t;return}}this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}function ev(e,t,n){var o=Qp(e+""),i,r=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(i=0,c=a[l];i<r;++i)if((s=o[i]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?jp:Jp,i=0;i<r;++i)this.each(a(o[i],t,n));return this}function _a(e,t,n){var o=pa(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function tv(e,t){return function(){return _a(this,e,t)}}function nv(e,t){return function(){return _a(this,e,t.apply(this,arguments))}}function ov(e,t){return this.each((typeof t=="function"?nv:tv)(e,t))}function*iv(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,s;i<r;++i)(s=o[i])&&(yield s)}var ba=[null];function Oe(e,t){this._groups=e,this._parents=t}function kn(){return new Oe([[document.documentElement]],ba)}function rv(){return this}Oe.prototype=kn.prototype={constructor:Oe,select:Tg,selectAll:Pg,selectChild:Hg,selectChildren:Yg,filter:Gg,data:Kg,enter:Xg,exit:Jg,join:jg,merge:ep,selection:rv,order:tp,sort:np,call:ip,nodes:rp,node:sp,size:ap,empty:lp,each:up,attr:vp,style:_p,property:Ep,classed:kp,text:Ap,html:Op,raise:Rp,lower:Vp,append:Fp,insert:Yp,remove:Xp,clone:Zp,datum:qp,on:ev,dispatch:ov,[Symbol.iterator]:iv};function mt(e){return typeof e=="string"?new Oe([[document.querySelector(e)]],[document.documentElement]):new Oe([[e]],ba)}function sv(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ft(e,t){if(e=sv(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const di={capture:!0,passive:!1};function fi(e){e.preventDefault(),e.stopImmediatePropagation()}function av(e){var t=e.document.documentElement,n=mt(e).on("dragstart.drag",fi,di);"onselectstart"in t?n.on("selectstart.drag",fi,di):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function lv(e,t){var n=e.document.documentElement,o=mt(e).on("dragstart.drag",null);t&&(o.on("click.drag",fi,di),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function Pi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function $a(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Mn(){}var _n=.7,co=1/_n,Yt="\\s*([+-]?\\d+)\\s*",bn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",uv=/^#([0-9a-f]{3,8})$/,cv=new RegExp(`^rgb\\(${Yt},${Yt},${Yt}\\)$`),dv=new RegExp(`^rgb\\(${qe},${qe},${qe}\\)$`),fv=new RegExp(`^rgba\\(${Yt},${Yt},${Yt},${bn}\\)$`),hv=new RegExp(`^rgba\\(${qe},${qe},${qe},${bn}\\)$`),gv=new RegExp(`^hsl\\(${bn},${qe},${qe}\\)$`),pv=new RegExp(`^hsla\\(${bn},${qe},${qe},${bn}\\)$`),Pr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Pi(Mn,$n,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Or,formatHex:Or,formatHex8:vv,formatHsl:mv,formatRgb:Br,toString:Br});function Or(){return this.rgb().formatHex()}function vv(){return this.rgb().formatHex8()}function mv(){return xa(this).formatHsl()}function Br(){return this.rgb().formatRgb()}function $n(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=uv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Rr(t):n===3?new De(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Rn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Rn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=cv.exec(e))?new De(t[1],t[2],t[3],1):(t=dv.exec(e))?new De(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=fv.exec(e))?Rn(t[1],t[2],t[3],t[4]):(t=hv.exec(e))?Rn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=gv.exec(e))?Fr(t[1],t[2]/100,t[3]/100,1):(t=pv.exec(e))?Fr(t[1],t[2]/100,t[3]/100,t[4]):Pr.hasOwnProperty(e)?Rr(Pr[e]):e==="transparent"?new De(NaN,NaN,NaN,0):null}function Rr(e){return new De(e>>16&255,e>>8&255,e&255,1)}function Rn(e,t,n,o){return o<=0&&(e=t=n=NaN),new De(e,t,n,o)}function yv(e){return e instanceof Mn||(e=$n(e)),e?(e=e.rgb(),new De(e.r,e.g,e.b,e.opacity)):new De}function hi(e,t,n,o){return arguments.length===1?yv(e):new De(e,t,n,o??1)}function De(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Pi(De,hi,$a(Mn,{brighter(e){return e=e==null?co:Math.pow(co,e),new De(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?_n:Math.pow(_n,e),new De(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new De(Dt(this.r),Dt(this.g),Dt(this.b),fo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Hr,formatHex:Hr,formatHex8:wv,formatRgb:Vr,toString:Vr}));function Hr(){return`#${kt(this.r)}${kt(this.g)}${kt(this.b)}`}function wv(){return`#${kt(this.r)}${kt(this.g)}${kt(this.b)}${kt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Vr(){const e=fo(this.opacity);return`${e===1?"rgb(":"rgba("}${Dt(this.r)}, ${Dt(this.g)}, ${Dt(this.b)}${e===1?")":`, ${e})`}`}function fo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Dt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function kt(e){return e=Dt(e),(e<16?"0":"")+e.toString(16)}function Fr(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Fe(e,t,n,o)}function xa(e){if(e instanceof Fe)return new Fe(e.h,e.s,e.l,e.opacity);if(e instanceof Mn||(e=$n(e)),!e)return new Fe;if(e instanceof Fe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),s=NaN,a=r-i,l=(r+i)/2;return a?(t===r?s=(n-o)/a+(n<o)*6:n===r?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?r+i:2-r-i,s*=60):a=l>0&&l<1?0:s,new Fe(s,a,l,e.opacity)}function _v(e,t,n,o){return arguments.length===1?xa(e):new Fe(e,t,n,o??1)}function Fe(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Pi(Fe,_v,$a(Mn,{brighter(e){return e=e==null?co:Math.pow(co,e),new Fe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?_n:Math.pow(_n,e),new Fe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new De(Yo(e>=240?e-240:e+120,i,o),Yo(e,i,o),Yo(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Fe(Lr(this.h),Hn(this.s),Hn(this.l),fo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=fo(this.opacity);return`${e===1?"hsl(":"hsla("}${Lr(this.h)}, ${Hn(this.s)*100}%, ${Hn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Lr(e){return e=(e||0)%360,e<0?e+360:e}function Hn(e){return Math.max(0,Math.min(1,e||0))}function Yo(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ea=e=>()=>e;function bv(e,t){return function(n){return e+n*t}}function $v(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function xv(e){return(e=+e)==1?Sa:function(t,n){return n-t?$v(t,n,e):Ea(isNaN(t)?n:t)}}function Sa(e,t){var n=t-e;return n?bv(e,n):Ea(isNaN(e)?t:e)}const Yr=function e(t){var n=xv(t);function o(i,r){var s=n((i=hi(i)).r,(r=hi(r)).r),a=n(i.g,r.g),l=n(i.b,r.b),u=Sa(i.opacity,r.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return o.gamma=e,o}(1);function vt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var gi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Go=new RegExp(gi.source,"g");function Ev(e){return function(){return e}}function Sv(e){return function(t){return e(t)+""}}function Nv(e,t){var n=gi.lastIndex=Go.lastIndex=0,o,i,r,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=gi.exec(e))&&(i=Go.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),a[s]?a[s]+=r:a[++s]=r),(o=o[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:vt(o,i)})),n=Go.lastIndex;return n<t.length&&(r=t.slice(n),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?Sv(l[0].x):Ev(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}var Gr=180/Math.PI,pi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Na(e,t,n,o,i,r){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*Gr,skewX:Math.atan(l)*Gr,scaleX:s,scaleY:a}}var Vn;function Cv(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?pi:Na(t.a,t.b,t.c,t.d,t.e,t.f)}function kv(e){return e==null||(Vn||(Vn=document.createElementNS("http://www.w3.org/2000/svg","g")),Vn.setAttribute("transform",e),!(e=Vn.transform.baseVal.consolidate()))?pi:(e=e.matrix,Na(e.a,e.b,e.c,e.d,e.e,e.f))}function Ca(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,d,h,g,E){if(u!==d||c!==h){var x=g.push("translate(",null,t,null,n);E.push({i:x-4,x:vt(u,d)},{i:x-2,x:vt(c,h)})}else(d||h)&&g.push("translate("+d+t+h+n)}function s(u,c,d,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:d.push(i(d)+"rotate(",null,o)-2,x:vt(u,c)})):c&&d.push(i(d)+"rotate("+c+o)}function a(u,c,d,h){u!==c?h.push({i:d.push(i(d)+"skewX(",null,o)-2,x:vt(u,c)}):c&&d.push(i(d)+"skewX("+c+o)}function l(u,c,d,h,g,E){if(u!==d||c!==h){var x=g.push(i(g)+"scale(",null,",",null,")");E.push({i:x-4,x:vt(u,d)},{i:x-2,x:vt(c,h)})}else(d!==1||h!==1)&&g.push(i(g)+"scale("+d+","+h+")")}return function(u,c){var d=[],h=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,d,h),s(u.rotate,c.rotate,d,h),a(u.skewX,c.skewX,d,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,h),u=c=null,function(g){for(var E=-1,x=h.length,y;++E<x;)d[(y=h[E]).i]=y.x(g);return d.join("")}}}var Mv=Ca(Cv,"px, ","px)","deg)"),Iv=Ca(kv,", ",")",")"),Tv=1e-12;function Xr(e){return((e=Math.exp(e))+1/e)/2}function Av(e){return((e=Math.exp(e))-1/e)/2}function Dv(e){return((e=Math.exp(2*e))-1)/(e+1)}const zv=function e(t,n,o){function i(r,s){var a=r[0],l=r[1],u=r[2],c=s[0],d=s[1],h=s[2],g=c-a,E=d-l,x=g*g+E*E,y,m;if(x<Tv)m=Math.log(h/u)/t,y=function(z){return[a+z*g,l+z*E,u*Math.exp(t*z*m)]};else{var S=Math.sqrt(x),_=(h*h-u*u+o*x)/(2*u*n*S),N=(h*h-u*u-o*x)/(2*h*n*S),P=Math.log(Math.sqrt(_*_+1)-_),O=Math.log(Math.sqrt(N*N+1)-N);m=(O-P)/t,y=function(z){var R=z*m,G=Xr(P),V=u/(n*S)*(G*Dv(t*R+P)-Av(P));return[a+V*g,l+V*E,u*G/Xr(t*R+P)]}}return y.duration=m*1e3*t/Math.SQRT2,y}return i.rho=function(r){var s=Math.max(.001,+r),a=s*s,l=a*a;return e(s,a,l)},i}(Math.SQRT2,2,4);var Kt=0,sn=0,en=0,ka=1e3,ho,an,go=0,Bt=0,Mo=0,xn=typeof performance=="object"&&performance.now?performance:Date,Ma=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Oi(){return Bt||(Ma(Pv),Bt=xn.now()+Mo)}function Pv(){Bt=0}function po(){this._call=this._time=this._next=null}po.prototype=Ia.prototype={constructor:po,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Oi():+n)+(t==null?0:+t),!this._next&&an!==this&&(an?an._next=this:ho=this,an=this),this._call=e,this._time=n,vi()},stop:function(){this._call&&(this._call=null,this._time=1/0,vi())}};function Ia(e,t,n){var o=new po;return o.restart(e,t,n),o}function Ov(){Oi(),++Kt;for(var e=ho,t;e;)(t=Bt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Kt}function Ur(){Bt=(go=xn.now())+Mo,Kt=sn=0;try{Ov()}finally{Kt=0,Rv(),Bt=0}}function Bv(){var e=xn.now(),t=e-go;t>ka&&(Mo-=t,go=e)}function Rv(){for(var e,t=ho,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ho=n);an=e,vi(o)}function vi(e){if(!Kt){sn&&(sn=clearTimeout(sn));var t=e-Bt;t>24?(e<1/0&&(sn=setTimeout(Ur,e-xn.now()-Mo)),en&&(en=clearInterval(en))):(en||(go=xn.now(),en=setInterval(Bv,ka)),Kt=1,Ma(Ur))}}function Wr(e,t,n){var o=new po;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var Hv=Ai("start","end","cancel","interrupt"),Vv=[],Ta=0,Zr=1,mi=2,qn=3,qr=4,yi=5,Kn=6;function Io(e,t,n,o,i,r){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Fv(e,n,{name:t,index:o,group:i,on:Hv,tween:Vv,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ta})}function Bi(e,t){var n=Ge(e,t);if(n.state>Ta)throw new Error("too late; already scheduled");return n}function Qe(e,t){var n=Ge(e,t);if(n.state>qn)throw new Error("too late; already running");return n}function Ge(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Fv(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=Ia(r,0,n.time);function r(u){n.state=Zr,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,h,g;if(n.state!==Zr)return l();for(c in o)if(g=o[c],g.name===n.name){if(g.state===qn)return Wr(s);g.state===qr?(g.state=Kn,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete o[c]):+c<t&&(g.state=Kn,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete o[c])}if(Wr(function(){n.state===qn&&(n.state=qr,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=mi,n.on.call("start",e,e.__data__,n.index,n.group),n.state===mi){for(n.state=qn,i=new Array(h=n.tween.length),c=0,d=-1;c<h;++c)(g=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=g);i.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=yi,1),d=-1,h=i.length;++d<h;)i[d].call(e,c);n.state===yi&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Kn,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function Qn(e,t){var n=e.__transition,o,i,r=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){r=!1;continue}i=o.state>mi&&o.state<yi,o.state=Kn,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}r&&delete e.__transition}}function Lv(e){return this.each(function(){Qn(this,e)})}function Yv(e,t){var n,o;return function(){var i=Qe(this,e),r=i.tween;if(r!==n){o=n=r;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}i.tween=o}}function Gv(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=Qe(this,e),s=r.tween;if(s!==o){i=(o=s).slice();for(var a={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=a;break}l===u&&i.push(a)}r.tween=i}}function Xv(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Ge(this.node(),n).tween,i=0,r=o.length,s;i<r;++i)if((s=o[i]).name===e)return s.value;return null}return this.each((t==null?Yv:Gv)(n,e,t))}function Ri(e,t,n){var o=e._id;return e.each(function(){var i=Qe(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ge(i,o).value[t]}}function Aa(e,t){var n;return(typeof t=="number"?vt:t instanceof $n?Yr:(n=$n(t))?(t=n,Yr):Nv)(e,t)}function Uv(e){return function(){this.removeAttribute(e)}}function Wv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Zv(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttribute(e);return s===i?null:s===o?r:r=t(o=s,n)}}function qv(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===o?r:r=t(o=s,n)}}function Kv(e,t,n){var o,i,r;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a)))}}function Qv(e,t,n){var o,i,r;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a)))}}function Jv(e,t){var n=ko(e),o=n==="transform"?Iv:Aa;return this.attrTween(e,typeof t=="function"?(n.local?Qv:Kv)(n,o,Ri(this,"attr."+e,t)):t==null?(n.local?Wv:Uv)(n):(n.local?qv:Zv)(n,o,t))}function jv(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function em(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function tm(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&em(e,r)),n}return i._value=t,i}function nm(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&jv(e,r)),n}return i._value=t,i}function om(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=ko(e);return this.tween(n,(o.local?tm:nm)(o,t))}function im(e,t){return function(){Bi(this,e).delay=+t.apply(this,arguments)}}function rm(e,t){return t=+t,function(){Bi(this,e).delay=t}}function sm(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?im:rm)(t,e)):Ge(this.node(),t).delay}function am(e,t){return function(){Qe(this,e).duration=+t.apply(this,arguments)}}function lm(e,t){return t=+t,function(){Qe(this,e).duration=t}}function um(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?am:lm)(t,e)):Ge(this.node(),t).duration}function cm(e,t){if(typeof t!="function")throw new Error;return function(){Qe(this,e).ease=t}}function dm(e){var t=this._id;return arguments.length?this.each(cm(t,e)):Ge(this.node(),t).ease}function fm(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Qe(this,e).ease=n}}function hm(e){if(typeof e!="function")throw new Error;return this.each(fm(this._id,e))}function gm(e){typeof e!="function"&&(e=fa(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new st(o,this._parents,this._name,this._id)}function pm(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,r=Math.min(o,i),s=new Array(o),a=0;a<r;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),h,g=0;g<c;++g)(h=l[g]||u[g])&&(d[g]=h);for(;a<o;++a)s[a]=t[a];return new st(s,this._parents,this._name,this._id)}function vm(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function mm(e,t,n){var o,i,r=vm(t)?Bi:Qe;return function(){var s=r(this,e),a=s.on;a!==o&&(i=(o=a).copy()).on(t,n),s.on=i}}function ym(e,t){var n=this._id;return arguments.length<2?Ge(this.node(),n).on.on(e):this.each(mm(n,e,t))}function wm(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _m(){return this.on("end.remove",wm(this._id))}function bm(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Di(e));for(var o=this._groups,i=o.length,r=new Array(i),s=0;s<i;++s)for(var a=o[s],l=a.length,u=r[s]=new Array(l),c,d,h=0;h<l;++h)(c=a[h])&&(d=e.call(c,c.__data__,h,a))&&("__data__"in c&&(d.__data__=c.__data__),u[h]=d,Io(u[h],t,n,h,u,Ge(c,n)));return new st(r,this._parents,t,n)}function $m(e){var t=this._name,n=this._id;typeof e!="function"&&(e=da(e));for(var o=this._groups,i=o.length,r=[],s=[],a=0;a<i;++a)for(var l=o[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var h=e.call(c,c.__data__,d,l),g,E=Ge(c,n),x=0,y=h.length;x<y;++x)(g=h[x])&&Io(g,t,n,x,h,E);r.push(h),s.push(c)}return new st(r,s,t,n)}var xm=kn.prototype.constructor;function Em(){return new xm(this._groups,this._parents)}function Sm(e,t){var n,o,i;return function(){var r=qt(this,e),s=(this.style.removeProperty(e),qt(this,e));return r===s?null:r===n&&s===o?i:i=t(n=r,o=s)}}function Da(e){return function(){this.style.removeProperty(e)}}function Nm(e,t,n){var o,i=n+"",r;return function(){var s=qt(this,e);return s===i?null:s===o?r:r=t(o=s,n)}}function Cm(e,t,n){var o,i,r;return function(){var s=qt(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),qt(this,e))),s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a))}}function km(e,t){var n,o,i,r="style."+t,s="end."+r,a;return function(){var l=Qe(this,e),u=l.on,c=l.value[r]==null?a||(a=Da(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(s,i=c),l.on=o}}function Mm(e,t,n){var o=(e+="")=="transform"?Mv:Aa;return t==null?this.styleTween(e,Sm(e,o)).on("end.style."+e,Da(e)):typeof t=="function"?this.styleTween(e,Cm(e,o,Ri(this,"style."+e,t))).each(km(this._id,e)):this.styleTween(e,Nm(e,o,t),n).on("end.style."+e,null)}function Im(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Tm(e,t,n){var o,i;function r(){var s=t.apply(this,arguments);return s!==i&&(o=(i=s)&&Im(e,s,n)),o}return r._value=t,r}function Am(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,Tm(e,t,n??""))}function Dm(e){return function(){this.textContent=e}}function zm(e){return function(){var t=e(this);this.textContent=t??""}}function Pm(e){return this.tween("text",typeof e=="function"?zm(Ri(this,"text",e)):Dm(e==null?"":e+""))}function Om(e){return function(t){this.textContent=e.call(this,t)}}function Bm(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Om(i)),t}return o._value=e,o}function Rm(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Bm(e))}function Hm(){for(var e=this._name,t=this._id,n=za(),o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=Ge(l,t);Io(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new st(o,this._parents,e,n)}function Vm(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,s){var a={value:s},l={value:function(){--i===0&&r()}};n.each(function(){var u=Qe(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),i===0&&r()})}var Fm=0;function st(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function za(){return++Fm}var je=kn.prototype;st.prototype={constructor:st,select:bm,selectAll:$m,selectChild:je.selectChild,selectChildren:je.selectChildren,filter:gm,merge:pm,selection:Em,transition:Hm,call:je.call,nodes:je.nodes,node:je.node,size:je.size,empty:je.empty,each:je.each,on:ym,attr:Jv,attrTween:om,style:Mm,styleTween:Am,text:Pm,textTween:Rm,remove:_m,tween:Xv,delay:sm,duration:um,ease:dm,easeVarying:hm,end:Vm,[Symbol.iterator]:je[Symbol.iterator]};function Lm(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ym={time:null,delay:0,duration:250,ease:Lm};function Gm(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Xm(e){var t,n;e instanceof st?(t=e._id,e=e._name):(t=za(),(n=Ym).time=Oi(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&Io(l,e,t,u,s,n||Gm(l,t));return new st(o,this._parents,e,t)}kn.prototype.interrupt=Lv;kn.prototype.transition=Xm;const Fn=e=>()=>e;function Um(e,{sourceEvent:t,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function ot(e,t,n){this.k=e,this.x=t,this.y=n}ot.prototype={constructor:ot,scale:function(e){return e===1?this:new ot(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ot(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Hi=new ot(1,0,0);ot.prototype;function Xo(e){e.stopImmediatePropagation()}function tn(e){e.preventDefault(),e.stopImmediatePropagation()}function Wm(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Zm(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Kr(){return this.__zoom||Hi}function qm(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Km(){return navigator.maxTouchPoints||"ontouchstart"in this}function Qm(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function Jm(){var e=Wm,t=Zm,n=Qm,o=qm,i=Km,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=zv,u=Ai("start","zoom","end"),c,d,h,g=500,E=150,x=0,y=10;function m(f){f.property("__zoom",Kr).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",G).on("dblclick.zoom",V).filter(i).on("touchstart.zoom",L).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",Z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(f,k,p,T){var C=f.selection?f.selection():f;C.property("__zoom",Kr),f!==C?P(f,k,p,T):C.interrupt().each(function(){O(this,arguments).event(T).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},m.scaleBy=function(f,k,p,T){m.scaleTo(f,function(){var C=this.__zoom.k,D=typeof k=="function"?k.apply(this,arguments):k;return C*D},p,T)},m.scaleTo=function(f,k,p,T){m.transform(f,function(){var C=t.apply(this,arguments),D=this.__zoom,A=p==null?N(C):typeof p=="function"?p.apply(this,arguments):p,H=D.invert(A),X=typeof k=="function"?k.apply(this,arguments):k;return n(_(S(D,X),A,H),C,s)},p,T)},m.translateBy=function(f,k,p,T){m.transform(f,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof p=="function"?p.apply(this,arguments):p),t.apply(this,arguments),s)},null,T)},m.translateTo=function(f,k,p,T,C){m.transform(f,function(){var D=t.apply(this,arguments),A=this.__zoom,H=T==null?N(D):typeof T=="function"?T.apply(this,arguments):T;return n(Hi.translate(H[0],H[1]).scale(A.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof p=="function"?-p.apply(this,arguments):-p),D,s)},T,C)};function S(f,k){return k=Math.max(r[0],Math.min(r[1],k)),k===f.k?f:new ot(k,f.x,f.y)}function _(f,k,p){var T=k[0]-p[0]*f.k,C=k[1]-p[1]*f.k;return T===f.x&&C===f.y?f:new ot(f.k,T,C)}function N(f){return[(+f[0][0]+ +f[1][0])/2,(+f[0][1]+ +f[1][1])/2]}function P(f,k,p,T){f.on("start.zoom",function(){O(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event(T).end()}).tween("zoom",function(){var C=this,D=arguments,A=O(C,D).event(T),H=t.apply(C,D),X=p==null?N(H):typeof p=="function"?p.apply(C,D):p,ee=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),F=C.__zoom,Y=typeof k=="function"?k.apply(C,D):k,q=l(F.invert(X).concat(ee/F.k),Y.invert(X).concat(ee/Y.k));return function(ie){if(ie===1)ie=Y;else{var ae=q(ie),re=ee/ae[2];ie=new ot(re,X[0]-ae[0]*re,X[1]-ae[1]*re)}A.zoom(null,ie)}})}function O(f,k,p){return!p&&f.__zooming||new z(f,k)}function z(f,k){this.that=f,this.args=k,this.active=0,this.sourceEvent=null,this.extent=t.apply(f,k),this.taps=0}z.prototype={event:function(f){return f&&(this.sourceEvent=f),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(f,k){return this.mouse&&f!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&f!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&f!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(f){var k=mt(this.that).datum();u.call(f,this.that,new Um(f,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),k)}};function R(f,...k){if(!e.apply(this,arguments))return;var p=O(this,k).event(f),T=this.__zoom,C=Math.max(r[0],Math.min(r[1],T.k*Math.pow(2,o.apply(this,arguments)))),D=ft(f);if(p.wheel)(p.mouse[0][0]!==D[0]||p.mouse[0][1]!==D[1])&&(p.mouse[1]=T.invert(p.mouse[0]=D)),clearTimeout(p.wheel);else{if(T.k===C)return;p.mouse=[D,T.invert(D)],Qn(this),p.start()}tn(f),p.wheel=setTimeout(A,E),p.zoom("mouse",n(_(S(T,C),p.mouse[0],p.mouse[1]),p.extent,s));function A(){p.wheel=null,p.end()}}function G(f,...k){if(h||!e.apply(this,arguments))return;var p=f.currentTarget,T=O(this,k,!0).event(f),C=mt(f.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",ee,!0),D=ft(f,p),A=f.clientX,H=f.clientY;av(f.view),Xo(f),T.mouse=[D,this.__zoom.invert(D)],Qn(this),T.start();function X(F){if(tn(F),!T.moved){var Y=F.clientX-A,q=F.clientY-H;T.moved=Y*Y+q*q>x}T.event(F).zoom("mouse",n(_(T.that.__zoom,T.mouse[0]=ft(F,p),T.mouse[1]),T.extent,s))}function ee(F){C.on("mousemove.zoom mouseup.zoom",null),lv(F.view,T.moved),tn(F),T.event(F).end()}}function V(f,...k){if(e.apply(this,arguments)){var p=this.__zoom,T=ft(f.changedTouches?f.changedTouches[0]:f,this),C=p.invert(T),D=p.k*(f.shiftKey?.5:2),A=n(_(S(p,D),T,C),t.apply(this,k),s);tn(f),a>0?mt(this).transition().duration(a).call(P,A,T,f):mt(this).call(m.transform,A,T,f)}}function L(f,...k){if(e.apply(this,arguments)){var p=f.touches,T=p.length,C=O(this,k,f.changedTouches.length===T).event(f),D,A,H,X;for(Xo(f),A=0;A<T;++A)H=p[A],X=ft(H,this),X=[X,this.__zoom.invert(X),H.identifier],C.touch0?!C.touch1&&C.touch0[2]!==X[2]&&(C.touch1=X,C.taps=0):(C.touch0=X,D=!0,C.taps=1+!!c);c&&(c=clearTimeout(c)),D&&(C.taps<2&&(d=X[0],c=setTimeout(function(){c=null},g)),Qn(this),C.start())}}function M(f,...k){if(this.__zooming){var p=O(this,k).event(f),T=f.changedTouches,C=T.length,D,A,H,X;for(tn(f),D=0;D<C;++D)A=T[D],H=ft(A,this),p.touch0&&p.touch0[2]===A.identifier?p.touch0[0]=H:p.touch1&&p.touch1[2]===A.identifier&&(p.touch1[0]=H);if(A=p.that.__zoom,p.touch1){var ee=p.touch0[0],F=p.touch0[1],Y=p.touch1[0],q=p.touch1[1],ie=(ie=Y[0]-ee[0])*ie+(ie=Y[1]-ee[1])*ie,ae=(ae=q[0]-F[0])*ae+(ae=q[1]-F[1])*ae;A=S(A,Math.sqrt(ie/ae)),H=[(ee[0]+Y[0])/2,(ee[1]+Y[1])/2],X=[(F[0]+q[0])/2,(F[1]+q[1])/2]}else if(p.touch0)H=p.touch0[0],X=p.touch0[1];else return;p.zoom("touch",n(_(A,H,X),p.extent,s))}}function Z(f,...k){if(this.__zooming){var p=O(this,k).event(f),T=f.changedTouches,C=T.length,D,A;for(Xo(f),h&&clearTimeout(h),h=setTimeout(function(){h=null},g),D=0;D<C;++D)A=T[D],p.touch0&&p.touch0[2]===A.identifier?delete p.touch0:p.touch1&&p.touch1[2]===A.identifier&&delete p.touch1;if(p.touch1&&!p.touch0&&(p.touch0=p.touch1,delete p.touch1),p.touch0)p.touch0[1]=this.__zoom.invert(p.touch0[0]);else if(p.end(),p.taps===2&&(A=ft(A,this),Math.hypot(d[0]-A[0],d[1]-A[1])<y)){var H=mt(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return m.wheelDelta=function(f){return arguments.length?(o=typeof f=="function"?f:Fn(+f),m):o},m.filter=function(f){return arguments.length?(e=typeof f=="function"?f:Fn(!!f),m):e},m.touchable=function(f){return arguments.length?(i=typeof f=="function"?f:Fn(!!f),m):i},m.extent=function(f){return arguments.length?(t=typeof f=="function"?f:Fn([[+f[0][0],+f[0][1]],[+f[1][0],+f[1][1]]]),m):t},m.scaleExtent=function(f){return arguments.length?(r[0]=+f[0],r[1]=+f[1],m):[r[0],r[1]]},m.translateExtent=function(f){return arguments.length?(s[0][0]=+f[0][0],s[1][0]=+f[1][0],s[0][1]=+f[0][1],s[1][1]=+f[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(f){return arguments.length?(n=f,m):n},m.duration=function(f){return arguments.length?(a=+f,m):a},m.interpolate=function(f){return arguments.length?(l=f,m):l},m.on=function(){var f=u.on.apply(u,arguments);return f===u?m:f},m.clickDistance=function(f){return arguments.length?(x=(f=+f)*f,m):Math.sqrt(x)},m.tapDistance=function(f){return arguments.length?(y=+f,m):y},m}const Pa=Symbol("MiniMapSlots"),jm=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],e0={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},t0=me({...e0,props:{id:{},type:{},selected:{type:Boolean},dragging:{type:Boolean},position:{},dimensions:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},hidden:{type:Boolean}},emits:["click","dblclick","mouseenter","mousemove","mouseleave"],setup(e,{emit:t}){const n=e,o=Rt(Pa),i=wi(),r=we(()=>i.style??{});function s(d){t("click",d)}function a(d){t("dblclick",d)}function l(d){t("mouseenter",d)}function u(d){t("mousemove",d)}function c(d){t("mouseleave",d)}return(d,h)=>!d.hidden&&d.dimensions.width!==0&&d.dimensions.height!==0?(W(),ue(Ie,{key:0},[I(o)[`node-${n.type}`]?(W(),Ee(ts(I(o)[`node-${n.type}`]),os(dn({key:0},{...n,...d.$attrs})),null,16)):(W(),ue("rect",dn({key:1,id:d.id},d.$attrs,{class:["vue-flow__minimap-node",{selected:d.selected,dragging:d.dragging}],x:d.position.x,y:d.position.y,rx:d.borderRadius,ry:d.borderRadius,width:d.dimensions.width,height:d.dimensions.height,fill:d.color||r.value.background||r.value.backgroundColor,stroke:d.strokeColor,"stroke-width":d.strokeWidth,"shape-rendering":d.shapeRendering,onClick:s,onDblclick:a,onMouseenter:l,onMousemove:u,onMouseleave:c}),null,16,jm))],64)):Me("",!0)}}),n0=["width","height","viewBox","aria-labelledby"],o0=["id"],i0=["d","fill","stroke","stroke-width"],r0={name:"MiniMap",compatConfig:{MODE:3}},s0=me({...r0,props:{nodeColor:{type:[String,Function],default:"#e2e2e2"},nodeStrokeColor:{type:[String,Function],default:"transparent"},nodeClassName:{type:[String,Function]},nodeBorderRadius:{default:5},nodeStrokeWidth:{default:2},maskColor:{default:"rgb(240, 240, 240, 0.6)"},maskStrokeColor:{default:"none"},maskStrokeWidth:{default:1},position:{default:"bottom-right"},pannable:{type:Boolean,default:!1},zoomable:{type:Boolean,default:!1},width:{},height:{},ariaLabel:{default:"Vue Flow mini map"},inversePan:{type:Boolean,default:!1},zoomStep:{default:10},offsetScale:{default:5},maskBorderRadius:{default:0}},emits:["click","nodeClick","nodeDblclick","nodeMouseenter","nodeMousemove","nodeMouseleave"],setup(e,{emit:t}){const n=Qr(),o=wi(),i=200,r=150,{id:s,edges:a,viewport:l,translateExtent:u,dimensions:c,emits:d,d3Selection:h,d3Zoom:g,getNodesInitialized:E}=$e(),x=ye();zt(Pa,n);const y=we(()=>{var C;return e.width??((C=o.style)==null?void 0:C.width)??i}),m=we(()=>{var C;return e.height??((C=o.style)==null?void 0:C.height)??r}),S=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",_=j(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),N=j(()=>typeof e.nodeStrokeColor=="string"?()=>e.nodeStrokeColor:e.nodeStrokeColor),P=j(()=>typeof e.nodeClassName=="string"?()=>e.nodeClassName:typeof e.nodeClassName=="function"?e.nodeClassName:()=>""),O=j(()=>Ci(E.value.filter(C=>!C.hidden))),z=j(()=>({x:-l.value.x/l.value.zoom,y:-l.value.y/l.value.zoom,width:c.value.width/l.value.zoom,height:c.value.height/l.value.zoom})),R=j(()=>E.value&&E.value.length?hf(O.value,z.value):z.value),G=j(()=>{const C=R.value.width/y.value,D=R.value.height/m.value;return Math.max(C,D)}),V=j(()=>{const C=G.value*y.value,D=G.value*m.value,A=e.offsetScale*G.value;return{offset:A,x:R.value.x-(C-R.value.width)/2-A,y:R.value.y-(D-R.value.height)/2-A,width:C+A*2,height:D+A*2}}),L=j(()=>!V.value.x||!V.value.y?"":`
27
+ M${V.value.x-V.value.offset},${V.value.y-V.value.offset}
28
+ h${V.value.width+V.value.offset*2}
29
+ v${V.value.height+V.value.offset*2}
30
+ h${-V.value.width-V.value.offset*2}z
31
+ M${z.value.x+e.maskBorderRadius},${z.value.y}
32
+ h${z.value.width-2*e.maskBorderRadius}
33
+ a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},${e.maskBorderRadius}
34
+ v${z.value.height-2*e.maskBorderRadius}
35
+ a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},${e.maskBorderRadius}
36
+ h${-(z.value.width-2*e.maskBorderRadius)}
37
+ a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},-${e.maskBorderRadius}
38
+ v${-(z.value.height-2*e.maskBorderRadius)}
39
+ a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);Qa(C=>{if(x.value){const D=mt(x.value),A=ee=>{if(ee.sourceEvent.type!=="wheel"||!h.value||!g.value)return;const F=-ee.sourceEvent.deltaY*(ee.sourceEvent.deltaMode===1?.05:ee.sourceEvent.deltaMode?1:.002)*e.zoomStep,Y=l.value.zoom*2**F;g.value.scaleTo(h.value,Y)},H=ee=>{if(ee.sourceEvent.type!=="mousemove"||!h.value||!g.value)return;const F=G.value*Math.max(1,l.value.zoom)*(e.inversePan?-1:1),Y={x:l.value.x-ee.sourceEvent.movementX*F,y:l.value.y-ee.sourceEvent.movementY*F},q=[[0,0],[c.value.width,c.value.height]],ie=Hi.translate(Y.x,Y.y).scale(l.value.zoom),ae=g.value.constrain()(ie,q,u.value);g.value.transform(h.value,ae)},X=Jm().on("zoom",e.pannable?H:()=>{}).on("zoom.wheel",e.zoomable?A:()=>{});D.call(X),C(()=>{D.on("zoom",null)})}},{flush:"post"});function M(C){const[D,A]=ft(C);t("click",{event:C,position:{x:D,y:A}})}function Z(C,D){const A={event:C,node:D,connectedEdges:St([D],a.value)};d.miniMapNodeClick(A),t("nodeClick",A)}function f(C,D){const A={event:C,node:D,connectedEdges:St([D],a.value)};d.miniMapNodeDoubleClick(A),t("nodeDblclick",A)}function k(C,D){const A={event:C,node:D,connectedEdges:St([D],a.value)};d.miniMapNodeMouseEnter(A),t("nodeMouseenter",A)}function p(C,D){const A={event:C,node:D,connectedEdges:St([D],a.value)};d.miniMapNodeMouseMove(A),t("nodeMousemove",A)}function T(C,D){const A={event:C,node:D,connectedEdges:St([D],a.value)};d.miniMapNodeMouseLeave(A),t("nodeMouseleave",A)}return(C,D)=>(W(),Ee(I(hg),{position:C.position,class:Le(["vue-flow__minimap",{pannable:C.pannable,zoomable:C.zoomable}])},{default:le(()=>[(W(),ue("svg",{ref_key:"el",ref:x,width:y.value,height:m.value,viewBox:[V.value.x,V.value.y,V.value.width,V.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${I(s)}`,onClick:M},[C.ariaLabel?(W(),ue("title",{key:0,id:`vue-flow__minimap-${I(s)}`},ze(C.ariaLabel),9,o0)):Me("",!0),(W(!0),ue(Ie,null,Mt(I(E),A=>(W(),Ee(t0,{id:A.id,key:A.id,position:A.computedPosition,dimensions:A.dimensions,selected:A.selected,dragging:A.dragging,style:Se(A.style),class:Le(P.value(A)),color:_.value(A),"border-radius":C.nodeBorderRadius,"stroke-color":N.value(A),"stroke-width":C.nodeStrokeWidth,"shape-rendering":I(S),type:A.type,hidden:A.hidden,onClick:H=>Z(H,A),onDblclick:H=>f(H,A),onMouseenter:H=>k(H,A),onMousemove:H=>p(H,A),onMouseleave:H=>T(H,A)},null,8,["id","position","dimensions","selected","dragging","style","class","color","border-radius","stroke-color","stroke-width","shape-rendering","type","hidden","onClick","onDblclick","onMouseenter","onMousemove","onMouseleave"]))),128)),ve("path",{class:"vue-flow__minimap-mask",d:L.value,fill:C.maskColor,stroke:C.maskStrokeColor,"stroke-width":C.maskStrokeWidth,"fill-rule":"evenodd"},null,8,i0)],8,n0))]),_:1},8,["position","class"]))}}),a0={class:"table-node text-foreground"},l0={class:"flex-1 text-center px-2 box-border text-xl truncate"},u0=["onClick"],c0={class:"col-span-2 py-2 truncate flex items-center gap-1"},d0={class:"w-6 flex items-center justify-center"},f0={class:"truncate"},h0={class:"col-span-1 py-2 truncate text-center text-muted-foreground"},g0=me({__name:"ErdTableNode",props:{isExpanded:{type:Boolean},hasRelations:{type:Boolean},id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{}},emits:["expand","collapse"],setup(e,{emit:t}){const n=e,o=t,{findNode:i,fitView:r,getViewport:s}=$e(),a=j(()=>fn({schemaName:n.data.schema,tableName:n.data.table})),l=()=>{n.isExpanded?o("collapse",a.value):o("expand",a.value)},u=j(()=>new Set(n.data.primary_keys.map(y=>y.column))),c=j(()=>new Set(n.data.foreign_keys.map(y=>y.column))),d=j(()=>n.data.columns.map(y=>({...y,isPrimary:u.value.has(y.name),isForeign:c.value.has(y.name)}))),h=j(()=>new Map(d.value.map((y,m)=>[y.name,m+1]))),g=j(()=>n.data.foreign_keys.map(({column:y})=>{const m=h.value.get(y);return{id:y,top:Ar(m)}})),E=j(()=>n.data.primary_keys.map(({column:y})=>{const m=h.value.get(y);return{id:y,top:Ar(m)}})),x=y=>{if(!y.isForeign)return;const m=n.data.foreign_keys.find(_=>_.column===y.name);if(!m)return;const S=fn({schemaName:m.reference_schema,tableName:m.reference_table});ui({nodeId:S,findNode:i,fitView:r,getViewport:s})};return(y,m)=>{const S=Te,_=Ue;return W(),ue("div",a0,[ve("div",{class:"flex flex-col rounded-md bg-card overflow-hidden",style:Se({width:I(is)+"px"})},[ve("div",{class:"rounded-t-md box-border p-2 bg-primary dark:bg-accent text-primary-foreground dark:text-foreground flex items-center justify-between gap-2",style:Se({height:I(yt)+10+"px"})},[ve("p",l0,ze(y.data.table)+" "+ze(y.data.schema==="public"?"":`(${y.data.schema})`),1),y.hasRelations?(W(),Ee(_,{key:0,size:"iconMd",title:y.isExpanded?"Collapse related tables":"Expand related tables",onClick:Ja(l,["stop"])},{default:le(()=>[K(S,{name:y.isExpanded?"hugeicons:remove-circle":"hugeicons:add-circle",class:"w-5 h-5"},null,8,["name"])]),_:1},8,["title"])):Me("",!0)],4),(W(!0),ue(Ie,null,Mt(d.value,N=>{var P;return W(),ue("div",{key:N.name,class:Le(["grid grid-cols-3 px-2 border-t border-border bg-card transition-colors",N.isForeign&&"cursor-pointer hover:bg-primary/10",((P=y.label)==null?void 0:P.get(N.name))&&"bg-primary/10"]),style:Se({height:I(yt)+"px"}),onClick:O=>x(N)},[ve("div",c0,[ve("div",d0,[N.isPrimary?(W(),Ee(S,{key:0,name:"hugeicons:key-01",class:"w-4 text-yellow-400 dark:text-yellow-300 text-xl"})):N.isForeign?(W(),Ee(S,{key:1,name:"hugeicons:key-01",class:"min-w-4 text-muted-foreground text-xl"})):N.nullable?(W(),Ee(S,{key:2,name:"hugeicons:diamond",class:"min-w-4 text-muted-foreground/60"})):(W(),Ee(S,{key:3,name:"mynaui:diamond-solid",class:"min-w-4 text-muted-foreground/60"}))]),ve("p",f0,ze(N.name),1),N.isForeign?(W(),Ee(S,{key:0,name:"hugeicons:link-04",class:"min-w-3 text-muted-foreground"})):Me("",!0)]),ve("div",h0,ze(N.type),1)],14,u0)}),128))],4),(W(!0),ue(Ie,null,Mt(g.value,N=>(W(),Ee(I(Zt),{key:N.id,type:"source",id:N.id,position:I(te).Left,connectable:!1,style:Se({top:N.top+"px",left:I(Fi),height:I(Vi),opacity:0})},null,8,["id","position","style"]))),128)),(W(!0),ue(Ie,null,Mt(E.value,N=>(W(),Ee(I(Zt),{key:N.id,type:"target",id:N.id,position:I(te).Right,connectable:!1,style:Se({top:N.top+"px",right:I(Fi),height:I(Vi),opacity:0})},null,8,["id","position","style"]))),128))])}}}),p0=ja(g0,[["__scopeId","data-v-a80035c1"]]),v0={class:"absolute bottom-1 z-10 left-1/2 -translate-x-1/2 w-fit h-10 bg-background box-border border-2 border-border rounded-lg p-1 flex flex-row gap-0.5"},m0={class:"w-7 h-7 text-center py-0.5 text-sm flex items-center justify-center"},y0=me({__name:"ErdControls",props:{isHand:{type:Boolean},isUseBgGrid:{type:[String,Boolean]},isUseMiniMap:{type:Boolean},isShowFilter:{type:Boolean}},emits:["update:isHand","update:isUseBgGrid","update:isUseMiniMap","update:isShowFilter","arrange"],setup(e,{emit:t}){const n=e,{zoomIn:o,zoomOut:i,fitView:r,getViewport:s}=$e(),a=t,l=j(()=>Math.round(s().zoom*100)),u=()=>a("update:isHand",!n.isHand),c=()=>{if(!n.isUseBgGrid){a("update:isUseBgGrid","dots");return}if(n.isUseBgGrid==="dots"){a("update:isUseBgGrid","lines");return}a("update:isUseBgGrid",!1)},d=()=>a("update:isUseMiniMap",!n.isUseMiniMap),h=()=>a("update:isShowFilter",!n.isShowFilter),g=()=>a("arrange"),E=()=>i({duration:Yn}),x=()=>o({duration:Yn}),y=()=>r({duration:Yn});return(m,S)=>(W(),ue("div",v0,[K(I(at),null,{default:le(()=>[K(I(lt),{"as-child":""},{default:le(()=>[K(I(Ue),{variant:m.isUseBgGrid?"secondary":"ghost",size:"iconMd",onClick:S[0]||(S[0]=_=>c())},{default:le(()=>[K(I(Te),{name:"hugeicons:grid",class:"size-4!"})]),_:1},8,["variant"])]),_:1}),K(I(ut),null,{default:le(()=>[Be(ze(m.isUseBgGrid?"Hide grid":"Show grid"),1)]),_:1})]),_:1}),K(I(at),null,{default:le(()=>[K(I(lt),{"as-child":""},{default:le(()=>[K(I(Ue),{variant:m.isUseMiniMap?"secondary":"ghost",size:"iconMd",onClick:S[1]||(S[1]=_=>d())},{default:le(()=>[K(I(Te),{name:"hugeicons:dashboard-circle",class:"size-4"})]),_:1},8,["variant"])]),_:1}),K(I(ut),null,{default:le(()=>[Be(ze(m.isUseMiniMap?"Hide minimap":"Show minimap"),1)]),_:1})]),_:1}),K(I(at),null,{default:le(()=>[K(I(lt),{"as-child":""},{default:le(()=>[K(I(Ue),{variant:m.isHand?"secondary":"ghost",size:"iconMd",onClick:S[2]||(S[2]=_=>u())},{default:le(()=>[m.isHand?(W(),Ee(I(Te),{key:1,name:"hugeicons:hold-04",class:"size-4!"})):(W(),Ee(I(Te),{key:0,name:"hugeicons:hold-03",class:"size-4!"}))]),_:1},8,["variant"])]),_:1}),K(I(ut),null,{default:le(()=>S[4]||(S[4]=[Be("Click to enable pan mode "),ve("br",null,null,-1),Be(" Or hold Space/Middle mouse + drag to pan")])),_:1})]),_:1}),K(I(Li),{orientation:"vertical",class:"mx-1.5"}),K(I(at),null,{default:le(()=>[K(I(lt),{"as-child":""},{default:le(()=>[K(I(Ue),{variant:"ghost",size:"iconMd",onClick:E},{default:le(()=>[K(I(Te),{name:"hugeicons:minus-sign",class:"size-4!"})]),_:1})]),_:1}),K(I(ut),null,{default:le(()=>S[5]||(S[5]=[Be("Zoom out")])),_:1})]),_:1}),ve("div",m0,ze(I(l)),1),K(I(at),null,{default:le(()=>[K(I(lt),{"as-child":""},{default:le(()=>[K(I(Ue),{variant:"ghost",size:"iconMd",onClick:x},{default:le(()=>[K(I(Te),{name:"hugeicons:add-01",class:"size-4!"})]),_:1})]),_:1}),K(I(ut),null,{default:le(()=>S[6]||(S[6]=[Be("Zoom in")])),_:1})]),_:1}),K(I(Li),{orientation:"vertical",class:"mx-1.5"}),K(I(at),null,{default:le(()=>[K(I(lt),{"as-child":""},{default:le(()=>[K(I(Ue),{variant:"ghost",size:"iconMd",onClick:y},{default:le(()=>[K(I(Te),{name:"hugeicons:center-focus",class:"size-4!"})]),_:1})]),_:1}),K(I(ut),null,{default:le(()=>S[7]||(S[7]=[Be("Fit to view")])),_:1})]),_:1}),K(I(at),null,{default:le(()=>[K(I(lt),{"as-child":""},{default:le(()=>[K(I(Ue),{variant:"ghost",size:"iconMd",onClick:g},{default:le(()=>[K(I(Te),{name:"hugeicons:coordinate-01",class:"size-4!"})]),_:1})]),_:1}),K(I(ut),null,{default:le(()=>S[8]||(S[8]=[Be("Arrange the diagram")])),_:1})]),_:1}),K(I(at),null,{default:le(()=>[K(I(lt),{"as-child":""},{default:le(()=>[K(I(Ue),{variant:m.isShowFilter?"secondary":"ghost",size:"iconMd",onClick:S[3]||(S[3]=_=>h())},{default:le(()=>[K(I(Te),{name:"hugeicons:filter",class:"size-4"})]),_:1},8,["variant"])]),_:1}),K(I(ut),null,{default:le(()=>[Be(ze(m.isShowFilter?"Hide filter":"Show filter")+" ",1),K(I(dl),null,{default:le(()=>[K(I(Yi),null,{default:le(()=>S[9]||(S[9]=[Be("⌘")])),_:1}),K(I(Yi),null,{default:le(()=>S[10]||(S[10]=[Be("f")])),_:1})]),_:1})]),_:1})]),_:1})]))}}),w0=["id","markerWidth","markerHeight"],_0=["fill"],b0=["fill"],$0=me({__name:"MarkerMany",props:{id:{},fill:{default:"#b1b1b7"},strokeWidth:{default:1.5},width:{default:24},height:{default:24}},setup(e){return(t,n)=>(W(),ue("marker",{id:t.id,viewBox:"0 0 24 24",refX:"2",refY:"8",markerWidth:t.width,markerHeight:t.height,orient:"0",markerUnits:"userSpaceOnUse"},[ve("path",{style:Se({strokeWidth:t.strokeWidth}),fill:t.fill,fillRule:"evenodd",clipRule:"evenodd",d:"M23.2381 1.93974C23.481 1.80822 23.5712 1.50476 23.4396 1.26195C23.3081 1.01914 23.0047 0.928928 22.7619 1.06045L10.7619 7.56045C10.6063 7.64471 10.5068 7.80491 10.5003 7.98171C10.4938 8.15851 10.5817 8.32587 10.7306 8.42134L10.7532 8.43574L10.8193 8.47786C10.8773 8.51474 10.9627 8.5689 11.0728 8.63831C11.293 8.77712 11.6121 8.97693 12.0083 9.22151C12.8004 9.71055 13.9017 10.379 15.1381 11.0967C17.6 12.5258 20.6347 14.172 22.8291 14.97C23.0886 15.0644 23.3755 14.9305 23.4699 14.671C23.5643 14.4115 23.4304 14.1246 23.1709 14.0302C21.0695 13.2661 18.1042 11.6623 15.6401 10.2319C14.5191 9.58119 13.5096 8.97094 12.7436 8.5H23.3333C23.6095 8.5 23.8333 8.27614 23.8333 8C23.8333 7.72386 23.6095 7.5 23.3333 7.5H12.973L23.2381 1.93974ZM11 8.0001L10.7306 8.42134C10.7306 8.42134 10.7302 8.42105 11 8.0001Z"},null,12,_0),ve("path",{style:Se({strokeWidth:t.strokeWidth}),d:"M6.665 13.16C9.24141 13.16 11.33 11.0714 11.33 8.495C11.33 5.91859 9.24141 3.83 6.665 3.83C4.08859 3.83 2 5.91859 2 8.495C2 11.0714 4.08859 13.16 6.665 13.16Z",fill:"transparent"},null,4),ve("path",{style:Se({strokeWidth:t.strokeWidth}),fill:t.fill,fillRule:"evenodd",clipRule:"evenodd",d:"M6.665 4.33C4.36473 4.33 2.5 6.19473 2.5 8.495C2.5 10.7953 4.36473 12.66 6.665 12.66C8.96527 12.66 10.83 10.7953 10.83 8.495C10.83 6.19473 8.96527 4.33 6.665 4.33ZM1.5 8.495C1.5 5.64245 3.81245 3.33 6.665 3.33C9.51755 3.33 11.83 5.64245 11.83 8.495C11.83 11.3476 9.51755 13.66 6.665 13.66C3.81245 13.66 1.5 11.3476 1.5 8.495Z"},null,12,b0)],8,w0))}}),x0=["id","markerWidth","markerHeight"],E0=["fill"],S0=["fill"],N0=["fill"],C0=me({__name:"MarkerZeroOrOne",props:{id:{},fill:{default:"#b1b1b7"},strokeWidth:{default:1.5},width:{default:24},height:{default:24}},setup(e){return(t,n)=>(W(),ue("marker",{id:t.id,viewBox:"0 0 24 24",refX:"2",refY:"8",markerWidth:t.width,markerHeight:t.height,orient:"180",markerUnits:"userSpaceOnUse"},[ve("path",{style:Se({strokeWidth:t.strokeWidth}),d:"M6.665 12.6601C9.24141 12.6601 11.33 10.5715 11.33 7.99508C11.33 5.41867 9.24141 3.33008 6.665 3.33008C4.08859 3.33008 2 5.41867 2 7.99508C2 10.5715 4.08859 12.6601 6.665 12.6601Z",fill:"transparent"},null,4),ve("path",{style:Se({strokeWidth:t.strokeWidth}),fill:t.fill,fillRule:"evenodd",clipRule:"evenodd",d:"M6.665 3.83008C4.36473 3.83008 2.5 5.69481 2.5 7.99508C2.5 10.2953 4.36473 12.1601 6.665 12.1601C8.96527 12.1601 10.83 10.2953 10.83 7.99508C10.83 5.69481 8.96527 3.83008 6.665 3.83008ZM1.5 7.99508C1.5 5.14253 3.81245 2.83008 6.665 2.83008C9.51755 2.83008 11.83 5.14253 11.83 7.99508C11.83 10.8476 9.51755 13.1601 6.665 13.1601C3.81245 13.1601 1.5 10.8476 1.5 7.99508Z"},null,12,E0),ve("path",{style:Se({strokeWidth:t.strokeWidth}),fill:t.fill,fillRule:"evenodd",clipRule:"evenodd",d:"M16 2.83008C16.2761 2.83008 16.5 3.05394 16.5 3.33008V12.6634C16.5 12.9396 16.2761 13.1634 16 13.1634C15.7239 13.1634 15.5 12.9396 15.5 12.6634V3.33008C15.5 3.05394 15.7239 2.83008 16 2.83008Z"},null,12,S0),ve("path",{style:Se({strokeWidth:t.strokeWidth}),fill:t.fill,d:"M23.5 7.5H11V8.5H23.5V7.5Z"},null,12,N0)],8,x0))}}),k0=me({__name:"CustomEdge",props:{id:{},sourceNode:{},targetNode:{},source:{},target:{},type:{},label:{},style:{},selected:{type:Boolean},sourcePosition:{},targetPosition:{},sourceHandleId:{},targetHandleId:{},animated:{type:Boolean},updatable:{type:Boolean},markerStart:{},markerEnd:{},curvature:{},interactionWidth:{},data:{},events:{},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{},sourceX:{},sourceY:{},targetX:{},targetY:{}},setup(e){const t=e,n=j(()=>Ii({sourceX:t.sourceX,sourceY:t.sourceY,sourcePosition:t.sourcePosition,targetX:t.targetX,targetY:t.targetY,targetPosition:t.targetPosition,curvature:.6})),o=j(()=>`${t.id}-marker-zero-or-one`),i=j(()=>`${t.id}-marker-many`),r=j(()=>{var a,l;return((a=t.sourceNode)==null?void 0:a.selected)||((l=t.targetNode)==null?void 0:l.selected)||t.animated?"var(--color-primary)":"var(--color-zinc-400)"});return(s,a)=>(W(),ue(Ie,null,[K(I(Cn),{id:s.id,path:n.value[0],"marker-start":`url(#${i.value})`,"marker-end":`url(#${o.value})`,style:Se({stroke:r.value,strokeWidth:s.animated?3:1.5})},null,8,["id","path","marker-start","marker-end","style"]),K(C0,{fill:r.value,"stroke-width":1.5,width:30,height:30,id:o.value},null,8,["fill","id"]),K($0,{fill:r.value,"stroke-width":1.5,width:30,height:30,id:i.value},null,8,["fill","id"])],64))}}),M0={class:"px-2 pt-2 flex flex-col h-full w-full"},I0={class:"text-base font-normal"},T0={class:"relative w-full pt-2 mb-2"},A0={class:"h-full w-[19rem] overflow-y-auto"},D0=me({__name:"ErdFilterPanal",props:{isShowFilter:{type:Boolean},tables:{},tableId:{}},emits:["update:isShowFilter","focusTable"],setup(e,{emit:t}){const n=e,o=t,i=el(""),r=tl(i,il),s=j(()=>nl(n.tableId||"")),a=j(()=>{const u={};return n.tables.forEach(c=>{if(!c.table.toLowerCase().includes(r.value.toLowerCase()))return;const d=fn({schemaName:c.schema,tableName:c.table});u[d]={id:d,parentId:null,name:c.table,type:"file",depth:-1,iconOpen:"vscode-icons:file-type-sql",iconClose:"vscode-icons:file-type-sql"}}),u}),l=u=>{o("focusTable",u)};return(u,c)=>{const d=ol,h=Ue;return W(),ue("div",{class:Le(["flex flex-col h-full bg-background absolute right-0 top-0 shadow transition-all ease-in-out",[u.isShowFilter?"w-[20rem]":"w-[0rem]"]])},[ve("div",{class:"w-5 h-8 absolute -left-5 top-2 cursor-pointer bg-background border border-r-0 rounded-l-md flex-col justify-center flex items-center",onClick:c[0]||(c[0]=g=>o("update:isShowFilter",!u.isShowFilter))},[u.isShowFilter?(W(),Ee(I(Te),{key:0,name:"hugeicons:arrow-right-01",class:"size-5!"})):(W(),Ee(I(Te),{key:1,name:"hugeicons:arrow-left-01",class:"size-5!"}))]),ve("div",M0,[ve("div",null,[ve("h1",I0,ze(I(s).tableName),1),c[3]||(c[3]=ve("p",{class:"text-muted-foreground text-sm"}," This view only show this table and relations ",-1))]),ve("div",T0,[K(d,{type:"text",placeholder:"Search tables",class:"pr-6 w-full h-8",modelValue:I(i),"onUpdate:modelValue":c[1]||(c[1]=g=>It(i)?i.value=g:null)},null,8,["modelValue"]),I(i)?(W(),ue("div",{key:0,class:"absolute right-2 top-3.5 w-4 cursor-pointer hover:bg-accent",onClick:c[2]||(c[2]=g=>i.value="")},[K(I(Te),{name:"lucide:x",class:"stroke-3! text-muted-foreground"})])):Me("",!0)]),ve("div",A0,[K(cl,{class:"overflow-x-hidden","initial-data":I(a),"allow-drag-and-drop":!1,"storage-key":"erd-filter-tree",onClick:l},{actions:le(()=>[K(h,{size:"iconSm",onClick:l,class:"hover:bg-background",variant:"ghost"},{default:le(()=>[K(I(Te),{name:"hugeicons:dashed-line-circle",class:"size-4! min-w-4 text-muted-foreground"})]),_:1})]),_:1},8,["initial-data"])])])],2)}}});function z0(e){const t=ye(!1),n=ye(!0),o=ye("dots"),i=ye({tableId:"",relatedColumnIds:new Set,edgeIds:new Set}),r=ye({edgeId:"",sourceId:"",targetId:""}),{getEdges:s,findEdge:a,findNode:l,fitView:u,getViewport:c,getNodes:d}=$e(),h=P=>{if(!e.focusTableId)return;const O=P.findNode(e.focusTableId);if(!O)return;const z=new Set,R=new Set,G=!0;O.selected=!0,s.value.forEach(V=>{if(V.sourceNode.id===O.id||V.targetNode.id===O.id){const L=pt(V.sourceNode.id,V.sourceHandle),M=pt(V.targetNode.id,V.targetHandle);R.add(L),R.add(M),z.add(V.id),xt(V,G,i.value,r.value)}}),i.value={tableId:O.id,edgeIds:z,relatedColumnIds:R}},g=P=>{P.sort((z,R)=>Number(z.selected)-Number(R.selected)).forEach(z=>{if(z.type!=="select")return;const R=z.selected;s.value.forEach(G=>{var Z,f,k,p,T,C;if(!(G.sourceNode.id===z.id||G.targetNode.id===z.id))return;const L=pt(G.sourceNode.id,G.sourceHandle),M=pt(G.targetNode.id,G.targetHandle);R?((Z=i.value)==null||Z.relatedColumnIds.add(L),(f=i.value)==null||f.relatedColumnIds.add(M),(k=i.value)==null||k.edgeIds.add(G.id)):((p=i.value)==null||p.relatedColumnIds.delete(L),(T=i.value)==null||T.relatedColumnIds.delete(M),(C=i.value)==null||C.edgeIds.delete(G.id)),xt(G,R,i.value,r.value)})})};return{isUseBgGrid:o,isUseMiniMap:n,isHand:t,activeTable:i,activeEdge:r,onInitVueFlow:h,onNodesChange:g,onEdgesChange:P=>{P.forEach(O=>{if(O.type!=="select")return;const z=a(O.id);if(!z)return;const R=O.selected,G=pt(z.sourceNode.id,z.sourceHandle),V=pt(z.targetNode.id,z.targetHandle);r.value=R?{edgeId:O.id,sourceId:G,targetId:V}:null,xt(z,R,i.value,r.value)})},onNodeMouseEnter:({node:P})=>{P.selected||s.value.forEach(O=>{(O.sourceNode.id===P.id||O.targetNode.id===P.id)&&xt(O,!0,i.value,r.value)})},onNodeMouseLeave:({node:P})=>{P.selected||s.value.forEach(O=>{(O.sourceNode.id===P.id||O.targetNode.id===P.id)&&xt(O,!1,i.value,r.value)})},handleEdgeMouseEnter:({edge:P})=>{P.selected||xt(P,!0,i.value,r.value)},handleEdgeMouseLeave:({edge:P})=>{P.selected||xt(P,!1,i.value,r.value)},onDoubleClickEdge:({edge:P})=>{P.selected=!0,ui({nodeId:P.source,findNode:l,fitView:u,getViewport:c})},getNodes:d,fitView:u,onfocusNode:P=>{ui({nodeId:P,findNode:l,fitView:u,getViewport:c});const O=l(P);O&&(O.selected=!0,g([{id:P,type:"select",selected:!0}]))}}}const R0=me({__name:"ErdDiagram",props:{nodes:{},edges:{},focusTableId:{},isShowFilter:{type:Boolean},matrixTablePosition:{},tables:{},tableId:{},isExpanded:{type:Function},hasRelations:{type:Function}},emits:["update:isShowFilter","expand","collapse"],setup(e,{emit:t}){const{width:n,height:o}=al(),i=e,r=t,{onInitVueFlow:s,onNodesChange:a,onEdgesChange:l,onNodeMouseEnter:u,onNodeMouseLeave:c,handleEdgeMouseEnter:d,handleEdgeMouseLeave:h,onDoubleClickEdge:g,isHand:E,isUseBgGrid:x,isUseMiniMap:y,getNodes:m,fitView:S,onfocusNode:_}=z0(i),N=()=>{var P;(P=m.value)==null||P.forEach(O=>{var R;const z=(R=i.matrixTablePosition)==null?void 0:R[O.id];z&&(O.position=z)}),S({duration:Yn})};return(P,O)=>(W(),ue(Ie,null,[K(I(dg),{class:"erd-flow w-full","pan-on-drag":I(E),"pan-on-scroll":!0,"pan-on-scroll-speed":1.2,nodes:i.nodes,edges:i.edges,"default-viewport":{zoom:I(ll),x:I(n)/2-I(is)/2,y:I(o)/2-200},"min-zoom":I(sl),"max-zoom":I(rl),onInit:I(s),onNodeMouseEnter:I(u),onNodeMouseLeave:I(c),onEdgeMouseEnter:I(d),onEdgeMouseLeave:I(h),onNodesChange:I(a),onEdgesChange:I(l),onEdgeDoubleClick:I(g)},{"edge-custom":le(z=>[K(k0,os(ul(z)),null,16)]),"node-value":le(z=>{var R,G;return[K(p0,dn(z,{isExpanded:(R=i.isExpanded)==null?void 0:R.call(i,I(fn)({schemaName:z.data.schema,tableName:z.data.table})),hasRelations:(G=i.hasRelations)==null?void 0:G.call(i,I(fn)({schemaName:z.data.schema,tableName:z.data.table})),onExpand:O[0]||(O[0]=V=>r("expand",V)),onCollapse:O[1]||(O[1]=V=>r("collapse",V))}),null,16,["isExpanded","hasRelations"])]}),default:le(()=>[I(x)?(W(),Ee(I(Eg),{key:0,size:2,gap:30,variant:I(x)},null,8,["variant"])):Me("",!0),I(y)?(W(),Ee(I(s0),{key:1,pannable:"",position:"top-right","node-color":"var(--primary)",nodeBorderRadius:10})):Me("",!0),K(y0,{isShowFilter:i.isShowFilter,isHand:I(E),"onUpdate:isHand":O[2]||(O[2]=z=>It(E)?E.value=z:null),isUseBgGrid:I(x),"onUpdate:isUseBgGrid":O[3]||(O[3]=z=>It(x)?x.value=z:null),isUseMiniMap:I(y),"onUpdate:isUseMiniMap":O[4]||(O[4]=z=>It(y)?y.value=z:null),"onUpdate:isShowFilter":O[5]||(O[5]=z=>r("update:isShowFilter",z)),onArrange:N},null,8,["isShowFilter","isHand","isUseBgGrid","isUseMiniMap"])]),_:1},8,["pan-on-drag","nodes","edges","default-viewport","min-zoom","max-zoom","onInit","onNodeMouseEnter","onNodeMouseLeave","onEdgeMouseEnter","onEdgeMouseLeave","onNodesChange","onEdgesChange","onEdgeDoubleClick"]),K(D0,{isShowFilter:i.isShowFilter,"onUpdate:isShowFilter":[O[6]||(O[6]=z=>i.isShowFilter=z),O[7]||(O[7]=z=>r("update:isShowFilter",z))],"table-id":i.tableId,tables:i.tables,onFocusTable:I(_)},null,8,["isShowFilter","table-id","tables","onFocusTable"])],64))}});export{p0 as E,R0 as _,Eg as a,B0 as b,k0 as c,dg as d};