agentix-cli 0.26.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/dist/{App-BPNHIGUX.js → App-U52IPUK2.js} +2 -2
  2. package/dist/{ChatApp-6XSSZB4U.js → ChatApp-XP4OMHPL.js} +2 -2
  3. package/dist/agent-V2CA4TXD.js +2 -0
  4. package/dist/article-fields-L4D2BOGY.js +2 -0
  5. package/dist/article-quality-44ONVGLN.js +3 -0
  6. package/dist/article-quality-44ONVGLN.js.map +1 -0
  7. package/dist/{audit-JU3HWISB.js → audit-4245CX6P.js} +2 -2
  8. package/dist/backfill-MTD2B62I.js +6 -0
  9. package/dist/backfill-MTD2B62I.js.map +1 -0
  10. package/dist/{board-dashboard-M3372FLO.js → board-dashboard-TTMAYRLG.js} +1407 -447
  11. package/dist/board-dashboard-TTMAYRLG.js.map +1 -0
  12. package/dist/{builtin-FRKAQMFS.js → builtin-B67DMJ3M.js} +2 -2
  13. package/dist/calibration-ILS5OI44.js +2 -0
  14. package/dist/chunk-2T5W3ETS.js +5 -0
  15. package/dist/{chunk-K2CAPYES.js.map → chunk-2T5W3ETS.js.map} +1 -1
  16. package/dist/chunk-3SCPRYJB.js +5 -0
  17. package/dist/chunk-3SCPRYJB.js.map +1 -0
  18. package/dist/chunk-4BR7D2OU.js +36 -0
  19. package/dist/chunk-4BR7D2OU.js.map +1 -0
  20. package/dist/{chunk-P4VWIVKN.js → chunk-52ZPELD2.js} +403 -29
  21. package/dist/chunk-52ZPELD2.js.map +1 -0
  22. package/dist/{chunk-5U35WAZF.js → chunk-77OV7346.js} +6 -6
  23. package/dist/chunk-77OV7346.js.map +1 -0
  24. package/dist/chunk-AJ5RMU7X.js +2 -0
  25. package/dist/chunk-AJ5RMU7X.js.map +1 -0
  26. package/dist/chunk-AJONZWLT.js +2 -0
  27. package/dist/chunk-AJONZWLT.js.map +1 -0
  28. package/dist/chunk-AX2PWSRT.js +114 -0
  29. package/dist/chunk-AX2PWSRT.js.map +1 -0
  30. package/dist/chunk-BH3GTCZ6.js +2 -0
  31. package/dist/chunk-BH3GTCZ6.js.map +1 -0
  32. package/dist/chunk-BPIRO4YD.js +126 -0
  33. package/dist/chunk-BPIRO4YD.js.map +1 -0
  34. package/dist/chunk-CJQQIRPD.js +13 -0
  35. package/dist/chunk-CJQQIRPD.js.map +1 -0
  36. package/dist/chunk-DCDQZR7I.js +24 -0
  37. package/dist/chunk-DCDQZR7I.js.map +1 -0
  38. package/dist/chunk-EVWEG3VD.js +3 -0
  39. package/dist/chunk-EVWEG3VD.js.map +1 -0
  40. package/dist/chunk-F4HZTZHW.js +2 -0
  41. package/dist/chunk-F4HZTZHW.js.map +1 -0
  42. package/dist/chunk-F6CNF7V3.js +25 -0
  43. package/dist/chunk-F6CNF7V3.js.map +1 -0
  44. package/dist/chunk-FIEJDZVC.js +121 -0
  45. package/dist/chunk-FIEJDZVC.js.map +1 -0
  46. package/dist/chunk-FIOB3MEX.js +2 -0
  47. package/dist/{chunk-H5D7ATXS.js → chunk-FKBGJYWQ.js} +5 -5
  48. package/dist/chunk-FKBGJYWQ.js.map +1 -0
  49. package/dist/chunk-GDWJUGB5.js +9 -0
  50. package/dist/chunk-GDWJUGB5.js.map +1 -0
  51. package/dist/{chunk-BVGJSPW4.js → chunk-IB3F7VBE.js} +7 -7
  52. package/dist/{chunk-BVGJSPW4.js.map → chunk-IB3F7VBE.js.map} +1 -1
  53. package/dist/chunk-IBUSGCLQ.js +109 -0
  54. package/dist/chunk-IBUSGCLQ.js.map +1 -0
  55. package/dist/{chunk-LDHPMJ7M.js → chunk-IWMW5432.js} +3 -3
  56. package/dist/chunk-IWMW5432.js.map +1 -0
  57. package/dist/chunk-K33GIBSE.js +2 -0
  58. package/dist/chunk-K33GIBSE.js.map +1 -0
  59. package/dist/chunk-L2IZPR6P.js +45 -0
  60. package/dist/chunk-L2IZPR6P.js.map +1 -0
  61. package/dist/chunk-L2WSPY6S.js +2 -0
  62. package/dist/chunk-L2WSPY6S.js.map +1 -0
  63. package/dist/chunk-LCIREYTD.js +54 -0
  64. package/dist/chunk-LCIREYTD.js.map +1 -0
  65. package/dist/chunk-LNRB5MCU.js +530 -0
  66. package/dist/chunk-LNRB5MCU.js.map +1 -0
  67. package/dist/chunk-OPHIXXGI.js +157 -0
  68. package/dist/chunk-OPHIXXGI.js.map +1 -0
  69. package/dist/{chunk-JTJIPNXY.js → chunk-PNWNVOEZ.js} +1 -1
  70. package/dist/chunk-PNWNVOEZ.js.map +1 -0
  71. package/dist/{chunk-V3U4OF7L.js → chunk-UFAGYX73.js} +45 -47
  72. package/dist/chunk-UFAGYX73.js.map +1 -0
  73. package/dist/{chunk-DJEZ2HVU.js → chunk-VDMYBPYB.js} +1 -1
  74. package/dist/chunk-VDMYBPYB.js.map +1 -0
  75. package/dist/chunk-VTE7L6LO.js +5 -0
  76. package/dist/{chunk-O6YPEOQF.js.map → chunk-VTE7L6LO.js.map} +1 -1
  77. package/dist/chunk-W5C2GDNC.js +32 -0
  78. package/dist/{chunk-JP5IEXR7.js.map → chunk-W5C2GDNC.js.map} +1 -1
  79. package/dist/chunk-WPMX3VGI.js +3 -0
  80. package/dist/chunk-WPMX3VGI.js.map +1 -0
  81. package/dist/chunk-WZ72HX5C.js +1182 -0
  82. package/dist/chunk-WZ72HX5C.js.map +1 -0
  83. package/dist/chunk-ZTEU5JVQ.js +2 -0
  84. package/dist/chunk-ZTEU5JVQ.js.map +1 -0
  85. package/dist/{chunk-2WVX3LEC.js → chunk-ZVP6GB4G.js} +1 -1
  86. package/dist/chunk-ZVP6GB4G.js.map +1 -0
  87. package/dist/cli.js +1 -1
  88. package/dist/cli.js.map +1 -1
  89. package/dist/client-PX25MD47.js +2 -0
  90. package/dist/{compaction-NWEMOSHA.js → compaction-FD4R23HZ.js} +4 -4
  91. package/dist/config-HL5F36V4.js +2 -0
  92. package/dist/config-mutator-HBX53OMJ.js +2 -0
  93. package/dist/{conflict-detector-D7VIYPDI.js → conflict-detector-ZPOT3M2C.js} +2 -2
  94. package/dist/conflict-detector-ZPOT3M2C.js.map +1 -0
  95. package/dist/context-planner-AQHJMVY2.js +17 -0
  96. package/dist/context-planner-AQHJMVY2.js.map +1 -0
  97. package/dist/debug-3MEUO2P2.js +2 -0
  98. package/dist/{discover-XJXQXXIO.js → discover-D4VVRNAI.js} +2 -2
  99. package/dist/discover-D4VVRNAI.js.map +1 -0
  100. package/dist/doctor-PBAH6XL3.js +2 -0
  101. package/dist/editor-chat-OB7IQOB5.js +137 -0
  102. package/dist/editor-chat-OB7IQOB5.js.map +1 -0
  103. package/dist/entry-triage-LK34TSQD.js +2 -0
  104. package/dist/entry-triage-LK34TSQD.js.map +1 -0
  105. package/dist/facts-YVEJOM7O.js +22 -0
  106. package/dist/facts-YVEJOM7O.js.map +1 -0
  107. package/dist/heal-FVLBHYP7.js +2 -0
  108. package/dist/index.d.ts +1016 -65
  109. package/dist/index.js +13 -13
  110. package/dist/index.js.map +1 -1
  111. package/dist/{ingest-whatsapp-LZE62INA.js → ingest-whatsapp-NS4OWDOU.js} +2 -2
  112. package/dist/loader-4ZGTK7LD.js +2 -0
  113. package/dist/loader-BOKE5M5S.js +2 -0
  114. package/dist/memory-extract-F5ZHWY5E.js +2 -0
  115. package/dist/{migrate-v2-QO7SLKIM.js → migrate-v2-V4WN2VVM.js} +2 -2
  116. package/dist/ntfy-X7EPB3TG.js +4 -0
  117. package/dist/ntfy-X7EPB3TG.js.map +1 -0
  118. package/dist/processes-WU23U2OJ.js +2 -0
  119. package/dist/program-YGXVCV2Y.js +2 -0
  120. package/dist/{projects-api-KRME2YKZ.js → projects-api-QE6L65SK.js} +2 -2
  121. package/dist/{projects-mutate-3NHVG437.js → projects-mutate-MY7JTLSZ.js} +2 -2
  122. package/dist/providers-KO2DODIO.js +2 -0
  123. package/dist/query-ZKTFJMNE.js +2 -0
  124. package/dist/questions-4B4KSPXG.js +3 -0
  125. package/dist/questions-4B4KSPXG.js.map +1 -0
  126. package/dist/recipes-7S4MC5OJ.js +2 -0
  127. package/dist/registry-PSZDPFZK.js +2 -0
  128. package/dist/review-candidates-AEUXRQQC.js +4 -0
  129. package/dist/review-candidates-AEUXRQQC.js.map +1 -0
  130. package/dist/review-store-B4YE3EFK.js +4 -0
  131. package/dist/review-store-B4YE3EFK.js.map +1 -0
  132. package/dist/{rotation-memo-B3EXXSEH.js → rotation-memo-7T75BLEX.js} +2 -2
  133. package/dist/routing-4PV66BK6.js +2 -0
  134. package/dist/routing-4PV66BK6.js.map +1 -0
  135. package/dist/runner-YRBVNYTY.js +2 -0
  136. package/dist/scheduler-GZZAN6ZG.js +2 -0
  137. package/dist/seat-VZ7AVO27.js +2 -0
  138. package/dist/select-F5I5PO2O.js +2 -0
  139. package/dist/select-F5I5PO2O.js.map +1 -0
  140. package/dist/store-MCOA6N4F.js +2 -0
  141. package/dist/{subagent-WV7QKQ3L.js → subagent-2SJHSSJS.js} +2 -2
  142. package/dist/{surface-usage-PRL6Z4U3.js → surface-usage-NS74AXSE.js} +2 -2
  143. package/dist/timers-PCB4ZIBD.js +2 -0
  144. package/dist/triage-backtest-JNO7RKX7.js +2 -0
  145. package/dist/triage-backtest-JNO7RKX7.js.map +1 -0
  146. package/dist/types-H5ENIUIT.js +2 -0
  147. package/dist/types-OIFU3KSQ.js +2 -0
  148. package/dist/web/workflow-editor.global.js +1542 -0
  149. package/dist/web/workflow-editor.global.js.map +1 -0
  150. package/dist/{whatsapp-state-XMTCSRXU.js → whatsapp-state-6D6FHHD2.js} +2 -2
  151. package/dist/wiki-N5SMP3DT.js +2 -0
  152. package/dist/wiki-N5SMP3DT.js.map +1 -0
  153. package/dist/workflows/templates/branching.yaml +1 -1
  154. package/dist/{workspace-setup-TBQAHYHJ.js → workspace-setup-B3F3TUDE.js} +2 -2
  155. package/dist/workspace-setup-B3F3TUDE.js.map +1 -0
  156. package/package.json +1 -1
  157. package/dist/agent-5QMITZT6.js +0 -2
  158. package/dist/architect-SEPWMWS4.js +0 -2
  159. package/dist/board-dashboard-M3372FLO.js.map +0 -1
  160. package/dist/chunk-2WVX3LEC.js.map +0 -1
  161. package/dist/chunk-3WQFCIB6.js +0 -24
  162. package/dist/chunk-3WQFCIB6.js.map +0 -1
  163. package/dist/chunk-4YCH6IZV.js +0 -2
  164. package/dist/chunk-53NRX2NA.js +0 -2
  165. package/dist/chunk-53NRX2NA.js.map +0 -1
  166. package/dist/chunk-5U35WAZF.js.map +0 -1
  167. package/dist/chunk-BFXONUUN.js +0 -108
  168. package/dist/chunk-BFXONUUN.js.map +0 -1
  169. package/dist/chunk-BFZUG66X.js +0 -45
  170. package/dist/chunk-BFZUG66X.js.map +0 -1
  171. package/dist/chunk-BTHHSY7D.js +0 -13
  172. package/dist/chunk-BTHHSY7D.js.map +0 -1
  173. package/dist/chunk-D46VZ7K7.js +0 -116
  174. package/dist/chunk-D46VZ7K7.js.map +0 -1
  175. package/dist/chunk-DJEZ2HVU.js.map +0 -1
  176. package/dist/chunk-E5CXCI33.js +0 -155
  177. package/dist/chunk-E5CXCI33.js.map +0 -1
  178. package/dist/chunk-FDWOECJY.js +0 -54
  179. package/dist/chunk-FDWOECJY.js.map +0 -1
  180. package/dist/chunk-H5D7ATXS.js.map +0 -1
  181. package/dist/chunk-HR4JSRZS.js +0 -3
  182. package/dist/chunk-HR4JSRZS.js.map +0 -1
  183. package/dist/chunk-ISEBLHWX.js +0 -118
  184. package/dist/chunk-ISEBLHWX.js.map +0 -1
  185. package/dist/chunk-JP5IEXR7.js +0 -32
  186. package/dist/chunk-JTJIPNXY.js.map +0 -1
  187. package/dist/chunk-K2CAPYES.js +0 -5
  188. package/dist/chunk-LDHPMJ7M.js.map +0 -1
  189. package/dist/chunk-METYYZKQ.js +0 -1115
  190. package/dist/chunk-METYYZKQ.js.map +0 -1
  191. package/dist/chunk-MTAPOCGA.js +0 -47
  192. package/dist/chunk-MTAPOCGA.js.map +0 -1
  193. package/dist/chunk-O6YPEOQF.js +0 -5
  194. package/dist/chunk-P4VWIVKN.js.map +0 -1
  195. package/dist/chunk-SR3X25TN.js +0 -3
  196. package/dist/chunk-SR3X25TN.js.map +0 -1
  197. package/dist/chunk-UHE5FCPB.js +0 -431
  198. package/dist/chunk-UHE5FCPB.js.map +0 -1
  199. package/dist/chunk-V3U4OF7L.js.map +0 -1
  200. package/dist/chunk-VJUTQAPJ.js +0 -2
  201. package/dist/chunk-VJUTQAPJ.js.map +0 -1
  202. package/dist/chunk-VT5XYFDD.js +0 -126
  203. package/dist/chunk-VT5XYFDD.js.map +0 -1
  204. package/dist/client-HGKAC6VP.js +0 -2
  205. package/dist/config-A4RWEJHV.js +0 -2
  206. package/dist/config-mutator-MNSFUN7D.js +0 -2
  207. package/dist/conflict-detector-D7VIYPDI.js.map +0 -1
  208. package/dist/context-planner-45GEWKGL.js +0 -17
  209. package/dist/context-planner-45GEWKGL.js.map +0 -1
  210. package/dist/debug-N3B5NVJU.js +0 -2
  211. package/dist/discover-XJXQXXIO.js.map +0 -1
  212. package/dist/doctor-3Q36ZFE6.js +0 -2
  213. package/dist/heal-HZ3EQD52.js +0 -2
  214. package/dist/loader-5CA3O5GM.js +0 -2
  215. package/dist/loader-6IHUCPVO.js +0 -2
  216. package/dist/memory-extract-AENFVVO5.js +0 -2
  217. package/dist/processes-UIC4XXA6.js +0 -2
  218. package/dist/program-SAUNRCCD.js +0 -2
  219. package/dist/providers-L27BJ5A6.js +0 -2
  220. package/dist/query-HZYYRCLU.js +0 -2
  221. package/dist/recipes-EPLE2SNT.js +0 -2
  222. package/dist/registry-HK3WQ7BS.js +0 -2
  223. package/dist/runner-BFYDWPUO.js +0 -2
  224. package/dist/scheduler-6T2SU5ST.js +0 -2
  225. package/dist/store-I3HEWVLQ.js +0 -2
  226. package/dist/timers-5LPZN55J.js +0 -2
  227. package/dist/types-VECTMYTO.js +0 -2
  228. package/dist/types-Y6ZCZ52Z.js +0 -2
  229. package/dist/wiki-M6YNRFC4.js +0 -2
  230. /package/dist/{App-BPNHIGUX.js.map → App-U52IPUK2.js.map} +0 -0
  231. /package/dist/{ChatApp-6XSSZB4U.js.map → ChatApp-XP4OMHPL.js.map} +0 -0
  232. /package/dist/{agent-5QMITZT6.js.map → agent-V2CA4TXD.js.map} +0 -0
  233. /package/dist/{architect-SEPWMWS4.js.map → article-fields-L4D2BOGY.js.map} +0 -0
  234. /package/dist/{audit-JU3HWISB.js.map → audit-4245CX6P.js.map} +0 -0
  235. /package/dist/{builtin-FRKAQMFS.js.map → builtin-B67DMJ3M.js.map} +0 -0
  236. /package/dist/{chunk-4YCH6IZV.js.map → calibration-ILS5OI44.js.map} +0 -0
  237. /package/dist/{client-HGKAC6VP.js.map → chunk-FIOB3MEX.js.map} +0 -0
  238. /package/dist/{config-A4RWEJHV.js.map → client-PX25MD47.js.map} +0 -0
  239. /package/dist/{compaction-NWEMOSHA.js.map → compaction-FD4R23HZ.js.map} +0 -0
  240. /package/dist/{config-mutator-MNSFUN7D.js.map → config-HL5F36V4.js.map} +0 -0
  241. /package/dist/{debug-N3B5NVJU.js.map → config-mutator-HBX53OMJ.js.map} +0 -0
  242. /package/dist/{doctor-3Q36ZFE6.js.map → debug-3MEUO2P2.js.map} +0 -0
  243. /package/dist/{heal-HZ3EQD52.js.map → doctor-PBAH6XL3.js.map} +0 -0
  244. /package/dist/{loader-5CA3O5GM.js.map → heal-FVLBHYP7.js.map} +0 -0
  245. /package/dist/{ingest-whatsapp-LZE62INA.js.map → ingest-whatsapp-NS4OWDOU.js.map} +0 -0
  246. /package/dist/{loader-6IHUCPVO.js.map → loader-4ZGTK7LD.js.map} +0 -0
  247. /package/dist/{memory-extract-AENFVVO5.js.map → loader-BOKE5M5S.js.map} +0 -0
  248. /package/dist/{processes-UIC4XXA6.js.map → memory-extract-F5ZHWY5E.js.map} +0 -0
  249. /package/dist/{migrate-v2-QO7SLKIM.js.map → migrate-v2-V4WN2VVM.js.map} +0 -0
  250. /package/dist/{program-SAUNRCCD.js.map → processes-WU23U2OJ.js.map} +0 -0
  251. /package/dist/{providers-L27BJ5A6.js.map → program-YGXVCV2Y.js.map} +0 -0
  252. /package/dist/{projects-api-KRME2YKZ.js.map → projects-api-QE6L65SK.js.map} +0 -0
  253. /package/dist/{projects-mutate-3NHVG437.js.map → projects-mutate-MY7JTLSZ.js.map} +0 -0
  254. /package/dist/{query-HZYYRCLU.js.map → providers-KO2DODIO.js.map} +0 -0
  255. /package/dist/{recipes-EPLE2SNT.js.map → query-ZKTFJMNE.js.map} +0 -0
  256. /package/dist/{registry-HK3WQ7BS.js.map → recipes-7S4MC5OJ.js.map} +0 -0
  257. /package/dist/{runner-BFYDWPUO.js.map → registry-PSZDPFZK.js.map} +0 -0
  258. /package/dist/{rotation-memo-B3EXXSEH.js.map → rotation-memo-7T75BLEX.js.map} +0 -0
  259. /package/dist/{scheduler-6T2SU5ST.js.map → runner-YRBVNYTY.js.map} +0 -0
  260. /package/dist/{store-I3HEWVLQ.js.map → scheduler-GZZAN6ZG.js.map} +0 -0
  261. /package/dist/{surface-usage-PRL6Z4U3.js.map → seat-VZ7AVO27.js.map} +0 -0
  262. /package/dist/{timers-5LPZN55J.js.map → store-MCOA6N4F.js.map} +0 -0
  263. /package/dist/{subagent-WV7QKQ3L.js.map → subagent-2SJHSSJS.js.map} +0 -0
  264. /package/dist/{types-VECTMYTO.js.map → surface-usage-NS74AXSE.js.map} +0 -0
  265. /package/dist/{types-Y6ZCZ52Z.js.map → timers-PCB4ZIBD.js.map} +0 -0
  266. /package/dist/{wiki-M6YNRFC4.js.map → types-H5ENIUIT.js.map} +0 -0
  267. /package/dist/{workspace-setup-TBQAHYHJ.js.map → types-OIFU3KSQ.js.map} +0 -0
  268. /package/dist/{whatsapp-state-XMTCSRXU.js.map → whatsapp-state-6D6FHHD2.js.map} +0 -0
@@ -0,0 +1,1542 @@
1
+ "use strict";(()=>{var Ip=Object.create;var xs=Object.defineProperty;var Lp=Object.getOwnPropertyDescriptor;var Op=Object.getOwnPropertyNames;var zp=Object.getPrototypeOf,Ap=Object.prototype.hasOwnProperty;var Ct=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Dp=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Op(t))!Ap.call(e,o)&&o!==n&&xs(e,o,{get:()=>t[o],enumerable:!(r=Lp(t,o))||r.enumerable});return e};var oe=(e,t,n)=>(n=e!=null?Ip(zp(e)):{},Dp(t||!e||!e.__esModule?xs(n,"default",{value:e,enumerable:!0}):n,e));var Is=Ct(B=>{"use strict";var pr=Symbol.for("react.element"),Up=Symbol.for("react.portal"),Wp=Symbol.for("react.fragment"),Hp=Symbol.for("react.strict_mode"),Bp=Symbol.for("react.profiler"),Gp=Symbol.for("react.provider"),$p=Symbol.for("react.context"),Vp=Symbol.for("react.forward_ref"),Kp=Symbol.for("react.suspense"),Yp=Symbol.for("react.memo"),Qp=Symbol.for("react.lazy"),bs=Symbol.iterator;function Jp(e){return e===null||typeof e!="object"?null:(e=bs&&e[bs]||e["@@iterator"],typeof e=="function"?e:null)}var Cs={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ns=Object.assign,Es={};function Nn(e,t,n){this.props=e,this.context=t,this.refs=Es,this.updater=n||Cs}Nn.prototype.isReactComponent={};Nn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Nn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ts(){}Ts.prototype=Nn.prototype;function Bi(e,t,n){this.props=e,this.context=t,this.refs=Es,this.updater=n||Cs}var Gi=Bi.prototype=new Ts;Gi.constructor=Bi;Ns(Gi,Nn.prototype);Gi.isPureReactComponent=!0;var _s=Array.isArray,Ps=Object.prototype.hasOwnProperty,$i={current:null},Fs={key:!0,ref:!0,__self:!0,__source:!0};function Ms(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)Ps.call(t,r)&&!Fs.hasOwnProperty(r)&&(o[r]=t[r]);var u=arguments.length-2;if(u===1)o.children=n;else if(1<u){for(var s=Array(u),c=0;c<u;c++)s[c]=arguments[c+2];o.children=s}if(e&&e.defaultProps)for(r in u=e.defaultProps,u)o[r]===void 0&&(o[r]=u[r]);return{$$typeof:pr,type:e,key:i,ref:a,props:o,_owner:$i.current}}function Xp(e,t){return{$$typeof:pr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Vi(e){return typeof e=="object"&&e!==null&&e.$$typeof===pr}function qp(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ss=/\/+/g;function Hi(e,t){return typeof e=="object"&&e!==null&&e.key!=null?qp(""+e.key):t.toString(36)}function uo(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case pr:case Up:a=!0}}if(a)return a=e,o=o(a),e=r===""?"."+Hi(a,0):r,_s(o)?(n="",e!=null&&(n=e.replace(Ss,"$&/")+"/"),uo(o,t,n,"",function(c){return c})):o!=null&&(Vi(o)&&(o=Xp(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(Ss,"$&/")+"/")+e)),t.push(o)),1;if(a=0,r=r===""?".":r+":",_s(e))for(var u=0;u<e.length;u++){i=e[u];var s=r+Hi(i,u);a+=uo(i,t,n,s,o)}else if(s=Jp(e),typeof s=="function")for(e=s.call(e),u=0;!(i=e.next()).done;)i=i.value,s=r+Hi(i,u++),a+=uo(i,t,n,s,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function so(e,t,n){if(e==null)return e;var r=[],o=0;return uo(e,r,"","",function(i){return t.call(n,i,o++)}),r}function Zp(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Re={current:null},co={transition:null},ef={ReactCurrentDispatcher:Re,ReactCurrentBatchConfig:co,ReactCurrentOwner:$i};function Rs(){throw Error("act(...) is not supported in production builds of React.")}B.Children={map:so,forEach:function(e,t,n){so(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return so(e,function(){t++}),t},toArray:function(e){return so(e,function(t){return t})||[]},only:function(e){if(!Vi(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};B.Component=Nn;B.Fragment=Wp;B.Profiler=Bp;B.PureComponent=Bi;B.StrictMode=Hp;B.Suspense=Kp;B.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ef;B.act=Rs;B.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Ns({},e.props),o=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=$i.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(s in t)Ps.call(t,s)&&!Fs.hasOwnProperty(s)&&(r[s]=t[s]===void 0&&u!==void 0?u[s]:t[s])}var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){u=Array(s);for(var c=0;c<s;c++)u[c]=arguments[c+2];r.children=u}return{$$typeof:pr,type:e.type,key:o,ref:i,props:r,_owner:a}};B.createContext=function(e){return e={$$typeof:$p,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Gp,_context:e},e.Consumer=e};B.createElement=Ms;B.createFactory=function(e){var t=Ms.bind(null,e);return t.type=e,t};B.createRef=function(){return{current:null}};B.forwardRef=function(e){return{$$typeof:Vp,render:e}};B.isValidElement=Vi;B.lazy=function(e){return{$$typeof:Qp,_payload:{_status:-1,_result:e},_init:Zp}};B.memo=function(e,t){return{$$typeof:Yp,type:e,compare:t===void 0?null:t}};B.startTransition=function(e){var t=co.transition;co.transition={};try{e()}finally{co.transition=t}};B.unstable_act=Rs;B.useCallback=function(e,t){return Re.current.useCallback(e,t)};B.useContext=function(e){return Re.current.useContext(e)};B.useDebugValue=function(){};B.useDeferredValue=function(e){return Re.current.useDeferredValue(e)};B.useEffect=function(e,t){return Re.current.useEffect(e,t)};B.useId=function(){return Re.current.useId()};B.useImperativeHandle=function(e,t,n){return Re.current.useImperativeHandle(e,t,n)};B.useInsertionEffect=function(e,t){return Re.current.useInsertionEffect(e,t)};B.useLayoutEffect=function(e,t){return Re.current.useLayoutEffect(e,t)};B.useMemo=function(e,t){return Re.current.useMemo(e,t)};B.useReducer=function(e,t,n){return Re.current.useReducer(e,t,n)};B.useRef=function(e){return Re.current.useRef(e)};B.useState=function(e){return Re.current.useState(e)};B.useSyncExternalStore=function(e,t,n){return Re.current.useSyncExternalStore(e,t,n)};B.useTransition=function(){return Re.current.useTransition()};B.version="18.3.1"});var Nt=Ct((Gm,Ls)=>{"use strict";Ls.exports=Is()});var Gs=Ct(J=>{"use strict";function Ji(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<po(o,t))e[r]=t,e[n]=o,n=r;else break e}}function ut(e){return e.length===0?null:e[0]}function go(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var a=2*(r+1)-1,u=e[a],s=a+1,c=e[s];if(0>po(u,n))s<o&&0>po(c,u)?(e[r]=c,e[s]=n,r=s):(e[r]=u,e[a]=n,r=a);else if(s<o&&0>po(c,n))e[r]=c,e[s]=n,r=s;else break e}}return t}function po(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Os=performance,J.unstable_now=function(){return Os.now()}):(Ki=Date,zs=Ki.now(),J.unstable_now=function(){return Ki.now()-zs});var Os,Ki,zs,yt=[],At=[],tf=1,Ze=null,Ne=3,ho=!1,on=!1,gr=!1,js=typeof setTimeout=="function"?setTimeout:null,Us=typeof clearTimeout=="function"?clearTimeout:null,As=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Xi(e){for(var t=ut(At);t!==null;){if(t.callback===null)go(At);else if(t.startTime<=e)go(At),t.sortIndex=t.expirationTime,Ji(yt,t);else break;t=ut(At)}}function qi(e){if(gr=!1,Xi(e),!on)if(ut(yt)!==null)on=!0,ea(Zi);else{var t=ut(At);t!==null&&ta(qi,t.startTime-e)}}function Zi(e,t){on=!1,gr&&(gr=!1,Us(hr),hr=-1),ho=!0;var n=Ne;try{for(Xi(t),Ze=ut(yt);Ze!==null&&(!(Ze.expirationTime>t)||e&&!Bs());){var r=Ze.callback;if(typeof r=="function"){Ze.callback=null,Ne=Ze.priorityLevel;var o=r(Ze.expirationTime<=t);t=J.unstable_now(),typeof o=="function"?Ze.callback=o:Ze===ut(yt)&&go(yt),Xi(t)}else go(yt);Ze=ut(yt)}if(Ze!==null)var i=!0;else{var a=ut(At);a!==null&&ta(qi,a.startTime-t),i=!1}return i}finally{Ze=null,Ne=n,ho=!1}}var mo=!1,fo=null,hr=-1,Ws=5,Hs=-1;function Bs(){return!(J.unstable_now()-Hs<Ws)}function Yi(){if(fo!==null){var e=J.unstable_now();Hs=e;var t=!0;try{t=fo(!0,e)}finally{t?fr():(mo=!1,fo=null)}}else mo=!1}var fr;typeof As=="function"?fr=function(){As(Yi)}:typeof MessageChannel<"u"?(Qi=new MessageChannel,Ds=Qi.port2,Qi.port1.onmessage=Yi,fr=function(){Ds.postMessage(null)}):fr=function(){js(Yi,0)};var Qi,Ds;function ea(e){fo=e,mo||(mo=!0,fr())}function ta(e,t){hr=js(function(){e(J.unstable_now())},t)}J.unstable_IdlePriority=5;J.unstable_ImmediatePriority=1;J.unstable_LowPriority=4;J.unstable_NormalPriority=3;J.unstable_Profiling=null;J.unstable_UserBlockingPriority=2;J.unstable_cancelCallback=function(e){e.callback=null};J.unstable_continueExecution=function(){on||ho||(on=!0,ea(Zi))};J.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Ws=0<e?Math.floor(1e3/e):5};J.unstable_getCurrentPriorityLevel=function(){return Ne};J.unstable_getFirstCallbackNode=function(){return ut(yt)};J.unstable_next=function(e){switch(Ne){case 1:case 2:case 3:var t=3;break;default:t=Ne}var n=Ne;Ne=t;try{return e()}finally{Ne=n}};J.unstable_pauseExecution=function(){};J.unstable_requestPaint=function(){};J.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Ne;Ne=e;try{return t()}finally{Ne=n}};J.unstable_scheduleCallback=function(e,t,n){var r=J.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=n+o,e={id:tf++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,Ji(At,e),ut(yt)===null&&e===ut(At)&&(gr?(Us(hr),hr=-1):gr=!0,ta(qi,n-r))):(e.sortIndex=o,Ji(yt,e),on||ho||(on=!0,ea(Zi))),e};J.unstable_shouldYield=Bs;J.unstable_wrapCallback=function(e){var t=Ne;return function(){var n=Ne;Ne=t;try{return e.apply(this,arguments)}finally{Ne=n}}}});var Vs=Ct((Vm,$s)=>{"use strict";$s.exports=Gs()});var Jd=Ct(Je=>{"use strict";var nf=Nt(),Ye=Vs();function b(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Zu=new Set,Ar={};function yn(e,t){Kn(e,t),Kn(e+"Capture",t)}function Kn(e,t){for(Ar[e]=t,e=0;e<t.length;e++)Zu.add(t[e])}var Rt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sa=Object.prototype.hasOwnProperty,rf=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ks={},Ys={};function of(e){return Sa.call(Ys,e)?!0:Sa.call(Ks,e)?!1:rf.test(e)?Ys[e]=!0:(Ks[e]=!0,!1)}function af(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function lf(e,t,n,r){if(t===null||typeof t>"u"||af(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Oe(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Se={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Se[e]=new Oe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Se[t]=new Oe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Se[e]=new Oe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Se[e]=new Oe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Se[e]=new Oe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Se[e]=new Oe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Se[e]=new Oe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Se[e]=new Oe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Se[e]=new Oe(e,5,!1,e.toLowerCase(),null,!1,!1)});var ml=/[\-:]([a-z])/g;function vl(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ml,vl);Se[t]=new Oe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ml,vl);Se[t]=new Oe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ml,vl);Se[t]=new Oe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Se[e]=new Oe(e,1,!1,e.toLowerCase(),null,!1,!1)});Se.xlinkHref=new Oe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Se[e]=new Oe(e,1,!1,e.toLowerCase(),null,!0,!0)});function yl(e,t,n,r){var o=Se.hasOwnProperty(t)?Se[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(lf(t,n,o,r)&&(n=null),r||o===null?of(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var zt=nf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,vo=Symbol.for("react.element"),Pn=Symbol.for("react.portal"),Fn=Symbol.for("react.fragment"),wl=Symbol.for("react.strict_mode"),Ca=Symbol.for("react.profiler"),ec=Symbol.for("react.provider"),tc=Symbol.for("react.context"),xl=Symbol.for("react.forward_ref"),Na=Symbol.for("react.suspense"),Ea=Symbol.for("react.suspense_list"),kl=Symbol.for("react.memo"),jt=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var nc=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var Qs=Symbol.iterator;function mr(e){return e===null||typeof e!="object"?null:(e=Qs&&e[Qs]||e["@@iterator"],typeof e=="function"?e:null)}var le=Object.assign,na;function Sr(e){if(na===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);na=t&&t[1]||""}return`
2
+ `+na+e}var ra=!1;function oa(e,t){if(!e||ra)return"";ra=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
3
+ `),i=r.stack.split(`
4
+ `),a=o.length-1,u=i.length-1;1<=a&&0<=u&&o[a]!==i[u];)u--;for(;1<=a&&0<=u;a--,u--)if(o[a]!==i[u]){if(a!==1||u!==1)do if(a--,u--,0>u||o[a]!==i[u]){var s=`
5
+ `+o[a].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}while(1<=a&&0<=u);break}}}finally{ra=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Sr(e):""}function sf(e){switch(e.tag){case 5:return Sr(e.type);case 16:return Sr("Lazy");case 13:return Sr("Suspense");case 19:return Sr("SuspenseList");case 0:case 2:case 15:return e=oa(e.type,!1),e;case 11:return e=oa(e.type.render,!1),e;case 1:return e=oa(e.type,!0),e;default:return""}}function Ta(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Fn:return"Fragment";case Pn:return"Portal";case Ca:return"Profiler";case wl:return"StrictMode";case Na:return"Suspense";case Ea:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case tc:return(e.displayName||"Context")+".Consumer";case ec:return(e._context.displayName||"Context")+".Provider";case xl:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case kl:return t=e.displayName||null,t!==null?t:Ta(e.type)||"Memo";case jt:t=e._payload,e=e._init;try{return Ta(e(t))}catch{}}return null}function uf(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ta(t);case 8:return t===wl?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Zt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function rc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function cf(e){var t=rc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yo(e){e._valueTracker||(e._valueTracker=cf(e))}function oc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=rc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Pa(e,t){var n=t.checked;return le({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Js(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Zt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ic(e,t){t=t.checked,t!=null&&yl(e,"checked",t,!1)}function Fa(e,t){ic(e,t);var n=Zt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ma(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ma(e,t.type,Zt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xs(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ma(e,t,n){(t!=="number"||Vo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Cr=Array.isArray;function Wn(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Zt(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ra(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(b(91));return le({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function qs(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(b(92));if(Cr(n)){if(1<n.length)throw Error(b(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Zt(n)}}function ac(e,t){var n=Zt(t.value),r=Zt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Zs(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function lc(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ia(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?lc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var wo,sc=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(wo=wo||document.createElement("div"),wo.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=wo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Dr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Tr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},df=["Webkit","ms","Moz","O"];Object.keys(Tr).forEach(function(e){df.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tr[t]=Tr[e]})});function uc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Tr.hasOwnProperty(e)&&Tr[e]?(""+t).trim():t+"px"}function cc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=uc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var pf=le({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function La(e,t){if(t){if(pf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(b(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(b(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(b(61))}if(t.style!=null&&typeof t.style!="object")throw Error(b(62))}}function Oa(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var za=null;function bl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Aa=null,Hn=null,Bn=null;function eu(e){if(e=no(e)){if(typeof Aa!="function")throw Error(b(280));var t=e.stateNode;t&&(t=xi(t),Aa(e.stateNode,e.type,t))}}function dc(e){Hn?Bn?Bn.push(e):Bn=[e]:Hn=e}function pc(){if(Hn){var e=Hn,t=Bn;if(Bn=Hn=null,eu(e),t)for(e=0;e<t.length;e++)eu(t[e])}}function fc(e,t){return e(t)}function gc(){}var ia=!1;function hc(e,t,n){if(ia)return e(t,n);ia=!0;try{return fc(e,t,n)}finally{ia=!1,(Hn!==null||Bn!==null)&&(gc(),pc())}}function jr(e,t){var n=e.stateNode;if(n===null)return null;var r=xi(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(b(231,t,typeof n));return n}var Da=!1;if(Rt)try{En={},Object.defineProperty(En,"passive",{get:function(){Da=!0}}),window.addEventListener("test",En,En),window.removeEventListener("test",En,En)}catch{Da=!1}var En;function ff(e,t,n,r,o,i,a,u,s){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var Pr=!1,Ko=null,Yo=!1,ja=null,gf={onError:function(e){Pr=!0,Ko=e}};function hf(e,t,n,r,o,i,a,u,s){Pr=!1,Ko=null,ff.apply(gf,arguments)}function mf(e,t,n,r,o,i,a,u,s){if(hf.apply(this,arguments),Pr){if(Pr){var c=Ko;Pr=!1,Ko=null}else throw Error(b(198));Yo||(Yo=!0,ja=c)}}function wn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function mc(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function tu(e){if(wn(e)!==e)throw Error(b(188))}function vf(e){var t=e.alternate;if(!t){if(t=wn(e),t===null)throw Error(b(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return tu(o),e;if(i===r)return tu(o),t;i=i.sibling}throw Error(b(188))}if(n.return!==r.return)n=o,r=i;else{for(var a=!1,u=o.child;u;){if(u===n){a=!0,n=o,r=i;break}if(u===r){a=!0,r=o,n=i;break}u=u.sibling}if(!a){for(u=i.child;u;){if(u===n){a=!0,n=i,r=o;break}if(u===r){a=!0,r=i,n=o;break}u=u.sibling}if(!a)throw Error(b(189))}}if(n.alternate!==r)throw Error(b(190))}if(n.tag!==3)throw Error(b(188));return n.stateNode.current===n?e:t}function vc(e){return e=vf(e),e!==null?yc(e):null}function yc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=yc(e);if(t!==null)return t;e=e.sibling}return null}var wc=Ye.unstable_scheduleCallback,nu=Ye.unstable_cancelCallback,yf=Ye.unstable_shouldYield,wf=Ye.unstable_requestPaint,de=Ye.unstable_now,xf=Ye.unstable_getCurrentPriorityLevel,_l=Ye.unstable_ImmediatePriority,xc=Ye.unstable_UserBlockingPriority,Qo=Ye.unstable_NormalPriority,kf=Ye.unstable_LowPriority,kc=Ye.unstable_IdlePriority,mi=null,bt=null;function bf(e){if(bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(mi,e,void 0,(e.current.flags&128)===128)}catch{}}var gt=Math.clz32?Math.clz32:Cf,_f=Math.log,Sf=Math.LN2;function Cf(e){return e>>>=0,e===0?32:31-(_f(e)/Sf|0)|0}var xo=64,ko=4194304;function Nr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Jo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var u=a&~o;u!==0?r=Nr(u):(i&=a,i!==0&&(r=Nr(i)))}else a=n&~o,a!==0?r=Nr(a):i!==0&&(r=Nr(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-gt(t),o=1<<n,r|=e[n],t&=~o;return r}function Nf(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ef(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-gt(i),u=1<<a,s=o[a];s===-1?(!(u&n)||u&r)&&(o[a]=Nf(u,t)):s<=t&&(e.expiredLanes|=u),i&=~u}}function Ua(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function bc(){var e=xo;return xo<<=1,!(xo&4194240)&&(xo=64),e}function aa(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function eo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gt(t),e[t]=n}function Tf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-gt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Sl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-gt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var Q=0;function _c(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Sc,Cl,Cc,Nc,Ec,Wa=!1,bo=[],$t=null,Vt=null,Kt=null,Ur=new Map,Wr=new Map,Wt=[],Pf="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ru(e,t){switch(e){case"focusin":case"focusout":$t=null;break;case"dragenter":case"dragleave":Vt=null;break;case"mouseover":case"mouseout":Kt=null;break;case"pointerover":case"pointerout":Ur.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wr.delete(t.pointerId)}}function vr(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=no(t),t!==null&&Cl(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Ff(e,t,n,r,o){switch(t){case"focusin":return $t=vr($t,e,t,n,r,o),!0;case"dragenter":return Vt=vr(Vt,e,t,n,r,o),!0;case"mouseover":return Kt=vr(Kt,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Ur.set(i,vr(Ur.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Wr.set(i,vr(Wr.get(i)||null,e,t,n,r,o)),!0}return!1}function Tc(e){var t=sn(e.target);if(t!==null){var n=wn(t);if(n!==null){if(t=n.tag,t===13){if(t=mc(n),t!==null){e.blockedOn=t,Ec(e.priority,function(){Cc(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ha(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);za=r,n.target.dispatchEvent(r),za=null}else return t=no(n),t!==null&&Cl(t),e.blockedOn=n,!1;t.shift()}return!0}function ou(e,t,n){zo(e)&&n.delete(t)}function Mf(){Wa=!1,$t!==null&&zo($t)&&($t=null),Vt!==null&&zo(Vt)&&(Vt=null),Kt!==null&&zo(Kt)&&(Kt=null),Ur.forEach(ou),Wr.forEach(ou)}function yr(e,t){e.blockedOn===t&&(e.blockedOn=null,Wa||(Wa=!0,Ye.unstable_scheduleCallback(Ye.unstable_NormalPriority,Mf)))}function Hr(e){function t(o){return yr(o,e)}if(0<bo.length){yr(bo[0],e);for(var n=1;n<bo.length;n++){var r=bo[n];r.blockedOn===e&&(r.blockedOn=null)}}for($t!==null&&yr($t,e),Vt!==null&&yr(Vt,e),Kt!==null&&yr(Kt,e),Ur.forEach(t),Wr.forEach(t),n=0;n<Wt.length;n++)r=Wt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Wt.length&&(n=Wt[0],n.blockedOn===null);)Tc(n),n.blockedOn===null&&Wt.shift()}var Gn=zt.ReactCurrentBatchConfig,Xo=!0;function Rf(e,t,n,r){var o=Q,i=Gn.transition;Gn.transition=null;try{Q=1,Nl(e,t,n,r)}finally{Q=o,Gn.transition=i}}function If(e,t,n,r){var o=Q,i=Gn.transition;Gn.transition=null;try{Q=4,Nl(e,t,n,r)}finally{Q=o,Gn.transition=i}}function Nl(e,t,n,r){if(Xo){var o=Ha(e,t,n,r);if(o===null)fa(e,t,r,qo,n),ru(e,r);else if(Ff(o,e,t,n,r))r.stopPropagation();else if(ru(e,r),t&4&&-1<Pf.indexOf(e)){for(;o!==null;){var i=no(o);if(i!==null&&Sc(i),i=Ha(e,t,n,r),i===null&&fa(e,t,r,qo,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else fa(e,t,r,null,n)}}var qo=null;function Ha(e,t,n,r){if(qo=null,e=bl(r),e=sn(e),e!==null)if(t=wn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=mc(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return qo=e,null}function Pc(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(xf()){case _l:return 1;case xc:return 4;case Qo:case kf:return 16;case kc:return 536870912;default:return 16}default:return 16}}var Bt=null,El=null,Ao=null;function Fc(){if(Ao)return Ao;var e,t=El,n=t.length,r,o="value"in Bt?Bt.value:Bt.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===o[i-r];r++);return Ao=o.slice(e,1<r?1-r:void 0)}function Do(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function _o(){return!0}function iu(){return!1}function Qe(e){function t(n,r,o,i,a){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var u in e)e.hasOwnProperty(u)&&(n=e[u],this[u]=n?n(i):i[u]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?_o:iu,this.isPropagationStopped=iu,this}return le(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=_o)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=_o)},persist:function(){},isPersistent:_o}),t}var er={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tl=Qe(er),to=le({},er,{view:0,detail:0}),Lf=Qe(to),la,sa,wr,vi=le({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pl,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==wr&&(wr&&e.type==="mousemove"?(la=e.screenX-wr.screenX,sa=e.screenY-wr.screenY):sa=la=0,wr=e),la)},movementY:function(e){return"movementY"in e?e.movementY:sa}}),au=Qe(vi),Of=le({},vi,{dataTransfer:0}),zf=Qe(Of),Af=le({},to,{relatedTarget:0}),ua=Qe(Af),Df=le({},er,{animationName:0,elapsedTime:0,pseudoElement:0}),jf=Qe(Df),Uf=le({},er,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Wf=Qe(Uf),Hf=le({},er,{data:0}),lu=Qe(Hf),Bf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gf={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},$f={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$f[e])?!!t[e]:!1}function Pl(){return Vf}var Kf=le({},to,{key:function(e){if(e.key){var t=Bf[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Do(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pl,charCode:function(e){return e.type==="keypress"?Do(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Do(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Yf=Qe(Kf),Qf=le({},vi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),su=Qe(Qf),Jf=le({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pl}),Xf=Qe(Jf),qf=le({},er,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zf=Qe(qf),eg=le({},vi,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),tg=Qe(eg),ng=[9,13,27,32],Fl=Rt&&"CompositionEvent"in window,Fr=null;Rt&&"documentMode"in document&&(Fr=document.documentMode);var rg=Rt&&"TextEvent"in window&&!Fr,Mc=Rt&&(!Fl||Fr&&8<Fr&&11>=Fr),uu=String.fromCharCode(32),cu=!1;function Rc(e,t){switch(e){case"keyup":return ng.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ic(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mn=!1;function og(e,t){switch(e){case"compositionend":return Ic(t);case"keypress":return t.which!==32?null:(cu=!0,uu);case"textInput":return e=t.data,e===uu&&cu?null:e;default:return null}}function ig(e,t){if(Mn)return e==="compositionend"||!Fl&&Rc(e,t)?(e=Fc(),Ao=El=Bt=null,Mn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Mc&&t.locale!=="ko"?null:t.data;default:return null}}var ag={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function du(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ag[e.type]:t==="textarea"}function Lc(e,t,n,r){dc(r),t=Zo(t,"onChange"),0<t.length&&(n=new Tl("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mr=null,Br=null;function lg(e){$c(e,0)}function yi(e){var t=Ln(e);if(oc(t))return e}function sg(e,t){if(e==="change")return t}var Oc=!1;Rt&&(Rt?(Co="oninput"in document,Co||(ca=document.createElement("div"),ca.setAttribute("oninput","return;"),Co=typeof ca.oninput=="function"),So=Co):So=!1,Oc=So&&(!document.documentMode||9<document.documentMode));var So,Co,ca;function pu(){Mr&&(Mr.detachEvent("onpropertychange",zc),Br=Mr=null)}function zc(e){if(e.propertyName==="value"&&yi(Br)){var t=[];Lc(t,Br,e,bl(e)),hc(lg,t)}}function ug(e,t,n){e==="focusin"?(pu(),Mr=t,Br=n,Mr.attachEvent("onpropertychange",zc)):e==="focusout"&&pu()}function cg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yi(Br)}function dg(e,t){if(e==="click")return yi(t)}function pg(e,t){if(e==="input"||e==="change")return yi(t)}function fg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mt=typeof Object.is=="function"?Object.is:fg;function Gr(e,t){if(mt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Sa.call(t,o)||!mt(e[o],t[o]))return!1}return!0}function fu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gu(e,t){var n=fu(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fu(n)}}function Ac(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ac(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dc(){for(var e=window,t=Vo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vo(e.document)}return t}function Ml(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function gg(e){var t=Dc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ac(n.ownerDocument.documentElement,n)){if(r!==null&&Ml(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=gu(n,i);var a=gu(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var hg=Rt&&"documentMode"in document&&11>=document.documentMode,Rn=null,Ba=null,Rr=null,Ga=!1;function hu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ga||Rn==null||Rn!==Vo(r)||(r=Rn,"selectionStart"in r&&Ml(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Rr&&Gr(Rr,r)||(Rr=r,r=Zo(Ba,"onSelect"),0<r.length&&(t=new Tl("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Rn)))}function No(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var In={animationend:No("Animation","AnimationEnd"),animationiteration:No("Animation","AnimationIteration"),animationstart:No("Animation","AnimationStart"),transitionend:No("Transition","TransitionEnd")},da={},jc={};Rt&&(jc=document.createElement("div").style,"AnimationEvent"in window||(delete In.animationend.animation,delete In.animationiteration.animation,delete In.animationstart.animation),"TransitionEvent"in window||delete In.transitionend.transition);function wi(e){if(da[e])return da[e];if(!In[e])return e;var t=In[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in jc)return da[e]=t[n];return e}var Uc=wi("animationend"),Wc=wi("animationiteration"),Hc=wi("animationstart"),Bc=wi("transitionend"),Gc=new Map,mu="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function tn(e,t){Gc.set(e,t),yn(t,[e])}for(Eo=0;Eo<mu.length;Eo++)To=mu[Eo],vu=To.toLowerCase(),yu=To[0].toUpperCase()+To.slice(1),tn(vu,"on"+yu);var To,vu,yu,Eo;tn(Uc,"onAnimationEnd");tn(Wc,"onAnimationIteration");tn(Hc,"onAnimationStart");tn("dblclick","onDoubleClick");tn("focusin","onFocus");tn("focusout","onBlur");tn(Bc,"onTransitionEnd");Kn("onMouseEnter",["mouseout","mouseover"]);Kn("onMouseLeave",["mouseout","mouseover"]);Kn("onPointerEnter",["pointerout","pointerover"]);Kn("onPointerLeave",["pointerout","pointerover"]);yn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));yn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));yn("onBeforeInput",["compositionend","keypress","textInput","paste"]);yn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));yn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));yn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Er="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mg=new Set("cancel close invalid load scroll toggle".split(" ").concat(Er));function wu(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,mf(r,t,void 0,e),e.currentTarget=null}function $c(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var u=r[a],s=u.instance,c=u.currentTarget;if(u=u.listener,s!==i&&o.isPropagationStopped())break e;wu(o,u,c),i=s}else for(a=0;a<r.length;a++){if(u=r[a],s=u.instance,c=u.currentTarget,u=u.listener,s!==i&&o.isPropagationStopped())break e;wu(o,u,c),i=s}}}if(Yo)throw e=ja,Yo=!1,ja=null,e}function ee(e,t){var n=t[Qa];n===void 0&&(n=t[Qa]=new Set);var r=e+"__bubble";n.has(r)||(Vc(t,e,2,!1),n.add(r))}function pa(e,t,n){var r=0;t&&(r|=4),Vc(n,e,r,t)}var Po="_reactListening"+Math.random().toString(36).slice(2);function $r(e){if(!e[Po]){e[Po]=!0,Zu.forEach(function(n){n!=="selectionchange"&&(mg.has(n)||pa(n,!1,e),pa(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Po]||(t[Po]=!0,pa("selectionchange",!1,t))}}function Vc(e,t,n,r){switch(Pc(t)){case 1:var o=Rf;break;case 4:o=If;break;default:o=Nl}n=o.bind(null,t,n,e),o=void 0,!Da||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function fa(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var u=r.stateNode.containerInfo;if(u===o||u.nodeType===8&&u.parentNode===o)break;if(a===4)for(a=r.return;a!==null;){var s=a.tag;if((s===3||s===4)&&(s=a.stateNode.containerInfo,s===o||s.nodeType===8&&s.parentNode===o))return;a=a.return}for(;u!==null;){if(a=sn(u),a===null)return;if(s=a.tag,s===5||s===6){r=i=a;continue e}u=u.parentNode}}r=r.return}hc(function(){var c=i,d=bl(n),p=[];e:{var m=Gc.get(e);if(m!==void 0){var y=Tl,w=e;switch(e){case"keypress":if(Do(n)===0)break e;case"keydown":case"keyup":y=Yf;break;case"focusin":w="focus",y=ua;break;case"focusout":w="blur",y=ua;break;case"beforeblur":case"afterblur":y=ua;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=au;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=zf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=Xf;break;case Uc:case Wc:case Hc:y=jf;break;case Bc:y=Zf;break;case"scroll":y=Lf;break;case"wheel":y=tg;break;case"copy":case"cut":case"paste":y=Wf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=su}var S=(t&4)!==0,H=!S&&e==="scroll",g=S?m!==null?m+"Capture":null:m;S=[];for(var f=c,h;f!==null;){h=f;var x=h.stateNode;if(h.tag===5&&x!==null&&(h=x,g!==null&&(x=jr(f,g),x!=null&&S.push(Vr(f,x,h)))),H)break;f=f.return}0<S.length&&(m=new y(m,w,null,n,d),p.push({event:m,listeners:S}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",m&&n!==za&&(w=n.relatedTarget||n.fromElement)&&(sn(w)||w[It]))break e;if((y||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,y?(w=n.relatedTarget||n.toElement,y=c,w=w?sn(w):null,w!==null&&(H=wn(w),w!==H||w.tag!==5&&w.tag!==6)&&(w=null)):(y=null,w=c),y!==w)){if(S=au,x="onMouseLeave",g="onMouseEnter",f="mouse",(e==="pointerout"||e==="pointerover")&&(S=su,x="onPointerLeave",g="onPointerEnter",f="pointer"),H=y==null?m:Ln(y),h=w==null?m:Ln(w),m=new S(x,f+"leave",y,n,d),m.target=H,m.relatedTarget=h,x=null,sn(d)===c&&(S=new S(g,f+"enter",w,n,d),S.target=h,S.relatedTarget=H,x=S),H=x,y&&w)t:{for(S=y,g=w,f=0,h=S;h;h=Tn(h))f++;for(h=0,x=g;x;x=Tn(x))h++;for(;0<f-h;)S=Tn(S),f--;for(;0<h-f;)g=Tn(g),h--;for(;f--;){if(S===g||g!==null&&S===g.alternate)break t;S=Tn(S),g=Tn(g)}S=null}else S=null;y!==null&&xu(p,m,y,S,!1),w!==null&&H!==null&&xu(p,H,w,S,!0)}}e:{if(m=c?Ln(c):window,y=m.nodeName&&m.nodeName.toLowerCase(),y==="select"||y==="input"&&m.type==="file")var C=sg;else if(du(m))if(Oc)C=pg;else{C=cg;var P=ug}else(y=m.nodeName)&&y.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(C=dg);if(C&&(C=C(e,c))){Lc(p,C,n,d);break e}P&&P(e,m,c),e==="focusout"&&(P=m._wrapperState)&&P.controlled&&m.type==="number"&&Ma(m,"number",m.value)}switch(P=c?Ln(c):window,e){case"focusin":(du(P)||P.contentEditable==="true")&&(Rn=P,Ba=c,Rr=null);break;case"focusout":Rr=Ba=Rn=null;break;case"mousedown":Ga=!0;break;case"contextmenu":case"mouseup":case"dragend":Ga=!1,hu(p,n,d);break;case"selectionchange":if(hg)break;case"keydown":case"keyup":hu(p,n,d)}var M;if(Fl)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Mn?Rc(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(Mc&&n.locale!=="ko"&&(Mn||E!=="onCompositionStart"?E==="onCompositionEnd"&&Mn&&(M=Fc()):(Bt=d,El="value"in Bt?Bt.value:Bt.textContent,Mn=!0)),P=Zo(c,E),0<P.length&&(E=new lu(E,e,null,n,d),p.push({event:E,listeners:P}),M?E.data=M:(M=Ic(n),M!==null&&(E.data=M)))),(M=rg?og(e,n):ig(e,n))&&(c=Zo(c,"onBeforeInput"),0<c.length&&(d=new lu("onBeforeInput","beforeinput",null,n,d),p.push({event:d,listeners:c}),d.data=M))}$c(p,t)})}function Vr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zo(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=jr(e,n),i!=null&&r.unshift(Vr(e,i,o)),i=jr(e,t),i!=null&&r.push(Vr(e,i,o))),e=e.return}return r}function Tn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function xu(e,t,n,r,o){for(var i=t._reactName,a=[];n!==null&&n!==r;){var u=n,s=u.alternate,c=u.stateNode;if(s!==null&&s===r)break;u.tag===5&&c!==null&&(u=c,o?(s=jr(n,i),s!=null&&a.unshift(Vr(n,s,u))):o||(s=jr(n,i),s!=null&&a.push(Vr(n,s,u)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var vg=/\r\n?/g,yg=/\u0000|\uFFFD/g;function ku(e){return(typeof e=="string"?e:""+e).replace(vg,`
6
+ `).replace(yg,"")}function Fo(e,t,n){if(t=ku(t),ku(e)!==t&&n)throw Error(b(425))}function ei(){}var $a=null,Va=null;function Ka(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ya=typeof setTimeout=="function"?setTimeout:void 0,wg=typeof clearTimeout=="function"?clearTimeout:void 0,bu=typeof Promise=="function"?Promise:void 0,xg=typeof queueMicrotask=="function"?queueMicrotask:typeof bu<"u"?function(e){return bu.resolve(null).then(e).catch(kg)}:Ya;function kg(e){setTimeout(function(){throw e})}function ga(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Hr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Hr(t)}function Yt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function _u(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var tr=Math.random().toString(36).slice(2),kt="__reactFiber$"+tr,Kr="__reactProps$"+tr,It="__reactContainer$"+tr,Qa="__reactEvents$"+tr,bg="__reactListeners$"+tr,_g="__reactHandles$"+tr;function sn(e){var t=e[kt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[It]||n[kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_u(e);e!==null;){if(n=e[kt])return n;e=_u(e)}return t}e=n,n=e.parentNode}return null}function no(e){return e=e[kt]||e[It],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ln(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(b(33))}function xi(e){return e[Kr]||null}var Ja=[],On=-1;function nn(e){return{current:e}}function te(e){0>On||(e.current=Ja[On],Ja[On]=null,On--)}function X(e,t){On++,Ja[On]=e.current,e.current=t}var en={},Fe=nn(en),Ue=nn(!1),fn=en;function Yn(e,t){var n=e.type.contextTypes;if(!n)return en;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function We(e){return e=e.childContextTypes,e!=null}function ti(){te(Ue),te(Fe)}function Su(e,t,n){if(Fe.current!==en)throw Error(b(168));X(Fe,t),X(Ue,n)}function Kc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(b(108,uf(e)||"Unknown",o));return le({},n,r)}function ni(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||en,fn=Fe.current,X(Fe,e),X(Ue,Ue.current),!0}function Cu(e,t,n){var r=e.stateNode;if(!r)throw Error(b(169));n?(e=Kc(e,t,fn),r.__reactInternalMemoizedMergedChildContext=e,te(Ue),te(Fe),X(Fe,e)):te(Ue),X(Ue,n)}var Tt=null,ki=!1,ha=!1;function Yc(e){Tt===null?Tt=[e]:Tt.push(e)}function Sg(e){ki=!0,Yc(e)}function rn(){if(!ha&&Tt!==null){ha=!0;var e=0,t=Q;try{var n=Tt;for(Q=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Tt=null,ki=!1}catch(o){throw Tt!==null&&(Tt=Tt.slice(e+1)),wc(_l,rn),o}finally{Q=t,ha=!1}}return null}var zn=[],An=0,ri=null,oi=0,et=[],tt=0,gn=null,Pt=1,Ft="";function an(e,t){zn[An++]=oi,zn[An++]=ri,ri=e,oi=t}function Qc(e,t,n){et[tt++]=Pt,et[tt++]=Ft,et[tt++]=gn,gn=e;var r=Pt;e=Ft;var o=32-gt(r)-1;r&=~(1<<o),n+=1;var i=32-gt(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Pt=1<<32-gt(t)+o|n<<o|r,Ft=i+e}else Pt=1<<i|n<<o|r,Ft=e}function Rl(e){e.return!==null&&(an(e,1),Qc(e,1,0))}function Il(e){for(;e===ri;)ri=zn[--An],zn[An]=null,oi=zn[--An],zn[An]=null;for(;e===gn;)gn=et[--tt],et[tt]=null,Ft=et[--tt],et[tt]=null,Pt=et[--tt],et[tt]=null}var Ke=null,Ve=null,re=!1,ft=null;function Jc(e,t){var n=nt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Nu(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ke=e,Ve=Yt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ke=e,Ve=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=gn!==null?{id:Pt,overflow:Ft}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=nt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ke=e,Ve=null,!0):!1;default:return!1}}function Xa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function qa(e){if(re){var t=Ve;if(t){var n=t;if(!Nu(e,t)){if(Xa(e))throw Error(b(418));t=Yt(n.nextSibling);var r=Ke;t&&Nu(e,t)?Jc(r,n):(e.flags=e.flags&-4097|2,re=!1,Ke=e)}}else{if(Xa(e))throw Error(b(418));e.flags=e.flags&-4097|2,re=!1,Ke=e}}}function Eu(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ke=e}function Mo(e){if(e!==Ke)return!1;if(!re)return Eu(e),re=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ka(e.type,e.memoizedProps)),t&&(t=Ve)){if(Xa(e))throw Xc(),Error(b(418));for(;t;)Jc(e,t),t=Yt(t.nextSibling)}if(Eu(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(b(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ve=Yt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ve=null}}else Ve=Ke?Yt(e.stateNode.nextSibling):null;return!0}function Xc(){for(var e=Ve;e;)e=Yt(e.nextSibling)}function Qn(){Ve=Ke=null,re=!1}function Ll(e){ft===null?ft=[e]:ft.push(e)}var Cg=zt.ReactCurrentBatchConfig;function xr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(b(309));var r=n.stateNode}if(!r)throw Error(b(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var u=o.refs;a===null?delete u[i]:u[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(b(284));if(!n._owner)throw Error(b(290,e))}return e}function Ro(e,t){throw e=Object.prototype.toString.call(t),Error(b(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Tu(e){var t=e._init;return t(e._payload)}function qc(e){function t(g,f){if(e){var h=g.deletions;h===null?(g.deletions=[f],g.flags|=16):h.push(f)}}function n(g,f){if(!e)return null;for(;f!==null;)t(g,f),f=f.sibling;return null}function r(g,f){for(g=new Map;f!==null;)f.key!==null?g.set(f.key,f):g.set(f.index,f),f=f.sibling;return g}function o(g,f){return g=qt(g,f),g.index=0,g.sibling=null,g}function i(g,f,h){return g.index=h,e?(h=g.alternate,h!==null?(h=h.index,h<f?(g.flags|=2,f):h):(g.flags|=2,f)):(g.flags|=1048576,f)}function a(g){return e&&g.alternate===null&&(g.flags|=2),g}function u(g,f,h,x){return f===null||f.tag!==6?(f=ba(h,g.mode,x),f.return=g,f):(f=o(f,h),f.return=g,f)}function s(g,f,h,x){var C=h.type;return C===Fn?d(g,f,h.props.children,x,h.key):f!==null&&(f.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===jt&&Tu(C)===f.type)?(x=o(f,h.props),x.ref=xr(g,f,h),x.return=g,x):(x=$o(h.type,h.key,h.props,null,g.mode,x),x.ref=xr(g,f,h),x.return=g,x)}function c(g,f,h,x){return f===null||f.tag!==4||f.stateNode.containerInfo!==h.containerInfo||f.stateNode.implementation!==h.implementation?(f=_a(h,g.mode,x),f.return=g,f):(f=o(f,h.children||[]),f.return=g,f)}function d(g,f,h,x,C){return f===null||f.tag!==7?(f=pn(h,g.mode,x,C),f.return=g,f):(f=o(f,h),f.return=g,f)}function p(g,f,h){if(typeof f=="string"&&f!==""||typeof f=="number")return f=ba(""+f,g.mode,h),f.return=g,f;if(typeof f=="object"&&f!==null){switch(f.$$typeof){case vo:return h=$o(f.type,f.key,f.props,null,g.mode,h),h.ref=xr(g,null,f),h.return=g,h;case Pn:return f=_a(f,g.mode,h),f.return=g,f;case jt:var x=f._init;return p(g,x(f._payload),h)}if(Cr(f)||mr(f))return f=pn(f,g.mode,h,null),f.return=g,f;Ro(g,f)}return null}function m(g,f,h,x){var C=f!==null?f.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return C!==null?null:u(g,f,""+h,x);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case vo:return h.key===C?s(g,f,h,x):null;case Pn:return h.key===C?c(g,f,h,x):null;case jt:return C=h._init,m(g,f,C(h._payload),x)}if(Cr(h)||mr(h))return C!==null?null:d(g,f,h,x,null);Ro(g,h)}return null}function y(g,f,h,x,C){if(typeof x=="string"&&x!==""||typeof x=="number")return g=g.get(h)||null,u(f,g,""+x,C);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case vo:return g=g.get(x.key===null?h:x.key)||null,s(f,g,x,C);case Pn:return g=g.get(x.key===null?h:x.key)||null,c(f,g,x,C);case jt:var P=x._init;return y(g,f,h,P(x._payload),C)}if(Cr(x)||mr(x))return g=g.get(h)||null,d(f,g,x,C,null);Ro(f,x)}return null}function w(g,f,h,x){for(var C=null,P=null,M=f,E=f=0,K=null;M!==null&&E<h.length;E++){M.index>E?(K=M,M=null):K=M.sibling;var W=m(g,M,h[E],x);if(W===null){M===null&&(M=K);break}e&&M&&W.alternate===null&&t(g,M),f=i(W,f,E),P===null?C=W:P.sibling=W,P=W,M=K}if(E===h.length)return n(g,M),re&&an(g,E),C;if(M===null){for(;E<h.length;E++)M=p(g,h[E],x),M!==null&&(f=i(M,f,E),P===null?C=M:P.sibling=M,P=M);return re&&an(g,E),C}for(M=r(g,M);E<h.length;E++)K=y(M,g,E,h[E],x),K!==null&&(e&&K.alternate!==null&&M.delete(K.key===null?E:K.key),f=i(K,f,E),P===null?C=K:P.sibling=K,P=K);return e&&M.forEach(function(ve){return t(g,ve)}),re&&an(g,E),C}function S(g,f,h,x){var C=mr(h);if(typeof C!="function")throw Error(b(150));if(h=C.call(h),h==null)throw Error(b(151));for(var P=C=null,M=f,E=f=0,K=null,W=h.next();M!==null&&!W.done;E++,W=h.next()){M.index>E?(K=M,M=null):K=M.sibling;var ve=m(g,M,W.value,x);if(ve===null){M===null&&(M=K);break}e&&M&&ve.alternate===null&&t(g,M),f=i(ve,f,E),P===null?C=ve:P.sibling=ve,P=ve,M=K}if(W.done)return n(g,M),re&&an(g,E),C;if(M===null){for(;!W.done;E++,W=h.next())W=p(g,W.value,x),W!==null&&(f=i(W,f,E),P===null?C=W:P.sibling=W,P=W);return re&&an(g,E),C}for(M=r(g,M);!W.done;E++,W=h.next())W=y(M,g,E,W.value,x),W!==null&&(e&&W.alternate!==null&&M.delete(W.key===null?E:W.key),f=i(W,f,E),P===null?C=W:P.sibling=W,P=W);return e&&M.forEach(function(ir){return t(g,ir)}),re&&an(g,E),C}function H(g,f,h,x){if(typeof h=="object"&&h!==null&&h.type===Fn&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case vo:e:{for(var C=h.key,P=f;P!==null;){if(P.key===C){if(C=h.type,C===Fn){if(P.tag===7){n(g,P.sibling),f=o(P,h.props.children),f.return=g,g=f;break e}}else if(P.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===jt&&Tu(C)===P.type){n(g,P.sibling),f=o(P,h.props),f.ref=xr(g,P,h),f.return=g,g=f;break e}n(g,P);break}else t(g,P);P=P.sibling}h.type===Fn?(f=pn(h.props.children,g.mode,x,h.key),f.return=g,g=f):(x=$o(h.type,h.key,h.props,null,g.mode,x),x.ref=xr(g,f,h),x.return=g,g=x)}return a(g);case Pn:e:{for(P=h.key;f!==null;){if(f.key===P)if(f.tag===4&&f.stateNode.containerInfo===h.containerInfo&&f.stateNode.implementation===h.implementation){n(g,f.sibling),f=o(f,h.children||[]),f.return=g,g=f;break e}else{n(g,f);break}else t(g,f);f=f.sibling}f=_a(h,g.mode,x),f.return=g,g=f}return a(g);case jt:return P=h._init,H(g,f,P(h._payload),x)}if(Cr(h))return w(g,f,h,x);if(mr(h))return S(g,f,h,x);Ro(g,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,f!==null&&f.tag===6?(n(g,f.sibling),f=o(f,h),f.return=g,g=f):(n(g,f),f=ba(h,g.mode,x),f.return=g,g=f),a(g)):n(g,f)}return H}var Jn=qc(!0),Zc=qc(!1),ii=nn(null),ai=null,Dn=null,Ol=null;function zl(){Ol=Dn=ai=null}function Al(e){var t=ii.current;te(ii),e._currentValue=t}function Za(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function $n(e,t){ai=e,Ol=Dn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(je=!0),e.firstContext=null)}function ot(e){var t=e._currentValue;if(Ol!==e)if(e={context:e,memoizedValue:t,next:null},Dn===null){if(ai===null)throw Error(b(308));Dn=e,ai.dependencies={lanes:0,firstContext:e}}else Dn=Dn.next=e;return t}var un=null;function Dl(e){un===null?un=[e]:un.push(e)}function ed(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Dl(t)):(n.next=o.next,o.next=n),t.interleaved=n,Lt(e,r)}function Lt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ut=!1;function jl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function td(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Mt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Lt(e,n)}return o=r.interleaved,o===null?(t.next=t,Dl(r)):(t.next=o.next,o.next=t),r.interleaved=t,Lt(e,n)}function jo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Sl(e,n)}}function Pu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function li(e,t,n,r){var o=e.updateQueue;Ut=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,u=o.shared.pending;if(u!==null){o.shared.pending=null;var s=u,c=s.next;s.next=null,a===null?i=c:a.next=c,a=s;var d=e.alternate;d!==null&&(d=d.updateQueue,u=d.lastBaseUpdate,u!==a&&(u===null?d.firstBaseUpdate=c:u.next=c,d.lastBaseUpdate=s))}if(i!==null){var p=o.baseState;a=0,d=c=s=null,u=i;do{var m=u.lane,y=u.eventTime;if((r&m)===m){d!==null&&(d=d.next={eventTime:y,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var w=e,S=u;switch(m=t,y=n,S.tag){case 1:if(w=S.payload,typeof w=="function"){p=w.call(y,p,m);break e}p=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=S.payload,m=typeof w=="function"?w.call(y,p,m):w,m==null)break e;p=le({},p,m);break e;case 2:Ut=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,m=o.effects,m===null?o.effects=[u]:m.push(u))}else y={eventTime:y,lane:m,tag:u.tag,payload:u.payload,callback:u.callback,next:null},d===null?(c=d=y,s=p):d=d.next=y,a|=m;if(u=u.next,u===null){if(u=o.shared.pending,u===null)break;m=u,u=m.next,m.next=null,o.lastBaseUpdate=m,o.shared.pending=null}}while(1);if(d===null&&(s=p),o.baseState=s,o.firstBaseUpdate=c,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);mn|=a,e.lanes=a,e.memoizedState=p}}function Fu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(b(191,o));o.call(r)}}}var ro={},_t=nn(ro),Yr=nn(ro),Qr=nn(ro);function cn(e){if(e===ro)throw Error(b(174));return e}function Ul(e,t){switch(X(Qr,t),X(Yr,e),X(_t,ro),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ia(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ia(t,e)}te(_t),X(_t,t)}function Xn(){te(_t),te(Yr),te(Qr)}function nd(e){cn(Qr.current);var t=cn(_t.current),n=Ia(t,e.type);t!==n&&(X(Yr,e),X(_t,n))}function Wl(e){Yr.current===e&&(te(_t),te(Yr))}var ie=nn(0);function si(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ma=[];function Hl(){for(var e=0;e<ma.length;e++)ma[e]._workInProgressVersionPrimary=null;ma.length=0}var Uo=zt.ReactCurrentDispatcher,va=zt.ReactCurrentBatchConfig,hn=0,ae=null,fe=null,he=null,ui=!1,Ir=!1,Jr=0,Ng=0;function Ee(){throw Error(b(321))}function Bl(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mt(e[n],t[n]))return!1;return!0}function Gl(e,t,n,r,o,i){if(hn=i,ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Uo.current=e===null||e.memoizedState===null?Fg:Mg,e=n(r,o),Ir){i=0;do{if(Ir=!1,Jr=0,25<=i)throw Error(b(301));i+=1,he=fe=null,t.updateQueue=null,Uo.current=Rg,e=n(r,o)}while(Ir)}if(Uo.current=ci,t=fe!==null&&fe.next!==null,hn=0,he=fe=ae=null,ui=!1,t)throw Error(b(300));return e}function $l(){var e=Jr!==0;return Jr=0,e}function xt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return he===null?ae.memoizedState=he=e:he=he.next=e,he}function it(){if(fe===null){var e=ae.alternate;e=e!==null?e.memoizedState:null}else e=fe.next;var t=he===null?ae.memoizedState:he.next;if(t!==null)he=t,fe=e;else{if(e===null)throw Error(b(310));fe=e,e={memoizedState:fe.memoizedState,baseState:fe.baseState,baseQueue:fe.baseQueue,queue:fe.queue,next:null},he===null?ae.memoizedState=he=e:he=he.next=e}return he}function Xr(e,t){return typeof t=="function"?t(e):t}function ya(e){var t=it(),n=t.queue;if(n===null)throw Error(b(311));n.lastRenderedReducer=e;var r=fe,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var u=a=null,s=null,c=i;do{var d=c.lane;if((hn&d)===d)s!==null&&(s=s.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var p={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};s===null?(u=s=p,a=r):s=s.next=p,ae.lanes|=d,mn|=d}c=c.next}while(c!==null&&c!==i);s===null?a=r:s.next=u,mt(r,t.memoizedState)||(je=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=s,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,ae.lanes|=i,mn|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function wa(e){var t=it(),n=t.queue;if(n===null)throw Error(b(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);mt(i,t.memoizedState)||(je=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function rd(){}function od(e,t){var n=ae,r=it(),o=t(),i=!mt(r.memoizedState,o);if(i&&(r.memoizedState=o,je=!0),r=r.queue,Vl(ld.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||he!==null&&he.memoizedState.tag&1){if(n.flags|=2048,qr(9,ad.bind(null,n,r,o,t),void 0,null),me===null)throw Error(b(349));hn&30||id(n,t,o)}return o}function id(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ae.updateQueue,t===null?(t={lastEffect:null,stores:null},ae.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ad(e,t,n,r){t.value=n,t.getSnapshot=r,sd(t)&&ud(e)}function ld(e,t,n){return n(function(){sd(t)&&ud(e)})}function sd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mt(e,n)}catch{return!0}}function ud(e){var t=Lt(e,1);t!==null&&ht(t,e,1,-1)}function Mu(e){var t=xt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Xr,lastRenderedState:e},t.queue=e,e=e.dispatch=Pg.bind(null,ae,e),[t.memoizedState,e]}function qr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ae.updateQueue,t===null?(t={lastEffect:null,stores:null},ae.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function cd(){return it().memoizedState}function Wo(e,t,n,r){var o=xt();ae.flags|=e,o.memoizedState=qr(1|t,n,void 0,r===void 0?null:r)}function bi(e,t,n,r){var o=it();r=r===void 0?null:r;var i=void 0;if(fe!==null){var a=fe.memoizedState;if(i=a.destroy,r!==null&&Bl(r,a.deps)){o.memoizedState=qr(t,n,i,r);return}}ae.flags|=e,o.memoizedState=qr(1|t,n,i,r)}function Ru(e,t){return Wo(8390656,8,e,t)}function Vl(e,t){return bi(2048,8,e,t)}function dd(e,t){return bi(4,2,e,t)}function pd(e,t){return bi(4,4,e,t)}function fd(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gd(e,t,n){return n=n!=null?n.concat([e]):null,bi(4,4,fd.bind(null,t,e),n)}function Kl(){}function hd(e,t){var n=it();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bl(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function md(e,t){var n=it();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bl(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function vd(e,t,n){return hn&21?(mt(n,t)||(n=bc(),ae.lanes|=n,mn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,je=!0),e.memoizedState=n)}function Eg(e,t){var n=Q;Q=n!==0&&4>n?n:4,e(!0);var r=va.transition;va.transition={};try{e(!1),t()}finally{Q=n,va.transition=r}}function yd(){return it().memoizedState}function Tg(e,t,n){var r=Xt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},wd(e))xd(t,n);else if(n=ed(e,t,n,r),n!==null){var o=Le();ht(n,e,r,o),kd(n,t,r)}}function Pg(e,t,n){var r=Xt(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(wd(e))xd(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,u=i(a,n);if(o.hasEagerState=!0,o.eagerState=u,mt(u,a)){var s=t.interleaved;s===null?(o.next=o,Dl(t)):(o.next=s.next,s.next=o),t.interleaved=o;return}}catch{}finally{}n=ed(e,t,o,r),n!==null&&(o=Le(),ht(n,e,r,o),kd(n,t,r))}}function wd(e){var t=e.alternate;return e===ae||t!==null&&t===ae}function xd(e,t){Ir=ui=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function kd(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Sl(e,n)}}var ci={readContext:ot,useCallback:Ee,useContext:Ee,useEffect:Ee,useImperativeHandle:Ee,useInsertionEffect:Ee,useLayoutEffect:Ee,useMemo:Ee,useReducer:Ee,useRef:Ee,useState:Ee,useDebugValue:Ee,useDeferredValue:Ee,useTransition:Ee,useMutableSource:Ee,useSyncExternalStore:Ee,useId:Ee,unstable_isNewReconciler:!1},Fg={readContext:ot,useCallback:function(e,t){return xt().memoizedState=[e,t===void 0?null:t],e},useContext:ot,useEffect:Ru,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Wo(4194308,4,fd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Wo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Wo(4,2,e,t)},useMemo:function(e,t){var n=xt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=xt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Tg.bind(null,ae,e),[r.memoizedState,e]},useRef:function(e){var t=xt();return e={current:e},t.memoizedState=e},useState:Mu,useDebugValue:Kl,useDeferredValue:function(e){return xt().memoizedState=e},useTransition:function(){var e=Mu(!1),t=e[0];return e=Eg.bind(null,e[1]),xt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ae,o=xt();if(re){if(n===void 0)throw Error(b(407));n=n()}else{if(n=t(),me===null)throw Error(b(349));hn&30||id(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Ru(ld.bind(null,r,i,e),[e]),r.flags|=2048,qr(9,ad.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=xt(),t=me.identifierPrefix;if(re){var n=Ft,r=Pt;n=(r&~(1<<32-gt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Jr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Ng++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Mg={readContext:ot,useCallback:hd,useContext:ot,useEffect:Vl,useImperativeHandle:gd,useInsertionEffect:dd,useLayoutEffect:pd,useMemo:md,useReducer:ya,useRef:cd,useState:function(){return ya(Xr)},useDebugValue:Kl,useDeferredValue:function(e){var t=it();return vd(t,fe.memoizedState,e)},useTransition:function(){var e=ya(Xr)[0],t=it().memoizedState;return[e,t]},useMutableSource:rd,useSyncExternalStore:od,useId:yd,unstable_isNewReconciler:!1},Rg={readContext:ot,useCallback:hd,useContext:ot,useEffect:Vl,useImperativeHandle:gd,useInsertionEffect:dd,useLayoutEffect:pd,useMemo:md,useReducer:wa,useRef:cd,useState:function(){return wa(Xr)},useDebugValue:Kl,useDeferredValue:function(e){var t=it();return fe===null?t.memoizedState=e:vd(t,fe.memoizedState,e)},useTransition:function(){var e=wa(Xr)[0],t=it().memoizedState;return[e,t]},useMutableSource:rd,useSyncExternalStore:od,useId:yd,unstable_isNewReconciler:!1};function dt(e,t){if(e&&e.defaultProps){t=le({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function el(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:le({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _i={isMounted:function(e){return(e=e._reactInternals)?wn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Le(),o=Xt(e),i=Mt(r,o);i.payload=t,n!=null&&(i.callback=n),t=Qt(e,i,o),t!==null&&(ht(t,e,o,r),jo(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Le(),o=Xt(e),i=Mt(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Qt(e,i,o),t!==null&&(ht(t,e,o,r),jo(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Le(),r=Xt(e),o=Mt(n,r);o.tag=2,t!=null&&(o.callback=t),t=Qt(e,o,r),t!==null&&(ht(t,e,r,n),jo(t,e,r))}};function Iu(e,t,n,r,o,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,a):t.prototype&&t.prototype.isPureReactComponent?!Gr(n,r)||!Gr(o,i):!0}function bd(e,t,n){var r=!1,o=en,i=t.contextType;return typeof i=="object"&&i!==null?i=ot(i):(o=We(t)?fn:Fe.current,r=t.contextTypes,i=(r=r!=null)?Yn(e,o):en),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=_i,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Lu(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_i.enqueueReplaceState(t,t.state,null)}function tl(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},jl(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=ot(i):(i=We(t)?fn:Fe.current,o.context=Yn(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(el(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&_i.enqueueReplaceState(o,o.state,null),li(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function qn(e,t){try{var n="",r=t;do n+=sf(r),r=r.return;while(r);var o=n}catch(i){o=`
7
+ Error generating stack: `+i.message+`
8
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function xa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function nl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Ig=typeof WeakMap=="function"?WeakMap:Map;function _d(e,t,n){n=Mt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){pi||(pi=!0,pl=r),nl(e,t)},n}function Sd(e,t,n){n=Mt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){nl(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){nl(e,t),typeof r!="function"&&(Jt===null?Jt=new Set([this]):Jt.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function Ou(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ig;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Kg.bind(null,e,t,n),t.then(e,e))}function zu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Au(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Mt(-1,1),t.tag=2,Qt(n,t,1))),n.lanes|=1),e)}var Lg=zt.ReactCurrentOwner,je=!1;function Ie(e,t,n,r){t.child=e===null?Zc(t,null,n,r):Jn(t,e.child,n,r)}function Du(e,t,n,r,o){n=n.render;var i=t.ref;return $n(t,o),r=Gl(e,t,n,r,i,o),n=$l(),e!==null&&!je?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ot(e,t,o)):(re&&n&&Rl(t),t.flags|=1,Ie(e,t,r,o),t.child)}function ju(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!ts(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Cd(e,t,i,r,o)):(e=$o(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:Gr,n(a,r)&&e.ref===t.ref)return Ot(e,t,o)}return t.flags|=1,e=qt(i,r),e.ref=t.ref,e.return=t,t.child=e}function Cd(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Gr(i,r)&&e.ref===t.ref)if(je=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(je=!0);else return t.lanes=e.lanes,Ot(e,t,o)}return rl(e,t,n,r,o)}function Nd(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},X(Un,$e),$e|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,X(Un,$e),$e|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,X(Un,$e),$e|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,X(Un,$e),$e|=r;return Ie(e,t,o,n),t.child}function Ed(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function rl(e,t,n,r,o){var i=We(n)?fn:Fe.current;return i=Yn(t,i),$n(t,o),n=Gl(e,t,n,r,i,o),r=$l(),e!==null&&!je?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ot(e,t,o)):(re&&r&&Rl(t),t.flags|=1,Ie(e,t,n,o),t.child)}function Uu(e,t,n,r,o){if(We(n)){var i=!0;ni(t)}else i=!1;if($n(t,o),t.stateNode===null)Ho(e,t),bd(t,n,r),tl(t,n,r,o),r=!0;else if(e===null){var a=t.stateNode,u=t.memoizedProps;a.props=u;var s=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=ot(c):(c=We(n)?fn:Fe.current,c=Yn(t,c));var d=n.getDerivedStateFromProps,p=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";p||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u!==r||s!==c)&&Lu(t,a,r,c),Ut=!1;var m=t.memoizedState;a.state=m,li(t,r,a,o),s=t.memoizedState,u!==r||m!==s||Ue.current||Ut?(typeof d=="function"&&(el(t,n,d,r),s=t.memoizedState),(u=Ut||Iu(t,n,u,r,m,s,c))?(p||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),a.props=r,a.state=s,a.context=c,r=u):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,td(e,t),u=t.memoizedProps,c=t.type===t.elementType?u:dt(t.type,u),a.props=c,p=t.pendingProps,m=a.context,s=n.contextType,typeof s=="object"&&s!==null?s=ot(s):(s=We(n)?fn:Fe.current,s=Yn(t,s));var y=n.getDerivedStateFromProps;(d=typeof y=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u!==p||m!==s)&&Lu(t,a,r,s),Ut=!1,m=t.memoizedState,a.state=m,li(t,r,a,o);var w=t.memoizedState;u!==p||m!==w||Ue.current||Ut?(typeof y=="function"&&(el(t,n,y,r),w=t.memoizedState),(c=Ut||Iu(t,n,c,r,m,w,s)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,w,s),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,w,s)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||u===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=w),a.props=r,a.state=w,a.context=s,r=c):(typeof a.componentDidUpdate!="function"||u===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return ol(e,t,n,r,i,o)}function ol(e,t,n,r,o,i){Ed(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&Cu(t,n,!1),Ot(e,t,i);r=t.stateNode,Lg.current=t;var u=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Jn(t,e.child,null,i),t.child=Jn(t,null,u,i)):Ie(e,t,u,i),t.memoizedState=r.state,o&&Cu(t,n,!0),t.child}function Td(e){var t=e.stateNode;t.pendingContext?Su(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Su(e,t.context,!1),Ul(e,t.containerInfo)}function Wu(e,t,n,r,o){return Qn(),Ll(o),t.flags|=256,Ie(e,t,n,r),t.child}var il={dehydrated:null,treeContext:null,retryLane:0};function al(e){return{baseLanes:e,cachePool:null,transitions:null}}function Pd(e,t,n){var r=t.pendingProps,o=ie.current,i=!1,a=(t.flags&128)!==0,u;if((u=a)||(u=e!==null&&e.memoizedState===null?!1:(o&2)!==0),u?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),X(ie,o&1),e===null)return qa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Ni(a,r,0,null),e=pn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=al(n),t.memoizedState=il,e):Yl(t,a));if(o=e.memoizedState,o!==null&&(u=o.dehydrated,u!==null))return Og(e,t,a,r,u,o,n);if(i){i=r.fallback,a=t.mode,o=e.child,u=o.sibling;var s={mode:"hidden",children:r.children};return!(a&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=s,t.deletions=null):(r=qt(o,s),r.subtreeFlags=o.subtreeFlags&14680064),u!==null?i=qt(u,i):(i=pn(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?al(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=il,r}return i=e.child,e=i.sibling,r=qt(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Yl(e,t){return t=Ni({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Io(e,t,n,r){return r!==null&&Ll(r),Jn(t,e.child,null,n),e=Yl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Og(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=xa(Error(b(422))),Io(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Ni({mode:"visible",children:r.children},o,0,null),i=pn(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Jn(t,e.child,null,a),t.child.memoizedState=al(a),t.memoizedState=il,i);if(!(t.mode&1))return Io(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var u=r.dgst;return r=u,i=Error(b(419)),r=xa(i,r,void 0),Io(e,t,a,r)}if(u=(a&e.childLanes)!==0,je||u){if(r=me,r!==null){switch(a&-a){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|a)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Lt(e,o),ht(r,e,o,-1))}return es(),r=xa(Error(b(421))),Io(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Yg.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Ve=Yt(o.nextSibling),Ke=t,re=!0,ft=null,e!==null&&(et[tt++]=Pt,et[tt++]=Ft,et[tt++]=gn,Pt=e.id,Ft=e.overflow,gn=t),t=Yl(t,r.children),t.flags|=4096,t)}function Hu(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Za(e.return,t,n)}function ka(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Fd(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Ie(e,t,r.children,n),r=ie.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Hu(e,n,t);else if(e.tag===19)Hu(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(X(ie,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&si(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ka(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&si(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ka(t,!0,n,null,i);break;case"together":ka(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ho(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ot(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),mn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(b(153));if(t.child!==null){for(e=t.child,n=qt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=qt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function zg(e,t,n){switch(t.tag){case 3:Td(t),Qn();break;case 5:nd(t);break;case 1:We(t.type)&&ni(t);break;case 4:Ul(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;X(ii,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(X(ie,ie.current&1),t.flags|=128,null):n&t.child.childLanes?Pd(e,t,n):(X(ie,ie.current&1),e=Ot(e,t,n),e!==null?e.sibling:null);X(ie,ie.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Fd(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),X(ie,ie.current),r)break;return null;case 22:case 23:return t.lanes=0,Nd(e,t,n)}return Ot(e,t,n)}var Md,ll,Rd,Id;Md=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ll=function(){};Rd=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,cn(_t.current);var i=null;switch(n){case"input":o=Pa(e,o),r=Pa(e,r),i=[];break;case"select":o=le({},o,{value:void 0}),r=le({},r,{value:void 0}),i=[];break;case"textarea":o=Ra(e,o),r=Ra(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ei)}La(n,r);var a;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var u=o[c];for(a in u)u.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ar.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var s=r[c];if(u=o?.[c],r.hasOwnProperty(c)&&s!==u&&(s!=null||u!=null))if(c==="style")if(u){for(a in u)!u.hasOwnProperty(a)||s&&s.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in s)s.hasOwnProperty(a)&&u[a]!==s[a]&&(n||(n={}),n[a]=s[a])}else n||(i||(i=[]),i.push(c,n)),n=s;else c==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,u=u?u.__html:void 0,s!=null&&u!==s&&(i=i||[]).push(c,s)):c==="children"?typeof s!="string"&&typeof s!="number"||(i=i||[]).push(c,""+s):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ar.hasOwnProperty(c)?(s!=null&&c==="onScroll"&&ee("scroll",e),i||u===s||(i=[])):(i=i||[]).push(c,s))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};Id=function(e,t,n,r){n!==r&&(t.flags|=4)};function kr(e,t){if(!re)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Te(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ag(e,t,n){var r=t.pendingProps;switch(Il(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Te(t),null;case 1:return We(t.type)&&ti(),Te(t),null;case 3:return r=t.stateNode,Xn(),te(Ue),te(Fe),Hl(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Mo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ft!==null&&(hl(ft),ft=null))),ll(e,t),Te(t),null;case 5:Wl(t);var o=cn(Qr.current);if(n=t.type,e!==null&&t.stateNode!=null)Rd(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(b(166));return Te(t),null}if(e=cn(_t.current),Mo(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[kt]=t,r[Kr]=i,e=(t.mode&1)!==0,n){case"dialog":ee("cancel",r),ee("close",r);break;case"iframe":case"object":case"embed":ee("load",r);break;case"video":case"audio":for(o=0;o<Er.length;o++)ee(Er[o],r);break;case"source":ee("error",r);break;case"img":case"image":case"link":ee("error",r),ee("load",r);break;case"details":ee("toggle",r);break;case"input":Js(r,i),ee("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ee("invalid",r);break;case"textarea":qs(r,i),ee("invalid",r)}La(n,i),o=null;for(var a in i)if(i.hasOwnProperty(a)){var u=i[a];a==="children"?typeof u=="string"?r.textContent!==u&&(i.suppressHydrationWarning!==!0&&Fo(r.textContent,u,e),o=["children",u]):typeof u=="number"&&r.textContent!==""+u&&(i.suppressHydrationWarning!==!0&&Fo(r.textContent,u,e),o=["children",""+u]):Ar.hasOwnProperty(a)&&u!=null&&a==="onScroll"&&ee("scroll",r)}switch(n){case"input":yo(r),Xs(r,i,!0);break;case"textarea":yo(r),Zs(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ei)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=lc(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[kt]=t,e[Kr]=r,Md(e,t,!1,!1),t.stateNode=e;e:{switch(a=Oa(n,r),n){case"dialog":ee("cancel",e),ee("close",e),o=r;break;case"iframe":case"object":case"embed":ee("load",e),o=r;break;case"video":case"audio":for(o=0;o<Er.length;o++)ee(Er[o],e);o=r;break;case"source":ee("error",e),o=r;break;case"img":case"image":case"link":ee("error",e),ee("load",e),o=r;break;case"details":ee("toggle",e),o=r;break;case"input":Js(e,r),o=Pa(e,r),ee("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=le({},r,{value:void 0}),ee("invalid",e);break;case"textarea":qs(e,r),o=Ra(e,r),ee("invalid",e);break;default:o=r}La(n,o),u=o;for(i in u)if(u.hasOwnProperty(i)){var s=u[i];i==="style"?cc(e,s):i==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,s!=null&&sc(e,s)):i==="children"?typeof s=="string"?(n!=="textarea"||s!=="")&&Dr(e,s):typeof s=="number"&&Dr(e,""+s):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ar.hasOwnProperty(i)?s!=null&&i==="onScroll"&&ee("scroll",e):s!=null&&yl(e,i,s,a))}switch(n){case"input":yo(e),Xs(e,r,!1);break;case"textarea":yo(e),Zs(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Zt(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Wn(e,!!r.multiple,i,!1):r.defaultValue!=null&&Wn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=ei)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Te(t),null;case 6:if(e&&t.stateNode!=null)Id(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(b(166));if(n=cn(Qr.current),cn(_t.current),Mo(t)){if(r=t.stateNode,n=t.memoizedProps,r[kt]=t,(i=r.nodeValue!==n)&&(e=Ke,e!==null))switch(e.tag){case 3:Fo(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Fo(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[kt]=t,t.stateNode=r}return Te(t),null;case 13:if(te(ie),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(re&&Ve!==null&&t.mode&1&&!(t.flags&128))Xc(),Qn(),t.flags|=98560,i=!1;else if(i=Mo(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(b(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(b(317));i[kt]=t}else Qn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Te(t),i=!1}else ft!==null&&(hl(ft),ft=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ie.current&1?ge===0&&(ge=3):es())),t.updateQueue!==null&&(t.flags|=4),Te(t),null);case 4:return Xn(),ll(e,t),e===null&&$r(t.stateNode.containerInfo),Te(t),null;case 10:return Al(t.type._context),Te(t),null;case 17:return We(t.type)&&ti(),Te(t),null;case 19:if(te(ie),i=t.memoizedState,i===null)return Te(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)kr(i,!1);else{if(ge!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=si(e),a!==null){for(t.flags|=128,kr(i,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return X(ie,ie.current&1|2),t.child}e=e.sibling}i.tail!==null&&de()>Zn&&(t.flags|=128,r=!0,kr(i,!1),t.lanes=4194304)}else{if(!r)if(e=si(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),kr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!re)return Te(t),null}else 2*de()-i.renderingStartTime>Zn&&n!==1073741824&&(t.flags|=128,r=!0,kr(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=de(),t.sibling=null,n=ie.current,X(ie,r?n&1|2:n&1),t):(Te(t),null);case 22:case 23:return Zl(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?$e&1073741824&&(Te(t),t.subtreeFlags&6&&(t.flags|=8192)):Te(t),null;case 24:return null;case 25:return null}throw Error(b(156,t.tag))}function Dg(e,t){switch(Il(t),t.tag){case 1:return We(t.type)&&ti(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xn(),te(Ue),te(Fe),Hl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Wl(t),null;case 13:if(te(ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(b(340));Qn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return te(ie),null;case 4:return Xn(),null;case 10:return Al(t.type._context),null;case 22:case 23:return Zl(),null;case 24:return null;default:return null}}var Lo=!1,Pe=!1,jg=typeof WeakSet=="function"?WeakSet:Set,T=null;function jn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){se(e,t,r)}else n.current=null}function sl(e,t,n){try{n()}catch(r){se(e,t,r)}}var Bu=!1;function Ug(e,t){if($a=Xo,e=Dc(),Ml(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,u=-1,s=-1,c=0,d=0,p=e,m=null;t:for(;;){for(var y;p!==n||o!==0&&p.nodeType!==3||(u=a+o),p!==i||r!==0&&p.nodeType!==3||(s=a+r),p.nodeType===3&&(a+=p.nodeValue.length),(y=p.firstChild)!==null;)m=p,p=y;for(;;){if(p===e)break t;if(m===n&&++c===o&&(u=a),m===i&&++d===r&&(s=a),(y=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=y}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Va={focusedElem:e,selectionRange:n},Xo=!1,T=t;T!==null;)if(t=T,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,T=e;else for(;T!==null;){t=T;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var S=w.memoizedProps,H=w.memoizedState,g=t.stateNode,f=g.getSnapshotBeforeUpdate(t.elementType===t.type?S:dt(t.type,S),H);g.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(b(163))}}catch(x){se(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,T=e;break}T=t.return}return w=Bu,Bu=!1,w}function Lr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&sl(t,n,i)}o=o.next}while(o!==r)}}function Si(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ul(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ld(e){var t=e.alternate;t!==null&&(e.alternate=null,Ld(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[kt],delete t[Kr],delete t[Qa],delete t[bg],delete t[_g])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Od(e){return e.tag===5||e.tag===3||e.tag===4}function Gu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Od(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ei));else if(r!==4&&(e=e.child,e!==null))for(cl(e,t,n),e=e.sibling;e!==null;)cl(e,t,n),e=e.sibling}function dl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(dl(e,t,n),e=e.sibling;e!==null;)dl(e,t,n),e=e.sibling}var be=null,pt=!1;function Dt(e,t,n){for(n=n.child;n!==null;)zd(e,t,n),n=n.sibling}function zd(e,t,n){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(mi,n)}catch{}switch(n.tag){case 5:Pe||jn(n,t);case 6:var r=be,o=pt;be=null,Dt(e,t,n),be=r,pt=o,be!==null&&(pt?(e=be,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):be.removeChild(n.stateNode));break;case 18:be!==null&&(pt?(e=be,n=n.stateNode,e.nodeType===8?ga(e.parentNode,n):e.nodeType===1&&ga(e,n),Hr(e)):ga(be,n.stateNode));break;case 4:r=be,o=pt,be=n.stateNode.containerInfo,pt=!0,Dt(e,t,n),be=r,pt=o;break;case 0:case 11:case 14:case 15:if(!Pe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&sl(n,t,a),o=o.next}while(o!==r)}Dt(e,t,n);break;case 1:if(!Pe&&(jn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){se(n,t,u)}Dt(e,t,n);break;case 21:Dt(e,t,n);break;case 22:n.mode&1?(Pe=(r=Pe)||n.memoizedState!==null,Dt(e,t,n),Pe=r):Dt(e,t,n);break;default:Dt(e,t,n)}}function $u(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new jg),t.forEach(function(r){var o=Qg.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ct(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,a=t,u=a;e:for(;u!==null;){switch(u.tag){case 5:be=u.stateNode,pt=!1;break e;case 3:be=u.stateNode.containerInfo,pt=!0;break e;case 4:be=u.stateNode.containerInfo,pt=!0;break e}u=u.return}if(be===null)throw Error(b(160));zd(i,a,o),be=null,pt=!1;var s=o.alternate;s!==null&&(s.return=null),o.return=null}catch(c){se(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ad(t,e),t=t.sibling}function Ad(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ct(t,e),wt(e),r&4){try{Lr(3,e,e.return),Si(3,e)}catch(S){se(e,e.return,S)}try{Lr(5,e,e.return)}catch(S){se(e,e.return,S)}}break;case 1:ct(t,e),wt(e),r&512&&n!==null&&jn(n,n.return);break;case 5:if(ct(t,e),wt(e),r&512&&n!==null&&jn(n,n.return),e.flags&32){var o=e.stateNode;try{Dr(o,"")}catch(S){se(e,e.return,S)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,a=n!==null?n.memoizedProps:i,u=e.type,s=e.updateQueue;if(e.updateQueue=null,s!==null)try{u==="input"&&i.type==="radio"&&i.name!=null&&ic(o,i),Oa(u,a);var c=Oa(u,i);for(a=0;a<s.length;a+=2){var d=s[a],p=s[a+1];d==="style"?cc(o,p):d==="dangerouslySetInnerHTML"?sc(o,p):d==="children"?Dr(o,p):yl(o,d,p,c)}switch(u){case"input":Fa(o,i);break;case"textarea":ac(o,i);break;case"select":var m=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var y=i.value;y!=null?Wn(o,!!i.multiple,y,!1):m!==!!i.multiple&&(i.defaultValue!=null?Wn(o,!!i.multiple,i.defaultValue,!0):Wn(o,!!i.multiple,i.multiple?[]:"",!1))}o[Kr]=i}catch(S){se(e,e.return,S)}}break;case 6:if(ct(t,e),wt(e),r&4){if(e.stateNode===null)throw Error(b(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(S){se(e,e.return,S)}}break;case 3:if(ct(t,e),wt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Hr(t.containerInfo)}catch(S){se(e,e.return,S)}break;case 4:ct(t,e),wt(e);break;case 13:ct(t,e),wt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Xl=de())),r&4&&$u(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Pe=(c=Pe)||d,ct(t,e),Pe=c):ct(t,e),wt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(T=e,d=e.child;d!==null;){for(p=T=d;T!==null;){switch(m=T,y=m.child,m.tag){case 0:case 11:case 14:case 15:Lr(4,m,m.return);break;case 1:jn(m,m.return);var w=m.stateNode;if(typeof w.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(S){se(r,n,S)}}break;case 5:jn(m,m.return);break;case 22:if(m.memoizedState!==null){Ku(p);continue}}y!==null?(y.return=m,T=y):Ku(p)}d=d.sibling}e:for(d=null,p=e;;){if(p.tag===5){if(d===null){d=p;try{o=p.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(u=p.stateNode,s=p.memoizedProps.style,a=s!=null&&s.hasOwnProperty("display")?s.display:null,u.style.display=uc("display",a))}catch(S){se(e,e.return,S)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=c?"":p.memoizedProps}catch(S){se(e,e.return,S)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:ct(t,e),wt(e),r&4&&$u(e);break;case 21:break;default:ct(t,e),wt(e)}}function wt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Od(n)){var r=n;break e}n=n.return}throw Error(b(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Dr(o,""),r.flags&=-33);var i=Gu(e);dl(e,i,o);break;case 3:case 4:var a=r.stateNode.containerInfo,u=Gu(e);cl(e,u,a);break;default:throw Error(b(161))}}catch(s){se(e,e.return,s)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wg(e,t,n){T=e,Dd(e,t,n)}function Dd(e,t,n){for(var r=(e.mode&1)!==0;T!==null;){var o=T,i=o.child;if(o.tag===22&&r){var a=o.memoizedState!==null||Lo;if(!a){var u=o.alternate,s=u!==null&&u.memoizedState!==null||Pe;u=Lo;var c=Pe;if(Lo=a,(Pe=s)&&!c)for(T=o;T!==null;)a=T,s=a.child,a.tag===22&&a.memoizedState!==null?Yu(o):s!==null?(s.return=a,T=s):Yu(o);for(;i!==null;)T=i,Dd(i,t,n),i=i.sibling;T=o,Lo=u,Pe=c}Vu(e,t,n)}else o.subtreeFlags&8772&&i!==null?(i.return=o,T=i):Vu(e,t,n)}}function Vu(e){for(;T!==null;){var t=T;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Pe||Si(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Pe)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:dt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Fu(t,i,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Fu(t,a,n)}break;case 5:var u=t.stateNode;if(n===null&&t.flags&4){n=u;var s=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":s.autoFocus&&n.focus();break;case"img":s.src&&(n.src=s.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var p=d.dehydrated;p!==null&&Hr(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(b(163))}Pe||t.flags&512&&ul(t)}catch(m){se(t,t.return,m)}}if(t===e){T=null;break}if(n=t.sibling,n!==null){n.return=t.return,T=n;break}T=t.return}}function Ku(e){for(;T!==null;){var t=T;if(t===e){T=null;break}var n=t.sibling;if(n!==null){n.return=t.return,T=n;break}T=t.return}}function Yu(e){for(;T!==null;){var t=T;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Si(4,t)}catch(s){se(t,n,s)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(s){se(t,o,s)}}var i=t.return;try{ul(t)}catch(s){se(t,i,s)}break;case 5:var a=t.return;try{ul(t)}catch(s){se(t,a,s)}}}catch(s){se(t,t.return,s)}if(t===e){T=null;break}var u=t.sibling;if(u!==null){u.return=t.return,T=u;break}T=t.return}}var Hg=Math.ceil,di=zt.ReactCurrentDispatcher,Ql=zt.ReactCurrentOwner,rt=zt.ReactCurrentBatchConfig,G=0,me=null,pe=null,_e=0,$e=0,Un=nn(0),ge=0,Zr=null,mn=0,Ci=0,Jl=0,Or=null,De=null,Xl=0,Zn=1/0,Et=null,pi=!1,pl=null,Jt=null,Oo=!1,Gt=null,fi=0,zr=0,fl=null,Bo=-1,Go=0;function Le(){return G&6?de():Bo!==-1?Bo:Bo=de()}function Xt(e){return e.mode&1?G&2&&_e!==0?_e&-_e:Cg.transition!==null?(Go===0&&(Go=bc()),Go):(e=Q,e!==0||(e=window.event,e=e===void 0?16:Pc(e.type)),e):1}function ht(e,t,n,r){if(50<zr)throw zr=0,fl=null,Error(b(185));eo(e,n,r),(!(G&2)||e!==me)&&(e===me&&(!(G&2)&&(Ci|=n),ge===4&&Ht(e,_e)),He(e,r),n===1&&G===0&&!(t.mode&1)&&(Zn=de()+500,ki&&rn()))}function He(e,t){var n=e.callbackNode;Ef(e,t);var r=Jo(e,e===me?_e:0);if(r===0)n!==null&&nu(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&nu(n),t===1)e.tag===0?Sg(Qu.bind(null,e)):Yc(Qu.bind(null,e)),xg(function(){!(G&6)&&rn()}),n=null;else{switch(_c(r)){case 1:n=_l;break;case 4:n=xc;break;case 16:n=Qo;break;case 536870912:n=kc;break;default:n=Qo}n=Vd(n,jd.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function jd(e,t){if(Bo=-1,Go=0,G&6)throw Error(b(327));var n=e.callbackNode;if(Vn()&&e.callbackNode!==n)return null;var r=Jo(e,e===me?_e:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=gi(e,r);else{t=r;var o=G;G|=2;var i=Wd();(me!==e||_e!==t)&&(Et=null,Zn=de()+500,dn(e,t));do try{$g();break}catch(u){Ud(e,u)}while(1);zl(),di.current=i,G=o,pe!==null?t=0:(me=null,_e=0,t=ge)}if(t!==0){if(t===2&&(o=Ua(e),o!==0&&(r=o,t=gl(e,o))),t===1)throw n=Zr,dn(e,0),Ht(e,r),He(e,de()),n;if(t===6)Ht(e,r);else{if(o=e.current.alternate,!(r&30)&&!Bg(o)&&(t=gi(e,r),t===2&&(i=Ua(e),i!==0&&(r=i,t=gl(e,i))),t===1))throw n=Zr,dn(e,0),Ht(e,r),He(e,de()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(b(345));case 2:ln(e,De,Et);break;case 3:if(Ht(e,r),(r&130023424)===r&&(t=Xl+500-de(),10<t)){if(Jo(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Le(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Ya(ln.bind(null,e,De,Et),t);break}ln(e,De,Et);break;case 4:if(Ht(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-gt(r);i=1<<a,a=t[a],a>o&&(o=a),r&=~i}if(r=o,r=de()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Hg(r/1960))-r,10<r){e.timeoutHandle=Ya(ln.bind(null,e,De,Et),r);break}ln(e,De,Et);break;case 5:ln(e,De,Et);break;default:throw Error(b(329))}}}return He(e,de()),e.callbackNode===n?jd.bind(null,e):null}function gl(e,t){var n=Or;return e.current.memoizedState.isDehydrated&&(dn(e,t).flags|=256),e=gi(e,t),e!==2&&(t=De,De=n,t!==null&&hl(t)),e}function hl(e){De===null?De=e:De.push.apply(De,e)}function Bg(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!mt(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ht(e,t){for(t&=~Jl,t&=~Ci,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-gt(t),r=1<<n;e[n]=-1,t&=~r}}function Qu(e){if(G&6)throw Error(b(327));Vn();var t=Jo(e,0);if(!(t&1))return He(e,de()),null;var n=gi(e,t);if(e.tag!==0&&n===2){var r=Ua(e);r!==0&&(t=r,n=gl(e,r))}if(n===1)throw n=Zr,dn(e,0),Ht(e,t),He(e,de()),n;if(n===6)throw Error(b(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ln(e,De,Et),He(e,de()),null}function ql(e,t){var n=G;G|=1;try{return e(t)}finally{G=n,G===0&&(Zn=de()+500,ki&&rn())}}function vn(e){Gt!==null&&Gt.tag===0&&!(G&6)&&Vn();var t=G;G|=1;var n=rt.transition,r=Q;try{if(rt.transition=null,Q=1,e)return e()}finally{Q=r,rt.transition=n,G=t,!(G&6)&&rn()}}function Zl(){$e=Un.current,te(Un)}function dn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,wg(n)),pe!==null)for(n=pe.return;n!==null;){var r=n;switch(Il(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ti();break;case 3:Xn(),te(Ue),te(Fe),Hl();break;case 5:Wl(r);break;case 4:Xn();break;case 13:te(ie);break;case 19:te(ie);break;case 10:Al(r.type._context);break;case 22:case 23:Zl()}n=n.return}if(me=e,pe=e=qt(e.current,null),_e=$e=t,ge=0,Zr=null,Jl=Ci=mn=0,De=Or=null,un!==null){for(t=0;t<un.length;t++)if(n=un[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var a=i.next;i.next=o,r.next=a}n.pending=r}un=null}return e}function Ud(e,t){do{var n=pe;try{if(zl(),Uo.current=ci,ui){for(var r=ae.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ui=!1}if(hn=0,he=fe=ae=null,Ir=!1,Jr=0,Ql.current=null,n===null||n.return===null){ge=1,Zr=t,pe=null;break}e:{var i=e,a=n.return,u=n,s=t;if(t=_e,u.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){var c=s,d=u,p=d.tag;if(!(d.mode&1)&&(p===0||p===11||p===15)){var m=d.alternate;m?(d.updateQueue=m.updateQueue,d.memoizedState=m.memoizedState,d.lanes=m.lanes):(d.updateQueue=null,d.memoizedState=null)}var y=zu(a);if(y!==null){y.flags&=-257,Au(y,a,u,i,t),y.mode&1&&Ou(i,c,t),t=y,s=c;var w=t.updateQueue;if(w===null){var S=new Set;S.add(s),t.updateQueue=S}else w.add(s);break e}else{if(!(t&1)){Ou(i,c,t),es();break e}s=Error(b(426))}}else if(re&&u.mode&1){var H=zu(a);if(H!==null){!(H.flags&65536)&&(H.flags|=256),Au(H,a,u,i,t),Ll(qn(s,u));break e}}i=s=qn(s,u),ge!==4&&(ge=2),Or===null?Or=[i]:Or.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=_d(i,s,t);Pu(i,g);break e;case 1:u=s;var f=i.type,h=i.stateNode;if(!(i.flags&128)&&(typeof f.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Jt===null||!Jt.has(h)))){i.flags|=65536,t&=-t,i.lanes|=t;var x=Sd(i,u,t);Pu(i,x);break e}}i=i.return}while(i!==null)}Bd(n)}catch(C){t=C,pe===n&&n!==null&&(pe=n=n.return);continue}break}while(1)}function Wd(){var e=di.current;return di.current=ci,e===null?ci:e}function es(){(ge===0||ge===3||ge===2)&&(ge=4),me===null||!(mn&268435455)&&!(Ci&268435455)||Ht(me,_e)}function gi(e,t){var n=G;G|=2;var r=Wd();(me!==e||_e!==t)&&(Et=null,dn(e,t));do try{Gg();break}catch(o){Ud(e,o)}while(1);if(zl(),G=n,di.current=r,pe!==null)throw Error(b(261));return me=null,_e=0,ge}function Gg(){for(;pe!==null;)Hd(pe)}function $g(){for(;pe!==null&&!yf();)Hd(pe)}function Hd(e){var t=$d(e.alternate,e,$e);e.memoizedProps=e.pendingProps,t===null?Bd(e):pe=t,Ql.current=null}function Bd(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Dg(n,t),n!==null){n.flags&=32767,pe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ge=6,pe=null;return}}else if(n=Ag(n,t,$e),n!==null){pe=n;return}if(t=t.sibling,t!==null){pe=t;return}pe=t=e}while(t!==null);ge===0&&(ge=5)}function ln(e,t,n){var r=Q,o=rt.transition;try{rt.transition=null,Q=1,Vg(e,t,n,r)}finally{rt.transition=o,Q=r}return null}function Vg(e,t,n,r){do Vn();while(Gt!==null);if(G&6)throw Error(b(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(b(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Tf(e,i),e===me&&(pe=me=null,_e=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Oo||(Oo=!0,Vd(Qo,function(){return Vn(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=rt.transition,rt.transition=null;var a=Q;Q=1;var u=G;G|=4,Ql.current=null,Ug(e,n),Ad(n,e),gg(Va),Xo=!!$a,Va=$a=null,e.current=n,Wg(n,e,o),wf(),G=u,Q=a,rt.transition=i}else e.current=n;if(Oo&&(Oo=!1,Gt=e,fi=o),i=e.pendingLanes,i===0&&(Jt=null),bf(n.stateNode,r),He(e,de()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(pi)throw pi=!1,e=pl,pl=null,e;return fi&1&&e.tag!==0&&Vn(),i=e.pendingLanes,i&1?e===fl?zr++:(zr=0,fl=e):zr=0,rn(),null}function Vn(){if(Gt!==null){var e=_c(fi),t=rt.transition,n=Q;try{if(rt.transition=null,Q=16>e?16:e,Gt===null)var r=!1;else{if(e=Gt,Gt=null,fi=0,G&6)throw Error(b(331));var o=G;for(G|=4,T=e.current;T!==null;){var i=T,a=i.child;if(T.flags&16){var u=i.deletions;if(u!==null){for(var s=0;s<u.length;s++){var c=u[s];for(T=c;T!==null;){var d=T;switch(d.tag){case 0:case 11:case 15:Lr(8,d,i)}var p=d.child;if(p!==null)p.return=d,T=p;else for(;T!==null;){d=T;var m=d.sibling,y=d.return;if(Ld(d),d===c){T=null;break}if(m!==null){m.return=y,T=m;break}T=y}}}var w=i.alternate;if(w!==null){var S=w.child;if(S!==null){w.child=null;do{var H=S.sibling;S.sibling=null,S=H}while(S!==null)}}T=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,T=a;else e:for(;T!==null;){if(i=T,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Lr(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,T=g;break e}T=i.return}}var f=e.current;for(T=f;T!==null;){a=T;var h=a.child;if(a.subtreeFlags&2064&&h!==null)h.return=a,T=h;else e:for(a=f;T!==null;){if(u=T,u.flags&2048)try{switch(u.tag){case 0:case 11:case 15:Si(9,u)}}catch(C){se(u,u.return,C)}if(u===a){T=null;break e}var x=u.sibling;if(x!==null){x.return=u.return,T=x;break e}T=u.return}}if(G=o,rn(),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(mi,e)}catch{}r=!0}return r}finally{Q=n,rt.transition=t}}return!1}function Ju(e,t,n){t=qn(n,t),t=_d(e,t,1),e=Qt(e,t,1),t=Le(),e!==null&&(eo(e,1,t),He(e,t))}function se(e,t,n){if(e.tag===3)Ju(e,e,n);else for(;t!==null;){if(t.tag===3){Ju(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Jt===null||!Jt.has(r))){e=qn(n,e),e=Sd(t,e,1),t=Qt(t,e,1),e=Le(),t!==null&&(eo(t,1,e),He(t,e));break}}t=t.return}}function Kg(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Le(),e.pingedLanes|=e.suspendedLanes&n,me===e&&(_e&n)===n&&(ge===4||ge===3&&(_e&130023424)===_e&&500>de()-Xl?dn(e,0):Jl|=n),He(e,t)}function Gd(e,t){t===0&&(e.mode&1?(t=ko,ko<<=1,!(ko&130023424)&&(ko=4194304)):t=1);var n=Le();e=Lt(e,t),e!==null&&(eo(e,t,n),He(e,n))}function Yg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gd(e,n)}function Qg(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(b(314))}r!==null&&r.delete(t),Gd(e,n)}var $d;$d=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ue.current)je=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return je=!1,zg(e,t,n);je=!!(e.flags&131072)}else je=!1,re&&t.flags&1048576&&Qc(t,oi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ho(e,t),e=t.pendingProps;var o=Yn(t,Fe.current);$n(t,n),o=Gl(null,t,r,e,o,n);var i=$l();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,We(r)?(i=!0,ni(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,jl(t),o.updater=_i,t.stateNode=o,o._reactInternals=t,tl(t,r,e,n),t=ol(null,t,r,!0,i,n)):(t.tag=0,re&&i&&Rl(t),Ie(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ho(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Xg(r),e=dt(r,e),o){case 0:t=rl(null,t,r,e,n);break e;case 1:t=Uu(null,t,r,e,n);break e;case 11:t=Du(null,t,r,e,n);break e;case 14:t=ju(null,t,r,dt(r.type,e),n);break e}throw Error(b(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:dt(r,o),rl(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:dt(r,o),Uu(e,t,r,o,n);case 3:e:{if(Td(t),e===null)throw Error(b(387));r=t.pendingProps,i=t.memoizedState,o=i.element,td(e,t),li(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=qn(Error(b(423)),t),t=Wu(e,t,r,n,o);break e}else if(r!==o){o=qn(Error(b(424)),t),t=Wu(e,t,r,n,o);break e}else for(Ve=Yt(t.stateNode.containerInfo.firstChild),Ke=t,re=!0,ft=null,n=Zc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qn(),r===o){t=Ot(e,t,n);break e}Ie(e,t,r,n)}t=t.child}return t;case 5:return nd(t),e===null&&qa(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Ka(r,o)?a=null:i!==null&&Ka(r,i)&&(t.flags|=32),Ed(e,t),Ie(e,t,a,n),t.child;case 6:return e===null&&qa(t),null;case 13:return Pd(e,t,n);case 4:return Ul(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Jn(t,null,r,n):Ie(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:dt(r,o),Du(e,t,r,o,n);case 7:return Ie(e,t,t.pendingProps,n),t.child;case 8:return Ie(e,t,t.pendingProps.children,n),t.child;case 12:return Ie(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,X(ii,r._currentValue),r._currentValue=a,i!==null)if(mt(i.value,a)){if(i.children===o.children&&!Ue.current){t=Ot(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var u=i.dependencies;if(u!==null){a=i.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(i.tag===1){s=Mt(-1,n&-n),s.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?s.next=s:(s.next=d.next,d.next=s),c.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),Za(i.return,n,t),u.lanes|=n;break}s=s.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(b(341));a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Za(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Ie(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,$n(t,n),o=ot(o),r=r(o),t.flags|=1,Ie(e,t,r,n),t.child;case 14:return r=t.type,o=dt(r,t.pendingProps),o=dt(r.type,o),ju(e,t,r,o,n);case 15:return Cd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:dt(r,o),Ho(e,t),t.tag=1,We(r)?(e=!0,ni(t)):e=!1,$n(t,n),bd(t,r,o),tl(t,r,o,n),ol(null,t,r,!0,e,n);case 19:return Fd(e,t,n);case 22:return Nd(e,t,n)}throw Error(b(156,t.tag))};function Vd(e,t){return wc(e,t)}function Jg(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nt(e,t,n,r){return new Jg(e,t,n,r)}function ts(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xg(e){if(typeof e=="function")return ts(e)?1:0;if(e!=null){if(e=e.$$typeof,e===xl)return 11;if(e===kl)return 14}return 2}function qt(e,t){var n=e.alternate;return n===null?(n=nt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function $o(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")ts(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Fn:return pn(n.children,o,i,t);case wl:a=8,o|=8;break;case Ca:return e=nt(12,n,t,o|2),e.elementType=Ca,e.lanes=i,e;case Na:return e=nt(13,n,t,o),e.elementType=Na,e.lanes=i,e;case Ea:return e=nt(19,n,t,o),e.elementType=Ea,e.lanes=i,e;case nc:return Ni(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ec:a=10;break e;case tc:a=9;break e;case xl:a=11;break e;case kl:a=14;break e;case jt:a=16,r=null;break e}throw Error(b(130,e==null?e:typeof e,""))}return t=nt(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function pn(e,t,n,r){return e=nt(7,e,r,t),e.lanes=n,e}function Ni(e,t,n,r){return e=nt(22,e,r,t),e.elementType=nc,e.lanes=n,e.stateNode={isHidden:!1},e}function ba(e,t,n){return e=nt(6,e,null,t),e.lanes=n,e}function _a(e,t,n){return t=nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function qg(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=aa(0),this.expirationTimes=aa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=aa(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ns(e,t,n,r,o,i,a,u,s){return e=new qg(e,t,n,u,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=nt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jl(i),e}function Zg(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Pn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Kd(e){if(!e)return en;e=e._reactInternals;e:{if(wn(e)!==e||e.tag!==1)throw Error(b(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(We(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(b(171))}if(e.tag===1){var n=e.type;if(We(n))return Kc(e,n,t)}return t}function Yd(e,t,n,r,o,i,a,u,s){return e=ns(n,r,!0,e,o,i,a,u,s),e.context=Kd(null),n=e.current,r=Le(),o=Xt(n),i=Mt(r,o),i.callback=t??null,Qt(n,i,o),e.current.lanes=o,eo(e,o,r),He(e,r),e}function Ei(e,t,n,r){var o=t.current,i=Le(),a=Xt(o);return n=Kd(n),t.context===null?t.context=n:t.pendingContext=n,t=Mt(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Qt(o,t,a),e!==null&&(ht(e,o,a,i),jo(e,o,a)),a}function hi(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Xu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function rs(e,t){Xu(e,t),(e=e.alternate)&&Xu(e,t)}function eh(){return null}var Qd=typeof reportError=="function"?reportError:function(e){console.error(e)};function os(e){this._internalRoot=e}Ti.prototype.render=os.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(b(409));Ei(e,t,null,null)};Ti.prototype.unmount=os.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vn(function(){Ei(null,e,null,null)}),t[It]=null}};function Ti(e){this._internalRoot=e}Ti.prototype.unstable_scheduleHydration=function(e){if(e){var t=Nc();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wt.length&&t!==0&&t<Wt[n].priority;n++);Wt.splice(n,0,e),n===0&&Tc(e)}};function is(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Pi(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function qu(){}function th(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=hi(a);i.call(c)}}var a=Yd(t,r,e,0,null,!1,!1,"",qu);return e._reactRootContainer=a,e[It]=a.current,$r(e.nodeType===8?e.parentNode:e),vn(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var u=r;r=function(){var c=hi(s);u.call(c)}}var s=ns(e,0,!1,null,null,!1,!1,"",qu);return e._reactRootContainer=s,e[It]=s.current,$r(e.nodeType===8?e.parentNode:e),vn(function(){Ei(t,s,n,r)}),s}function Fi(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if(typeof o=="function"){var u=o;o=function(){var s=hi(a);u.call(s)}}Ei(t,a,e,o)}else a=th(n,t,e,o,r);return hi(a)}Sc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Nr(t.pendingLanes);n!==0&&(Sl(t,n|1),He(t,de()),!(G&6)&&(Zn=de()+500,rn()))}break;case 13:vn(function(){var r=Lt(e,1);if(r!==null){var o=Le();ht(r,e,1,o)}}),rs(e,1)}};Cl=function(e){if(e.tag===13){var t=Lt(e,134217728);if(t!==null){var n=Le();ht(t,e,134217728,n)}rs(e,134217728)}};Cc=function(e){if(e.tag===13){var t=Xt(e),n=Lt(e,t);if(n!==null){var r=Le();ht(n,e,t,r)}rs(e,t)}};Nc=function(){return Q};Ec=function(e,t){var n=Q;try{return Q=e,t()}finally{Q=n}};Aa=function(e,t,n){switch(t){case"input":if(Fa(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=xi(r);if(!o)throw Error(b(90));oc(r),Fa(r,o)}}}break;case"textarea":ac(e,n);break;case"select":t=n.value,t!=null&&Wn(e,!!n.multiple,t,!1)}};fc=ql;gc=vn;var nh={usingClientEntryPoint:!1,Events:[no,Ln,xi,dc,pc,ql]},br={findFiberByHostInstance:sn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},rh={bundleType:br.bundleType,version:br.version,rendererPackageName:br.rendererPackageName,rendererConfig:br.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:zt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=vc(e),e===null?null:e.stateNode},findFiberByHostInstance:br.findFiberByHostInstance||eh,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(_r=__REACT_DEVTOOLS_GLOBAL_HOOK__,!_r.isDisabled&&_r.supportsFiber))try{mi=_r.inject(rh),bt=_r}catch{}var _r;Je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=nh;Je.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!is(t))throw Error(b(200));return Zg(e,t,null,n)};Je.createRoot=function(e,t){if(!is(e))throw Error(b(299));var n=!1,r="",o=Qd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=ns(e,1,!1,null,null,n,!1,r,o),e[It]=t.current,$r(e.nodeType===8?e.parentNode:e),new os(t)};Je.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(b(188)):(e=Object.keys(e).join(","),Error(b(268,e)));return e=vc(t),e=e===null?null:e.stateNode,e};Je.flushSync=function(e){return vn(e)};Je.hydrate=function(e,t,n){if(!Pi(t))throw Error(b(200));return Fi(null,e,t,!0,n)};Je.hydrateRoot=function(e,t,n){if(!is(e))throw Error(b(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",a=Qd;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Yd(t,null,e,1,n??null,o,!1,i,a),e[It]=t.current,$r(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Ti(t)};Je.render=function(e,t,n){if(!Pi(t))throw Error(b(200));return Fi(null,e,t,!1,n)};Je.unmountComponentAtNode=function(e){if(!Pi(e))throw Error(b(40));return e._reactRootContainer?(vn(function(){Fi(null,null,e,!1,function(){e._reactRootContainer=null,e[It]=null})}),!0):!1};Je.unstable_batchedUpdates=ql;Je.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Pi(n))throw Error(b(200));if(e==null||e._reactInternals===void 0)throw Error(b(38));return Fi(e,t,n,!1,r)};Je.version="18.3.1-next-f1338f8080-20240426"});var Zd=Ct((Ym,qd)=>{"use strict";function Xd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xd)}catch(e){console.error(e)}}Xd(),qd.exports=Jd()});var tp=Ct(as=>{"use strict";var ep=Zd();as.createRoot=ep.createRoot,as.hydrateRoot=ep.hydrateRoot;var Qm});var rp=Ct(Mi=>{"use strict";var oh=Nt(),ih=Symbol.for("react.element"),ah=Symbol.for("react.fragment"),lh=Object.prototype.hasOwnProperty,sh=oh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,uh={key:!0,ref:!0,__self:!0,__source:!0};function np(e,t,n){var r,o={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)lh.call(t,r)&&!uh.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:ih,type:e,key:i,ref:a,props:o,_owner:sh.current}}Mi.Fragment=ah;Mi.jsx=np;Mi.jsxs=np});var Ce=Ct((qm,op)=>{"use strict";op.exports=rp()});var ks=`/* ---------------------------------------------------------------
9
+ Workflow Editor \u2014 bold redesign
10
+ Design system:
11
+ - Type: Space Grotesk (UI), JetBrains Mono (identifiers/expr),
12
+ Instrument Serif (display accents)
13
+ - Color: cool-neutral base, single accent keyed to workflow type.
14
+ Accent hue tweakable; chroma held constant (oklch).
15
+ - Node geometry: each type has its own shape (trigger pill, state
16
+ card, branch diamond-sliced card, action chip).
17
+ --------------------------------------------------------------- */
18
+
19
+ :root {
20
+ --accent-hue: 255; /* tweakable */
21
+ --accent: oklch(0.70 0.16 var(--accent-hue));
22
+ --accent-ink: oklch(0.22 0.08 var(--accent-hue));
23
+ --accent-soft: oklch(0.70 0.16 var(--accent-hue) / 0.14);
24
+ --accent-line: oklch(0.70 0.16 var(--accent-hue) / 0.38);
25
+
26
+ /* type roles */
27
+ --t-trigger: oklch(0.78 0.14 145);
28
+ --t-state: oklch(0.72 0.14 250);
29
+ --t-branch: oklch(0.78 0.13 60);
30
+ --t-action: oklch(0.72 0.14 330);
31
+ --t-end: oklch(0.62 0.04 260);
32
+
33
+ --t-trigger-soft: oklch(0.78 0.14 145 / 0.14);
34
+ --t-state-soft: oklch(0.72 0.14 250 / 0.14);
35
+ --t-branch-soft: oklch(0.78 0.13 60 / 0.14);
36
+ --t-action-soft: oklch(0.72 0.14 330 / 0.14);
37
+ --t-end-soft: oklch(0.62 0.04 260 / 0.16);
38
+
39
+ --ok: oklch(0.78 0.14 155);
40
+ --warn: oklch(0.78 0.14 75);
41
+ --err: oklch(0.68 0.20 25);
42
+
43
+ --radius: 10px;
44
+ --radius-sm: 6px;
45
+ --density: 1;
46
+ }
47
+
48
+ /* DARK (default) */
49
+ :root[data-theme="dark"] {
50
+ --bg: oklch(0.18 0.014 265);
51
+ --bg-deep: oklch(0.14 0.014 265);
52
+ --surface: oklch(0.22 0.014 265);
53
+ --surface-2: oklch(0.26 0.014 265);
54
+ --line: oklch(0.32 0.018 265);
55
+ --line-soft: oklch(0.28 0.014 265);
56
+ --ink: oklch(0.96 0.006 265);
57
+ --ink-2: oklch(0.82 0.012 265);
58
+ --muted: oklch(0.62 0.012 265);
59
+ --muted-2: oklch(0.48 0.012 265);
60
+ --grid: oklch(0.32 0.014 265 / 0.35);
61
+ --grid-bold: oklch(0.32 0.014 265 / 0.65);
62
+ --node: oklch(0.24 0.014 265);
63
+ --node-hi: oklch(0.28 0.014 265);
64
+ --shadow: 0 1px 0 oklch(1 0 0 / 0.04) inset,
65
+ 0 18px 40px -20px oklch(0 0 0 / 0.7),
66
+ 0 2px 6px -2px oklch(0 0 0 / 0.5);
67
+ }
68
+
69
+ /* LIGHT */
70
+ :root[data-theme="light"] {
71
+ --bg: oklch(0.985 0.003 265);
72
+ --bg-deep: oklch(0.96 0.004 265);
73
+ --surface: oklch(1 0 0);
74
+ --surface-2: oklch(0.975 0.004 265);
75
+ --line: oklch(0.90 0.006 265);
76
+ --line-soft: oklch(0.94 0.005 265);
77
+ --ink: oklch(0.20 0.016 265);
78
+ --ink-2: oklch(0.34 0.014 265);
79
+ --muted: oklch(0.52 0.010 265);
80
+ --muted-2: oklch(0.66 0.010 265);
81
+ --grid: oklch(0.90 0.006 265 / 0.6);
82
+ --grid-bold: oklch(0.80 0.010 265 / 0.75);
83
+ --node: oklch(1 0 0);
84
+ --node-hi: oklch(0.98 0.004 265);
85
+ --shadow: 0 1px 0 oklch(1 0 0 / 0.9) inset,
86
+ 0 20px 40px -24px oklch(0.2 0.02 265 / 0.18),
87
+ 0 2px 6px -3px oklch(0.2 0.02 265 / 0.12);
88
+ }
89
+
90
+ * { box-sizing: border-box; }
91
+ html, body, #root { height: 100%; margin: 0; }
92
+ body {
93
+ background: var(--bg-deep);
94
+ color: var(--ink);
95
+ font: 13px/1.5 "Space Grotesk", system-ui, -apple-system, sans-serif;
96
+ font-feature-settings: "ss01", "cv01";
97
+ -webkit-font-smoothing: antialiased;
98
+ overflow: hidden;
99
+ }
100
+ kbd {
101
+ font: 500 10.5px/1 "JetBrains Mono", ui-monospace, monospace;
102
+ background: var(--surface-2);
103
+ border: 1px solid var(--line);
104
+ border-bottom-width: 2px;
105
+ padding: 2px 5px;
106
+ border-radius: 4px;
107
+ color: var(--ink-2);
108
+ }
109
+ code, .mono {
110
+ font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
111
+ font-size: 0.92em;
112
+ letter-spacing: -0.005em;
113
+ }
114
+
115
+ /* ============================================================
116
+ APP SHELL
117
+ ============================================================ */
118
+ .app {
119
+ display: grid;
120
+ grid-template-rows: 52px 1fr;
121
+ grid-template-columns: 288px 1fr 380px;
122
+ height: 100vh;
123
+ background: var(--bg);
124
+ }
125
+ .app[data-density="compact"] { --density: 0.88; }
126
+ .app[data-density="cozy"] { --density: 1; }
127
+ .app[data-density="roomy"] { --density: 1.12; }
128
+ .app[data-palette="closed"] { grid-template-columns: 0 1fr 380px; }
129
+ .app[data-inspector="closed"] { grid-template-columns: 288px 1fr 0; }
130
+ .app[data-palette="closed"][data-inspector="closed"] { grid-template-columns: 0 1fr 0; }
131
+
132
+ /* ============================================================
133
+ TOOLBAR
134
+ ============================================================ */
135
+ .tb {
136
+ grid-column: 1 / 4;
137
+ display: flex;
138
+ align-items: stretch;
139
+ background: var(--surface);
140
+ border-bottom: 1px solid var(--line);
141
+ position: relative;
142
+ z-index: 5;
143
+ }
144
+ .tb__brand {
145
+ display: flex; align-items: center; gap: 10px;
146
+ padding: 0 16px;
147
+ border-right: 1px solid var(--line);
148
+ width: 288px;
149
+ }
150
+ .tb__mark {
151
+ width: 26px; height: 26px;
152
+ border-radius: 7px;
153
+ background: linear-gradient(140deg, var(--accent) 0%, var(--t-action) 100%);
154
+ position: relative;
155
+ display: grid; place-items: center;
156
+ color: var(--accent-ink);
157
+ font-weight: 700;
158
+ box-shadow: 0 2px 8px -2px var(--accent-line), inset 0 0 0 1px oklch(1 0 0 / 0.2);
159
+ }
160
+ .tb__mark::after {
161
+ content: "";
162
+ position: absolute; inset: 3px;
163
+ border-radius: 5px;
164
+ background: radial-gradient(circle at 30% 30%, oklch(1 0 0 / 0.35), transparent 60%);
165
+ pointer-events: none;
166
+ }
167
+ .tb__brand-label { font-weight: 600; letter-spacing: -0.01em; font-size: 13px; }
168
+ .tb__brand-sub { font-size: 10px; color: var(--muted); font-family: "JetBrains Mono", monospace; letter-spacing: 0; }
169
+
170
+ .tb__main {
171
+ flex: 1;
172
+ display: flex; align-items: center; gap: 4px;
173
+ padding: 0 14px;
174
+ min-width: 0;
175
+ }
176
+ .tb__crumbs {
177
+ display: flex; align-items: center; gap: 8px;
178
+ font-size: 12px; color: var(--muted);
179
+ min-width: 0;
180
+ }
181
+ .tb__crumbs b {
182
+ color: var(--ink);
183
+ font-weight: 600;
184
+ max-width: 320px;
185
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
186
+ font-size: 13px;
187
+ letter-spacing: -0.005em;
188
+ }
189
+ .tb__crumbs input {
190
+ font: inherit;
191
+ font-weight: 600;
192
+ color: var(--ink);
193
+ background: transparent;
194
+ border: 1px solid transparent;
195
+ padding: 3px 6px;
196
+ border-radius: 5px;
197
+ min-width: 240px;
198
+ letter-spacing: -0.005em;
199
+ }
200
+ .tb__crumbs input:focus { outline: none; border-color: var(--accent-line); background: var(--bg); }
201
+ .tb__crumbs .sep { color: var(--muted-2); }
202
+ .tb__status {
203
+ font: 500 10.5px/1 "JetBrains Mono", monospace;
204
+ color: var(--muted);
205
+ display: inline-flex; align-items: center; gap: 6px;
206
+ padding: 4px 8px;
207
+ border-radius: 20px;
208
+ background: var(--surface-2);
209
+ border: 1px solid var(--line-soft);
210
+ }
211
+ .tb__status .dot {
212
+ width: 6px; height: 6px; border-radius: 50%;
213
+ background: var(--muted);
214
+ }
215
+ .tb__status.is-dirty .dot { background: var(--warn); box-shadow: 0 0 0 3px oklch(from var(--warn) l c h / 0.25); }
216
+ .tb__status.is-saved .dot { background: var(--ok); }
217
+ .tb__status.is-running .dot { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
218
+
219
+ .tb__sep { width: 1px; background: var(--line); margin: 10px 6px; }
220
+ .tb__spacer { flex: 1; }
221
+
222
+ .tb__actions { display: flex; align-items: center; gap: 4px; padding: 0 12px; border-left: 1px solid var(--line); }
223
+
224
+ /* ============================================================
225
+ BUTTONS
226
+ ============================================================ */
227
+ .btn {
228
+ font: 500 12px/1 "Space Grotesk", sans-serif;
229
+ color: var(--ink-2);
230
+ background: transparent;
231
+ border: 1px solid transparent;
232
+ height: 30px;
233
+ padding: 0 10px;
234
+ border-radius: 7px;
235
+ display: inline-flex; align-items: center; gap: 6px;
236
+ cursor: pointer;
237
+ transition: background .12s ease, border-color .12s ease, color .12s ease;
238
+ white-space: nowrap;
239
+ }
240
+ .btn:hover { background: var(--surface-2); color: var(--ink); }
241
+ .btn:disabled { opacity: 0.4; cursor: not-allowed; }
242
+ .btn svg { width: 14px; height: 14px; }
243
+
244
+ .btn--outline { border-color: var(--line); background: var(--surface); }
245
+ .btn--outline:hover { border-color: var(--line); background: var(--node-hi); }
246
+
247
+ .btn--primary {
248
+ background: var(--accent);
249
+ color: var(--accent-ink);
250
+ border-color: var(--accent);
251
+ font-weight: 600;
252
+ }
253
+ .btn--primary:hover { filter: brightness(1.08); color: var(--accent-ink); background: var(--accent); }
254
+
255
+ .btn--ghost-icon {
256
+ width: 30px; padding: 0; justify-content: center;
257
+ color: var(--muted);
258
+ }
259
+ .btn--ghost-icon:hover { color: var(--ink); background: var(--surface-2); }
260
+ .btn--ghost-icon.is-active { color: var(--accent); background: var(--accent-soft); }
261
+
262
+ .btn--danger {
263
+ color: var(--err);
264
+ background: oklch(from var(--err) l c h / 0.08);
265
+ border-color: oklch(from var(--err) l c h / 0.3);
266
+ }
267
+ .btn--danger:hover { background: oklch(from var(--err) l c h / 0.16); }
268
+
269
+ /* ============================================================
270
+ PALETTE (left)
271
+ ============================================================ */
272
+ .pal {
273
+ border-right: 1px solid var(--line);
274
+ background: var(--surface);
275
+ display: flex; flex-direction: column;
276
+ overflow: hidden;
277
+ min-width: 0;
278
+ }
279
+ .pal__search {
280
+ position: relative;
281
+ padding: 12px 14px 8px;
282
+ border-bottom: 1px solid var(--line-soft);
283
+ }
284
+ .pal__search input {
285
+ width: 100%;
286
+ font: 13px "Space Grotesk", sans-serif;
287
+ background: var(--bg);
288
+ border: 1px solid var(--line);
289
+ border-radius: 8px;
290
+ padding: 8px 12px 8px 32px;
291
+ color: var(--ink);
292
+ }
293
+ .pal__search input::placeholder { color: var(--muted-2); }
294
+ .pal__search input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
295
+ .pal__search svg {
296
+ position: absolute; left: 24px; top: 50%;
297
+ width: 14px; height: 14px;
298
+ transform: translateY(-4px);
299
+ color: var(--muted);
300
+ pointer-events: none;
301
+ }
302
+ .pal__search kbd { position: absolute; right: 22px; top: 20px; }
303
+
304
+ .pal__scroll { flex: 1; overflow-y: auto; padding: 14px 10px 18px; }
305
+ .pal__scroll::-webkit-scrollbar { width: 8px; }
306
+ .pal__scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
307
+
308
+ .pal__section {
309
+ display: flex; align-items: center; justify-content: space-between;
310
+ padding: 14px 6px 6px;
311
+ font-size: 10px; font-weight: 600;
312
+ letter-spacing: 0.1em;
313
+ text-transform: uppercase;
314
+ color: var(--muted);
315
+ }
316
+ .pal__section:first-child { padding-top: 4px; }
317
+ .pal__section-count {
318
+ font-size: 10px; font-family: "JetBrains Mono", monospace;
319
+ color: var(--muted-2);
320
+ }
321
+
322
+ .pal__item {
323
+ display: flex; align-items: flex-start; gap: 10px;
324
+ padding: 9px 10px;
325
+ margin: 2px 0;
326
+ border-radius: 8px;
327
+ cursor: grab;
328
+ user-select: none;
329
+ border: 1px solid transparent;
330
+ position: relative;
331
+ transition: background .12s, border-color .12s;
332
+ }
333
+ .pal__item:hover { background: var(--surface-2); border-color: var(--line-soft); }
334
+ .pal__item:active { cursor: grabbing; }
335
+ .pal__item.is-dragging { opacity: 0.35; }
336
+
337
+ .pal__glyph {
338
+ flex-shrink: 0;
339
+ width: 30px; height: 30px;
340
+ display: grid; place-items: center;
341
+ color: var(--gcol, var(--ink));
342
+ background: var(--gbg, var(--surface-2));
343
+ border: 1px solid var(--gbor, var(--line));
344
+ }
345
+ .pal__glyph.g-trigger { --gcol: var(--t-trigger); --gbg: var(--t-trigger-soft); --gbor: oklch(from var(--t-trigger) l c h / 0.3); border-radius: 15px; }
346
+ .pal__glyph.g-state { --gcol: var(--t-state); --gbg: var(--t-state-soft); --gbor: oklch(from var(--t-state) l c h / 0.3); border-radius: 6px; }
347
+ .pal__glyph.g-branch { --gcol: var(--t-branch); --gbg: var(--t-branch-soft); --gbor: oklch(from var(--t-branch) l c h / 0.3); border-radius: 4px; transform: rotate(45deg); }
348
+ .pal__glyph.g-branch svg { transform: rotate(-45deg); }
349
+ .pal__glyph.g-action { --gcol: var(--t-action); --gbg: var(--t-action-soft); --gbor: oklch(from var(--t-action) l c h / 0.3); border-radius: 4px 10px 10px 4px; }
350
+ .pal__glyph.g-end { --gcol: var(--t-end); --gbg: var(--t-end-soft); --gbor: oklch(from var(--t-end) l c h / 0.3); border-radius: 15px; border-style: dashed; }
351
+ .pal__glyph svg { width: 14px; height: 14px; }
352
+
353
+ .pal__meta { min-width: 0; flex: 1; padding-top: 2px; }
354
+ .pal__label { font-size: 12.5px; font-weight: 500; color: var(--ink); letter-spacing: -0.005em; }
355
+ .pal__hint { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
356
+
357
+ .pal__tpl {
358
+ display: block;
359
+ padding: 12px 14px;
360
+ background: var(--bg);
361
+ border: 1px solid var(--line);
362
+ border-radius: 10px;
363
+ margin: 6px 4px;
364
+ cursor: pointer;
365
+ position: relative;
366
+ overflow: hidden;
367
+ transition: border-color .12s, transform .12s;
368
+ }
369
+ .pal__tpl:hover { border-color: var(--accent-line); transform: translateY(-1px); }
370
+ .pal__tpl-title { font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em; margin-bottom: 4px; }
371
+ .pal__tpl-hint { font-size: 10.5px; color: var(--muted); line-height: 1.45; }
372
+ .pal__tpl-dots {
373
+ position: absolute; right: 10px; top: 10px;
374
+ display: flex; gap: 3px;
375
+ }
376
+ .pal__tpl-dots span {
377
+ width: 5px; height: 5px; border-radius: 50%;
378
+ background: var(--line);
379
+ }
380
+ .pal__tpl-dots span.on { background: var(--accent); }
381
+
382
+ .pal__foot {
383
+ border-top: 1px solid var(--line);
384
+ padding: 10px 14px;
385
+ font-size: 10.5px; color: var(--muted);
386
+ display: flex; align-items: center; gap: 8px;
387
+ background: var(--surface-2);
388
+ }
389
+
390
+ /* ============================================================
391
+ CANVAS
392
+ ============================================================ */
393
+ .cv {
394
+ position: relative;
395
+ overflow: hidden;
396
+ background: var(--bg);
397
+ background-image:
398
+ radial-gradient(circle at center, var(--grid) 1px, transparent 1px),
399
+ linear-gradient(to right, var(--grid-bold) 1px, transparent 1px),
400
+ linear-gradient(to bottom, var(--grid-bold) 1px, transparent 1px);
401
+ background-size: 24px 24px, 120px 120px, 120px 120px;
402
+ background-position: 0 0, 0 0, 0 0;
403
+ cursor: default;
404
+ }
405
+ .cv.is-panning { cursor: grabbing; }
406
+ .cv.is-drop-target::before {
407
+ content: "";
408
+ position: absolute; inset: 8px;
409
+ border: 2px dashed var(--accent);
410
+ border-radius: 18px;
411
+ background: var(--accent-soft);
412
+ pointer-events: none;
413
+ z-index: 0;
414
+ }
415
+
416
+ .cv__viewport {
417
+ position: absolute;
418
+ left: 0; top: 0;
419
+ width: 100%; height: 100%;
420
+ transform-origin: 0 0;
421
+ }
422
+
423
+ .cv__edges {
424
+ position: absolute; inset: 0;
425
+ pointer-events: none;
426
+ overflow: visible;
427
+ z-index: 1;
428
+ }
429
+ .cv__edges path {
430
+ fill: none;
431
+ stroke: var(--line);
432
+ stroke-width: 1.6;
433
+ pointer-events: stroke;
434
+ cursor: pointer;
435
+ }
436
+ .cv__edges path.edge-bg {
437
+ stroke: transparent;
438
+ stroke-width: 14;
439
+ pointer-events: stroke;
440
+ }
441
+ .cv__edges path.is-hover { stroke: var(--ink-2); }
442
+ .cv__edges path.is-selected { stroke: var(--accent); stroke-width: 2; }
443
+ .cv__edges path.is-running {
444
+ stroke: var(--accent);
445
+ stroke-width: 2;
446
+ stroke-dasharray: 6 4;
447
+ animation: dash 0.6s linear infinite;
448
+ }
449
+ .cv__edges path.is-visited { stroke: var(--accent); stroke-width: 1.8; }
450
+ .cv__edges path.is-true { stroke: var(--ok); }
451
+ .cv__edges path.is-false { stroke: var(--err); }
452
+ .cv__edges .edge-label {
453
+ font: 500 10.5px "JetBrains Mono", monospace;
454
+ fill: var(--ink-2);
455
+ }
456
+ .cv__edges .edge-label-bg {
457
+ fill: var(--surface);
458
+ stroke: var(--line);
459
+ stroke-width: 1;
460
+ }
461
+ @keyframes dash { to { stroke-dashoffset: -20; } }
462
+ @keyframes pulse {
463
+ 0%, 100% { opacity: 1; transform: scale(1); }
464
+ 50% { opacity: 0.55; transform: scale(1.25); }
465
+ }
466
+
467
+ /* ---------- NODE base ---------- */
468
+ .node {
469
+ position: absolute;
470
+ --c: var(--t-state);
471
+ --c-soft: var(--t-state-soft);
472
+ --c-line: oklch(from var(--c) l c h / 0.38);
473
+ background: var(--node);
474
+ color: var(--ink);
475
+ font-family: "Space Grotesk", sans-serif;
476
+ border: 1.25px solid var(--line);
477
+ border-radius: var(--radius);
478
+ min-width: 220px;
479
+ box-shadow: var(--shadow);
480
+ cursor: grab;
481
+ transition: border-color .12s, box-shadow .12s, transform .12s;
482
+ z-index: 2;
483
+ }
484
+ .node.t-trigger { --c: var(--t-trigger); --c-soft: var(--t-trigger-soft); }
485
+ .node.t-state { --c: var(--t-state); --c-soft: var(--t-state-soft); }
486
+ .node.t-branch { --c: var(--t-branch); --c-soft: var(--t-branch-soft); }
487
+ .node.t-action { --c: var(--t-action); --c-soft: var(--t-action-soft); }
488
+ .node.t-end { --c: var(--t-end); --c-soft: var(--t-end-soft); }
489
+
490
+ .node:active { cursor: grabbing; }
491
+ .node.is-selected { border-color: var(--c-line); box-shadow: var(--shadow), 0 0 0 2px oklch(from var(--c) l c h / 0.4); z-index: 4; }
492
+ .node.is-running { box-shadow: var(--shadow), 0 0 0 2px var(--c-line), 0 0 22px 2px oklch(from var(--c) l c h / 0.4); border-color: var(--c-line); }
493
+ .node.is-visited { border-color: var(--c-line); }
494
+ .node.is-error { border-color: var(--err); box-shadow: var(--shadow), 0 0 0 2px oklch(from var(--err) l c h / 0.35); }
495
+
496
+ .node__stripe {
497
+ height: 4px;
498
+ border-radius: var(--radius) var(--radius) 0 0;
499
+ background: linear-gradient(90deg, var(--c) 0%, oklch(from var(--c) l c h / 0.5) 100%);
500
+ position: relative;
501
+ overflow: hidden;
502
+ }
503
+ .node__stripe::after {
504
+ content: "";
505
+ position: absolute; inset: 0;
506
+ background: repeating-linear-gradient(90deg, oklch(1 0 0 / 0.15) 0 2px, transparent 2px 4px);
507
+ mix-blend-mode: overlay;
508
+ }
509
+ .node__head {
510
+ display: flex; align-items: center; gap: 10px;
511
+ padding: 10px 12px 6px;
512
+ }
513
+ .node__icon {
514
+ width: 22px; height: 22px;
515
+ border-radius: 5px;
516
+ background: var(--c-soft);
517
+ color: var(--c);
518
+ border: 1px solid oklch(from var(--c) l c h / 0.28);
519
+ display: grid; place-items: center;
520
+ flex-shrink: 0;
521
+ }
522
+ .node__icon svg { width: 12px; height: 12px; }
523
+ .node__meta { min-width: 0; flex: 1; }
524
+ .node__kind {
525
+ font: 600 9px/1 "JetBrains Mono", monospace;
526
+ letter-spacing: 0.12em;
527
+ text-transform: uppercase;
528
+ color: var(--c);
529
+ }
530
+ .node__name {
531
+ font-weight: 600; font-size: 13.5px;
532
+ letter-spacing: -0.01em;
533
+ margin-top: 2px;
534
+ color: var(--ink);
535
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
536
+ }
537
+ .node__chev {
538
+ color: var(--muted-2);
539
+ display: grid; place-items: center;
540
+ }
541
+ .node__body {
542
+ padding: 0 12px 12px;
543
+ display: flex; flex-direction: column; gap: 6px;
544
+ }
545
+ .node__row {
546
+ display: flex; align-items: center; gap: 6px;
547
+ font-size: 11.5px;
548
+ color: var(--ink-2);
549
+ min-height: 18px;
550
+ }
551
+ .node__row .mono { color: var(--muted); }
552
+ .node__row svg { width: 12px; height: 12px; color: var(--muted); flex-shrink: 0; }
553
+ .node__tag {
554
+ font: 500 10px "JetBrains Mono", monospace;
555
+ padding: 2px 6px;
556
+ background: var(--surface-2);
557
+ border-radius: 3px;
558
+ color: var(--ink-2);
559
+ border: 1px solid var(--line-soft);
560
+ }
561
+
562
+ .node__foot {
563
+ padding: 8px 12px;
564
+ border-top: 1px dashed var(--line-soft);
565
+ display: flex; align-items: center; justify-content: space-between;
566
+ font-size: 10.5px;
567
+ color: var(--muted);
568
+ }
569
+ .node__badges { display: flex; gap: 4px; }
570
+ .node__badge {
571
+ font: 600 9px/1 "JetBrains Mono", monospace;
572
+ letter-spacing: 0.08em;
573
+ padding: 3px 5px;
574
+ border-radius: 3px;
575
+ background: var(--surface-2);
576
+ color: var(--ink-2);
577
+ text-transform: uppercase;
578
+ border: 1px solid var(--line-soft);
579
+ }
580
+ .node__badge.ok { color: var(--ok); background: oklch(from var(--ok) l c h / 0.12); border-color: oklch(from var(--ok) l c h / 0.3); }
581
+ .node__badge.warn { color: var(--warn); background: oklch(from var(--warn) l c h / 0.12); border-color: oklch(from var(--warn) l c h / 0.3); }
582
+ .node__badge.err { color: var(--err); background: oklch(from var(--err) l c h / 0.12); border-color: oklch(from var(--err) l c h / 0.3); }
583
+
584
+ /* ---------- NODE: Trigger (pill) ---------- */
585
+ .node.t-trigger {
586
+ border-radius: 999px;
587
+ min-width: 200px;
588
+ padding: 10px 18px 10px 14px;
589
+ }
590
+ .node.t-trigger .node__stripe { display: none; }
591
+ .node.t-trigger .node__head { padding: 0; gap: 10px; }
592
+ .node.t-trigger .node__body { display: none; }
593
+ .node.t-trigger .node__foot { display: none; }
594
+ .node.t-trigger::before {
595
+ content: "";
596
+ position: absolute;
597
+ left: -6px; top: 50%;
598
+ transform: translateY(-50%);
599
+ width: 10px; height: 10px;
600
+ border-radius: 50%;
601
+ background: var(--c);
602
+ box-shadow: 0 0 0 3px var(--bg), 0 0 14px 2px oklch(from var(--c) l c h / 0.6);
603
+ }
604
+
605
+ /* ---------- NODE: Branch (diamond-clipped card) ---------- */
606
+ .node.t-branch {
607
+ min-width: 240px;
608
+ clip-path: polygon(0% 14px, 14px 0%, calc(100% - 14px) 0%, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0% calc(100% - 14px));
609
+ }
610
+
611
+ /* ---------- NODE: Action (chip, smaller) ---------- */
612
+ .node.t-action {
613
+ min-width: 200px;
614
+ border-radius: 4px 14px 14px 4px;
615
+ border-left: 3px solid var(--c);
616
+ }
617
+ .node.t-action .node__stripe { display: none; }
618
+ .node.t-action .node__head { padding-top: 10px; }
619
+
620
+ /* ---------- HANDLES (ports) ---------- */
621
+ .handle {
622
+ position: absolute;
623
+ width: 12px; height: 12px;
624
+ border-radius: 50%;
625
+ background: var(--node);
626
+ border: 2px solid var(--c);
627
+ transform: translate(-50%, -50%);
628
+ cursor: crosshair;
629
+ z-index: 5;
630
+ transition: transform .1s, background .12s;
631
+ }
632
+ .handle:hover, .handle.is-active {
633
+ background: var(--c);
634
+ transform: translate(-50%, -50%) scale(1.35);
635
+ }
636
+ .handle.h-in { left: 0; top: 50%; }
637
+ .handle.h-out { left: 100%; top: 50%; }
638
+ .handle.h-true { left: 100%; top: 30%; border-color: var(--ok); }
639
+ .handle.h-false { left: 100%; top: 70%; border-color: var(--err); }
640
+ .handle__label {
641
+ position: absolute;
642
+ left: 14px; top: 50%;
643
+ transform: translateY(-50%);
644
+ font: 600 9px/1 "JetBrains Mono", monospace;
645
+ letter-spacing: 0.1em;
646
+ text-transform: uppercase;
647
+ color: var(--muted);
648
+ white-space: nowrap;
649
+ pointer-events: none;
650
+ }
651
+ .handle.h-true .handle__label { color: var(--ok); }
652
+ .handle.h-false .handle__label { color: var(--err); }
653
+
654
+ /* ---------- Canvas overlays ---------- */
655
+ .cv__controls {
656
+ position: absolute;
657
+ left: 14px; bottom: 14px;
658
+ display: flex; gap: 6px;
659
+ background: var(--surface);
660
+ border: 1px solid var(--line);
661
+ border-radius: 10px;
662
+ padding: 4px;
663
+ box-shadow: var(--shadow);
664
+ z-index: 10;
665
+ }
666
+ .cv__controls button {
667
+ width: 28px; height: 28px;
668
+ background: transparent;
669
+ border: 0;
670
+ border-radius: 6px;
671
+ color: var(--ink-2);
672
+ cursor: pointer;
673
+ display: grid; place-items: center;
674
+ }
675
+ .cv__controls button:hover { background: var(--surface-2); color: var(--ink); }
676
+ .cv__zoom { padding: 0 8px; font: 500 11px "JetBrains Mono", monospace; color: var(--muted); display: grid; place-items: center; border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-width: 56px; }
677
+
678
+ .cv__mini {
679
+ position: absolute;
680
+ right: 14px; bottom: 14px;
681
+ width: 200px; height: 140px;
682
+ background: var(--surface);
683
+ border: 1px solid var(--line);
684
+ border-radius: 10px;
685
+ overflow: hidden;
686
+ z-index: 10;
687
+ box-shadow: var(--shadow);
688
+ transition: height .16s, width .16s;
689
+ }
690
+ .cv__mini.is-collapsed { height: 32px; width: 140px; }
691
+ .cv__mini-head {
692
+ height: 28px;
693
+ display: flex; align-items: center; justify-content: space-between;
694
+ padding: 0 10px;
695
+ font: 600 10px "Space Grotesk"; letter-spacing: 0.08em; text-transform: uppercase;
696
+ color: var(--muted);
697
+ border-bottom: 1px solid var(--line-soft);
698
+ }
699
+ .cv__mini-head button { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 4px; display: grid; place-items: center; }
700
+ .cv__mini-head button:hover { color: var(--ink); background: var(--surface-2); }
701
+ .cv__mini svg { width: 100%; height: calc(100% - 28px); display: block; }
702
+ .cv__mini .mini-node { fill: var(--muted-2); }
703
+ .cv__mini .mini-node.sel { fill: var(--accent); }
704
+ .cv__mini .mini-view { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
705
+
706
+ /* ---------- Run panel ---------- */
707
+ .run {
708
+ position: absolute;
709
+ top: 14px; left: 14px;
710
+ width: 320px;
711
+ max-height: calc(100% - 28px);
712
+ background: var(--surface);
713
+ border: 1px solid var(--line);
714
+ border-radius: 12px;
715
+ box-shadow: var(--shadow);
716
+ z-index: 9;
717
+ overflow: hidden;
718
+ display: flex; flex-direction: column;
719
+ }
720
+ .run__head {
721
+ display: flex; align-items: center; gap: 10px;
722
+ padding: 10px 12px;
723
+ border-bottom: 1px solid var(--line-soft);
724
+ }
725
+ .run__title { font-weight: 600; font-size: 12.5px; letter-spacing: -0.005em; }
726
+ .run__chip {
727
+ font: 600 10px "JetBrains Mono", monospace;
728
+ padding: 3px 7px;
729
+ border-radius: 20px;
730
+ background: oklch(from var(--accent) l c h / 0.14);
731
+ color: var(--accent);
732
+ border: 1px solid var(--accent-line);
733
+ display: inline-flex; align-items: center; gap: 5px;
734
+ }
735
+ .run__chip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
736
+ .run__body { overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
737
+ .run__step {
738
+ display: flex; gap: 10px;
739
+ padding: 9px 10px;
740
+ background: var(--bg);
741
+ border: 1px solid var(--line-soft);
742
+ border-radius: 8px;
743
+ font-size: 11.5px;
744
+ position: relative;
745
+ }
746
+ .run__step.is-current { border-color: var(--accent-line); background: var(--accent-soft); }
747
+ .run__step.is-done .run__marker { background: var(--ok); color: var(--bg); border-color: var(--ok); }
748
+ .run__step.is-current .run__marker { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); animation: pulse 1s ease-in-out infinite; }
749
+ .run__marker {
750
+ width: 20px; height: 20px; flex-shrink: 0;
751
+ border-radius: 50%;
752
+ display: grid; place-items: center;
753
+ font: 600 10px "JetBrains Mono", monospace;
754
+ color: var(--muted);
755
+ border: 1.5px solid var(--line);
756
+ }
757
+ .run__step-title { font-weight: 600; font-size: 11.5px; }
758
+ .run__step-body { color: var(--muted); font-size: 11px; margin-top: 3px; line-height: 1.4; }
759
+ .run__step-body code { color: var(--ink-2); }
760
+ .run__foot {
761
+ padding: 8px 12px;
762
+ border-top: 1px solid var(--line-soft);
763
+ display: flex; align-items: center; justify-content: space-between;
764
+ font-size: 11px; color: var(--muted);
765
+ font-family: "JetBrains Mono", monospace;
766
+ }
767
+
768
+ /* ---------- Empty state ---------- */
769
+ .cv__empty {
770
+ position: absolute;
771
+ inset: 0;
772
+ display: grid; place-items: center;
773
+ color: var(--muted);
774
+ pointer-events: none;
775
+ }
776
+ .cv__empty-card {
777
+ background: var(--surface);
778
+ border: 1px dashed var(--line);
779
+ border-radius: 14px;
780
+ padding: 28px 32px;
781
+ text-align: center;
782
+ pointer-events: auto;
783
+ max-width: 360px;
784
+ box-shadow: var(--shadow);
785
+ }
786
+ .cv__empty-card h3 { font-family: "Instrument Serif", serif; font-weight: 400; font-size: 26px; margin: 8px 0 4px; color: var(--ink); letter-spacing: -0.01em; }
787
+ .cv__empty-card p { font-size: 12px; line-height: 1.5; margin: 0 0 14px; }
788
+
789
+ /* ============================================================
790
+ INSPECTOR (right)
791
+ ============================================================ */
792
+ .insp {
793
+ border-left: 1px solid var(--line);
794
+ background: var(--surface);
795
+ display: flex; flex-direction: column;
796
+ overflow: hidden;
797
+ }
798
+ .insp__head {
799
+ padding: 12px 16px 0;
800
+ border-bottom: 1px solid var(--line-soft);
801
+ background: var(--surface);
802
+ }
803
+ .insp__top {
804
+ display: flex; align-items: center; gap: 8px;
805
+ padding-bottom: 12px;
806
+ }
807
+ .insp__type-pill {
808
+ font: 600 9px "JetBrains Mono", monospace;
809
+ letter-spacing: 0.1em;
810
+ text-transform: uppercase;
811
+ padding: 3px 7px;
812
+ border-radius: 20px;
813
+ background: var(--c-soft, var(--surface-2));
814
+ color: var(--c, var(--ink-2));
815
+ border: 1px solid oklch(from var(--c, var(--line)) l c h / 0.3);
816
+ }
817
+ .insp__name {
818
+ font-weight: 600; font-size: 14px; letter-spacing: -0.01em;
819
+ flex: 1; min-width: 0;
820
+ background: transparent; border: 1px solid transparent;
821
+ color: var(--ink);
822
+ padding: 4px 6px;
823
+ border-radius: 5px;
824
+ font-family: inherit;
825
+ }
826
+ .insp__name:focus { outline: none; border-color: var(--accent-line); background: var(--bg); }
827
+ .insp__tabs {
828
+ display: flex; gap: 2px;
829
+ margin-top: 6px;
830
+ }
831
+ .insp__tab {
832
+ font: 500 11.5px "Space Grotesk";
833
+ color: var(--muted);
834
+ background: transparent;
835
+ border: 0;
836
+ padding: 8px 10px;
837
+ cursor: pointer;
838
+ border-bottom: 2px solid transparent;
839
+ display: inline-flex; align-items: center; gap: 6px;
840
+ margin-bottom: -1px;
841
+ }
842
+ .insp__tab:hover { color: var(--ink-2); }
843
+ .insp__tab.is-active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
844
+ .insp__tab .count {
845
+ font: 600 9.5px "JetBrains Mono", monospace;
846
+ background: var(--surface-2);
847
+ color: var(--muted);
848
+ padding: 2px 5px;
849
+ border-radius: 10px;
850
+ }
851
+ .insp__tab.is-active .count { background: var(--accent-soft); color: var(--accent); }
852
+
853
+ .insp__body { overflow-y: auto; flex: 1; padding-bottom: 24px; }
854
+ .insp__body::-webkit-scrollbar { width: 8px; }
855
+ .insp__body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
856
+
857
+ .insp__section {
858
+ border-bottom: 1px solid var(--line-soft);
859
+ }
860
+ .insp__section-head {
861
+ display: flex; align-items: center; gap: 8px;
862
+ padding: 14px 16px 8px;
863
+ cursor: pointer;
864
+ user-select: none;
865
+ }
866
+ .insp__section-head h4 {
867
+ margin: 0;
868
+ font: 600 10.5px "Space Grotesk";
869
+ letter-spacing: 0.1em;
870
+ text-transform: uppercase;
871
+ color: var(--muted);
872
+ flex: 1;
873
+ }
874
+ .insp__section-head .chev { color: var(--muted-2); transition: transform .16s; }
875
+ .insp__section.is-collapsed .insp__section-body { display: none; }
876
+ .insp__section.is-collapsed .chev { transform: rotate(-90deg); }
877
+ .insp__section-body {
878
+ padding: 4px 16px 16px;
879
+ display: flex; flex-direction: column; gap: 10px;
880
+ }
881
+
882
+ /* ---------- Form fields ---------- */
883
+ .fld { display: flex; flex-direction: column; gap: 5px; }
884
+ .fld__label {
885
+ font: 500 11px "Space Grotesk";
886
+ color: var(--muted);
887
+ display: flex; align-items: center; justify-content: space-between;
888
+ }
889
+ .fld__hint { font-size: 10.5px; color: var(--muted-2); }
890
+ .fld__input,
891
+ .fld__select,
892
+ .fld__textarea {
893
+ font-family: "Space Grotesk", sans-serif;
894
+ font-size: 12.5px;
895
+ background: var(--bg);
896
+ color: var(--ink);
897
+ border: 1px solid var(--line);
898
+ border-radius: 6px;
899
+ padding: 7px 9px;
900
+ width: 100%;
901
+ transition: border-color .12s, box-shadow .12s;
902
+ }
903
+ .fld.is-mono .fld__input,
904
+ .fld.is-mono .fld__textarea { font-family: "JetBrains Mono", monospace; font-size: 11.5px; }
905
+ .fld__input:focus,
906
+ .fld__select:focus,
907
+ .fld__textarea:focus {
908
+ outline: none;
909
+ border-color: var(--accent-line);
910
+ box-shadow: 0 0 0 3px var(--accent-soft);
911
+ }
912
+ .fld__textarea { min-height: 70px; resize: vertical; line-height: 1.5; }
913
+ .fld__select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 26px; }
914
+ .fld.is-err .fld__input, .fld.is-err .fld__select, .fld.is-err .fld__textarea { border-color: var(--err); box-shadow: 0 0 0 3px oklch(from var(--err) l c h / 0.15); }
915
+ .fld__err { font-size: 10.5px; color: var(--err); display: flex; align-items: center; gap: 4px; }
916
+ .fld__ok { font-size: 10.5px; color: var(--ok); display: flex; align-items: center; gap: 4px; }
917
+
918
+ /* ---------- Agent picker (combo) ---------- */
919
+ .combo { position: relative; }
920
+ .combo__btn {
921
+ width: 100%;
922
+ display: flex; align-items: center; gap: 8px;
923
+ background: var(--bg);
924
+ border: 1px solid var(--line);
925
+ border-radius: 6px;
926
+ padding: 6px 8px 6px 6px;
927
+ cursor: pointer;
928
+ font-family: inherit;
929
+ font-size: 12.5px;
930
+ color: var(--ink);
931
+ text-align: left;
932
+ }
933
+ .combo__btn:hover { border-color: var(--line); background: var(--node-hi); }
934
+ .combo__btn:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
935
+ .combo__avatar {
936
+ width: 22px; height: 22px;
937
+ border-radius: 5px;
938
+ display: grid; place-items: center;
939
+ font: 700 10px "Space Grotesk";
940
+ letter-spacing: -0.02em;
941
+ color: oklch(0.25 0.04 265);
942
+ flex-shrink: 0;
943
+ }
944
+ .combo__main { min-width: 0; flex: 1; }
945
+ .combo__name { font-weight: 500; font-size: 12px; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
946
+ .combo__id { font: 10.5px "JetBrains Mono", monospace; color: var(--muted); }
947
+ .combo__chev { color: var(--muted); }
948
+ .combo__menu {
949
+ position: absolute;
950
+ top: calc(100% + 4px);
951
+ left: 0; right: 0;
952
+ background: var(--surface);
953
+ border: 1px solid var(--line);
954
+ border-radius: 8px;
955
+ box-shadow: var(--shadow);
956
+ z-index: 20;
957
+ max-height: 280px;
958
+ overflow: hidden;
959
+ display: flex; flex-direction: column;
960
+ }
961
+ .combo__menu-search {
962
+ padding: 8px;
963
+ border-bottom: 1px solid var(--line-soft);
964
+ }
965
+ .combo__menu-search input {
966
+ width: 100%;
967
+ background: var(--bg);
968
+ border: 1px solid var(--line);
969
+ border-radius: 5px;
970
+ padding: 5px 8px;
971
+ font: 12px "Space Grotesk";
972
+ color: var(--ink);
973
+ }
974
+ .combo__menu-search input:focus { outline: none; border-color: var(--accent-line); }
975
+ .combo__menu-list { overflow-y: auto; padding: 4px; flex: 1; }
976
+ .combo__opt {
977
+ display: flex; align-items: center; gap: 10px;
978
+ padding: 6px 8px;
979
+ border-radius: 5px;
980
+ cursor: pointer;
981
+ }
982
+ .combo__opt:hover, .combo__opt.is-active { background: var(--accent-soft); }
983
+ .combo__opt-name { font-weight: 500; font-size: 12px; letter-spacing: -0.005em; }
984
+ .combo__opt-id { font: 10.5px "JetBrains Mono", monospace; color: var(--muted); }
985
+ .combo__opt-tags { display: flex; gap: 3px; margin-left: auto; }
986
+ .combo__opt-tag {
987
+ font: 500 9.5px "JetBrains Mono", monospace;
988
+ padding: 1px 5px;
989
+ border-radius: 3px;
990
+ background: var(--surface-2);
991
+ color: var(--muted);
992
+ border: 1px solid var(--line-soft);
993
+ }
994
+
995
+ /* ---------- Expression editor ---------- */
996
+ .expr {
997
+ position: relative;
998
+ }
999
+ .expr__box {
1000
+ font-family: "JetBrains Mono", monospace;
1001
+ font-size: 11.5px;
1002
+ line-height: 1.55;
1003
+ background: var(--bg);
1004
+ border: 1px solid var(--line);
1005
+ border-radius: 6px;
1006
+ padding: 8px 10px;
1007
+ color: var(--ink);
1008
+ min-height: 72px;
1009
+ resize: vertical;
1010
+ width: 100%;
1011
+ }
1012
+ .expr__box:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
1013
+ .expr__hint {
1014
+ font: 500 10.5px "Space Grotesk";
1015
+ color: var(--muted);
1016
+ display: flex; gap: 4px; align-items: center; margin-top: 2px;
1017
+ }
1018
+ .expr__hint code {
1019
+ background: var(--surface-2);
1020
+ padding: 1px 5px;
1021
+ border-radius: 3px;
1022
+ color: var(--accent);
1023
+ border: 1px solid var(--line-soft);
1024
+ }
1025
+ .expr__popover {
1026
+ position: absolute;
1027
+ left: 0; top: calc(100% + 4px);
1028
+ background: var(--surface);
1029
+ border: 1px solid var(--line);
1030
+ border-radius: 8px;
1031
+ padding: 6px;
1032
+ max-height: 240px;
1033
+ overflow-y: auto;
1034
+ width: 300px;
1035
+ z-index: 30;
1036
+ box-shadow: var(--shadow);
1037
+ }
1038
+ .expr__pop-group {
1039
+ font: 600 9.5px "JetBrains Mono", monospace;
1040
+ letter-spacing: 0.08em;
1041
+ text-transform: uppercase;
1042
+ color: var(--muted);
1043
+ padding: 8px 8px 4px;
1044
+ }
1045
+ .expr__pop-opt {
1046
+ display: flex; gap: 10px; align-items: center;
1047
+ padding: 5px 8px;
1048
+ border-radius: 5px;
1049
+ cursor: pointer;
1050
+ font: 11.5px "JetBrains Mono", monospace;
1051
+ }
1052
+ .expr__pop-opt:hover, .expr__pop-opt.is-active { background: var(--accent-soft); }
1053
+ .expr__pop-opt b { color: var(--accent); font-weight: 600; }
1054
+ .expr__pop-opt .typ {
1055
+ margin-left: auto;
1056
+ font: 500 9.5px "Space Grotesk";
1057
+ color: var(--muted);
1058
+ padding: 1px 5px;
1059
+ background: var(--surface-2);
1060
+ border-radius: 3px;
1061
+ border: 1px solid var(--line-soft);
1062
+ }
1063
+
1064
+ /* ---------- Cards inside inspector ---------- */
1065
+ .card {
1066
+ background: var(--bg);
1067
+ border: 1px solid var(--line);
1068
+ border-radius: 8px;
1069
+ padding: 10px;
1070
+ display: flex; flex-direction: column; gap: 8px;
1071
+ }
1072
+ .card__head {
1073
+ display: flex; align-items: center; gap: 8px;
1074
+ justify-content: space-between;
1075
+ }
1076
+ .card__title {
1077
+ display: flex; align-items: center; gap: 6px;
1078
+ font-weight: 600; font-size: 11.5px; letter-spacing: -0.005em;
1079
+ }
1080
+ .card__del {
1081
+ background: transparent; border: 0; padding: 3px;
1082
+ border-radius: 4px; color: var(--muted); cursor: pointer;
1083
+ }
1084
+ .card__del:hover { color: var(--err); background: oklch(from var(--err) l c h / 0.12); }
1085
+ .card__kind {
1086
+ font: 600 9.5px "JetBrains Mono", monospace;
1087
+ letter-spacing: 0.08em;
1088
+ text-transform: uppercase;
1089
+ padding: 2px 6px;
1090
+ border-radius: 3px;
1091
+ background: var(--surface-2);
1092
+ color: var(--muted);
1093
+ border: 1px solid var(--line-soft);
1094
+ }
1095
+ .card__add {
1096
+ background: transparent;
1097
+ border: 1px dashed var(--line);
1098
+ border-radius: 6px;
1099
+ padding: 8px;
1100
+ width: 100%;
1101
+ font: 500 11.5px "Space Grotesk";
1102
+ color: var(--muted);
1103
+ cursor: pointer;
1104
+ display: flex; align-items: center; justify-content: center; gap: 6px;
1105
+ }
1106
+ .card__add:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
1107
+
1108
+ /* ---------- Empty inspector state ---------- */
1109
+ .insp__empty {
1110
+ padding: 40px 24px;
1111
+ text-align: center;
1112
+ color: var(--muted);
1113
+ }
1114
+ .insp__empty h3 { font-family: "Instrument Serif", serif; font-weight: 400; font-size: 24px; margin: 4px 0 2px; color: var(--ink); letter-spacing: -0.005em; }
1115
+ .insp__empty p { font-size: 12px; line-height: 1.5; margin: 0; }
1116
+ .insp__empty-shortcuts { display: flex; flex-direction: column; gap: 4px; margin-top: 20px; font-size: 11.5px; color: var(--ink-2); text-align: left; }
1117
+ .insp__empty-shortcuts div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); }
1118
+ .insp__empty-shortcuts div:last-child { border: 0; }
1119
+ .insp__empty-shortcuts div > span:first-child { flex: 1; min-width: 0; text-align: left; white-space: nowrap; color: var(--ink-2); }
1120
+ .insp__empty-shortcuts div > *:not(:first-child) { flex-shrink: 0; display: inline-flex; gap: 4px; }
1121
+
1122
+ /* ---------- Delete-workflow zone (in WorkflowPane) ---------- */
1123
+ .insp__danger {
1124
+ display: flex;
1125
+ justify-content: center;
1126
+ padding: 18px 16px 24px;
1127
+ margin-top: 6px;
1128
+ border-top: 1px solid var(--line-soft);
1129
+ }
1130
+ .insp__delete-wf {
1131
+ height: 30px;
1132
+ padding: 0 14px;
1133
+ font-size: 11.5px;
1134
+ color: var(--err);
1135
+ border-color: color-mix(in oklch, var(--err) 35%, var(--line));
1136
+ }
1137
+ .insp__delete-wf:hover {
1138
+ background: color-mix(in oklch, var(--err) 10%, transparent);
1139
+ border-color: color-mix(in oklch, var(--err) 55%, var(--line));
1140
+ }
1141
+
1142
+ /* ============================================================
1143
+ Tweaks panel
1144
+ ============================================================ */
1145
+ .tweaks {
1146
+ position: fixed;
1147
+ right: 396px;
1148
+ bottom: 16px;
1149
+ width: 260px;
1150
+ background: var(--surface);
1151
+ border: 1px solid var(--line);
1152
+ border-radius: 12px;
1153
+ box-shadow: var(--shadow);
1154
+ z-index: 100;
1155
+ font-size: 12px;
1156
+ overflow: hidden;
1157
+ }
1158
+ .tweaks__head {
1159
+ padding: 10px 12px;
1160
+ border-bottom: 1px solid var(--line-soft);
1161
+ font: 600 10.5px "Space Grotesk"; letter-spacing: 0.1em; text-transform: uppercase;
1162
+ color: var(--muted);
1163
+ display: flex; justify-content: space-between; align-items: center;
1164
+ }
1165
+ .tweaks__body { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
1166
+ .tweaks__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11.5px; }
1167
+ .tweaks__row label { color: var(--muted); }
1168
+ .tweaks__opts { display: flex; gap: 4px; }
1169
+ .tweaks__opts button {
1170
+ font: 500 11px "Space Grotesk";
1171
+ background: transparent;
1172
+ border: 1px solid var(--line);
1173
+ border-radius: 5px;
1174
+ padding: 4px 8px;
1175
+ cursor: pointer;
1176
+ color: var(--ink-2);
1177
+ }
1178
+ .tweaks__opts button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
1179
+ .tweaks__hue {
1180
+ display: flex; gap: 6px; flex-wrap: wrap;
1181
+ }
1182
+ .tweaks__hue button {
1183
+ width: 22px; height: 22px;
1184
+ border-radius: 50%;
1185
+ border: 2px solid transparent;
1186
+ cursor: pointer;
1187
+ padding: 0;
1188
+ }
1189
+ .tweaks__hue button.on { border-color: var(--ink); }
1190
+
1191
+ /* ============================================================
1192
+ Keyboard overlay
1193
+ ============================================================ */
1194
+ .kbd-overlay {
1195
+ position: fixed; inset: 0;
1196
+ background: oklch(0 0 0 / 0.5);
1197
+ z-index: 200;
1198
+ display: grid; place-items: center;
1199
+ backdrop-filter: blur(4px);
1200
+ }
1201
+ .kbd-card {
1202
+ background: var(--surface);
1203
+ border: 1px solid var(--line);
1204
+ border-radius: 14px;
1205
+ padding: 24px 28px;
1206
+ width: 520px;
1207
+ box-shadow: var(--shadow);
1208
+ }
1209
+ .kbd-card h3 { font-family: "Instrument Serif", serif; font-weight: 400; font-size: 28px; margin: 0 0 16px; letter-spacing: -0.01em; }
1210
+ .kbd-card .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12.5px; }
1211
+ .kbd-card .row:last-child { border: 0; }
1212
+ .kbd-card .row span:first-child { color: var(--ink-2); }
1213
+
1214
+ /* ============================================================
1215
+ Toast
1216
+ ============================================================ */
1217
+ .toast {
1218
+ position: fixed;
1219
+ bottom: 20px; left: 50%;
1220
+ transform: translateX(-50%);
1221
+ padding: 8px 16px;
1222
+ background: var(--surface);
1223
+ border: 1px solid var(--line);
1224
+ border-radius: 8px;
1225
+ font-size: 12px;
1226
+ z-index: 150;
1227
+ box-shadow: var(--shadow);
1228
+ display: inline-flex; align-items: center; gap: 8px;
1229
+ }
1230
+ .toast .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
1231
+ .toast.err .dot { background: var(--err); }
1232
+
1233
+ /* ============================================================
1234
+ Connecting-edge ghost
1235
+ ============================================================ */
1236
+ .cv__ghost-edge {
1237
+ position: absolute; inset: 0;
1238
+ pointer-events: none;
1239
+ z-index: 8;
1240
+ }
1241
+ .cv__ghost-edge path {
1242
+ fill: none;
1243
+ stroke: var(--accent);
1244
+ stroke-width: 2;
1245
+ stroke-dasharray: 6 4;
1246
+ animation: dash 0.6s linear infinite;
1247
+ }
1248
+
1249
+ /* Utilities */
1250
+ .hstack { display: flex; gap: 8px; align-items: center; }
1251
+ .vstack { display: flex; flex-direction: column; gap: 8px; }
1252
+ .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
1253
+
1254
+ /* KeyValueEditor \u2014 friendly object editor (replaces JSON textareas
1255
+ * for headers, inputs, payloads, match filters, output maps). */
1256
+ .kv-editor { display: flex; flex-direction: column; gap: 6px; }
1257
+ .kv-editor__empty {
1258
+ font-size: 11px; color: var(--muted);
1259
+ padding: 6px 4px;
1260
+ }
1261
+ .kv-editor__row {
1262
+ display: grid;
1263
+ grid-template-columns: minmax(110px, 1.4fr) auto minmax(150px, 2.4fr) auto;
1264
+ gap: 6px;
1265
+ align-items: start;
1266
+ }
1267
+ .kv-editor__key { min-width: 0; }
1268
+ .kv-editor__type {
1269
+ font-size: 11px; padding: 4px 6px;
1270
+ background: var(--surface); color: var(--ink);
1271
+ border: 1px solid var(--line); border-radius: 4px;
1272
+ }
1273
+ .kv-editor__val { min-width: 0; }
1274
+ .kv-editor__val > * { width: 100%; }
1275
+ .kv-editor__json { resize: vertical; min-height: 28px; }
1276
+ .kv-editor__remove {
1277
+ background: transparent; border: 1px solid transparent;
1278
+ color: var(--muted); padding: 4px 8px;
1279
+ border-radius: 4px; cursor: pointer; font-size: 14px;
1280
+ align-self: start;
1281
+ }
1282
+ .kv-editor__remove:hover {
1283
+ color: var(--err);
1284
+ border-color: var(--err);
1285
+ }
1286
+ .kv-editor__add {
1287
+ align-self: flex-start;
1288
+ background: transparent; color: var(--accent);
1289
+ border: 1px dashed var(--accent); border-radius: 4px;
1290
+ padding: 4px 10px; cursor: pointer; font-size: 12px;
1291
+ margin-top: 2px;
1292
+ }
1293
+ .kv-editor__add:hover { background: var(--surface); }
1294
+
1295
+ /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
1296
+ AgentX design system bridge.
1297
+
1298
+ The editor shipped with its own oklch palette and its own dark/light
1299
+ blocks, so it looked like a different product bolted onto the dashboard.
1300
+ Rather than rewrite 1200 lines, remap the editor's variables onto the
1301
+ AgentX tokens: the canvas then follows the dashboard theme automatically,
1302
+ because those tokens already flip on [data-theme].
1303
+
1304
+ Specificity has to beat :root[data-theme="dark"] and ...="light" above,
1305
+ hence the doubled attribute selector.
1306
+ \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1307
+ :root, :root[data-theme][data-theme] {
1308
+ --bg: var(--ax-bg);
1309
+ --bg-deep: var(--ax-bg-elev);
1310
+ --surface: var(--ax-surface);
1311
+ --surface-2: var(--ax-surface-2);
1312
+ --node: var(--ax-surface);
1313
+ --node-hi: var(--ax-surface-2);
1314
+ --line: var(--ax-border);
1315
+ --line-soft: var(--ax-border);
1316
+ --ink: var(--ax-text);
1317
+ --ink-2: var(--ax-text-2);
1318
+ /* --muted is used for labels people have to read, so it gets the readable
1319
+ step; the genuinely decorative one keeps the lighter grey. */
1320
+ --muted: var(--ax-text-2);
1321
+ --muted-2: var(--ax-muted);
1322
+ --accent: var(--ax-accent);
1323
+ --accent-ink: var(--ax-accent-2);
1324
+ --accent-soft: var(--ax-blue-t);
1325
+ --accent-line: var(--ax-blue-e);
1326
+ --ok: var(--ax-green);
1327
+ --err: var(--ax-red);
1328
+ --radius: var(--ax-radius-sm);
1329
+ --radius-sm: 8px;
1330
+ --shadow: var(--ax-shadow);
1331
+ --grid: var(--ax-border);
1332
+ --grid-bold: var(--ax-border-2);
1333
+ }
1334
+
1335
+ /* The dashboard's type stack, so the canvas is not the one surface in the
1336
+ product using a different face. */
1337
+ #wfe-root, #wfe-root button, #wfe-root input, #wfe-root select, #wfe-root textarea {
1338
+ font-family: var(--ax-font);
1339
+ }
1340
+ #wfe-root code, #wfe-root .mono, #wfe-root pre { font-family: var(--ax-mono); }
1341
+ `;var Pp=oe(tp(),1);var O=oe(Nt(),1);var Be=oe(Nt(),1);var v=oe(Ce(),1),D=({children:e,size:t=14,...n})=>(0,v.jsx)("svg",{viewBox:"0 0 16 16",width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",...n,children:e}),A={gitlab:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M8 14L2 7l1.2-4.5L5 7h6l1.8-4.5L14 7z"})}),clock:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"8",cy:"8",r:"5.5"}),(0,v.jsx)("path",{d:"M8 5v3l2 1.5"})]}),hook:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M4 3v4a4 4 0 0 0 4 4h4"}),(0,v.jsx)("path",{d:"M10 9l2 2-2 2"})]}),play:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M5 3.5l7 4.5-7 4.5z",fill:"currentColor"})}),box:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("rect",{x:"2.5",y:"2.5",width:"11",height:"11",rx:"1.5"}),(0,v.jsx)("path",{d:"M2.5 6h11M6 2.5v11"})]}),branch:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"4",cy:"4",r:"1.5"}),(0,v.jsx)("circle",{cx:"12",cy:"12",r:"1.5"}),(0,v.jsx)("circle",{cx:"12",cy:"4",r:"1.5"}),(0,v.jsx)("path",{d:"M4 5.5v3a2 2 0 0 0 2 2h4.5"}),(0,v.jsx)("path",{d:"M12 5.5v5"})]}),stop:()=>(0,v.jsx)(D,{children:(0,v.jsx)("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1"})}),msg:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M2.5 3.5h11v8h-6l-3 2.5v-2.5h-2z"})}),tag:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M8 2h5v5l-6 6-5-5z"}),(0,v.jsx)("circle",{cx:"10.5",cy:"5.5",r:.8,fill:"currentColor"})]}),bell:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M4 11V7a4 4 0 0 1 8 0v4l1 1.5H3zM6.5 13.5a1.5 1.5 0 0 0 3 0"})}),globe:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"8",cy:"8",r:"5.5"}),(0,v.jsx)("path",{d:"M2.5 8h11M8 2.5c2 2 2 9 0 11M8 2.5c-2 2-2 9 0 11"})]}),search:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"7",cy:"7",r:"4"}),(0,v.jsx)("path",{d:"M10 10l3.5 3.5"})]}),undo:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M4 7h6a3 3 0 0 1 0 6H7"}),(0,v.jsx)("path",{d:"M6.5 4.5L4 7l2.5 2.5"})]}),redo:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M12 7H6a3 3 0 0 0 0 6h3"}),(0,v.jsx)("path",{d:"M9.5 4.5L12 7 9.5 9.5"})]}),save:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M3 3h8l2 2v8H3z"}),(0,v.jsx)("path",{d:"M5 3v4h6V3M5 13v-4h6v4"})]}),run:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M5 3.5l7 4.5-7 4.5z",fill:"currentColor"})}),stop2:()=>(0,v.jsx)(D,{children:(0,v.jsx)("rect",{x:"4",y:"4",width:"8",height:"8",rx:"1",fill:"currentColor"})}),sun:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"8",cy:"8",r:"2.75"}),(0,v.jsx)("path",{d:"M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.5 3.5l1.4 1.4M11.1 11.1l1.4 1.4M3.5 12.5l1.4-1.4M11.1 4.9l1.4-1.4"})]}),moon:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M13 9.5A5.5 5.5 0 0 1 6.5 3 5.5 5.5 0 1 0 13 9.5z"})}),plus:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M8 3v10M3 8h10"})}),trash:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M3 4.5h10M6 4.5V3h4v1.5M4.5 4.5l.5 8h6l.5-8"})}),chev:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M4 6l4 4 4-4"})}),x:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M4 4l8 8M12 4l-8 8"})}),more:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"4",cy:"8",r:"1",fill:"currentColor",stroke:"none"}),(0,v.jsx)("circle",{cx:"8",cy:"8",r:"1",fill:"currentColor",stroke:"none"}),(0,v.jsx)("circle",{cx:"12",cy:"8",r:"1",fill:"currentColor",stroke:"none"})]}),check:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M3 8.5l3 3 7-7"})}),warn:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M8 2l6 11H2z"}),(0,v.jsx)("path",{d:"M8 6.5v3M8 11.2v.3"})]}),err:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"8",cy:"8",r:"5.5"}),(0,v.jsx)("path",{d:"M8 5v3.5M8 10.5v.3"})]}),zoomin:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"7",cy:"7",r:"4"}),(0,v.jsx)("path",{d:"M10 10l3.5 3.5M5 7h4M7 5v4"})]}),zoomout:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"7",cy:"7",r:"4"}),(0,v.jsx)("path",{d:"M10 10l3.5 3.5M5 7h4"})]}),fit:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M3 5V3h2M13 5V3h-2M3 11v2h2M13 11v2h-2"}),(0,v.jsx)("rect",{x:"6",y:"6",width:"4",height:"4",rx:.5})]}),minus:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M3 8h10"})}),kbd:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("rect",{x:"1.5",y:"4",width:"13",height:"8",rx:"1.5"}),(0,v.jsx)("path",{d:"M4 7h.5M6 7h.5M8 7h.5M10 7h.5M4 10h7"})]}),lightning:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M9 2L3 9h4l-1 5 6-7H8z",fill:"currentColor",fillOpacity:.2})}),variable:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M4 3c-2 3-2 7 0 10M12 3c2 3 2 7 0 10"}),(0,v.jsx)("path",{d:"M6 7.5h.5l1 1 1-1h.5M6 10l1.5-1.5M9 10l-1.5-1.5"})]}),users:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"6",cy:"6",r:"2"}),(0,v.jsx)("path",{d:"M2.5 12c.5-2 2-3 3.5-3s3 1 3.5 3"}),(0,v.jsx)("circle",{cx:"11",cy:"5",r:"1.5"}),(0,v.jsx)("path",{d:"M10 10.5c.5-1 1.2-1.5 2-1.5 1 0 2 .8 2.3 2"})]}),grid:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("rect",{x:"2.5",y:"2.5",width:"4",height:"4"}),(0,v.jsx)("rect",{x:"9.5",y:"2.5",width:"4",height:"4"}),(0,v.jsx)("rect",{x:"2.5",y:"9.5",width:"4",height:"4"}),(0,v.jsx)("rect",{x:"9.5",y:"9.5",width:"4",height:"4"})]}),eye:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M1.5 8C3 5 5.3 3.5 8 3.5S13 5 14.5 8C13 11 10.7 12.5 8 12.5S3 11 1.5 8z"}),(0,v.jsx)("circle",{cx:"8",cy:"8",r:"1.8"})]}),slide:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1"}),(0,v.jsx)("path",{d:"M5 6h6M5 8.5h4M5 11h5"})]}),gear:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"8",cy:"8",r:"2"}),(0,v.jsx)("path",{d:"M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.5 3.5l1.4 1.4M11.1 11.1l1.4 1.4M3.5 12.5l1.4-1.4M11.1 4.9l1.4-1.4"})]}),flag:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M3 13V3h7l-1 2.5L10 8H3"})}),dup:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1"}),(0,v.jsx)("path",{d:"M3 9V3h6"})]}),layout:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M2.5 3.5h11v9h-11z"}),(0,v.jsx)("path",{d:"M2.5 7h11M7 7v5.5"})]}),panelLeft:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),(0,v.jsx)("path",{d:"M6 3v10"}),(0,v.jsx)("rect",{x:"2.5",y:"3.5",width:"3.5",height:"9",fill:"currentColor",fillOpacity:.18,stroke:"none"})]}),panelRight:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),(0,v.jsx)("path",{d:"M10 3v10"}),(0,v.jsx)("rect",{x:"10",y:"3.5",width:"3.5",height:"9",fill:"currentColor",fillOpacity:.18,stroke:"none"})]})};var ls=[{section:"What starts it",items:[{id:"trigger.channel.whatsapp",type:"trigger.channel",label:"A WhatsApp message",hint:"Someone messages you on WhatsApp",glyph:"g-trigger",icon:"msg"},{id:"trigger.channel.telegram",type:"trigger.channel",label:"A Telegram message",hint:"Someone messages you on Telegram",glyph:"g-trigger",icon:"msg"},{id:"trigger.channel.gitlab",type:"trigger.channel",label:"Something on GitLab",hint:"An issue, merge request or pipeline changes",glyph:"g-trigger",icon:"gitlab"},{id:"trigger.hook.n8n",type:"trigger.hook",label:"n8n hands work over",hint:"n8n calls this workflow \u2014 it keeps the connectors, you keep the agents",glyph:"g-trigger",icon:"hook"},{id:"trigger.hook",type:"trigger.hook",label:"Something calls in",hint:"Any service that can POST a webhook",glyph:"g-trigger",icon:"hook"},{id:"trigger.cron",type:"trigger.cron",label:"A time of day",hint:"Runs on a schedule you set",glyph:"g-trigger",icon:"clock"},{id:"trigger.manual",type:"trigger.manual",label:"You start it",hint:"Only runs when you press run",glyph:"g-trigger",icon:"play"},{id:"trigger.form",type:"trigger.form",label:"Someone fills a form",hint:"A person submits a form to begin",glyph:"g-trigger",icon:"plus"}]},{section:"Put an agent on it",items:[{id:"node.agent",type:"agent",label:"Ask an agent",hint:"Give an agent the job, in your own words",glyph:"g-state",icon:"box"},{id:"node.transform",type:"transform",label:"Reshape the data",hint:"Build a value out of earlier steps",glyph:"g-state",icon:"variable"}]},{section:"Bring in a person",items:[{id:"node.userTask",type:"userTask",label:"Ask a person",hint:"Send someone a form and wait for their answer",glyph:"g-state",icon:"box"},{id:"node.checkpoint",type:"checkpoint",label:"Wait for approval",hint:"Hold here until someone says go",glyph:"g-branch",icon:"flag"},{id:"node.timer.boundary",type:"timer.boundary",label:"Wait a while",hint:"Pause for an hour, a day, however long",glyph:"g-branch",icon:"clock"}]},{section:"Decide what happens next",items:[{id:"node.classify",type:"classify",label:"Sort it into buckets",hint:"Pick one of your labels \u2014 and take the \u201Cnot sure\u201D path when it cannot tell",glyph:"g-branch",icon:"branch"},{id:"node.branch",type:"branch",label:"If this, then that",hint:"Send the run down one path or another",glyph:"g-branch",icon:"branch"},{id:"node.rule",type:"rule",label:"A table of rules",hint:"Several conditions at once; first match wins",glyph:"g-branch",icon:"branch"},{id:"node.gateway.parallel",type:"gateway.parallel",label:"Do several at once",hint:"Split into parallel paths, then join them",glyph:"g-branch",icon:"branch"},{id:"node.end",type:"end",label:"Finish",hint:"The run ends here",glyph:"g-end",icon:"stop"}]},{section:"Do something",items:[{id:"action.send",type:"action.send",label:"Send a message",hint:"Post to WhatsApp, Telegram, GitLab \u2014 anywhere you have a channel",glyph:"g-action",icon:"msg"},{id:"action.createIssue",type:"action.createIssue",label:"Open an issue",hint:"Create a new GitLab issue",glyph:"g-action",icon:"plus"},{id:"action.setLabel",type:"action.setLabel",label:"Change a label",hint:"Add or remove labels",glyph:"g-action",icon:"tag"},{id:"action.react",type:"action.react",label:"React to a message",hint:"Add an emoji reaction",glyph:"g-action",icon:"msg"},{id:"action.editMessage",type:"action.editMessage",label:"Edit a message",hint:"Change a message you already sent",glyph:"g-action",icon:"msg"},{id:"action.readLabel",type:"action.readLabel",label:"Read a label",hint:"Look at the labels on an issue before deciding",glyph:"g-action",icon:"tag"},{id:"action.callHTTP",type:"action.callHTTP",label:"Call a web address",hint:"Hand work to n8n, or any service with a URL",glyph:"g-action",icon:"globe"},{id:"action.builtin",type:"action.builtin",label:"Use a built-in step",hint:"Fetch a page, extract fields, and other bundled helpers",glyph:"g-action",icon:"lightning"},{id:"action.run",type:"action.run",label:"Run a saved action",hint:"Invoke something from your action registry",glyph:"g-action",icon:"lightning"},{id:"action.logTime",type:"action.logTime",label:"Log time spent",hint:"Record how long this took",glyph:"g-action",icon:"clock"}]},{section:"Talk to other workflows",items:[{id:"node.subProcess",type:"subProcess",label:"Run another workflow",hint:"Call one, and carry on when it finishes",glyph:"g-state",icon:"box"},{id:"node.signal.emit",type:"signal.emit",label:"Tell other workflows",hint:"Announce that something happened",glyph:"g-action",icon:"msg"},{id:"node.signal.wait",type:"signal.wait",label:"Wait to be told",hint:"Hold until another workflow announces it",glyph:"g-branch",icon:"flag"}]}],ss=[{group:"issue",items:[{path:"issue.title",type:"string"},{path:"issue.labels",type:"string[]"},{path:"issue.assignee",type:"string?"},{path:"issue.author",type:"string"},{path:"issue.body",type:"string"},{path:"issue.iid",type:"number"},{path:"issue.url",type:"string"}]},{group:"run",items:[{path:"run.id",type:"string"},{path:"run.state",type:"string"},{path:"run.workflow",type:"string"},{path:"run.homeNode",type:"string"}]},{group:"pipeline",items:[{path:"pipeline.status",type:"enum"},{path:"pipeline.ref",type:"string"},{path:"pipeline.id",type:"number"}]},{group:"state",items:[{path:"state.previous",type:"string?"},{path:"state.next",type:"string?"}]},{group:"env",items:[{path:"env.GITLAB_TOKEN",type:"secret (allowlist req.)"},{path:"env.GITLAB_HOST",type:"string (allowlist req.)"}]}],us=[{id:"tpl.gitlab",title:"GitLab issue lifecycle",hint:"Triage \u2192 Review \u2192 QA \u2192 Done \xB7 5 states",dots:3},{id:"tpl.mr",title:"MR review loop",hint:"Agent-driven 3-state review",dots:2},{id:"tpl.blank",title:"Blank canvas",hint:"Start from a single trigger",dots:1}],ip=[{id:"triage-agent",name:"Triage Agent",tags:["default"],color:200},{id:"dev-agent",name:"Dev Agent",tags:["default"],color:145},{id:"code-reviewer",name:"Code Reviewer",tags:["default"],color:28}];function ap(e){for(let t of ls){let n=t.items.find(r=>r.type===e);if(n)return n.label}return e}function lp(e,t){let n=o=>typeof t[o]=="string"?t[o].trim():"",r=(o,i=70)=>o.length>i?o.slice(0,i-1)+"\u2026":o;switch(e){case"trigger.channel":return n("source")?`when ${n("source")} has activity`:"";case"trigger.cron":return n("schedule")?`at ${n("schedule")}`:"";case"trigger.hook":return n("event")==="on:n8n"?"when n8n calls":n("event")?`on ${n("event")}`:"";case"trigger.form":return n("formId")?`form: ${n("formId")}`:"";case"agent":{let o=n("agentId")||n("agent"),i=n("prompt")||n("message");return[o&&`ask ${o}`,i&&r(i)].filter(Boolean).join(" \u2014 ")}case"action.send":return r(n("text")||n("body"))||n("channel")&&`to ${n("channel")}`;case"action.callHTTP":return r(n("url"));case"action.builtin":return n("name");case"action.run":return n("action")||n("name");case"action.createIssue":return r(n("title"));case"action.setLabel":return n("label")?`label: ${n("label")}`:"";case"subProcess":return n("workflowId")?`runs ${n("workflowId")}`:"";case"signal.emit":case"signal.wait":return n("signal")?`signal: ${n("signal")}`:"";case"timer.boundary":return n("duration")?`waits ${n("duration")}`:"";case"userTask":return n("assignTo")?`asks ${n("assignTo")}`:"";case"branch":{let o=Array.isArray(t.cases)?t.cases.length:0;return o?`${o} way${o===1?"":"s"} out`:""}default:return""}}var F=oe(Ce(),1),ch={trigger:220,state:240,branch:260,action:220,end:160,agent:240,checkpoint:220,transform:220},dh={trigger:46,state:118,branch:110,action:78,end:46,agent:118,checkpoint:92,transform:78};function up(e){return e.startsWith("trigger.")?"trigger":e.startsWith("action.")?"action":e}function nr(e){let t=up(e.type);return{w:ch[t]??220,h:dh[t]??100}}function rr(e){return e.position?.x??0}function or(e){return e.position?.y??0}function Ri(e,t){let{w:n,h:r}=nr(e),o=rr(e),i=or(e);return t==="in"?{x:o,y:i+r/2}:t==="out"?{x:o+n,y:i+r/2}:t==="true"?{x:o+n,y:i+r*.3}:t==="false"?{x:o+n,y:i+r*.7}:{x:o+n/2,y:i+r/2}}function sp(e,t){let n=Math.max(40,Math.abs(t.x-e.x)*.45);return`M ${e.x} ${e.y} C ${e.x+n} ${e.y}, ${t.x-n} ${t.y}, ${t.x} ${t.y}`}function ph(e){let{n:t,selected:n,state:r}=e,{w:o}=nr(t),i=up(t.type),a=lp(t.type,t.config??{}),u=t.config,s=i==="trigger"?u.source==="cron"?"clock":u.source==="webhook"||u.source==="hook"?"hook":u.source==="manual"?"play":"gitlab":i==="agent"?"box":i==="branch"?"branch":i==="action"?t.type==="action.send"?"msg":t.type==="action.setLabel"?"tag":t.type==="action.react"?"bell":t.type==="action.callHTTP"?"globe":t.type==="action.logTime"?"clock":t.type==="action.createIssue"?"plus":"lightning":i==="checkpoint"?"flag":i==="transform"?"variable":"stop",c=A[s]??A.box,d=["node",`t-${i}`,n&&"is-selected",r==="running"&&"is-running",r==="visited"&&"is-visited",r==="error"&&"is-error"].filter(Boolean).join(" "),p={left:rr(t),top:or(t),width:o},m=u.agentId,y=u.prompt;return(0,F.jsxs)("div",{className:d,style:p,onMouseDown:w=>e.onMouseDown?.(w,t),onClick:w=>e.onClick?.(w,t),onDoubleClick:w=>e.onDoubleClick?.(w,t),children:[(0,F.jsx)("div",{className:"node__stripe"}),(0,F.jsxs)("div",{className:"node__head",children:[(0,F.jsx)("div",{className:"node__icon",children:(0,F.jsx)(c,{})}),(0,F.jsxs)("div",{className:"node__meta",children:[(0,F.jsx)("div",{className:"node__kind",children:ap(t.type)}),(0,F.jsx)("div",{className:"node__name",children:t.id})]}),i!=="trigger"&&i!=="end"&&(0,F.jsx)("div",{className:"node__chev",children:(0,F.jsx)(A.more,{})})]}),a&&(0,F.jsx)("div",{className:"node__body",children:(0,F.jsx)("div",{className:"node__row node__row--summary",children:a})}),i!=="trigger"&&(0,F.jsx)("div",{className:"handle h-in",onMouseDown:w=>e.onPortDown?.(w,t,"in"),onMouseEnter:()=>e.onPortEnter?.(t,"in"),onMouseLeave:()=>e.onPortLeave?.()}),i==="branch"?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"handle h-true",onMouseDown:w=>e.onPortDown?.(w,t,"true"),onMouseEnter:()=>e.onPortEnter?.(t,"true"),onMouseLeave:()=>e.onPortLeave?.(),children:(0,F.jsx)("span",{className:"handle__label",children:"true"})}),(0,F.jsx)("div",{className:"handle h-false",onMouseDown:w=>e.onPortDown?.(w,t,"false"),onMouseEnter:()=>e.onPortEnter?.(t,"false"),onMouseLeave:()=>e.onPortLeave?.(),children:(0,F.jsx)("span",{className:"handle__label",children:"false"})})]}):i!=="end"&&(0,F.jsx)("div",{className:"handle h-out",onMouseDown:w=>e.onPortDown?.(w,t,"out"),onMouseEnter:()=>e.onPortEnter?.(t,"out"),onMouseLeave:()=>e.onPortLeave?.()})]})}function fh({nodes:e,viewBox:t,selection:n,hostRef:r}){let[o,i]=(0,Be.useState)(!1);if(!e.length)return null;let a=60,u=e.map(E=>rr(E)),s=e.map(E=>or(E)),c=e.map(E=>nr(E).w),d=e.map(E=>nr(E).h),p=Math.min(...u)-a,m=Math.min(...s)-a,y=Math.max(...u.map((E,K)=>E+c[K]))+a,w=Math.max(...s.map((E,K)=>E+d[K]))+a,S=y-p,H=w-m,g=r.current?.getBoundingClientRect(),f=g?.width??800,h=g?.height??500,x=-t.tx/t.zoom,C=-t.ty/t.zoom,P=f/t.zoom,M=h/t.zoom;return(0,F.jsxs)("div",{className:"cv__mini"+(o?" is-collapsed":""),children:[(0,F.jsxs)("div",{className:"cv__mini-head",children:[(0,F.jsx)("span",{children:"Map"}),(0,F.jsx)("button",{onClick:()=>i(!o),children:(0,F.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:(0,F.jsx)("path",{d:o?"M2 4l3 3 3-3":"M2 6l3-3 3 3",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round"})})})]}),!o&&(0,F.jsxs)("svg",{viewBox:`${p} ${m} ${S} ${H}`,preserveAspectRatio:"xMidYMid meet",children:[(0,F.jsx)("rect",{className:"mini-view",x,y:C,width:P,height:M}),e.map(E=>{let K=nr(E),W=n?.kind==="node"&&n.id===E.id;return(0,F.jsx)("rect",{className:"mini-node"+(W?" sel":""),x:rr(E),y:or(E),width:K.w,height:K.h,rx:3},E.id)})]})]})}function cp(e){let{nodes:t,edges:n,selection:r,setSelection:o,onNodeMove:i,onAddNode:a,onConnect:u,runState:s,viewBox:c,setViewBox:d}=e,p=(0,Be.useRef)(null),[m,y]=(0,Be.useState)(null),[w,S]=(0,Be.useState)(null),[H,g]=(0,Be.useState)(!1),[f,h]=(0,Be.useState)(null),[x,C]=(0,Be.useState)(null),[P,M]=(0,Be.useState)(null),{zoom:E,tx:K,ty:W}=c,ve=(N,j)=>{let U=p.current;if(!U)return{x:0,y:0};let Y=U.getBoundingClientRect();return{x:(N-Y.left-K)/E,y:(j-Y.top-W)/E}},ir=N=>{let j=N.target;j!==N.currentTarget&&!j.classList.contains("cv__viewport")||N.button!==0&&N.button!==1||(o(null),C({startX:N.clientX,startY:N.clientY,tx:K,ty:W}))},Sn=(N,j)=>{if(N.target.classList.contains("handle"))return;N.stopPropagation(),o({kind:"node",id:j.id});let U=ve(N.clientX,N.clientY);y({id:j.id,offX:U.x-rr(j),offY:U.y-or(j)})},ar=(N,j,U)=>{N.stopPropagation(),N.preventDefault();let Y=Ri(j,U);S({from:{id:j.id,port:U},x:Y.x,y:Y.y})},ao=(N,j)=>{w&&h({id:N.id,port:j})},lr=()=>h(null);(0,Be.useEffect)(()=>{let N=U=>{if(m){let Y=ve(U.clientX,U.clientY);i(m.id,Y.x-m.offX,Y.y-m.offY)}else if(w){let Y=ve(U.clientX,U.clientY);S(q=>q&&{...q,x:Y.x,y:Y.y})}else x&&d(Y=>({...Y,tx:x.tx+(U.clientX-x.startX),ty:x.ty+(U.clientY-x.startY)}))},j=()=>{w&&f&&f.id!==w.from.id&&u({from:w.from.id,fromPort:w.from.port,to:f.id,toPort:"in"}),y(null),S(null),C(null),h(null)};return window.addEventListener("mousemove",N),window.addEventListener("mouseup",j),()=>{window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",j)}},[m,w,x,f,u,i,d]);let at=N=>{if(!N.ctrlKey&&!N.metaKey&&Math.abs(N.deltaY)<30){d(Z=>({...Z,tx:Z.tx-N.deltaX,ty:Z.ty-N.deltaY}));return}N.preventDefault();let j=p.current;if(!j)return;let U=j.getBoundingClientRect(),Y=N.clientX-U.left,q=N.clientY-U.top,Ge=-N.deltaY*.0015;d(Z=>{let qe=Math.min(2,Math.max(.3,Z.zoom*(1+Ge))),ze=qe/Z.zoom;return{zoom:qe,tx:Y-(Y-Z.tx)*ze,ty:q-(q-Z.ty)*ze}})},lt=()=>d(N=>({...N,zoom:Math.min(2,N.zoom*1.15)})),Ai=()=>d(N=>({...N,zoom:Math.max(.3,N.zoom/1.15)})),Di=()=>{let N=p.current;if(!N||!t.length)return;let j=N.getBoundingClientRect(),U=60,Y=1/0,q=1/0,Ge=-1/0,Z=-1/0;t.forEach(st=>{let cr=nr(st),dr=rr(st),lo=or(st);Y=Math.min(Y,dr),q=Math.min(q,lo),Ge=Math.max(Ge,dr+cr.w),Z=Math.max(Z,lo+cr.h)});let qe=Ge-Y+U*2,ze=Z-q+U*2,ye=Math.min(1,Math.min(j.width/qe,j.height/ze));d({zoom:ye,tx:(j.width-qe*ye)/2-(Y-U)*ye,ty:(j.height-ze*ye)/2-(q-U)*ye})},sr=N=>{N.preventDefault(),g(!0)},Cn=()=>g(!1),ur=N=>{N.preventDefault(),g(!1);let j=N.dataTransfer.getData("application/x-wfe-item");if(j)try{let U=JSON.parse(j),Y=ve(N.clientX,N.clientY);a(U,Y.x-100,Y.y-40)}catch{}},ji=N=>{let j=N.id??"",U=["wfe-edge"];return r?.kind==="edge"&&r.id===j&&U.push("is-selected"),P===j&&U.push("is-hover"),s?.currentEdgeId===j&&U.push("is-running"),j&&s?.visitedEdges?.has(j)&&U.push("is-visited"),N.fromPort==="true"&&U.push("is-true"),N.fromPort==="false"&&U.push("is-false"),U.join(" ")},Ui=N=>s?.currentNodeId===N.id?"running":s?.visitedNodes?.has(N.id)?"visited":null,Wi=(0,Be.useMemo)(()=>{if(!w)return null;let N=t.find(Y=>Y.id===w.from.id);if(!N)return null;let j=Ri(N,w.from.port),U={x:w.x,y:w.y};return(0,F.jsx)("svg",{className:"cv__ghost-edge",width:"4000",height:"2400",children:(0,F.jsx)("path",{d:sp(j,U)})})},[w,t]);return(0,F.jsxs)("div",{className:"cv"+(x?" is-panning":"")+(H?" is-drop-target":""),ref:p,onWheel:at,onMouseDown:ir,onDragOver:sr,onDragLeave:Cn,onDrop:ur,children:[(0,F.jsxs)("div",{className:"cv__viewport",style:{transform:`translate(${K}px, ${W}px) scale(${E})`},children:[(0,F.jsxs)("svg",{className:"cv__edges",width:"4000",height:"2400",children:[(0,F.jsxs)("defs",{children:[(0,F.jsx)("marker",{id:"arr",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto",children:(0,F.jsx)("path",{d:"M0 0L10 5L0 10z",fill:"currentColor"})}),(0,F.jsx)("marker",{id:"arr-ok",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto",children:(0,F.jsx)("path",{d:"M0 0L10 5L0 10z",fill:"var(--ok)"})}),(0,F.jsx)("marker",{id:"arr-err",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto",children:(0,F.jsx)("path",{d:"M0 0L10 5L0 10z",fill:"var(--err)"})}),(0,F.jsx)("marker",{id:"arr-acc",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto",children:(0,F.jsx)("path",{d:"M0 0L10 5L0 10z",fill:"var(--accent)"})})]}),n.map((N,j)=>{let U=t.find(st=>st.id===N.from),Y=t.find(st=>st.id===N.to);if(!U||!Y)return null;let q=N.id??`e-${j}`,Ge=Ri(U,N.fromPort??"out"),Z=Ri(Y,N.toPort??"in"),qe=sp(Ge,Z),ze={x:(Ge.x+Z.x)/2,y:(Ge.y+Z.y)/2},ye=s?.currentEdgeId===q||s?.visitedEdges?.has(q)?"url(#arr-acc)":N.fromPort==="true"?"url(#arr-ok)":N.fromPort==="false"?"url(#arr-err)":"url(#arr)";return(0,F.jsxs)("g",{children:[(0,F.jsx)("path",{className:"edge-bg",d:qe,onMouseEnter:()=>M(q),onMouseLeave:()=>M(null),onClick:()=>o({kind:"edge",id:q})}),(0,F.jsx)("path",{className:ji(N),d:qe,markerEnd:ye}),N.label&&(0,F.jsxs)("g",{transform:`translate(${ze.x},${ze.y})`,children:[(0,F.jsx)("rect",{className:"edge-label-bg",x:-N.label.length*3.6-6,y:-9,rx:3,width:N.label.length*7.2+12,height:18}),(0,F.jsx)("text",{className:"edge-label",y:4,textAnchor:"middle",children:N.label})]})]},q)})]}),Wi,t.map(N=>(0,F.jsx)(ph,{n:N,selected:r?.kind==="node"&&r.id===N.id,state:Ui(N),onMouseDown:Sn,onPortDown:ar,onPortEnter:ao,onPortLeave:lr,onClick:(j,U)=>{j.stopPropagation(),o({kind:"node",id:U.id})}},N.id))]}),(0,F.jsxs)("div",{className:"cv__controls",children:[(0,F.jsx)("button",{title:"Zoom out",onClick:Ai,children:(0,F.jsx)(A.zoomout,{})}),(0,F.jsxs)("div",{className:"cv__zoom",children:[Math.round(E*100),"%"]}),(0,F.jsx)("button",{title:"Zoom in",onClick:lt,children:(0,F.jsx)(A.zoomin,{})}),(0,F.jsx)("button",{title:"Fit",onClick:Di,children:(0,F.jsx)(A.fit,{})})]}),(0,F.jsx)(fh,{nodes:t,viewBox:c,selection:r,hostRef:p})]})}var ne=oe(Nt(),1);var gh=[{path:"channel",type:"string",description:"Channel name that received the event.",example:'"whatsapp"',sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"chatId",type:"string",description:"Stable chat id \u2014 conversation partner JID (WhatsApp) or chat integer (Telegram). Use as `action.send` chatId to reply on the same thread.",example:'"10000000000@s.whatsapp.net"',sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"accountId",type:"string",description:"Which bot account received the message. Telegram routes this per-account; inherit into `action.send` to reply through the same bot.",example:'"default"',sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"text",type:"string",description:"Message body (caption for media), lower-cased for routing but the raw text here is verbatim.",example:'"hello"',sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"fromJid",type:"string",description:"Raw sender JID/id straight from the platform. Use `sender.id` for the normalized form.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"sender.id",type:"string",description:"Normalized sender id.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"sender.name",type:"string",description:"Display name, e.g. WhatsApp pushName or Telegram first_name.",example:'"Alex"',sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"sender.username",type:"string",description:"Platform-specific handle when available (Telegram @username, ...).",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"group.id",type:"string",description:"Group chat id when the message came from a group; undefined for DMs.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"group.name",type:"string",description:"Group display name when available.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"replyTo",type:"string",description:"ID of the message this one quoted, when any.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"replyToText",type:"string",description:"Text of the quoted message when available.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"media.path",type:"string",description:"Filesystem path of the attached media after download.",sourceFilter:["whatsapp-message","telegram-message"]},{path:"media.type",type:"string",description:"MIME type of the media (`image/jpeg`, `audio/ogg`, ...).",sourceFilter:["whatsapp-message","telegram-message"]},{path:"event.id",type:"string",description:"Platform message id. Use as `action.send` replyTo to thread replies.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"event.timestamp",type:"string",description:"ISO-8601 timestamp of the source message.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"issue.iid",type:"number",description:"GitLab internal issue id (per project).",example:"42",sourceFilter:["gitlab-issue"]},{path:"issue.title",type:"string",description:"Issue title.",sourceFilter:["gitlab-issue"]},{path:"issue.description",type:"string",description:"Issue description body.",sourceFilter:["gitlab-issue"]},{path:"issue.url",type:"string",description:"Web URL of the issue.",sourceFilter:["gitlab-issue"]},{path:"issue.action",type:"string",description:"Action that triggered the event (`open`, `update`, `close`, ...).",sourceFilter:["gitlab-issue"]},{path:"issue.labels",type:"array",description:"Current labels on the issue.",sourceFilter:["gitlab-issue"]},{path:"issue.assignees",type:"array",description:"Assignees on the issue.",sourceFilter:["gitlab-issue"]},{path:"project",type:"string",description:"GitLab project path.",example:'"acme/web"',sourceFilter:["gitlab-issue","gitlab-pipeline"]},{path:"chatId",type:"string",description:'Stable entity id for GitLab: "<project>:issue:<iid>" (issue) or "<project>:merge_request:<iid>" (pipeline).',sourceFilter:["gitlab-issue","gitlab-pipeline"]},{path:"channel",type:"string",description:'Always `"gitlab"` for GitLab sources.',sourceFilter:["gitlab-issue","gitlab-pipeline"]},{path:"pipeline.id",type:"number",description:"Pipeline id.",sourceFilter:["gitlab-pipeline"]},{path:"pipeline.status",type:"string",description:"Pipeline status (`success`, `failed`, `canceled`, ...).",sourceFilter:["gitlab-pipeline"]},{path:"pipeline.ref",type:"string",description:"Git ref the pipeline ran on.",sourceFilter:["gitlab-pipeline"]}],hh=[{path:"reply",type:"string",description:"Full agent response text. Most common template target (e.g. echoing it back via `action.send`).",example:'"Got it \u2014 routing to..."'},{path:"result",type:"string",description:"Parsed `RESULT: <token>` marker from the agent's reply (lowercased), or `approved`/`rejected`/`done`/`failed` from a `[BRACKET]`. Used by `branch` nodes to route on agent classification.",example:'"approved"'},{path:"json",type:"any",description:"When `resultParser` is `json`, the parsed first fenced ```json ... ``` block. Useful for structured agent outputs."},{path:"taskId",type:"string",description:"Opaque workflow-scoped task id \u2014 mostly for diagnostics.",example:'"wf-<runId>-<suffix>"'},{path:"durationMs",type:"number",description:"Wall-clock duration of the agent call.",example:"14520"}],mh=[{path:"messageId",type:"string",description:"Platform message id of the sent message. `null` when the adapter couldn't capture it (e.g. mesh-forwarded sends may return null)."},{path:"viaMesh",type:"bool",description:"`true` when the send was forwarded over the mesh to a peer that hosts the channel (workflow on one node, channel adapter on another). Absent for local sends."}],vh=[{path:"issue.iid",type:"number",description:"Newly-created issue iid.",example:"123"},{path:"issue.url",type:"string",description:"Web URL of the new issue."},{path:"issue.webUrl",type:"string",description:"Alias of `issue.url`."}],yh=[{path:"labels",type:"array",description:"Label list after the change."},{path:"add",type:"array",description:"Labels that were added in this call."},{path:"remove",type:"array",description:"Labels that were removed in this call."}],wh=[{path:"labels",type:"array",description:"Current label list on the entity. Use with a `branch` node to route on label state."}],xh=[{path:"emoji",type:"string",description:"The emoji reaction that was applied (echoes the input for debugging)."}],kh=[{path:"edited",type:"bool",description:"`true` when the platform accepted the edit. Treat `false` as a soft miss \u2014 text may have been unchanged or the message was too old."}],bh=[{path:"durationMs",type:"number",description:"Duration logged, in milliseconds (echoed for downstream use)."}],_h=[{path:"ok",type:"bool",description:"Response.ok \u2014 `true` for 2xx."},{path:"status",type:"number",description:"HTTP status code.",example:"200"},{path:"body",type:"any",description:"Parsed JSON body when the response was JSON; otherwise the raw text string."}],Sh=[{path:"ok",type:"bool",description:"`true` when the action exited 0 (shell) or returned 2xx (http)."},{path:"status",type:"number",description:"Exit code (shell) or HTTP status (http)."},{path:"output",type:"string",description:"stdout (shell) or response body text (http). Capped at 32KB."},{path:"errors",type:"string",description:"stderr (shell) or transport error (http). Empty when none."},{path:"durationMs",type:"number",description:"Wall time of the invocation, in milliseconds."}],Ch=[{path:"*",type:"any",description:"The built-in's typed response. Shape depends on the action \u2014 e.g. http.fetch returns {status, statusText, headers, body, truncated, url}; mesh.delegate returns {peer, agent, response}; extract.structured returns {data, model, usage}. See GET /api/actions/builtin for each action's schema."}],Nh=[{path:"port",type:"string",description:"Which outgoing port matched. Downstream edges with `fromPort` matching this value will fire."}],Eh=[{path:"label",type:"string",description:"The label chosen. Also the port that fires.",example:'"bug"'},{path:"result",type:"string",description:"Alias of `label`, so a workflow migrating off an `agent` + RESULT-token node keeps its existing {{node.result}} references working.",example:'"bug"'},{path:"confidence",type:"number",description:"How peaked the distribution was, 0-1. Compare against the node's minConfidence.",example:"0.93"},{path:"probabilities",type:"object",description:"The full distribution over labels \u2014 every label with its probability.",example:'{"bug":0.93,"feature":0.05,"question":0.02}'},{path:"unsure",type:"bool",description:"True when confidence fell below minConfidence and the `unsure` port fired instead of a label port.",example:"false"},{path:"port",type:"string",description:"The port that fired: the chosen label, or `unsure`.",example:'"bug"'}],Th=[{path:"value",type:"any",description:"When config uses `path`, this carries the value picked from context. In `template` mode, keys from the rendered template land at the top level of this node's output (no `.value` prefix)."}],Ph=[{path:"event",type:"any",description:"Payload of the event that resumed this checkpoint. Fields mirror whichever trigger source delivered the resume event."}],Fh=[{path:"name",type:"string",description:"Name of the signal that resumed the wait."},{path:"payload",type:"any",description:"Payload the emitter attached to the signal."},{path:"receivedAt",type:"string",description:"ISO-8601 time the signal was observed."}],Mh=[{path:"emittedAt",type:"string",description:"ISO-8601 time the signal was published."}],Rh=[{path:"firedAt",type:"string",description:"ISO-8601 time the timer elapsed (when resumed)."},{path:"scheduledFor",type:"string",description:"ISO-8601 time the timer was originally scheduled for."}],Ih=[{path:"childRunId",type:"string",description:"Run id of the spawned child workflow."},{path:"result",type:"any",description:"Output bundle of the child's terminal `end` node (if any)."}],cs={"trigger.channel":{summary:"Raw event payload from the source channel. Shape varies by `source` \u2014 the Context panel filters accordingly.",fields:gh},"trigger.manual":{summary:"Arbitrary payload posted by `agentx workflow run <id>` / POST /workflows/:id/run.",fields:[{path:"",type:"any",description:"Whatever JSON the caller supplied."}]},"trigger.cron":{summary:"Scheduled tick \u2014 no data bundle beyond the firing metadata.",fields:[{path:"firedAt",type:"string",description:"ISO-8601 time the tick fired."},{path:"cronSpec",type:"string",description:"The `spec` from the node's config (echoed for debug)."}]},"trigger.hook":{summary:"Fires when a custom hook event bubbles through the registry. Payload is whatever the hook subscriber chose to emit.",fields:[{path:"",type:"any",description:"Hook-specific payload."}]},"trigger.form":{summary:"Starts when a published form receives a submission.",fields:[{path:"formId",type:"string",description:"Form id that received the submission."},{path:"submission",type:"object",description:"Submitted values keyed by field id."},{path:"submittedBy",type:"string",description:"Actor id of the submitter."}]},agent:{summary:"Agent response after executing the prompt template.",fields:hh},classify:{summary:"A typed classification with a full probability distribution. Branches on its own result: the port named after the winning label fires, or `unsure` when nothing clears minConfidence.",fields:Eh},transform:{summary:"Value picked from upstream context (path mode) or rendered template bundle (template mode).",fields:Th},branch:{summary:"Which outgoing port fired. Downstream edges match via `fromPort`.",fields:Nh},"gateway.parallel":{summary:"All incoming branches joined here. No output.",fields:[]},rule:{summary:"Evaluates a declarative rule against context; may short-circuit the walk.",fields:[]},"action.send":{summary:"Dispatched an outbound message through the chosen channel.",fields:mh},"action.createIssue":{summary:"Created an issue on GitLab/GitHub.",fields:vh},"action.setLabel":{summary:"Added/removed labels on a GitLab issue or MR.",fields:yh},"action.readLabel":{summary:"Fetched the current label list \u2014 useful before a `branch`.",fields:wh},"action.react":{summary:"Emoji reaction on a message (Telegram/WhatsApp).",fields:xh},"action.editMessage":{summary:"Edited an existing message in place.",fields:kh},"action.logTime":{summary:"Logged time spent on a GitLab issue/MR.",fields:bh},"action.callHTTP":{summary:"Made an outbound HTTP request with templated params.",fields:_h},"action.run":{summary:"Invoked a registered action from the action registry. Output is the full ActionRunResult.",fields:Sh},"action.builtin":{summary:"Invoked a daemon-shipped typed built-in action (improvement plan #6) by name. Output is the built-in's validated response.",fields:Ch},subProcess:{summary:"Spawned a child workflow and waited for its completion.",fields:Ih},"signal.emit":{summary:"Published a signal to the bus. Runs elsewhere can resume on it via `signal.wait`.",fields:Mh},"signal.wait":{summary:"Paused until a matching signal arrives. Resumes with that signal in this node's output.",fields:Fh},"timer.boundary":{summary:"Paused until a timer elapses. Resumes with timing metadata.",fields:Rh},checkpoint:{summary:"Paused until a matching resume event arrives on this entity.",fields:Ph},end:{summary:"Terminal node \u2014 closes the run with the configured status. No output downstream.",fields:[]}};function dp(e,t={}){let n=cs[e];if(!n)return[];let r=typeof t.source=="string"?t.source:void 0;return r?n.fields.filter(o=>!o.sourceFilter||o.sourceFilter.includes(r)):n.fields.filter(o=>!o.sourceFilter)}var l=oe(Ce(),1);function L({title:e,children:t,defaultOpen:n=!0,right:r}){let[o,i]=(0,ne.useState)(n);return(0,l.jsxs)("div",{className:"insp__section"+(o?"":" is-collapsed"),children:[(0,l.jsxs)("div",{className:"insp__section-head",onClick:()=>i(!o),children:[(0,l.jsx)("span",{className:"chev",children:(0,l.jsx)(A.chev,{})}),(0,l.jsx)("h4",{children:e}),r]}),(0,l.jsx)("div",{className:"insp__section-body",children:t})]})}function k({label:e,hint:t,err:n,children:r,mono:o}){return(0,l.jsxs)("div",{className:"fld"+(o?" is-mono":"")+(n?" is-err":""),children:[(0,l.jsxs)("div",{className:"fld__label",children:[(0,l.jsx)("span",{children:e}),t&&(0,l.jsx)("span",{className:"fld__hint",children:t})]}),r,n&&(0,l.jsxs)("div",{className:"fld__err",children:[(0,l.jsx)(A.err,{}),n]})]})}function I({value:e,onChange:t,placeholder:n,mono:r,list:o}){return(0,l.jsx)("input",{className:"fld__input"+(r?" mono":""),type:"text",value:e,placeholder:n,list:o,onChange:i=>t(i.target.value)})}function xn({value:e,onChange:t,placeholder:n}){return(0,l.jsx)("input",{className:"fld__input",type:"number",value:e??"",placeholder:n,onChange:r=>{let o=r.target.value.trim();t(o===""?void 0:Number(o))}})}function Ii({value:e,onChange:t,rows:n=3,placeholder:r,mono:o}){return(0,l.jsx)("textarea",{className:"fld__input"+(o?" mono":""),rows:n,spellCheck:!1,value:e,placeholder:r,onChange:i=>t(i.target.value)})}function ue({value:e,onChange:t,options:n}){return(0,l.jsx)("select",{className:"fld__select",value:e,onChange:r=>t(r.target.value),children:n.map(r=>{let o=typeof r=="string"?r:r.value,i=typeof r=="string"?r:r.label;return(0,l.jsx)("option",{value:o,children:i},o)})})}function Li({checked:e,onChange:t,label:n}){return(0,l.jsxs)("label",{className:"fld__check",style:{display:"flex",gap:8,alignItems:"center",fontSize:12},children:[(0,l.jsx)("input",{type:"checkbox",checked:e,onChange:r=>t(r.target.checked)}),(0,l.jsx)("span",{children:n})]})}function vt({value:e,onChange:t,placeholder:n,mono:r}){return(0,l.jsx)("input",{className:"fld__input"+(r?" mono":""),type:"text",value:e.join(", "),placeholder:n,onChange:o=>t(o.target.value.split(",").map(i=>i.trim()).filter(Boolean))})}function Lh(e){return typeof e=="boolean"?"boolean":typeof e=="number"?"number":Array.isArray(e)?"list":e&&typeof e=="object"?"json":"string"}function bn({value:e,onChange:t,keyPlaceholder:n="key",valuePlaceholder:r="value",allowedTypes:o=["string","number","boolean","list","json"],emptyHint:i}){let a=Object.entries(e||{}),u=s=>{let c={};for(let[d,p]of s)d&&(c[d]=p);t(c)};return(0,l.jsxs)("div",{className:"kv-editor",children:[a.length===0&&i&&(0,l.jsx)("div",{className:"kv-editor__empty",children:i}),a.map(([s,c],d)=>(0,l.jsx)(Oh,{k:s,v:c,allowedTypes:o,keyPlaceholder:n,valuePlaceholder:r,onKey:p=>{let m=a.slice();m[d]=[p,m[d][1]],u(m)},onValue:p=>{let m=a.slice();m[d]=[m[d][0],p],u(m)},onRemove:()=>{let p=a.slice();p.splice(d,1),u(p)}},d)),(0,l.jsx)("button",{type:"button",className:"kv-editor__add",onClick:()=>u([...a,["",""]]),children:"+ Add field"})]})}function Oh({k:e,v:t,allowedTypes:n,keyPlaceholder:r,valuePlaceholder:o,onKey:i,onValue:a,onRemove:u}){let[s,c]=(0,ne.useState)(Lh(t)),d=p=>{c(p),a(p==="boolean"?typeof t=="boolean"?t:!1:p==="number"?typeof t=="number"?t:Number(t)||0:p==="list"?Array.isArray(t)?t:typeof t=="string"&&t?t.split(",").map(m=>m.trim()):[]:p==="json"?typeof t=="object"&&t&&!Array.isArray(t)?t:{}:typeof t=="string"?t:String(t??""))};return(0,l.jsxs)("div",{className:"kv-editor__row",children:[(0,l.jsx)("input",{className:"fld__input mono kv-editor__key",type:"text",value:e,placeholder:r,onChange:p=>i(p.target.value)}),n.length>1&&(0,l.jsx)("select",{className:"fld__input kv-editor__type",value:s,onChange:p=>d(p.target.value),children:n.map(p=>(0,l.jsx)("option",{value:p,children:p},p))}),(0,l.jsxs)("div",{className:"kv-editor__val",children:[s==="string"&&(0,l.jsx)(kn,{rows:1,value:typeof t=="string"?t:"",onChange:p=>a(p),placeholder:o}),s==="number"&&(0,l.jsx)("input",{className:"fld__input",type:"number",value:typeof t=="number"?String(t):"",onChange:p=>a(p.target.value===""?0:Number(p.target.value))}),s==="boolean"&&(0,l.jsx)(Li,{checked:!!t,onChange:p=>a(p),label:String(!!t)}),s==="list"&&(0,l.jsx)(vt,{value:Array.isArray(t)?t.map(String):[],onChange:p=>a(p),placeholder:"comma,separated,values"}),s==="json"&&(0,l.jsx)("textarea",{className:"fld__input mono kv-editor__json",rows:2,value:JSON.stringify(t??{},null,2),onChange:p=>{try{a(JSON.parse(p.target.value))}catch{}}})]}),(0,l.jsx)("button",{type:"button",className:"kv-editor__remove",onClick:u,title:"Remove field",children:"\xD7"})]})}function kn({value:e,onChange:t,placeholder:n,rows:r=3}){let[o,i]=(0,ne.useState)(!1),[a,u]=(0,ne.useState)(0),s=(0,ne.useRef)(null),c=(0,ne.useMemo)(()=>{let m=[];return ss.forEach(y=>y.items.forEach(w=>m.push({group:y.group,...w}))),m},[]),d=m=>{let y=s.current;if(!y)return;let w=y.selectionStart,S=e.slice(0,w),H=e.slice(w),f=S.endsWith("{{")?S:S+"{{",h=f+m+"}}"+H;t(h),i(!1),requestAnimationFrame(()=>{y.focus();let x=f.length+m.length+2;y.setSelectionRange(x,x)})};return(0,l.jsxs)("div",{className:"expr",style:{position:"relative"},children:[(0,l.jsx)("textarea",{ref:s,className:"fld__input mono",rows:r,spellCheck:!1,value:e,placeholder:n,onChange:m=>t(m.target.value),onKeyDown:m=>{if(!o){m.key==="{"&&m.shiftKey&&i(!0);return}m.key==="ArrowDown"?(m.preventDefault(),u(y=>(y+1)%c.length)):m.key==="ArrowUp"?(m.preventDefault(),u(y=>(y-1+c.length)%c.length)):m.key==="Enter"||m.key==="Tab"?(m.preventDefault(),d(c[a].path)):m.key==="Escape"&&i(!1)}}),(0,l.jsxs)("div",{className:"fld__hint",style:{display:"flex",alignItems:"center",gap:6,marginTop:4},children:[(0,l.jsx)(A.variable,{}),"Type ",(0,l.jsx)("code",{children:"{{"})," to insert a variable \xB7 ",(0,l.jsx)("kbd",{children:"\u2191\u2193"})," ",(0,l.jsx)("kbd",{children:"\u21B5"}),(0,l.jsx)("button",{type:"button",style:{marginLeft:"auto",background:"none",border:"none",color:"inherit",cursor:"pointer"},onClick:()=>i(!o),children:(0,l.jsx)(A.plus,{})})]}),o&&(0,l.jsx)("div",{className:"expr__popover",style:{position:"absolute",left:0,right:0,top:"100%",zIndex:10,background:"var(--bg)",border:"1px solid var(--line)",borderRadius:4,maxHeight:260,overflowY:"auto",boxShadow:"0 6px 20px rgba(0,0,0,0.25)"},children:ss.map(m=>(0,l.jsxs)(ne.Fragment,{children:[(0,l.jsx)("div",{className:"expr__pop-group",style:{padding:"4px 10px",fontSize:10,color:"var(--muted)",textTransform:"uppercase",letterSpacing:.5},children:m.group}),m.items.map(y=>{let w=c.findIndex(H=>H.path===y.path);return(0,l.jsxs)("div",{onMouseEnter:()=>u(w),onClick:()=>d(y.path),style:{padding:"4px 10px",cursor:"pointer",fontSize:11,display:"flex",justifyContent:"space-between",gap:12,fontFamily:"var(--ax-mono, ui-monospace)",background:w===a?"var(--accent-soft)":"transparent"},children:[(0,l.jsx)("span",{children:`{{${y.path}}}`}),(0,l.jsx)("span",{style:{color:"var(--muted)",fontSize:10},children:y.type})]},y.path)})]},m.group))})]})}function zh({value:e,onChange:t,agents:n}){let[r,o]=(0,ne.useState)(!1),[i,a]=(0,ne.useState)(""),u=(0,ne.useRef)(null);(0,ne.useEffect)(()=>{let d=p=>{u.current&&!u.current.contains(p.target)&&o(!1)};return window.addEventListener("mousedown",d),()=>window.removeEventListener("mousedown",d)},[]);let s=n.find(d=>d.id===e),c=n.filter(d=>!i||d.name.toLowerCase().includes(i.toLowerCase())||d.id.includes(i));return(0,l.jsxs)("div",{ref:u,style:{position:"relative"},children:[(0,l.jsxs)("button",{type:"button",className:"fld__input",onClick:()=>o(d=>!d),style:{display:"flex",alignItems:"center",gap:8,textAlign:"left",width:"100%",cursor:"pointer"},children:[(0,l.jsx)("span",{style:{display:"inline-flex",width:22,height:22,borderRadius:4,background:`oklch(0.78 0.13 ${s?.color??260})`,color:"#fff",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:600,flexShrink:0},children:(s?.name??"??").slice(0,2).toUpperCase()}),(0,l.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,l.jsx)("div",{style:{fontSize:12,fontWeight:500},children:s?.name??"Select agent\u2026"}),(0,l.jsx)("div",{style:{fontSize:10,color:"var(--muted)",fontFamily:"var(--ax-mono, ui-monospace)"},children:s?.id??"\u2014"})]}),(0,l.jsx)(A.chev,{})]}),r&&(0,l.jsxs)("div",{style:{position:"absolute",left:0,right:0,top:"100%",zIndex:10,background:"var(--bg)",border:"1px solid var(--line)",borderRadius:4,marginTop:4,maxHeight:280,overflowY:"auto",boxShadow:"0 6px 20px rgba(0,0,0,0.25)"},children:[(0,l.jsx)("div",{style:{padding:6,borderBottom:"1px solid var(--line)"},children:(0,l.jsx)("input",{autoFocus:!0,className:"fld__input",value:i,placeholder:"Filter agents\u2026",onChange:d=>a(d.target.value),style:{width:"100%"}})}),(0,l.jsxs)("div",{children:[c.map(d=>(0,l.jsxs)("div",{onClick:()=>{t(d.id),o(!1),a("")},style:{padding:"6px 10px",cursor:"pointer",display:"flex",gap:8,alignItems:"center",background:d.id===e?"var(--accent-soft)":"transparent"},children:[(0,l.jsx)("span",{style:{display:"inline-flex",width:22,height:22,borderRadius:4,background:`oklch(0.78 0.13 ${d.color})`,color:"#fff",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:600,flexShrink:0},children:d.name.slice(0,2).toUpperCase()}),(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,l.jsx)("div",{style:{fontSize:12,fontWeight:500},children:d.name}),(0,l.jsx)("div",{style:{fontSize:10,color:"var(--muted)",fontFamily:"var(--ax-mono, ui-monospace)"},children:d.id})]}),d.tags.length>0&&(0,l.jsx)("div",{style:{display:"flex",gap:3},children:d.tags.map(p=>(0,l.jsx)("span",{style:{fontSize:9,color:"var(--muted)",background:"var(--surface)",padding:"1px 5px",borderRadius:3},children:p},p))})]},d.id)),c.length===0&&(0,l.jsx)("div",{style:{padding:10,fontSize:11,color:"var(--muted)"},children:"No agents match."})]})]}),(0,l.jsx)(k,{label:"",hint:"Free text \u2014 type an agent id directly if it isn't in the list yet",children:(0,l.jsx)(I,{value:e??"",onChange:t,placeholder:"agent-id",mono:!0})})]})}var fs={"whatsapp-message":{label:"WhatsApp \u2014 Incoming message",fires:"Fires when a contact or group sends a WhatsApp message to the paired account.",wired:!0,group:"channel-msg",hasLabels:!1},"telegram-message":{label:"Telegram \u2014 Incoming message",fires:"Fires when a Telegram user or group sends a message to the bot.",wired:!0,group:"channel-msg",hasLabels:!1},"discord-message":{label:"Discord \u2014 Incoming message",fires:"Fires when a Discord user posts a message in a watched channel or DM.",wired:!1,group:"channel-msg",hasLabels:!1},"slack-message":{label:"Slack \u2014 Incoming message",fires:"Fires when a Slack user posts a message in a watched channel or DM.",wired:!1,group:"channel-msg",hasLabels:!1},"gitlab-issue":{label:"GitLab \u2014 Issue event",fires:"Fires when a GitLab issue is opened, updated, reopened, or closed.",wired:!0,group:"gitlab",hasLabels:!0},"gitlab-mr":{label:"GitLab \u2014 Merge request event",fires:"Fires when a GitLab merge request is opened, updated, approved, merged, or closed.",wired:!0,group:"gitlab",hasLabels:!0},"gitlab-note":{label:"GitLab \u2014 Comment on issue or MR",fires:"Fires when a comment is posted on a GitLab issue or merge request.",wired:!0,group:"gitlab",hasLabels:!1},"gitlab-pipeline":{label:"GitLab \u2014 Pipeline status change",fires:"Fires when a CI/CD pipeline transitions state (running, success, failed).",wired:!0,group:"gitlab",hasLabels:!1},"github-issue":{label:"GitHub \u2014 Issue event",fires:"Fires when a GitHub issue is opened, updated, or closed (after webhook signature verification).",wired:!0,group:"github",hasLabels:!0},"github-pr":{label:"GitHub \u2014 Pull request event",fires:"Fires when a GitHub pull request is opened, updated, reviewed, merged, or closed.",wired:!0,group:"github",hasLabels:!0},"stripe-event":{label:"Stripe \u2014 Webhook event",fires:"Fires on any Stripe webhook (invoice.paid, customer.subscription.deleted, charge.refunded, etc.). Filter by event type in the workflow body.",wired:!0,group:"external-webhook",hasLabels:!1},"sentry-issue":{label:"Sentry \u2014 Issue alert",fires:"Fires when Sentry triggers an issue alert (new issue, regression, threshold breach).",wired:!0,group:"external-webhook",hasLabels:!1},"vercel-deployment":{label:"Vercel \u2014 Deployment event",fires:"Fires when Vercel reports a deployment state change (created, ready, error).",wired:!0,group:"external-webhook",hasLabels:!1},"odoo-event":{label:"Odoo \u2014 ERP/CRM event",fires:"Fires on any Odoo webhook (contact create, lead won, sale confirmed, invoice paid, project task updated, etc.). Filter by event/model in the workflow body.",wired:!0,group:"external-webhook",hasLabels:!1},"hubspot-event":{label:"HubSpot \u2014 CRM event",fires:"Fires on any HubSpot v3 webhook (contact.creation, deal.propertyChange, conversation.newMessage, etc.). Filter by subscriptionType in the workflow body.",wired:!0,group:"external-webhook",hasLabels:!1}},Ah=Object.entries(fs).map(([e,t])=>({value:e,label:t.wired?`${t.label} \u2713`:`${t.label} \u26A0 schema-only`}));function Dh({node:e,patchData:t}){let n=e.config,r=n.filter??{},o=p=>t({filter:{...r,...p}}),i=String(n.source??"whatsapp-message"),a=fs[i]??fs["whatsapp-message"],u=a.group==="channel-msg",s=a.group==="gitlab",c=a.group==="github",d=u||s||c;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(L,{title:"Source",children:[(0,l.jsx)(k,{label:"Event",hint:a.wired?"\u2713 wired end-to-end":"\u26A0 schema-only \u2014 no webhook subscriber configured for this source yet",children:(0,l.jsx)(ue,{value:i,onChange:p=>t({source:p,filter:{}}),options:Ah})}),(0,l.jsx)("div",{style:{fontSize:12,color:"var(--muted)",lineHeight:1.5,marginTop:-6,marginBottom:12},children:a.fires})]}),d&&(0,l.jsxs)(L,{title:"Match criteria",children:[(0,l.jsxs)("div",{style:{fontSize:11,color:"var(--muted)",marginBottom:8},children:["Limit when this trigger fires. Leave empty or use ",(0,l.jsx)("span",{className:"mono",children:"*"})," to match anything."]}),s&&(0,l.jsx)(k,{label:"Project",hint:'GitLab project path. Empty or "*" matches any.',children:(0,l.jsx)(I,{mono:!0,value:String(r.project??""),onChange:p=>o({project:p}),placeholder:"* (any) or acme/web"})}),c&&(0,l.jsx)(k,{label:"Repo",hint:'GitHub "owner/repo". Empty or "*" matches any.',children:(0,l.jsx)(I,{mono:!0,value:String(r.repo??""),onChange:p=>o({repo:p}),placeholder:"* (any) or owner/repo"})}),u&&(0,l.jsx)(k,{label:"Chat",hint:i==="whatsapp-message"?'Contact number or JID (e.g. "+216 00 000 000", "10000000000@s.whatsapp.net"). Empty or "*" matches any.':i==="telegram-message"?'Telegram chat id ("1816212449" for a DM, "-1003861455814" for a group). Empty or "*" matches any.':'Exact chat id. Empty or "*" matches any.',children:(0,l.jsx)(I,{mono:!0,value:String(r.chat??""),onChange:p=>o({chat:p}),placeholder:"* (any)"})}),a.hasLabels&&(0,l.jsx)(k,{label:"Labels (any of)",hint:"Fires only when at least one of these labels is present on the issue/MR. Empty = no label filter.",children:(0,l.jsx)(vt,{mono:!0,value:Array.isArray(r.labels)?r.labels:[],onChange:p=>o({labels:p}),placeholder:"bug, needs-review"})})]}),u&&(0,l.jsx)(L,{title:"Routing",defaultOpen:!1,children:(0,l.jsx)(k,{label:"Pass data straight through",hint:"When on, the default agent router ALSO replies alongside this workflow. Use for observability-only workflows (tag, log, forward) that shouldn't own the conversation.",children:(0,l.jsx)(Li,{checked:!!n.passthrough,onChange:p=>t({passthrough:p}),label:"Let the default agent also reply"})})})]})}function jh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(L,{title:"Schedule",children:[(0,l.jsx)(k,{label:"When it runs",hint:"5 fields: minute hour day month weekday. E.g. '0 9 * * 1-5' = 9am Mon\u2013Fri.",children:(0,l.jsx)(I,{mono:!0,value:String(n.spec??"0 * * * *"),onChange:r=>t({spec:r}),placeholder:"0 9 * * *"})}),(0,l.jsx)(k,{label:"Timezone",hint:"IANA timezone (e.g. Africa/Tunis, America/New_York). Defaults to UTC.",children:(0,l.jsx)(I,{mono:!0,value:String(n.timezone??"UTC"),onChange:r=>t({timezone:r}),placeholder:"Africa/Tunis"})}),(0,l.jsxs)("div",{style:{fontSize:12,color:"var(--muted)",lineHeight:1.5,marginTop:4},children:["Fires the workflow on the schedule. The trigger payload is empty \u2014 downstream nodes won't have ",(0,l.jsx)("span",{className:"mono",children:"{{start.*}}"})," data unless you wire it."]})]})}var ds=[{value:"on:gitlab-issue",label:"on:gitlab-issue",fires:"Fires when a GitLab issue is opened, updated, reopened, or closed (after the channel adapter dispatched it)."},{value:"on:gitlab-mr",label:"on:gitlab-mr",fires:"Fires when a GitLab merge request is opened, updated, approved, merged, or closed."},{value:"on:gitlab-note",label:"on:gitlab-note",fires:"Fires when a comment is posted on a GitLab issue or merge request."},{value:"on:gitlab-pipeline",label:"on:gitlab-pipeline",fires:"Fires when a GitLab CI/CD pipeline transitions state."},{value:"on:github-issue",label:"on:github-issue",fires:"Fires when a GitHub issue is opened, updated, or closed (signature-verified webhook)."},{value:"on:github-pr",label:"on:github-pr",fires:"Fires when a GitHub pull request is opened, reviewed, merged, or closed."},{value:"on:github-push",label:"on:github-push",fires:"Fires on any GitHub push event (branch updates)."},{value:"on:stripe-event",label:"on:stripe-event",fires:"Fires on any Stripe webhook (invoice.paid, charge.refunded, subscription.deleted, etc.). Filter by event type inside the workflow."},{value:"on:sentry-issue",label:"on:sentry-issue",fires:"Fires when a Sentry issue alert lands (new issue, regression, error threshold)."},{value:"on:vercel-deployment",label:"on:vercel-deployment",fires:"Fires when a Vercel deployment changes state."},{value:"on:odoo-event",label:"on:odoo-event",fires:"Fires on any Odoo webhook (res.partner.create, sale.order.action_confirm, account.move.paid, etc.). Filter by event/model inside the workflow."},{value:"on:hubspot-event",label:"on:hubspot-event",fires:"Fires on any HubSpot v3 webhook (contact.creation, deal.propertyChange, conversation.newMessage, etc.). Filter by subscriptionType inside the workflow."},{value:"on:error",label:"on:error",fires:"Fires when an agent task fails. Useful for incident-routing workflows."}];function Uh({node:e,patchData:t}){let n=e.config,r=String(n.event??"on:"),i=ds.find(a=>a.value===r)?.fires??(r.startsWith("on:")&&r!=="on:"?"Custom hook event. Fires whenever code in your agentx setup emits this event via the bus. Subscribe responsibly.":'Hook event names must start with "on:" \u2014 e.g. on:gitlab-issue.');return(0,l.jsxs)(L,{title:"Hook subscription",children:[(0,l.jsxs)(k,{label:"Event",hint:"Pick a known event or type your own (must start with on:)",children:[(0,l.jsx)(I,{mono:!0,value:r,onChange:a=>t({event:a}),placeholder:"on:gitlab-issue",list:"hook-events-list"}),(0,l.jsx)("datalist",{id:"hook-events-list",children:ds.map(a=>(0,l.jsx)("option",{value:a.value,children:a.fires},a.value))})]}),(0,l.jsx)("div",{style:{fontSize:12,color:"var(--muted)",lineHeight:1.5,marginTop:-6,marginBottom:4},children:i}),(0,l.jsxs)("details",{style:{marginTop:8},children:[(0,l.jsx)("summary",{style:{cursor:"pointer",fontSize:12,color:"var(--muted)"},children:"Available hook events"}),(0,l.jsx)("ul",{style:{fontSize:11,color:"var(--muted)",paddingLeft:16,marginTop:6},children:ds.map(a=>(0,l.jsxs)("li",{style:{marginBottom:4},children:[(0,l.jsx)("span",{className:"mono",children:a.value})," \u2014 ",a.fires]},a.value))})]})]})}function Wh(e){return(0,l.jsx)(L,{title:"Manual run",children:(0,l.jsxs)("div",{style:{fontSize:12,color:"var(--muted)",lineHeight:1.5},children:["No configuration needed. Fire this workflow via:",(0,l.jsx)("pre",{style:{marginTop:8,padding:8,background:"var(--bg)",border:"1px solid var(--line)",borderRadius:4,fontSize:11},children:"agentx workflow run <id>"}),"or ",(0,l.jsx)("span",{className:"mono",children:"POST /workflows/<id>/run"}),"."]})})}function Hh({node:e,patchData:t,agents:n}){let r=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(L,{title:"Agent",children:[(0,l.jsx)(k,{label:"Which agent runs",children:(0,l.jsx)(zh,{value:r.agentId,onChange:o=>t({agentId:o}),agents:n})}),(0,l.jsx)(k,{label:"What to ask for",hint:"Supports {{nodeId.path}} variables from upstream context",children:(0,l.jsx)(kn,{value:r.prompt??"",onChange:o=>t({prompt:o}),placeholder:"Classify {{trigger.text}} \u2014 reply RESULT: status-check | new-request | other",rows:5})})]}),(0,l.jsxs)(L,{title:"Behavior",defaultOpen:!1,children:[(0,l.jsx)(k,{label:"How to read the reply",hint:"How to extract a routing token from the agent's reply",children:(0,l.jsx)(ue,{value:String(r.resultParser??"acme-result-token"),onChange:o=>t({resultParser:o}),options:[{value:"acme-result-token",label:"RESULT: token (recommended)"},{value:"json",label:"JSON block (```json \u2026```)"},{value:"raw",label:"Raw reply (no parsing)"}]})}),(0,l.jsx)(k,{label:"Give up after (minutes)",children:(0,l.jsx)(xn,{value:r.timeoutMinutes,onChange:o=>t({timeoutMinutes:o}),placeholder:"5"})})]})]})}function Bh({node:e,patchData:t}){let n=e.config,[r,o]=(0,ne.useState)(n.template&&typeof n.template=="object"?"template":"path");return(0,l.jsxs)(L,{title:"Transform",children:[(0,l.jsx)(k,{label:"Mode",children:(0,l.jsx)(ue,{value:r,onChange:i=>{let a=i;o(a),t(a==="path"?{path:n.path??"",template:void 0}:{template:n.template??{},path:void 0})},options:[{value:"path",label:"Pick value from context (dotted path)"},{value:"template",label:"Build a bundle (template object)"}]})}),r==="path"&&(0,l.jsx)(k,{label:"Path",hint:"e.g. classify.reply or trigger.contact.name",children:(0,l.jsx)(I,{mono:!0,value:String(n.path??""),onChange:i=>t({path:i}),placeholder:"classify.reply"})}),r==="template"&&(0,l.jsx)(k,{label:"Template",hint:"One field per output key. String values support {{nodeId.path}} variables.",children:(0,l.jsx)(bn,{value:n.template??{},onChange:i=>t({template:i}),keyPlaceholder:"output key (e.g. greeting)",valuePlaceholder:"hi {{trigger.sender.name}}",emptyHint:"No fields yet \u2014 click + Add field below."})})]})}function Gh({node:e,patchData:t}){let n=e.config,r=n.cases??[],o=s=>t({cases:s}),i=(s,c)=>o(r.map((d,p)=>p===s?c:d)),a=(s,c)=>i(s,{...r[s],when:{...r[s].when,...c}}),u=(s,c)=>i(s,{...r[s],when:{...r[s].when,params:{...r[s].when.params,...c}}});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(L,{title:"Cases",right:(0,l.jsx)("span",{className:"card__kind",children:r.length}),children:[r.map((s,c)=>{let d=s.when.params??{};return(0,l.jsxs)("div",{style:{border:"1px solid var(--line)",borderRadius:4,padding:10,marginBottom:8,background:"var(--bg)"},children:[(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[(0,l.jsxs)("strong",{style:{fontSize:11},children:["Case #",c+1]}),(0,l.jsx)("button",{className:"btn btn--ghost-icon",onClick:()=>o(r.filter((p,m)=>m!==c)),children:(0,l.jsx)(A.trash,{})})]}),(0,l.jsx)(k,{label:"If",children:(0,l.jsx)(ue,{value:s.when.kind,onChange:p=>a(c,{kind:p,params:{}}),options:[{value:"equals",label:"Path equals value"},{value:"contains",label:"Path contains value"},{value:"matches",label:"Path matches regex"},{value:"exists",label:"Path exists (non-empty)"}]})}),(0,l.jsx)(k,{label:"Path",hint:"e.g. classify.result",children:(0,l.jsx)(I,{mono:!0,value:String(d.path??""),onChange:p=>u(c,{path:p}),placeholder:"classify.result"})}),(s.when.kind==="equals"||s.when.kind==="contains")&&(0,l.jsx)(k,{label:"Value",children:(0,l.jsx)(I,{mono:!0,value:String(d.value??""),onChange:p=>u(c,{value:p})})}),s.when.kind==="matches"&&(0,l.jsx)(k,{label:"Regex",children:(0,l.jsx)(I,{mono:!0,value:String(d.regex??""),onChange:p=>u(c,{regex:p}),placeholder:"^(approved|done)$"})}),(0,l.jsx)(k,{label:"Port",hint:"Outgoing edge's `fromPort` must match this",children:(0,l.jsx)(I,{mono:!0,value:s.to,onChange:p=>i(c,{...s,to:p}),placeholder:"approved"})})]},c)}),(0,l.jsxs)("button",{className:"btn btn--ghost-icon",style:{width:"100%",padding:8,justifyContent:"center"},onClick:()=>o([...r,{when:{kind:"equals",params:{path:"",value:""}},to:`case${r.length+1}`}]),children:[(0,l.jsx)(A.plus,{})," Add case"]})]}),(0,l.jsx)(L,{title:"Fallback",defaultOpen:!1,children:(0,l.jsx)(k,{label:"If nothing matches, go to",hint:"Used when no case matches. Leave blank to drop the event.",children:(0,l.jsx)(I,{mono:!0,value:String(n.default??"fallback"),onChange:s=>t({default:s})})})})]})}function $h({node:e,patchData:t}){let n=e.config,r=n.waitFor??{},o=a=>t({waitFor:{...r,...a}}),i=n.resumeMatch??{};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(L,{title:"Checkpoint",children:(0,l.jsx)(k,{label:"Name",hint:"Human label shown in logs + run timelines",children:(0,l.jsx)(I,{value:String(n.name??e.id),onChange:a=>t({name:a}),placeholder:"await-label-change"})})}),(0,l.jsxs)(L,{title:"Wait for",children:[(0,l.jsx)(k,{label:"Source",hint:"Which kind of event unpauses this run",children:(0,l.jsx)(ue,{value:String(r.source??""),onChange:a=>o({source:a||void 0}),options:[{value:"",label:"Any (same entity)"},{value:"gitlab-issue",label:"GitLab issue update"},{value:"gitlab-pipeline",label:"GitLab pipeline event"},{value:"whatsapp-message",label:"WhatsApp reply"},{value:"telegram-message",label:"Telegram reply"},{value:"manual",label:"Manual poke"}]})}),(0,l.jsx)(k,{label:"Labels (any of)",hint:"e.g. a label change to one of these resumes the run",children:(0,l.jsx)(vt,{mono:!0,value:Array.isArray(r.labels)?r.labels:[],onChange:a=>o({labels:a.length?a:void 0})})})]}),(0,l.jsx)(L,{title:"Advanced match",defaultOpen:!1,children:(0,l.jsx)(k,{label:"Only if the event mentions",hint:"Optional substring match on the incoming event's id",children:(0,l.jsx)(I,{mono:!0,value:String(i.eventIdLike??""),onChange:a=>t({resumeMatch:{...i,eventIdLike:a||void 0}})})})})]})}function Vh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(L,{title:"Terminal",children:[(0,l.jsx)(k,{label:"Status",children:(0,l.jsx)(ue,{value:String(n.status??"completed"),onChange:r=>t({status:r}),options:[{value:"completed",label:"Completed (success)"},{value:"failed",label:"Failed"},{value:"canceled",label:"Canceled"}]})}),(0,l.jsx)(k,{label:"Short summary",hint:"Surfaced in run history + notifications",children:(0,l.jsx)(Ii,{value:String(n.summary??""),onChange:r=>t({summary:r}),rows:2})})]})}var Kh=["gitlab","github","whatsapp","telegram","discord","slack"],ps=new Map,pp=6e4;function Yh(e){let[t,n]=(0,ne.useState)(()=>{let r=ps.get(e);return r&&Date.now()-r.at<pp?{chats:r.chats,source:r.source,loading:!1}:{chats:[],source:"",loading:!0}});return(0,ne.useEffect)(()=>{let r=!1,o=ps.get(e);if(o&&Date.now()-o.at<pp){n({chats:o.chats,source:o.source,loading:!1});return}return n(i=>({...i,loading:!0})),fetch(`/channels/${encodeURIComponent(e)}/chats`).then(i=>i.ok?i.json():{chats:[],source:""}).then(i=>{if(r)return;let a=Array.isArray(i.chats)?i.chats:[],u=typeof i.source=="string"?i.source:"";ps.set(e,{at:Date.now(),chats:a,source:u}),n({chats:a,source:u,loading:!1})}).catch(()=>{r||n({chats:[],source:"",loading:!1})}),()=>{r=!0}},[e]),t}function Qh({node:e,patchData:t,nodes:n}){let r=e.config,o=n.find(c=>c.type.startsWith("trigger."))?.id??"trigger",i=c=>`{{${o}.${c}}}`,a=String(r.channel??"whatsapp"),u=Yh(a),s=`chats-${a}`;return(0,l.jsxs)(L,{title:"Send message",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ue,{value:a,onChange:c=>t({channel:c}),options:Kh})}),(0,l.jsxs)(k,{label:"Chat id",hint:u.chats.length>0?`Use ${i("chatId")} to reply to the trigger's chat, or pick one of the ${u.chats.length} known chat(s) ${u.source==="local"?"on this node":`from ${u.source}`} (click the field to see the list).`:u.loading?`Loading known chats for "${a}"\u2026`:`Use ${i("chatId")} to reply to the trigger's chat. For a different destination, paste the channel-specific id (no discovered chats for "${a}" yet).`,children:[(0,l.jsx)(I,{mono:!0,value:String(r.chatId??""),onChange:c=>t({chatId:c}),placeholder:i("chatId"),list:u.chats.length>0?s:void 0}),u.chats.length>0&&(0,l.jsx)("datalist",{id:s,children:u.chats.map(c=>(0,l.jsx)("option",{value:c.id,children:c.name?`${c.name} \u2014 ${c.id}${c.kind==="group"?" (group)":""}`:`${c.id}${c.kind==="group"?" (group)":""}`},c.id))})]}),(0,l.jsx)(k,{label:"Text",hint:"Supports {{nodeId.path}} templates from any upstream node",children:(0,l.jsx)(kn,{value:String(r.text??""),onChange:c=>t({text:c}),rows:4,placeholder:`Thanks ${i("sender.name")} \u2014 working on it.`})}),(0,l.jsx)(k,{label:"Account id",hint:"Telegram only: which bot account sends. Leave empty to inherit from the trigger's account (recommended).",children:(0,l.jsx)(I,{mono:!0,value:String(r.accountId??""),onChange:c=>t({accountId:c}),placeholder:`(inherit from ${i("accountId")})`})}),(0,l.jsx)(k,{label:"Reply to which message",hint:"Optional. When set, the platform threads this reply under the referenced message.",children:(0,l.jsx)(I,{mono:!0,value:String(r.replyTo??""),onChange:c=>t({replyTo:c}),placeholder:i("event.id")})}),(0,l.jsx)(k,{label:"Text formatting",hint:r.channel==="telegram"?'Telegram default is "markdown" (Telegram-flavoured HTML conversion). Use "plain" to send raw text without escaping.':"Platform-specific. WhatsApp ignores; Telegram supports markdown/html.",children:(0,l.jsx)(ue,{value:String(r.parseMode??"markdown"),onChange:c=>t({parseMode:c}),options:["markdown","plain","html"]})})]})}function Jh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(L,{title:"Target",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ue,{value:String(n.channel??"gitlab"),onChange:r=>t({channel:r}),options:["gitlab","github"]})}),(0,l.jsx)(k,{label:"Project",hint:'GitLab "group/project" or GitHub "owner/repo"',children:(0,l.jsx)(I,{mono:!0,value:String(n.project??""),onChange:r=>t({project:r}),placeholder:"acme/web"})})]}),(0,l.jsxs)(L,{title:"Issue",children:[(0,l.jsx)(k,{label:"Title",children:(0,l.jsx)(kn,{rows:1,value:String(n.title??""),onChange:r=>t({title:r}),placeholder:"From WhatsApp: {{trigger.sender.name}}"})}),(0,l.jsx)(k,{label:"Description",children:(0,l.jsx)(kn,{rows:6,value:String(n.description??""),onChange:r=>t({description:r}),placeholder:"Reported by {{trigger.sender.name}}\\n\\n{{trigger.text}}"})}),(0,l.jsx)(k,{label:"Labels",children:(0,l.jsx)(vt,{mono:!0,value:Array.isArray(n.labels)?n.labels:[],onChange:r=>t({labels:r}),placeholder:"Triage, source::whatsapp"})}),(0,l.jsx)(k,{label:"Assignees",hint:"GitLab usernames (resolved to ids at runtime)",children:(0,l.jsx)(vt,{mono:!0,value:Array.isArray(n.assignees)?n.assignees:[],onChange:r=>t({assignees:r}),placeholder:"alice, bob"})})]})]})}function Xh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(L,{title:"Target",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ue,{value:String(n.channel??"gitlab"),onChange:r=>t({channel:r}),options:["gitlab","github"]})}),(0,l.jsx)(k,{label:"What it is about",children:(0,l.jsx)(ue,{value:String(n.kind??"issue"),onChange:r=>t({kind:r}),options:["issue","merge_request"]})}),(0,l.jsx)(k,{label:"Project",children:(0,l.jsx)(I,{mono:!0,value:String(n.project??""),onChange:r=>t({project:r}),placeholder:"{{trigger.project}}"})}),(0,l.jsx)(k,{label:"Issue number",children:(0,l.jsx)(I,{mono:!0,value:String(n.iid??""),onChange:r=>t({iid:r}),placeholder:"{{trigger.issue.iid}}"})})]}),(0,l.jsxs)(L,{title:"Labels",children:[(0,l.jsx)(k,{label:"Add",hint:"Comma-separated list",children:(0,l.jsx)(vt,{value:Array.isArray(n.add)?n.add:[],onChange:r=>t({add:r}),placeholder:"In review"})}),(0,l.jsx)(k,{label:"Remove",children:(0,l.jsx)(vt,{value:Array.isArray(n.remove)?n.remove:[],onChange:r=>t({remove:r}),placeholder:"Triage"})})]})]})}function qh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(L,{title:"Read labels",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ue,{value:String(n.channel??"gitlab"),onChange:r=>t({channel:r}),options:["gitlab","github"]})}),(0,l.jsx)(k,{label:"What it is about",children:(0,l.jsx)(ue,{value:String(n.kind??"issue"),onChange:r=>t({kind:r}),options:["issue","merge_request"]})}),(0,l.jsx)(k,{label:"Project",children:(0,l.jsx)(I,{mono:!0,value:String(n.project??""),onChange:r=>t({project:r})})}),(0,l.jsx)(k,{label:"Issue number",children:(0,l.jsx)(I,{mono:!0,value:String(n.iid??""),onChange:r=>t({iid:r})})}),(0,l.jsxs)("div",{style:{fontSize:11,color:"var(--muted)",marginTop:8},children:["Output bundle: ",(0,l.jsx)("span",{className:"mono",children:"{{ <nodeId>.labels }}"})," = string[]"]})]})}function Zh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(L,{title:"React",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ue,{value:String(n.channel??"telegram"),onChange:r=>t({channel:r}),options:["telegram","whatsapp"]})}),(0,l.jsx)(k,{label:"Chat id",children:(0,l.jsx)(I,{mono:!0,value:String(n.chatId??""),onChange:r=>t({chatId:r}),placeholder:"{{trigger.chatId}}"})}),(0,l.jsx)(k,{label:"Message id",children:(0,l.jsx)(I,{mono:!0,value:String(n.messageId??""),onChange:r=>t({messageId:r}),placeholder:"{{trigger.event.id}}"})}),(0,l.jsx)(k,{label:"Emoji",children:(0,l.jsx)(I,{value:String(n.emoji??"\u{1F440}"),onChange:r=>t({emoji:r})})})]})}function em({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(L,{title:"Edit message",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ue,{value:String(n.channel??"telegram"),onChange:r=>t({channel:r}),options:["telegram","whatsapp","gitlab","github","discord","slack"]})}),(0,l.jsx)(k,{label:"Chat id",children:(0,l.jsx)(I,{mono:!0,value:String(n.chatId??""),onChange:r=>t({chatId:r})})}),(0,l.jsx)(k,{label:"Message id",children:(0,l.jsx)(I,{mono:!0,value:String(n.messageId??""),onChange:r=>t({messageId:r})})}),(0,l.jsx)(k,{label:"Replace the text with",children:(0,l.jsx)(kn,{value:String(n.text??""),onChange:r=>t({text:r}),rows:3})}),(0,l.jsx)(k,{label:"Text formatting",children:(0,l.jsx)(ue,{value:String(n.parseMode??"plain"),onChange:r=>t({parseMode:r}),options:["plain","markdown","html"]})})]})}function tm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(L,{title:"Log time",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ue,{value:String(n.channel??"gitlab"),onChange:r=>t({channel:r}),options:["gitlab"]})}),(0,l.jsx)(k,{label:"Chat id",hint:'"project:issue:42" or "project:merge_request:7"',children:(0,l.jsx)(I,{mono:!0,value:String(n.chatId??""),onChange:r=>t({chatId:r}),placeholder:"{{trigger.chatId}}"})}),(0,l.jsx)(k,{label:"How long to wait",children:(0,l.jsx)(xn,{value:n.durationMs,onChange:r=>t({durationMs:r}),placeholder:"900000"})})]})}function nm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(L,{title:"Action",children:(0,l.jsx)(k,{label:"Which saved action",hint:"Slug of a registered action (.agentx/actions/<id>.json). Manage in Settings \u2192 Actions or via `agentx actions`.",children:(0,l.jsx)(I,{mono:!0,value:String(n.actionId??""),onChange:r=>t({actionId:r}),placeholder:"deploy-staging"})})}),(0,l.jsx)(L,{title:"Inputs",defaultOpen:!0,children:(0,l.jsx)(k,{label:"Inputs",hint:"One field per input key. String values support {{nodeId.path}} variables.",children:(0,l.jsx)(bn,{value:n.inputs??{},onChange:r=>t({inputs:r}),keyPlaceholder:"input name (e.g. version)",valuePlaceholder:"{{trigger.tag}}",emptyHint:"No inputs configured."})})}),(0,l.jsxs)("div",{style:{fontSize:11,color:"var(--muted)",marginTop:8,padding:"0 10px"},children:["Output: ",(0,l.jsx)("span",{className:"mono",children:"{{ <nodeId>.ok / .status / .output / .errors / .durationMs }}"})]})]})}function rm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(L,{title:"Request",children:[(0,l.jsx)(k,{label:"URL",children:(0,l.jsx)(I,{mono:!0,value:String(n.url??""),onChange:r=>t({url:r}),placeholder:"https://example.com/webhook"})}),(0,l.jsx)(k,{label:"Method",children:(0,l.jsx)(ue,{value:String(n.method??"POST"),onChange:r=>t({method:r}),options:["GET","POST","PUT","PATCH","DELETE"]})})]}),(0,l.jsx)(L,{title:"Body",defaultOpen:!1,children:(0,l.jsx)(k,{label:"Body",hint:"String \u2014 rendered with {{nodeId.path}}. Server parses as JSON when possible.",children:(0,l.jsx)(kn,{rows:5,value:typeof n.body=="string"?n.body:n.body?JSON.stringify(n.body,null,2):"",onChange:r=>t({body:r})})})}),(0,l.jsx)(L,{title:"Headers",defaultOpen:!1,children:(0,l.jsx)(k,{label:"Headers",hint:"HTTP request headers \u2014 string values support {{env.*}} and {{nodeId.path}}.",children:(0,l.jsx)(bn,{value:n.headers??{},onChange:r=>t({headers:r}),keyPlaceholder:"Header-Name",valuePlaceholder:"Bearer {{env.TOKEN}}",allowedTypes:["string"],emptyHint:"No headers set."})})}),(0,l.jsxs)("div",{style:{fontSize:11,color:"var(--muted)",marginTop:8,padding:"0 10px"},children:["Output: ",(0,l.jsx)("span",{className:"mono",children:"{{ <nodeId>.ok / .status / .body }}"})]})]})}var om=["text","long-text","number","boolean","date","select","multi-select","file"];function fp({form:e,patch:t}){let n=e.fields??[],r=(s,c)=>{let d=[...n];d[s]={...d[s],...c},t({...e,fields:d})},o=(s,c)=>{let d=[...n];d[s]={...d[s],validate:{...d[s].validate??{},...c}},t({...e,fields:d})},i=s=>t({...e,fields:n.filter((c,d)=>d!==s)}),a=(s,c)=>{let d=s+c;if(d<0||d>=n.length)return;let p=[...n];[p[s],p[d]]=[p[d],p[s]],t({...e,fields:p})},u=()=>t({...e,fields:[...n,{key:`field_${n.length+1}`,label:"New field",type:"text"}]});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(L,{title:"Form",children:[(0,l.jsx)(k,{label:"Title",hint:"Header shown to the assignee above the form",children:(0,l.jsx)(I,{value:e.title??"",onChange:s=>t({...e,title:s}),placeholder:"Review application"})}),(0,l.jsx)(k,{label:"Description",hint:"Optional one-line context shown under the title",children:(0,l.jsx)(I,{value:e.description??"",onChange:s=>t({...e,description:s}),placeholder:""})}),(0,l.jsx)(k,{label:"Primary button",hint:"Label on the submit button; default: Submit",children:(0,l.jsx)(I,{value:e.submitLabel??"Submit",onChange:s=>t({...e,submitLabel:s})})}),(0,l.jsx)(k,{label:"Secondary action",hint:"Optional reject/hold button. Submissions carry action='secondary'.",children:(0,l.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6},children:[(0,l.jsx)(I,{value:e.secondaryAction?.key??"",onChange:s=>t({...e,secondaryAction:s?{key:s,label:e.secondaryAction?.label??s}:void 0}),placeholder:"key (e.g. reject)",mono:!0}),(0,l.jsx)(I,{value:e.secondaryAction?.label??"",onChange:s=>t({...e,secondaryAction:{key:e.secondaryAction?.key??"secondary",label:s}}),placeholder:"label (e.g. Reject)"})]})})]}),(0,l.jsxs)(L,{title:`Fields (${n.length})`,children:[n.length===0&&(0,l.jsx)("div",{className:"hint",style:{fontSize:12,color:"var(--ax-muted)"},children:"No fields \u2014 approve/reject form with no input."}),n.map((s,c)=>(0,l.jsxs)("div",{className:"fld__field-row",style:{border:"1px solid var(--ax-border)",borderRadius:6,padding:8,marginBottom:8},children:[(0,l.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr auto",gap:6,alignItems:"end"},children:[(0,l.jsx)(k,{label:"Key",hint:"Stored under values.<key>",children:(0,l.jsx)(I,{mono:!0,value:s.key,onChange:d=>r(c,{key:d})})}),(0,l.jsx)(k,{label:"Label",children:(0,l.jsx)(I,{value:s.label,onChange:d=>r(c,{label:d})})}),(0,l.jsxs)("div",{style:{display:"flex",gap:4},children:[(0,l.jsx)("button",{className:"fld__btn",type:"button",onClick:()=>a(c,-1),title:"Move up",children:"\u2191"}),(0,l.jsx)("button",{className:"fld__btn",type:"button",onClick:()=>a(c,1),title:"Move down",children:"\u2193"}),(0,l.jsx)("button",{className:"fld__btn",type:"button",onClick:()=>i(c),title:"Remove",children:"\u2715"})]})]}),(0,l.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6,marginTop:6},children:[(0,l.jsx)(k,{label:"Type",children:(0,l.jsx)(ue,{value:s.type,onChange:d=>r(c,{type:d}),options:om.slice()})}),(0,l.jsx)(k,{label:"",children:(0,l.jsx)(Li,{checked:!!s.required,onChange:d=>r(c,{required:d}),label:"Required"})})]}),(s.type==="select"||s.type==="multi-select")&&(0,l.jsx)(k,{label:"Options",hint:"Comma-separated list of allowed values",children:(0,l.jsx)(vt,{value:s.options??[],onChange:d=>r(c,{options:d}),placeholder:"low, medium, high"})}),(0,l.jsx)(k,{label:"Hint",hint:"Helper text shown under the input",children:(0,l.jsx)(I,{value:s.hint??"",onChange:d=>r(c,{hint:d})})}),(s.type==="text"||s.type==="long-text"||s.type==="number")&&(0,l.jsxs)("div",{style:{display:"grid",gridTemplateColumns:s.type==="number"?"1fr 1fr":"1fr 1fr 1fr",gap:6},children:[(0,l.jsx)(k,{label:"Min",children:(0,l.jsx)(xn,{value:s.validate?.min,onChange:d=>o(c,{min:d})})}),(0,l.jsx)(k,{label:"Max",children:(0,l.jsx)(xn,{value:s.validate?.max,onChange:d=>o(c,{max:d})})}),s.type!=="number"&&(0,l.jsx)(k,{label:"Pattern",hint:"Regex \u2014 optional",children:(0,l.jsx)(I,{mono:!0,value:s.validate?.pattern??"",onChange:d=>o(c,{pattern:d})})})]})]},c)),(0,l.jsx)("button",{className:"fld__btn",type:"button",onClick:u,style:{marginTop:4},children:"+ Add field"})]})]})}function im({node:e,patchData:t}){let n=e.config,r=n.form??{title:"",fields:[],submitLabel:"Submit"};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(L,{title:"Assignment",children:[(0,l.jsx)(k,{label:"Assignee",hint:"actor:<id> or role:<id> \u2014 managed via `agentx actor` / `agentx role`",children:(0,l.jsx)(I,{mono:!0,value:String(n.assignTo??""),onChange:o=>t({assignTo:o}),placeholder:"role:reviewers"})}),(0,l.jsx)(k,{label:"Title",hint:"Shown in the inbox + notification",children:(0,l.jsx)(I,{value:String(n.title??""),onChange:o=>t({title:o})})}),(0,l.jsx)(k,{label:"Description",children:(0,l.jsx)(Ii,{value:String(n.description??""),onChange:o=>t({description:o}),rows:2})}),(0,l.jsx)(k,{label:"Due in",hint:"ISO-8601 duration (PT2H, P1D) or number of minutes",children:(0,l.jsx)(I,{mono:!0,value:String(n.dueIn??""),onChange:o=>t({dueIn:o}),placeholder:"P2D"})})]}),(0,l.jsx)(fp,{form:r,patch:o=>t({form:o})})]})}function am({node:e,patchData:t}){let n=e.config,r=n.form??{title:"",fields:[],submitLabel:"Submit"};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(L,{title:"Start conditions",children:(0,l.jsx)(k,{label:"Who can start it",hint:"actor:<id> or role:<id> \u2014 who is allowed to initiate a new run",children:(0,l.jsx)(I,{mono:!0,value:String(n.startableBy??""),onChange:o=>t({startableBy:o}),placeholder:"role:public"})})}),(0,l.jsx)(fp,{form:r,patch:o=>t({form:o})})]})}function lm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(L,{title:"Sub-process",children:[(0,l.jsx)(k,{label:"Which workflow",hint:"id of another workflow definition \u2014 it runs to completion, then parent resumes",children:(0,l.jsx)(I,{mono:!0,value:String(n.workflowId??""),onChange:r=>t({workflowId:r}),placeholder:"child-workflow-id"})}),(0,l.jsx)(k,{label:"Values to pass on",hint:'Map child-context keys \u2192 templated values. Use a single key "*" for full inheritance.',children:(0,l.jsx)(bn,{value:n.inputMap??{},onChange:r=>t({inputMap:r}),keyPlaceholder:"child key",valuePlaceholder:"{{trigger.foo}}",emptyHint:"No mapping \u2014 child workflow runs with no parent context."})})]})}function sm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(L,{title:"Emit signal",children:[(0,l.jsx)(k,{label:"Name",hint:"Signal identifier; other workflows' signal.wait nodes subscribe by this",children:(0,l.jsx)(I,{mono:!0,value:String(n.name??""),onChange:r=>t({name:r}),placeholder:"approved"})}),(0,l.jsx)(k,{label:"Scope",hint:"workflow = only same-workflow waiters; global = every waiter",children:(0,l.jsx)(ue,{value:String(n.scope??"workflow"),onChange:r=>t({scope:r}),options:["workflow","global"]})}),(0,l.jsx)(k,{label:"Payload",hint:"Object delivered with the signal. String values support {{nodeId.path}}.",children:(0,l.jsx)(bn,{value:n.payload??{},onChange:r=>t({payload:r}),keyPlaceholder:"payload key",valuePlaceholder:"{{trigger.iid}}",emptyHint:"Empty signal payload."})})]})}function um({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(L,{title:"Wait for signal",children:[(0,l.jsx)(k,{label:"Name",children:(0,l.jsx)(I,{mono:!0,value:String(n.name??""),onChange:r=>t({name:r}),placeholder:"approved"})}),(0,l.jsx)(k,{label:"Scope",children:(0,l.jsx)(ue,{value:String(n.scope??"workflow"),onChange:r=>t({scope:r}),options:["workflow","global"]})}),(0,l.jsx)(k,{label:"Only when",hint:"Only resume when every key here matches the emitted payload. Empty = match any payload.",children:(0,l.jsx)(bn,{value:n.match??{},onChange:r=>t({match:r}),keyPlaceholder:"payload key",valuePlaceholder:"expected value",emptyHint:"No filter \u2014 matches any payload."})})]})}function cm({node:e,patchData:t}){let n=e.config;return(0,l.jsx)(L,{title:"Timer",children:(0,l.jsx)(k,{label:"After",hint:"ISO-8601 duration (PT30M, PT2H, P1D) or minutes as a number",children:(0,l.jsx)(I,{mono:!0,value:String(n.after??""),onChange:r=>t({after:r}),placeholder:"PT1H"})})})}function dm({node:e,patchData:t}){let n=e.config;return(0,l.jsx)(L,{title:"Parallel gateway",children:(0,l.jsx)(k,{label:"Mode",hint:"fanOut = send to all outgoing edges; join = wait for every incoming edge",children:(0,l.jsx)(ue,{value:String(n.mode??"fanOut"),onChange:r=>t({mode:r}),options:["fanOut","join"]})})})}function pm({node:e,patchData:t}){let n=e.config,r=Array.isArray(n.inputs)?n.inputs.map(String):[],o=Array.isArray(n.rules)?n.rules:[],i=c=>t({inputs:c,rules:o.map(d=>({...d,when:(Array.isArray(d.when)?d.when.slice(0,c.length):[]).concat(Array(Math.max(0,c.length-(d.when?.length??0))).fill("*"))}))}),a=(c,d)=>{let p=[...o];p[c]={...p[c],...d},t({rules:p})},u=()=>t({rules:[...o,{when:r.map(()=>"*"),to:"port",output:{}}]}),s=c=>t({rules:o.filter((d,p)=>p!==c)});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(L,{title:"Inputs",children:(0,l.jsx)(k,{label:"Values to read",hint:"Comma-separated; each is a template evaluated per-run against the run context",children:(0,l.jsx)(vt,{mono:!0,value:r,onChange:i,placeholder:"{{classify.result}}, {{trigger.values.amount}}"})})}),(0,l.jsxs)(L,{title:`Rules (${o.length})`,children:[o.map((c,d)=>(0,l.jsxs)("div",{style:{border:"1px solid var(--ax-border)",borderRadius:6,padding:8,marginBottom:8},children:[(0,l.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr auto",gap:6,alignItems:"end"},children:[(0,l.jsx)(k,{label:"Goes to",hint:"Outgoing edge port taken when this row matches",children:(0,l.jsx)(I,{mono:!0,value:String(c.to??""),onChange:p=>a(d,{to:p})})}),(0,l.jsx)("button",{className:"fld__btn",type:"button",onClick:()=>s(d),children:"\u2715"})]}),(0,l.jsx)(k,{label:"When these are true",hint:'One per input. "*" wildcard, "x" equals, ">10" numeric, "!=x", "/regex/"',children:(0,l.jsx)(vt,{mono:!0,value:(Array.isArray(c.when)?c.when:[]).map(String),onChange:p=>a(d,{when:p}),placeholder:"gold, >100"})}),(0,l.jsx)(k,{label:"Output",hint:"Fields written when this rule matches.",children:(0,l.jsx)(bn,{value:c.output??{},onChange:p=>a(d,{output:p}),keyPlaceholder:"output key",valuePlaceholder:"value",emptyHint:"No outputs."})})]},d)),(0,l.jsx)("button",{className:"fld__btn",type:"button",onClick:u,children:"+ Add rule"})]}),(0,l.jsx)(L,{title:"Default",children:(0,l.jsx)(k,{label:"Goes to",children:(0,l.jsx)(I,{mono:!0,value:String(n.default?.to??"fallback"),onChange:c=>t({default:{...n.default??{},to:c}})})})})]})}var fm={"trigger.channel":e=>(0,l.jsx)(Dh,{...e}),"trigger.cron":e=>(0,l.jsx)(jh,{...e}),"trigger.hook":e=>(0,l.jsx)(Uh,{...e}),"trigger.manual":e=>(0,l.jsx)(Wh,{...e}),"trigger.form":e=>(0,l.jsx)(am,{...e}),agent:e=>(0,l.jsx)(Hh,{...e}),transform:e=>(0,l.jsx)(Bh,{...e}),branch:e=>(0,l.jsx)(Gh,{...e}),"gateway.parallel":e=>(0,l.jsx)(dm,{...e}),rule:e=>(0,l.jsx)(pm,{...e}),checkpoint:e=>(0,l.jsx)($h,{...e}),userTask:e=>(0,l.jsx)(im,{...e}),subProcess:e=>(0,l.jsx)(lm,{...e}),"signal.emit":e=>(0,l.jsx)(sm,{...e}),"signal.wait":e=>(0,l.jsx)(um,{...e}),"timer.boundary":e=>(0,l.jsx)(cm,{...e}),end:e=>(0,l.jsx)(Vh,{...e}),"action.send":e=>(0,l.jsx)(Qh,{...e}),"action.createIssue":e=>(0,l.jsx)(Jh,{...e}),"action.setLabel":e=>(0,l.jsx)(Xh,{...e}),"action.readLabel":e=>(0,l.jsx)(qh,{...e}),"action.react":e=>(0,l.jsx)(Zh,{...e}),"action.editMessage":e=>(0,l.jsx)(em,{...e}),"action.logTime":e=>(0,l.jsx)(tm,{...e}),"action.callHTTP":e=>(0,l.jsx)(rm,{...e}),"action.run":e=>(0,l.jsx)(nm,{...e})};function gp(e){let{selection:t,nodes:n,edges:r,patch:o,patchData:i,onDelete:a,onDuplicate:u,validation:s,runState:c,agents:d,meta:p,patchMeta:m,onDeleteWorkflow:y,isNew:w}=e;if(!t)return(0,l.jsx)(xm,{meta:p,patchMeta:m,onDeleteWorkflow:y,isNew:w});if(t.kind==="edge"){let H=r.find(g=>g.id===t.id);return H?(0,l.jsx)(km,{edge:{...H,id:H.id??""},patch:o,onDelete:()=>a(t)}):null}let S=n.find(H=>H.id===t.id);return S?(0,l.jsx)(gm,{node:S,nodes:n,edges:r,patch:o,patchData:i,onDelete:()=>a(t),onDuplicate:()=>u(t),validation:s,runOutput:c?.outputs?.[S.id],agents:d}):null}function gm({node:e,nodes:t,edges:n,patch:r,patchData:o,onDelete:i,onDuplicate:a,validation:u,runOutput:s,agents:c}){let[d,p]=(0,ne.useState)("config"),m=fm[e.type];return(0,l.jsxs)("aside",{className:"insp",children:[(0,l.jsxs)("div",{className:"insp__head",children:[(0,l.jsxs)("div",{className:"insp__top",children:[(0,l.jsx)("span",{className:"insp__type-pill",children:e.type}),(0,l.jsx)("input",{className:"insp__name",value:e.id,onChange:y=>r({id:y.target.value})}),(0,l.jsx)("button",{className:"btn btn--ghost-icon",title:"Duplicate",onClick:a,children:(0,l.jsx)(A.dup,{})}),(0,l.jsx)("button",{className:"btn btn--ghost-icon",title:"Delete",onClick:i,children:(0,l.jsx)(A.trash,{})})]}),(0,l.jsxs)("div",{className:"insp__tabs",children:[(0,l.jsxs)("button",{className:"insp__tab"+(d==="config"?" is-active":""),onClick:()=>p("config"),children:[(0,l.jsx)(A.gear,{})," Config"]}),(0,l.jsxs)("button",{className:"insp__tab"+(d==="advanced"?" is-active":""),onClick:()=>p("advanced"),children:[(0,l.jsx)(A.layout,{})," Advanced"]}),(0,l.jsxs)("button",{className:"insp__tab"+(d==="preview"?" is-active":""),onClick:()=>p("preview"),children:[(0,l.jsx)(A.eye,{})," Preview ",s&&(0,l.jsx)("span",{className:"count",children:"\u25CF"})]})]})]}),(0,l.jsxs)("div",{className:"insp__body",children:[d==="config"&&(0,l.jsxs)(l.Fragment,{children:[m?m({node:e,nodes:t,patch:r,patchData:o,agents:c}):(0,l.jsx)(L,{title:"Config",children:(0,l.jsxs)("div",{style:{fontSize:12,color:"var(--muted)",marginBottom:8},children:["No typed form yet for ",(0,l.jsx)("span",{className:"mono",children:e.type}),". Use the Advanced tab to edit raw JSON."]})}),(0,l.jsx)(mm,{node:e,nodes:t,edges:n})]}),d==="advanced"&&(0,l.jsx)(wm,{node:e,patchData:o}),d==="preview"&&(0,l.jsx)(L,{title:"Latest run output",children:s?(0,l.jsx)("pre",{style:{fontSize:11,color:"var(--ink-2)",padding:8,background:"var(--bg)",borderRadius:4,border:"1px solid var(--line)"},dangerouslySetInnerHTML:{__html:s}}):(0,l.jsx)("div",{style:{fontSize:12,color:"var(--muted)"},children:"No run data for this node yet."})}),u&&u.length>0&&(0,l.jsx)(L,{title:"Issues",right:(0,l.jsx)("span",{className:"card__kind",style:{color:"var(--err)"},children:u.length}),children:u.map((y,w)=>(0,l.jsxs)("div",{className:"fld__err",style:{padding:"6px 0"},children:[(0,l.jsx)(A.warn,{})," ",y.message]},w))})]})]})}function hm(e,t,n){let r=new Map(t.map(u=>[u.id,u])),o=new Set,i=[],a=u=>{if(!o.has(u)){o.add(u);for(let s of n)s.to===u&&a(s.from);if(u!==e){let s=r.get(u);s&&i.push(s)}}};a(e);for(let u of t)u.type.startsWith("trigger.")&&!o.has(u.id)&&u.id!==e&&i.push(u);return i}function mm({node:e,nodes:t,edges:n}){let r=(0,ne.useMemo)(()=>hm(e.id,t,n),[e.id,t,n]);return r.length===0?(0,l.jsx)(L,{title:"Available inputs",defaultOpen:!1,children:(0,l.jsxs)("div",{style:{fontSize:12,color:"var(--muted)"},children:["No upstream nodes yet \u2014 connect a trigger or upstream node to make its outputs available as ",(0,l.jsx)("span",{className:"mono",children:"{{nodeId.path}}"})," templates here."]})}):(0,l.jsx)(L,{title:`Available inputs (${r.length})`,defaultOpen:!1,right:(0,l.jsx)("span",{className:"card__kind",style:{color:"var(--muted)"},children:"click to copy"}),children:(0,l.jsx)("div",{style:{display:"grid",gap:10},children:r.map(o=>(0,l.jsx)(vm,{node:o},o.id))})})}function vm({node:e}){let t=cs[e.type],n=t?dp(e.type,e.config):[];return(0,l.jsxs)("div",{style:{border:"1px solid var(--line)",borderRadius:6,padding:8,background:"var(--bg)"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[(0,l.jsx)("span",{className:"mono",style:{fontSize:11,color:"var(--ink-2)"},children:e.id}),(0,l.jsx)("span",{className:"insp__type-pill",style:{fontSize:10},children:e.type})]}),t?.summary&&(0,l.jsx)("div",{style:{fontSize:11,color:"var(--muted)",marginBottom:6},children:t.summary}),n.length===0?(0,l.jsx)("div",{style:{fontSize:11,color:"var(--muted)"},children:"No declared outputs."}):(0,l.jsx)("div",{style:{display:"grid",gap:2},children:n.map(r=>(0,l.jsx)(ym,{nodeId:e.id,field:r},r.path))})]})}function ym({nodeId:e,field:t}){let[n,r]=(0,ne.useState)(!1),o=t.path?`{{${e}.${t.path}}}`:`{{${e}}}`;return(0,l.jsxs)("button",{type:"button",onClick:async()=>{try{await navigator.clipboard.writeText(o),r(!0),window.setTimeout(()=>r(!1),900)}catch{}},title:t.description,style:{textAlign:"left",display:"grid",gridTemplateColumns:"1fr auto",gap:6,padding:"4px 6px",background:n?"var(--ok-soft, rgba(0, 200, 100, 0.12))":"transparent",border:"1px solid transparent",borderRadius:4,cursor:"pointer",color:"var(--ink-1)",fontSize:11,lineHeight:1.35},children:[(0,l.jsx)("span",{className:"mono",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o}),(0,l.jsx)("span",{style:{color:n?"var(--ok, #2ea043)":"var(--muted)",fontSize:10},children:n?"copied":t.type})]})}function wm({node:e,patchData:t}){let[n,r]=(0,ne.useState)(()=>JSON.stringify(e.config,null,2)),[o,i]=(0,ne.useState)(null);return(0,ne.useMemo)(()=>{r(JSON.stringify(e.config,null,2)),i(null)},[e.id]),(0,l.jsxs)(L,{title:"Raw config JSON",children:[(0,l.jsx)(Ii,{mono:!0,rows:14,value:n,onChange:r}),(0,l.jsxs)("div",{style:{display:"flex",gap:8,marginTop:8},children:[(0,l.jsxs)("button",{className:"btn btn--ghost-icon",onClick:()=>{try{let u=JSON.parse(n);u&&typeof u=="object"&&!Array.isArray(u)?(t(u),i(null)):i("config must be a JSON object")}catch(u){i(u.message)}},children:[(0,l.jsx)(A.check,{})," Apply"]}),(0,l.jsxs)("button",{className:"btn btn--ghost-icon",onClick:()=>r(JSON.stringify(e.config,null,2)),children:[(0,l.jsx)(A.undo,{})," Reset"]})]}),o&&(0,l.jsxs)("div",{className:"fld__err",style:{color:"var(--err)",fontSize:11,marginTop:4},children:[(0,l.jsx)(A.err,{})," ",o]})]})}function xm({meta:e,patchMeta:t,onDeleteWorkflow:n,isNew:r}){let o=e.retention??{maxRuns:500,maxDays:90};return(0,l.jsxs)("aside",{className:"insp",children:[(0,l.jsx)("div",{className:"insp__head",children:(0,l.jsxs)("div",{className:"insp__top",children:[(0,l.jsx)("span",{className:"insp__type-pill",children:"workflow"}),(0,l.jsx)("input",{className:"insp__name",value:e.title,placeholder:"Untitled workflow",onChange:i=>t({title:i.target.value})})]})}),(0,l.jsxs)("div",{className:"insp__body",children:[(0,l.jsxs)(L,{title:"Identity",children:[(0,l.jsx)(k,{label:"ID",hint:r?"URL slug \u2014 set once on first save":"URL slug \u2014 read-only after creation",children:(0,l.jsx)(I,{mono:!0,value:e.id,onChange:i=>r&&t({id:i})})}),(0,l.jsx)(k,{label:"Title",children:(0,l.jsx)(I,{value:e.title,onChange:i=>t({title:i})})}),(0,l.jsx)(k,{label:"Description",hint:"Optional one-liner shown on the workflows index",children:(0,l.jsx)(Ii,{rows:2,value:e.description??"",onChange:i=>t({description:i})})})]}),(0,l.jsxs)(L,{title:"Execution",children:[(0,l.jsx)(k,{label:"Priority",hint:"Higher numbers run before lower ones when multiple workflows match the same trigger",children:(0,l.jsx)(xn,{value:e.priority,onChange:i=>t({priority:i??0}),placeholder:"0"})}),(0,l.jsx)(k,{label:"",children:(0,l.jsx)(Li,{checked:!!e.fanOut,onChange:i=>t({fanOut:i}),label:"Fan out \u2014 let multiple workflows match the same trigger event"})}),(0,l.jsx)(k,{label:"Secrets this flow may use",hint:"Comma-separated. Only these env names are exposed to actions/agents in this flow.",children:(0,l.jsx)(vt,{mono:!0,value:e.envAllow??[],onChange:i=>t({envAllow:i}),placeholder:"GITLAB_TOKEN, SLACK_WEBHOOK"})})]}),(0,l.jsxs)(L,{title:"Retention",defaultOpen:!1,children:[(0,l.jsx)(k,{label:"How many runs to keep",children:(0,l.jsx)(xn,{value:o.maxRuns,onChange:i=>t({retention:{...o,maxRuns:i??0}}),placeholder:"500"})}),(0,l.jsx)(k,{label:"Keep runs for (days)",children:(0,l.jsx)(xn,{value:o.maxDays,onChange:i=>t({retention:{...o,maxDays:i??0}}),placeholder:"90"})})]}),(0,l.jsxs)("div",{style:{fontSize:11,color:"var(--muted)",padding:"4px 16px 14px",borderTop:"1px solid var(--line-soft)",marginTop:4},children:["Tip: pick a node or edge on the canvas to edit its config. Each node's output becomes available as"," ",(0,l.jsx)("span",{className:"mono",children:"{{nodeId.path}}"})," to downstream nodes."]}),n&&!r&&(0,l.jsx)("div",{className:"insp__danger",children:(0,l.jsxs)("button",{className:"btn btn--ghost-icon insp__delete-wf",onClick:n,title:"Delete this workflow permanently",children:[(0,l.jsx)(A.trash,{})," Delete workflow"]})})]})]})}function km({edge:e,patch:t,onDelete:n}){return(0,l.jsxs)("aside",{className:"insp",children:[(0,l.jsx)("div",{className:"insp__head",children:(0,l.jsxs)("div",{className:"insp__top",children:[(0,l.jsx)("span",{className:"insp__type-pill",children:"edge"}),(0,l.jsxs)("div",{className:"insp__name",style:{padding:0,fontSize:13,color:"var(--ink-2)"},children:[(0,l.jsx)("span",{className:"mono",children:e.from}),e.fromPort?(0,l.jsxs)("span",{className:"mono",children:[" :",e.fromPort]}):null," \u2192 ",(0,l.jsx)("span",{className:"mono",children:e.to})]}),(0,l.jsx)("button",{className:"btn btn--ghost-icon",onClick:n,children:(0,l.jsx)(A.trash,{})})]})}),(0,l.jsxs)("div",{className:"insp__body",children:[(0,l.jsx)(L,{title:"Label",children:(0,l.jsx)(k,{label:"Label",hint:"Shown on the edge (cosmetic only)",children:(0,l.jsx)(I,{mono:!0,value:e.label??"",onChange:r=>t({label:r})})})}),(0,l.jsx)(L,{title:"Port",defaultOpen:!1,children:(0,l.jsx)(k,{label:"Leaves from",hint:"Set when the source is a branch node. Must match a case's `to` field or the default port.",children:(0,l.jsx)(I,{mono:!0,value:e.fromPort??"",onChange:r=>t({fromPort:r||void 0})})})})]})]})}var St=oe(Nt(),1);var $=oe(Ce(),1);function hp({onLoadTemplate:e}){let[t,n]=(0,St.useState)(""),[r,o]=(0,St.useState)([]);(0,St.useEffect)(()=>{let u=!0;return fetch("/api/n8n/workflows").then(s=>s.json()).then(s=>{if(!u)return;let c=(s.workflows??[]).filter(d=>d.webhookUrl).map(d=>({id:"n8n."+d.id,type:"action.callHTTP",label:d.name,hint:d.active?"Hands this over to n8n":"In n8n, but switched off there",glyph:"g-action",icon:"globe",config:{url:d.webhookUrl,method:"POST",body:"{{trigger}}"}}));o(c.length?[{section:"From your n8n",items:c}]:[])}).catch(()=>{}),()=>{u=!1}},[]);let i=(0,St.useMemo)(()=>[...ls,...r],[r]),a=(0,St.useMemo)(()=>{if(!t.trim())return i;let u=t.toLowerCase();return i.map(s=>({...s,items:s.items.filter(c=>c.label.toLowerCase().includes(u)||c.hint.toLowerCase().includes(u)||c.type.includes(u))})).filter(s=>s.items.length>0)},[t,i]);return(0,$.jsxs)("aside",{className:"pal",children:[(0,$.jsxs)("div",{className:"pal__search",children:[(0,$.jsx)(A.search,{}),(0,$.jsx)("input",{value:t,onChange:u=>n(u.target.value),placeholder:"Search nodes\u2026"}),(0,$.jsx)("kbd",{children:"/"})]}),(0,$.jsxs)("div",{className:"pal__scroll",children:[a.map(u=>(0,$.jsxs)(St.Fragment,{children:[(0,$.jsxs)("div",{className:"pal__section",children:[(0,$.jsx)("span",{children:u.section}),(0,$.jsx)("span",{className:"pal__section-count",children:u.items.length.toString().padStart(2,"0")})]}),u.items.map(s=>(0,$.jsx)(bm,{item:s},s.id))]},u.section)),!t&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{className:"pal__section",children:[(0,$.jsx)("span",{children:"Templates"}),(0,$.jsx)("span",{className:"pal__section-count",children:us.length.toString().padStart(2,"0")})]}),us.map(u=>(0,$.jsxs)("div",{className:"pal__tpl",onClick:()=>e(u),children:[(0,$.jsx)("div",{className:"pal__tpl-dots",children:[0,1,2].map(s=>(0,$.jsx)("span",{className:s<u.dots?"on":""},s))}),(0,$.jsx)("div",{className:"pal__tpl-title",children:u.title}),(0,$.jsx)("div",{className:"pal__tpl-hint",children:u.hint})]},u.id))]})]}),(0,$.jsxs)("div",{className:"pal__foot",children:[(0,$.jsx)(A.lightning,{}),(0,$.jsx)("span",{children:"Drag items onto the canvas"})]})]})}function bm({item:e}){let t=A[e.icon]??A.box;return(0,$.jsxs)("div",{className:"pal__item",draggable:!0,onDragStart:r=>{r.dataTransfer.setData("application/x-wfe-item",JSON.stringify(e)),r.dataTransfer.effectAllowed="copy";let o=document.createElement("div");o.textContent=e.label,o.style.cssText="position:absolute;top:-1000px;padding:6px 10px;background:var(--accent);color:#fff;border-radius:6px;font:500 12px 'Space Grotesk';",document.body.appendChild(o),r.dataTransfer.setDragImage(o,10,10),setTimeout(()=>document.body.removeChild(o),0)},children:[(0,$.jsx)("div",{className:"pal__glyph "+e.glyph,children:(0,$.jsx)(t,{})}),(0,$.jsxs)("div",{className:"pal__meta",children:[(0,$.jsx)("div",{className:"pal__label",children:e.label}),(0,$.jsx)("div",{className:"pal__hint",children:e.hint})]})]})}var gs=oe(Nt(),1);var _=oe(Ce(),1);function mp(e){return(0,_.jsxs)("div",{className:"tb",children:[(0,_.jsxs)("div",{className:"tb__brand",children:[(0,_.jsx)("div",{className:"tb__mark",children:"\u2726"}),(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"tb__brand-label",children:"Workflow Editor"}),(0,_.jsx)("div",{className:"tb__brand-sub",children:e.workflowIdLabel})]})]}),(0,_.jsxs)("div",{className:"tb__main",children:[(0,_.jsxs)("div",{className:"tb__crumbs",children:[(0,_.jsx)("a",{href:"/workflows",children:"Workflows"}),(0,_.jsx)("span",{className:"sep",children:"/"}),(0,_.jsx)("input",{value:e.title,onChange:t=>e.setTitle(t.target.value)})]}),(0,_.jsx)("span",{className:"tb__sep"}),(0,_.jsxs)("div",{className:"tb__status "+e.status,children:[(0,_.jsx)("span",{className:"dot"}),e.statusLabel??(e.status==="is-dirty"?"unsaved":e.status==="is-running"?"running":e.status==="is-validating"?"validating\u2026":"saved")]}),(0,_.jsx)("div",{className:"tb__spacer"}),(0,_.jsx)("button",{className:"btn btn--ghost-icon"+(e.paletteOpen?" is-active":""),title:e.paletteOpen?"Hide palette":"Show palette",onClick:()=>e.setPaletteOpen(!e.paletteOpen),children:(0,_.jsx)(A.panelLeft,{})}),(0,_.jsx)("button",{className:"btn btn--ghost-icon"+(e.inspectorOpen?" is-active":""),title:e.inspectorOpen?"Hide inspector":"Show inspector",onClick:()=>e.setInspectorOpen(!e.inspectorOpen),children:(0,_.jsx)(A.panelRight,{})}),(0,_.jsx)("span",{className:"tb__sep"}),(0,_.jsx)("button",{className:"btn btn--ghost-icon",title:"Undo (\u2318Z)",onClick:e.onUndo,disabled:!e.canUndo,children:(0,_.jsx)(A.undo,{})}),(0,_.jsx)("button",{className:"btn btn--ghost-icon",title:"Redo (\u2318\u21E7Z)",onClick:e.onRedo,disabled:!e.canRedo,children:(0,_.jsx)(A.redo,{})}),(0,_.jsx)("button",{className:"btn btn--ghost-icon",title:"Auto layout",onClick:e.onLayout,children:(0,_.jsx)(A.layout,{})}),(0,_.jsx)("button",{className:"btn btn--ghost-icon",title:"Keyboard shortcuts",onClick:e.onHelp,children:(0,_.jsx)(A.kbd,{})}),(0,_.jsx)("button",{className:"btn btn--ghost-icon"+(e.tweaksOpen?" is-active":""),title:"Tweaks",onClick:()=>e.setTweaksOpen(!e.tweaksOpen),children:(0,_.jsx)(A.gear,{})}),(0,_.jsx)("button",{className:"btn btn--ghost-icon",title:"Toggle theme",onClick:()=>e.setTheme(e.theme==="dark"?"light":"dark"),children:e.theme==="dark"?(0,_.jsx)(A.sun,{}):(0,_.jsx)(A.moon,{})})]}),(0,_.jsxs)("div",{className:"tb__actions",children:[(0,_.jsxs)("button",{className:"btn btn--outline",onClick:e.onSave,children:[(0,_.jsx)(A.save,{})," Save"]}),(0,_.jsx)("button",{className:"btn btn--primary",onClick:e.onRun,children:e.running?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(A.stop2,{})," Stop"]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(A.run,{})," Run preview"]})})]})]})}function vp({running:e,script:t,cursor:n,onStop:r}){if(!e)return null;let o=t.filter(i=>i.nodeId);return(0,_.jsxs)("div",{className:"run",children:[(0,_.jsxs)("div",{className:"run__head",children:[(0,_.jsx)(A.lightning,{}),(0,_.jsx)("div",{className:"run__title",children:"Live run"}),(0,_.jsxs)("span",{className:"run__chip",children:[(0,_.jsx)("span",{className:"dot"})," streaming"]}),(0,_.jsx)("button",{className:"btn btn--ghost-icon",onClick:r,style:{height:24,width:24},children:(0,_.jsx)(A.x,{})})]}),(0,_.jsx)("div",{className:"run__body",children:o.map((i,a)=>{let u=t.indexOf(i),s=u<n,c=["run__step"];return s&&c.push("is-done"),u===n&&c.push("is-current"),(0,_.jsxs)("div",{className:c.join(" "),children:[(0,_.jsx)("div",{className:"run__marker",children:s?(0,_.jsx)(A.check,{}):a+1}),(0,_.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,_.jsx)("div",{className:"run__step-title",children:i.title}),i.body&&(0,_.jsx)("div",{className:"run__step-body",dangerouslySetInnerHTML:{__html:i.body}})]})]},a)})}),(0,_.jsxs)("div",{className:"run__foot",children:[(0,_.jsxs)("span",{children:[Math.min(n+1,t.length),"/",t.length]}),(0,_.jsxs)("span",{children:[t.length?Math.round((n+1)/t.length*100):0,"%"]})]})]})}var _m=[{h:255,name:"indigo"},{h:220,name:"blue"},{h:180,name:"teal"},{h:145,name:"green"},{h:70,name:"amber"},{h:28,name:"orange"},{h:330,name:"pink"}];function yp(e){return e.open?(0,_.jsxs)("div",{className:"tweaks",children:[(0,_.jsxs)("div",{className:"tweaks__head",children:[(0,_.jsx)("span",{children:"Tweaks"}),(0,_.jsx)("button",{className:"btn btn--ghost-icon",style:{height:22,width:22},onClick:()=>e.setOpen(!1),children:(0,_.jsx)(A.x,{})})]}),(0,_.jsxs)("div",{className:"tweaks__body",children:[(0,_.jsxs)("div",{className:"tweaks__row",children:[(0,_.jsx)("label",{children:"Theme"}),(0,_.jsx)("div",{className:"tweaks__opts",children:["dark","light"].map(t=>(0,_.jsx)("button",{className:e.theme===t?"on":"",onClick:()=>e.setTheme(t),children:t},t))})]}),(0,_.jsxs)("div",{className:"tweaks__row",children:[(0,_.jsx)("label",{children:"Density"}),(0,_.jsx)("div",{className:"tweaks__opts",children:["compact","cozy","roomy"].map(t=>(0,_.jsx)("button",{className:e.density===t?"on":"",onClick:()=>e.setDensity(t),children:t},t))})]}),(0,_.jsxs)("div",{className:"tweaks__row",style:{alignItems:"flex-start",flexDirection:"column",gap:6},children:[(0,_.jsx)("label",{children:"Accent hue"}),(0,_.jsx)("div",{className:"tweaks__hue",children:_m.map(t=>(0,_.jsx)("button",{title:t.name,className:e.hue===t.h?"on":"",style:{background:`oklch(0.70 0.16 ${t.h})`},onClick:()=>e.setHue(t.h)},t.h))})]})]})]}):null}function wp({open:e,onClose:t}){return e?(0,_.jsx)("div",{className:"kbd-overlay",onClick:t,children:(0,_.jsxs)("div",{className:"kbd-card",onClick:r=>r.stopPropagation(),children:[(0,_.jsx)("h3",{children:"Keyboard shortcuts"}),[["Save workflow","\u2318S"],["Undo / Redo","\u2318Z / \u2318\u21E7Z"],["Delete selection","Delete"],["Duplicate node","\u2318D"],["Run preview","\u2318\u23CE"],["Focus search","/"],["Fit view","F"],["Close panels","Esc"]].map(([r,o])=>(0,_.jsxs)("div",{className:"row",children:[(0,_.jsx)("span",{children:r}),(0,_.jsx)("span",{children:o.split(" ").map((i,a)=>(0,_.jsxs)(gs.Fragment,{children:[i.includes("/")?i.split("/").map((u,s)=>(0,_.jsxs)(gs.Fragment,{children:[s>0&&" / ",(0,_.jsx)("kbd",{children:u.trim()})]},s)):(0,_.jsx)("kbd",{children:i})," "]},a))})]},r))]})}):null}var Me=oe(Nt(),1),V=oe(Ce(),1),ms="agentx.editor.chat.v1";function xp({currentWorkflow:e,onApplyWorkflow:t,agentId:n}){let[r,o]=(0,Me.useState)(!1),[i,a]=(0,Me.useState)(()=>Em()),[u,s]=(0,Me.useState)(""),[c,d]=(0,Me.useState)(!1),p=(0,Me.useRef)(null),m=(0,Me.useRef)(null);(0,Me.useEffect)(()=>{let g=i.filter(f=>!f.pending).map(f=>({role:f.role,content:f.content}));try{sessionStorage.setItem(ms,JSON.stringify(g))}catch{}},[i]),(0,Me.useEffect)(()=>{let g=p.current;g&&(g.scrollTop=g.scrollHeight)},[i,r]),(0,Me.useEffect)(()=>{r&&m.current?.focus()},[r]);let y=(0,Me.useCallback)(async()=>{let g=u.trim();if(!g||c)return;let f=i.filter(x=>!x.pending).map(x=>({role:x.role,content:x.content})),h=[...i,{role:"user",content:g},{role:"assistant",content:"\u2026",pending:!0}];a(h),s(""),d(!0);try{let x=await fetch("/api/workflows/editor/chat",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-Requested-With":"agentx-board"},body:JSON.stringify({messages:[...f,{role:"user",content:g}],currentWorkflow:e,agentId:n})}),C=await x.json().catch(()=>({}));x.ok?a(P=>hs(P,{role:"assistant",content:C.reply||"",workflow:C.workflow||void 0})):a(P=>hs(P,{role:"assistant",content:"",error:C.error||`HTTP ${x.status}`}))}catch(x){a(C=>hs(C,{role:"assistant",content:"",error:x?.message||"network error"}))}finally{d(!1)}},[n,c,e,u,i]),w=()=>{a([]);try{sessionStorage.removeItem(ms)}catch{}},S=g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),y())},H=(0,Me.useMemo)(()=>["Describe the process you want \u2014 I'll generate the workflow.","","Examples:",'\u2022 "Expense approval: employee submits form, manager approves over $500 otherwise auto-approve"','\u2022 "Telegram bot that classifies messages as billing/bug/other and routes to the right agent"',`\u2022 "Triage a GitLab issue: label 'bug' \u2192 dev agent; label 'feature' \u2192 product agent; otherwise close"`].join(`
1342
+ `),[]);return(0,V.jsxs)(V.Fragment,{children:[!r&&(0,V.jsxs)("button",{className:"ax-chat__pill","aria-label":"Open workflow assistant",onClick:()=>o(!0),children:[(0,V.jsx)("span",{className:"ax-chat__pill-glyph",children:"\u2728"}),(0,V.jsx)("span",{className:"ax-chat__pill-text",children:"Ask AI to build\u2026"})]}),r&&(0,V.jsxs)("div",{className:"ax-chat__panel",role:"dialog","aria-label":"Workflow assistant",children:[(0,V.jsxs)("header",{className:"ax-chat__head",children:[(0,V.jsxs)("div",{className:"ax-chat__title",children:[(0,V.jsx)("span",{className:"ax-chat__dot"})," Workflow assistant"]}),(0,V.jsxs)("div",{className:"ax-chat__head-actions",children:[(0,V.jsx)("button",{className:"ax-chat__iconbtn",onClick:w,title:"Clear conversation",children:"\u232B"}),(0,V.jsx)("button",{className:"ax-chat__iconbtn",onClick:()=>o(!1),title:"Collapse",children:"\u25BC"})]})]}),(0,V.jsxs)("div",{className:"ax-chat__body",ref:p,children:[i.length===0&&(0,V.jsx)("pre",{className:"ax-chat__empty",children:H}),i.map((g,f)=>(0,V.jsx)(Sm,{m:g,onApply:t},f))]}),(0,V.jsxs)("footer",{className:"ax-chat__foot",children:[(0,V.jsx)("textarea",{ref:m,className:"ax-chat__input",value:u,onChange:g=>s(g.target.value),onKeyDown:S,placeholder:"Describe the workflow you want\u2026 (Enter to send, Shift+Enter for newline)",rows:2,disabled:c}),(0,V.jsx)("button",{className:"ax-chat__send",onClick:()=>void y(),disabled:c||!u.trim(),children:c?"\u2026":"Send"})]})]}),(0,V.jsx)("style",{children:Tm})]})}function Sm({m:e,onApply:t}){if(e.error)return(0,V.jsxs)("div",{className:"ax-chat__msg ax-chat__msg--err",children:["\u26A0 ",e.error]});if(e.pending)return(0,V.jsx)("div",{className:"ax-chat__msg ax-chat__msg--assistant ax-chat__msg--pending",children:(0,V.jsxs)("span",{className:"ax-chat__typing",children:[(0,V.jsx)("span",{}),(0,V.jsx)("span",{}),(0,V.jsx)("span",{})]})});let n=e.role==="user"?"ax-chat__msg ax-chat__msg--user":"ax-chat__msg ax-chat__msg--assistant",r=Cm(e.content,!!e.workflow),o=e.role==="assistant"?Nm(r):Oi(r);return(0,V.jsxs)("div",{className:n,children:[(0,V.jsx)("div",{className:"ax-chat__text",dangerouslySetInnerHTML:{__html:o}}),e.workflow&&(0,V.jsxs)("div",{className:"ax-chat__apply",children:[(0,V.jsx)("button",{className:"ax-chat__applybtn",onClick:()=>t(e.workflow),children:"Apply to canvas"}),(0,V.jsx)("span",{className:"ax-chat__apply-hint",children:"replaces the current workflow"})]})]})}function Cm(e,t){return t?e.replace(/```(?:json)?\s*\n[\s\S]*?```/g,"").trim():e}function Oi(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Nm(e){let t=[],n=e.replace(/```([a-zA-Z0-9_-]*)\n([\s\S]*?)```/g,(d,p,m)=>{let y=Oi(m.replace(/\n+$/,"")),w=p?` class="lang-${Oi(p)}"`:"";return t.push(`<pre><code${w}>${y}</code></pre>`),`\0CODE${t.length-1}\0`});n=Oi(n),n=n.replace(/`([^`\n]+)`/g,(d,p)=>`<code>${p}</code>`),n=n.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(d,p,m)=>`<a href="${/^https?:\/\/|^\//.test(m)?m:"#"}" target="_blank" rel="noopener noreferrer">${p}</a>`),n=n.replace(/\*\*([^*\n]+)\*\*/g,"<strong>$1</strong>"),n=n.replace(/(?<!\*)\*([^*\n]+)\*(?!\*)/g,"<em>$1</em>");let r=n.split(`
1343
+ `),o=[],i=null,a=()=>{i&&(o.push(`</${i}>`),i=null)},u=[],s=()=>{if(!u.length)return;let d=u.join(" ").trim();d&&o.push(`<p>${d}</p>`),u=[]};for(let d of r){let p=d.trimEnd();if(/^\s*$/.test(p)){s(),a();continue}let m=/^(#{1,3})\s+(.+)/.exec(p);if(m){s(),a();let S=m[1].length+2;o.push(`<h${S}>${m[2]}</h${S}>`);continue}let y=/^\s*[-*]\s+(.+)/.exec(p);if(y){s(),i!=="ul"&&(a(),o.push("<ul>"),i="ul"),o.push(`<li>${y[1]}</li>`);continue}let w=/^\s*\d+\.\s+(.+)/.exec(p);if(w){s(),i!=="ol"&&(a(),o.push("<ol>"),i="ol"),o.push(`<li>${w[1]}</li>`);continue}a(),u.push(p)}s(),a();let c=o.join(`
1344
+ `);return c=c.replace(/CODE(\d+)/g,(d,p)=>t[Number(p)]||""),c}function hs(e,t){let n=[...e];for(let r=n.length-1;r>=0;r--)if(n[r].pending||n[r].role==="assistant")return n[r]=t,n;return n.push(t),n}function Em(){try{let e=sessionStorage.getItem(ms);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>n&&(n.role==="user"||n.role==="assistant")&&typeof n.content=="string"):[]}catch{return[]}}var Tm=`
1345
+ .ax-chat__pill {
1346
+ position: fixed; bottom: 18px; right: 18px; z-index: 40;
1347
+ display: flex; align-items: center; gap: 8px;
1348
+ background: linear-gradient(135deg, #6b5bff, #8b5cf6); color: white;
1349
+ border: 0; border-radius: 999px; padding: 10px 18px;
1350
+ font: 600 13px/1 system-ui, -apple-system, sans-serif;
1351
+ box-shadow: 0 10px 28px rgba(107,91,255,0.35);
1352
+ cursor: pointer; transition: transform 120ms ease, box-shadow 120ms ease;
1353
+ }
1354
+ .ax-chat__pill:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(107,91,255,0.45); }
1355
+ .ax-chat__pill-glyph { font-size: 16px; line-height: 1; }
1356
+
1357
+ .ax-chat__panel {
1358
+ position: fixed; bottom: 18px; right: 18px; z-index: 40;
1359
+ width: 380px; height: 540px; max-height: calc(100vh - 40px);
1360
+ display: flex; flex-direction: column;
1361
+ background: var(--ax-bg, #fff); color: var(--ax-fg, #111);
1362
+ border: 1px solid var(--ax-border, rgba(0,0,0,0.15));
1363
+ border-radius: 12px;
1364
+ box-shadow: 0 20px 50px rgba(0,0,0,0.25);
1365
+ overflow: hidden;
1366
+ }
1367
+ .ax-chat__head {
1368
+ display: flex; align-items: center; justify-content: space-between;
1369
+ padding: 10px 14px;
1370
+ border-bottom: 1px solid var(--ax-border, rgba(0,0,0,0.1));
1371
+ background: linear-gradient(135deg, rgba(107,91,255,0.08), rgba(139,92,246,0.04));
1372
+ }
1373
+ .ax-chat__title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
1374
+ .ax-chat__dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; }
1375
+ .ax-chat__head-actions { display: flex; gap: 4px; }
1376
+ .ax-chat__iconbtn {
1377
+ background: transparent; border: 0; cursor: pointer;
1378
+ padding: 4px 8px; font-size: 14px; color: var(--ax-muted, #666);
1379
+ border-radius: 4px;
1380
+ }
1381
+ .ax-chat__iconbtn:hover { background: rgba(127,127,127,0.15); color: var(--ax-fg); }
1382
+
1383
+ .ax-chat__body {
1384
+ flex: 1; overflow-y: auto; padding: 12px;
1385
+ display: flex; flex-direction: column; gap: 10px;
1386
+ font-size: 13px; line-height: 1.45;
1387
+ }
1388
+ .ax-chat__empty {
1389
+ font-size: 12px; color: var(--ax-muted, #777); white-space: pre-wrap;
1390
+ font-family: inherit; margin: 0;
1391
+ }
1392
+
1393
+ .ax-chat__msg { max-width: 88%; padding: 8px 12px; border-radius: 10px; word-break: break-word; }
1394
+ .ax-chat__msg--user {
1395
+ align-self: flex-end;
1396
+ background: linear-gradient(135deg, #6b5bff, #8b5cf6); color: white;
1397
+ border-bottom-right-radius: 2px;
1398
+ }
1399
+ .ax-chat__msg--assistant {
1400
+ align-self: flex-start;
1401
+ background: rgba(127,127,127,0.12);
1402
+ border-bottom-left-radius: 2px;
1403
+ }
1404
+ .ax-chat__msg--err { align-self: center; background: rgba(192,57,43,0.15); color: #c0392b; font-size: 12px; max-width: 100%; text-align: center; }
1405
+ .ax-chat__msg--pending { min-height: 20px; }
1406
+ .ax-chat__typing { display: inline-flex; gap: 4px; }
1407
+ .ax-chat__typing span {
1408
+ width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5;
1409
+ animation: axchatblink 1s infinite ease-in-out;
1410
+ }
1411
+ .ax-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
1412
+ .ax-chat__typing span:nth-child(3) { animation-delay: 0.3s; }
1413
+ @keyframes axchatblink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
1414
+
1415
+ .ax-chat__text { margin: 0; }
1416
+ .ax-chat__msg--user .ax-chat__text { white-space: pre-wrap; }
1417
+
1418
+ /* Assistant markdown surface ------------------------------------------- */
1419
+ .ax-chat__msg--assistant .ax-chat__text > :first-child { margin-top: 0; }
1420
+ .ax-chat__msg--assistant .ax-chat__text > :last-child { margin-bottom: 0; }
1421
+ .ax-chat__msg--assistant .ax-chat__text p { margin: 6px 0; }
1422
+ .ax-chat__msg--assistant .ax-chat__text h3,
1423
+ .ax-chat__msg--assistant .ax-chat__text h4,
1424
+ .ax-chat__msg--assistant .ax-chat__text h5 {
1425
+ margin: 10px 0 4px; font-weight: 700; font-size: 13px;
1426
+ }
1427
+ .ax-chat__msg--assistant .ax-chat__text ul,
1428
+ .ax-chat__msg--assistant .ax-chat__text ol {
1429
+ margin: 4px 0; padding-left: 20px;
1430
+ }
1431
+ .ax-chat__msg--assistant .ax-chat__text li { margin: 2px 0; }
1432
+ .ax-chat__msg--assistant .ax-chat__text a {
1433
+ color: #6b5bff; text-decoration: underline; word-break: break-all;
1434
+ }
1435
+ .ax-chat__msg--assistant .ax-chat__text code {
1436
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
1437
+ font-size: 11.5px;
1438
+ background: rgba(0,0,0,0.08);
1439
+ padding: 1px 5px; border-radius: 4px;
1440
+ }
1441
+ .ax-chat__msg--assistant .ax-chat__text pre {
1442
+ margin: 6px 0; padding: 8px 10px;
1443
+ background: rgba(0,0,0,0.08);
1444
+ border-radius: 6px;
1445
+ overflow-x: auto; max-width: 100%;
1446
+ }
1447
+ .ax-chat__msg--assistant .ax-chat__text pre code {
1448
+ background: transparent; padding: 0; border-radius: 0;
1449
+ font-size: 11px; line-height: 1.45; white-space: pre;
1450
+ }
1451
+ @media (prefers-color-scheme: dark) {
1452
+ .ax-chat__msg--assistant .ax-chat__text code,
1453
+ .ax-chat__msg--assistant .ax-chat__text pre { background: rgba(255,255,255,0.06); }
1454
+ }
1455
+
1456
+ .ax-chat__apply { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
1457
+ .ax-chat__applybtn {
1458
+ background: #22c55e; color: white; border: 0; border-radius: 6px;
1459
+ padding: 6px 10px; font: 600 12px/1 system-ui; cursor: pointer;
1460
+ }
1461
+ .ax-chat__applybtn:hover { background: #16a34a; }
1462
+ .ax-chat__apply-hint { font-size: 10px; color: var(--ax-muted, #888); }
1463
+
1464
+ .ax-chat__foot {
1465
+ display: flex; gap: 8px; padding: 10px;
1466
+ border-top: 1px solid var(--ax-border, rgba(0,0,0,0.1));
1467
+ }
1468
+ .ax-chat__input {
1469
+ flex: 1; resize: none;
1470
+ font: inherit; padding: 8px 10px;
1471
+ border: 1px solid var(--ax-border, rgba(0,0,0,0.15));
1472
+ border-radius: 8px; background: var(--ax-bg); color: var(--ax-fg);
1473
+ }
1474
+ .ax-chat__input:focus { outline: 2px solid #8b5cf6; outline-offset: -1px; }
1475
+ .ax-chat__send {
1476
+ background: #6b5bff; color: white; border: 0; border-radius: 8px;
1477
+ padding: 0 14px; font: 600 12px/1 system-ui; cursor: pointer;
1478
+ }
1479
+ .ax-chat__send:disabled { opacity: 0.4; cursor: not-allowed; }
1480
+ .ax-chat__send:hover:not(:disabled) { background: #5b4bf0; }
1481
+
1482
+ @media (prefers-color-scheme: dark) {
1483
+ .ax-chat__panel { background: #1a1a1a; color: #eee; border-color: rgba(255,255,255,0.1); }
1484
+ .ax-chat__head { background: linear-gradient(135deg, rgba(107,91,255,0.15), rgba(139,92,246,0.08)); }
1485
+ .ax-chat__input { background: #2a2a2a; color: #eee; border-color: rgba(255,255,255,0.15); }
1486
+ }
1487
+ `;function oo(e,t){let n=t?.nodes??{},r=e.nodes.map(i=>({...i,position:i.position??n[i.id]??void 0})),o=e.edges.map((i,a)=>({...i,id:Pm(i,a)}));return{meta:{id:e.id,version:2,title:e.title,description:e.description,priority:e.priority,fanOut:e.fanOut,envAllow:e.envAllow,retention:e.retention,mesh:e.mesh,project:e.project},nodes:r,edges:o}}function vs(e){let t={id:e.meta.id,version:2,title:e.meta.title,description:e.meta.description,priority:e.meta.priority,fanOut:e.meta.fanOut,nodes:e.nodes.map(r=>({id:r.id,type:r.type,config:r.config??{},position:r.position})),edges:e.edges.map(r=>{let{id:o,...i}=r;return i}),envAllow:e.meta.envAllow,retention:e.meta.retention,mesh:e.meta.mesh??{allowRemote:!1},project:e.meta.project},n={version:1,nodes:Object.fromEntries(e.nodes.filter(r=>r.position).map(r=>[r.id,{x:r.position.x,y:r.position.y}]))};return{workflow:t,layout:n}}function io(e){return{meta:{id:/^[a-z0-9][a-z0-9_-]*$/.test(e)?e:"new-workflow",version:2,title:"New workflow",priority:0,fanOut:!1,envAllow:[],retention:{maxRuns:500,maxDays:90},mesh:{allowRemote:!1}},nodes:[{id:"trigger",type:"trigger.manual",config:{},position:{x:40,y:80}},{id:"end",type:"end",config:{status:"completed"},position:{x:400,y:80}}],edges:[{id:"e-trigger-end",from:"trigger",to:"end"}]}}function Pm(e,t){let n=o=>o.replace(/[^a-zA-Z0-9._-]/g,"_");return`e-${[n(e.from),e.fromPort?n(e.fromPort):"out",n(e.to),String(t)].join("-")}`}var ys="__trigger__";function Fm(){try{return localStorage.getItem("ax_token")||""}catch{return""}}function _n(){let e={"Content-Type":"application/json","X-Requested-With":"agentx-board"},t=Fm();return t&&(e.Authorization="Bearer "+t),e}async function kp(e){let t=await fetch("/api/workflows/"+encodeURIComponent(e),{headers:_n()});if(!t.ok)throw new Error("fetch workflow "+e+": "+t.status);return(await t.json()).workflow}async function bp(e){let t=await fetch("/api/workflows/"+encodeURIComponent(e)+"/layout",{headers:_n()});return t.ok?(await t.json()).layout:null}async function _p(e){let t=await fetch("/api/workflows/"+encodeURIComponent(e.id)+"/validate",{method:"POST",headers:_n(),body:JSON.stringify(e)});return t.ok?await t.json():{ok:!1,issues:[{path:"",message:"HTTP "+t.status}]}}async function ws(e,t){let n=t.create?"/api/workflows":"/api/workflows/"+encodeURIComponent(e.id),r=t.convertFromYaml?n+"?convertFromYaml=true":n,o=t.create?"POST":"PUT",i=await fetch(r,{method:o,headers:_n(),body:JSON.stringify(e)});if(i.ok)return{ok:!0};let a=await i.json().catch(()=>({}));return{ok:!1,issues:a.issues||[{path:"",message:a.error||"HTTP "+i.status}],kind:a.kind,path:a.path,error:a.error}}async function Sp(e,t){await fetch("/api/workflows/"+encodeURIComponent(e)+"/layout",{method:"PUT",headers:_n(),body:JSON.stringify(t)})}async function Cp(e){return(await fetch("/api/workflows/"+encodeURIComponent(e),{method:"DELETE",headers:_n()})).ok}async function Np(){try{let e=await fetch("/api/agents",{headers:_n()});if(!e.ok)return[];let t=await e.json();if(Array.isArray(t))return t.map(n=>typeof n=="string"?{id:n,name:n}:n&&typeof n=="object"&&"id"in n?{id:String(n.id),name:String(n.name??n.id)}:null).filter(n=>n!==null);if(t&&typeof t=="object"&&"agents"in t){let n=t.agents;if(Array.isArray(n))return n.map(r=>({id:String(r.id??r),name:String(r.name??r.id??r)}))}return[]}catch{return[]}}var Xe=oe(Ce(),1);function Mm(e,t){switch(t.type){case"hydrate":return{meta:t.graph.meta,nodes:t.graph.nodes,edges:t.graph.edges,selection:null,isNew:t.isNew};case"setTitle":return{...e,meta:{...e.meta,title:t.title}};case"patchMeta":return{...e,meta:{...e.meta,...t.patch}};case"select":return{...e,selection:t.selection};case"moveNode":return{...e,nodes:e.nodes.map(n=>n.id===t.id?{...n,position:{x:t.x,y:t.y}}:n)};case"patchNode":return{...e,nodes:e.nodes.map(n=>n.id===t.id?{...n,...t.patch}:n)};case"patchNodeData":return{...e,nodes:e.nodes.map(n=>n.id===t.id?{...n,config:{...n.config,...t.patch}}:n)};case"patchEdge":return{...e,edges:e.edges.map(n=>n.id===t.id?{...n,...t.patch}:n)};case"addNode":{let n="n-"+Math.random().toString(36).slice(2,8),r={id:n,type:t.item.type,position:{x:t.x,y:t.y},config:Rm(t.item)};return{...e,nodes:[...e.nodes,r],selection:{kind:"node",id:n}}}case"connect":{if(t.conn.from===t.conn.to)return e;let n="e-"+Math.random().toString(36).slice(2,8),r=e.nodes.find(a=>a.id===t.conn.from),o=t.conn.fromPort==="true"||t.conn.fromPort==="false"?t.conn.fromPort:"",i={id:n,from:t.conn.from,fromPort:t.conn.fromPort,to:t.conn.to,toPort:"in",label:o||(r?.type?.startsWith("trigger.")?"start":"")};return e.edges.some(a=>a.from===i.from&&a.fromPort===i.fromPort&&a.to===i.to)?e:{...e,edges:[...e.edges,i]}}case"delete":{let n=t.selection??e.selection;return n?n.kind==="node"?n.id===ys?e:{...e,nodes:e.nodes.filter(r=>r.id!==n.id),edges:e.edges.filter(r=>r.from!==n.id&&r.to!==n.id),selection:null}:n.kind==="edge"?{...e,edges:e.edges.filter(r=>r.id!==n.id),selection:null}:e:e}case"duplicate":{let n=t.selection??e.selection;if(!n||n.kind!=="node")return e;let r=e.nodes.find(u=>u.id===n.id);if(!r||r.id===ys)return e;let o="n-"+Math.random().toString(36).slice(2,8),i=r.position??{x:0,y:0},a={...r,id:o,position:{x:i.x+40,y:i.y+40}};return{...e,nodes:[...e.nodes,a],selection:{kind:"node",id:o}}}case"layout":{let n=Im(e.nodes,e.edges);return{...e,nodes:e.nodes.map(r=>({...r,...n[r.id]??{}}))}}case"setAll":return t.state}}function Rm(e){if(e.config)return{...e.config};switch(e.type){case"trigger.channel":return{source:e.id.endsWith("whatsapp")?"whatsapp-message":e.id.endsWith("telegram")?"telegram-message":e.id.endsWith("gitlab")?"gitlab-issue":"whatsapp-message",filter:{chat:"*"}};case"trigger.cron":return{spec:"0 * * * *"};case"trigger.manual":return{};case"trigger.hook":return{event:e.id.endsWith(".n8n")?"on:n8n":"on:hook"};case"trigger.form":return{form:{title:"New request",fields:[],submitLabel:"Submit"}};case"agent":return{agentId:"",prompt:"",resultParser:"acme-result-token"};case"transform":return{expr:""};case"branch":return{cases:[{when:{kind:"equals",params:{path:"",value:""}},to:"case1"}],default:"fallback"};case"gateway.parallel":return{mode:"fanOut"};case"rule":return{inputs:[""],rules:[{when:["*"],to:"match",output:{}}],default:{to:"fallback",output:{}}};case"checkpoint":return{name:"wait",waitFor:{source:"manual"},resumeMatch:{}};case"userTask":return{assignTo:"role:reviewers",title:"",form:{title:"Review",fields:[],submitLabel:"Approve",secondaryAction:{key:"reject",label:"Reject"}}};case"subProcess":return{workflowId:"",inputMap:{},awaitCompletion:!0};case"signal.emit":return{name:"",scope:"workflow",payload:{}};case"signal.wait":return{name:"",scope:"workflow",match:{}};case"timer.boundary":return{after:"PT1H"};case"action.send":return{channel:"gitlab",chatId:"",text:""};case"action.createIssue":return{channel:"gitlab",project:"",title:"",description:"",labels:[]};case"action.setLabel":return{channel:"gitlab",add:[],remove:[]};case"action.readLabel":return{channel:"gitlab"};case"action.react":return{channel:"gitlab",emoji:"\u{1F440}"};case"action.editMessage":return{channel:"gitlab",messageId:"",text:""};case"action.logTime":return{channel:"gitlab"};case"action.callHTTP":return{url:"",method:"POST"};case"action.run":return{actionId:"",inputs:{}};case"end":return{status:"completed"}}return{}}function Im(e,t){let n=Object.fromEntries(e.map(s=>[s.id,s])),r={};e.forEach(s=>{r[s.id]=0}),t.forEach(s=>{n[s.to]&&(r[s.to]=(r[s.to]??0)+1)});let o={},i=(s,c)=>{o[s]=Math.max(o[s]??0,c),t.filter(d=>d.from===s).forEach(d=>i(d.to,c+1))};e.filter(s=>(r[s.id]??0)===0).forEach(s=>i(s.id,0));let a={};Object.entries(o).forEach(([s,c])=>{(a[c]??(a[c]=[])).push(s)});let u={};return Object.entries(a).forEach(([s,c])=>{c.forEach((d,p)=>{u[d]={x:80+Number(s)*280,y:120+p*170}})}),u}function Lm(e){let[t,n]=(0,O.useReducer)(Mm,e),r=(0,O.useRef)([]),o=(0,O.useRef)([]),i=(0,O.useRef)(t);(0,O.useEffect)(()=>{i.current=t},[t]);let a=(0,O.useCallback)(d=>{d.type==="select"||d.type==="moveNode"||(r.current.push(i.current),r.current.length>50&&r.current.shift(),o.current=[]),n(d)},[]),u=(0,O.useCallback)(()=>{let d=r.current.pop();d&&(o.current.push(i.current),n({type:"setAll",state:d}))},[]),s=(0,O.useCallback)(()=>{let d=o.current.pop();d&&(r.current.push(i.current),n({type:"setAll",state:d}))},[]),c=(0,O.useCallback)(d=>{r.current=[],o.current=[],n({type:"setAll",state:d})},[]);return{state:t,dispatch:a,undo:u,redo:s,forceReset:c,canUndo:r.current.length>0,canRedo:o.current.length>0}}function Om(e){let t={},n=(r,o)=>{(t[r]??(t[r]=[])).push({message:o})};for(let r of e.nodes){let o=r.config;r.type==="agent"&&!o.agentId&&n(r.id,"Agent node has no agentId selected."),r.type==="branch"&&(!Array.isArray(o.cases)||o.cases.length===0)&&n(r.id,"Branch has no cases \u2014 add at least one.");let i=r.type==="end",a=r.type.startsWith("trigger.");!i&&!a&&!e.edges.some(u=>u.from===r.id)&&n(r.id,"No outgoing connection \u2014 the flow dead-ends here.")}return t}function zm(e){let t=[],n=Object.fromEntries(e.nodes.map(a=>[a.id,a])),r=new Set,o=a=>{if(r.has(a))return;r.add(a);let u=n[a];if(!u)return;let s=u.config;t.push({nodeId:u.id,edgeId:null,title:`${u.id}${s.agentId?` \u2192 ${String(s.agentId)}`:""}`,body:s.prompt?`<span class="mono">${String(s.prompt).slice(0,200)}</span>`:null});let c=e.edges.filter(d=>d.from===a);for(let d of c){let p=d.id??"";t.push({nodeId:null,edgeId:p,title:null,body:null}),o(d.to)}},i=e.nodes.find(a=>a.type.startsWith("trigger."))?.id;return i&&o(i),t}function Ep(){let{state:e,dispatch:t,undo:n,redo:r,forceReset:o,canUndo:i,canRedo:a}=Lm({meta:{id:"loading",version:2,title:"Loading\u2026",priority:0,fanOut:!1,envAllow:[],retention:{maxRuns:500,maxDays:90}},nodes:[],edges:[],selection:null,isNew:!0}),{meta:u,nodes:s,edges:c,selection:d,isNew:p}=e,m=(0,O.useRef)(e);(0,O.useEffect)(()=>{m.current=e},[e]);let[y,w]=(0,O.useState)(()=>document.documentElement.getAttribute("data-theme")??"dark"),[S,H]=(0,O.useState)(()=>localStorage.getItem("wfe.density")??"cozy"),[g,f]=(0,O.useState)(()=>Number(localStorage.getItem("wfe.hue")??255)),[h,x]=(0,O.useState)(()=>localStorage.getItem("wfe.paletteOpen")!=="0"),[C,P]=(0,O.useState)(()=>localStorage.getItem("wfe.inspectorOpen")!=="0"),[M,E]=(0,O.useState)({zoom:.75,tx:40,ty:60});(0,O.useEffect)(()=>{document.documentElement.dataset.theme=y,localStorage.setItem("ax-theme",y)},[y]),(0,O.useEffect)(()=>{localStorage.setItem("wfe.density",S)},[S]),(0,O.useEffect)(()=>{document.documentElement.style.setProperty("--accent-hue",String(g)),localStorage.setItem("wfe.hue",String(g))},[g]),(0,O.useEffect)(()=>{localStorage.setItem("wfe.paletteOpen",h?"1":"0")},[h]),(0,O.useEffect)(()=>{localStorage.setItem("wfe.inspectorOpen",C?"1":"0")},[C]);let K=R=>w(R),[W,ve]=(0,O.useState)(!1),[ir,Sn]=(0,O.useState)(!1),[ar,ao]=(0,O.useState)(null),[lr,at]=(0,O.useState)("is-saved"),lt=(R,z="ok")=>{ao({msg:R,kind:z}),setTimeout(()=>ao(null),2e3)},[Ai,Di]=(0,O.useState)(ip);(0,O.useEffect)(()=>{(async()=>{let R=await Np();if(!R.length)return;let z=R.map((ce,we)=>({id:ce.id,name:ce.name||ce.id,tags:[],color:we*37%360}));Di(z)})()},[]),(0,O.useEffect)(()=>{let R=new URLSearchParams(location.search),z=R.get("new")==="1",ce=R.get("id")||"new-workflow";if(z){o(zi(io(ce),!0));return}(async()=>{try{let[we,xe]=await Promise.all([kp(ce),bp(ce)]),ke=oo(we,xe);o(zi(ke,!1))}catch(we){lt(`Failed to load "${ce}": ${we.message}`,"err"),o(zi(io(ce),!0))}})()},[]),(0,O.useEffect)(()=>{u.id!=="loading"&&at("is-dirty")},[s,c,u]);let sr=(0,O.useCallback)(async()=>{let R=m.current,{workflow:z,layout:ce}=vs({meta:R.meta,nodes:R.nodes,edges:R.edges});at("is-validating");let we=await _p(z);if(!we.ok){at("is-dirty"),lt(`${we.issues.length} validation issue${we.issues.length===1?"":"s"}`,"err");return}let xe=await ws(z,{create:R.isNew});if(!xe.ok&&xe.kind==="yaml-authored"){let ke=xe.path||"(unknown path)";if(!confirm(`This workflow is YAML-authored on disk:
1488
+
1489
+ ${ke}
1490
+
1491
+ Saving from the editor will overwrite the YAML as JSON and discard any comments in the YAML file.
1492
+
1493
+ Continue and convert to JSON?`)){at("is-dirty"),lt("Save canceled \u2014 YAML preserved on disk","err");return}xe=await ws(z,{create:R.isNew,convertFromYaml:!0})}if(!xe.ok){at("is-dirty"),lt(xe.issues?.[0]?.message??"Save failed","err");return}try{await Sp(z.id,ce)}catch{}if(at("is-saved"),lt("Saved","ok"),R.isNew){t({type:"patchMeta",patch:{}});let ke=new URL(location.href);ke.searchParams.delete("new"),ke.searchParams.set("id",z.id),history.replaceState(null,"",ke.toString()),o({...R,isNew:!1})}},[t,o]),Cn=(0,O.useCallback)(R=>t({type:"delete",selection:R}),[t]),ur=(0,O.useCallback)(R=>t({type:"duplicate",selection:R}),[t]),ji=(0,O.useCallback)((R,z,ce)=>t({type:"addNode",item:R,x:z,y:ce}),[t]),Ui=(0,O.useCallback)(R=>t({type:"connect",conn:R}),[t]),Wi=(0,O.useCallback)((R,z,ce)=>t({type:"moveNode",id:R,x:z,y:ce}),[t]),N=(0,O.useCallback)(R=>t({type:"select",selection:R,commit:!0}),[t]),j=R=>{d&&(d.kind==="node"&&t({type:"patchNode",id:d.id,patch:R}),d.kind==="edge"&&t({type:"patchEdge",id:d.id,patch:R}))},U=R=>{!d||d.kind!=="node"||t({type:"patchNodeData",id:d.id,patch:R})},Y=async R=>{if(!confirm(`Replace the current workflow with the "${R.title}" template? (Undoable)`))return;let z=await Am(R.id,u.id);o(zi(z,p)),lt(`Loaded ${R.title}`,"ok")},[q,Ge]=(0,O.useState)(!1),[Z,qe]=(0,O.useState)(-1),ze=(0,O.useMemo)(()=>zm(e),[e]),ye=(0,O.useRef)(null),st=()=>{ye.current&&window.clearInterval(ye.current),Ge(!1),at("is-saved")},cr=()=>{Ge(!0),qe(0),at("is-running"),ye.current&&window.clearInterval(ye.current),ye.current=window.setInterval(()=>{qe(R=>R>=ze.length-1?(ye.current&&window.clearInterval(ye.current),Ge(!1),at("is-saved"),R):R+1)},900)};(0,O.useEffect)(()=>()=>{ye.current&&window.clearInterval(ye.current)},[]);let dr=(0,O.useMemo)(()=>{if(!q&&Z<0)return null;let R=new Set,z=new Set,ce=null,we=null;for(let ke=0;ke<=Z;ke++){let Ae=ze[ke];Ae&&(Ae.nodeId&&(ke===Z?ce=Ae.nodeId:R.add(Ae.nodeId)),Ae.edgeId&&(ke===Z?we=Ae.edgeId:z.add(Ae.edgeId)))}let xe={};for(let ke=0;ke<=Z;ke++){let Ae=ze[ke];!Ae||!Ae.nodeId||!Ae.body||(xe[Ae.nodeId]=Ae.body)}return{visitedNodes:R,visitedEdges:z,currentNodeId:ce,currentEdgeId:we,outputs:xe}},[q,Z,ze]),lo=(0,O.useMemo)(()=>Om(e),[e]),Mp=d?.kind==="node"?lo[d.id]:void 0;(0,O.useEffect)(()=>{let R=z=>{let ce=document.activeElement,we=!!ce&&/^(INPUT|TEXTAREA|SELECT)$/.test(ce.tagName);z.key==="?"&&!we&&Sn(!0),z.key==="Escape"&&(Sn(!1),ve(!1));let xe=z.metaKey||z.ctrlKey;xe&&z.key.toLowerCase()==="z"&&!z.shiftKey?(z.preventDefault(),n()):xe&&(z.key.toLowerCase()==="y"||z.shiftKey&&z.key.toLowerCase()==="z")?(z.preventDefault(),r()):xe&&z.key.toLowerCase()==="s"?(z.preventDefault(),sr()):xe&&z.key==="Enter"?(z.preventDefault(),q?st():cr()):xe&&z.key.toLowerCase()==="d"&&!we&&d?(z.preventDefault(),ur(d)):(z.key==="Delete"||z.key==="Backspace")&&!we&&d?Cn(d):z.key==="/"&&!we&&(z.preventDefault(),document.querySelector(".pal__search input")?.focus())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[d,q,n,r,sr,Cn,ur]),(0,O.useEffect)(()=>{let R=z=>{lr==="is-dirty"&&(z.preventDefault(),z.returnValue="")};return window.addEventListener("beforeunload",R),()=>window.removeEventListener("beforeunload",R)},[lr]);let Rp=async()=>{if(p||!confirm(`Delete workflow "${u.id}"? This cannot be undone.`))return;await Cp(u.id)?(lt("Deleted","ok"),setTimeout(()=>{location.href="/workflows"},500)):lt("Delete failed","err")};return(0,Xe.jsxs)("div",{className:"app","data-density":S,"data-palette":h?"open":"closed","data-inspector":C?"open":"closed",children:[(0,Xe.jsx)(mp,{title:u.title,setTitle:R=>t({type:"setTitle",title:R}),status:lr,theme:y,setTheme:K,canUndo:i,canRedo:a,onUndo:n,onRedo:r,onSave:()=>void sr(),onRun:()=>q?st():cr(),running:q,tweaksOpen:W,setTweaksOpen:ve,onHelp:()=>Sn(!0),onLayout:()=>t({type:"layout"}),workflowIdLabel:`/workflows/${u.id}`,paletteOpen:h,setPaletteOpen:x,inspectorOpen:C,setInspectorOpen:P}),h&&(0,Xe.jsx)(hp,{onLoadTemplate:Y}),(0,Xe.jsx)(cp,{nodes:s,edges:c,selection:d,setSelection:N,onNodeMove:Wi,onAddNode:ji,onConnect:Ui,onDelete:Cn,runState:dr,viewBox:M,setViewBox:E}),C&&(0,Xe.jsx)(gp,{selection:d,nodes:s,edges:c,patch:j,patchData:U,onDelete:Cn,onDuplicate:ur,validation:Mp,runState:dr,agents:Ai,meta:u,patchMeta:R=>t({type:"patchMeta",patch:R}),onDeleteWorkflow:Rp,isNew:p}),(0,Xe.jsx)(vp,{running:q||Z>=0,script:ze,cursor:Z,onStop:()=>{st(),qe(-1)}}),(0,Xe.jsx)(yp,{open:W,setOpen:ve,theme:y,setTheme:K,density:S,setDensity:H,hue:g,setHue:f}),(0,Xe.jsx)(wp,{open:ir,onClose:()=>Sn(!1)}),(0,Xe.jsx)(xp,{currentWorkflow:vs({meta:u,nodes:s,edges:c}).workflow,onApplyWorkflow:R=>{let z=oo(R);t({type:"setAll",state:{meta:z.meta,nodes:z.nodes,edges:z.edges,selection:null,isNew:!1}}),lt("Applied workflow from chat","ok")}}),ar&&(0,Xe.jsxs)("div",{className:"toast"+(ar.kind==="err"?" err":""),children:[(0,Xe.jsx)("span",{className:"dot"}),ar.msg]})]})}function zi(e,t){return{meta:e.meta,nodes:e.nodes,edges:e.edges,selection:null,isNew:t}}async function Am(e,t){return e==="tpl.blank"?io(t||"new-workflow"):e==="tpl.whatsapp"?oo(Dm(t)):e==="tpl.mr"?oo(jm(t)):io(t||"new-workflow")}function Dm(e){return{id:e||"whatsapp-client-support",version:2,title:"WhatsApp client support triage",priority:10,fanOut:!1,envAllow:["GITLAB_TOKEN"],nodes:[{id:"trigger",type:"trigger.channel",config:{source:"whatsapp-message",filter:{chat:"*"}}},{id:"classify",type:"agent",config:{agentId:"intent-classifier",prompt:"Classify this message from {{trigger.sender.name}}:\n{{trigger.text}}\nReply with `RESULT: status-check`, `RESULT: new-request`, or `RESULT: other`."}},{id:"route",type:"branch",config:{cases:[{when:{kind:"equals",params:{path:"classify.result",value:"status-check"}},to:"status"},{when:{kind:"equals",params:{path:"classify.result",value:"new-request"}},to:"new"}],default:"fallback"}},{id:"lookup_ticket",type:"agent",config:{agentId:"gitlab-ticket-lookup",prompt:"Find related issues for {{trigger.sender.name}}. Summarise."}},{id:"reply_status",type:"action.send",config:{channel:"whatsapp",chatId:"{{trigger.chatId}}",text:"{{lookup_ticket.reply}}"}},{id:"create_issue",type:"action.createIssue",config:{channel:"gitlab",project:"acme/web",title:"WhatsApp: {{trigger.sender.name}}",description:`From: {{trigger.sender.name}} ({{trigger.fromJid}})
1494
+
1495
+ {{trigger.text}}`,labels:["source::whatsapp","Triage"]}},{id:"confirm_new",type:"action.send",config:{channel:"whatsapp",chatId:"{{trigger.chatId}}",text:"Thanks \u2014 ticket {{create_issue.issue.webUrl}} opened."}},{id:"fallback",type:"action.send",config:{channel:"whatsapp",chatId:"{{trigger.chatId}}",text:"Got it \u2014 a human will reply shortly."}},{id:"done",type:"end",config:{status:"completed"}}],edges:[{from:"trigger",to:"classify"},{from:"classify",to:"route"},{from:"route",fromPort:"status",to:"lookup_ticket"},{from:"route",fromPort:"new",to:"create_issue"},{from:"route",fromPort:"fallback",to:"fallback"},{from:"lookup_ticket",to:"reply_status"},{from:"create_issue",to:"confirm_new"},{from:"reply_status",to:"done"},{from:"confirm_new",to:"done"},{from:"fallback",to:"done"}],retention:{maxRuns:500,maxDays:90}}}function jm(e){return{id:e||"mr-review",version:2,title:"MR review loop",priority:5,fanOut:!1,envAllow:["GITLAB_TOKEN"],nodes:[{id:"trigger",type:"trigger.channel",config:{source:"gitlab-pipeline",filter:{project:"acme/web"}}},{id:"review",type:"agent",config:{agentId:"code-reviewer",prompt:"Review MR #{{trigger.pipeline.id}}. Reply `RESULT: approved` or `RESULT: changes-requested`."}},{id:"route",type:"branch",config:{cases:[{when:{kind:"equals",params:{path:"review.result",value:"approved"}},to:"approved"},{when:{kind:"equals",params:{path:"review.result",value:"changes-requested"}},to:"rejected"}],default:"done"}},{id:"approved",type:"action.send",config:{channel:"gitlab",chatId:"{{trigger.chatId}}",text:"\u2705 Approved by reviewer"}},{id:"rejected",type:"action.send",config:{channel:"gitlab",chatId:"{{trigger.chatId}}",text:"\u274C Changes requested"}},{id:"done",type:"end",config:{status:"completed"}}],edges:[{from:"trigger",to:"review"},{from:"review",to:"route"},{from:"route",fromPort:"approved",to:"approved"},{from:"route",fromPort:"rejected",to:"rejected"},{from:"route",fromPort:"done",to:"done"},{from:"approved",to:"done"},{from:"rejected",to:"done"}],retention:{maxRuns:500,maxDays:90}}}var Fp=oe(Ce(),1);function Um(e,t){if(document.getElementById(e))return;let n=document.createElement("style");n.id=e,n.textContent=t,document.head.appendChild(n)}function Tp(){Um("wfe-redesign-css",ks);let e=document.getElementById("wfe-root");if(!e){console.error("[wfe] #wfe-root missing \u2014 editor cannot mount");return}(0,Pp.createRoot)(e).render((0,Fp.jsx)(Ep,{}))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Tp):Tp();})();
1496
+ /*! Bundled license information:
1497
+
1498
+ react/cjs/react.production.min.js:
1499
+ (**
1500
+ * @license React
1501
+ * react.production.min.js
1502
+ *
1503
+ * Copyright (c) Facebook, Inc. and its affiliates.
1504
+ *
1505
+ * This source code is licensed under the MIT license found in the
1506
+ * LICENSE file in the root directory of this source tree.
1507
+ *)
1508
+
1509
+ scheduler/cjs/scheduler.production.min.js:
1510
+ (**
1511
+ * @license React
1512
+ * scheduler.production.min.js
1513
+ *
1514
+ * Copyright (c) Facebook, Inc. and its affiliates.
1515
+ *
1516
+ * This source code is licensed under the MIT license found in the
1517
+ * LICENSE file in the root directory of this source tree.
1518
+ *)
1519
+
1520
+ react-dom/cjs/react-dom.production.min.js:
1521
+ (**
1522
+ * @license React
1523
+ * react-dom.production.min.js
1524
+ *
1525
+ * Copyright (c) Facebook, Inc. and its affiliates.
1526
+ *
1527
+ * This source code is licensed under the MIT license found in the
1528
+ * LICENSE file in the root directory of this source tree.
1529
+ *)
1530
+
1531
+ react/cjs/react-jsx-runtime.production.min.js:
1532
+ (**
1533
+ * @license React
1534
+ * react-jsx-runtime.production.min.js
1535
+ *
1536
+ * Copyright (c) Facebook, Inc. and its affiliates.
1537
+ *
1538
+ * This source code is licensed under the MIT license found in the
1539
+ * LICENSE file in the root directory of this source tree.
1540
+ *)
1541
+ */
1542
+ //# sourceMappingURL=workflow-editor.global.js.map