agentix-cli 0.190.0 → 0.191.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 (175) hide show
  1. package/dist/{App-6AHOJ2PO.js → App-Z4OZ4VAI.js} +2 -2
  2. package/dist/{ChatApp-MVSQX44C.js → ChatApp-7VLNOH2N.js} +2 -2
  3. package/dist/{absorb-eval-PHA44MPA.js → absorb-eval-QR3EEHDE.js} +2 -2
  4. package/dist/{adapter-RXZGBGFY.js → adapter-VWMQAALK.js} +2 -2
  5. package/dist/{agent-4CGWR2XJ.js → agent-RS4W545P.js} +2 -2
  6. package/dist/{board-dashboard-3CNZ3R6T.js → board-dashboard-RXOSENTD.js} +318 -317
  7. package/dist/{board-dashboard-3CNZ3R6T.js.map → board-dashboard-RXOSENTD.js.map} +1 -1
  8. package/dist/chunk-2HBEZV7L.js +24 -0
  9. package/dist/chunk-2HBEZV7L.js.map +1 -0
  10. package/dist/{chunk-YHRQQ4DB.js → chunk-34O2GH4J.js} +2 -2
  11. package/dist/{chunk-SOVWD6TL.js → chunk-3NMBTBNW.js} +2 -2
  12. package/dist/{chunk-EGKOB3ZM.js → chunk-54J6PXBG.js} +2 -2
  13. package/dist/{chunk-PE5V2LI7.js → chunk-5ONH4ITT.js} +2 -2
  14. package/dist/{chunk-ZJNEJRUU.js → chunk-6MU3OEII.js} +2 -2
  15. package/dist/chunk-A7JSRDJL.js +3 -0
  16. package/dist/chunk-A7JSRDJL.js.map +1 -0
  17. package/dist/{chunk-OBVLO6FV.js → chunk-AS4NDKUJ.js} +2 -2
  18. package/dist/{chunk-URWRA3EO.js → chunk-BWBTNBPS.js} +2 -2
  19. package/dist/{chunk-U2OGZDAN.js → chunk-CKHLBNMN.js} +2 -2
  20. package/dist/{chunk-ZYZ4VQUD.js → chunk-FRTU3ICQ.js} +2 -2
  21. package/dist/{chunk-FKT34MQ7.js → chunk-IGLJXEXX.js} +2 -2
  22. package/dist/chunk-JRAG37V5.js +3 -0
  23. package/dist/chunk-JRAG37V5.js.map +1 -0
  24. package/dist/{chunk-H7VI7OTS.js → chunk-KTGTKOLV.js} +2 -2
  25. package/dist/{chunk-A5KZSTYI.js → chunk-L3CWRXKQ.js} +2 -2
  26. package/dist/{chunk-POK4IPY3.js → chunk-MW75GECE.js} +94 -92
  27. package/dist/chunk-MW75GECE.js.map +1 -0
  28. package/dist/{chunk-WXJ25XH2.js → chunk-OTCMYGQR.js} +2 -2
  29. package/dist/{chunk-7BA4KCRW.js → chunk-RA4WCDGV.js} +2 -2
  30. package/dist/{chunk-QBR6TGRW.js → chunk-RQKLUGMS.js} +3 -3
  31. package/dist/{chunk-YLCMN4OA.js → chunk-RRGC6Y4L.js} +2 -2
  32. package/dist/{chunk-JE5KSD6Z.js → chunk-S3XUIVC2.js} +2 -2
  33. package/dist/{chunk-WILRVP4X.js → chunk-T2NPSEPJ.js} +2 -2
  34. package/dist/chunk-U5B275AU.js +143 -0
  35. package/dist/chunk-U5B275AU.js.map +1 -0
  36. package/dist/{chunk-UU77SLIS.js → chunk-WXSS7VIW.js} +302 -297
  37. package/dist/chunk-WXSS7VIW.js.map +1 -0
  38. package/dist/{chunk-J522P3Z3.js → chunk-XJEBJZLX.js} +2 -2
  39. package/dist/{chunk-Z55PWDYH.js → chunk-XJUBFPOM.js} +2 -2
  40. package/dist/chunk-XVV7ZZ77.js +6 -0
  41. package/dist/{chunk-4ZWZ42YE.js.map → chunk-XVV7ZZ77.js.map} +1 -1
  42. package/dist/{chunk-2MFBCDWL.js → chunk-YFJVQOWI.js} +2 -2
  43. package/dist/{chunk-FM5VBO3D.js → chunk-YMDGKFIG.js} +2 -2
  44. package/dist/{chunk-V2O4OQZC.js → chunk-YOMLHG33.js} +2 -2
  45. package/dist/{chunk-XIGFRLU5.js → chunk-ZCBTTYQN.js} +20 -20
  46. package/dist/chunk-ZCBTTYQN.js.map +1 -0
  47. package/dist/{chunk-YJDQK22T.js → chunk-ZJ74H5SV.js} +2 -2
  48. package/dist/{chunk-BSQIPD6F.js → chunk-ZU6W3CXO.js} +36 -36
  49. package/dist/chunk-ZU6W3CXO.js.map +1 -0
  50. package/dist/cli.js +1 -1
  51. package/dist/{client-YDESLBEL.js → client-N5YTG2K6.js} +2 -2
  52. package/dist/{compaction-R7VWQB6X.js → compaction-ZE2WYXHQ.js} +2 -2
  53. package/dist/{config-J7LIYG6O.js → config-WUB5SJPH.js} +2 -2
  54. package/dist/{config-mutate-WNWJL2BY.js → config-mutate-ZLPUEIVN.js} +2 -2
  55. package/dist/config-mutator-S5X4DOJK.js +2 -0
  56. package/dist/{contributions-VVKFLXVL.js → contributions-C4DKQJY6.js} +2 -2
  57. package/dist/{contributions-VVKFLXVL.js.map → contributions-C4DKQJY6.js.map} +1 -1
  58. package/dist/{doctor-IPU5KA2L.js → doctor-ND3OS575.js} +2 -2
  59. package/dist/fact-proposals-Z7HJG7QJ.js +2 -0
  60. package/dist/{follow-up-tool-NUXHITTB.js → follow-up-tool-TWOEAWOL.js} +2 -2
  61. package/dist/{hub-4SPXWMRT.js → hub-FUM7UY5S.js} +2 -2
  62. package/dist/index.d.ts +216 -4
  63. package/dist/index.js +1 -1
  64. package/dist/index.js.map +1 -1
  65. package/dist/ledger-5GMBLR7W.js +2 -0
  66. package/dist/memory-extract-QYSXPK22.js +2 -0
  67. package/dist/memory-migrate-SO7RC5OU.js +2 -0
  68. package/dist/{memory-migrate-ED37IBEL.js.map → memory-migrate-SO7RC5OU.js.map} +1 -1
  69. package/dist/{program-5LBTVRBW.js → program-JLUZINRR.js} +201 -201
  70. package/dist/program-JLUZINRR.js.map +1 -0
  71. package/dist/{promote-A7VZBQUZ.js → promote-M5AJSWHZ.js} +2 -2
  72. package/dist/{query-5I6RBPPK.js → query-NPDKXBTN.js} +2 -2
  73. package/dist/{query-settings-QLLC46BO.js → query-settings-HXKZYIEV.js} +2 -2
  74. package/dist/registry-A2FFL4EA.js +2 -0
  75. package/dist/{request-planner-SF4GYBQE.js → request-planner-ANGZP4JL.js} +2 -2
  76. package/dist/{review-candidates-KPAZ3FYG.js → review-candidates-B7T2QA3R.js} +2 -2
  77. package/dist/{rotation-memo-6RP4Z3S5.js → rotation-memo-26CFE4JN.js} +4 -3
  78. package/dist/rotation-memo-26CFE4JN.js.map +1 -0
  79. package/dist/rotation-memo-store-WMDI7NND.js +2 -0
  80. package/dist/{rotation-memo-store-Z4D5KRA6.js.map → rotation-memo-store-WMDI7NND.js.map} +1 -1
  81. package/dist/{routing-RUJNJHM6.js → routing-2KWP5TAT.js} +2 -2
  82. package/dist/schedule-tool-2UNMXEBQ.js +2 -0
  83. package/dist/{scheduler-C44WJX4C.js → scheduler-VN7WDAKE.js} +2 -2
  84. package/dist/{seat-QY2GW3FI.js → seat-MAC3QGGD.js} +2 -2
  85. package/dist/{select-XJMJ2XVP.js → select-UYKEN4N4.js} +2 -2
  86. package/dist/{set-enabled-JC3TJ6VZ.js → set-enabled-JEUIINT3.js} +2 -2
  87. package/dist/{sprint-tool-NP4WN7KL.js → sprint-tool-MB2MPR4K.js} +2 -2
  88. package/dist/{tool-23ODBVYF.js → tool-L4CQCPRF.js} +2 -2
  89. package/dist/{tool-LZR4EOQJ.js → tool-SZ6C6EBP.js} +2 -2
  90. package/dist/{tool-KHD45TSF.js → tool-TLXKW55S.js} +2 -2
  91. package/dist/web/workflow-editor.global.js +12 -12
  92. package/dist/web/workflow-editor.global.js.map +1 -1
  93. package/dist/{wiki-N3JOY2NN.js → wiki-ZAHFGDKE.js} +2 -2
  94. package/dist/wiki-enrich-QLCQHV6B.js +2 -0
  95. package/package.json +1 -1
  96. package/dist/chunk-4ZWZ42YE.js +0 -5
  97. package/dist/chunk-BSQIPD6F.js.map +0 -1
  98. package/dist/chunk-C5OCJCDC.js +0 -137
  99. package/dist/chunk-C5OCJCDC.js.map +0 -1
  100. package/dist/chunk-GQ76J72O.js +0 -3
  101. package/dist/chunk-GQ76J72O.js.map +0 -1
  102. package/dist/chunk-LE3BXIUF.js +0 -23
  103. package/dist/chunk-LE3BXIUF.js.map +0 -1
  104. package/dist/chunk-POK4IPY3.js.map +0 -1
  105. package/dist/chunk-UU77SLIS.js.map +0 -1
  106. package/dist/chunk-XIGFRLU5.js.map +0 -1
  107. package/dist/config-mutator-V3PSCM6Q.js +0 -2
  108. package/dist/fact-proposals-X2O4W7VN.js +0 -2
  109. package/dist/ledger-P62U3FHT.js +0 -2
  110. package/dist/memory-extract-NLVLQE7V.js +0 -2
  111. package/dist/memory-migrate-ED37IBEL.js +0 -2
  112. package/dist/program-5LBTVRBW.js.map +0 -1
  113. package/dist/registry-J724YF5H.js +0 -2
  114. package/dist/rotation-memo-6RP4Z3S5.js.map +0 -1
  115. package/dist/rotation-memo-store-Z4D5KRA6.js +0 -2
  116. package/dist/schedule-tool-PX5YULLG.js +0 -2
  117. package/dist/wiki-enrich-ZNFEO7BX.js +0 -2
  118. /package/dist/{App-6AHOJ2PO.js.map → App-Z4OZ4VAI.js.map} +0 -0
  119. /package/dist/{ChatApp-MVSQX44C.js.map → ChatApp-7VLNOH2N.js.map} +0 -0
  120. /package/dist/{absorb-eval-PHA44MPA.js.map → absorb-eval-QR3EEHDE.js.map} +0 -0
  121. /package/dist/{adapter-RXZGBGFY.js.map → adapter-VWMQAALK.js.map} +0 -0
  122. /package/dist/{agent-4CGWR2XJ.js.map → agent-RS4W545P.js.map} +0 -0
  123. /package/dist/{chunk-YHRQQ4DB.js.map → chunk-34O2GH4J.js.map} +0 -0
  124. /package/dist/{chunk-SOVWD6TL.js.map → chunk-3NMBTBNW.js.map} +0 -0
  125. /package/dist/{chunk-EGKOB3ZM.js.map → chunk-54J6PXBG.js.map} +0 -0
  126. /package/dist/{chunk-PE5V2LI7.js.map → chunk-5ONH4ITT.js.map} +0 -0
  127. /package/dist/{chunk-ZJNEJRUU.js.map → chunk-6MU3OEII.js.map} +0 -0
  128. /package/dist/{chunk-OBVLO6FV.js.map → chunk-AS4NDKUJ.js.map} +0 -0
  129. /package/dist/{chunk-URWRA3EO.js.map → chunk-BWBTNBPS.js.map} +0 -0
  130. /package/dist/{chunk-U2OGZDAN.js.map → chunk-CKHLBNMN.js.map} +0 -0
  131. /package/dist/{chunk-ZYZ4VQUD.js.map → chunk-FRTU3ICQ.js.map} +0 -0
  132. /package/dist/{chunk-FKT34MQ7.js.map → chunk-IGLJXEXX.js.map} +0 -0
  133. /package/dist/{chunk-H7VI7OTS.js.map → chunk-KTGTKOLV.js.map} +0 -0
  134. /package/dist/{chunk-A5KZSTYI.js.map → chunk-L3CWRXKQ.js.map} +0 -0
  135. /package/dist/{chunk-WXJ25XH2.js.map → chunk-OTCMYGQR.js.map} +0 -0
  136. /package/dist/{chunk-7BA4KCRW.js.map → chunk-RA4WCDGV.js.map} +0 -0
  137. /package/dist/{chunk-QBR6TGRW.js.map → chunk-RQKLUGMS.js.map} +0 -0
  138. /package/dist/{chunk-YLCMN4OA.js.map → chunk-RRGC6Y4L.js.map} +0 -0
  139. /package/dist/{chunk-JE5KSD6Z.js.map → chunk-S3XUIVC2.js.map} +0 -0
  140. /package/dist/{chunk-WILRVP4X.js.map → chunk-T2NPSEPJ.js.map} +0 -0
  141. /package/dist/{chunk-J522P3Z3.js.map → chunk-XJEBJZLX.js.map} +0 -0
  142. /package/dist/{chunk-Z55PWDYH.js.map → chunk-XJUBFPOM.js.map} +0 -0
  143. /package/dist/{chunk-2MFBCDWL.js.map → chunk-YFJVQOWI.js.map} +0 -0
  144. /package/dist/{chunk-FM5VBO3D.js.map → chunk-YMDGKFIG.js.map} +0 -0
  145. /package/dist/{chunk-V2O4OQZC.js.map → chunk-YOMLHG33.js.map} +0 -0
  146. /package/dist/{chunk-YJDQK22T.js.map → chunk-ZJ74H5SV.js.map} +0 -0
  147. /package/dist/{client-YDESLBEL.js.map → client-N5YTG2K6.js.map} +0 -0
  148. /package/dist/{compaction-R7VWQB6X.js.map → compaction-ZE2WYXHQ.js.map} +0 -0
  149. /package/dist/{config-J7LIYG6O.js.map → config-WUB5SJPH.js.map} +0 -0
  150. /package/dist/{config-mutate-WNWJL2BY.js.map → config-mutate-ZLPUEIVN.js.map} +0 -0
  151. /package/dist/{config-mutator-V3PSCM6Q.js.map → config-mutator-S5X4DOJK.js.map} +0 -0
  152. /package/dist/{doctor-IPU5KA2L.js.map → doctor-ND3OS575.js.map} +0 -0
  153. /package/dist/{fact-proposals-X2O4W7VN.js.map → fact-proposals-Z7HJG7QJ.js.map} +0 -0
  154. /package/dist/{follow-up-tool-NUXHITTB.js.map → follow-up-tool-TWOEAWOL.js.map} +0 -0
  155. /package/dist/{hub-4SPXWMRT.js.map → hub-FUM7UY5S.js.map} +0 -0
  156. /package/dist/{ledger-P62U3FHT.js.map → ledger-5GMBLR7W.js.map} +0 -0
  157. /package/dist/{memory-extract-NLVLQE7V.js.map → memory-extract-QYSXPK22.js.map} +0 -0
  158. /package/dist/{promote-A7VZBQUZ.js.map → promote-M5AJSWHZ.js.map} +0 -0
  159. /package/dist/{query-5I6RBPPK.js.map → query-NPDKXBTN.js.map} +0 -0
  160. /package/dist/{query-settings-QLLC46BO.js.map → query-settings-HXKZYIEV.js.map} +0 -0
  161. /package/dist/{registry-J724YF5H.js.map → registry-A2FFL4EA.js.map} +0 -0
  162. /package/dist/{request-planner-SF4GYBQE.js.map → request-planner-ANGZP4JL.js.map} +0 -0
  163. /package/dist/{review-candidates-KPAZ3FYG.js.map → review-candidates-B7T2QA3R.js.map} +0 -0
  164. /package/dist/{routing-RUJNJHM6.js.map → routing-2KWP5TAT.js.map} +0 -0
  165. /package/dist/{schedule-tool-PX5YULLG.js.map → schedule-tool-2UNMXEBQ.js.map} +0 -0
  166. /package/dist/{scheduler-C44WJX4C.js.map → scheduler-VN7WDAKE.js.map} +0 -0
  167. /package/dist/{seat-QY2GW3FI.js.map → seat-MAC3QGGD.js.map} +0 -0
  168. /package/dist/{select-XJMJ2XVP.js.map → select-UYKEN4N4.js.map} +0 -0
  169. /package/dist/{set-enabled-JC3TJ6VZ.js.map → set-enabled-JEUIINT3.js.map} +0 -0
  170. /package/dist/{sprint-tool-NP4WN7KL.js.map → sprint-tool-MB2MPR4K.js.map} +0 -0
  171. /package/dist/{tool-23ODBVYF.js.map → tool-L4CQCPRF.js.map} +0 -0
  172. /package/dist/{tool-LZR4EOQJ.js.map → tool-SZ6C6EBP.js.map} +0 -0
  173. /package/dist/{tool-KHD45TSF.js.map → tool-TLXKW55S.js.map} +0 -0
  174. /package/dist/{wiki-N3JOY2NN.js.map → wiki-ZAHFGDKE.js.map} +0 -0
  175. /package/dist/{wiki-enrich-ZNFEO7BX.js.map → wiki-enrich-QLCQHV6B.js.map} +0 -0
@@ -1,11 +1,11 @@
1
- "use strict";(()=>{var af=Object.create;var js=Object.defineProperty;var lf=Object.getOwnPropertyDescriptor;var sf=Object.getOwnPropertyNames;var uf=Object.getPrototypeOf,cf=Object.prototype.hasOwnProperty;var jt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var df=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of sf(t))!cf.call(e,o)&&o!==n&&js(e,o,{get:()=>t[o],enumerable:!(r=lf(t,o))||r.enumerable});return e};var ge=(e,t,n)=>(n=e!=null?af(uf(e)):{},df(t||!e||!e.__esModule?js(n,"default",{value:e,enumerable:!0}):n,e));var Zs=jt(X=>{"use strict";var Sr=Symbol.for("react.element"),ff=Symbol.for("react.portal"),hf=Symbol.for("react.fragment"),gf=Symbol.for("react.strict_mode"),mf=Symbol.for("react.profiler"),vf=Symbol.for("react.provider"),yf=Symbol.for("react.context"),wf=Symbol.for("react.forward_ref"),xf=Symbol.for("react.suspense"),kf=Symbol.for("react.memo"),bf=Symbol.for("react.lazy"),$s=Symbol.iterator;function _f(e){return e===null||typeof e!="object"?null:(e=$s&&e[$s]||e["@@iterator"],typeof e=="function"?e:null)}var Gs={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Vs=Object.assign,Ks={};function Vn(e,t,n){this.props=e,this.context=t,this.refs=Ks,this.updater=n||Gs}Vn.prototype.isReactComponent={};Vn.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")};Vn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ys(){}Ys.prototype=Vn.prototype;function ea(e,t,n){this.props=e,this.context=t,this.refs=Ks,this.updater=n||Gs}var ta=ea.prototype=new Ys;ta.constructor=ea;Vs(ta,Vn.prototype);ta.isPureReactComponent=!0;var Hs=Array.isArray,Qs=Object.prototype.hasOwnProperty,na={current:null},Xs={key:!0,ref:!0,__self:!0,__source:!0};function Js(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)Qs.call(t,r)&&!Xs.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:Sr,type:e,key:i,ref:a,props:o,_owner:na.current}}function Sf(e,t){return{$$typeof:Sr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ra(e){return typeof e=="object"&&e!==null&&e.$$typeof===Sr}function Cf(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Bs=/\/+/g;function Zi(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Cf(""+e.key):t.toString(36)}function ko(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 Sr:case ff:a=!0}}if(a)return a=e,o=o(a),e=r===""?"."+Zi(a,0):r,Hs(o)?(n="",e!=null&&(n=e.replace(Bs,"$&/")+"/"),ko(o,t,n,"",function(c){return c})):o!=null&&(ra(o)&&(o=Sf(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(Bs,"$&/")+"/")+e)),t.push(o)),1;if(a=0,r=r===""?".":r+":",Hs(e))for(var u=0;u<e.length;u++){i=e[u];var s=r+Zi(i,u);a+=ko(i,t,n,s,o)}else if(s=_f(e),typeof s=="function")for(e=s.call(e),u=0;!(i=e.next()).done;)i=i.value,s=r+Zi(i,u++),a+=ko(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 xo(e,t,n){if(e==null)return e;var r=[],o=0;return ko(e,r,"","",function(i){return t.call(n,i,o++)}),r}function Nf(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 Ge={current:null},bo={transition:null},Ef={ReactCurrentDispatcher:Ge,ReactCurrentBatchConfig:bo,ReactCurrentOwner:na};function qs(){throw Error("act(...) is not supported in production builds of React.")}X.Children={map:xo,forEach:function(e,t,n){xo(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return xo(e,function(){t++}),t},toArray:function(e){return xo(e,function(t){return t})||[]},only:function(e){if(!ra(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};X.Component=Vn;X.Fragment=hf;X.Profiler=mf;X.PureComponent=ea;X.StrictMode=gf;X.Suspense=xf;X.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ef;X.act=qs;X.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=Vs({},e.props),o=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=na.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(s in t)Qs.call(t,s)&&!Xs.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:Sr,type:e.type,key:o,ref:i,props:r,_owner:a}};X.createContext=function(e){return e={$$typeof:yf,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:vf,_context:e},e.Consumer=e};X.createElement=Js;X.createFactory=function(e){var t=Js.bind(null,e);return t.type=e,t};X.createRef=function(){return{current:null}};X.forwardRef=function(e){return{$$typeof:wf,render:e}};X.isValidElement=ra;X.lazy=function(e){return{$$typeof:bf,_payload:{_status:-1,_result:e},_init:Nf}};X.memo=function(e,t){return{$$typeof:kf,type:e,compare:t===void 0?null:t}};X.startTransition=function(e){var t=bo.transition;bo.transition={};try{e()}finally{bo.transition=t}};X.unstable_act=qs;X.useCallback=function(e,t){return Ge.current.useCallback(e,t)};X.useContext=function(e){return Ge.current.useContext(e)};X.useDebugValue=function(){};X.useDeferredValue=function(e){return Ge.current.useDeferredValue(e)};X.useEffect=function(e,t){return Ge.current.useEffect(e,t)};X.useId=function(){return Ge.current.useId()};X.useImperativeHandle=function(e,t,n){return Ge.current.useImperativeHandle(e,t,n)};X.useInsertionEffect=function(e,t){return Ge.current.useInsertionEffect(e,t)};X.useLayoutEffect=function(e,t){return Ge.current.useLayoutEffect(e,t)};X.useMemo=function(e,t){return Ge.current.useMemo(e,t)};X.useReducer=function(e,t,n){return Ge.current.useReducer(e,t,n)};X.useRef=function(e){return Ge.current.useRef(e)};X.useState=function(e){return Ge.current.useState(e)};X.useSyncExternalStore=function(e,t,n){return Ge.current.useSyncExternalStore(e,t,n)};X.useTransition=function(){return Ge.current.useTransition()};X.version="18.3.1"});var Ut=jt((_v,eu)=>{"use strict";eu.exports=Zs()});var cu=jt(ue=>{"use strict";function la(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<_o(o,t))e[r]=t,e[n]=o,n=r;else break e}}function wt(e){return e.length===0?null:e[0]}function Co(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>_o(u,n))s<o&&0>_o(c,u)?(e[r]=c,e[s]=n,r=s):(e[r]=u,e[a]=n,r=a);else if(s<o&&0>_o(c,n))e[r]=c,e[s]=n,r=s;else break e}}return t}function _o(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(tu=performance,ue.unstable_now=function(){return tu.now()}):(oa=Date,nu=oa.now(),ue.unstable_now=function(){return oa.now()-nu});var tu,oa,nu,Mt=[],en=[],Tf=1,ct=null,We=3,No=!1,Cn=!1,Nr=!1,iu=typeof setTimeout=="function"?setTimeout:null,au=typeof clearTimeout=="function"?clearTimeout:null,ru=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function sa(e){for(var t=wt(en);t!==null;){if(t.callback===null)Co(en);else if(t.startTime<=e)Co(en),t.sortIndex=t.expirationTime,la(Mt,t);else break;t=wt(en)}}function ua(e){if(Nr=!1,sa(e),!Cn)if(wt(Mt)!==null)Cn=!0,da(ca);else{var t=wt(en);t!==null&&pa(ua,t.startTime-e)}}function ca(e,t){Cn=!1,Nr&&(Nr=!1,au(Er),Er=-1),No=!0;var n=We;try{for(sa(t),ct=wt(Mt);ct!==null&&(!(ct.expirationTime>t)||e&&!uu());){var r=ct.callback;if(typeof r=="function"){ct.callback=null,We=ct.priorityLevel;var o=r(ct.expirationTime<=t);t=ue.unstable_now(),typeof o=="function"?ct.callback=o:ct===wt(Mt)&&Co(Mt),sa(t)}else Co(Mt);ct=wt(Mt)}if(ct!==null)var i=!0;else{var a=wt(en);a!==null&&pa(ua,a.startTime-t),i=!1}return i}finally{ct=null,We=n,No=!1}}var Eo=!1,So=null,Er=-1,lu=5,su=-1;function uu(){return!(ue.unstable_now()-su<lu)}function ia(){if(So!==null){var e=ue.unstable_now();su=e;var t=!0;try{t=So(!0,e)}finally{t?Cr():(Eo=!1,So=null)}}else Eo=!1}var Cr;typeof ru=="function"?Cr=function(){ru(ia)}:typeof MessageChannel<"u"?(aa=new MessageChannel,ou=aa.port2,aa.port1.onmessage=ia,Cr=function(){ou.postMessage(null)}):Cr=function(){iu(ia,0)};var aa,ou;function da(e){So=e,Eo||(Eo=!0,Cr())}function pa(e,t){Er=iu(function(){e(ue.unstable_now())},t)}ue.unstable_IdlePriority=5;ue.unstable_ImmediatePriority=1;ue.unstable_LowPriority=4;ue.unstable_NormalPriority=3;ue.unstable_Profiling=null;ue.unstable_UserBlockingPriority=2;ue.unstable_cancelCallback=function(e){e.callback=null};ue.unstable_continueExecution=function(){Cn||No||(Cn=!0,da(ca))};ue.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"):lu=0<e?Math.floor(1e3/e):5};ue.unstable_getCurrentPriorityLevel=function(){return We};ue.unstable_getFirstCallbackNode=function(){return wt(Mt)};ue.unstable_next=function(e){switch(We){case 1:case 2:case 3:var t=3;break;default:t=We}var n=We;We=t;try{return e()}finally{We=n}};ue.unstable_pauseExecution=function(){};ue.unstable_requestPaint=function(){};ue.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=We;We=e;try{return t()}finally{We=n}};ue.unstable_scheduleCallback=function(e,t,n){var r=ue.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,la(en,e),wt(Mt)===null&&e===wt(en)&&(Nr?(au(Er),Er=-1):Nr=!0,pa(ua,n-r))):(e.sortIndex=o,la(Mt,e),Cn||No||(Cn=!0,da(ca))),e};ue.unstable_shouldYield=uu;ue.unstable_wrapCallback=function(e){var t=We;return function(){var n=We;We=t;try{return e.apply(this,arguments)}finally{We=n}}}});var pu=jt((Cv,du)=>{"use strict";du.exports=cu()});var mp=jt(ut=>{"use strict";var Pf=Ut(),lt=pu();function S(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 wc=new Set,Qr={};function Dn(e,t){fr(e,t),fr(e+"Capture",t)}function fr(e,t){for(Qr[e]=t,e=0;e<t.length;e++)wc.add(t[e])}var Kt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oa=Object.prototype.hasOwnProperty,Mf=/^[: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]*$/,fu={},hu={};function Ff(e){return Oa.call(hu,e)?!0:Oa.call(fu,e)?!1:Mf.test(e)?hu[e]=!0:(fu[e]=!0,!1)}function Lf(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 If(e,t,n,r){if(t===null||typeof t>"u"||Lf(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 Ye(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 ze={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ze[e]=new Ye(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ze[t]=new Ye(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ze[e]=new Ye(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ze[e]=new Ye(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){ze[e]=new Ye(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ze[e]=new Ye(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ze[e]=new Ye(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ze[e]=new Ye(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ze[e]=new Ye(e,5,!1,e.toLowerCase(),null,!1,!1)});var El=/[\-:]([a-z])/g;function Tl(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(El,Tl);ze[t]=new Ye(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(El,Tl);ze[t]=new Ye(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(El,Tl);ze[t]=new Ye(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ze[e]=new Ye(e,1,!1,e.toLowerCase(),null,!1,!1)});ze.xlinkHref=new Ye("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ze[e]=new Ye(e,1,!1,e.toLowerCase(),null,!0,!0)});function Pl(e,t,n,r){var o=ze.hasOwnProperty(t)?ze[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(If(t,n,o,r)&&(n=null),r||o===null?Ff(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 Jt=Pf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,To=Symbol.for("react.element"),Qn=Symbol.for("react.portal"),Xn=Symbol.for("react.fragment"),Ml=Symbol.for("react.strict_mode"),Aa=Symbol.for("react.profiler"),xc=Symbol.for("react.provider"),kc=Symbol.for("react.context"),Fl=Symbol.for("react.forward_ref"),za=Symbol.for("react.suspense"),Da=Symbol.for("react.suspense_list"),Ll=Symbol.for("react.memo"),nn=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var bc=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var gu=Symbol.iterator;function Tr(e){return e===null||typeof e!="object"?null:(e=gu&&e[gu]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Object.assign,fa;function Ar(e){if(fa===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);fa=t&&t[1]||""}return`
2
- `+fa+e}var ha=!1;function ga(e,t){if(!e||ha)return"";ha=!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(`
1
+ "use strict";(()=>{var af=Object.create;var js=Object.defineProperty;var lf=Object.getOwnPropertyDescriptor;var sf=Object.getOwnPropertyNames;var uf=Object.getPrototypeOf,cf=Object.prototype.hasOwnProperty;var jt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var df=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of sf(t))!cf.call(e,o)&&o!==n&&js(e,o,{get:()=>t[o],enumerable:!(r=lf(t,o))||r.enumerable});return e};var ge=(e,t,n)=>(n=e!=null?af(uf(e)):{},df(t||!e||!e.__esModule?js(n,"default",{value:e,enumerable:!0}):n,e));var Zs=jt(X=>{"use strict";var Sr=Symbol.for("react.element"),ff=Symbol.for("react.portal"),hf=Symbol.for("react.fragment"),gf=Symbol.for("react.strict_mode"),mf=Symbol.for("react.profiler"),vf=Symbol.for("react.provider"),yf=Symbol.for("react.context"),wf=Symbol.for("react.forward_ref"),xf=Symbol.for("react.suspense"),kf=Symbol.for("react.memo"),bf=Symbol.for("react.lazy"),$s=Symbol.iterator;function _f(e){return e===null||typeof e!="object"?null:(e=$s&&e[$s]||e["@@iterator"],typeof e=="function"?e:null)}var Gs={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Vs=Object.assign,Ks={};function Vn(e,t,n){this.props=e,this.context=t,this.refs=Ks,this.updater=n||Gs}Vn.prototype.isReactComponent={};Vn.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")};Vn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ys(){}Ys.prototype=Vn.prototype;function ta(e,t,n){this.props=e,this.context=t,this.refs=Ks,this.updater=n||Gs}var na=ta.prototype=new Ys;na.constructor=ta;Vs(na,Vn.prototype);na.isPureReactComponent=!0;var Hs=Array.isArray,Qs=Object.prototype.hasOwnProperty,ra={current:null},Xs={key:!0,ref:!0,__self:!0,__source:!0};function Js(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)Qs.call(t,r)&&!Xs.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:Sr,type:e,key:i,ref:a,props:o,_owner:ra.current}}function Sf(e,t){return{$$typeof:Sr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function oa(e){return typeof e=="object"&&e!==null&&e.$$typeof===Sr}function Cf(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Bs=/\/+/g;function ea(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Cf(""+e.key):t.toString(36)}function bo(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 Sr:case ff:a=!0}}if(a)return a=e,o=o(a),e=r===""?"."+ea(a,0):r,Hs(o)?(n="",e!=null&&(n=e.replace(Bs,"$&/")+"/"),bo(o,t,n,"",function(c){return c})):o!=null&&(oa(o)&&(o=Sf(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(Bs,"$&/")+"/")+e)),t.push(o)),1;if(a=0,r=r===""?".":r+":",Hs(e))for(var u=0;u<e.length;u++){i=e[u];var s=r+ea(i,u);a+=bo(i,t,n,s,o)}else if(s=_f(e),typeof s=="function")for(e=s.call(e),u=0;!(i=e.next()).done;)i=i.value,s=r+ea(i,u++),a+=bo(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 ko(e,t,n){if(e==null)return e;var r=[],o=0;return bo(e,r,"","",function(i){return t.call(n,i,o++)}),r}function Nf(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 Ge={current:null},_o={transition:null},Ef={ReactCurrentDispatcher:Ge,ReactCurrentBatchConfig:_o,ReactCurrentOwner:ra};function qs(){throw Error("act(...) is not supported in production builds of React.")}X.Children={map:ko,forEach:function(e,t,n){ko(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ko(e,function(){t++}),t},toArray:function(e){return ko(e,function(t){return t})||[]},only:function(e){if(!oa(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};X.Component=Vn;X.Fragment=hf;X.Profiler=mf;X.PureComponent=ta;X.StrictMode=gf;X.Suspense=xf;X.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ef;X.act=qs;X.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=Vs({},e.props),o=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=ra.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(s in t)Qs.call(t,s)&&!Xs.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:Sr,type:e.type,key:o,ref:i,props:r,_owner:a}};X.createContext=function(e){return e={$$typeof:yf,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:vf,_context:e},e.Consumer=e};X.createElement=Js;X.createFactory=function(e){var t=Js.bind(null,e);return t.type=e,t};X.createRef=function(){return{current:null}};X.forwardRef=function(e){return{$$typeof:wf,render:e}};X.isValidElement=oa;X.lazy=function(e){return{$$typeof:bf,_payload:{_status:-1,_result:e},_init:Nf}};X.memo=function(e,t){return{$$typeof:kf,type:e,compare:t===void 0?null:t}};X.startTransition=function(e){var t=_o.transition;_o.transition={};try{e()}finally{_o.transition=t}};X.unstable_act=qs;X.useCallback=function(e,t){return Ge.current.useCallback(e,t)};X.useContext=function(e){return Ge.current.useContext(e)};X.useDebugValue=function(){};X.useDeferredValue=function(e){return Ge.current.useDeferredValue(e)};X.useEffect=function(e,t){return Ge.current.useEffect(e,t)};X.useId=function(){return Ge.current.useId()};X.useImperativeHandle=function(e,t,n){return Ge.current.useImperativeHandle(e,t,n)};X.useInsertionEffect=function(e,t){return Ge.current.useInsertionEffect(e,t)};X.useLayoutEffect=function(e,t){return Ge.current.useLayoutEffect(e,t)};X.useMemo=function(e,t){return Ge.current.useMemo(e,t)};X.useReducer=function(e,t,n){return Ge.current.useReducer(e,t,n)};X.useRef=function(e){return Ge.current.useRef(e)};X.useState=function(e){return Ge.current.useState(e)};X.useSyncExternalStore=function(e,t,n){return Ge.current.useSyncExternalStore(e,t,n)};X.useTransition=function(){return Ge.current.useTransition()};X.version="18.3.1"});var Ut=jt((_v,eu)=>{"use strict";eu.exports=Zs()});var cu=jt(ue=>{"use strict";function sa(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<So(o,t))e[r]=t,e[n]=o,n=r;else break e}}function wt(e){return e.length===0?null:e[0]}function No(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>So(u,n))s<o&&0>So(c,u)?(e[r]=c,e[s]=n,r=s):(e[r]=u,e[a]=n,r=a);else if(s<o&&0>So(c,n))e[r]=c,e[s]=n,r=s;else break e}}return t}function So(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(tu=performance,ue.unstable_now=function(){return tu.now()}):(ia=Date,nu=ia.now(),ue.unstable_now=function(){return ia.now()-nu});var tu,ia,nu,Mt=[],en=[],Tf=1,ct=null,We=3,Eo=!1,Cn=!1,Nr=!1,iu=typeof setTimeout=="function"?setTimeout:null,au=typeof clearTimeout=="function"?clearTimeout:null,ru=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ua(e){for(var t=wt(en);t!==null;){if(t.callback===null)No(en);else if(t.startTime<=e)No(en),t.sortIndex=t.expirationTime,sa(Mt,t);else break;t=wt(en)}}function ca(e){if(Nr=!1,ua(e),!Cn)if(wt(Mt)!==null)Cn=!0,pa(da);else{var t=wt(en);t!==null&&fa(ca,t.startTime-e)}}function da(e,t){Cn=!1,Nr&&(Nr=!1,au(Er),Er=-1),Eo=!0;var n=We;try{for(ua(t),ct=wt(Mt);ct!==null&&(!(ct.expirationTime>t)||e&&!uu());){var r=ct.callback;if(typeof r=="function"){ct.callback=null,We=ct.priorityLevel;var o=r(ct.expirationTime<=t);t=ue.unstable_now(),typeof o=="function"?ct.callback=o:ct===wt(Mt)&&No(Mt),ua(t)}else No(Mt);ct=wt(Mt)}if(ct!==null)var i=!0;else{var a=wt(en);a!==null&&fa(ca,a.startTime-t),i=!1}return i}finally{ct=null,We=n,Eo=!1}}var To=!1,Co=null,Er=-1,lu=5,su=-1;function uu(){return!(ue.unstable_now()-su<lu)}function aa(){if(Co!==null){var e=ue.unstable_now();su=e;var t=!0;try{t=Co(!0,e)}finally{t?Cr():(To=!1,Co=null)}}else To=!1}var Cr;typeof ru=="function"?Cr=function(){ru(aa)}:typeof MessageChannel<"u"?(la=new MessageChannel,ou=la.port2,la.port1.onmessage=aa,Cr=function(){ou.postMessage(null)}):Cr=function(){iu(aa,0)};var la,ou;function pa(e){Co=e,To||(To=!0,Cr())}function fa(e,t){Er=iu(function(){e(ue.unstable_now())},t)}ue.unstable_IdlePriority=5;ue.unstable_ImmediatePriority=1;ue.unstable_LowPriority=4;ue.unstable_NormalPriority=3;ue.unstable_Profiling=null;ue.unstable_UserBlockingPriority=2;ue.unstable_cancelCallback=function(e){e.callback=null};ue.unstable_continueExecution=function(){Cn||Eo||(Cn=!0,pa(da))};ue.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"):lu=0<e?Math.floor(1e3/e):5};ue.unstable_getCurrentPriorityLevel=function(){return We};ue.unstable_getFirstCallbackNode=function(){return wt(Mt)};ue.unstable_next=function(e){switch(We){case 1:case 2:case 3:var t=3;break;default:t=We}var n=We;We=t;try{return e()}finally{We=n}};ue.unstable_pauseExecution=function(){};ue.unstable_requestPaint=function(){};ue.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=We;We=e;try{return t()}finally{We=n}};ue.unstable_scheduleCallback=function(e,t,n){var r=ue.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,sa(en,e),wt(Mt)===null&&e===wt(en)&&(Nr?(au(Er),Er=-1):Nr=!0,fa(ca,n-r))):(e.sortIndex=o,sa(Mt,e),Cn||Eo||(Cn=!0,pa(da))),e};ue.unstable_shouldYield=uu;ue.unstable_wrapCallback=function(e){var t=We;return function(){var n=We;We=t;try{return e.apply(this,arguments)}finally{We=n}}}});var pu=jt((Cv,du)=>{"use strict";du.exports=cu()});var mp=jt(ut=>{"use strict";var Pf=Ut(),lt=pu();function S(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 wc=new Set,Qr={};function Dn(e,t){fr(e,t),fr(e+"Capture",t)}function fr(e,t){for(Qr[e]=t,e=0;e<t.length;e++)wc.add(t[e])}var Kt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Aa=Object.prototype.hasOwnProperty,Mf=/^[: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]*$/,fu={},hu={};function Ff(e){return Aa.call(hu,e)?!0:Aa.call(fu,e)?!1:Mf.test(e)?hu[e]=!0:(fu[e]=!0,!1)}function Lf(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 If(e,t,n,r){if(t===null||typeof t>"u"||Lf(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 Ye(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 ze={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ze[e]=new Ye(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ze[t]=new Ye(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ze[e]=new Ye(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ze[e]=new Ye(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){ze[e]=new Ye(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ze[e]=new Ye(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ze[e]=new Ye(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ze[e]=new Ye(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ze[e]=new Ye(e,5,!1,e.toLowerCase(),null,!1,!1)});var Tl=/[\-:]([a-z])/g;function Pl(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(Tl,Pl);ze[t]=new Ye(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(Tl,Pl);ze[t]=new Ye(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(Tl,Pl);ze[t]=new Ye(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ze[e]=new Ye(e,1,!1,e.toLowerCase(),null,!1,!1)});ze.xlinkHref=new Ye("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ze[e]=new Ye(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ml(e,t,n,r){var o=ze.hasOwnProperty(t)?ze[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(If(t,n,o,r)&&(n=null),r||o===null?Ff(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 Jt=Pf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Po=Symbol.for("react.element"),Qn=Symbol.for("react.portal"),Xn=Symbol.for("react.fragment"),Fl=Symbol.for("react.strict_mode"),za=Symbol.for("react.profiler"),xc=Symbol.for("react.provider"),kc=Symbol.for("react.context"),Ll=Symbol.for("react.forward_ref"),Da=Symbol.for("react.suspense"),Wa=Symbol.for("react.suspense_list"),Il=Symbol.for("react.memo"),nn=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var bc=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var gu=Symbol.iterator;function Tr(e){return e===null||typeof e!="object"?null:(e=gu&&e[gu]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Object.assign,ha;function Ar(e){if(ha===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ha=t&&t[1]||""}return`
2
+ `+ha+e}var ga=!1;function ma(e,t){if(!e||ga)return"";ga=!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
3
  `),i=r.stack.split(`
4
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{ha=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ar(e):""}function Rf(e){switch(e.tag){case 5:return Ar(e.type);case 16:return Ar("Lazy");case 13:return Ar("Suspense");case 19:return Ar("SuspenseList");case 0:case 2:case 15:return e=ga(e.type,!1),e;case 11:return e=ga(e.type.render,!1),e;case 1:return e=ga(e.type,!0),e;default:return""}}function Wa(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 Xn:return"Fragment";case Qn:return"Portal";case Aa:return"Profiler";case Ml:return"StrictMode";case za:return"Suspense";case Da:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case kc:return(e.displayName||"Context")+".Consumer";case xc:return(e._context.displayName||"Context")+".Provider";case Fl:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ll:return t=e.displayName||null,t!==null?t:Wa(e.type)||"Memo";case nn:t=e._payload,e=e._init;try{return Wa(e(t))}catch{}}return null}function Of(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 Wa(t);case 8:return t===Ml?"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 vn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _c(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Af(e){var t=_c(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 Po(e){e._valueTracker||(e._valueTracker=Af(e))}function Sc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=_c(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ri(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 ja(e,t){var n=t.checked;return ye({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mu(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=vn(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 Cc(e,t){t=t.checked,t!=null&&Pl(e,"checked",t,!1)}function Ua(e,t){Cc(e,t);var n=vn(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")?$a(e,t.type,n):t.hasOwnProperty("defaultValue")&&$a(e,t.type,vn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vu(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 $a(e,t,n){(t!=="number"||ri(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zr=Array.isArray;function lr(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=""+vn(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 Ha(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(S(91));return ye({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function yu(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(S(92));if(zr(n)){if(1<n.length)throw Error(S(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:vn(n)}}function Nc(e,t){var n=vn(t.value),r=vn(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 wu(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ec(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 Ba(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ec(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Mo,Tc=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(Mo=Mo||document.createElement("div"),Mo.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Mo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var jr={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},zf=["Webkit","ms","Moz","O"];Object.keys(jr).forEach(function(e){zf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),jr[t]=jr[e]})});function Pc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||jr.hasOwnProperty(e)&&jr[e]?(""+t).trim():t+"px"}function Mc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Pc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Df=ye({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 Ga(e,t){if(t){if(Df[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(S(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(S(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(S(61))}if(t.style!=null&&typeof t.style!="object")throw Error(S(62))}}function Va(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 Ka=null;function Il(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ya=null,sr=null,ur=null;function xu(e){if(e=go(e)){if(typeof Ya!="function")throw Error(S(280));var t=e.stateNode;t&&(t=Fi(t),Ya(e.stateNode,e.type,t))}}function Fc(e){sr?ur?ur.push(e):ur=[e]:sr=e}function Lc(){if(sr){var e=sr,t=ur;if(ur=sr=null,xu(e),t)for(e=0;e<t.length;e++)xu(t[e])}}function Ic(e,t){return e(t)}function Rc(){}var ma=!1;function Oc(e,t,n){if(ma)return e(t,n);ma=!0;try{return Ic(e,t,n)}finally{ma=!1,(sr!==null||ur!==null)&&(Rc(),Lc())}}function Jr(e,t){var n=e.stateNode;if(n===null)return null;var r=Fi(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(S(231,t,typeof n));return n}var Qa=!1;if(Kt)try{Kn={},Object.defineProperty(Kn,"passive",{get:function(){Qa=!0}}),window.addEventListener("test",Kn,Kn),window.removeEventListener("test",Kn,Kn)}catch{Qa=!1}var Kn;function Wf(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 Ur=!1,oi=null,ii=!1,Xa=null,jf={onError:function(e){Ur=!0,oi=e}};function Uf(e,t,n,r,o,i,a,u,s){Ur=!1,oi=null,Wf.apply(jf,arguments)}function $f(e,t,n,r,o,i,a,u,s){if(Uf.apply(this,arguments),Ur){if(Ur){var c=oi;Ur=!1,oi=null}else throw Error(S(198));ii||(ii=!0,Xa=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 Ac(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 ku(e){if(Wn(e)!==e)throw Error(S(188))}function Hf(e){var t=e.alternate;if(!t){if(t=Wn(e),t===null)throw Error(S(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 ku(o),e;if(i===r)return ku(o),t;i=i.sibling}throw Error(S(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(S(189))}}if(n.alternate!==r)throw Error(S(190))}if(n.tag!==3)throw Error(S(188));return n.stateNode.current===n?e:t}function zc(e){return e=Hf(e),e!==null?Dc(e):null}function Dc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Dc(e);if(t!==null)return t;e=e.sibling}return null}var Wc=lt.unstable_scheduleCallback,bu=lt.unstable_cancelCallback,Bf=lt.unstable_shouldYield,Gf=lt.unstable_requestPaint,_e=lt.unstable_now,Vf=lt.unstable_getCurrentPriorityLevel,Rl=lt.unstable_ImmediatePriority,jc=lt.unstable_UserBlockingPriority,ai=lt.unstable_NormalPriority,Kf=lt.unstable_LowPriority,Uc=lt.unstable_IdlePriority,Ei=null,Rt=null;function Yf(e){if(Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(Ei,e,void 0,(e.current.flags&128)===128)}catch{}}var St=Math.clz32?Math.clz32:Jf,Qf=Math.log,Xf=Math.LN2;function Jf(e){return e>>>=0,e===0?32:31-(Qf(e)/Xf|0)|0}var Fo=64,Lo=4194304;function Dr(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 li(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=Dr(u):(i&=a,i!==0&&(r=Dr(i)))}else a=n&~o,a!==0?r=Dr(a):i!==0&&(r=Dr(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-St(t),o=1<<n,r|=e[n],t&=~o;return r}function qf(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 Zf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-St(i),u=1<<a,s=o[a];s===-1?(!(u&n)||u&r)&&(o[a]=qf(u,t)):s<=t&&(e.expiredLanes|=u),i&=~u}}function Ja(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function $c(){var e=Fo;return Fo<<=1,!(Fo&4194240)&&(Fo=64),e}function va(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function fo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-St(t),e[t]=n}function eh(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-St(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Ol(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-St(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ie=0;function Hc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Bc,Al,Gc,Vc,Kc,qa=!1,Io=[],un=null,cn=null,dn=null,qr=new Map,Zr=new Map,on=[],th="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 _u(e,t){switch(e){case"focusin":case"focusout":un=null;break;case"dragenter":case"dragleave":cn=null;break;case"mouseover":case"mouseout":dn=null;break;case"pointerover":case"pointerout":qr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zr.delete(t.pointerId)}}function Pr(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=go(t),t!==null&&Al(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function nh(e,t,n,r,o){switch(t){case"focusin":return un=Pr(un,e,t,n,r,o),!0;case"dragenter":return cn=Pr(cn,e,t,n,r,o),!0;case"mouseover":return dn=Pr(dn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return qr.set(i,Pr(qr.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Zr.set(i,Pr(Zr.get(i)||null,e,t,n,r,o)),!0}return!1}function Yc(e){var t=Tn(e.target);if(t!==null){var n=Wn(t);if(n!==null){if(t=n.tag,t===13){if(t=Ac(n),t!==null){e.blockedOn=t,Kc(e.priority,function(){Gc(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 Ko(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Za(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ka=r,n.target.dispatchEvent(r),Ka=null}else return t=go(n),t!==null&&Al(t),e.blockedOn=n,!1;t.shift()}return!0}function Su(e,t,n){Ko(e)&&n.delete(t)}function rh(){qa=!1,un!==null&&Ko(un)&&(un=null),cn!==null&&Ko(cn)&&(cn=null),dn!==null&&Ko(dn)&&(dn=null),qr.forEach(Su),Zr.forEach(Su)}function Mr(e,t){e.blockedOn===t&&(e.blockedOn=null,qa||(qa=!0,lt.unstable_scheduleCallback(lt.unstable_NormalPriority,rh)))}function eo(e){function t(o){return Mr(o,e)}if(0<Io.length){Mr(Io[0],e);for(var n=1;n<Io.length;n++){var r=Io[n];r.blockedOn===e&&(r.blockedOn=null)}}for(un!==null&&Mr(un,e),cn!==null&&Mr(cn,e),dn!==null&&Mr(dn,e),qr.forEach(t),Zr.forEach(t),n=0;n<on.length;n++)r=on[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<on.length&&(n=on[0],n.blockedOn===null);)Yc(n),n.blockedOn===null&&on.shift()}var cr=Jt.ReactCurrentBatchConfig,si=!0;function oh(e,t,n,r){var o=ie,i=cr.transition;cr.transition=null;try{ie=1,zl(e,t,n,r)}finally{ie=o,cr.transition=i}}function ih(e,t,n,r){var o=ie,i=cr.transition;cr.transition=null;try{ie=4,zl(e,t,n,r)}finally{ie=o,cr.transition=i}}function zl(e,t,n,r){if(si){var o=Za(e,t,n,r);if(o===null)Sa(e,t,r,ui,n),_u(e,r);else if(nh(o,e,t,n,r))r.stopPropagation();else if(_u(e,r),t&4&&-1<th.indexOf(e)){for(;o!==null;){var i=go(o);if(i!==null&&Bc(i),i=Za(e,t,n,r),i===null&&Sa(e,t,r,ui,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Sa(e,t,r,null,n)}}var ui=null;function Za(e,t,n,r){if(ui=null,e=Il(r),e=Tn(e),e!==null)if(t=Wn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ac(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 ui=e,null}function Qc(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(Vf()){case Rl:return 1;case jc:return 4;case ai:case Kf:return 16;case Uc:return 536870912;default:return 16}default:return 16}}var ln=null,Dl=null,Yo=null;function Xc(){if(Yo)return Yo;var e,t=Dl,n=t.length,r,o="value"in ln?ln.value:ln.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 Yo=o.slice(e,1<r?1-r:void 0)}function Qo(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 Ro(){return!0}function Cu(){return!1}function st(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)?Ro:Cu,this.isPropagationStopped=Cu,this}return ye(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=Ro)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ro)},persist:function(){},isPersistent:Ro}),t}var xr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wl=st(xr),ho=ye({},xr,{view:0,detail:0}),ah=st(ho),ya,wa,Fr,Ti=ye({},ho,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jl,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!==Fr&&(Fr&&e.type==="mousemove"?(ya=e.screenX-Fr.screenX,wa=e.screenY-Fr.screenY):wa=ya=0,Fr=e),ya)},movementY:function(e){return"movementY"in e?e.movementY:wa}}),Nu=st(Ti),lh=ye({},Ti,{dataTransfer:0}),sh=st(lh),uh=ye({},ho,{relatedTarget:0}),xa=st(uh),ch=ye({},xr,{animationName:0,elapsedTime:0,pseudoElement:0}),dh=st(ch),ph=ye({},xr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),fh=st(ph),hh=ye({},xr,{data:0}),Eu=st(hh),gh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mh={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"},vh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=vh[e])?!!t[e]:!1}function jl(){return yh}var wh=ye({},ho,{key:function(e){if(e.key){var t=gh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Qo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?mh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jl,charCode:function(e){return e.type==="keypress"?Qo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Qo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),xh=st(wh),kh=ye({},Ti,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tu=st(kh),bh=ye({},ho,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jl}),_h=st(bh),Sh=ye({},xr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ch=st(Sh),Nh=ye({},Ti,{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}),Eh=st(Nh),Th=[9,13,27,32],Ul=Kt&&"CompositionEvent"in window,$r=null;Kt&&"documentMode"in document&&($r=document.documentMode);var Ph=Kt&&"TextEvent"in window&&!$r,Jc=Kt&&(!Ul||$r&&8<$r&&11>=$r),Pu=String.fromCharCode(32),Mu=!1;function qc(e,t){switch(e){case"keyup":return Th.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jn=!1;function Mh(e,t){switch(e){case"compositionend":return Zc(t);case"keypress":return t.which!==32?null:(Mu=!0,Pu);case"textInput":return e=t.data,e===Pu&&Mu?null:e;default:return null}}function Fh(e,t){if(Jn)return e==="compositionend"||!Ul&&qc(e,t)?(e=Xc(),Yo=Dl=ln=null,Jn=!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 Jc&&t.locale!=="ko"?null:t.data;default:return null}}var Lh={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 Fu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lh[e.type]:t==="textarea"}function ed(e,t,n,r){Fc(r),t=ci(t,"onChange"),0<t.length&&(n=new Wl("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Hr=null,to=null;function Ih(e){dd(e,0)}function Pi(e){var t=er(e);if(Sc(t))return e}function Rh(e,t){if(e==="change")return t}var td=!1;Kt&&(Kt?(Ao="oninput"in document,Ao||(ka=document.createElement("div"),ka.setAttribute("oninput","return;"),Ao=typeof ka.oninput=="function"),Oo=Ao):Oo=!1,td=Oo&&(!document.documentMode||9<document.documentMode));var Oo,Ao,ka;function Lu(){Hr&&(Hr.detachEvent("onpropertychange",nd),to=Hr=null)}function nd(e){if(e.propertyName==="value"&&Pi(to)){var t=[];ed(t,to,e,Il(e)),Oc(Ih,t)}}function Oh(e,t,n){e==="focusin"?(Lu(),Hr=t,to=n,Hr.attachEvent("onpropertychange",nd)):e==="focusout"&&Lu()}function Ah(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Pi(to)}function zh(e,t){if(e==="click")return Pi(t)}function Dh(e,t){if(e==="input"||e==="change")return Pi(t)}function Wh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nt=typeof Object.is=="function"?Object.is:Wh;function no(e,t){if(Nt(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(!Oa.call(t,o)||!Nt(e[o],t[o]))return!1}return!0}function Iu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ru(e,t){var n=Iu(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=Iu(n)}}function rd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?rd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function od(){for(var e=window,t=ri();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ri(e.document)}return t}function $l(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 jh(e){var t=od(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&rd(n.ownerDocument.documentElement,n)){if(r!==null&&$l(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=Ru(n,i);var a=Ru(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 Uh=Kt&&"documentMode"in document&&11>=document.documentMode,qn=null,el=null,Br=null,tl=!1;function Ou(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;tl||qn==null||qn!==ri(r)||(r=qn,"selectionStart"in r&&$l(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}),Br&&no(Br,r)||(Br=r,r=ci(el,"onSelect"),0<r.length&&(t=new Wl("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=qn)))}function zo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Zn={animationend:zo("Animation","AnimationEnd"),animationiteration:zo("Animation","AnimationIteration"),animationstart:zo("Animation","AnimationStart"),transitionend:zo("Transition","TransitionEnd")},ba={},id={};Kt&&(id=document.createElement("div").style,"AnimationEvent"in window||(delete Zn.animationend.animation,delete Zn.animationiteration.animation,delete Zn.animationstart.animation),"TransitionEvent"in window||delete Zn.transitionend.transition);function Mi(e){if(ba[e])return ba[e];if(!Zn[e])return e;var t=Zn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in id)return ba[e]=t[n];return e}var ad=Mi("animationend"),ld=Mi("animationiteration"),sd=Mi("animationstart"),ud=Mi("transitionend"),cd=new Map,Au="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 wn(e,t){cd.set(e,t),Dn(t,[e])}for(Do=0;Do<Au.length;Do++)Wo=Au[Do],zu=Wo.toLowerCase(),Du=Wo[0].toUpperCase()+Wo.slice(1),wn(zu,"on"+Du);var Wo,zu,Du,Do;wn(ad,"onAnimationEnd");wn(ld,"onAnimationIteration");wn(sd,"onAnimationStart");wn("dblclick","onDoubleClick");wn("focusin","onFocus");wn("focusout","onBlur");wn(ud,"onTransitionEnd");fr("onMouseEnter",["mouseout","mouseover"]);fr("onMouseLeave",["mouseout","mouseover"]);fr("onPointerEnter",["pointerout","pointerover"]);fr("onPointerLeave",["pointerout","pointerover"]);Dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Dn("onBeforeInput",["compositionend","keypress","textInput","paste"]);Dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Dn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wr="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(" "),$h=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wr));function Wu(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,$f(r,t,void 0,e),e.currentTarget=null}function dd(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(ii)throw e=Xa,ii=!1,Xa=null,e}function de(e,t){var n=t[al];n===void 0&&(n=t[al]=new Set);var r=e+"__bubble";n.has(r)||(pd(t,e,2,!1),n.add(r))}function _a(e,t,n){var r=0;t&&(r|=4),pd(n,e,r,t)}var jo="_reactListening"+Math.random().toString(36).slice(2);function ro(e){if(!e[jo]){e[jo]=!0,wc.forEach(function(n){n!=="selectionchange"&&($h.has(n)||_a(n,!1,e),_a(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[jo]||(t[jo]=!0,_a("selectionchange",!1,t))}}function pd(e,t,n,r){switch(Qc(t)){case 1:var o=oh;break;case 4:o=ih;break;default:o=zl}n=o.bind(null,t,n,e),o=void 0,!Qa||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 Sa(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=Tn(u),a===null)return;if(s=a.tag,s===5||s===6){r=i=a;continue e}u=u.parentNode}}r=r.return}Oc(function(){var c=i,d=Il(n),p=[];e:{var g=cd.get(e);if(g!==void 0){var v=Wl,b=e;switch(e){case"keypress":if(Qo(n)===0)break e;case"keydown":case"keyup":v=xh;break;case"focusin":b="focus",v=xa;break;case"focusout":b="blur",v=xa;break;case"beforeblur":case"afterblur":v=xa;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":v=Nu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=sh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=_h;break;case ad:case ld:case sd:v=dh;break;case ud:v=Ch;break;case"scroll":v=ah;break;case"wheel":v=Eh;break;case"copy":case"cut":case"paste":v=fh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=Tu}var w=(t&4)!==0,G=!w&&e==="scroll",f=w?g!==null?g+"Capture":null:g;w=[];for(var h=c,m;h!==null;){m=h;var x=m.stateNode;if(m.tag===5&&x!==null&&(m=x,f!==null&&(x=Jr(h,f),x!=null&&w.push(oo(h,x,m)))),G)break;h=h.return}0<w.length&&(g=new v(g,b,null,n,d),p.push({event:g,listeners:w}))}}if(!(t&7)){e:{if(g=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",g&&n!==Ka&&(b=n.relatedTarget||n.fromElement)&&(Tn(b)||b[Yt]))break e;if((v||g)&&(g=d.window===d?d:(g=d.ownerDocument)?g.defaultView||g.parentWindow:window,v?(b=n.relatedTarget||n.toElement,v=c,b=b?Tn(b):null,b!==null&&(G=Wn(b),b!==G||b.tag!==5&&b.tag!==6)&&(b=null)):(v=null,b=c),v!==b)){if(w=Nu,x="onMouseLeave",f="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(w=Tu,x="onPointerLeave",f="onPointerEnter",h="pointer"),G=v==null?g:er(v),m=b==null?g:er(b),g=new w(x,h+"leave",v,n,d),g.target=G,g.relatedTarget=m,x=null,Tn(d)===c&&(w=new w(f,h+"enter",b,n,d),w.target=m,w.relatedTarget=G,x=w),G=x,v&&b)t:{for(w=v,f=b,h=0,m=w;m;m=Yn(m))h++;for(m=0,x=f;x;x=Yn(x))m++;for(;0<h-m;)w=Yn(w),h--;for(;0<m-h;)f=Yn(f),m--;for(;h--;){if(w===f||f!==null&&w===f.alternate)break t;w=Yn(w),f=Yn(f)}w=null}else w=null;v!==null&&ju(p,g,v,w,!1),b!==null&&G!==null&&ju(p,G,b,w,!0)}}e:{if(g=c?er(c):window,v=g.nodeName&&g.nodeName.toLowerCase(),v==="select"||v==="input"&&g.type==="file")var C=Rh;else if(Fu(g))if(td)C=Dh;else{C=Ah;var F=Oh}else(v=g.nodeName)&&v.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(C=zh);if(C&&(C=C(e,c))){ed(p,C,n,d);break e}F&&F(e,g,c),e==="focusout"&&(F=g._wrapperState)&&F.controlled&&g.type==="number"&&$a(g,"number",g.value)}switch(F=c?er(c):window,e){case"focusin":(Fu(F)||F.contentEditable==="true")&&(qn=F,el=c,Br=null);break;case"focusout":Br=el=qn=null;break;case"mousedown":tl=!0;break;case"contextmenu":case"mouseup":case"dragend":tl=!1,Ou(p,n,d);break;case"selectionchange":if(Uh)break;case"keydown":case"keyup":Ou(p,n,d)}var L;if(Ul)e:{switch(e){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else Jn?qc(e,n)&&(R="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(R="onCompositionStart");R&&(Jc&&n.locale!=="ko"&&(Jn||R!=="onCompositionStart"?R==="onCompositionEnd"&&Jn&&(L=Xc()):(ln=d,Dl="value"in ln?ln.value:ln.textContent,Jn=!0)),F=ci(c,R),0<F.length&&(R=new Eu(R,e,null,n,d),p.push({event:R,listeners:F}),L?R.data=L:(L=Zc(n),L!==null&&(R.data=L)))),(L=Ph?Mh(e,n):Fh(e,n))&&(c=ci(c,"onBeforeInput"),0<c.length&&(d=new Eu("onBeforeInput","beforeinput",null,n,d),p.push({event:d,listeners:c}),d.data=L))}dd(p,t)})}function oo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ci(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(oo(e,i,o)),i=Jr(e,t),i!=null&&r.push(oo(e,i,o))),e=e.return}return r}function Yn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ju(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(oo(n,s,u))):o||(s=Jr(n,i),s!=null&&a.push(oo(n,s,u)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var Hh=/\r\n?/g,Bh=/\u0000|\uFFFD/g;function Uu(e){return(typeof e=="string"?e:""+e).replace(Hh,`
6
- `).replace(Bh,"")}function Uo(e,t,n){if(t=Uu(t),Uu(e)!==t&&n)throw Error(S(425))}function di(){}var nl=null,rl=null;function ol(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 il=typeof setTimeout=="function"?setTimeout:void 0,Gh=typeof clearTimeout=="function"?clearTimeout:void 0,$u=typeof Promise=="function"?Promise:void 0,Vh=typeof queueMicrotask=="function"?queueMicrotask:typeof $u<"u"?function(e){return $u.resolve(null).then(e).catch(Kh)}:il;function Kh(e){setTimeout(function(){throw e})}function Ca(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),eo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);eo(t)}function pn(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 Hu(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 kr=Math.random().toString(36).slice(2),It="__reactFiber$"+kr,io="__reactProps$"+kr,Yt="__reactContainer$"+kr,al="__reactEvents$"+kr,Yh="__reactListeners$"+kr,Qh="__reactHandles$"+kr;function Tn(e){var t=e[It];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Yt]||n[It]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Hu(e);e!==null;){if(n=e[It])return n;e=Hu(e)}return t}e=n,n=e.parentNode}return null}function go(e){return e=e[It]||e[Yt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function er(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(S(33))}function Fi(e){return e[io]||null}var ll=[],tr=-1;function xn(e){return{current:e}}function pe(e){0>tr||(e.current=ll[tr],ll[tr]=null,tr--)}function ce(e,t){tr++,ll[tr]=e.current,e.current=t}var yn={},He=xn(yn),Je=xn(!1),In=yn;function hr(e,t){var n=e.type.contextTypes;if(!n)return yn;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 qe(e){return e=e.childContextTypes,e!=null}function pi(){pe(Je),pe(He)}function Bu(e,t,n){if(He.current!==yn)throw Error(S(168));ce(He,t),ce(Je,n)}function fd(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(S(108,Of(e)||"Unknown",o));return ye({},n,r)}function fi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||yn,In=He.current,ce(He,e),ce(Je,Je.current),!0}function Gu(e,t,n){var r=e.stateNode;if(!r)throw Error(S(169));n?(e=fd(e,t,In),r.__reactInternalMemoizedMergedChildContext=e,pe(Je),pe(He),ce(He,e)):pe(Je),ce(Je,n)}var Ht=null,Li=!1,Na=!1;function hd(e){Ht===null?Ht=[e]:Ht.push(e)}function Xh(e){Li=!0,hd(e)}function kn(){if(!Na&&Ht!==null){Na=!0;var e=0,t=ie;try{var n=Ht;for(ie=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ht=null,Li=!1}catch(o){throw Ht!==null&&(Ht=Ht.slice(e+1)),Wc(Rl,kn),o}finally{ie=t,Na=!1}}return null}var nr=[],rr=0,hi=null,gi=0,dt=[],pt=0,Rn=null,Bt=1,Gt="";function Nn(e,t){nr[rr++]=gi,nr[rr++]=hi,hi=e,gi=t}function gd(e,t,n){dt[pt++]=Bt,dt[pt++]=Gt,dt[pt++]=Rn,Rn=e;var r=Bt;e=Gt;var o=32-St(r)-1;r&=~(1<<o),n+=1;var i=32-St(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Bt=1<<32-St(t)+o|n<<o|r,Gt=i+e}else Bt=1<<i|n<<o|r,Gt=e}function Hl(e){e.return!==null&&(Nn(e,1),gd(e,1,0))}function Bl(e){for(;e===hi;)hi=nr[--rr],nr[rr]=null,gi=nr[--rr],nr[rr]=null;for(;e===Rn;)Rn=dt[--pt],dt[pt]=null,Gt=dt[--pt],dt[pt]=null,Bt=dt[--pt],dt[pt]=null}var at=null,it=null,he=!1,_t=null;function md(e,t){var n=ft(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 Vu(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,at=e,it=pn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,at=e,it=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Rn!==null?{id:Bt,overflow:Gt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ft(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,at=e,it=null,!0):!1;default:return!1}}function sl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ul(e){if(he){var t=it;if(t){var n=t;if(!Vu(e,t)){if(sl(e))throw Error(S(418));t=pn(n.nextSibling);var r=at;t&&Vu(e,t)?md(r,n):(e.flags=e.flags&-4097|2,he=!1,at=e)}}else{if(sl(e))throw Error(S(418));e.flags=e.flags&-4097|2,he=!1,at=e}}}function Ku(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;at=e}function $o(e){if(e!==at)return!1;if(!he)return Ku(e),he=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ol(e.type,e.memoizedProps)),t&&(t=it)){if(sl(e))throw vd(),Error(S(418));for(;t;)md(e,t),t=pn(t.nextSibling)}if(Ku(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(S(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){it=pn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}it=null}}else it=at?pn(e.stateNode.nextSibling):null;return!0}function vd(){for(var e=it;e;)e=pn(e.nextSibling)}function gr(){it=at=null,he=!1}function Gl(e){_t===null?_t=[e]:_t.push(e)}var Jh=Jt.ReactCurrentBatchConfig;function Lr(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(S(309));var r=n.stateNode}if(!r)throw Error(S(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(S(284));if(!n._owner)throw Error(S(290,e))}return e}function Ho(e,t){throw e=Object.prototype.toString.call(t),Error(S(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Yu(e){var t=e._init;return t(e._payload)}function yd(e){function t(f,h){if(e){var m=f.deletions;m===null?(f.deletions=[h],f.flags|=16):m.push(h)}}function n(f,h){if(!e)return null;for(;h!==null;)t(f,h),h=h.sibling;return null}function r(f,h){for(f=new Map;h!==null;)h.key!==null?f.set(h.key,h):f.set(h.index,h),h=h.sibling;return f}function o(f,h){return f=mn(f,h),f.index=0,f.sibling=null,f}function i(f,h,m){return f.index=m,e?(m=f.alternate,m!==null?(m=m.index,m<h?(f.flags|=2,h):m):(f.flags|=2,h)):(f.flags|=1048576,h)}function a(f){return e&&f.alternate===null&&(f.flags|=2),f}function u(f,h,m,x){return h===null||h.tag!==6?(h=Ia(m,f.mode,x),h.return=f,h):(h=o(h,m),h.return=f,h)}function s(f,h,m,x){var C=m.type;return C===Xn?d(f,h,m.props.children,x,m.key):h!==null&&(h.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===nn&&Yu(C)===h.type)?(x=o(h,m.props),x.ref=Lr(f,h,m),x.return=f,x):(x=ni(m.type,m.key,m.props,null,f.mode,x),x.ref=Lr(f,h,m),x.return=f,x)}function c(f,h,m,x){return h===null||h.tag!==4||h.stateNode.containerInfo!==m.containerInfo||h.stateNode.implementation!==m.implementation?(h=Ra(m,f.mode,x),h.return=f,h):(h=o(h,m.children||[]),h.return=f,h)}function d(f,h,m,x,C){return h===null||h.tag!==7?(h=Ln(m,f.mode,x,C),h.return=f,h):(h=o(h,m),h.return=f,h)}function p(f,h,m){if(typeof h=="string"&&h!==""||typeof h=="number")return h=Ia(""+h,f.mode,m),h.return=f,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case To:return m=ni(h.type,h.key,h.props,null,f.mode,m),m.ref=Lr(f,null,h),m.return=f,m;case Qn:return h=Ra(h,f.mode,m),h.return=f,h;case nn:var x=h._init;return p(f,x(h._payload),m)}if(zr(h)||Tr(h))return h=Ln(h,f.mode,m,null),h.return=f,h;Ho(f,h)}return null}function g(f,h,m,x){var C=h!==null?h.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return C!==null?null:u(f,h,""+m,x);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case To:return m.key===C?s(f,h,m,x):null;case Qn:return m.key===C?c(f,h,m,x):null;case nn:return C=m._init,g(f,h,C(m._payload),x)}if(zr(m)||Tr(m))return C!==null?null:d(f,h,m,x,null);Ho(f,m)}return null}function v(f,h,m,x,C){if(typeof x=="string"&&x!==""||typeof x=="number")return f=f.get(m)||null,u(h,f,""+x,C);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case To:return f=f.get(x.key===null?m:x.key)||null,s(h,f,x,C);case Qn:return f=f.get(x.key===null?m:x.key)||null,c(h,f,x,C);case nn:var F=x._init;return v(f,h,m,F(x._payload),C)}if(zr(x)||Tr(x))return f=f.get(m)||null,d(h,f,x,C,null);Ho(h,x)}return null}function b(f,h,m,x){for(var C=null,F=null,L=h,R=h=0,H=null;L!==null&&R<m.length;R++){L.index>R?(H=L,L=null):H=L.sibling;var z=g(f,L,m[R],x);if(z===null){L===null&&(L=H);break}e&&L&&z.alternate===null&&t(f,L),h=i(z,h,R),F===null?C=z:F.sibling=z,F=z,L=H}if(R===m.length)return n(f,L),he&&Nn(f,R),C;if(L===null){for(;R<m.length;R++)L=p(f,m[R],x),L!==null&&(h=i(L,h,R),F===null?C=L:F.sibling=L,F=L);return he&&Nn(f,R),C}for(L=r(f,L);R<m.length;R++)H=v(L,f,R,m[R],x),H!==null&&(e&&H.alternate!==null&&L.delete(H.key===null?R:H.key),h=i(H,h,R),F===null?C=H:F.sibling=H,F=H);return e&&L.forEach(function(Se){return t(f,Se)}),he&&Nn(f,R),C}function w(f,h,m,x){var C=Tr(m);if(typeof C!="function")throw Error(S(150));if(m=C.call(m),m==null)throw Error(S(151));for(var F=C=null,L=h,R=h=0,H=null,z=m.next();L!==null&&!z.done;R++,z=m.next()){L.index>R?(H=L,L=null):H=L.sibling;var Se=g(f,L,z.value,x);if(Se===null){L===null&&(L=H);break}e&&L&&Se.alternate===null&&t(f,L),h=i(Se,h,R),F===null?C=Se:F.sibling=Se,F=Se,L=H}if(z.done)return n(f,L),he&&Nn(f,R),C;if(L===null){for(;!z.done;R++,z=m.next())z=p(f,z.value,x),z!==null&&(h=i(z,h,R),F===null?C=z:F.sibling=z,F=z);return he&&Nn(f,R),C}for(L=r(f,L);!z.done;R++,z=m.next())z=v(L,f,R,z.value,x),z!==null&&(e&&z.alternate!==null&&L.delete(z.key===null?R:z.key),h=i(z,h,R),F===null?C=z:F.sibling=z,F=z);return e&&L.forEach(function(tt){return t(f,tt)}),he&&Nn(f,R),C}function G(f,h,m,x){if(typeof m=="object"&&m!==null&&m.type===Xn&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case To:e:{for(var C=m.key,F=h;F!==null;){if(F.key===C){if(C=m.type,C===Xn){if(F.tag===7){n(f,F.sibling),h=o(F,m.props.children),h.return=f,f=h;break e}}else if(F.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===nn&&Yu(C)===F.type){n(f,F.sibling),h=o(F,m.props),h.ref=Lr(f,F,m),h.return=f,f=h;break e}n(f,F);break}else t(f,F);F=F.sibling}m.type===Xn?(h=Ln(m.props.children,f.mode,x,m.key),h.return=f,f=h):(x=ni(m.type,m.key,m.props,null,f.mode,x),x.ref=Lr(f,h,m),x.return=f,f=x)}return a(f);case Qn:e:{for(F=m.key;h!==null;){if(h.key===F)if(h.tag===4&&h.stateNode.containerInfo===m.containerInfo&&h.stateNode.implementation===m.implementation){n(f,h.sibling),h=o(h,m.children||[]),h.return=f,f=h;break e}else{n(f,h);break}else t(f,h);h=h.sibling}h=Ra(m,f.mode,x),h.return=f,f=h}return a(f);case nn:return F=m._init,G(f,h,F(m._payload),x)}if(zr(m))return b(f,h,m,x);if(Tr(m))return w(f,h,m,x);Ho(f,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,h!==null&&h.tag===6?(n(f,h.sibling),h=o(h,m),h.return=f,f=h):(n(f,h),h=Ia(m,f.mode,x),h.return=f,f=h),a(f)):n(f,h)}return G}var mr=yd(!0),wd=yd(!1),mi=xn(null),vi=null,or=null,Vl=null;function Kl(){Vl=or=vi=null}function Yl(e){var t=mi.current;pe(mi),e._currentValue=t}function cl(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 dr(e,t){vi=e,Vl=or=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xe=!0),e.firstContext=null)}function gt(e){var t=e._currentValue;if(Vl!==e)if(e={context:e,memoizedValue:t,next:null},or===null){if(vi===null)throw Error(S(308));or=e,vi.dependencies={lanes:0,firstContext:e}}else or=or.next=e;return t}var Pn=null;function Ql(e){Pn===null?Pn=[e]:Pn.push(e)}function xd(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Ql(t)):(n.next=o.next,o.next=n),t.interleaved=n,Qt(e,r)}function Qt(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 rn=!1;function Xl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function kd(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 Vt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,te&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Qt(e,n)}return o=r.interleaved,o===null?(t.next=t,Ql(r)):(t.next=o.next,o.next=t),r.interleaved=t,Qt(e,n)}function Xo(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,Ol(e,n)}}function Qu(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 yi(e,t,n,r){var o=e.updateQueue;rn=!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 g=u.lane,v=u.eventTime;if((r&g)===g){d!==null&&(d=d.next={eventTime:v,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var b=e,w=u;switch(g=t,v=n,w.tag){case 1:if(b=w.payload,typeof b=="function"){p=b.call(v,p,g);break e}p=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=w.payload,g=typeof b=="function"?b.call(v,p,g):b,g==null)break e;p=ye({},p,g);break e;case 2:rn=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,g=o.effects,g===null?o.effects=[u]:g.push(u))}else v={eventTime:v,lane:g,tag:u.tag,payload:u.payload,callback:u.callback,next:null},d===null?(c=d=v,s=p):d=d.next=v,a|=g;if(u=u.next,u===null){if(u=o.shared.pending,u===null)break;g=u,u=g.next,g.next=null,o.lastBaseUpdate=g,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);An|=a,e.lanes=a,e.memoizedState=p}}function Xu(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(S(191,o));o.call(r)}}}var mo={},Ot=xn(mo),ao=xn(mo),lo=xn(mo);function Mn(e){if(e===mo)throw Error(S(174));return e}function Jl(e,t){switch(ce(lo,t),ce(ao,e),ce(Ot,mo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ba(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ba(t,e)}pe(Ot),ce(Ot,t)}function vr(){pe(Ot),pe(ao),pe(lo)}function bd(e){Mn(lo.current);var t=Mn(Ot.current),n=Ba(t,e.type);t!==n&&(ce(ao,e),ce(Ot,n))}function ql(e){ao.current===e&&(pe(Ot),pe(ao))}var me=xn(0);function wi(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 Ea=[];function Zl(){for(var e=0;e<Ea.length;e++)Ea[e]._workInProgressVersionPrimary=null;Ea.length=0}var Jo=Jt.ReactCurrentDispatcher,Ta=Jt.ReactCurrentBatchConfig,On=0,ve=null,Me=null,Ie=null,xi=!1,Gr=!1,so=0,qh=0;function je(){throw Error(S(321))}function es(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Nt(e[n],t[n]))return!1;return!0}function ts(e,t,n,r,o,i){if(On=i,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Jo.current=e===null||e.memoizedState===null?ng:rg,e=n(r,o),Gr){i=0;do{if(Gr=!1,so=0,25<=i)throw Error(S(301));i+=1,Ie=Me=null,t.updateQueue=null,Jo.current=og,e=n(r,o)}while(Gr)}if(Jo.current=ki,t=Me!==null&&Me.next!==null,On=0,Ie=Me=ve=null,xi=!1,t)throw Error(S(300));return e}function ns(){var e=so!==0;return so=0,e}function Lt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ie===null?ve.memoizedState=Ie=e:Ie=Ie.next=e,Ie}function mt(){if(Me===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=Me.next;var t=Ie===null?ve.memoizedState:Ie.next;if(t!==null)Ie=t,Me=e;else{if(e===null)throw Error(S(310));Me=e,e={memoizedState:Me.memoizedState,baseState:Me.baseState,baseQueue:Me.baseQueue,queue:Me.queue,next:null},Ie===null?ve.memoizedState=Ie=e:Ie=Ie.next=e}return Ie}function uo(e,t){return typeof t=="function"?t(e):t}function Pa(e){var t=mt(),n=t.queue;if(n===null)throw Error(S(311));n.lastRenderedReducer=e;var r=Me,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((On&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,ve.lanes|=d,An|=d}c=c.next}while(c!==null&&c!==i);s===null?a=r:s.next=u,Nt(r,t.memoizedState)||(Xe=!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,ve.lanes|=i,An|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ma(e){var t=mt(),n=t.queue;if(n===null)throw Error(S(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);Nt(i,t.memoizedState)||(Xe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function _d(){}function Sd(e,t){var n=ve,r=mt(),o=t(),i=!Nt(r.memoizedState,o);if(i&&(r.memoizedState=o,Xe=!0),r=r.queue,rs(Ed.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ie!==null&&Ie.memoizedState.tag&1){if(n.flags|=2048,co(9,Nd.bind(null,n,r,o,t),void 0,null),Re===null)throw Error(S(349));On&30||Cd(n,t,o)}return o}function Cd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Nd(e,t,n,r){t.value=n,t.getSnapshot=r,Td(t)&&Pd(e)}function Ed(e,t,n){return n(function(){Td(t)&&Pd(e)})}function Td(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Nt(e,n)}catch{return!0}}function Pd(e){var t=Qt(e,1);t!==null&&Ct(t,e,1,-1)}function Ju(e){var t=Lt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:uo,lastRenderedState:e},t.queue=e,e=e.dispatch=tg.bind(null,ve,e),[t.memoizedState,e]}function co(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.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 Md(){return mt().memoizedState}function qo(e,t,n,r){var o=Lt();ve.flags|=e,o.memoizedState=co(1|t,n,void 0,r===void 0?null:r)}function Ii(e,t,n,r){var o=mt();r=r===void 0?null:r;var i=void 0;if(Me!==null){var a=Me.memoizedState;if(i=a.destroy,r!==null&&es(r,a.deps)){o.memoizedState=co(t,n,i,r);return}}ve.flags|=e,o.memoizedState=co(1|t,n,i,r)}function qu(e,t){return qo(8390656,8,e,t)}function rs(e,t){return Ii(2048,8,e,t)}function Fd(e,t){return Ii(4,2,e,t)}function Ld(e,t){return Ii(4,4,e,t)}function Id(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 Rd(e,t,n){return n=n!=null?n.concat([e]):null,Ii(4,4,Id.bind(null,t,e),n)}function os(){}function Od(e,t){var n=mt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&es(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ad(e,t){var n=mt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&es(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function zd(e,t,n){return On&21?(Nt(n,t)||(n=$c(),ve.lanes|=n,An|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Xe=!0),e.memoizedState=n)}function Zh(e,t){var n=ie;ie=n!==0&&4>n?n:4,e(!0);var r=Ta.transition;Ta.transition={};try{e(!1),t()}finally{ie=n,Ta.transition=r}}function Dd(){return mt().memoizedState}function eg(e,t,n){var r=gn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Wd(e))jd(t,n);else if(n=xd(e,t,n,r),n!==null){var o=Ke();Ct(n,e,r,o),Ud(n,t,r)}}function tg(e,t,n){var r=gn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wd(e))jd(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,Nt(u,a)){var s=t.interleaved;s===null?(o.next=o,Ql(t)):(o.next=s.next,s.next=o),t.interleaved=o;return}}catch{}finally{}n=xd(e,t,o,r),n!==null&&(o=Ke(),Ct(n,e,r,o),Ud(n,t,r))}}function Wd(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function jd(e,t){Gr=xi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ud(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ol(e,n)}}var ki={readContext:gt,useCallback:je,useContext:je,useEffect:je,useImperativeHandle:je,useInsertionEffect:je,useLayoutEffect:je,useMemo:je,useReducer:je,useRef:je,useState:je,useDebugValue:je,useDeferredValue:je,useTransition:je,useMutableSource:je,useSyncExternalStore:je,useId:je,unstable_isNewReconciler:!1},ng={readContext:gt,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:qu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,qo(4194308,4,Id.bind(null,t,e),n)},useLayoutEffect:function(e,t){return qo(4194308,4,e,t)},useInsertionEffect:function(e,t){return qo(4,2,e,t)},useMemo:function(e,t){var n=Lt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Lt();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=eg.bind(null,ve,e),[r.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:Ju,useDebugValue:os,useDeferredValue:function(e){return Lt().memoizedState=e},useTransition:function(){var e=Ju(!1),t=e[0];return e=Zh.bind(null,e[1]),Lt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ve,o=Lt();if(he){if(n===void 0)throw Error(S(407));n=n()}else{if(n=t(),Re===null)throw Error(S(349));On&30||Cd(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,qu(Ed.bind(null,r,i,e),[e]),r.flags|=2048,co(9,Nd.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Lt(),t=Re.identifierPrefix;if(he){var n=Gt,r=Bt;n=(r&~(1<<32-St(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=so++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=qh++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},rg={readContext:gt,useCallback:Od,useContext:gt,useEffect:rs,useImperativeHandle:Rd,useInsertionEffect:Fd,useLayoutEffect:Ld,useMemo:Ad,useReducer:Pa,useRef:Md,useState:function(){return Pa(uo)},useDebugValue:os,useDeferredValue:function(e){var t=mt();return zd(t,Me.memoizedState,e)},useTransition:function(){var e=Pa(uo)[0],t=mt().memoizedState;return[e,t]},useMutableSource:_d,useSyncExternalStore:Sd,useId:Dd,unstable_isNewReconciler:!1},og={readContext:gt,useCallback:Od,useContext:gt,useEffect:rs,useImperativeHandle:Rd,useInsertionEffect:Fd,useLayoutEffect:Ld,useMemo:Ad,useReducer:Ma,useRef:Md,useState:function(){return Ma(uo)},useDebugValue:os,useDeferredValue:function(e){var t=mt();return Me===null?t.memoizedState=e:zd(t,Me.memoizedState,e)},useTransition:function(){var e=Ma(uo)[0],t=mt().memoizedState;return[e,t]},useMutableSource:_d,useSyncExternalStore:Sd,useId:Dd,unstable_isNewReconciler:!1};function kt(e,t){if(e&&e.defaultProps){t=ye({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function dl(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ye({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ri={isMounted:function(e){return(e=e._reactInternals)?Wn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ke(),o=gn(e),i=Vt(r,o);i.payload=t,n!=null&&(i.callback=n),t=fn(e,i,o),t!==null&&(Ct(t,e,o,r),Xo(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ke(),o=gn(e),i=Vt(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=fn(e,i,o),t!==null&&(Ct(t,e,o,r),Xo(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ke(),r=gn(e),o=Vt(n,r);o.tag=2,t!=null&&(o.callback=t),t=fn(e,o,r),t!==null&&(Ct(t,e,r,n),Xo(t,e,r))}};function Zu(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?!no(n,r)||!no(o,i):!0}function $d(e,t,n){var r=!1,o=yn,i=t.contextType;return typeof i=="object"&&i!==null?i=gt(i):(o=qe(t)?In:He.current,r=t.contextTypes,i=(r=r!=null)?hr(e,o):yn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ri,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function ec(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&&Ri.enqueueReplaceState(t,t.state,null)}function pl(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Xl(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=gt(i):(i=qe(t)?In:He.current,o.context=hr(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(dl(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&&Ri.enqueueReplaceState(o,o.state,null),yi(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function yr(e,t){try{var n="",r=t;do n+=Rf(r),r=r.return;while(r);var o=n}catch(i){o=`
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{ga=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ar(e):""}function Rf(e){switch(e.tag){case 5:return Ar(e.type);case 16:return Ar("Lazy");case 13:return Ar("Suspense");case 19:return Ar("SuspenseList");case 0:case 2:case 15:return e=ma(e.type,!1),e;case 11:return e=ma(e.type.render,!1),e;case 1:return e=ma(e.type,!0),e;default:return""}}function ja(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 Xn:return"Fragment";case Qn:return"Portal";case za:return"Profiler";case Fl:return"StrictMode";case Da:return"Suspense";case Wa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case kc:return(e.displayName||"Context")+".Consumer";case xc:return(e._context.displayName||"Context")+".Provider";case Ll:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Il:return t=e.displayName||null,t!==null?t:ja(e.type)||"Memo";case nn:t=e._payload,e=e._init;try{return ja(e(t))}catch{}}return null}function Of(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 ja(t);case 8:return t===Fl?"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 vn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _c(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Af(e){var t=_c(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 Mo(e){e._valueTracker||(e._valueTracker=Af(e))}function Sc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=_c(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function oi(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 Ua(e,t){var n=t.checked;return ye({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mu(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=vn(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 Cc(e,t){t=t.checked,t!=null&&Ml(e,"checked",t,!1)}function $a(e,t){Cc(e,t);var n=vn(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")?Ha(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ha(e,t.type,vn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vu(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 Ha(e,t,n){(t!=="number"||oi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zr=Array.isArray;function lr(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=""+vn(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 Ba(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(S(91));return ye({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function yu(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(S(92));if(zr(n)){if(1<n.length)throw Error(S(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:vn(n)}}function Nc(e,t){var n=vn(t.value),r=vn(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 wu(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ec(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 Ga(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ec(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fo,Tc=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(Fo=Fo||document.createElement("div"),Fo.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var jr={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},zf=["Webkit","ms","Moz","O"];Object.keys(jr).forEach(function(e){zf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),jr[t]=jr[e]})});function Pc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||jr.hasOwnProperty(e)&&jr[e]?(""+t).trim():t+"px"}function Mc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Pc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Df=ye({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 Va(e,t){if(t){if(Df[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(S(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(S(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(S(61))}if(t.style!=null&&typeof t.style!="object")throw Error(S(62))}}function Ka(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 Ya=null;function Rl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qa=null,sr=null,ur=null;function xu(e){if(e=go(e)){if(typeof Qa!="function")throw Error(S(280));var t=e.stateNode;t&&(t=Li(t),Qa(e.stateNode,e.type,t))}}function Fc(e){sr?ur?ur.push(e):ur=[e]:sr=e}function Lc(){if(sr){var e=sr,t=ur;if(ur=sr=null,xu(e),t)for(e=0;e<t.length;e++)xu(t[e])}}function Ic(e,t){return e(t)}function Rc(){}var va=!1;function Oc(e,t,n){if(va)return e(t,n);va=!0;try{return Ic(e,t,n)}finally{va=!1,(sr!==null||ur!==null)&&(Rc(),Lc())}}function Jr(e,t){var n=e.stateNode;if(n===null)return null;var r=Li(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(S(231,t,typeof n));return n}var Xa=!1;if(Kt)try{Kn={},Object.defineProperty(Kn,"passive",{get:function(){Xa=!0}}),window.addEventListener("test",Kn,Kn),window.removeEventListener("test",Kn,Kn)}catch{Xa=!1}var Kn;function Wf(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 Ur=!1,ii=null,ai=!1,Ja=null,jf={onError:function(e){Ur=!0,ii=e}};function Uf(e,t,n,r,o,i,a,u,s){Ur=!1,ii=null,Wf.apply(jf,arguments)}function $f(e,t,n,r,o,i,a,u,s){if(Uf.apply(this,arguments),Ur){if(Ur){var c=ii;Ur=!1,ii=null}else throw Error(S(198));ai||(ai=!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 Ac(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 ku(e){if(Wn(e)!==e)throw Error(S(188))}function Hf(e){var t=e.alternate;if(!t){if(t=Wn(e),t===null)throw Error(S(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 ku(o),e;if(i===r)return ku(o),t;i=i.sibling}throw Error(S(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(S(189))}}if(n.alternate!==r)throw Error(S(190))}if(n.tag!==3)throw Error(S(188));return n.stateNode.current===n?e:t}function zc(e){return e=Hf(e),e!==null?Dc(e):null}function Dc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Dc(e);if(t!==null)return t;e=e.sibling}return null}var Wc=lt.unstable_scheduleCallback,bu=lt.unstable_cancelCallback,Bf=lt.unstable_shouldYield,Gf=lt.unstable_requestPaint,Se=lt.unstable_now,Vf=lt.unstable_getCurrentPriorityLevel,Ol=lt.unstable_ImmediatePriority,jc=lt.unstable_UserBlockingPriority,li=lt.unstable_NormalPriority,Kf=lt.unstable_LowPriority,Uc=lt.unstable_IdlePriority,Ti=null,Rt=null;function Yf(e){if(Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(Ti,e,void 0,(e.current.flags&128)===128)}catch{}}var St=Math.clz32?Math.clz32:Jf,Qf=Math.log,Xf=Math.LN2;function Jf(e){return e>>>=0,e===0?32:31-(Qf(e)/Xf|0)|0}var Lo=64,Io=4194304;function Dr(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 si(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=Dr(u):(i&=a,i!==0&&(r=Dr(i)))}else a=n&~o,a!==0?r=Dr(a):i!==0&&(r=Dr(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-St(t),o=1<<n,r|=e[n],t&=~o;return r}function qf(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 Zf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-St(i),u=1<<a,s=o[a];s===-1?(!(u&n)||u&r)&&(o[a]=qf(u,t)):s<=t&&(e.expiredLanes|=u),i&=~u}}function qa(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function $c(){var e=Lo;return Lo<<=1,!(Lo&4194240)&&(Lo=64),e}function ya(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function fo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-St(t),e[t]=n}function eh(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-St(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Al(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-St(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ie=0;function Hc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Bc,zl,Gc,Vc,Kc,Za=!1,Ro=[],un=null,cn=null,dn=null,qr=new Map,Zr=new Map,on=[],th="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 _u(e,t){switch(e){case"focusin":case"focusout":un=null;break;case"dragenter":case"dragleave":cn=null;break;case"mouseover":case"mouseout":dn=null;break;case"pointerover":case"pointerout":qr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zr.delete(t.pointerId)}}function Pr(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=go(t),t!==null&&zl(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function nh(e,t,n,r,o){switch(t){case"focusin":return un=Pr(un,e,t,n,r,o),!0;case"dragenter":return cn=Pr(cn,e,t,n,r,o),!0;case"mouseover":return dn=Pr(dn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return qr.set(i,Pr(qr.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Zr.set(i,Pr(Zr.get(i)||null,e,t,n,r,o)),!0}return!1}function Yc(e){var t=Tn(e.target);if(t!==null){var n=Wn(t);if(n!==null){if(t=n.tag,t===13){if(t=Ac(n),t!==null){e.blockedOn=t,Kc(e.priority,function(){Gc(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 Yo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=el(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ya=r,n.target.dispatchEvent(r),Ya=null}else return t=go(n),t!==null&&zl(t),e.blockedOn=n,!1;t.shift()}return!0}function Su(e,t,n){Yo(e)&&n.delete(t)}function rh(){Za=!1,un!==null&&Yo(un)&&(un=null),cn!==null&&Yo(cn)&&(cn=null),dn!==null&&Yo(dn)&&(dn=null),qr.forEach(Su),Zr.forEach(Su)}function Mr(e,t){e.blockedOn===t&&(e.blockedOn=null,Za||(Za=!0,lt.unstable_scheduleCallback(lt.unstable_NormalPriority,rh)))}function eo(e){function t(o){return Mr(o,e)}if(0<Ro.length){Mr(Ro[0],e);for(var n=1;n<Ro.length;n++){var r=Ro[n];r.blockedOn===e&&(r.blockedOn=null)}}for(un!==null&&Mr(un,e),cn!==null&&Mr(cn,e),dn!==null&&Mr(dn,e),qr.forEach(t),Zr.forEach(t),n=0;n<on.length;n++)r=on[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<on.length&&(n=on[0],n.blockedOn===null);)Yc(n),n.blockedOn===null&&on.shift()}var cr=Jt.ReactCurrentBatchConfig,ui=!0;function oh(e,t,n,r){var o=ie,i=cr.transition;cr.transition=null;try{ie=1,Dl(e,t,n,r)}finally{ie=o,cr.transition=i}}function ih(e,t,n,r){var o=ie,i=cr.transition;cr.transition=null;try{ie=4,Dl(e,t,n,r)}finally{ie=o,cr.transition=i}}function Dl(e,t,n,r){if(ui){var o=el(e,t,n,r);if(o===null)Ca(e,t,r,ci,n),_u(e,r);else if(nh(o,e,t,n,r))r.stopPropagation();else if(_u(e,r),t&4&&-1<th.indexOf(e)){for(;o!==null;){var i=go(o);if(i!==null&&Bc(i),i=el(e,t,n,r),i===null&&Ca(e,t,r,ci,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Ca(e,t,r,null,n)}}var ci=null;function el(e,t,n,r){if(ci=null,e=Rl(r),e=Tn(e),e!==null)if(t=Wn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ac(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 ci=e,null}function Qc(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(Vf()){case Ol:return 1;case jc:return 4;case li:case Kf:return 16;case Uc:return 536870912;default:return 16}default:return 16}}var ln=null,Wl=null,Qo=null;function Xc(){if(Qo)return Qo;var e,t=Wl,n=t.length,r,o="value"in ln?ln.value:ln.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 Qo=o.slice(e,1<r?1-r:void 0)}function Xo(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 Oo(){return!0}function Cu(){return!1}function st(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)?Oo:Cu,this.isPropagationStopped=Cu,this}return ye(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=Oo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Oo)},persist:function(){},isPersistent:Oo}),t}var xr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jl=st(xr),ho=ye({},xr,{view:0,detail:0}),ah=st(ho),wa,xa,Fr,Pi=ye({},ho,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ul,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!==Fr&&(Fr&&e.type==="mousemove"?(wa=e.screenX-Fr.screenX,xa=e.screenY-Fr.screenY):xa=wa=0,Fr=e),wa)},movementY:function(e){return"movementY"in e?e.movementY:xa}}),Nu=st(Pi),lh=ye({},Pi,{dataTransfer:0}),sh=st(lh),uh=ye({},ho,{relatedTarget:0}),ka=st(uh),ch=ye({},xr,{animationName:0,elapsedTime:0,pseudoElement:0}),dh=st(ch),ph=ye({},xr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),fh=st(ph),hh=ye({},xr,{data:0}),Eu=st(hh),gh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mh={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"},vh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=vh[e])?!!t[e]:!1}function Ul(){return yh}var wh=ye({},ho,{key:function(e){if(e.key){var t=gh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Xo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?mh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ul,charCode:function(e){return e.type==="keypress"?Xo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),xh=st(wh),kh=ye({},Pi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tu=st(kh),bh=ye({},ho,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ul}),_h=st(bh),Sh=ye({},xr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ch=st(Sh),Nh=ye({},Pi,{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}),Eh=st(Nh),Th=[9,13,27,32],$l=Kt&&"CompositionEvent"in window,$r=null;Kt&&"documentMode"in document&&($r=document.documentMode);var Ph=Kt&&"TextEvent"in window&&!$r,Jc=Kt&&(!$l||$r&&8<$r&&11>=$r),Pu=String.fromCharCode(32),Mu=!1;function qc(e,t){switch(e){case"keyup":return Th.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jn=!1;function Mh(e,t){switch(e){case"compositionend":return Zc(t);case"keypress":return t.which!==32?null:(Mu=!0,Pu);case"textInput":return e=t.data,e===Pu&&Mu?null:e;default:return null}}function Fh(e,t){if(Jn)return e==="compositionend"||!$l&&qc(e,t)?(e=Xc(),Qo=Wl=ln=null,Jn=!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 Jc&&t.locale!=="ko"?null:t.data;default:return null}}var Lh={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 Fu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lh[e.type]:t==="textarea"}function ed(e,t,n,r){Fc(r),t=di(t,"onChange"),0<t.length&&(n=new jl("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Hr=null,to=null;function Ih(e){dd(e,0)}function Mi(e){var t=er(e);if(Sc(t))return e}function Rh(e,t){if(e==="change")return t}var td=!1;Kt&&(Kt?(zo="oninput"in document,zo||(ba=document.createElement("div"),ba.setAttribute("oninput","return;"),zo=typeof ba.oninput=="function"),Ao=zo):Ao=!1,td=Ao&&(!document.documentMode||9<document.documentMode));var Ao,zo,ba;function Lu(){Hr&&(Hr.detachEvent("onpropertychange",nd),to=Hr=null)}function nd(e){if(e.propertyName==="value"&&Mi(to)){var t=[];ed(t,to,e,Rl(e)),Oc(Ih,t)}}function Oh(e,t,n){e==="focusin"?(Lu(),Hr=t,to=n,Hr.attachEvent("onpropertychange",nd)):e==="focusout"&&Lu()}function Ah(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Mi(to)}function zh(e,t){if(e==="click")return Mi(t)}function Dh(e,t){if(e==="input"||e==="change")return Mi(t)}function Wh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nt=typeof Object.is=="function"?Object.is:Wh;function no(e,t){if(Nt(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(!Aa.call(t,o)||!Nt(e[o],t[o]))return!1}return!0}function Iu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ru(e,t){var n=Iu(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=Iu(n)}}function rd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?rd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function od(){for(var e=window,t=oi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=oi(e.document)}return t}function Hl(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 jh(e){var t=od(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&rd(n.ownerDocument.documentElement,n)){if(r!==null&&Hl(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=Ru(n,i);var a=Ru(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 Uh=Kt&&"documentMode"in document&&11>=document.documentMode,qn=null,tl=null,Br=null,nl=!1;function Ou(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;nl||qn==null||qn!==oi(r)||(r=qn,"selectionStart"in r&&Hl(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}),Br&&no(Br,r)||(Br=r,r=di(tl,"onSelect"),0<r.length&&(t=new jl("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=qn)))}function Do(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Zn={animationend:Do("Animation","AnimationEnd"),animationiteration:Do("Animation","AnimationIteration"),animationstart:Do("Animation","AnimationStart"),transitionend:Do("Transition","TransitionEnd")},_a={},id={};Kt&&(id=document.createElement("div").style,"AnimationEvent"in window||(delete Zn.animationend.animation,delete Zn.animationiteration.animation,delete Zn.animationstart.animation),"TransitionEvent"in window||delete Zn.transitionend.transition);function Fi(e){if(_a[e])return _a[e];if(!Zn[e])return e;var t=Zn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in id)return _a[e]=t[n];return e}var ad=Fi("animationend"),ld=Fi("animationiteration"),sd=Fi("animationstart"),ud=Fi("transitionend"),cd=new Map,Au="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 wn(e,t){cd.set(e,t),Dn(t,[e])}for(Wo=0;Wo<Au.length;Wo++)jo=Au[Wo],zu=jo.toLowerCase(),Du=jo[0].toUpperCase()+jo.slice(1),wn(zu,"on"+Du);var jo,zu,Du,Wo;wn(ad,"onAnimationEnd");wn(ld,"onAnimationIteration");wn(sd,"onAnimationStart");wn("dblclick","onDoubleClick");wn("focusin","onFocus");wn("focusout","onBlur");wn(ud,"onTransitionEnd");fr("onMouseEnter",["mouseout","mouseover"]);fr("onMouseLeave",["mouseout","mouseover"]);fr("onPointerEnter",["pointerout","pointerover"]);fr("onPointerLeave",["pointerout","pointerover"]);Dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Dn("onBeforeInput",["compositionend","keypress","textInput","paste"]);Dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Dn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wr="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(" "),$h=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wr));function Wu(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,$f(r,t,void 0,e),e.currentTarget=null}function dd(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(ai)throw e=Ja,ai=!1,Ja=null,e}function de(e,t){var n=t[ll];n===void 0&&(n=t[ll]=new Set);var r=e+"__bubble";n.has(r)||(pd(t,e,2,!1),n.add(r))}function Sa(e,t,n){var r=0;t&&(r|=4),pd(n,e,r,t)}var Uo="_reactListening"+Math.random().toString(36).slice(2);function ro(e){if(!e[Uo]){e[Uo]=!0,wc.forEach(function(n){n!=="selectionchange"&&($h.has(n)||Sa(n,!1,e),Sa(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uo]||(t[Uo]=!0,Sa("selectionchange",!1,t))}}function pd(e,t,n,r){switch(Qc(t)){case 1:var o=oh;break;case 4:o=ih;break;default:o=Dl}n=o.bind(null,t,n,e),o=void 0,!Xa||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 Ca(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=Tn(u),a===null)return;if(s=a.tag,s===5||s===6){r=i=a;continue e}u=u.parentNode}}r=r.return}Oc(function(){var c=i,d=Rl(n),p=[];e:{var g=cd.get(e);if(g!==void 0){var v=jl,b=e;switch(e){case"keypress":if(Xo(n)===0)break e;case"keydown":case"keyup":v=xh;break;case"focusin":b="focus",v=ka;break;case"focusout":b="blur",v=ka;break;case"beforeblur":case"afterblur":v=ka;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":v=Nu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=sh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=_h;break;case ad:case ld:case sd:v=dh;break;case ud:v=Ch;break;case"scroll":v=ah;break;case"wheel":v=Eh;break;case"copy":case"cut":case"paste":v=fh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=Tu}var w=(t&4)!==0,V=!w&&e==="scroll",f=w?g!==null?g+"Capture":null:g;w=[];for(var h=c,m;h!==null;){m=h;var x=m.stateNode;if(m.tag===5&&x!==null&&(m=x,f!==null&&(x=Jr(h,f),x!=null&&w.push(oo(h,x,m)))),V)break;h=h.return}0<w.length&&(g=new v(g,b,null,n,d),p.push({event:g,listeners:w}))}}if(!(t&7)){e:{if(g=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",g&&n!==Ya&&(b=n.relatedTarget||n.fromElement)&&(Tn(b)||b[Yt]))break e;if((v||g)&&(g=d.window===d?d:(g=d.ownerDocument)?g.defaultView||g.parentWindow:window,v?(b=n.relatedTarget||n.toElement,v=c,b=b?Tn(b):null,b!==null&&(V=Wn(b),b!==V||b.tag!==5&&b.tag!==6)&&(b=null)):(v=null,b=c),v!==b)){if(w=Nu,x="onMouseLeave",f="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(w=Tu,x="onPointerLeave",f="onPointerEnter",h="pointer"),V=v==null?g:er(v),m=b==null?g:er(b),g=new w(x,h+"leave",v,n,d),g.target=V,g.relatedTarget=m,x=null,Tn(d)===c&&(w=new w(f,h+"enter",b,n,d),w.target=m,w.relatedTarget=V,x=w),V=x,v&&b)t:{for(w=v,f=b,h=0,m=w;m;m=Yn(m))h++;for(m=0,x=f;x;x=Yn(x))m++;for(;0<h-m;)w=Yn(w),h--;for(;0<m-h;)f=Yn(f),m--;for(;h--;){if(w===f||f!==null&&w===f.alternate)break t;w=Yn(w),f=Yn(f)}w=null}else w=null;v!==null&&ju(p,g,v,w,!1),b!==null&&V!==null&&ju(p,V,b,w,!0)}}e:{if(g=c?er(c):window,v=g.nodeName&&g.nodeName.toLowerCase(),v==="select"||v==="input"&&g.type==="file")var C=Rh;else if(Fu(g))if(td)C=Dh;else{C=Ah;var F=Oh}else(v=g.nodeName)&&v.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(C=zh);if(C&&(C=C(e,c))){ed(p,C,n,d);break e}F&&F(e,g,c),e==="focusout"&&(F=g._wrapperState)&&F.controlled&&g.type==="number"&&Ha(g,"number",g.value)}switch(F=c?er(c):window,e){case"focusin":(Fu(F)||F.contentEditable==="true")&&(qn=F,tl=c,Br=null);break;case"focusout":Br=tl=qn=null;break;case"mousedown":nl=!0;break;case"contextmenu":case"mouseup":case"dragend":nl=!1,Ou(p,n,d);break;case"selectionchange":if(Uh)break;case"keydown":case"keyup":Ou(p,n,d)}var L;if($l)e:{switch(e){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else Jn?qc(e,n)&&(R="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(R="onCompositionStart");R&&(Jc&&n.locale!=="ko"&&(Jn||R!=="onCompositionStart"?R==="onCompositionEnd"&&Jn&&(L=Xc()):(ln=d,Wl="value"in ln?ln.value:ln.textContent,Jn=!0)),F=di(c,R),0<F.length&&(R=new Eu(R,e,null,n,d),p.push({event:R,listeners:F}),L?R.data=L:(L=Zc(n),L!==null&&(R.data=L)))),(L=Ph?Mh(e,n):Fh(e,n))&&(c=di(c,"onBeforeInput"),0<c.length&&(d=new Eu("onBeforeInput","beforeinput",null,n,d),p.push({event:d,listeners:c}),d.data=L))}dd(p,t)})}function oo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function di(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(oo(e,i,o)),i=Jr(e,t),i!=null&&r.push(oo(e,i,o))),e=e.return}return r}function Yn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ju(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(oo(n,s,u))):o||(s=Jr(n,i),s!=null&&a.push(oo(n,s,u)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var Hh=/\r\n?/g,Bh=/\u0000|\uFFFD/g;function Uu(e){return(typeof e=="string"?e:""+e).replace(Hh,`
6
+ `).replace(Bh,"")}function $o(e,t,n){if(t=Uu(t),Uu(e)!==t&&n)throw Error(S(425))}function pi(){}var rl=null,ol=null;function il(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 al=typeof setTimeout=="function"?setTimeout:void 0,Gh=typeof clearTimeout=="function"?clearTimeout:void 0,$u=typeof Promise=="function"?Promise:void 0,Vh=typeof queueMicrotask=="function"?queueMicrotask:typeof $u<"u"?function(e){return $u.resolve(null).then(e).catch(Kh)}:al;function Kh(e){setTimeout(function(){throw e})}function Na(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),eo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);eo(t)}function pn(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 Hu(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 kr=Math.random().toString(36).slice(2),It="__reactFiber$"+kr,io="__reactProps$"+kr,Yt="__reactContainer$"+kr,ll="__reactEvents$"+kr,Yh="__reactListeners$"+kr,Qh="__reactHandles$"+kr;function Tn(e){var t=e[It];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Yt]||n[It]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Hu(e);e!==null;){if(n=e[It])return n;e=Hu(e)}return t}e=n,n=e.parentNode}return null}function go(e){return e=e[It]||e[Yt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function er(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(S(33))}function Li(e){return e[io]||null}var sl=[],tr=-1;function xn(e){return{current:e}}function pe(e){0>tr||(e.current=sl[tr],sl[tr]=null,tr--)}function ce(e,t){tr++,sl[tr]=e.current,e.current=t}var yn={},He=xn(yn),Je=xn(!1),In=yn;function hr(e,t){var n=e.type.contextTypes;if(!n)return yn;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 qe(e){return e=e.childContextTypes,e!=null}function fi(){pe(Je),pe(He)}function Bu(e,t,n){if(He.current!==yn)throw Error(S(168));ce(He,t),ce(Je,n)}function fd(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(S(108,Of(e)||"Unknown",o));return ye({},n,r)}function hi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||yn,In=He.current,ce(He,e),ce(Je,Je.current),!0}function Gu(e,t,n){var r=e.stateNode;if(!r)throw Error(S(169));n?(e=fd(e,t,In),r.__reactInternalMemoizedMergedChildContext=e,pe(Je),pe(He),ce(He,e)):pe(Je),ce(Je,n)}var Ht=null,Ii=!1,Ea=!1;function hd(e){Ht===null?Ht=[e]:Ht.push(e)}function Xh(e){Ii=!0,hd(e)}function kn(){if(!Ea&&Ht!==null){Ea=!0;var e=0,t=ie;try{var n=Ht;for(ie=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ht=null,Ii=!1}catch(o){throw Ht!==null&&(Ht=Ht.slice(e+1)),Wc(Ol,kn),o}finally{ie=t,Ea=!1}}return null}var nr=[],rr=0,gi=null,mi=0,dt=[],pt=0,Rn=null,Bt=1,Gt="";function Nn(e,t){nr[rr++]=mi,nr[rr++]=gi,gi=e,mi=t}function gd(e,t,n){dt[pt++]=Bt,dt[pt++]=Gt,dt[pt++]=Rn,Rn=e;var r=Bt;e=Gt;var o=32-St(r)-1;r&=~(1<<o),n+=1;var i=32-St(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Bt=1<<32-St(t)+o|n<<o|r,Gt=i+e}else Bt=1<<i|n<<o|r,Gt=e}function Bl(e){e.return!==null&&(Nn(e,1),gd(e,1,0))}function Gl(e){for(;e===gi;)gi=nr[--rr],nr[rr]=null,mi=nr[--rr],nr[rr]=null;for(;e===Rn;)Rn=dt[--pt],dt[pt]=null,Gt=dt[--pt],dt[pt]=null,Bt=dt[--pt],dt[pt]=null}var at=null,it=null,he=!1,_t=null;function md(e,t){var n=ft(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 Vu(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,at=e,it=pn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,at=e,it=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Rn!==null?{id:Bt,overflow:Gt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ft(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,at=e,it=null,!0):!1;default:return!1}}function ul(e){return(e.mode&1)!==0&&(e.flags&128)===0}function cl(e){if(he){var t=it;if(t){var n=t;if(!Vu(e,t)){if(ul(e))throw Error(S(418));t=pn(n.nextSibling);var r=at;t&&Vu(e,t)?md(r,n):(e.flags=e.flags&-4097|2,he=!1,at=e)}}else{if(ul(e))throw Error(S(418));e.flags=e.flags&-4097|2,he=!1,at=e}}}function Ku(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;at=e}function Ho(e){if(e!==at)return!1;if(!he)return Ku(e),he=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!il(e.type,e.memoizedProps)),t&&(t=it)){if(ul(e))throw vd(),Error(S(418));for(;t;)md(e,t),t=pn(t.nextSibling)}if(Ku(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(S(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){it=pn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}it=null}}else it=at?pn(e.stateNode.nextSibling):null;return!0}function vd(){for(var e=it;e;)e=pn(e.nextSibling)}function gr(){it=at=null,he=!1}function Vl(e){_t===null?_t=[e]:_t.push(e)}var Jh=Jt.ReactCurrentBatchConfig;function Lr(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(S(309));var r=n.stateNode}if(!r)throw Error(S(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(S(284));if(!n._owner)throw Error(S(290,e))}return e}function Bo(e,t){throw e=Object.prototype.toString.call(t),Error(S(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Yu(e){var t=e._init;return t(e._payload)}function yd(e){function t(f,h){if(e){var m=f.deletions;m===null?(f.deletions=[h],f.flags|=16):m.push(h)}}function n(f,h){if(!e)return null;for(;h!==null;)t(f,h),h=h.sibling;return null}function r(f,h){for(f=new Map;h!==null;)h.key!==null?f.set(h.key,h):f.set(h.index,h),h=h.sibling;return f}function o(f,h){return f=mn(f,h),f.index=0,f.sibling=null,f}function i(f,h,m){return f.index=m,e?(m=f.alternate,m!==null?(m=m.index,m<h?(f.flags|=2,h):m):(f.flags|=2,h)):(f.flags|=1048576,h)}function a(f){return e&&f.alternate===null&&(f.flags|=2),f}function u(f,h,m,x){return h===null||h.tag!==6?(h=Ra(m,f.mode,x),h.return=f,h):(h=o(h,m),h.return=f,h)}function s(f,h,m,x){var C=m.type;return C===Xn?d(f,h,m.props.children,x,m.key):h!==null&&(h.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===nn&&Yu(C)===h.type)?(x=o(h,m.props),x.ref=Lr(f,h,m),x.return=f,x):(x=ri(m.type,m.key,m.props,null,f.mode,x),x.ref=Lr(f,h,m),x.return=f,x)}function c(f,h,m,x){return h===null||h.tag!==4||h.stateNode.containerInfo!==m.containerInfo||h.stateNode.implementation!==m.implementation?(h=Oa(m,f.mode,x),h.return=f,h):(h=o(h,m.children||[]),h.return=f,h)}function d(f,h,m,x,C){return h===null||h.tag!==7?(h=Ln(m,f.mode,x,C),h.return=f,h):(h=o(h,m),h.return=f,h)}function p(f,h,m){if(typeof h=="string"&&h!==""||typeof h=="number")return h=Ra(""+h,f.mode,m),h.return=f,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Po:return m=ri(h.type,h.key,h.props,null,f.mode,m),m.ref=Lr(f,null,h),m.return=f,m;case Qn:return h=Oa(h,f.mode,m),h.return=f,h;case nn:var x=h._init;return p(f,x(h._payload),m)}if(zr(h)||Tr(h))return h=Ln(h,f.mode,m,null),h.return=f,h;Bo(f,h)}return null}function g(f,h,m,x){var C=h!==null?h.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return C!==null?null:u(f,h,""+m,x);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Po:return m.key===C?s(f,h,m,x):null;case Qn:return m.key===C?c(f,h,m,x):null;case nn:return C=m._init,g(f,h,C(m._payload),x)}if(zr(m)||Tr(m))return C!==null?null:d(f,h,m,x,null);Bo(f,m)}return null}function v(f,h,m,x,C){if(typeof x=="string"&&x!==""||typeof x=="number")return f=f.get(m)||null,u(h,f,""+x,C);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Po:return f=f.get(x.key===null?m:x.key)||null,s(h,f,x,C);case Qn:return f=f.get(x.key===null?m:x.key)||null,c(h,f,x,C);case nn:var F=x._init;return v(f,h,m,F(x._payload),C)}if(zr(x)||Tr(x))return f=f.get(m)||null,d(h,f,x,C,null);Bo(h,x)}return null}function b(f,h,m,x){for(var C=null,F=null,L=h,R=h=0,H=null;L!==null&&R<m.length;R++){L.index>R?(H=L,L=null):H=L.sibling;var z=g(f,L,m[R],x);if(z===null){L===null&&(L=H);break}e&&L&&z.alternate===null&&t(f,L),h=i(z,h,R),F===null?C=z:F.sibling=z,F=z,L=H}if(R===m.length)return n(f,L),he&&Nn(f,R),C;if(L===null){for(;R<m.length;R++)L=p(f,m[R],x),L!==null&&(h=i(L,h,R),F===null?C=L:F.sibling=L,F=L);return he&&Nn(f,R),C}for(L=r(f,L);R<m.length;R++)H=v(L,f,R,m[R],x),H!==null&&(e&&H.alternate!==null&&L.delete(H.key===null?R:H.key),h=i(H,h,R),F===null?C=H:F.sibling=H,F=H);return e&&L.forEach(function(Ce){return t(f,Ce)}),he&&Nn(f,R),C}function w(f,h,m,x){var C=Tr(m);if(typeof C!="function")throw Error(S(150));if(m=C.call(m),m==null)throw Error(S(151));for(var F=C=null,L=h,R=h=0,H=null,z=m.next();L!==null&&!z.done;R++,z=m.next()){L.index>R?(H=L,L=null):H=L.sibling;var Ce=g(f,L,z.value,x);if(Ce===null){L===null&&(L=H);break}e&&L&&Ce.alternate===null&&t(f,L),h=i(Ce,h,R),F===null?C=Ce:F.sibling=Ce,F=Ce,L=H}if(z.done)return n(f,L),he&&Nn(f,R),C;if(L===null){for(;!z.done;R++,z=m.next())z=p(f,z.value,x),z!==null&&(h=i(z,h,R),F===null?C=z:F.sibling=z,F=z);return he&&Nn(f,R),C}for(L=r(f,L);!z.done;R++,z=m.next())z=v(L,f,R,z.value,x),z!==null&&(e&&z.alternate!==null&&L.delete(z.key===null?R:z.key),h=i(z,h,R),F===null?C=z:F.sibling=z,F=z);return e&&L.forEach(function(tt){return t(f,tt)}),he&&Nn(f,R),C}function V(f,h,m,x){if(typeof m=="object"&&m!==null&&m.type===Xn&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Po:e:{for(var C=m.key,F=h;F!==null;){if(F.key===C){if(C=m.type,C===Xn){if(F.tag===7){n(f,F.sibling),h=o(F,m.props.children),h.return=f,f=h;break e}}else if(F.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===nn&&Yu(C)===F.type){n(f,F.sibling),h=o(F,m.props),h.ref=Lr(f,F,m),h.return=f,f=h;break e}n(f,F);break}else t(f,F);F=F.sibling}m.type===Xn?(h=Ln(m.props.children,f.mode,x,m.key),h.return=f,f=h):(x=ri(m.type,m.key,m.props,null,f.mode,x),x.ref=Lr(f,h,m),x.return=f,f=x)}return a(f);case Qn:e:{for(F=m.key;h!==null;){if(h.key===F)if(h.tag===4&&h.stateNode.containerInfo===m.containerInfo&&h.stateNode.implementation===m.implementation){n(f,h.sibling),h=o(h,m.children||[]),h.return=f,f=h;break e}else{n(f,h);break}else t(f,h);h=h.sibling}h=Oa(m,f.mode,x),h.return=f,f=h}return a(f);case nn:return F=m._init,V(f,h,F(m._payload),x)}if(zr(m))return b(f,h,m,x);if(Tr(m))return w(f,h,m,x);Bo(f,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,h!==null&&h.tag===6?(n(f,h.sibling),h=o(h,m),h.return=f,f=h):(n(f,h),h=Ra(m,f.mode,x),h.return=f,f=h),a(f)):n(f,h)}return V}var mr=yd(!0),wd=yd(!1),vi=xn(null),yi=null,or=null,Kl=null;function Yl(){Kl=or=yi=null}function Ql(e){var t=vi.current;pe(vi),e._currentValue=t}function dl(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 dr(e,t){yi=e,Kl=or=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xe=!0),e.firstContext=null)}function gt(e){var t=e._currentValue;if(Kl!==e)if(e={context:e,memoizedValue:t,next:null},or===null){if(yi===null)throw Error(S(308));or=e,yi.dependencies={lanes:0,firstContext:e}}else or=or.next=e;return t}var Pn=null;function Xl(e){Pn===null?Pn=[e]:Pn.push(e)}function xd(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Xl(t)):(n.next=o.next,o.next=n),t.interleaved=n,Qt(e,r)}function Qt(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 rn=!1;function Jl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function kd(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 Vt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ne&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Qt(e,n)}return o=r.interleaved,o===null?(t.next=t,Xl(r)):(t.next=o.next,o.next=t),r.interleaved=t,Qt(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,Al(e,n)}}function Qu(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 wi(e,t,n,r){var o=e.updateQueue;rn=!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 g=u.lane,v=u.eventTime;if((r&g)===g){d!==null&&(d=d.next={eventTime:v,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var b=e,w=u;switch(g=t,v=n,w.tag){case 1:if(b=w.payload,typeof b=="function"){p=b.call(v,p,g);break e}p=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=w.payload,g=typeof b=="function"?b.call(v,p,g):b,g==null)break e;p=ye({},p,g);break e;case 2:rn=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,g=o.effects,g===null?o.effects=[u]:g.push(u))}else v={eventTime:v,lane:g,tag:u.tag,payload:u.payload,callback:u.callback,next:null},d===null?(c=d=v,s=p):d=d.next=v,a|=g;if(u=u.next,u===null){if(u=o.shared.pending,u===null)break;g=u,u=g.next,g.next=null,o.lastBaseUpdate=g,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);An|=a,e.lanes=a,e.memoizedState=p}}function Xu(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(S(191,o));o.call(r)}}}var mo={},Ot=xn(mo),ao=xn(mo),lo=xn(mo);function Mn(e){if(e===mo)throw Error(S(174));return e}function ql(e,t){switch(ce(lo,t),ce(ao,e),ce(Ot,mo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ga(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ga(t,e)}pe(Ot),ce(Ot,t)}function vr(){pe(Ot),pe(ao),pe(lo)}function bd(e){Mn(lo.current);var t=Mn(Ot.current),n=Ga(t,e.type);t!==n&&(ce(ao,e),ce(Ot,n))}function Zl(e){ao.current===e&&(pe(Ot),pe(ao))}var me=xn(0);function xi(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 Ta=[];function es(){for(var e=0;e<Ta.length;e++)Ta[e]._workInProgressVersionPrimary=null;Ta.length=0}var qo=Jt.ReactCurrentDispatcher,Pa=Jt.ReactCurrentBatchConfig,On=0,ve=null,Me=null,Ie=null,ki=!1,Gr=!1,so=0,qh=0;function je(){throw Error(S(321))}function ts(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Nt(e[n],t[n]))return!1;return!0}function ns(e,t,n,r,o,i){if(On=i,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,qo.current=e===null||e.memoizedState===null?ng:rg,e=n(r,o),Gr){i=0;do{if(Gr=!1,so=0,25<=i)throw Error(S(301));i+=1,Ie=Me=null,t.updateQueue=null,qo.current=og,e=n(r,o)}while(Gr)}if(qo.current=bi,t=Me!==null&&Me.next!==null,On=0,Ie=Me=ve=null,ki=!1,t)throw Error(S(300));return e}function rs(){var e=so!==0;return so=0,e}function Lt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ie===null?ve.memoizedState=Ie=e:Ie=Ie.next=e,Ie}function mt(){if(Me===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=Me.next;var t=Ie===null?ve.memoizedState:Ie.next;if(t!==null)Ie=t,Me=e;else{if(e===null)throw Error(S(310));Me=e,e={memoizedState:Me.memoizedState,baseState:Me.baseState,baseQueue:Me.baseQueue,queue:Me.queue,next:null},Ie===null?ve.memoizedState=Ie=e:Ie=Ie.next=e}return Ie}function uo(e,t){return typeof t=="function"?t(e):t}function Ma(e){var t=mt(),n=t.queue;if(n===null)throw Error(S(311));n.lastRenderedReducer=e;var r=Me,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((On&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,ve.lanes|=d,An|=d}c=c.next}while(c!==null&&c!==i);s===null?a=r:s.next=u,Nt(r,t.memoizedState)||(Xe=!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,ve.lanes|=i,An|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Fa(e){var t=mt(),n=t.queue;if(n===null)throw Error(S(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);Nt(i,t.memoizedState)||(Xe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function _d(){}function Sd(e,t){var n=ve,r=mt(),o=t(),i=!Nt(r.memoizedState,o);if(i&&(r.memoizedState=o,Xe=!0),r=r.queue,os(Ed.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ie!==null&&Ie.memoizedState.tag&1){if(n.flags|=2048,co(9,Nd.bind(null,n,r,o,t),void 0,null),Re===null)throw Error(S(349));On&30||Cd(n,t,o)}return o}function Cd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Nd(e,t,n,r){t.value=n,t.getSnapshot=r,Td(t)&&Pd(e)}function Ed(e,t,n){return n(function(){Td(t)&&Pd(e)})}function Td(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Nt(e,n)}catch{return!0}}function Pd(e){var t=Qt(e,1);t!==null&&Ct(t,e,1,-1)}function Ju(e){var t=Lt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:uo,lastRenderedState:e},t.queue=e,e=e.dispatch=tg.bind(null,ve,e),[t.memoizedState,e]}function co(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.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 Md(){return mt().memoizedState}function Zo(e,t,n,r){var o=Lt();ve.flags|=e,o.memoizedState=co(1|t,n,void 0,r===void 0?null:r)}function Ri(e,t,n,r){var o=mt();r=r===void 0?null:r;var i=void 0;if(Me!==null){var a=Me.memoizedState;if(i=a.destroy,r!==null&&ts(r,a.deps)){o.memoizedState=co(t,n,i,r);return}}ve.flags|=e,o.memoizedState=co(1|t,n,i,r)}function qu(e,t){return Zo(8390656,8,e,t)}function os(e,t){return Ri(2048,8,e,t)}function Fd(e,t){return Ri(4,2,e,t)}function Ld(e,t){return Ri(4,4,e,t)}function Id(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 Rd(e,t,n){return n=n!=null?n.concat([e]):null,Ri(4,4,Id.bind(null,t,e),n)}function is(){}function Od(e,t){var n=mt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ts(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ad(e,t){var n=mt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ts(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function zd(e,t,n){return On&21?(Nt(n,t)||(n=$c(),ve.lanes|=n,An|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Xe=!0),e.memoizedState=n)}function Zh(e,t){var n=ie;ie=n!==0&&4>n?n:4,e(!0);var r=Pa.transition;Pa.transition={};try{e(!1),t()}finally{ie=n,Pa.transition=r}}function Dd(){return mt().memoizedState}function eg(e,t,n){var r=gn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Wd(e))jd(t,n);else if(n=xd(e,t,n,r),n!==null){var o=Ke();Ct(n,e,r,o),Ud(n,t,r)}}function tg(e,t,n){var r=gn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wd(e))jd(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,Nt(u,a)){var s=t.interleaved;s===null?(o.next=o,Xl(t)):(o.next=s.next,s.next=o),t.interleaved=o;return}}catch{}finally{}n=xd(e,t,o,r),n!==null&&(o=Ke(),Ct(n,e,r,o),Ud(n,t,r))}}function Wd(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function jd(e,t){Gr=ki=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ud(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Al(e,n)}}var bi={readContext:gt,useCallback:je,useContext:je,useEffect:je,useImperativeHandle:je,useInsertionEffect:je,useLayoutEffect:je,useMemo:je,useReducer:je,useRef:je,useState:je,useDebugValue:je,useDeferredValue:je,useTransition:je,useMutableSource:je,useSyncExternalStore:je,useId:je,unstable_isNewReconciler:!1},ng={readContext:gt,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:qu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Zo(4194308,4,Id.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zo(4,2,e,t)},useMemo:function(e,t){var n=Lt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Lt();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=eg.bind(null,ve,e),[r.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:Ju,useDebugValue:is,useDeferredValue:function(e){return Lt().memoizedState=e},useTransition:function(){var e=Ju(!1),t=e[0];return e=Zh.bind(null,e[1]),Lt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ve,o=Lt();if(he){if(n===void 0)throw Error(S(407));n=n()}else{if(n=t(),Re===null)throw Error(S(349));On&30||Cd(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,qu(Ed.bind(null,r,i,e),[e]),r.flags|=2048,co(9,Nd.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Lt(),t=Re.identifierPrefix;if(he){var n=Gt,r=Bt;n=(r&~(1<<32-St(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=so++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=qh++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},rg={readContext:gt,useCallback:Od,useContext:gt,useEffect:os,useImperativeHandle:Rd,useInsertionEffect:Fd,useLayoutEffect:Ld,useMemo:Ad,useReducer:Ma,useRef:Md,useState:function(){return Ma(uo)},useDebugValue:is,useDeferredValue:function(e){var t=mt();return zd(t,Me.memoizedState,e)},useTransition:function(){var e=Ma(uo)[0],t=mt().memoizedState;return[e,t]},useMutableSource:_d,useSyncExternalStore:Sd,useId:Dd,unstable_isNewReconciler:!1},og={readContext:gt,useCallback:Od,useContext:gt,useEffect:os,useImperativeHandle:Rd,useInsertionEffect:Fd,useLayoutEffect:Ld,useMemo:Ad,useReducer:Fa,useRef:Md,useState:function(){return Fa(uo)},useDebugValue:is,useDeferredValue:function(e){var t=mt();return Me===null?t.memoizedState=e:zd(t,Me.memoizedState,e)},useTransition:function(){var e=Fa(uo)[0],t=mt().memoizedState;return[e,t]},useMutableSource:_d,useSyncExternalStore:Sd,useId:Dd,unstable_isNewReconciler:!1};function kt(e,t){if(e&&e.defaultProps){t=ye({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function pl(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ye({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Oi={isMounted:function(e){return(e=e._reactInternals)?Wn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ke(),o=gn(e),i=Vt(r,o);i.payload=t,n!=null&&(i.callback=n),t=fn(e,i,o),t!==null&&(Ct(t,e,o,r),Jo(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ke(),o=gn(e),i=Vt(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=fn(e,i,o),t!==null&&(Ct(t,e,o,r),Jo(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ke(),r=gn(e),o=Vt(n,r);o.tag=2,t!=null&&(o.callback=t),t=fn(e,o,r),t!==null&&(Ct(t,e,r,n),Jo(t,e,r))}};function Zu(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?!no(n,r)||!no(o,i):!0}function $d(e,t,n){var r=!1,o=yn,i=t.contextType;return typeof i=="object"&&i!==null?i=gt(i):(o=qe(t)?In:He.current,r=t.contextTypes,i=(r=r!=null)?hr(e,o):yn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Oi,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function ec(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&&Oi.enqueueReplaceState(t,t.state,null)}function fl(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=gt(i):(i=qe(t)?In:He.current,o.context=hr(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(pl(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&&Oi.enqueueReplaceState(o,o.state,null),wi(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function yr(e,t){try{var n="",r=t;do n+=Rf(r),r=r.return;while(r);var o=n}catch(i){o=`
7
7
  Error generating stack: `+i.message+`
8
- `+i.stack}return{value:e,source:t,stack:o,digest:null}}function Fa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function fl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ig=typeof WeakMap=="function"?WeakMap:Map;function Hd(e,t,n){n=Vt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_i||(_i=!0,_l=r),fl(e,t)},n}function Bd(e,t,n){n=Vt(-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(){fl(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){fl(e,t),typeof r!="function"&&(hn===null?hn=new Set([this]):hn.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function tc(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=wg.bind(null,e,t,n),t.then(e,e))}function nc(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 rc(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=Vt(-1,1),t.tag=2,fn(n,t,1))),n.lanes|=1),e)}var ag=Jt.ReactCurrentOwner,Xe=!1;function Ve(e,t,n,r){t.child=e===null?wd(t,null,n,r):mr(t,e.child,n,r)}function oc(e,t,n,r,o){n=n.render;var i=t.ref;return dr(t,o),r=ts(e,t,n,r,i,o),n=ns(),e!==null&&!Xe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Xt(e,t,o)):(he&&n&&Hl(t),t.flags|=1,Ve(e,t,r,o),t.child)}function ic(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!ps(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Gd(e,t,i,r,o)):(e=ni(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:no,n(a,r)&&e.ref===t.ref)return Xt(e,t,o)}return t.flags|=1,e=mn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Gd(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(no(i,r)&&e.ref===t.ref)if(Xe=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Xe=!0);else return t.lanes=e.lanes,Xt(e,t,o)}return hl(e,t,n,r,o)}function Vd(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},ce(ar,ot),ot|=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,ce(ar,ot),ot|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ce(ar,ot),ot|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ce(ar,ot),ot|=r;return Ve(e,t,o,n),t.child}function Kd(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function hl(e,t,n,r,o){var i=qe(n)?In:He.current;return i=hr(t,i),dr(t,o),n=ts(e,t,n,r,i,o),r=ns(),e!==null&&!Xe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Xt(e,t,o)):(he&&r&&Hl(t),t.flags|=1,Ve(e,t,n,o),t.child)}function ac(e,t,n,r,o){if(qe(n)){var i=!0;fi(t)}else i=!1;if(dr(t,o),t.stateNode===null)Zo(e,t),$d(t,n,r),pl(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=gt(c):(c=qe(n)?In:He.current,c=hr(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)&&ec(t,a,r,c),rn=!1;var g=t.memoizedState;a.state=g,yi(t,r,a,o),s=t.memoizedState,u!==r||g!==s||Je.current||rn?(typeof d=="function"&&(dl(t,n,d,r),s=t.memoizedState),(u=rn||Zu(t,n,u,r,g,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,kd(e,t),u=t.memoizedProps,c=t.type===t.elementType?u:kt(t.type,u),a.props=c,p=t.pendingProps,g=a.context,s=n.contextType,typeof s=="object"&&s!==null?s=gt(s):(s=qe(n)?In:He.current,s=hr(t,s));var v=n.getDerivedStateFromProps;(d=typeof v=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u!==p||g!==s)&&ec(t,a,r,s),rn=!1,g=t.memoizedState,a.state=g,yi(t,r,a,o);var b=t.memoizedState;u!==p||g!==b||Je.current||rn?(typeof v=="function"&&(dl(t,n,v,r),b=t.memoizedState),(c=rn||Zu(t,n,c,r,g,b,s)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,b,s),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,b,s)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||u===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),a.props=r,a.state=b,a.context=s,r=c):(typeof a.componentDidUpdate!="function"||u===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),r=!1)}return gl(e,t,n,r,i,o)}function gl(e,t,n,r,o,i){Kd(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&Gu(t,n,!1),Xt(e,t,i);r=t.stateNode,ag.current=t;var u=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=mr(t,e.child,null,i),t.child=mr(t,null,u,i)):Ve(e,t,u,i),t.memoizedState=r.state,o&&Gu(t,n,!0),t.child}function Yd(e){var t=e.stateNode;t.pendingContext?Bu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Bu(e,t.context,!1),Jl(e,t.containerInfo)}function lc(e,t,n,r,o){return gr(),Gl(o),t.flags|=256,Ve(e,t,n,r),t.child}var ml={dehydrated:null,treeContext:null,retryLane:0};function vl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qd(e,t,n){var r=t.pendingProps,o=me.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),ce(me,o&1),e===null)return ul(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=zi(a,r,0,null),e=Ln(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=vl(n),t.memoizedState=ml,e):is(t,a));if(o=e.memoizedState,o!==null&&(u=o.dehydrated,u!==null))return lg(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=mn(o,s),r.subtreeFlags=o.subtreeFlags&14680064),u!==null?i=mn(u,i):(i=Ln(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?vl(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=ml,r}return i=e.child,e=i.sibling,r=mn(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 is(e,t){return t=zi({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Bo(e,t,n,r){return r!==null&&Gl(r),mr(t,e.child,null,n),e=is(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lg(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=Fa(Error(S(422))),Bo(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=zi({mode:"visible",children:r.children},o,0,null),i=Ln(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&mr(t,e.child,null,a),t.child.memoizedState=vl(a),t.memoizedState=ml,i);if(!(t.mode&1))return Bo(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var u=r.dgst;return r=u,i=Error(S(419)),r=Fa(i,r,void 0),Bo(e,t,a,r)}if(u=(a&e.childLanes)!==0,Xe||u){if(r=Re,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,Qt(e,o),Ct(r,e,o,-1))}return ds(),r=Fa(Error(S(421))),Bo(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=xg.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,it=pn(o.nextSibling),at=t,he=!0,_t=null,e!==null&&(dt[pt++]=Bt,dt[pt++]=Gt,dt[pt++]=Rn,Bt=e.id,Gt=e.overflow,Rn=t),t=is(t,r.children),t.flags|=4096,t)}function sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),cl(e.return,t,n)}function La(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 Xd(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Ve(e,t,r.children,n),r=me.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&&sc(e,n,t);else if(e.tag===19)sc(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(ce(me,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&&wi(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),La(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&&wi(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}La(t,!0,n,null,i);break;case"together":La(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Zo(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Xt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),An|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(S(153));if(t.child!==null){for(e=t.child,n=mn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=mn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sg(e,t,n){switch(t.tag){case 3:Yd(t),gr();break;case 5:bd(t);break;case 1:qe(t.type)&&fi(t);break;case 4:Jl(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ce(mi,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ce(me,me.current&1),t.flags|=128,null):n&t.child.childLanes?Qd(e,t,n):(ce(me,me.current&1),e=Xt(e,t,n),e!==null?e.sibling:null);ce(me,me.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Xd(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ce(me,me.current),r)break;return null;case 22:case 23:return t.lanes=0,Vd(e,t,n)}return Xt(e,t,n)}var Jd,yl,qd,Zd;Jd=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}};yl=function(){};qd=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Mn(Ot.current);var i=null;switch(n){case"input":o=ja(e,o),r=ja(e,r),i=[];break;case"select":o=ye({},o,{value:void 0}),r=ye({},r,{value:void 0}),i=[];break;case"textarea":o=Ha(e,o),r=Ha(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=di)}Ga(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"&&(Qr.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"&&(Qr.hasOwnProperty(c)?(s!=null&&c==="onScroll"&&de("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)}};Zd=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ir(e,t){if(!he)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 Ue(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 ug(e,t,n){var r=t.pendingProps;switch(Bl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(t),null;case 1:return qe(t.type)&&pi(),Ue(t),null;case 3:return r=t.stateNode,vr(),pe(Je),pe(He),Zl(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&($o(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,_t!==null&&(Nl(_t),_t=null))),yl(e,t),Ue(t),null;case 5:ql(t);var o=Mn(lo.current);if(n=t.type,e!==null&&t.stateNode!=null)qd(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(S(166));return Ue(t),null}if(e=Mn(Ot.current),$o(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[It]=t,r[io]=i,e=(t.mode&1)!==0,n){case"dialog":de("cancel",r),de("close",r);break;case"iframe":case"object":case"embed":de("load",r);break;case"video":case"audio":for(o=0;o<Wr.length;o++)de(Wr[o],r);break;case"source":de("error",r);break;case"img":case"image":case"link":de("error",r),de("load",r);break;case"details":de("toggle",r);break;case"input":mu(r,i),de("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},de("invalid",r);break;case"textarea":yu(r,i),de("invalid",r)}Ga(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&&Uo(r.textContent,u,e),o=["children",u]):typeof u=="number"&&r.textContent!==""+u&&(i.suppressHydrationWarning!==!0&&Uo(r.textContent,u,e),o=["children",""+u]):Qr.hasOwnProperty(a)&&u!=null&&a==="onScroll"&&de("scroll",r)}switch(n){case"input":Po(r),vu(r,i,!0);break;case"textarea":Po(r),wu(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=di)}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=Ec(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[It]=t,e[io]=r,Jd(e,t,!1,!1),t.stateNode=e;e:{switch(a=Va(n,r),n){case"dialog":de("cancel",e),de("close",e),o=r;break;case"iframe":case"object":case"embed":de("load",e),o=r;break;case"video":case"audio":for(o=0;o<Wr.length;o++)de(Wr[o],e);o=r;break;case"source":de("error",e),o=r;break;case"img":case"image":case"link":de("error",e),de("load",e),o=r;break;case"details":de("toggle",e),o=r;break;case"input":mu(e,r),o=ja(e,r),de("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ye({},r,{value:void 0}),de("invalid",e);break;case"textarea":yu(e,r),o=Ha(e,r),de("invalid",e);break;default:o=r}Ga(n,o),u=o;for(i in u)if(u.hasOwnProperty(i)){var s=u[i];i==="style"?Mc(e,s):i==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,s!=null&&Tc(e,s)):i==="children"?typeof s=="string"?(n!=="textarea"||s!=="")&&Xr(e,s):typeof s=="number"&&Xr(e,""+s):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Qr.hasOwnProperty(i)?s!=null&&i==="onScroll"&&de("scroll",e):s!=null&&Pl(e,i,s,a))}switch(n){case"input":Po(e),vu(e,r,!1);break;case"textarea":Po(e),wu(e);break;case"option":r.value!=null&&e.setAttribute("value",""+vn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?lr(e,!!r.multiple,i,!1):r.defaultValue!=null&&lr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=di)}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 Ue(t),null;case 6:if(e&&t.stateNode!=null)Zd(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(S(166));if(n=Mn(lo.current),Mn(Ot.current),$o(t)){if(r=t.stateNode,n=t.memoizedProps,r[It]=t,(i=r.nodeValue!==n)&&(e=at,e!==null))switch(e.tag){case 3:Uo(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Uo(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[It]=t,t.stateNode=r}return Ue(t),null;case 13:if(pe(me),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(he&&it!==null&&t.mode&1&&!(t.flags&128))vd(),gr(),t.flags|=98560,i=!1;else if(i=$o(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(S(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(S(317));i[It]=t}else gr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ue(t),i=!1}else _t!==null&&(Nl(_t),_t=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||me.current&1?Fe===0&&(Fe=3):ds())),t.updateQueue!==null&&(t.flags|=4),Ue(t),null);case 4:return vr(),yl(e,t),e===null&&ro(t.stateNode.containerInfo),Ue(t),null;case 10:return Yl(t.type._context),Ue(t),null;case 17:return qe(t.type)&&pi(),Ue(t),null;case 19:if(pe(me),i=t.memoizedState,i===null)return Ue(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)Ir(i,!1);else{if(Fe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=wi(e),a!==null){for(t.flags|=128,Ir(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 ce(me,me.current&1|2),t.child}e=e.sibling}i.tail!==null&&_e()>wr&&(t.flags|=128,r=!0,Ir(i,!1),t.lanes=4194304)}else{if(!r)if(e=wi(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ir(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!he)return Ue(t),null}else 2*_e()-i.renderingStartTime>wr&&n!==1073741824&&(t.flags|=128,r=!0,Ir(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=_e(),t.sibling=null,n=me.current,ce(me,r?n&1|2:n&1),t):(Ue(t),null);case 22:case 23:return cs(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ot&1073741824&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),null;case 24:return null;case 25:return null}throw Error(S(156,t.tag))}function cg(e,t){switch(Bl(t),t.tag){case 1:return qe(t.type)&&pi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vr(),pe(Je),pe(He),Zl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ql(t),null;case 13:if(pe(me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(S(340));gr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(me),null;case 4:return vr(),null;case 10:return Yl(t.type._context),null;case 22:case 23:return cs(),null;case 24:return null;default:return null}}var Go=!1,$e=!1,dg=typeof WeakSet=="function"?WeakSet:Set,P=null;function ir(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xe(e,t,r)}else n.current=null}function wl(e,t,n){try{n()}catch(r){xe(e,t,r)}}var uc=!1;function pg(e,t){if(nl=si,e=od(),$l(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,g=null;t:for(;;){for(var v;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),(v=p.firstChild)!==null;)g=p,p=v;for(;;){if(p===e)break t;if(g===n&&++c===o&&(u=a),g===i&&++d===r&&(s=a),(v=p.nextSibling)!==null)break;p=g,g=p.parentNode}p=v}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(rl={focusedElem:e,selectionRange:n},si=!1,P=t;P!==null;)if(t=P,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,P=e;else for(;P!==null;){t=P;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var w=b.memoizedProps,G=b.memoizedState,f=t.stateNode,h=f.getSnapshotBeforeUpdate(t.elementType===t.type?w:kt(t.type,w),G);f.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(S(163))}}catch(x){xe(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,P=e;break}P=t.return}return b=uc,uc=!1,b}function Vr(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&&wl(t,n,i)}o=o.next}while(o!==r)}}function Oi(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 xl(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 ep(e){var t=e.alternate;t!==null&&(e.alternate=null,ep(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[It],delete t[io],delete t[al],delete t[Yh],delete t[Qh])),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 tp(e){return e.tag===5||e.tag===3||e.tag===4}function cc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tp(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 kl(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=di));else if(r!==4&&(e=e.child,e!==null))for(kl(e,t,n),e=e.sibling;e!==null;)kl(e,t,n),e=e.sibling}function bl(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(bl(e,t,n),e=e.sibling;e!==null;)bl(e,t,n),e=e.sibling}var Oe=null,bt=!1;function tn(e,t,n){for(n=n.child;n!==null;)np(e,t,n),n=n.sibling}function np(e,t,n){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(Ei,n)}catch{}switch(n.tag){case 5:$e||ir(n,t);case 6:var r=Oe,o=bt;Oe=null,tn(e,t,n),Oe=r,bt=o,Oe!==null&&(bt?(e=Oe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Oe.removeChild(n.stateNode));break;case 18:Oe!==null&&(bt?(e=Oe,n=n.stateNode,e.nodeType===8?Ca(e.parentNode,n):e.nodeType===1&&Ca(e,n),eo(e)):Ca(Oe,n.stateNode));break;case 4:r=Oe,o=bt,Oe=n.stateNode.containerInfo,bt=!0,tn(e,t,n),Oe=r,bt=o;break;case 0:case 11:case 14:case 15:if(!$e&&(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)&&wl(n,t,a),o=o.next}while(o!==r)}tn(e,t,n);break;case 1:if(!$e&&(ir(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){xe(n,t,u)}tn(e,t,n);break;case 21:tn(e,t,n);break;case 22:n.mode&1?($e=(r=$e)||n.memoizedState!==null,tn(e,t,n),$e=r):tn(e,t,n);break;default:tn(e,t,n)}}function dc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new dg),t.forEach(function(r){var o=kg.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function xt(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:Oe=u.stateNode,bt=!1;break e;case 3:Oe=u.stateNode.containerInfo,bt=!0;break e;case 4:Oe=u.stateNode.containerInfo,bt=!0;break e}u=u.return}if(Oe===null)throw Error(S(160));np(i,a,o),Oe=null,bt=!1;var s=o.alternate;s!==null&&(s.return=null),o.return=null}catch(c){xe(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)rp(t,e),t=t.sibling}function rp(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xt(t,e),Ft(e),r&4){try{Vr(3,e,e.return),Oi(3,e)}catch(w){xe(e,e.return,w)}try{Vr(5,e,e.return)}catch(w){xe(e,e.return,w)}}break;case 1:xt(t,e),Ft(e),r&512&&n!==null&&ir(n,n.return);break;case 5:if(xt(t,e),Ft(e),r&512&&n!==null&&ir(n,n.return),e.flags&32){var o=e.stateNode;try{Xr(o,"")}catch(w){xe(e,e.return,w)}}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&&Cc(o,i),Va(u,a);var c=Va(u,i);for(a=0;a<s.length;a+=2){var d=s[a],p=s[a+1];d==="style"?Mc(o,p):d==="dangerouslySetInnerHTML"?Tc(o,p):d==="children"?Xr(o,p):Pl(o,d,p,c)}switch(u){case"input":Ua(o,i);break;case"textarea":Nc(o,i);break;case"select":var g=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var v=i.value;v!=null?lr(o,!!i.multiple,v,!1):g!==!!i.multiple&&(i.defaultValue!=null?lr(o,!!i.multiple,i.defaultValue,!0):lr(o,!!i.multiple,i.multiple?[]:"",!1))}o[io]=i}catch(w){xe(e,e.return,w)}}break;case 6:if(xt(t,e),Ft(e),r&4){if(e.stateNode===null)throw Error(S(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(w){xe(e,e.return,w)}}break;case 3:if(xt(t,e),Ft(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{eo(t.containerInfo)}catch(w){xe(e,e.return,w)}break;case 4:xt(t,e),Ft(e);break;case 13:xt(t,e),Ft(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(ss=_e())),r&4&&dc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?($e=(c=$e)||d,xt(t,e),$e=c):xt(t,e),Ft(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(P=e,d=e.child;d!==null;){for(p=P=d;P!==null;){switch(g=P,v=g.child,g.tag){case 0:case 11:case 14:case 15:Vr(4,g,g.return);break;case 1:ir(g,g.return);var b=g.stateNode;if(typeof b.componentWillUnmount=="function"){r=g,n=g.return;try{t=r,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(w){xe(r,n,w)}}break;case 5:ir(g,g.return);break;case 22:if(g.memoizedState!==null){fc(p);continue}}v!==null?(v.return=g,P=v):fc(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=Pc("display",a))}catch(w){xe(e,e.return,w)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=c?"":p.memoizedProps}catch(w){xe(e,e.return,w)}}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:xt(t,e),Ft(e),r&4&&dc(e);break;case 21:break;default:xt(t,e),Ft(e)}}function Ft(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(tp(n)){var r=n;break e}n=n.return}throw Error(S(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Xr(o,""),r.flags&=-33);var i=cc(e);bl(e,i,o);break;case 3:case 4:var a=r.stateNode.containerInfo,u=cc(e);kl(e,u,a);break;default:throw Error(S(161))}}catch(s){xe(e,e.return,s)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function fg(e,t,n){P=e,op(e,t,n)}function op(e,t,n){for(var r=(e.mode&1)!==0;P!==null;){var o=P,i=o.child;if(o.tag===22&&r){var a=o.memoizedState!==null||Go;if(!a){var u=o.alternate,s=u!==null&&u.memoizedState!==null||$e;u=Go;var c=$e;if(Go=a,($e=s)&&!c)for(P=o;P!==null;)a=P,s=a.child,a.tag===22&&a.memoizedState!==null?hc(o):s!==null?(s.return=a,P=s):hc(o);for(;i!==null;)P=i,op(i,t,n),i=i.sibling;P=o,Go=u,$e=c}pc(e,t,n)}else o.subtreeFlags&8772&&i!==null?(i.return=o,P=i):pc(e,t,n)}}function pc(e){for(;P!==null;){var t=P;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:$e||Oi(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!$e)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:kt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Xu(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}Xu(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&&eo(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(S(163))}$e||t.flags&512&&xl(t)}catch(g){xe(t,t.return,g)}}if(t===e){P=null;break}if(n=t.sibling,n!==null){n.return=t.return,P=n;break}P=t.return}}function fc(e){for(;P!==null;){var t=P;if(t===e){P=null;break}var n=t.sibling;if(n!==null){n.return=t.return,P=n;break}P=t.return}}function hc(e){for(;P!==null;){var t=P;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Oi(4,t)}catch(s){xe(t,n,s)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(s){xe(t,o,s)}}var i=t.return;try{xl(t)}catch(s){xe(t,i,s)}break;case 5:var a=t.return;try{xl(t)}catch(s){xe(t,a,s)}}}catch(s){xe(t,t.return,s)}if(t===e){P=null;break}var u=t.sibling;if(u!==null){u.return=t.return,P=u;break}P=t.return}}var hg=Math.ceil,bi=Jt.ReactCurrentDispatcher,as=Jt.ReactCurrentOwner,ht=Jt.ReactCurrentBatchConfig,te=0,Re=null,Ne=null,Ae=0,ot=0,ar=xn(0),Fe=0,po=null,An=0,Ai=0,ls=0,Kr=null,Qe=null,ss=0,wr=1/0,$t=null,_i=!1,_l=null,hn=null,Vo=!1,sn=null,Si=0,Yr=0,Sl=null,ei=-1,ti=0;function Ke(){return te&6?_e():ei!==-1?ei:ei=_e()}function gn(e){return e.mode&1?te&2&&Ae!==0?Ae&-Ae:Jh.transition!==null?(ti===0&&(ti=$c()),ti):(e=ie,e!==0||(e=window.event,e=e===void 0?16:Qc(e.type)),e):1}function Ct(e,t,n,r){if(50<Yr)throw Yr=0,Sl=null,Error(S(185));fo(e,n,r),(!(te&2)||e!==Re)&&(e===Re&&(!(te&2)&&(Ai|=n),Fe===4&&an(e,Ae)),Ze(e,r),n===1&&te===0&&!(t.mode&1)&&(wr=_e()+500,Li&&kn()))}function Ze(e,t){var n=e.callbackNode;Zf(e,t);var r=li(e,e===Re?Ae:0);if(r===0)n!==null&&bu(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&bu(n),t===1)e.tag===0?Xh(gc.bind(null,e)):hd(gc.bind(null,e)),Vh(function(){!(te&6)&&kn()}),n=null;else{switch(Hc(r)){case 1:n=Rl;break;case 4:n=jc;break;case 16:n=ai;break;case 536870912:n=Uc;break;default:n=ai}n=pp(n,ip.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ip(e,t){if(ei=-1,ti=0,te&6)throw Error(S(327));var n=e.callbackNode;if(pr()&&e.callbackNode!==n)return null;var r=li(e,e===Re?Ae:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ci(e,r);else{t=r;var o=te;te|=2;var i=lp();(Re!==e||Ae!==t)&&($t=null,wr=_e()+500,Fn(e,t));do try{vg();break}catch(u){ap(e,u)}while(1);Kl(),bi.current=i,te=o,Ne!==null?t=0:(Re=null,Ae=0,t=Fe)}if(t!==0){if(t===2&&(o=Ja(e),o!==0&&(r=o,t=Cl(e,o))),t===1)throw n=po,Fn(e,0),an(e,r),Ze(e,_e()),n;if(t===6)an(e,r);else{if(o=e.current.alternate,!(r&30)&&!gg(o)&&(t=Ci(e,r),t===2&&(i=Ja(e),i!==0&&(r=i,t=Cl(e,i))),t===1))throw n=po,Fn(e,0),an(e,r),Ze(e,_e()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(S(345));case 2:En(e,Qe,$t);break;case 3:if(an(e,r),(r&130023424)===r&&(t=ss+500-_e(),10<t)){if(li(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ke(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=il(En.bind(null,e,Qe,$t),t);break}En(e,Qe,$t);break;case 4:if(an(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-St(r);i=1<<a,a=t[a],a>o&&(o=a),r&=~i}if(r=o,r=_e()-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=il(En.bind(null,e,Qe,$t),r);break}En(e,Qe,$t);break;case 5:En(e,Qe,$t);break;default:throw Error(S(329))}}}return Ze(e,_e()),e.callbackNode===n?ip.bind(null,e):null}function Cl(e,t){var n=Kr;return e.current.memoizedState.isDehydrated&&(Fn(e,t).flags|=256),e=Ci(e,t),e!==2&&(t=Qe,Qe=n,t!==null&&Nl(t)),e}function Nl(e){Qe===null?Qe=e:Qe.push.apply(Qe,e)}function gg(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(!Nt(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 an(e,t){for(t&=~ls,t&=~Ai,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-St(t),r=1<<n;e[n]=-1,t&=~r}}function gc(e){if(te&6)throw Error(S(327));pr();var t=li(e,0);if(!(t&1))return Ze(e,_e()),null;var n=Ci(e,t);if(e.tag!==0&&n===2){var r=Ja(e);r!==0&&(t=r,n=Cl(e,r))}if(n===1)throw n=po,Fn(e,0),an(e,t),Ze(e,_e()),n;if(n===6)throw Error(S(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,En(e,Qe,$t),Ze(e,_e()),null}function us(e,t){var n=te;te|=1;try{return e(t)}finally{te=n,te===0&&(wr=_e()+500,Li&&kn())}}function zn(e){sn!==null&&sn.tag===0&&!(te&6)&&pr();var t=te;te|=1;var n=ht.transition,r=ie;try{if(ht.transition=null,ie=1,e)return e()}finally{ie=r,ht.transition=n,te=t,!(te&6)&&kn()}}function cs(){ot=ar.current,pe(ar)}function Fn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Gh(n)),Ne!==null)for(n=Ne.return;n!==null;){var r=n;switch(Bl(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&pi();break;case 3:vr(),pe(Je),pe(He),Zl();break;case 5:ql(r);break;case 4:vr();break;case 13:pe(me);break;case 19:pe(me);break;case 10:Yl(r.type._context);break;case 22:case 23:cs()}n=n.return}if(Re=e,Ne=e=mn(e.current,null),Ae=ot=t,Fe=0,po=null,ls=Ai=An=0,Qe=Kr=null,Pn!==null){for(t=0;t<Pn.length;t++)if(n=Pn[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}Pn=null}return e}function ap(e,t){do{var n=Ne;try{if(Kl(),Jo.current=ki,xi){for(var r=ve.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}xi=!1}if(On=0,Ie=Me=ve=null,Gr=!1,so=0,as.current=null,n===null||n.return===null){Fe=1,po=t,Ne=null;break}e:{var i=e,a=n.return,u=n,s=t;if(t=Ae,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 g=d.alternate;g?(d.updateQueue=g.updateQueue,d.memoizedState=g.memoizedState,d.lanes=g.lanes):(d.updateQueue=null,d.memoizedState=null)}var v=nc(a);if(v!==null){v.flags&=-257,rc(v,a,u,i,t),v.mode&1&&tc(i,c,t),t=v,s=c;var b=t.updateQueue;if(b===null){var w=new Set;w.add(s),t.updateQueue=w}else b.add(s);break e}else{if(!(t&1)){tc(i,c,t),ds();break e}s=Error(S(426))}}else if(he&&u.mode&1){var G=nc(a);if(G!==null){!(G.flags&65536)&&(G.flags|=256),rc(G,a,u,i,t),Gl(yr(s,u));break e}}i=s=yr(s,u),Fe!==4&&(Fe=2),Kr===null?Kr=[i]:Kr.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var f=Hd(i,s,t);Qu(i,f);break e;case 1:u=s;var h=i.type,m=i.stateNode;if(!(i.flags&128)&&(typeof h.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(hn===null||!hn.has(m)))){i.flags|=65536,t&=-t,i.lanes|=t;var x=Bd(i,u,t);Qu(i,x);break e}}i=i.return}while(i!==null)}up(n)}catch(C){t=C,Ne===n&&n!==null&&(Ne=n=n.return);continue}break}while(1)}function lp(){var e=bi.current;return bi.current=ki,e===null?ki:e}function ds(){(Fe===0||Fe===3||Fe===2)&&(Fe=4),Re===null||!(An&268435455)&&!(Ai&268435455)||an(Re,Ae)}function Ci(e,t){var n=te;te|=2;var r=lp();(Re!==e||Ae!==t)&&($t=null,Fn(e,t));do try{mg();break}catch(o){ap(e,o)}while(1);if(Kl(),te=n,bi.current=r,Ne!==null)throw Error(S(261));return Re=null,Ae=0,Fe}function mg(){for(;Ne!==null;)sp(Ne)}function vg(){for(;Ne!==null&&!Bf();)sp(Ne)}function sp(e){var t=dp(e.alternate,e,ot);e.memoizedProps=e.pendingProps,t===null?up(e):Ne=t,as.current=null}function up(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=cg(n,t),n!==null){n.flags&=32767,Ne=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Fe=6,Ne=null;return}}else if(n=ug(n,t,ot),n!==null){Ne=n;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);Fe===0&&(Fe=5)}function En(e,t,n){var r=ie,o=ht.transition;try{ht.transition=null,ie=1,yg(e,t,n,r)}finally{ht.transition=o,ie=r}return null}function yg(e,t,n,r){do pr();while(sn!==null);if(te&6)throw Error(S(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(S(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(eh(e,i),e===Re&&(Ne=Re=null,Ae=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Vo||(Vo=!0,pp(ai,function(){return pr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=ht.transition,ht.transition=null;var a=ie;ie=1;var u=te;te|=4,as.current=null,pg(e,n),rp(n,e),jh(rl),si=!!nl,rl=nl=null,e.current=n,fg(n,e,o),Gf(),te=u,ie=a,ht.transition=i}else e.current=n;if(Vo&&(Vo=!1,sn=e,Si=o),i=e.pendingLanes,i===0&&(hn=null),Yf(n.stateNode,r),Ze(e,_e()),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(_i)throw _i=!1,e=_l,_l=null,e;return Si&1&&e.tag!==0&&pr(),i=e.pendingLanes,i&1?e===Sl?Yr++:(Yr=0,Sl=e):Yr=0,kn(),null}function pr(){if(sn!==null){var e=Hc(Si),t=ht.transition,n=ie;try{if(ht.transition=null,ie=16>e?16:e,sn===null)var r=!1;else{if(e=sn,sn=null,Si=0,te&6)throw Error(S(331));var o=te;for(te|=4,P=e.current;P!==null;){var i=P,a=i.child;if(P.flags&16){var u=i.deletions;if(u!==null){for(var s=0;s<u.length;s++){var c=u[s];for(P=c;P!==null;){var d=P;switch(d.tag){case 0:case 11:case 15:Vr(8,d,i)}var p=d.child;if(p!==null)p.return=d,P=p;else for(;P!==null;){d=P;var g=d.sibling,v=d.return;if(ep(d),d===c){P=null;break}if(g!==null){g.return=v,P=g;break}P=v}}}var b=i.alternate;if(b!==null){var w=b.child;if(w!==null){b.child=null;do{var G=w.sibling;w.sibling=null,w=G}while(w!==null)}}P=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,P=a;else e:for(;P!==null;){if(i=P,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Vr(9,i,i.return)}var f=i.sibling;if(f!==null){f.return=i.return,P=f;break e}P=i.return}}var h=e.current;for(P=h;P!==null;){a=P;var m=a.child;if(a.subtreeFlags&2064&&m!==null)m.return=a,P=m;else e:for(a=h;P!==null;){if(u=P,u.flags&2048)try{switch(u.tag){case 0:case 11:case 15:Oi(9,u)}}catch(C){xe(u,u.return,C)}if(u===a){P=null;break e}var x=u.sibling;if(x!==null){x.return=u.return,P=x;break e}P=u.return}}if(te=o,kn(),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(Ei,e)}catch{}r=!0}return r}finally{ie=n,ht.transition=t}}return!1}function mc(e,t,n){t=yr(n,t),t=Hd(e,t,1),e=fn(e,t,1),t=Ke(),e!==null&&(fo(e,1,t),Ze(e,t))}function xe(e,t,n){if(e.tag===3)mc(e,e,n);else for(;t!==null;){if(t.tag===3){mc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(hn===null||!hn.has(r))){e=yr(n,e),e=Bd(t,e,1),t=fn(t,e,1),e=Ke(),t!==null&&(fo(t,1,e),Ze(t,e));break}}t=t.return}}function wg(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ke(),e.pingedLanes|=e.suspendedLanes&n,Re===e&&(Ae&n)===n&&(Fe===4||Fe===3&&(Ae&130023424)===Ae&&500>_e()-ss?Fn(e,0):ls|=n),Ze(e,t)}function cp(e,t){t===0&&(e.mode&1?(t=Lo,Lo<<=1,!(Lo&130023424)&&(Lo=4194304)):t=1);var n=Ke();e=Qt(e,t),e!==null&&(fo(e,t,n),Ze(e,n))}function xg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),cp(e,n)}function kg(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(S(314))}r!==null&&r.delete(t),cp(e,n)}var dp;dp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Je.current)Xe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xe=!1,sg(e,t,n);Xe=!!(e.flags&131072)}else Xe=!1,he&&t.flags&1048576&&gd(t,gi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Zo(e,t),e=t.pendingProps;var o=hr(t,He.current);dr(t,n),o=ts(null,t,r,e,o,n);var i=ns();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,qe(r)?(i=!0,fi(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Xl(t),o.updater=Ri,t.stateNode=o,o._reactInternals=t,pl(t,r,e,n),t=gl(null,t,r,!0,i,n)):(t.tag=0,he&&i&&Hl(t),Ve(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Zo(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=_g(r),e=kt(r,e),o){case 0:t=hl(null,t,r,e,n);break e;case 1:t=ac(null,t,r,e,n);break e;case 11:t=oc(null,t,r,e,n);break e;case 14:t=ic(null,t,r,kt(r.type,e),n);break e}throw Error(S(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:kt(r,o),hl(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:kt(r,o),ac(e,t,r,o,n);case 3:e:{if(Yd(t),e===null)throw Error(S(387));r=t.pendingProps,i=t.memoizedState,o=i.element,kd(e,t),yi(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=yr(Error(S(423)),t),t=lc(e,t,r,n,o);break e}else if(r!==o){o=yr(Error(S(424)),t),t=lc(e,t,r,n,o);break e}else for(it=pn(t.stateNode.containerInfo.firstChild),at=t,he=!0,_t=null,n=wd(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gr(),r===o){t=Xt(e,t,n);break e}Ve(e,t,r,n)}t=t.child}return t;case 5:return bd(t),e===null&&ul(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,ol(r,o)?a=null:i!==null&&ol(r,i)&&(t.flags|=32),Kd(e,t),Ve(e,t,a,n),t.child;case 6:return e===null&&ul(t),null;case 13:return Qd(e,t,n);case 4:return Jl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mr(t,null,r,n):Ve(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:kt(r,o),oc(e,t,r,o,n);case 7:return Ve(e,t,t.pendingProps,n),t.child;case 8:return Ve(e,t,t.pendingProps.children,n),t.child;case 12:return Ve(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,ce(mi,r._currentValue),r._currentValue=a,i!==null)if(Nt(i.value,a)){if(i.children===o.children&&!Je.current){t=Xt(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=Vt(-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),cl(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(S(341));a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),cl(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}Ve(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,dr(t,n),o=gt(o),r=r(o),t.flags|=1,Ve(e,t,r,n),t.child;case 14:return r=t.type,o=kt(r,t.pendingProps),o=kt(r.type,o),ic(e,t,r,o,n);case 15:return Gd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:kt(r,o),Zo(e,t),t.tag=1,qe(r)?(e=!0,fi(t)):e=!1,dr(t,n),$d(t,r,o),pl(t,r,o,n),gl(null,t,r,!0,e,n);case 19:return Xd(e,t,n);case 22:return Vd(e,t,n)}throw Error(S(156,t.tag))};function pp(e,t){return Wc(e,t)}function bg(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 ft(e,t,n,r){return new bg(e,t,n,r)}function ps(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _g(e){if(typeof e=="function")return ps(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Fl)return 11;if(e===Ll)return 14}return 2}function mn(e,t){var n=e.alternate;return n===null?(n=ft(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 ni(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")ps(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Xn:return Ln(n.children,o,i,t);case Ml:a=8,o|=8;break;case Aa:return e=ft(12,n,t,o|2),e.elementType=Aa,e.lanes=i,e;case za:return e=ft(13,n,t,o),e.elementType=za,e.lanes=i,e;case Da:return e=ft(19,n,t,o),e.elementType=Da,e.lanes=i,e;case bc:return zi(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case xc:a=10;break e;case kc:a=9;break e;case Fl:a=11;break e;case Ll:a=14;break e;case nn:a=16,r=null;break e}throw Error(S(130,e==null?e:typeof e,""))}return t=ft(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Ln(e,t,n,r){return e=ft(7,e,r,t),e.lanes=n,e}function zi(e,t,n,r){return e=ft(22,e,r,t),e.elementType=bc,e.lanes=n,e.stateNode={isHidden:!1},e}function Ia(e,t,n){return e=ft(6,e,null,t),e.lanes=n,e}function Ra(e,t,n){return t=ft(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Sg(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=va(0),this.expirationTimes=va(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=va(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function fs(e,t,n,r,o,i,a,u,s){return e=new Sg(e,t,n,u,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ft(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xl(i),e}function Cg(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Qn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function fp(e){if(!e)return yn;e=e._reactInternals;e:{if(Wn(e)!==e||e.tag!==1)throw Error(S(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(qe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(S(171))}if(e.tag===1){var n=e.type;if(qe(n))return fd(e,n,t)}return t}function hp(e,t,n,r,o,i,a,u,s){return e=fs(n,r,!0,e,o,i,a,u,s),e.context=fp(null),n=e.current,r=Ke(),o=gn(n),i=Vt(r,o),i.callback=t??null,fn(n,i,o),e.current.lanes=o,fo(e,o,r),Ze(e,r),e}function Di(e,t,n,r){var o=t.current,i=Ke(),a=gn(o);return n=fp(n),t.context===null?t.context=n:t.pendingContext=n,t=Vt(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=fn(o,t,a),e!==null&&(Ct(e,o,a,i),Xo(e,o,a)),a}function Ni(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 vc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hs(e,t){vc(e,t),(e=e.alternate)&&vc(e,t)}function Ng(){return null}var gp=typeof reportError=="function"?reportError:function(e){console.error(e)};function gs(e){this._internalRoot=e}Wi.prototype.render=gs.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(S(409));Di(e,t,null,null)};Wi.prototype.unmount=gs.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zn(function(){Di(null,e,null,null)}),t[Yt]=null}};function Wi(e){this._internalRoot=e}Wi.prototype.unstable_scheduleHydration=function(e){if(e){var t=Vc();e={blockedOn:null,target:e,priority:t};for(var n=0;n<on.length&&t!==0&&t<on[n].priority;n++);on.splice(n,0,e),n===0&&Yc(e)}};function ms(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ji(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function yc(){}function Eg(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=Ni(a);i.call(c)}}var a=hp(t,r,e,0,null,!1,!1,"",yc);return e._reactRootContainer=a,e[Yt]=a.current,ro(e.nodeType===8?e.parentNode:e),zn(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var u=r;r=function(){var c=Ni(s);u.call(c)}}var s=fs(e,0,!1,null,null,!1,!1,"",yc);return e._reactRootContainer=s,e[Yt]=s.current,ro(e.nodeType===8?e.parentNode:e),zn(function(){Di(t,s,n,r)}),s}function Ui(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=Ni(a);u.call(s)}}Di(t,a,e,o)}else a=Eg(n,t,e,o,r);return Ni(a)}Bc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Dr(t.pendingLanes);n!==0&&(Ol(t,n|1),Ze(t,_e()),!(te&6)&&(wr=_e()+500,kn()))}break;case 13:zn(function(){var r=Qt(e,1);if(r!==null){var o=Ke();Ct(r,e,1,o)}}),hs(e,1)}};Al=function(e){if(e.tag===13){var t=Qt(e,134217728);if(t!==null){var n=Ke();Ct(t,e,134217728,n)}hs(e,134217728)}};Gc=function(e){if(e.tag===13){var t=gn(e),n=Qt(e,t);if(n!==null){var r=Ke();Ct(n,e,t,r)}hs(e,t)}};Vc=function(){return ie};Kc=function(e,t){var n=ie;try{return ie=e,t()}finally{ie=n}};Ya=function(e,t,n){switch(t){case"input":if(Ua(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=Fi(r);if(!o)throw Error(S(90));Sc(r),Ua(r,o)}}}break;case"textarea":Nc(e,n);break;case"select":t=n.value,t!=null&&lr(e,!!n.multiple,t,!1)}};Ic=us;Rc=zn;var Tg={usingClientEntryPoint:!1,Events:[go,er,Fi,Fc,Lc,us]},Rr={findFiberByHostInstance:Tn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Pg={bundleType:Rr.bundleType,version:Rr.version,rendererPackageName:Rr.rendererPackageName,rendererConfig:Rr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Jt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=zc(e),e===null?null:e.stateNode},findFiberByHostInstance:Rr.findFiberByHostInstance||Ng,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Or=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Or.isDisabled&&Or.supportsFiber))try{Ei=Or.inject(Pg),Rt=Or}catch{}var Or;ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Tg;ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ms(t))throw Error(S(200));return Cg(e,t,null,n)};ut.createRoot=function(e,t){if(!ms(e))throw Error(S(299));var n=!1,r="",o=gp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=fs(e,1,!1,null,null,n,!1,r,o),e[Yt]=t.current,ro(e.nodeType===8?e.parentNode:e),new gs(t)};ut.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(S(188)):(e=Object.keys(e).join(","),Error(S(268,e)));return e=zc(t),e=e===null?null:e.stateNode,e};ut.flushSync=function(e){return zn(e)};ut.hydrate=function(e,t,n){if(!ji(t))throw Error(S(200));return Ui(null,e,t,!0,n)};ut.hydrateRoot=function(e,t,n){if(!ms(e))throw Error(S(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",a=gp;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=hp(t,null,e,1,n??null,o,!1,i,a),e[Yt]=t.current,ro(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 Wi(t)};ut.render=function(e,t,n){if(!ji(t))throw Error(S(200));return Ui(null,e,t,!1,n)};ut.unmountComponentAtNode=function(e){if(!ji(e))throw Error(S(40));return e._reactRootContainer?(zn(function(){Ui(null,null,e,!1,function(){e._reactRootContainer=null,e[Yt]=null})}),!0):!1};ut.unstable_batchedUpdates=us;ut.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ji(n))throw Error(S(200));if(e==null||e._reactInternals===void 0)throw Error(S(38));return Ui(e,t,n,!1,r)};ut.version="18.3.1-next-f1338f8080-20240426"});var wp=jt((Ev,yp)=>{"use strict";function vp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vp)}catch(e){console.error(e)}}vp(),yp.exports=mp()});var kp=jt(vs=>{"use strict";var xp=wp();vs.createRoot=xp.createRoot,vs.hydrateRoot=xp.hydrateRoot;var Tv});var _p=jt($i=>{"use strict";var Mg=Ut(),Fg=Symbol.for("react.element"),Lg=Symbol.for("react.fragment"),Ig=Object.prototype.hasOwnProperty,Rg=Mg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Og={key:!0,ref:!0,__self:!0,__source:!0};function bp(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)Ig.call(t,r)&&!Og.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:Fg,type:e,key:i,ref:a,props:o,_owner:Rg.current}}$i.Fragment=Lg;$i.jsx=bp;$i.jsxs=bp});var De=jt((Fv,Sp)=>{"use strict";Sp.exports=_p()});var Us=`/* ---------------------------------------------------------------
8
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function La(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function hl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ig=typeof WeakMap=="function"?WeakMap:Map;function Hd(e,t,n){n=Vt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Si||(Si=!0,Sl=r),hl(e,t)},n}function Bd(e,t,n){n=Vt(-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(){hl(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){hl(e,t),typeof r!="function"&&(hn===null?hn=new Set([this]):hn.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function tc(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=wg.bind(null,e,t,n),t.then(e,e))}function nc(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 rc(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=Vt(-1,1),t.tag=2,fn(n,t,1))),n.lanes|=1),e)}var ag=Jt.ReactCurrentOwner,Xe=!1;function Ve(e,t,n,r){t.child=e===null?wd(t,null,n,r):mr(t,e.child,n,r)}function oc(e,t,n,r,o){n=n.render;var i=t.ref;return dr(t,o),r=ns(e,t,n,r,i,o),n=rs(),e!==null&&!Xe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Xt(e,t,o)):(he&&n&&Bl(t),t.flags|=1,Ve(e,t,r,o),t.child)}function ic(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!fs(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Gd(e,t,i,r,o)):(e=ri(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:no,n(a,r)&&e.ref===t.ref)return Xt(e,t,o)}return t.flags|=1,e=mn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Gd(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(no(i,r)&&e.ref===t.ref)if(Xe=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Xe=!0);else return t.lanes=e.lanes,Xt(e,t,o)}return gl(e,t,n,r,o)}function Vd(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},ce(ar,ot),ot|=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,ce(ar,ot),ot|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ce(ar,ot),ot|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ce(ar,ot),ot|=r;return Ve(e,t,o,n),t.child}function Kd(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function gl(e,t,n,r,o){var i=qe(n)?In:He.current;return i=hr(t,i),dr(t,o),n=ns(e,t,n,r,i,o),r=rs(),e!==null&&!Xe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Xt(e,t,o)):(he&&r&&Bl(t),t.flags|=1,Ve(e,t,n,o),t.child)}function ac(e,t,n,r,o){if(qe(n)){var i=!0;hi(t)}else i=!1;if(dr(t,o),t.stateNode===null)ei(e,t),$d(t,n,r),fl(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=gt(c):(c=qe(n)?In:He.current,c=hr(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)&&ec(t,a,r,c),rn=!1;var g=t.memoizedState;a.state=g,wi(t,r,a,o),s=t.memoizedState,u!==r||g!==s||Je.current||rn?(typeof d=="function"&&(pl(t,n,d,r),s=t.memoizedState),(u=rn||Zu(t,n,u,r,g,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,kd(e,t),u=t.memoizedProps,c=t.type===t.elementType?u:kt(t.type,u),a.props=c,p=t.pendingProps,g=a.context,s=n.contextType,typeof s=="object"&&s!==null?s=gt(s):(s=qe(n)?In:He.current,s=hr(t,s));var v=n.getDerivedStateFromProps;(d=typeof v=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u!==p||g!==s)&&ec(t,a,r,s),rn=!1,g=t.memoizedState,a.state=g,wi(t,r,a,o);var b=t.memoizedState;u!==p||g!==b||Je.current||rn?(typeof v=="function"&&(pl(t,n,v,r),b=t.memoizedState),(c=rn||Zu(t,n,c,r,g,b,s)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,b,s),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,b,s)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||u===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),a.props=r,a.state=b,a.context=s,r=c):(typeof a.componentDidUpdate!="function"||u===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),r=!1)}return ml(e,t,n,r,i,o)}function ml(e,t,n,r,o,i){Kd(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&Gu(t,n,!1),Xt(e,t,i);r=t.stateNode,ag.current=t;var u=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=mr(t,e.child,null,i),t.child=mr(t,null,u,i)):Ve(e,t,u,i),t.memoizedState=r.state,o&&Gu(t,n,!0),t.child}function Yd(e){var t=e.stateNode;t.pendingContext?Bu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Bu(e,t.context,!1),ql(e,t.containerInfo)}function lc(e,t,n,r,o){return gr(),Vl(o),t.flags|=256,Ve(e,t,n,r),t.child}var vl={dehydrated:null,treeContext:null,retryLane:0};function yl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qd(e,t,n){var r=t.pendingProps,o=me.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),ce(me,o&1),e===null)return cl(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=Di(a,r,0,null),e=Ln(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=yl(n),t.memoizedState=vl,e):as(t,a));if(o=e.memoizedState,o!==null&&(u=o.dehydrated,u!==null))return lg(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=mn(o,s),r.subtreeFlags=o.subtreeFlags&14680064),u!==null?i=mn(u,i):(i=Ln(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?yl(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=vl,r}return i=e.child,e=i.sibling,r=mn(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 as(e,t){return t=Di({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Go(e,t,n,r){return r!==null&&Vl(r),mr(t,e.child,null,n),e=as(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lg(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=La(Error(S(422))),Go(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Di({mode:"visible",children:r.children},o,0,null),i=Ln(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&mr(t,e.child,null,a),t.child.memoizedState=yl(a),t.memoizedState=vl,i);if(!(t.mode&1))return Go(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var u=r.dgst;return r=u,i=Error(S(419)),r=La(i,r,void 0),Go(e,t,a,r)}if(u=(a&e.childLanes)!==0,Xe||u){if(r=Re,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,Qt(e,o),Ct(r,e,o,-1))}return ps(),r=La(Error(S(421))),Go(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=xg.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,it=pn(o.nextSibling),at=t,he=!0,_t=null,e!==null&&(dt[pt++]=Bt,dt[pt++]=Gt,dt[pt++]=Rn,Bt=e.id,Gt=e.overflow,Rn=t),t=as(t,r.children),t.flags|=4096,t)}function sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),dl(e.return,t,n)}function Ia(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 Xd(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Ve(e,t,r.children,n),r=me.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&&sc(e,n,t);else if(e.tag===19)sc(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(ce(me,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&&xi(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ia(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&&xi(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ia(t,!0,n,null,i);break;case"together":Ia(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ei(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Xt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),An|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(S(153));if(t.child!==null){for(e=t.child,n=mn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=mn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sg(e,t,n){switch(t.tag){case 3:Yd(t),gr();break;case 5:bd(t);break;case 1:qe(t.type)&&hi(t);break;case 4:ql(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ce(vi,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ce(me,me.current&1),t.flags|=128,null):n&t.child.childLanes?Qd(e,t,n):(ce(me,me.current&1),e=Xt(e,t,n),e!==null?e.sibling:null);ce(me,me.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Xd(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ce(me,me.current),r)break;return null;case 22:case 23:return t.lanes=0,Vd(e,t,n)}return Xt(e,t,n)}var Jd,wl,qd,Zd;Jd=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}};wl=function(){};qd=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Mn(Ot.current);var i=null;switch(n){case"input":o=Ua(e,o),r=Ua(e,r),i=[];break;case"select":o=ye({},o,{value:void 0}),r=ye({},r,{value:void 0}),i=[];break;case"textarea":o=Ba(e,o),r=Ba(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=pi)}Va(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"&&(Qr.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"&&(Qr.hasOwnProperty(c)?(s!=null&&c==="onScroll"&&de("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)}};Zd=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ir(e,t){if(!he)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 Ue(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 ug(e,t,n){var r=t.pendingProps;switch(Gl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(t),null;case 1:return qe(t.type)&&fi(),Ue(t),null;case 3:return r=t.stateNode,vr(),pe(Je),pe(He),es(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ho(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,_t!==null&&(El(_t),_t=null))),wl(e,t),Ue(t),null;case 5:Zl(t);var o=Mn(lo.current);if(n=t.type,e!==null&&t.stateNode!=null)qd(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(S(166));return Ue(t),null}if(e=Mn(Ot.current),Ho(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[It]=t,r[io]=i,e=(t.mode&1)!==0,n){case"dialog":de("cancel",r),de("close",r);break;case"iframe":case"object":case"embed":de("load",r);break;case"video":case"audio":for(o=0;o<Wr.length;o++)de(Wr[o],r);break;case"source":de("error",r);break;case"img":case"image":case"link":de("error",r),de("load",r);break;case"details":de("toggle",r);break;case"input":mu(r,i),de("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},de("invalid",r);break;case"textarea":yu(r,i),de("invalid",r)}Va(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&&$o(r.textContent,u,e),o=["children",u]):typeof u=="number"&&r.textContent!==""+u&&(i.suppressHydrationWarning!==!0&&$o(r.textContent,u,e),o=["children",""+u]):Qr.hasOwnProperty(a)&&u!=null&&a==="onScroll"&&de("scroll",r)}switch(n){case"input":Mo(r),vu(r,i,!0);break;case"textarea":Mo(r),wu(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=pi)}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=Ec(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[It]=t,e[io]=r,Jd(e,t,!1,!1),t.stateNode=e;e:{switch(a=Ka(n,r),n){case"dialog":de("cancel",e),de("close",e),o=r;break;case"iframe":case"object":case"embed":de("load",e),o=r;break;case"video":case"audio":for(o=0;o<Wr.length;o++)de(Wr[o],e);o=r;break;case"source":de("error",e),o=r;break;case"img":case"image":case"link":de("error",e),de("load",e),o=r;break;case"details":de("toggle",e),o=r;break;case"input":mu(e,r),o=Ua(e,r),de("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ye({},r,{value:void 0}),de("invalid",e);break;case"textarea":yu(e,r),o=Ba(e,r),de("invalid",e);break;default:o=r}Va(n,o),u=o;for(i in u)if(u.hasOwnProperty(i)){var s=u[i];i==="style"?Mc(e,s):i==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,s!=null&&Tc(e,s)):i==="children"?typeof s=="string"?(n!=="textarea"||s!=="")&&Xr(e,s):typeof s=="number"&&Xr(e,""+s):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Qr.hasOwnProperty(i)?s!=null&&i==="onScroll"&&de("scroll",e):s!=null&&Ml(e,i,s,a))}switch(n){case"input":Mo(e),vu(e,r,!1);break;case"textarea":Mo(e),wu(e);break;case"option":r.value!=null&&e.setAttribute("value",""+vn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?lr(e,!!r.multiple,i,!1):r.defaultValue!=null&&lr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=pi)}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 Ue(t),null;case 6:if(e&&t.stateNode!=null)Zd(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(S(166));if(n=Mn(lo.current),Mn(Ot.current),Ho(t)){if(r=t.stateNode,n=t.memoizedProps,r[It]=t,(i=r.nodeValue!==n)&&(e=at,e!==null))switch(e.tag){case 3:$o(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$o(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[It]=t,t.stateNode=r}return Ue(t),null;case 13:if(pe(me),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(he&&it!==null&&t.mode&1&&!(t.flags&128))vd(),gr(),t.flags|=98560,i=!1;else if(i=Ho(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(S(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(S(317));i[It]=t}else gr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ue(t),i=!1}else _t!==null&&(El(_t),_t=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||me.current&1?Fe===0&&(Fe=3):ps())),t.updateQueue!==null&&(t.flags|=4),Ue(t),null);case 4:return vr(),wl(e,t),e===null&&ro(t.stateNode.containerInfo),Ue(t),null;case 10:return Ql(t.type._context),Ue(t),null;case 17:return qe(t.type)&&fi(),Ue(t),null;case 19:if(pe(me),i=t.memoizedState,i===null)return Ue(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)Ir(i,!1);else{if(Fe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=xi(e),a!==null){for(t.flags|=128,Ir(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 ce(me,me.current&1|2),t.child}e=e.sibling}i.tail!==null&&Se()>wr&&(t.flags|=128,r=!0,Ir(i,!1),t.lanes=4194304)}else{if(!r)if(e=xi(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ir(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!he)return Ue(t),null}else 2*Se()-i.renderingStartTime>wr&&n!==1073741824&&(t.flags|=128,r=!0,Ir(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=Se(),t.sibling=null,n=me.current,ce(me,r?n&1|2:n&1),t):(Ue(t),null);case 22:case 23:return ds(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ot&1073741824&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),null;case 24:return null;case 25:return null}throw Error(S(156,t.tag))}function cg(e,t){switch(Gl(t),t.tag){case 1:return qe(t.type)&&fi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vr(),pe(Je),pe(He),es(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zl(t),null;case 13:if(pe(me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(S(340));gr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(me),null;case 4:return vr(),null;case 10:return Ql(t.type._context),null;case 22:case 23:return ds(),null;case 24:return null;default:return null}}var Vo=!1,$e=!1,dg=typeof WeakSet=="function"?WeakSet:Set,P=null;function ir(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xe(e,t,r)}else n.current=null}function xl(e,t,n){try{n()}catch(r){xe(e,t,r)}}var uc=!1;function pg(e,t){if(rl=ui,e=od(),Hl(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,g=null;t:for(;;){for(var v;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),(v=p.firstChild)!==null;)g=p,p=v;for(;;){if(p===e)break t;if(g===n&&++c===o&&(u=a),g===i&&++d===r&&(s=a),(v=p.nextSibling)!==null)break;p=g,g=p.parentNode}p=v}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(ol={focusedElem:e,selectionRange:n},ui=!1,P=t;P!==null;)if(t=P,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,P=e;else for(;P!==null;){t=P;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var w=b.memoizedProps,V=b.memoizedState,f=t.stateNode,h=f.getSnapshotBeforeUpdate(t.elementType===t.type?w:kt(t.type,w),V);f.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(S(163))}}catch(x){xe(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,P=e;break}P=t.return}return b=uc,uc=!1,b}function Vr(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&&xl(t,n,i)}o=o.next}while(o!==r)}}function Ai(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 kl(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 ep(e){var t=e.alternate;t!==null&&(e.alternate=null,ep(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[It],delete t[io],delete t[ll],delete t[Yh],delete t[Qh])),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 tp(e){return e.tag===5||e.tag===3||e.tag===4}function cc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tp(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 bl(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=pi));else if(r!==4&&(e=e.child,e!==null))for(bl(e,t,n),e=e.sibling;e!==null;)bl(e,t,n),e=e.sibling}function _l(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(_l(e,t,n),e=e.sibling;e!==null;)_l(e,t,n),e=e.sibling}var Oe=null,bt=!1;function tn(e,t,n){for(n=n.child;n!==null;)np(e,t,n),n=n.sibling}function np(e,t,n){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(Ti,n)}catch{}switch(n.tag){case 5:$e||ir(n,t);case 6:var r=Oe,o=bt;Oe=null,tn(e,t,n),Oe=r,bt=o,Oe!==null&&(bt?(e=Oe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Oe.removeChild(n.stateNode));break;case 18:Oe!==null&&(bt?(e=Oe,n=n.stateNode,e.nodeType===8?Na(e.parentNode,n):e.nodeType===1&&Na(e,n),eo(e)):Na(Oe,n.stateNode));break;case 4:r=Oe,o=bt,Oe=n.stateNode.containerInfo,bt=!0,tn(e,t,n),Oe=r,bt=o;break;case 0:case 11:case 14:case 15:if(!$e&&(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)&&xl(n,t,a),o=o.next}while(o!==r)}tn(e,t,n);break;case 1:if(!$e&&(ir(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){xe(n,t,u)}tn(e,t,n);break;case 21:tn(e,t,n);break;case 22:n.mode&1?($e=(r=$e)||n.memoizedState!==null,tn(e,t,n),$e=r):tn(e,t,n);break;default:tn(e,t,n)}}function dc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new dg),t.forEach(function(r){var o=kg.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function xt(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:Oe=u.stateNode,bt=!1;break e;case 3:Oe=u.stateNode.containerInfo,bt=!0;break e;case 4:Oe=u.stateNode.containerInfo,bt=!0;break e}u=u.return}if(Oe===null)throw Error(S(160));np(i,a,o),Oe=null,bt=!1;var s=o.alternate;s!==null&&(s.return=null),o.return=null}catch(c){xe(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)rp(t,e),t=t.sibling}function rp(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xt(t,e),Ft(e),r&4){try{Vr(3,e,e.return),Ai(3,e)}catch(w){xe(e,e.return,w)}try{Vr(5,e,e.return)}catch(w){xe(e,e.return,w)}}break;case 1:xt(t,e),Ft(e),r&512&&n!==null&&ir(n,n.return);break;case 5:if(xt(t,e),Ft(e),r&512&&n!==null&&ir(n,n.return),e.flags&32){var o=e.stateNode;try{Xr(o,"")}catch(w){xe(e,e.return,w)}}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&&Cc(o,i),Ka(u,a);var c=Ka(u,i);for(a=0;a<s.length;a+=2){var d=s[a],p=s[a+1];d==="style"?Mc(o,p):d==="dangerouslySetInnerHTML"?Tc(o,p):d==="children"?Xr(o,p):Ml(o,d,p,c)}switch(u){case"input":$a(o,i);break;case"textarea":Nc(o,i);break;case"select":var g=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var v=i.value;v!=null?lr(o,!!i.multiple,v,!1):g!==!!i.multiple&&(i.defaultValue!=null?lr(o,!!i.multiple,i.defaultValue,!0):lr(o,!!i.multiple,i.multiple?[]:"",!1))}o[io]=i}catch(w){xe(e,e.return,w)}}break;case 6:if(xt(t,e),Ft(e),r&4){if(e.stateNode===null)throw Error(S(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(w){xe(e,e.return,w)}}break;case 3:if(xt(t,e),Ft(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{eo(t.containerInfo)}catch(w){xe(e,e.return,w)}break;case 4:xt(t,e),Ft(e);break;case 13:xt(t,e),Ft(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(us=Se())),r&4&&dc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?($e=(c=$e)||d,xt(t,e),$e=c):xt(t,e),Ft(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(P=e,d=e.child;d!==null;){for(p=P=d;P!==null;){switch(g=P,v=g.child,g.tag){case 0:case 11:case 14:case 15:Vr(4,g,g.return);break;case 1:ir(g,g.return);var b=g.stateNode;if(typeof b.componentWillUnmount=="function"){r=g,n=g.return;try{t=r,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(w){xe(r,n,w)}}break;case 5:ir(g,g.return);break;case 22:if(g.memoizedState!==null){fc(p);continue}}v!==null?(v.return=g,P=v):fc(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=Pc("display",a))}catch(w){xe(e,e.return,w)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=c?"":p.memoizedProps}catch(w){xe(e,e.return,w)}}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:xt(t,e),Ft(e),r&4&&dc(e);break;case 21:break;default:xt(t,e),Ft(e)}}function Ft(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(tp(n)){var r=n;break e}n=n.return}throw Error(S(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Xr(o,""),r.flags&=-33);var i=cc(e);_l(e,i,o);break;case 3:case 4:var a=r.stateNode.containerInfo,u=cc(e);bl(e,u,a);break;default:throw Error(S(161))}}catch(s){xe(e,e.return,s)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function fg(e,t,n){P=e,op(e,t,n)}function op(e,t,n){for(var r=(e.mode&1)!==0;P!==null;){var o=P,i=o.child;if(o.tag===22&&r){var a=o.memoizedState!==null||Vo;if(!a){var u=o.alternate,s=u!==null&&u.memoizedState!==null||$e;u=Vo;var c=$e;if(Vo=a,($e=s)&&!c)for(P=o;P!==null;)a=P,s=a.child,a.tag===22&&a.memoizedState!==null?hc(o):s!==null?(s.return=a,P=s):hc(o);for(;i!==null;)P=i,op(i,t,n),i=i.sibling;P=o,Vo=u,$e=c}pc(e,t,n)}else o.subtreeFlags&8772&&i!==null?(i.return=o,P=i):pc(e,t,n)}}function pc(e){for(;P!==null;){var t=P;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:$e||Ai(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!$e)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:kt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Xu(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}Xu(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&&eo(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(S(163))}$e||t.flags&512&&kl(t)}catch(g){xe(t,t.return,g)}}if(t===e){P=null;break}if(n=t.sibling,n!==null){n.return=t.return,P=n;break}P=t.return}}function fc(e){for(;P!==null;){var t=P;if(t===e){P=null;break}var n=t.sibling;if(n!==null){n.return=t.return,P=n;break}P=t.return}}function hc(e){for(;P!==null;){var t=P;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ai(4,t)}catch(s){xe(t,n,s)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(s){xe(t,o,s)}}var i=t.return;try{kl(t)}catch(s){xe(t,i,s)}break;case 5:var a=t.return;try{kl(t)}catch(s){xe(t,a,s)}}}catch(s){xe(t,t.return,s)}if(t===e){P=null;break}var u=t.sibling;if(u!==null){u.return=t.return,P=u;break}P=t.return}}var hg=Math.ceil,_i=Jt.ReactCurrentDispatcher,ls=Jt.ReactCurrentOwner,ht=Jt.ReactCurrentBatchConfig,ne=0,Re=null,Ne=null,Ae=0,ot=0,ar=xn(0),Fe=0,po=null,An=0,zi=0,ss=0,Kr=null,Qe=null,us=0,wr=1/0,$t=null,Si=!1,Sl=null,hn=null,Ko=!1,sn=null,Ci=0,Yr=0,Cl=null,ti=-1,ni=0;function Ke(){return ne&6?Se():ti!==-1?ti:ti=Se()}function gn(e){return e.mode&1?ne&2&&Ae!==0?Ae&-Ae:Jh.transition!==null?(ni===0&&(ni=$c()),ni):(e=ie,e!==0||(e=window.event,e=e===void 0?16:Qc(e.type)),e):1}function Ct(e,t,n,r){if(50<Yr)throw Yr=0,Cl=null,Error(S(185));fo(e,n,r),(!(ne&2)||e!==Re)&&(e===Re&&(!(ne&2)&&(zi|=n),Fe===4&&an(e,Ae)),Ze(e,r),n===1&&ne===0&&!(t.mode&1)&&(wr=Se()+500,Ii&&kn()))}function Ze(e,t){var n=e.callbackNode;Zf(e,t);var r=si(e,e===Re?Ae:0);if(r===0)n!==null&&bu(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&bu(n),t===1)e.tag===0?Xh(gc.bind(null,e)):hd(gc.bind(null,e)),Vh(function(){!(ne&6)&&kn()}),n=null;else{switch(Hc(r)){case 1:n=Ol;break;case 4:n=jc;break;case 16:n=li;break;case 536870912:n=Uc;break;default:n=li}n=pp(n,ip.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ip(e,t){if(ti=-1,ni=0,ne&6)throw Error(S(327));var n=e.callbackNode;if(pr()&&e.callbackNode!==n)return null;var r=si(e,e===Re?Ae:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ni(e,r);else{t=r;var o=ne;ne|=2;var i=lp();(Re!==e||Ae!==t)&&($t=null,wr=Se()+500,Fn(e,t));do try{vg();break}catch(u){ap(e,u)}while(1);Yl(),_i.current=i,ne=o,Ne!==null?t=0:(Re=null,Ae=0,t=Fe)}if(t!==0){if(t===2&&(o=qa(e),o!==0&&(r=o,t=Nl(e,o))),t===1)throw n=po,Fn(e,0),an(e,r),Ze(e,Se()),n;if(t===6)an(e,r);else{if(o=e.current.alternate,!(r&30)&&!gg(o)&&(t=Ni(e,r),t===2&&(i=qa(e),i!==0&&(r=i,t=Nl(e,i))),t===1))throw n=po,Fn(e,0),an(e,r),Ze(e,Se()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(S(345));case 2:En(e,Qe,$t);break;case 3:if(an(e,r),(r&130023424)===r&&(t=us+500-Se(),10<t)){if(si(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ke(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=al(En.bind(null,e,Qe,$t),t);break}En(e,Qe,$t);break;case 4:if(an(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-St(r);i=1<<a,a=t[a],a>o&&(o=a),r&=~i}if(r=o,r=Se()-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=al(En.bind(null,e,Qe,$t),r);break}En(e,Qe,$t);break;case 5:En(e,Qe,$t);break;default:throw Error(S(329))}}}return Ze(e,Se()),e.callbackNode===n?ip.bind(null,e):null}function Nl(e,t){var n=Kr;return e.current.memoizedState.isDehydrated&&(Fn(e,t).flags|=256),e=Ni(e,t),e!==2&&(t=Qe,Qe=n,t!==null&&El(t)),e}function El(e){Qe===null?Qe=e:Qe.push.apply(Qe,e)}function gg(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(!Nt(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 an(e,t){for(t&=~ss,t&=~zi,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-St(t),r=1<<n;e[n]=-1,t&=~r}}function gc(e){if(ne&6)throw Error(S(327));pr();var t=si(e,0);if(!(t&1))return Ze(e,Se()),null;var n=Ni(e,t);if(e.tag!==0&&n===2){var r=qa(e);r!==0&&(t=r,n=Nl(e,r))}if(n===1)throw n=po,Fn(e,0),an(e,t),Ze(e,Se()),n;if(n===6)throw Error(S(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,En(e,Qe,$t),Ze(e,Se()),null}function cs(e,t){var n=ne;ne|=1;try{return e(t)}finally{ne=n,ne===0&&(wr=Se()+500,Ii&&kn())}}function zn(e){sn!==null&&sn.tag===0&&!(ne&6)&&pr();var t=ne;ne|=1;var n=ht.transition,r=ie;try{if(ht.transition=null,ie=1,e)return e()}finally{ie=r,ht.transition=n,ne=t,!(ne&6)&&kn()}}function ds(){ot=ar.current,pe(ar)}function Fn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Gh(n)),Ne!==null)for(n=Ne.return;n!==null;){var r=n;switch(Gl(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&fi();break;case 3:vr(),pe(Je),pe(He),es();break;case 5:Zl(r);break;case 4:vr();break;case 13:pe(me);break;case 19:pe(me);break;case 10:Ql(r.type._context);break;case 22:case 23:ds()}n=n.return}if(Re=e,Ne=e=mn(e.current,null),Ae=ot=t,Fe=0,po=null,ss=zi=An=0,Qe=Kr=null,Pn!==null){for(t=0;t<Pn.length;t++)if(n=Pn[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}Pn=null}return e}function ap(e,t){do{var n=Ne;try{if(Yl(),qo.current=bi,ki){for(var r=ve.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ki=!1}if(On=0,Ie=Me=ve=null,Gr=!1,so=0,ls.current=null,n===null||n.return===null){Fe=1,po=t,Ne=null;break}e:{var i=e,a=n.return,u=n,s=t;if(t=Ae,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 g=d.alternate;g?(d.updateQueue=g.updateQueue,d.memoizedState=g.memoizedState,d.lanes=g.lanes):(d.updateQueue=null,d.memoizedState=null)}var v=nc(a);if(v!==null){v.flags&=-257,rc(v,a,u,i,t),v.mode&1&&tc(i,c,t),t=v,s=c;var b=t.updateQueue;if(b===null){var w=new Set;w.add(s),t.updateQueue=w}else b.add(s);break e}else{if(!(t&1)){tc(i,c,t),ps();break e}s=Error(S(426))}}else if(he&&u.mode&1){var V=nc(a);if(V!==null){!(V.flags&65536)&&(V.flags|=256),rc(V,a,u,i,t),Vl(yr(s,u));break e}}i=s=yr(s,u),Fe!==4&&(Fe=2),Kr===null?Kr=[i]:Kr.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var f=Hd(i,s,t);Qu(i,f);break e;case 1:u=s;var h=i.type,m=i.stateNode;if(!(i.flags&128)&&(typeof h.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(hn===null||!hn.has(m)))){i.flags|=65536,t&=-t,i.lanes|=t;var x=Bd(i,u,t);Qu(i,x);break e}}i=i.return}while(i!==null)}up(n)}catch(C){t=C,Ne===n&&n!==null&&(Ne=n=n.return);continue}break}while(1)}function lp(){var e=_i.current;return _i.current=bi,e===null?bi:e}function ps(){(Fe===0||Fe===3||Fe===2)&&(Fe=4),Re===null||!(An&268435455)&&!(zi&268435455)||an(Re,Ae)}function Ni(e,t){var n=ne;ne|=2;var r=lp();(Re!==e||Ae!==t)&&($t=null,Fn(e,t));do try{mg();break}catch(o){ap(e,o)}while(1);if(Yl(),ne=n,_i.current=r,Ne!==null)throw Error(S(261));return Re=null,Ae=0,Fe}function mg(){for(;Ne!==null;)sp(Ne)}function vg(){for(;Ne!==null&&!Bf();)sp(Ne)}function sp(e){var t=dp(e.alternate,e,ot);e.memoizedProps=e.pendingProps,t===null?up(e):Ne=t,ls.current=null}function up(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=cg(n,t),n!==null){n.flags&=32767,Ne=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Fe=6,Ne=null;return}}else if(n=ug(n,t,ot),n!==null){Ne=n;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);Fe===0&&(Fe=5)}function En(e,t,n){var r=ie,o=ht.transition;try{ht.transition=null,ie=1,yg(e,t,n,r)}finally{ht.transition=o,ie=r}return null}function yg(e,t,n,r){do pr();while(sn!==null);if(ne&6)throw Error(S(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(S(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(eh(e,i),e===Re&&(Ne=Re=null,Ae=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ko||(Ko=!0,pp(li,function(){return pr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=ht.transition,ht.transition=null;var a=ie;ie=1;var u=ne;ne|=4,ls.current=null,pg(e,n),rp(n,e),jh(ol),ui=!!rl,ol=rl=null,e.current=n,fg(n,e,o),Gf(),ne=u,ie=a,ht.transition=i}else e.current=n;if(Ko&&(Ko=!1,sn=e,Ci=o),i=e.pendingLanes,i===0&&(hn=null),Yf(n.stateNode,r),Ze(e,Se()),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(Si)throw Si=!1,e=Sl,Sl=null,e;return Ci&1&&e.tag!==0&&pr(),i=e.pendingLanes,i&1?e===Cl?Yr++:(Yr=0,Cl=e):Yr=0,kn(),null}function pr(){if(sn!==null){var e=Hc(Ci),t=ht.transition,n=ie;try{if(ht.transition=null,ie=16>e?16:e,sn===null)var r=!1;else{if(e=sn,sn=null,Ci=0,ne&6)throw Error(S(331));var o=ne;for(ne|=4,P=e.current;P!==null;){var i=P,a=i.child;if(P.flags&16){var u=i.deletions;if(u!==null){for(var s=0;s<u.length;s++){var c=u[s];for(P=c;P!==null;){var d=P;switch(d.tag){case 0:case 11:case 15:Vr(8,d,i)}var p=d.child;if(p!==null)p.return=d,P=p;else for(;P!==null;){d=P;var g=d.sibling,v=d.return;if(ep(d),d===c){P=null;break}if(g!==null){g.return=v,P=g;break}P=v}}}var b=i.alternate;if(b!==null){var w=b.child;if(w!==null){b.child=null;do{var V=w.sibling;w.sibling=null,w=V}while(w!==null)}}P=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,P=a;else e:for(;P!==null;){if(i=P,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Vr(9,i,i.return)}var f=i.sibling;if(f!==null){f.return=i.return,P=f;break e}P=i.return}}var h=e.current;for(P=h;P!==null;){a=P;var m=a.child;if(a.subtreeFlags&2064&&m!==null)m.return=a,P=m;else e:for(a=h;P!==null;){if(u=P,u.flags&2048)try{switch(u.tag){case 0:case 11:case 15:Ai(9,u)}}catch(C){xe(u,u.return,C)}if(u===a){P=null;break e}var x=u.sibling;if(x!==null){x.return=u.return,P=x;break e}P=u.return}}if(ne=o,kn(),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(Ti,e)}catch{}r=!0}return r}finally{ie=n,ht.transition=t}}return!1}function mc(e,t,n){t=yr(n,t),t=Hd(e,t,1),e=fn(e,t,1),t=Ke(),e!==null&&(fo(e,1,t),Ze(e,t))}function xe(e,t,n){if(e.tag===3)mc(e,e,n);else for(;t!==null;){if(t.tag===3){mc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(hn===null||!hn.has(r))){e=yr(n,e),e=Bd(t,e,1),t=fn(t,e,1),e=Ke(),t!==null&&(fo(t,1,e),Ze(t,e));break}}t=t.return}}function wg(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ke(),e.pingedLanes|=e.suspendedLanes&n,Re===e&&(Ae&n)===n&&(Fe===4||Fe===3&&(Ae&130023424)===Ae&&500>Se()-us?Fn(e,0):ss|=n),Ze(e,t)}function cp(e,t){t===0&&(e.mode&1?(t=Io,Io<<=1,!(Io&130023424)&&(Io=4194304)):t=1);var n=Ke();e=Qt(e,t),e!==null&&(fo(e,t,n),Ze(e,n))}function xg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),cp(e,n)}function kg(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(S(314))}r!==null&&r.delete(t),cp(e,n)}var dp;dp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Je.current)Xe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xe=!1,sg(e,t,n);Xe=!!(e.flags&131072)}else Xe=!1,he&&t.flags&1048576&&gd(t,mi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ei(e,t),e=t.pendingProps;var o=hr(t,He.current);dr(t,n),o=ns(null,t,r,e,o,n);var i=rs();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,qe(r)?(i=!0,hi(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Jl(t),o.updater=Oi,t.stateNode=o,o._reactInternals=t,fl(t,r,e,n),t=ml(null,t,r,!0,i,n)):(t.tag=0,he&&i&&Bl(t),Ve(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ei(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=_g(r),e=kt(r,e),o){case 0:t=gl(null,t,r,e,n);break e;case 1:t=ac(null,t,r,e,n);break e;case 11:t=oc(null,t,r,e,n);break e;case 14:t=ic(null,t,r,kt(r.type,e),n);break e}throw Error(S(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:kt(r,o),gl(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:kt(r,o),ac(e,t,r,o,n);case 3:e:{if(Yd(t),e===null)throw Error(S(387));r=t.pendingProps,i=t.memoizedState,o=i.element,kd(e,t),wi(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=yr(Error(S(423)),t),t=lc(e,t,r,n,o);break e}else if(r!==o){o=yr(Error(S(424)),t),t=lc(e,t,r,n,o);break e}else for(it=pn(t.stateNode.containerInfo.firstChild),at=t,he=!0,_t=null,n=wd(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gr(),r===o){t=Xt(e,t,n);break e}Ve(e,t,r,n)}t=t.child}return t;case 5:return bd(t),e===null&&cl(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,il(r,o)?a=null:i!==null&&il(r,i)&&(t.flags|=32),Kd(e,t),Ve(e,t,a,n),t.child;case 6:return e===null&&cl(t),null;case 13:return Qd(e,t,n);case 4:return ql(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mr(t,null,r,n):Ve(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:kt(r,o),oc(e,t,r,o,n);case 7:return Ve(e,t,t.pendingProps,n),t.child;case 8:return Ve(e,t,t.pendingProps.children,n),t.child;case 12:return Ve(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,ce(vi,r._currentValue),r._currentValue=a,i!==null)if(Nt(i.value,a)){if(i.children===o.children&&!Je.current){t=Xt(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=Vt(-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),dl(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(S(341));a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),dl(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}Ve(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,dr(t,n),o=gt(o),r=r(o),t.flags|=1,Ve(e,t,r,n),t.child;case 14:return r=t.type,o=kt(r,t.pendingProps),o=kt(r.type,o),ic(e,t,r,o,n);case 15:return Gd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:kt(r,o),ei(e,t),t.tag=1,qe(r)?(e=!0,hi(t)):e=!1,dr(t,n),$d(t,r,o),fl(t,r,o,n),ml(null,t,r,!0,e,n);case 19:return Xd(e,t,n);case 22:return Vd(e,t,n)}throw Error(S(156,t.tag))};function pp(e,t){return Wc(e,t)}function bg(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 ft(e,t,n,r){return new bg(e,t,n,r)}function fs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _g(e){if(typeof e=="function")return fs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ll)return 11;if(e===Il)return 14}return 2}function mn(e,t){var n=e.alternate;return n===null?(n=ft(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 ri(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")fs(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Xn:return Ln(n.children,o,i,t);case Fl:a=8,o|=8;break;case za:return e=ft(12,n,t,o|2),e.elementType=za,e.lanes=i,e;case Da:return e=ft(13,n,t,o),e.elementType=Da,e.lanes=i,e;case Wa:return e=ft(19,n,t,o),e.elementType=Wa,e.lanes=i,e;case bc:return Di(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case xc:a=10;break e;case kc:a=9;break e;case Ll:a=11;break e;case Il:a=14;break e;case nn:a=16,r=null;break e}throw Error(S(130,e==null?e:typeof e,""))}return t=ft(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Ln(e,t,n,r){return e=ft(7,e,r,t),e.lanes=n,e}function Di(e,t,n,r){return e=ft(22,e,r,t),e.elementType=bc,e.lanes=n,e.stateNode={isHidden:!1},e}function Ra(e,t,n){return e=ft(6,e,null,t),e.lanes=n,e}function Oa(e,t,n){return t=ft(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Sg(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=ya(0),this.expirationTimes=ya(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ya(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function hs(e,t,n,r,o,i,a,u,s){return e=new Sg(e,t,n,u,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ft(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 Cg(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Qn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function fp(e){if(!e)return yn;e=e._reactInternals;e:{if(Wn(e)!==e||e.tag!==1)throw Error(S(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(qe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(S(171))}if(e.tag===1){var n=e.type;if(qe(n))return fd(e,n,t)}return t}function hp(e,t,n,r,o,i,a,u,s){return e=hs(n,r,!0,e,o,i,a,u,s),e.context=fp(null),n=e.current,r=Ke(),o=gn(n),i=Vt(r,o),i.callback=t??null,fn(n,i,o),e.current.lanes=o,fo(e,o,r),Ze(e,r),e}function Wi(e,t,n,r){var o=t.current,i=Ke(),a=gn(o);return n=fp(n),t.context===null?t.context=n:t.pendingContext=n,t=Vt(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=fn(o,t,a),e!==null&&(Ct(e,o,a,i),Jo(e,o,a)),a}function Ei(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 vc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gs(e,t){vc(e,t),(e=e.alternate)&&vc(e,t)}function Ng(){return null}var gp=typeof reportError=="function"?reportError:function(e){console.error(e)};function ms(e){this._internalRoot=e}ji.prototype.render=ms.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(S(409));Wi(e,t,null,null)};ji.prototype.unmount=ms.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zn(function(){Wi(null,e,null,null)}),t[Yt]=null}};function ji(e){this._internalRoot=e}ji.prototype.unstable_scheduleHydration=function(e){if(e){var t=Vc();e={blockedOn:null,target:e,priority:t};for(var n=0;n<on.length&&t!==0&&t<on[n].priority;n++);on.splice(n,0,e),n===0&&Yc(e)}};function vs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ui(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function yc(){}function Eg(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=Ei(a);i.call(c)}}var a=hp(t,r,e,0,null,!1,!1,"",yc);return e._reactRootContainer=a,e[Yt]=a.current,ro(e.nodeType===8?e.parentNode:e),zn(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var u=r;r=function(){var c=Ei(s);u.call(c)}}var s=hs(e,0,!1,null,null,!1,!1,"",yc);return e._reactRootContainer=s,e[Yt]=s.current,ro(e.nodeType===8?e.parentNode:e),zn(function(){Wi(t,s,n,r)}),s}function $i(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=Ei(a);u.call(s)}}Wi(t,a,e,o)}else a=Eg(n,t,e,o,r);return Ei(a)}Bc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Dr(t.pendingLanes);n!==0&&(Al(t,n|1),Ze(t,Se()),!(ne&6)&&(wr=Se()+500,kn()))}break;case 13:zn(function(){var r=Qt(e,1);if(r!==null){var o=Ke();Ct(r,e,1,o)}}),gs(e,1)}};zl=function(e){if(e.tag===13){var t=Qt(e,134217728);if(t!==null){var n=Ke();Ct(t,e,134217728,n)}gs(e,134217728)}};Gc=function(e){if(e.tag===13){var t=gn(e),n=Qt(e,t);if(n!==null){var r=Ke();Ct(n,e,t,r)}gs(e,t)}};Vc=function(){return ie};Kc=function(e,t){var n=ie;try{return ie=e,t()}finally{ie=n}};Qa=function(e,t,n){switch(t){case"input":if($a(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=Li(r);if(!o)throw Error(S(90));Sc(r),$a(r,o)}}}break;case"textarea":Nc(e,n);break;case"select":t=n.value,t!=null&&lr(e,!!n.multiple,t,!1)}};Ic=cs;Rc=zn;var Tg={usingClientEntryPoint:!1,Events:[go,er,Li,Fc,Lc,cs]},Rr={findFiberByHostInstance:Tn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Pg={bundleType:Rr.bundleType,version:Rr.version,rendererPackageName:Rr.rendererPackageName,rendererConfig:Rr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Jt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=zc(e),e===null?null:e.stateNode},findFiberByHostInstance:Rr.findFiberByHostInstance||Ng,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Or=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Or.isDisabled&&Or.supportsFiber))try{Ti=Or.inject(Pg),Rt=Or}catch{}var Or;ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Tg;ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vs(t))throw Error(S(200));return Cg(e,t,null,n)};ut.createRoot=function(e,t){if(!vs(e))throw Error(S(299));var n=!1,r="",o=gp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=hs(e,1,!1,null,null,n,!1,r,o),e[Yt]=t.current,ro(e.nodeType===8?e.parentNode:e),new ms(t)};ut.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(S(188)):(e=Object.keys(e).join(","),Error(S(268,e)));return e=zc(t),e=e===null?null:e.stateNode,e};ut.flushSync=function(e){return zn(e)};ut.hydrate=function(e,t,n){if(!Ui(t))throw Error(S(200));return $i(null,e,t,!0,n)};ut.hydrateRoot=function(e,t,n){if(!vs(e))throw Error(S(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",a=gp;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=hp(t,null,e,1,n??null,o,!1,i,a),e[Yt]=t.current,ro(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 ji(t)};ut.render=function(e,t,n){if(!Ui(t))throw Error(S(200));return $i(null,e,t,!1,n)};ut.unmountComponentAtNode=function(e){if(!Ui(e))throw Error(S(40));return e._reactRootContainer?(zn(function(){$i(null,null,e,!1,function(){e._reactRootContainer=null,e[Yt]=null})}),!0):!1};ut.unstable_batchedUpdates=cs;ut.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ui(n))throw Error(S(200));if(e==null||e._reactInternals===void 0)throw Error(S(38));return $i(e,t,n,!1,r)};ut.version="18.3.1-next-f1338f8080-20240426"});var wp=jt((Ev,yp)=>{"use strict";function vp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vp)}catch(e){console.error(e)}}vp(),yp.exports=mp()});var kp=jt(ys=>{"use strict";var xp=wp();ys.createRoot=xp.createRoot,ys.hydrateRoot=xp.hydrateRoot;var Tv});var _p=jt(Hi=>{"use strict";var Mg=Ut(),Fg=Symbol.for("react.element"),Lg=Symbol.for("react.fragment"),Ig=Object.prototype.hasOwnProperty,Rg=Mg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Og={key:!0,ref:!0,__self:!0,__source:!0};function bp(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)Ig.call(t,r)&&!Og.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:Fg,type:e,key:i,ref:a,props:o,_owner:Rg.current}}Hi.Fragment=Lg;Hi.jsx=bp;Hi.jsxs=bp});var De=jt((Fv,Sp)=>{"use strict";Sp.exports=_p()});var Us=`/* ---------------------------------------------------------------
9
9
  Workflow Editor \u2014 bold redesign
10
10
  Design system:
11
11
  - Type: Space Grotesk (UI), JetBrains Mono (identifiers/expr),
@@ -1467,10 +1467,10 @@ Error generating stack: `+i.message+`
1467
1467
  #wfe-root .app[data-menu="open"] > .run { left: 14px; }
1468
1468
  #wfe-root .app > .run { width: min(320px, calc(100% - 28px)); max-height: 45%; }
1469
1469
  }
1470
- `;var Zp=ge(kp(),1);var U=ge(Ut(),1);var Le=ge(Ut(),1);var y=ge(De(),1),Y=({children:e,size:t=14,...n})=>(0,y.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}),K={gitlab:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M8 14L2 7l1.2-4.5L5 7h6l1.8-4.5L14 7z"})}),clock:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"8",cy:"8",r:"5.5"}),(0,y.jsx)("path",{d:"M8 5v3l2 1.5"})]}),hook:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M4 3v4a4 4 0 0 0 4 4h4"}),(0,y.jsx)("path",{d:"M10 9l2 2-2 2"})]}),play:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M5 3.5l7 4.5-7 4.5z",fill:"currentColor"})}),box:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("rect",{x:"2.5",y:"2.5",width:"11",height:"11",rx:"1.5"}),(0,y.jsx)("path",{d:"M2.5 6h11M6 2.5v11"})]}),branch:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"4",cy:"4",r:"1.5"}),(0,y.jsx)("circle",{cx:"12",cy:"12",r:"1.5"}),(0,y.jsx)("circle",{cx:"12",cy:"4",r:"1.5"}),(0,y.jsx)("path",{d:"M4 5.5v3a2 2 0 0 0 2 2h4.5"}),(0,y.jsx)("path",{d:"M12 5.5v5"})]}),stop:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1"})}),msg:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M2.5 3.5h11v8h-6l-3 2.5v-2.5h-2z"})}),tag:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M8 2h5v5l-6 6-5-5z"}),(0,y.jsx)("circle",{cx:"10.5",cy:"5.5",r:.8,fill:"currentColor"})]}),bell:()=>(0,y.jsx)(Y,{children:(0,y.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,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"8",cy:"8",r:"5.5"}),(0,y.jsx)("path",{d:"M2.5 8h11M8 2.5c2 2 2 9 0 11M8 2.5c-2 2-2 9 0 11"})]}),search:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"7",cy:"7",r:"4"}),(0,y.jsx)("path",{d:"M10 10l3.5 3.5"})]}),undo:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M4 7h6a3 3 0 0 1 0 6H7"}),(0,y.jsx)("path",{d:"M6.5 4.5L4 7l2.5 2.5"})]}),redo:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M12 7H6a3 3 0 0 0 0 6h3"}),(0,y.jsx)("path",{d:"M9.5 4.5L12 7 9.5 9.5"})]}),save:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M3 3h8l2 2v8H3z"}),(0,y.jsx)("path",{d:"M5 3v4h6V3M5 13v-4h6v4"})]}),run:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M5 3.5l7 4.5-7 4.5z",fill:"currentColor"})}),stop2:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("rect",{x:"4",y:"4",width:"8",height:"8",rx:"1",fill:"currentColor"})}),sun:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"8",cy:"8",r:"2.75"}),(0,y.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,y.jsx)(Y,{children:(0,y.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,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M8 3v10M3 8h10"})}),trash:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M3 4.5h10M6 4.5V3h4v1.5M4.5 4.5l.5 8h6l.5-8"})}),chev:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M4 6l4 4 4-4"})}),x:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M4 4l8 8M12 4l-8 8"})}),more:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"4",cy:"8",r:"1",fill:"currentColor",stroke:"none"}),(0,y.jsx)("circle",{cx:"8",cy:"8",r:"1",fill:"currentColor",stroke:"none"}),(0,y.jsx)("circle",{cx:"12",cy:"8",r:"1",fill:"currentColor",stroke:"none"})]}),check:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M3 8.5l3 3 7-7"})}),warn:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M8 2l6 11H2z"}),(0,y.jsx)("path",{d:"M8 6.5v3M8 11.2v.3"})]}),err:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"8",cy:"8",r:"5.5"}),(0,y.jsx)("path",{d:"M8 5v3.5M8 10.5v.3"})]}),zoomin:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"7",cy:"7",r:"4"}),(0,y.jsx)("path",{d:"M10 10l3.5 3.5M5 7h4M7 5v4"})]}),zoomout:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"7",cy:"7",r:"4"}),(0,y.jsx)("path",{d:"M10 10l3.5 3.5M5 7h4"})]}),fit:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M3 5V3h2M13 5V3h-2M3 11v2h2M13 11v2h-2"}),(0,y.jsx)("rect",{x:"6",y:"6",width:"4",height:"4",rx:.5})]}),minus:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M3 8h10"})}),kbd:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("rect",{x:"1.5",y:"4",width:"13",height:"8",rx:"1.5"}),(0,y.jsx)("path",{d:"M4 7h.5M6 7h.5M8 7h.5M10 7h.5M4 10h7"})]}),lightning:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M9 2L3 9h4l-1 5 6-7H8z",fill:"currentColor",fillOpacity:.2})}),variable:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M4 3c-2 3-2 7 0 10M12 3c2 3 2 7 0 10"}),(0,y.jsx)("path",{d:"M6 7.5h.5l1 1 1-1h.5M6 10l1.5-1.5M9 10l-1.5-1.5"})]}),users:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"6",cy:"6",r:"2"}),(0,y.jsx)("path",{d:"M2.5 12c.5-2 2-3 3.5-3s3 1 3.5 3"}),(0,y.jsx)("circle",{cx:"11",cy:"5",r:"1.5"}),(0,y.jsx)("path",{d:"M10 10.5c.5-1 1.2-1.5 2-1.5 1 0 2 .8 2.3 2"})]}),grid:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("rect",{x:"2.5",y:"2.5",width:"4",height:"4"}),(0,y.jsx)("rect",{x:"9.5",y:"2.5",width:"4",height:"4"}),(0,y.jsx)("rect",{x:"2.5",y:"9.5",width:"4",height:"4"}),(0,y.jsx)("rect",{x:"9.5",y:"9.5",width:"4",height:"4"})]}),eye:()=>(0,y.jsxs)(Y,{children:[(0,y.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,y.jsx)("circle",{cx:"8",cy:"8",r:"1.8"})]}),slide:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1"}),(0,y.jsx)("path",{d:"M5 6h6M5 8.5h4M5 11h5"})]}),gear:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"8",cy:"8",r:"2"}),(0,y.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,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M3 13V3h7l-1 2.5L10 8H3"})}),dup:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1"}),(0,y.jsx)("path",{d:"M3 9V3h6"})]}),layout:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M2.5 3.5h11v9h-11z"}),(0,y.jsx)("path",{d:"M2.5 7h11M7 7v5.5"})]}),panelLeft:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),(0,y.jsx)("path",{d:"M6 3v10"}),(0,y.jsx)("rect",{x:"2.5",y:"3.5",width:"3.5",height:"9",fill:"currentColor",fillOpacity:.18,stroke:"none"})]}),panelRight:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),(0,y.jsx)("path",{d:"M10 3v10"}),(0,y.jsx)("rect",{x:"10",y:"3.5",width:"3.5",height:"9",fill:"currentColor",fillOpacity:.18,stroke:"none"})]})};var ys=[{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.poll",type:"trigger.poll",label:"Something new shows up",hint:"Checks a command every so often; runs once per new item",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"},{id:"node.owner.notify",type:"owner.notify",label:"Tell me",hint:"Send yourself a note through your notifications",glyph:"g-action",icon:"msg"},{id:"node.owner.ask",type:"owner.ask",label:"Ask me to decide",hint:"A decision card; goes on with yes, no or no answer",glyph:"g-branch",icon:"flag"},{id:"node.person.message",type:"person.message",label:"Message someone",hint:"Write to an employee or a client, once you approve the text",glyph:"g-action",icon:"msg"},{id:"node.person.wait",type:"person.wait",label:"Wait for their reply",hint:"Hold until they answer or send a file, with a deadline and reminders",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"}]}],ws=[{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.)"}]}],xs=[{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}],Cp=[{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 ks(e){for(let t of ys){let n=t.items.find(r=>r.type===e);if(n)return n.label}return e}function Np(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.poll":return n("actionId")?`new items from ${n("actionId")}`:"";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"owner.notify":return r(n("text"));case"owner.ask":return r(n("ask"));case"person.message":return[n("to")&&`to ${n("to")}`,r(n("text"))].filter(Boolean).join(" \u2014 ");case"person.wait":return n("timeout")?`waits up to ${n("timeout")}`:"";case"branch":{let o=Array.isArray(t.cases)?t.cases.length:0;return o?`${o} way${o===1?"":"s"} out`:""}default:return""}}var Ep={"owner.ask":{main:"yes",other:["no","expired"]},"person.message":{main:"sent",other:["declined"]},"person.wait":{main:"reply",other:["timeout"]}},Ag="unsure";function Hi(e){return typeof e=="string"?e:""}function zg(e){let t=e.config??{};return e.type==="branch"?[...(Array.isArray(t.cases)?t.cases:[]).map(r=>Hi(r?.to)),Hi(t.default)]:e.type==="rule"?[...(Array.isArray(t.rules)?t.rules:[]).map(r=>Hi(r?.to)),Hi(t.default?.to)]:e.type==="classify"?[...Array.isArray(t.labels)?t.labels.map(String):t.labels&&typeof t.labels=="object"?Object.keys(t.labels):[],Ag]:[]}function jn(e,t=[]){if(e.type==="end")return[];let n=Ep[e.type],r=n?[{name:void 0,label:n.main},...n.other.map(i=>({name:i,label:i}))]:zg(e).filter(Boolean).map(i=>({name:i,label:i})),o=new Set(r.map(i=>i.name??""));n&&o.add(n.main);for(let i of t){if(i.from!==e.id)continue;let a=i.fromPort??"";o.has(a)||(o.add(a),r.push({name:i.fromPort,label:i.fromPort??""}))}return r.length||r.push({name:void 0,label:""}),r}function bs(e,t,n){let r=n?Ep[n]:void 0,o=r&&t.fromPort===r.main?void 0:t.fromPort,i=e.findIndex(a=>(a.name??"")===(o??""));return i<0?0:i}function br(e,t,n){return e*(t+1)/(n+1)}function Dg(e,t){let n=new Map(e.map((s,c)=>[s.id,c])),r=e.map(()=>[]),o=e.map(()=>0);t.forEach((s,c)=>{let d=n.get(s.from),p=n.get(s.to);d===void 0||p===void 0||d===p||(r[d].push(c),o[p]++)});for(let s of r)s.sort((c,d)=>t[c].port-t[d].port);let i=new Set,a=e.map(()=>0),u=[...e.keys()].filter(s=>o[s]===0).concat([...e.keys()]);for(let s of u){if(a[s])continue;let c=[[s,0]];for(a[s]=1;c.length;){let d=c[c.length-1],[p,g]=d;if(g>=r[p].length){a[p]=2,c.pop();continue}d[1]++;let v=r[p][g],b=n.get(t[v].to);a[b]===1?i.add(v):a[b]===0&&(a[b]=1,c.push([b,0]))}}return t.forEach((s,c)=>{s.from===s.to&&i.add(c)}),i}function Tp(e,t,n={}){let r=n.gapX??110,o=n.gapY??40,i=n.margin??40;if(!e.length)return{};let a=new Map(e.map((_,O)=>[_.id,O])),u=Dg(e,t),s=e.map(_=>({id:_.id,w:_.w,h:_.h,ports:Math.max(1,_.ports),dummy:!1,layer:0,out:[],inn:[],key:0,pos:0,c:0})),c=[];t.forEach((_,O)=>{if(u.has(O))return;let V=a.get(_.from),B=a.get(_.to);V===void 0||B===void 0||c.push({a:V,b:B,port:_.port})});let d=s.map(()=>0),p=s.map(()=>[]);for(let _ of c)p[_.a].push(_.b),d[_.b]++;let g=[...s.keys()].filter(_=>d[_]===0),v=[];for(;g.length;){let _=g.shift();v.push(_);for(let O of p[_])s[O].layer=Math.max(s[O].layer,s[_].layer+1),--d[O]===0&&g.push(O)}{let _=s.map(()=>[]);for(let $ of c)_[$.a].push({b:$.b,port:$.port});_.forEach($=>$.sort((J,Z)=>J.port-Z.port));let O=0,V=new Set,B=$=>{let J=[$];for(;J.length;){let Z=J.pop();if(!V.has(Z)){V.add(Z),s[Z].key=O++;for(let le=_[Z].length-1;le>=0;le--)J.push(_[Z][le].b)}}};v.forEach($=>{c.some(J=>J.b===$)||B($)}),v.forEach(B)}for(let _ of c){let O=_.a,V=_.port;for(let B=s[_.a].layer+1;B<s[_.b].layer;B++){let $=s.length;s.push({id:"",w:0,h:0,ports:1,dummy:!0,layer:B,out:[],inn:[],key:s[_.a].key+(B-s[_.a].layer)/100,pos:0,c:0}),s[O].out.push({v:$,port:V}),s[$].inn.push({v:O,port:V}),O=$,V=0}s[O].out.push({v:_.b,port:V}),s[_.b].inn.push({v:O,port:V})}let b=Math.max(...s.map(_=>_.layer))+1,w=Array.from({length:b},()=>[]);s.forEach((_,O)=>w[_.layer].push(O)),w.forEach(_=>_.sort((O,V)=>s[O].key-s[V].key));let G=()=>w.forEach(_=>_.forEach((O,V)=>{s[O].pos=V}));G();let f=(_,O)=>(O+1)/(s[_].ports+1)-.5,h=()=>{let _=0;for(let O=0;O+1<b;O++){let V=[];for(let B of w[O])for(let $ of s[B].out)V.push([s[B].pos+f(B,$.port)*.9,s[$.v].pos]);for(let B=0;B<V.length;B++)for(let $=B+1;$<V.length;$++)(V[B][0]-V[$][0])*(V[B][1]-V[$][1])<0&&_++}return _},m=w.map(_=>[..._]),x=h();for(let _=0;_<12&&x>0;_++){let O=_%2===0,V=O?[...Array(b).keys()].slice(1):[...Array(b).keys()].reverse().slice(1);for(let $ of V){let J=new Map;for(let Z of w[$]){let le=O?s[Z].inn.map(we=>s[we.v].pos+f(we.v,we.port)*.9):s[Z].out.map(we=>s[we.v].pos-f(Z,we.port)*.9);J.set(Z,le.length?le.reduce((we,nt)=>we+nt,0)/le.length:s[Z].pos)}w[$].sort((Z,le)=>J.get(Z)-J.get(le)),w[$].forEach((Z,le)=>{s[Z].pos=le})}let B=h();B<x&&(x=B,m=w.map($=>[...$]))}m.forEach((_,O)=>{w[O]=_}),G();let C=_=>s[_].dummy?8:s[_].h,F=(_,O)=>s[_].dummy&&s[O].dummy?12:s[_].dummy||s[O].dummy?o/2:o,L=(_,O)=>C(_)/2+F(_,O)+C(O)/2;for(let _ of w){let O=0;_.forEach((B,$)=>{$&&(O+=L(_[$-1],B)),s[B].c=O});let V=O/2;_.forEach(B=>{s[B].c-=V})}let R=(_,O)=>s[_].c-C(_)/2+(s[_].dummy?C(_)/2:br(C(_),O,s[_].ports)),H=(_,O)=>{let V=[0];for(let J=1;J<_.length;J++)V.push(V[J-1]+L(_[J-1],_[J]));let B=[];_.forEach((J,Z)=>{let le=s[J].dummy?.3:1;for(B.push({sum:(O[Z]-V[Z])*le,w:le,n:1});B.length>1;){let we=B[B.length-1],nt=B[B.length-2];if(nt.sum/nt.w<=we.sum/we.w)break;B.splice(B.length-2,2,{sum:nt.sum+we.sum,w:nt.w+we.w,n:nt.n+we.n})}});let $=0;for(let J of B)for(let Z=0;Z<J.n;Z++,$++)s[_[$]].c=J.sum/J.w+V[$]};for(let _=0;_<8;_++){let O=_%2===0,V=O?[...Array(b).keys()].slice(1):[...Array(b).keys()].reverse().slice(1);for(let B of V){let $=w[B].map(J=>{let Z=O?s[J].inn.map(le=>R(le.v,le.port)):s[J].out.map(le=>s[le.v].c-(R(J,le.port)-s[J].c));return Z.length?Z.reduce((le,we)=>le+we,0)/Z.length:s[J].c});H(w[B],$)}}let z=[],Se=i;for(let _ of w){z.push(Se);let O=Math.max(0,..._.filter(V=>!s[V].dummy).map(V=>s[V].w));Se+=(O||40)+r}let tt=s.filter(_=>!_.dummy),vt=Math.min(...tt.map(_=>_.c-_.h/2)),zt={};for(let _ of tt)zt[_.id]={x:Math.round(z[_.layer]),y:Math.round(_.c-_.h/2-vt+i)};return zt}var Wg={trigger:220,branch:240,action:220,end:160,agent:240,checkpoint:220,transform:220},jg={trigger:46,branch:92,action:78,end:46,agent:104,checkpoint:92,transform:78},Ug=26;function _s(e){return e.startsWith("trigger.")?"trigger":e.startsWith("action.")?"action":e}function et(e,t=[]){let n=_s(e.type),r=jn(e,t).length,o=Math.max(jg[n]??92,r>1?18+Ug*r:0);return{w:Wg[n]??220,h:o}}function Ss(e,t,n){let{w:r,h:o}=et(e,n),i=jn(e,n),a=bs(i,t,e.type);return{x:(e.position?.x??0)+r,y:(e.position?.y??0)+br(o,a,i.length)}}function Pp(e,t){let{h:n}=et(e,t);return{x:e.position?.x??0,y:(e.position?.y??0)+n/2}}function vo(e,t){let n=new Map(e.map(r=>[r.id,r]));return Tp(e.map(r=>({id:r.id,...et(r,t),ports:jn(r,t).length})),t.filter(r=>n.has(r.from)&&n.has(r.to)).map(r=>{let o=n.get(r.from);return{from:r.from,to:r.to,port:bs(jn(o,t),r,o.type)}}))}function Mp(e){return e.some(t=>!t.position)?!0:e.length>1&&new Set(e.map(t=>`${t.position.x},${t.position.y}`)).size===1}var j=ge(De(),1);function bn(e){return e.position?.x??0}function Et(e){return e.position?.y??0}function Fp(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 $g(e,t,n){return`M ${e.x} ${e.y} C ${e.x+28*2} ${e.y}, ${e.x+28*2} ${n}, ${e.x} ${n} L ${t.x} ${n} C ${t.x-28*2} ${n}, ${t.x-28*2} ${t.y}, ${t.x} ${t.y}`}function Hg(e){let{n:t,edges:n,selected:r,state:o}=e,{w:i,h:a}=et(t,n),u=jn(t,n),s=_s(t.type),c=Np(t.type,t.config??{}),d=t.config,p=s==="trigger"?d.source==="cron"?"clock":d.source==="webhook"||d.source==="hook"?"hook":d.source==="manual"?"play":"gitlab":s==="agent"?"box":s==="branch"?"branch":s==="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":s==="checkpoint"?"flag":s==="transform"?"variable":"stop",g=K[p]??K.box,v=["node",`t-${s}`,r&&"is-selected",e.drop&&"is-drop",o==="running"&&"is-running",o==="visited"&&"is-visited",o==="error"&&"is-error"].filter(Boolean).join(" "),b={left:bn(t),top:Et(t),width:i,height:a},w=d.agentId,G=d.prompt;return(0,j.jsxs)("div",{className:v,style:b,tabIndex:0,role:"button","data-node":t.id,"aria-label":`${ks(t.type)} ${t.id}`,"aria-pressed":r,onPointerDown:f=>e.onMouseDown?.(f,t),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),e.onClick?.(f,t))},onClick:f=>e.onClick?.(f,t),onDoubleClick:f=>e.onDoubleClick?.(f,t),children:[(0,j.jsx)("div",{className:"node__stripe"}),(0,j.jsxs)("div",{className:"node__head",children:[(0,j.jsx)("div",{className:"node__icon",children:(0,j.jsx)(g,{})}),(0,j.jsxs)("div",{className:"node__meta",children:[(0,j.jsx)("div",{className:"node__kind",children:ks(t.type)}),(0,j.jsx)("div",{className:"node__name",children:t.id})]}),s!=="trigger"&&s!=="end"&&(0,j.jsx)("div",{className:"node__chev",children:(0,j.jsx)(K.more,{})})]}),c&&(0,j.jsx)("div",{className:"node__body",children:(0,j.jsx)("div",{className:"node__row node__row--summary",children:c})}),s!=="trigger"&&(0,j.jsx)("div",{className:"handle h-in",title:"Drop a connection here",onPointerDown:f=>e.onPortDown?.(f,t,null),onPointerEnter:()=>e.onPortEnter?.(t),onPointerLeave:()=>e.onPortLeave?.()}),u.map((f,h)=>(0,j.jsx)("div",{className:"handle h-out"+(f.label?" has-label":""),style:{top:br(a,h,u.length)},title:f.label?`Leaves here when: ${f.label}`:"Drag to connect",onPointerDown:m=>e.onPortDown?.(m,t,f),children:f.label&&(0,j.jsx)("span",{className:"handle__label",children:f.label})},f.name??""))]})}function Bg({nodes:e,edges:t,viewBox:n,selection:r,hostRef:o}){let[i,a]=(0,Le.useState)(!1);if(!e.length)return null;let u=60,s=e.map(H=>bn(H)),c=e.map(H=>Et(H)),d=e.map(H=>et(H,t).w),p=e.map(H=>et(H,t).h),g=Math.min(...s)-u,v=Math.min(...c)-u,b=Math.max(...s.map((H,z)=>H+d[z]))+u,w=Math.max(...c.map((H,z)=>H+p[z]))+u,G=b-g,f=w-v,h=o.current?.getBoundingClientRect(),m=h?.width??800,x=h?.height??500,C=-n.tx/n.zoom,F=-n.ty/n.zoom,L=m/n.zoom,R=x/n.zoom;return(0,j.jsxs)("div",{className:"cv__mini"+(i?" is-collapsed":""),children:[(0,j.jsxs)("div",{className:"cv__mini-head",children:[(0,j.jsx)("span",{children:"Map"}),(0,j.jsx)("button",{onClick:()=>a(!i),children:(0,j.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:(0,j.jsx)("path",{d:i?"M2 4l3 3 3-3":"M2 6l3-3 3 3",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round"})})})]}),!i&&(0,j.jsxs)("svg",{viewBox:`${g} ${v} ${G} ${f}`,preserveAspectRatio:"xMidYMid meet",children:[(0,j.jsx)("rect",{className:"mini-view",x:C,y:F,width:L,height:R}),e.map(H=>{let z=et(H,t),Se=r?.kind==="node"&&r.id===H.id;return(0,j.jsx)("rect",{className:"mini-node"+(Se?" sel":""),x:bn(H),y:Et(H),width:z.w,height:z.h,rx:3},H.id)})]})]})}var Cs=.2,Lp=2,Gg=.6;function Ip(e,t){let n=1/0,r=1/0,o=-1/0,i=-1/0;for(let a of e){let u=et(a,t);n=Math.min(n,bn(a)),r=Math.min(r,Et(a)),o=Math.max(o,bn(a)+u.w),i=Math.max(i,Et(a)+u.h)}return{minX:n,minY:r,maxX:o,maxY:i}}function Rp(e){let{nodes:t,edges:n,selection:r,setSelection:o,onNodeMove:i,onAddNode:a,onConnect:u,runState:s,viewBox:c,setViewBox:d}=e,p=e.editable!==!1,g=(0,Le.useRef)(null),[v,b]=(0,Le.useState)(null),[w,G]=(0,Le.useState)(null),[f,h]=(0,Le.useState)(!1),[m,x]=(0,Le.useState)(null),[C,F]=(0,Le.useState)(null),[L,R]=(0,Le.useState)(null),{zoom:H,tx:z,ty:Se}=c,tt=(0,Le.useMemo)(()=>new Map(t.map(N=>[N.id,N])),[t]),vt=(N,D)=>{let I=g.current;if(!I)return{x:0,y:0};let Q=I.getBoundingClientRect();return{x:(N-Q.left-z)/H,y:(D-Q.top-Se)/H}},zt=N=>{let D=N.target;D!==N.currentTarget&&!D.classList.contains("cv__viewport")&&!D.classList.contains("cv__edges")||N.button!==0&&N.button!==1||(o(null),F({startX:N.clientX,startY:N.clientY,tx:z,ty:Se}))},_=(N,D)=>{if(N.target.classList.contains("handle")||(N.stopPropagation(),o({kind:"node",id:D.id}),!p))return;let I=vt(N.clientX,N.clientY);b({id:D.id,offX:I.x-bn(D),offY:I.y-Et(D)})},O=(N,D,I)=>{if(N.stopPropagation(),N.preventDefault(),!p||!I)return;let Q=Ss(D,{from:D.id,fromPort:I.name,to:""},n);G({from:{id:D.id,port:I},start:Q,x:Q.x,y:Q.y})},V=N=>{w&&x(N.id)},B=()=>x(null);(0,Le.useEffect)(()=>{if(!v&&!w&&!C)return;let N=I=>{if(v){let Q=vt(I.clientX,I.clientY);i(v.id,Math.round(Q.x-v.offX),Math.round(Q.y-v.offY))}else if(w){let Q=vt(I.clientX,I.clientY);G(se=>se&&{...se,x:Q.x,y:Q.y});let ee=document.elementFromPoint(I.clientX,I.clientY)?.closest("[data-node]");x(ee?ee.dataset.node??null:null)}else C&&d(Q=>({...Q,tx:C.tx+(I.clientX-C.startX),ty:C.ty+(I.clientY-C.startY)}))},D=()=>{w&&m&&m!==w.from.id&&!tt.get(m)?.type.startsWith("trigger.")&&u({from:w.from.id,fromPort:w.from.port.name,to:m}),v&&e.onNodeMoved?.(v.id),b(null),G(null),F(null),x(null)};return window.addEventListener("pointermove",N),window.addEventListener("pointerup",D),window.addEventListener("pointercancel",D),()=>{window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",D),window.removeEventListener("pointercancel",D)}},[v,w,C,m,u,i,d,tt]);let $=N=>{if(!N.ctrlKey&&!N.metaKey&&Math.abs(N.deltaY)<30){d(ae=>({...ae,tx:ae.tx-N.deltaX,ty:ae.ty-N.deltaY}));return}let D=g.current;if(!D)return;let I=D.getBoundingClientRect(),Q=N.clientX-I.left,ee=N.clientY-I.top,se=-N.deltaY*.0015;d(ae=>{let yt=Math.min(Lp,Math.max(Cs,ae.zoom*(1+se))),rt=yt/ae.zoom;return{zoom:yt,tx:Q-(Q-ae.tx)*rt,ty:ee-(ee-ae.ty)*rt}})};(0,Le.useEffect)(()=>{let N=g.current;if(!N)return;let D=I=>{(I.ctrlKey||I.metaKey)&&I.preventDefault()};return N.addEventListener("wheel",D,{passive:!1}),()=>N.removeEventListener("wheel",D)},[]);let J=N=>{let D=g.current?.getBoundingClientRect(),I=(D?.width??800)/2,Q=(D?.height??500)/2;d(ee=>{let se=Math.min(Lp,Math.max(Cs,ee.zoom*N)),ae=se/ee.zoom;return{zoom:se,tx:I-(I-ee.tx)*ae,ty:Q-(Q-ee.ty)*ae}})},Z=(N=!1)=>{let D=g.current;if(!D||!t.length)return;let I=D.getBoundingClientRect();if(!I.width||!I.height)return;let Q=48,ee=Ip(t,n),se=ee.maxX-ee.minX+Q*2,ae=ee.maxY-ee.minY+Q*2+40,yt=N?Math.min(Gg,1):Cs,rt=Math.max(yt,Math.min(1,I.width/se,I.height/ae)),Gn=(ee.maxX-ee.minX)*rt,Dt=(ee.maxY-ee.minY)*rt;d({zoom:rt,tx:(Gn+Q*2<=I.width?(I.width-Gn)/2:Q)-ee.minX*rt,ty:(Dt+Q*2<=I.height?(I.height-Dt)/2:Q)-ee.minY*rt})};(0,Le.useEffect)(()=>{e.fitSignal&&requestAnimationFrame(()=>Z(!0))},[e.fitSignal]),(0,Le.useEffect)(()=>{let N=()=>Z(),D=g.current;return D?.addEventListener("wfe:fit",N),()=>D?.removeEventListener("wfe:fit",N)});let le=N=>{p&&(N.preventDefault(),h(!0))},we=()=>h(!1),nt=N=>{if(N.preventDefault(),h(!1),!p)return;let D=N.dataTransfer.getData("application/x-wfe-item");if(D)try{let I=JSON.parse(D),Q=vt(N.clientX,N.clientY);a(I,Q.x-100,Q.y-40)}catch{}},As=N=>{let D=N.id??"",I=["wfe-edge"];return r?.kind==="edge"&&r.id===D&&I.push("is-selected"),L===D&&I.push("is-hover"),s?.currentEdgeId===D&&I.push("is-running"),D&&s?.visitedEdges?.has(D)&&I.push("is-visited"),I.join(" ")},Sn=N=>s?.currentNodeId===N.id?"running":s?.visitedNodes?.has(N.id)?"visited":null,Te=(0,Le.useMemo)(()=>{let N=t.length?Ip(t,n):{minX:0,minY:0,maxX:800,maxY:600};return{x:Math.min(0,N.minX)-400,y:Math.min(0,N.minY)-400,w:Math.max(N.maxX,0)-Math.min(0,N.minX)+800,h:Math.max(N.maxY,0)-Math.min(0,N.minY)+800}},[t,n]),Hn=(N,D,I,Q)=>{let ee=Math.max(I,Q);for(let se of t){let ae=et(se,n);bn(se)+ae.w>=Math.min(N.x,D.x)-40&&bn(se)<=Math.max(N.x,D.x)+40&&(ee=Math.max(ee,Et(se)+ae.h))}return ee+36},Bn=(0,Le.useMemo)(()=>w?(0,j.jsx)("svg",{className:"cv__ghost-edge",style:{left:Te.x,top:Te.y},width:Te.w,height:Te.h,viewBox:`${Te.x} ${Te.y} ${Te.w} ${Te.h}`,children:(0,j.jsx)("path",{d:Fp(w.start,{x:w.x,y:w.y})})}):null,[w,Te]);return(0,j.jsxs)("div",{className:"cv"+(C?" is-panning":"")+(f?" is-drop-target":"")+(w?" is-connecting":""),ref:g,onWheel:$,onPointerDown:zt,onDragOver:le,onDragLeave:we,onDrop:nt,children:[(0,j.jsxs)("div",{className:"cv__viewport",style:{transform:`translate(${z}px, ${Se}px) scale(${H})`},children:[(0,j.jsxs)("svg",{className:"cv__edges",style:{left:Te.x,top:Te.y},width:Te.w,height:Te.h,viewBox:`${Te.x} ${Te.y} ${Te.w} ${Te.h}`,children:[(0,j.jsxs)("defs",{children:[(0,j.jsx)("marker",{id:"arr",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto",children:(0,j.jsx)("path",{d:"M0 0L10 5L0 10z",fill:"currentColor"})}),(0,j.jsx)("marker",{id:"arr-acc",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto",children:(0,j.jsx)("path",{d:"M0 0L10 5L0 10z",fill:"var(--accent)"})})]}),n.map((N,D)=>{let I=tt.get(N.from),Q=tt.get(N.to);if(!I||!Q)return null;let ee=N.id??`e-${D}`,se=Ss(I,N,n),ae=Pp(Q,n),yt=ae.x<se.x+24,rt=yt?$g(se,ae,Hn(se,ae,Et(I)+et(I,n).h,Et(Q)+et(Q,n).h)):Fp(se,ae),Gn=s?.currentEdgeId===ee||s?.visitedEdges?.has(ee)?"url(#arr-acc)":"url(#arr)",Dt=N.label&&!(I.type==="branch"||I.type==="rule"||I.type==="classify")?N.label:"",Pt=yt?{x:(se.x+ae.x)/2,y:Hn(se,ae,Et(I)+et(I,n).h,Et(Q)+et(Q,n).h)}:{x:(se.x+ae.x)/2,y:(se.y+ae.y)/2};return(0,j.jsxs)("g",{children:[(0,j.jsx)("path",{className:"edge-bg",d:rt,onPointerEnter:()=>R(ee),onPointerLeave:()=>R(null),onClick:()=>o({kind:"edge",id:ee})}),(0,j.jsx)("path",{className:As(N)+(yt?" is-loop":""),d:rt,markerEnd:Gn}),Dt&&(0,j.jsxs)("g",{transform:`translate(${Pt.x},${Pt.y})`,children:[(0,j.jsx)("rect",{className:"edge-label-bg",x:-Dt.length*3.6-6,y:-9,rx:3,width:Dt.length*7.2+12,height:18}),(0,j.jsx)("text",{className:"edge-label",y:4,textAnchor:"middle",children:Dt})]})]},ee)})]}),Bn,t.map(N=>(0,j.jsx)(Hg,{n:N,edges:n,selected:r?.kind==="node"&&r.id===N.id,state:Sn(N),drop:!!w&&m===N.id,onMouseDown:_,onPortDown:O,onPortEnter:V,onPortLeave:B,onClick:(D,I)=>{D.stopPropagation(),o({kind:"node",id:I.id})}},N.id))]}),(0,j.jsxs)("div",{className:"cv__controls",role:"toolbar","aria-label":"Zoom",children:[(0,j.jsx)("button",{type:"button",title:"Zoom out","aria-label":"Zoom out",onClick:()=>J(1/1.2),children:(0,j.jsx)(K.zoomout,{})}),(0,j.jsxs)("div",{className:"cv__zoom",children:[Math.round(H*100),"%"]}),(0,j.jsx)("button",{type:"button",title:"Zoom in","aria-label":"Zoom in",onClick:()=>J(1.2),children:(0,j.jsx)(K.zoomin,{})}),(0,j.jsx)("button",{type:"button",title:"Fit the workflow in view (F)","aria-label":"Fit",onClick:()=>Z(),children:(0,j.jsx)(K.fit,{})})]}),(0,j.jsx)(Bg,{nodes:t,edges:n,viewBox:c,selection:r,hostRef:g})]})}var fe=ge(Ut(),1);var Vg=[{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"]}],Kg=[{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"}],Yg=[{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."}],Qg=[{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`."}],Xg=[{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."}],Jg=[{path:"labels",type:"array",description:"Current label list on the entity. Use with a `branch` node to route on label state."}],qg=[{path:"emoji",type:"string",description:"The emoji reaction that was applied (echoes the input for debugging)."}],Zg=[{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."}],em=[{path:"durationMs",type:"number",description:"Duration logged, in milliseconds (echoed for downstream use)."}],tm=[{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."}],nm=[{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."}],rm=[{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."}],om=[{path:"port",type:"string",description:"Which outgoing port matched. Downstream edges with `fromPort` matching this value will fire."}],im=[{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"'}],am=[{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)."}],lm=[{path:"event",type:"any",description:"Payload of the event that resumed this checkpoint. Fields mirror whichever trigger source delivered the resume event."}],sm=[{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."}],um=[{path:"emittedAt",type:"string",description:"ISO-8601 time the signal was published."}],cm=[{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."}],dm=[{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)."}],Ns={"trigger.channel":{summary:"Raw event payload from the source channel. Shape varies by `source` \u2014 the Context panel filters accordingly.",fields:Vg},"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."}]},"trigger.poll":{summary:"Runs a registered action on an interval and starts one run per new item it prints (one JSON object per line). The item is the payload.",fields:[{path:"",type:"any",description:"The item's own fields, e.g. `{{trigger.msgId}}`, `{{trigger.text}}`. Whatever the poll command printed for this item."}]},agent:{summary:"Agent response after executing the prompt template.",fields:Kg},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:im},transform:{summary:"Value picked from upstream context (path mode) or rendered template bundle (template mode).",fields:am},branch:{summary:"Which outgoing port fired. Downstream edges match via `fromPort`.",fields:om},"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:Yg},"action.createIssue":{summary:"Created an issue on GitLab/GitHub.",fields:Qg},"action.setLabel":{summary:"Added/removed labels on a GitLab issue or MR.",fields:Xg},"action.readLabel":{summary:"Fetched the current label list \u2014 useful before a `branch`.",fields:Jg},"action.react":{summary:"Emoji reaction on a message (Telegram/WhatsApp).",fields:qg},"action.editMessage":{summary:"Edited an existing message in place.",fields:Zg},"action.logTime":{summary:"Logged time spent on a GitLab issue/MR.",fields:em},"action.callHTTP":{summary:"Made an outbound HTTP request with templated params.",fields:tm},"action.run":{summary:"Invoked a registered action from the action registry. Output is the full ActionRunResult.",fields:nm},"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:rm},subProcess:{summary:"Spawned a child workflow and waited for its completion.",fields:dm},"signal.emit":{summary:"Published a signal to the bus. Runs elsewhere can resume on it via `signal.wait`.",fields:um},"signal.wait":{summary:"Paused until a matching signal arrives. Resumes with that signal in this node's output.",fields:sm},"timer.boundary":{summary:"Paused until a timer elapses. Resumes with timing metadata.",fields:cm},checkpoint:{summary:"Paused until a matching resume event arrives on this entity.",fields:lm},end:{summary:"Terminal node \u2014 closes the run with the configured status. No output downstream.",fields:[]},"owner.notify":{summary:"Told the owner, through the node's notifications.",fields:[{path:"text",type:"string",description:"What the owner was told."},{path:"sentAt",type:"string",description:"When (ISO time)."}]},"owner.ask":{summary:"The owner's answer on a decision card. Leaves on port yes, no or expired.",fields:[{path:"port",type:"string",description:"yes, no or expired.",example:'"yes"'},{path:"choice",type:"string",description:"The option the owner picked, when the card offered choices."},{path:"text",type:"string",description:"The draft as the owner approved it, after any edit."},{path:"note",type:"string",description:"The owner's note on the card."},{path:"cardId",type:"string",description:"The decision card's id."}]},"person.message":{summary:"A message to a person, sent once the owner approved it. Leaves on port sent or declined.",fields:[{path:"text",type:"string",description:"The text that was sent (the owner may have edited it)."},{path:"channel",type:"string",description:"Channel it went out on."},{path:"chatId",type:"string",description:"The person's chat."},{path:"messageId",type:"string",description:"Id of the sent message, when the channel gives one."},{path:"approved",type:"string",description:"start (approved with the run) or step (on its own card)."}]},"person.wait":{summary:"A person's reply. Leaves on port reply, or timeout when the deadline passed.",fields:[{path:"text",type:"string",description:"What the person wrote."},{path:"from",type:"string",description:"Sender id."},{path:"media",type:"any",description:"Attached file, when they sent one."},{path:"reminders",type:"number",description:"Reminders sent before the reply came."},{path:"timedOut",type:"bool",description:"True on the timeout port."}]}};function Op(e,t={}){let n=Ns[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=ge(De(),1);function W({title:e,children:t,defaultOpen:n=!0,right:r}){let[o,i]=(0,fe.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)(K.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)(K.err,{}),n]})]})}function A({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 _n({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 Bi({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 ke({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 Gi({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 Tt({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 pm(e){return typeof e=="boolean"?"boolean":typeof e=="number"?"number":Array.isArray(e)?"list":e&&typeof e=="object"?"json":"string"}function $n({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)(fm,{k:s,v:c,allowedTypes:o,keyPlaceholder:n,valuePlaceholder:r,onKey:p=>{let g=a.slice();g[d]=[p,g[d][1]],u(g)},onValue:p=>{let g=a.slice();g[d]=[g[d][0],p],u(g)},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 fm({k:e,v:t,allowedTypes:n,keyPlaceholder:r,valuePlaceholder:o,onKey:i,onValue:a,onRemove:u}){let[s,c]=(0,fe.useState)(pm(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(g=>g.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)(Un,{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)(Gi,{checked:!!t,onChange:p=>a(p),label:String(!!t)}),s==="list"&&(0,l.jsx)(Tt,{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 Un({value:e,onChange:t,placeholder:n,rows:r=3}){let[o,i]=(0,fe.useState)(!1),[a,u]=(0,fe.useState)(0),s=(0,fe.useRef)(null),c=(0,fe.useMemo)(()=>{let g=[];return ws.forEach(v=>v.items.forEach(b=>g.push({group:v.group,...b}))),g},[]),d=g=>{let v=s.current;if(!v)return;let b=v.selectionStart,w=e.slice(0,b),G=e.slice(b),h=w.endsWith("{{")?w:w+"{{",m=h+g+"}}"+G;t(m),i(!1),requestAnimationFrame(()=>{v.focus();let x=h.length+g.length+2;v.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:g=>t(g.target.value),onKeyDown:g=>{if(!o){g.key==="{"&&g.shiftKey&&i(!0);return}g.key==="ArrowDown"?(g.preventDefault(),u(v=>(v+1)%c.length)):g.key==="ArrowUp"?(g.preventDefault(),u(v=>(v-1+c.length)%c.length)):g.key==="Enter"||g.key==="Tab"?(g.preventDefault(),d(c[a].path)):g.key==="Escape"&&i(!1)}}),(0,l.jsxs)("div",{className:"fld__hint",style:{display:"flex",alignItems:"center",gap:6,marginTop:4},children:[(0,l.jsx)(K.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)(K.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:ws.map(g=>(0,l.jsxs)(fe.Fragment,{children:[(0,l.jsx)("div",{className:"expr__pop-group",style:{padding:"4px 10px",fontSize:10,color:"var(--muted)",textTransform:"uppercase",letterSpacing:.5},children:g.group}),g.items.map(v=>{let b=c.findIndex(G=>G.path===v.path);return(0,l.jsxs)("div",{onMouseEnter:()=>u(b),onClick:()=>d(v.path),style:{padding:"4px 10px",cursor:"pointer",fontSize:11,display:"flex",justifyContent:"space-between",gap:12,fontFamily:"var(--ax-mono, ui-monospace)",background:b===a?"var(--accent-soft)":"transparent"},children:[(0,l.jsx)("span",{children:`{{${v.path}}}`}),(0,l.jsx)("span",{style:{color:"var(--muted)",fontSize:10},children:v.type})]},v.path)})]},g.group))})]})}function hm({value:e,onChange:t,agents:n}){let[r,o]=(0,fe.useState)(!1),[i,a]=(0,fe.useState)(""),u=(0,fe.useRef)(null);(0,fe.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)(K.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)(A,{value:e??"",onChange:t,placeholder:"agent-id",mono:!0})})]})}var Ps={"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}},gm=Object.entries(Ps).map(([e,t])=>({value:e,label:t.wired?`${t.label} \u2713`:`${t.label} \u26A0 schema-only`}));function mm({node:e,patchData:t}){let n=e.config,r=n.filter??{},o=p=>t({filter:{...r,...p}}),i=String(n.source??"whatsapp-message"),a=Ps[i]??Ps["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)(W,{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)(ke,{value:i,onChange:p=>t({source:p,filter:{}}),options:gm})}),(0,l.jsx)("div",{style:{fontSize:12,color:"var(--muted)",lineHeight:1.5,marginTop:-6,marginBottom:12},children:a.fires})]}),d&&(0,l.jsxs)(W,{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)(A,{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)(A,{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)(A,{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)(Tt,{mono:!0,value:Array.isArray(r.labels)?r.labels:[],onChange:p=>o({labels:p}),placeholder:"bug, needs-review"})})]}),u&&(0,l.jsx)(W,{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)(Gi,{checked:!!n.passthrough,onChange:p=>t({passthrough:p}),label:"Let the default agent also reply"})})})]})}function vm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{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)(A,{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. Europe/London, America/New_York). Defaults to UTC.",children:(0,l.jsx)(A,{mono:!0,value:String(n.timezone??"UTC"),onChange:r=>t({timezone:r}),placeholder:"Europe/London"})}),(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."]})]})}function ym({node:e,patchData:t}){let n=e.config,r=Array.isArray(n.filter)?n.filter.length:0;return(0,l.jsxs)(W,{title:"Poll",children:[(0,l.jsx)(k,{label:"Which saved action",hint:"Slug of a registered action (.agentx/actions/<id>.json). It must print one JSON object per line.",children:(0,l.jsx)(A,{mono:!0,value:String(n.actionId??""),onChange:o=>t({actionId:o}),placeholder:"list-new-messages"})}),(0,l.jsx)(k,{label:"Every (seconds)",hint:"How often the action runs. 5 or more; defaults to 60.",children:(0,l.jsx)(_n,{value:n.everySeconds,onChange:o=>t({everySeconds:o}),placeholder:"60"})}),(0,l.jsx)(k,{label:"Item key",hint:"Field that identifies an item, e.g. msgId. Each key starts one run, once.",children:(0,l.jsx)(A,{mono:!0,value:String(n.key??""),onChange:o=>t({key:o}),placeholder:"id"})}),(0,l.jsxs)("div",{style:{fontSize:12,color:"var(--muted)",lineHeight:1.5,marginTop:4},children:["The first poll only records what is already there. After that, each new item starts one run with its fields as ",(0,l.jsx)("span",{className:"mono",children:"{{trigger.*}}"}),"."," ",r>0?`${r} filter condition(s) set.`:"No filter."," Edit ",(0,l.jsx)("span",{className:"mono",children:"filter"})," under Advanced."]})]})}var Es=[{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 wm({node:e,patchData:t}){let n=e.config,r=String(n.event??"on:"),i=Es.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)(W,{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)(A,{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:Es.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:Es.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 xm(e){return(0,l.jsx)(W,{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 km({node:e,patchData:t,agents:n}){let r=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(W,{title:"Agent",children:[(0,l.jsx)(k,{label:"Which agent runs",children:(0,l.jsx)(hm,{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)(Un,{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)(W,{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)(ke,{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)(_n,{value:r.timeoutMinutes,onChange:o=>t({timeoutMinutes:o}),placeholder:"5"})})]})]})}function bm({node:e,patchData:t}){let n=e.config,[r,o]=(0,fe.useState)(n.template&&typeof n.template=="object"?"template":"path");return(0,l.jsxs)(W,{title:"Transform",children:[(0,l.jsx)(k,{label:"Mode",children:(0,l.jsx)(ke,{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)(A,{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)($n,{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 _m({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)(W,{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,g)=>g!==c)),children:(0,l.jsx)(K.trash,{})})]}),(0,l.jsx)(k,{label:"If",children:(0,l.jsx)(ke,{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)(A,{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)(A,{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)(A,{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)(A,{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)(K.plus,{})," Add case"]})]}),(0,l.jsx)(W,{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)(A,{mono:!0,value:String(n.default??"fallback"),onChange:s=>t({default:s})})})})]})}function Sm({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)(W,{title:"Checkpoint",children:(0,l.jsx)(k,{label:"Name",hint:"Human label shown in logs + run timelines",children:(0,l.jsx)(A,{value:String(n.name??e.id),onChange:a=>t({name:a}),placeholder:"await-label-change"})})}),(0,l.jsxs)(W,{title:"Wait for",children:[(0,l.jsx)(k,{label:"Source",hint:"Which kind of event unpauses this run",children:(0,l.jsx)(ke,{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)(Tt,{mono:!0,value:Array.isArray(r.labels)?r.labels:[],onChange:a=>o({labels:a.length?a:void 0})})})]}),(0,l.jsx)(W,{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)(A,{mono:!0,value:String(i.eventIdLike??""),onChange:a=>t({resumeMatch:{...i,eventIdLike:a||void 0}})})})})]})}function Cm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{title:"Terminal",children:[(0,l.jsx)(k,{label:"Status",children:(0,l.jsx)(ke,{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)(Bi,{value:String(n.summary??""),onChange:r=>t({summary:r}),rows:2})})]})}var Nm=["gitlab","github","whatsapp","telegram","discord","slack"],Ts=new Map,Ap=6e4;function Em(e){let[t,n]=(0,fe.useState)(()=>{let r=Ts.get(e);return r&&Date.now()-r.at<Ap?{chats:r.chats,source:r.source,loading:!1}:{chats:[],source:"",loading:!0}});return(0,fe.useEffect)(()=>{let r=!1,o=Ts.get(e);if(o&&Date.now()-o.at<Ap){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:"";Ts.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 Tm({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=Em(a),s=`chats-${a}`;return(0,l.jsxs)(W,{title:"Send message",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ke,{value:a,onChange:c=>t({channel:c}),options:Nm})}),(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)(A,{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)(Un,{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)(A,{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)(A,{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)(ke,{value:String(r.parseMode??"markdown"),onChange:c=>t({parseMode:c}),options:["markdown","plain","html"]})})]})}function Pm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(W,{title:"Target",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ke,{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)(A,{mono:!0,value:String(n.project??""),onChange:r=>t({project:r}),placeholder:"acme/web"})})]}),(0,l.jsxs)(W,{title:"Issue",children:[(0,l.jsx)(k,{label:"Title",children:(0,l.jsx)(Un,{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)(Un,{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)(Tt,{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)(Tt,{mono:!0,value:Array.isArray(n.assignees)?n.assignees:[],onChange:r=>t({assignees:r}),placeholder:"alice, bob"})})]})]})}function Mm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(W,{title:"Target",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ke,{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)(ke,{value:String(n.kind??"issue"),onChange:r=>t({kind:r}),options:["issue","merge_request"]})}),(0,l.jsx)(k,{label:"Project",children:(0,l.jsx)(A,{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)(A,{mono:!0,value:String(n.iid??""),onChange:r=>t({iid:r}),placeholder:"{{trigger.issue.iid}}"})})]}),(0,l.jsxs)(W,{title:"Labels",children:[(0,l.jsx)(k,{label:"Add",hint:"Comma-separated list",children:(0,l.jsx)(Tt,{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)(Tt,{value:Array.isArray(n.remove)?n.remove:[],onChange:r=>t({remove:r}),placeholder:"Triage"})})]})]})}function Fm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{title:"Read labels",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ke,{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)(ke,{value:String(n.kind??"issue"),onChange:r=>t({kind:r}),options:["issue","merge_request"]})}),(0,l.jsx)(k,{label:"Project",children:(0,l.jsx)(A,{mono:!0,value:String(n.project??""),onChange:r=>t({project:r})})}),(0,l.jsx)(k,{label:"Issue number",children:(0,l.jsx)(A,{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 Lm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{title:"React",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ke,{value:String(n.channel??"telegram"),onChange:r=>t({channel:r}),options:["telegram","whatsapp"]})}),(0,l.jsx)(k,{label:"Chat id",children:(0,l.jsx)(A,{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)(A,{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)(A,{value:String(n.emoji??"\u{1F440}"),onChange:r=>t({emoji:r})})})]})}function Im({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{title:"Edit message",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ke,{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)(A,{mono:!0,value:String(n.chatId??""),onChange:r=>t({chatId:r})})}),(0,l.jsx)(k,{label:"Message id",children:(0,l.jsx)(A,{mono:!0,value:String(n.messageId??""),onChange:r=>t({messageId:r})})}),(0,l.jsx)(k,{label:"Replace the text with",children:(0,l.jsx)(Un,{value:String(n.text??""),onChange:r=>t({text:r}),rows:3})}),(0,l.jsx)(k,{label:"Text formatting",children:(0,l.jsx)(ke,{value:String(n.parseMode??"plain"),onChange:r=>t({parseMode:r}),options:["plain","markdown","html"]})})]})}function Rm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{title:"Log time",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ke,{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)(A,{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)(_n,{value:n.durationMs,onChange:r=>t({durationMs:r}),placeholder:"900000"})})]})}function Om({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(W,{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)(A,{mono:!0,value:String(n.actionId??""),onChange:r=>t({actionId:r}),placeholder:"deploy-staging"})})}),(0,l.jsx)(W,{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)($n,{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 Am({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(W,{title:"Request",children:[(0,l.jsx)(k,{label:"URL",children:(0,l.jsx)(A,{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)(ke,{value:String(n.method??"POST"),onChange:r=>t({method:r}),options:["GET","POST","PUT","PATCH","DELETE"]})})]}),(0,l.jsx)(W,{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)(Un,{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)(W,{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)($n,{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 zm=["text","long-text","number","boolean","date","select","multi-select","file"];function zp({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)(W,{title:"Form",children:[(0,l.jsx)(k,{label:"Title",hint:"Header shown to the assignee above the form",children:(0,l.jsx)(A,{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)(A,{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)(A,{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)(A,{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)(A,{value:e.secondaryAction?.label??"",onChange:s=>t({...e,secondaryAction:{key:e.secondaryAction?.key??"secondary",label:s}}),placeholder:"label (e.g. Reject)"})]})})]}),(0,l.jsxs)(W,{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)(A,{mono:!0,value:s.key,onChange:d=>r(c,{key:d})})}),(0,l.jsx)(k,{label:"Label",children:(0,l.jsx)(A,{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)(ke,{value:s.type,onChange:d=>r(c,{type:d}),options:zm.slice()})}),(0,l.jsx)(k,{label:"",children:(0,l.jsx)(Gi,{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)(Tt,{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)(A,{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)(_n,{value:s.validate?.min,onChange:d=>o(c,{min:d})})}),(0,l.jsx)(k,{label:"Max",children:(0,l.jsx)(_n,{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)(A,{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 Dm({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)(W,{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)(A,{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)(A,{value:String(n.title??""),onChange:o=>t({title:o})})}),(0,l.jsx)(k,{label:"Description",children:(0,l.jsx)(Bi,{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)(A,{mono:!0,value:String(n.dueIn??""),onChange:o=>t({dueIn:o}),placeholder:"P2D"})})]}),(0,l.jsx)(zp,{form:r,patch:o=>t({form:o})})]})}function Wm({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)(W,{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)(A,{mono:!0,value:String(n.startableBy??""),onChange:o=>t({startableBy:o}),placeholder:"role:public"})})}),(0,l.jsx)(zp,{form:r,patch:o=>t({form:o})})]})}function jm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{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)(A,{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)($n,{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 Um({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{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)(A,{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)(ke,{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)($n,{value:n.payload??{},onChange:r=>t({payload:r}),keyPlaceholder:"payload key",valuePlaceholder:"{{trigger.iid}}",emptyHint:"Empty signal payload."})})]})}function $m({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{title:"Wait for signal",children:[(0,l.jsx)(k,{label:"Name",children:(0,l.jsx)(A,{mono:!0,value:String(n.name??""),onChange:r=>t({name:r}),placeholder:"approved"})}),(0,l.jsx)(k,{label:"Scope",children:(0,l.jsx)(ke,{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)($n,{value:n.match??{},onChange:r=>t({match:r}),keyPlaceholder:"payload key",valuePlaceholder:"expected value",emptyHint:"No filter \u2014 matches any payload."})})]})}function Hm({node:e,patchData:t}){let n=e.config;return(0,l.jsx)(W,{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)(A,{mono:!0,value:String(n.after??""),onChange:r=>t({after:r}),placeholder:"PT1H"})})})}function Bm({node:e,patchData:t}){let n=e.config;return(0,l.jsx)(W,{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)(ke,{value:String(n.mode??"fanOut"),onChange:r=>t({mode:r}),options:["fanOut","join"]})})})}function Gm({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)(W,{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)(Tt,{mono:!0,value:r,onChange:i,placeholder:"{{classify.result}}, {{trigger.values.amount}}"})})}),(0,l.jsxs)(W,{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)(A,{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)(Tt,{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)($n,{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)(W,{title:"Default",children:(0,l.jsx)(k,{label:"Goes to",children:(0,l.jsx)(A,{mono:!0,value:String(n.default?.to??"fallback"),onChange:c=>t({default:{...n.default??{},to:c}})})})})]})}var Vm={"trigger.channel":e=>(0,l.jsx)(mm,{...e}),"trigger.cron":e=>(0,l.jsx)(vm,{...e}),"trigger.poll":e=>(0,l.jsx)(ym,{...e}),"trigger.hook":e=>(0,l.jsx)(wm,{...e}),"trigger.manual":e=>(0,l.jsx)(xm,{...e}),"trigger.form":e=>(0,l.jsx)(Wm,{...e}),agent:e=>(0,l.jsx)(km,{...e}),transform:e=>(0,l.jsx)(bm,{...e}),branch:e=>(0,l.jsx)(_m,{...e}),"gateway.parallel":e=>(0,l.jsx)(Bm,{...e}),rule:e=>(0,l.jsx)(Gm,{...e}),checkpoint:e=>(0,l.jsx)(Sm,{...e}),userTask:e=>(0,l.jsx)(Dm,{...e}),subProcess:e=>(0,l.jsx)(jm,{...e}),"signal.emit":e=>(0,l.jsx)(Um,{...e}),"signal.wait":e=>(0,l.jsx)($m,{...e}),"timer.boundary":e=>(0,l.jsx)(Hm,{...e}),end:e=>(0,l.jsx)(Cm,{...e}),"action.send":e=>(0,l.jsx)(Tm,{...e}),"action.createIssue":e=>(0,l.jsx)(Pm,{...e}),"action.setLabel":e=>(0,l.jsx)(Mm,{...e}),"action.readLabel":e=>(0,l.jsx)(Fm,{...e}),"action.react":e=>(0,l.jsx)(Lm,{...e}),"action.editMessage":e=>(0,l.jsx)(Im,{...e}),"action.logTime":e=>(0,l.jsx)(Rm,{...e}),"action.callHTTP":e=>(0,l.jsx)(Am,{...e}),"action.run":e=>(0,l.jsx)(Om,{...e})};function Dp(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:g,onDeleteWorkflow:v,isNew:b}=e;if(!t)return(0,l.jsx)(Zm,{meta:p,patchMeta:g,onDeleteWorkflow:v,isNew:b});if(t.kind==="edge"){let G=r.find(f=>f.id===t.id);return G?(0,l.jsx)(ev,{edge:{...G,id:G.id??""},patch:o,onDelete:()=>a(t)}):null}let w=n.find(G=>G.id===t.id);return w?(0,l.jsx)(Km,{node:w,nodes:n,edges:r,patch:o,patchData:i,onDelete:()=>a(t),onDuplicate:()=>u(t),validation:s,runOutput:c?.outputs?.[w.id],agents:d}):null}function Km({node:e,nodes:t,edges:n,patch:r,patchData:o,onDelete:i,onDuplicate:a,validation:u,runOutput:s,agents:c}){let[d,p]=(0,fe.useState)("config"),g=Vm[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:v=>r({id:v.target.value})}),(0,l.jsx)("button",{className:"btn btn--ghost-icon",title:"Duplicate",onClick:a,children:(0,l.jsx)(K.dup,{})}),(0,l.jsx)("button",{className:"btn btn--ghost-icon",title:"Delete",onClick:i,children:(0,l.jsx)(K.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)(K.gear,{})," Config"]}),(0,l.jsxs)("button",{className:"insp__tab"+(d==="advanced"?" is-active":""),onClick:()=>p("advanced"),children:[(0,l.jsx)(K.layout,{})," Advanced"]}),(0,l.jsxs)("button",{className:"insp__tab"+(d==="preview"?" is-active":""),onClick:()=>p("preview"),children:[(0,l.jsx)(K.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:[g?g({node:e,nodes:t,patch:r,patchData:o,agents:c}):(0,l.jsx)(W,{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)(Qm,{node:e,nodes:t,edges:n})]}),d==="advanced"&&(0,l.jsx)(qm,{node:e,patchData:o}),d==="preview"&&(0,l.jsx)(W,{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)(W,{title:"Issues",right:(0,l.jsx)("span",{className:"card__kind",style:{color:"var(--err)"},children:u.length}),children:u.map((v,b)=>(0,l.jsxs)("div",{className:"fld__err",style:{padding:"6px 0"},children:[(0,l.jsx)(K.warn,{})," ",v.message]},b))})]})]})}function Ym(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 Qm({node:e,nodes:t,edges:n}){let r=(0,fe.useMemo)(()=>Ym(e.id,t,n),[e.id,t,n]);return r.length===0?(0,l.jsx)(W,{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)(W,{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)(Xm,{node:o},o.id))})})}function Xm({node:e}){let t=Ns[e.type],n=t?Op(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)(Jm,{nodeId:e.id,field:r},r.path))})]})}function Jm({nodeId:e,field:t}){let[n,r]=(0,fe.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 qm({node:e,patchData:t}){let[n,r]=(0,fe.useState)(()=>JSON.stringify(e.config,null,2)),[o,i]=(0,fe.useState)(null);return(0,fe.useMemo)(()=>{r(JSON.stringify(e.config,null,2)),i(null)},[e.id]),(0,l.jsxs)(W,{title:"Raw config JSON",children:[(0,l.jsx)(Bi,{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)(K.check,{})," Apply"]}),(0,l.jsxs)("button",{className:"btn btn--ghost-icon",onClick:()=>r(JSON.stringify(e.config,null,2)),children:[(0,l.jsx)(K.undo,{})," Reset"]})]}),o&&(0,l.jsxs)("div",{className:"fld__err",style:{color:"var(--err)",fontSize:11,marginTop:4},children:[(0,l.jsx)(K.err,{})," ",o]})]})}function Zm({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)(W,{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)(A,{mono:!0,value:e.id,onChange:i=>r&&t({id:i})})}),(0,l.jsx)(k,{label:"Title",children:(0,l.jsx)(A,{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)(Bi,{rows:2,value:e.description??"",onChange:i=>t({description:i})})})]}),(0,l.jsxs)(W,{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)(_n,{value:e.priority,onChange:i=>t({priority:i??0}),placeholder:"0"})}),(0,l.jsx)(k,{label:"",children:(0,l.jsx)(Gi,{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)(Tt,{mono:!0,value:e.envAllow??[],onChange:i=>t({envAllow:i}),placeholder:"GITLAB_TOKEN, SLACK_WEBHOOK"})})]}),(0,l.jsxs)(W,{title:"Retention",defaultOpen:!1,children:[(0,l.jsx)(k,{label:"How many runs to keep",children:(0,l.jsx)(_n,{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)(_n,{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)(K.trash,{})," Delete workflow"]})})]})]})}function ev({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)(K.trash,{})})]})}),(0,l.jsxs)("div",{className:"insp__body",children:[(0,l.jsx)(W,{title:"Label",children:(0,l.jsx)(k,{label:"Label",hint:"Shown on the edge (cosmetic only)",children:(0,l.jsx)(A,{mono:!0,value:e.label??"",onChange:r=>t({label:r})})})}),(0,l.jsx)(W,{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)(A,{mono:!0,value:e.fromPort??"",onChange:r=>t({fromPort:r||void 0})})})})]})]})}var At=ge(Ut(),1);var ne=ge(De(),1);function Wp({onLoadTemplate:e,onAdd:t}){let[n,r]=(0,At.useState)(""),[o,i]=(0,At.useState)([]);(0,At.useEffect)(()=>{let s=!0;return fetch("/api/n8n/workflows").then(c=>c.json()).then(c=>{if(!s)return;let d=(c.workflows??[]).filter(p=>p.webhookUrl).map(p=>({id:"n8n."+p.id,type:"action.callHTTP",label:p.name,hint:p.active?"Hands this over to n8n":"In n8n, but switched off there",glyph:"g-action",icon:"globe",config:{url:p.webhookUrl,method:"POST",body:"{{trigger}}"}}));i(d.length?[{section:"From your n8n",items:d}]:[])}).catch(()=>{}),()=>{s=!1}},[]);let a=(0,At.useMemo)(()=>[...ys,...o],[o]),u=(0,At.useMemo)(()=>{if(!n.trim())return a;let s=n.toLowerCase();return a.map(c=>({...c,items:c.items.filter(d=>d.label.toLowerCase().includes(s)||d.hint.toLowerCase().includes(s)||d.type.includes(s))})).filter(c=>c.items.length>0)},[n,a]);return(0,ne.jsxs)("div",{className:"pal",children:[(0,ne.jsxs)("div",{className:"pal__search",children:[(0,ne.jsx)(K.search,{}),(0,ne.jsx)("input",{value:n,onChange:s=>r(s.target.value),placeholder:"Find a step\u2026","aria-label":"Find a step to add"}),(0,ne.jsx)("kbd",{children:"/"})]}),(0,ne.jsxs)("div",{className:"pal__scroll",children:[u.map(s=>(0,ne.jsxs)(At.Fragment,{children:[(0,ne.jsxs)("div",{className:"pal__section",children:[(0,ne.jsx)("span",{children:s.section}),(0,ne.jsx)("span",{className:"pal__section-count",children:s.items.length.toString().padStart(2,"0")})]}),s.items.map(c=>(0,ne.jsx)(tv,{item:c,onAdd:t},c.id))]},s.section)),!n&&(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsxs)("div",{className:"pal__section",children:[(0,ne.jsx)("span",{children:"Templates"}),(0,ne.jsx)("span",{className:"pal__section-count",children:xs.length.toString().padStart(2,"0")})]}),xs.map(s=>(0,ne.jsxs)("button",{type:"button",className:"pal__tpl",onClick:()=>e(s),children:[(0,ne.jsx)("div",{className:"pal__tpl-dots",children:[0,1,2].map(c=>(0,ne.jsx)("span",{className:c<s.dots?"on":""},c))}),(0,ne.jsx)("div",{className:"pal__tpl-title",children:s.title}),(0,ne.jsx)("div",{className:"pal__tpl-hint",children:s.hint})]},s.id))]})]}),(0,ne.jsxs)("div",{className:"pal__foot",children:[(0,ne.jsx)(K.lightning,{}),(0,ne.jsx)("span",{children:"Select a step to add it, or drag it onto the canvas"})]})]})}function tv({item:e,onAdd:t}){let n=K[e.icon]??K.box;return(0,ne.jsxs)("div",{className:"pal__item",draggable:!0,onDragStart:o=>{o.dataTransfer.setData("application/x-wfe-item",JSON.stringify(e)),o.dataTransfer.effectAllowed="copy";let i=document.createElement("div");i.textContent=e.label,i.style.cssText="position:absolute;top:-1000px;padding:6px 10px;background:var(--ax-accent);color:var(--ax-bg);border-radius:6px;font:500 12px var(--ax-font);",document.body.appendChild(i),o.dataTransfer.setDragImage(i,10,10),setTimeout(()=>document.body.removeChild(i),0)},role:"button",tabIndex:0,title:`Add \u201C${e.label}\u201D`,onClick:()=>t(e),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t(e))},children:[(0,ne.jsx)("div",{className:"pal__glyph "+e.glyph,children:(0,ne.jsx)(n,{})}),(0,ne.jsxs)("div",{className:"pal__meta",children:[(0,ne.jsx)("div",{className:"pal__label",children:e.label}),(0,ne.jsx)("div",{className:"pal__hint",children:e.hint})]})]})}var Ms=ge(Ut(),1);var M=ge(De(),1);function jp(e){return(0,M.jsxs)("div",{className:"tb",role:"toolbar","aria-label":"Workflow editor",children:[(0,M.jsxs)("div",{className:"tb__main",children:[(0,M.jsx)("button",{type:"button",className:"btn btn--ghost-icon tb__menu"+(e.menuOpen?" is-active":""),"aria-expanded":e.menuOpen,"aria-controls":"wfe-menu",title:(e.menuOpen?"Hide":"Show")+" the side menu ([)","aria-label":(e.menuOpen?"Hide":"Show")+" the side menu",onClick:()=>e.setMenuOpen(!e.menuOpen),children:(0,M.jsx)(K.panelLeft,{})}),(0,M.jsxs)("div",{className:"tb__crumbs",children:[(0,M.jsx)("button",{type:"button",className:"tb__back",onClick:e.onBack,title:"Back to Workflows",children:"Workflows"}),(0,M.jsx)("span",{className:"sep","aria-hidden":"true",children:"/"}),(0,M.jsx)("input",{value:e.title,"aria-label":"Workflow title",onChange:t=>e.setTitle(t.target.value)})]}),(0,M.jsxs)("div",{className:"tb__status "+e.status,role:"status",children:[(0,M.jsx)("span",{className:"dot"}),e.statusLabel??(e.status==="is-dirty"?"unsaved":e.status==="is-running"?"running":e.status==="is-validating"?"checking\u2026":"saved")]}),(0,M.jsx)("div",{className:"tb__spacer"}),(0,M.jsx)("button",{type:"button",className:"btn btn--ghost-icon tb__opt",title:"Undo (\u2318Z)","aria-label":"Undo",onClick:e.onUndo,disabled:!e.canUndo,children:(0,M.jsx)(K.undo,{})}),(0,M.jsx)("button",{type:"button",className:"btn btn--ghost-icon tb__opt",title:"Redo (\u2318\u21E7Z)","aria-label":"Redo",onClick:e.onRedo,disabled:!e.canRedo,children:(0,M.jsx)(K.redo,{})}),(0,M.jsxs)("button",{type:"button",className:"btn btn--ghost tb__arrange",title:"Arrange the steps left to right (L)",onClick:e.onLayout,children:[(0,M.jsx)(K.layout,{}),(0,M.jsx)("span",{children:"Arrange"})]}),(0,M.jsx)("button",{type:"button",className:"btn btn--ghost-icon tb__opt",title:"Fit the workflow in view (F)","aria-label":"Fit in view",onClick:e.onFit,children:(0,M.jsx)(K.fit,{})}),(0,M.jsx)("button",{type:"button",className:"btn btn--ghost-icon tb__opt",title:"Keyboard shortcuts (?)","aria-label":"Keyboard shortcuts",onClick:e.onHelp,children:(0,M.jsx)(K.kbd,{})})]}),(0,M.jsxs)("div",{className:"tb__actions",children:[e.canSave&&(0,M.jsxs)("button",{type:"button",className:"btn btn--outline",onClick:e.onSave,children:[(0,M.jsx)(K.save,{})," ",(0,M.jsx)("span",{children:"Save"})]}),(0,M.jsx)("button",{type:"button",className:"btn btn--primary tb__run",onClick:e.onRun,title:"Walk through the steps without running them",children:e.running?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(K.stop2,{})," ",(0,M.jsx)("span",{children:"Stop"})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(K.run,{})," ",(0,M.jsx)("span",{children:"Preview"})]})})]})]})}function Up({running:e,script:t,cursor:n,onStop:r}){if(!e)return null;let o=t.filter(i=>i.nodeId);return(0,M.jsxs)("div",{className:"run",children:[(0,M.jsxs)("div",{className:"run__head",children:[(0,M.jsx)(K.lightning,{}),(0,M.jsx)("div",{className:"run__title",children:"Live run"}),(0,M.jsxs)("span",{className:"run__chip",children:[(0,M.jsx)("span",{className:"dot"})," streaming"]}),(0,M.jsx)("button",{className:"btn btn--ghost-icon",onClick:r,style:{height:24,width:24},children:(0,M.jsx)(K.x,{})})]}),(0,M.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,M.jsxs)("div",{className:c.join(" "),children:[(0,M.jsx)("div",{className:"run__marker",children:s?(0,M.jsx)(K.check,{}):a+1}),(0,M.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,M.jsx)("div",{className:"run__step-title",children:i.title}),i.body&&(0,M.jsx)("div",{className:"run__step-body",dangerouslySetInnerHTML:{__html:i.body}})]})]},a)})}),(0,M.jsxs)("div",{className:"run__foot",children:[(0,M.jsxs)("span",{children:[Math.min(n+1,t.length),"/",t.length]}),(0,M.jsxs)("span",{children:[t.length?Math.round((n+1)/t.length*100):0,"%"]})]})]})}function $p({open:e,onClose:t}){return e?(0,M.jsx)("div",{className:"kbd-overlay",onClick:t,children:(0,M.jsxs)("div",{className:"kbd-card",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",onClick:r=>r.stopPropagation(),children:[(0,M.jsx)("h3",{children:"Keyboard shortcuts"}),[["Save workflow","\u2318S"],["Undo / Redo","\u2318Z / \u2318\u21E7Z"],["Delete selection","Delete"],["Duplicate step","\u2318D"],["Move the selected step","\u2190 \u2192 \u2191 \u2193"],["Arrange the steps","L"],["Fit in view","F"],["Show or hide the side menu","["],["Preview","\u2318\u23CE"],["Find a step to add","/"],["Close this","Esc"]].map(([r,o])=>(0,M.jsxs)("div",{className:"row",children:[(0,M.jsx)("span",{children:r}),(0,M.jsx)("span",{children:o.split(" ").map((i,a)=>(0,M.jsxs)(Ms.Fragment,{children:[i.includes("/")?i.split("/").map((u,s)=>(0,M.jsxs)(Ms.Fragment,{children:[s>0&&" / ",(0,M.jsx)("kbd",{children:u.trim()})]},s)):(0,M.jsx)("kbd",{children:i})," "]},a))})]},r))]})}):null}function nv(){if(window.AX_LOCAL_TOKEN)return window.AX_LOCAL_TOKEN;try{return localStorage.getItem("ax_token")||""}catch{return""}}function qt(){let e={"Content-Type":"application/json","X-Requested-With":"agentx-board"},t=nv();return t&&(e.Authorization="Bearer "+t),e}async function Hp(e){let t=await fetch("/api/workflows/"+encodeURIComponent(e),{headers:qt()});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:qt()});return t.ok?(await t.json()).layout:null}async function Gp(e){let t=await fetch("/api/workflows/"+encodeURIComponent(e.id)+"/validate",{method:"POST",headers:qt(),body:JSON.stringify(e)});return t.ok?await t.json():{ok:!1,issues:[{path:"",message:"HTTP "+t.status}]}}async function Fs(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:qt(),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 Vp(e,t){await fetch("/api/workflows/"+encodeURIComponent(e)+"/layout",{method:"PUT",headers:qt(),body:JSON.stringify(t)})}async function Kp(e){return(await fetch("/api/workflows/"+encodeURIComponent(e),{method:"DELETE",headers:qt()})).ok}async function Yp(){try{let e=await fetch("/api/agents",{headers:qt()});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 Be=ge(Ut(),1),re=ge(De(),1),Is="agentx.editor.chat.v1";function Qp({currentWorkflow:e,onApplyWorkflow:t,agentId:n}){let[r,o]=(0,Be.useState)(!1),[i,a]=(0,Be.useState)(()=>av()),[u,s]=(0,Be.useState)(""),[c,d]=(0,Be.useState)(!1),p=(0,Be.useRef)(null),g=(0,Be.useRef)(null);(0,Be.useEffect)(()=>{let f=i.filter(h=>!h.pending).map(h=>({role:h.role,content:h.content}));try{sessionStorage.setItem(Is,JSON.stringify(f))}catch{}},[i]),(0,Be.useEffect)(()=>{let f=p.current;f&&(f.scrollTop=f.scrollHeight)},[i,r]),(0,Be.useEffect)(()=>{r&&g.current?.focus()},[r]);let v=(0,Be.useCallback)(async()=>{let f=u.trim();if(!f||c)return;let h=i.filter(x=>!x.pending).map(x=>({role:x.role,content:x.content})),m=[...i,{role:"user",content:f},{role:"assistant",content:"\u2026",pending:!0}];a(m),s(""),d(!0);try{let x=await fetch("/api/workflows/editor/chat",{method:"POST",credentials:"same-origin",headers:qt(),body:JSON.stringify({messages:[...h,{role:"user",content:f}],currentWorkflow:e,agentId:n})}),C=await x.json().catch(()=>({}));x.ok?a(F=>Ls(F,{role:"assistant",content:C.reply||"",workflow:C.workflow||void 0})):a(F=>Ls(F,{role:"assistant",content:"",error:C.error||`HTTP ${x.status}`}))}catch(x){a(C=>Ls(C,{role:"assistant",content:"",error:x?.message||"network error"}))}finally{d(!1)}},[n,c,e,u,i]),b=()=>{a([]);try{sessionStorage.removeItem(Is)}catch{}},w=f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),v())},G=(0,Be.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(`
1471
- `),[]);return(0,re.jsxs)(re.Fragment,{children:[!r&&(0,re.jsxs)("button",{className:"ax-chat__pill","aria-label":"Open workflow assistant",onClick:()=>o(!0),children:[(0,re.jsx)("span",{className:"ax-chat__pill-glyph",children:"\u2728"}),(0,re.jsx)("span",{className:"ax-chat__pill-text",children:"Ask AI to build\u2026"})]}),r&&(0,re.jsxs)("div",{className:"ax-chat__panel",role:"dialog","aria-label":"Workflow assistant",children:[(0,re.jsxs)("header",{className:"ax-chat__head",children:[(0,re.jsxs)("div",{className:"ax-chat__title",children:[(0,re.jsx)("span",{className:"ax-chat__dot"})," Workflow assistant"]}),(0,re.jsxs)("div",{className:"ax-chat__head-actions",children:[(0,re.jsx)("button",{className:"ax-chat__iconbtn",onClick:b,title:"Clear conversation",children:"\u232B"}),(0,re.jsx)("button",{className:"ax-chat__iconbtn",onClick:()=>o(!1),title:"Collapse",children:"\u25BC"})]})]}),(0,re.jsxs)("div",{className:"ax-chat__body",ref:p,children:[i.length===0&&(0,re.jsx)("pre",{className:"ax-chat__empty",children:G}),i.map((f,h)=>(0,re.jsx)(rv,{m:f,onApply:t},h))]}),(0,re.jsxs)("footer",{className:"ax-chat__foot",children:[(0,re.jsx)("textarea",{ref:g,className:"ax-chat__input",value:u,onChange:f=>s(f.target.value),onKeyDown:w,placeholder:"Describe the workflow you want\u2026 (Enter to send, Shift+Enter for newline)",rows:2,disabled:c}),(0,re.jsx)("button",{className:"ax-chat__send",onClick:()=>void v(),disabled:c||!u.trim(),children:c?"\u2026":"Send"})]})]}),(0,re.jsx)("style",{children:lv})]})}function rv({m:e,onApply:t}){if(e.error)return(0,re.jsxs)("div",{className:"ax-chat__msg ax-chat__msg--err",children:["\u26A0 ",e.error]});if(e.pending)return(0,re.jsx)("div",{className:"ax-chat__msg ax-chat__msg--assistant ax-chat__msg--pending",children:(0,re.jsxs)("span",{className:"ax-chat__typing",children:[(0,re.jsx)("span",{}),(0,re.jsx)("span",{}),(0,re.jsx)("span",{})]})});let n=e.role==="user"?"ax-chat__msg ax-chat__msg--user":"ax-chat__msg ax-chat__msg--assistant",r=ov(e.content,!!e.workflow),o=e.role==="assistant"?iv(r):Vi(r);return(0,re.jsxs)("div",{className:n,children:[(0,re.jsx)("div",{className:"ax-chat__text",dangerouslySetInnerHTML:{__html:o}}),e.workflow&&(0,re.jsxs)("div",{className:"ax-chat__apply",children:[(0,re.jsx)("button",{className:"ax-chat__applybtn",onClick:()=>t(e.workflow),children:"Apply to canvas"}),(0,re.jsx)("span",{className:"ax-chat__apply-hint",children:"replaces the current workflow"})]})]})}function ov(e,t){return t?e.replace(/```(?:json)?\s*\n[\s\S]*?```/g,"").trim():e}function Vi(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function iv(e){let t=[],n=e.replace(/```([a-zA-Z0-9_-]*)\n([\s\S]*?)```/g,(d,p,g)=>{let v=Vi(g.replace(/\n+$/,"")),b=p?` class="lang-${Vi(p)}"`:"";return t.push(`<pre><code${b}>${v}</code></pre>`),`\0CODE${t.length-1}\0`});n=Vi(n),n=n.replace(/`([^`\n]+)`/g,(d,p)=>`<code>${p}</code>`),n=n.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(d,p,g)=>`<a href="${/^https?:\/\/|^\//.test(g)?g:"#"}" 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(`
1470
+ `;var Zp=ge(kp(),1);var U=ge(Ut(),1);var Le=ge(Ut(),1);var y=ge(De(),1),Y=({children:e,size:t=14,...n})=>(0,y.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}),K={gitlab:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M8 14L2 7l1.2-4.5L5 7h6l1.8-4.5L14 7z"})}),clock:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"8",cy:"8",r:"5.5"}),(0,y.jsx)("path",{d:"M8 5v3l2 1.5"})]}),hook:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M4 3v4a4 4 0 0 0 4 4h4"}),(0,y.jsx)("path",{d:"M10 9l2 2-2 2"})]}),play:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M5 3.5l7 4.5-7 4.5z",fill:"currentColor"})}),box:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("rect",{x:"2.5",y:"2.5",width:"11",height:"11",rx:"1.5"}),(0,y.jsx)("path",{d:"M2.5 6h11M6 2.5v11"})]}),branch:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"4",cy:"4",r:"1.5"}),(0,y.jsx)("circle",{cx:"12",cy:"12",r:"1.5"}),(0,y.jsx)("circle",{cx:"12",cy:"4",r:"1.5"}),(0,y.jsx)("path",{d:"M4 5.5v3a2 2 0 0 0 2 2h4.5"}),(0,y.jsx)("path",{d:"M12 5.5v5"})]}),stop:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1"})}),msg:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M2.5 3.5h11v8h-6l-3 2.5v-2.5h-2z"})}),tag:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M8 2h5v5l-6 6-5-5z"}),(0,y.jsx)("circle",{cx:"10.5",cy:"5.5",r:.8,fill:"currentColor"})]}),bell:()=>(0,y.jsx)(Y,{children:(0,y.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,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"8",cy:"8",r:"5.5"}),(0,y.jsx)("path",{d:"M2.5 8h11M8 2.5c2 2 2 9 0 11M8 2.5c-2 2-2 9 0 11"})]}),search:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"7",cy:"7",r:"4"}),(0,y.jsx)("path",{d:"M10 10l3.5 3.5"})]}),undo:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M4 7h6a3 3 0 0 1 0 6H7"}),(0,y.jsx)("path",{d:"M6.5 4.5L4 7l2.5 2.5"})]}),redo:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M12 7H6a3 3 0 0 0 0 6h3"}),(0,y.jsx)("path",{d:"M9.5 4.5L12 7 9.5 9.5"})]}),save:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M3 3h8l2 2v8H3z"}),(0,y.jsx)("path",{d:"M5 3v4h6V3M5 13v-4h6v4"})]}),run:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M5 3.5l7 4.5-7 4.5z",fill:"currentColor"})}),stop2:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("rect",{x:"4",y:"4",width:"8",height:"8",rx:"1",fill:"currentColor"})}),sun:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"8",cy:"8",r:"2.75"}),(0,y.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,y.jsx)(Y,{children:(0,y.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,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M8 3v10M3 8h10"})}),trash:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M3 4.5h10M6 4.5V3h4v1.5M4.5 4.5l.5 8h6l.5-8"})}),chev:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M4 6l4 4 4-4"})}),x:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M4 4l8 8M12 4l-8 8"})}),more:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"4",cy:"8",r:"1",fill:"currentColor",stroke:"none"}),(0,y.jsx)("circle",{cx:"8",cy:"8",r:"1",fill:"currentColor",stroke:"none"}),(0,y.jsx)("circle",{cx:"12",cy:"8",r:"1",fill:"currentColor",stroke:"none"})]}),check:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M3 8.5l3 3 7-7"})}),warn:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M8 2l6 11H2z"}),(0,y.jsx)("path",{d:"M8 6.5v3M8 11.2v.3"})]}),err:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"8",cy:"8",r:"5.5"}),(0,y.jsx)("path",{d:"M8 5v3.5M8 10.5v.3"})]}),zoomin:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"7",cy:"7",r:"4"}),(0,y.jsx)("path",{d:"M10 10l3.5 3.5M5 7h4M7 5v4"})]}),zoomout:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"7",cy:"7",r:"4"}),(0,y.jsx)("path",{d:"M10 10l3.5 3.5M5 7h4"})]}),fit:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M3 5V3h2M13 5V3h-2M3 11v2h2M13 11v2h-2"}),(0,y.jsx)("rect",{x:"6",y:"6",width:"4",height:"4",rx:.5})]}),minus:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M3 8h10"})}),kbd:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("rect",{x:"1.5",y:"4",width:"13",height:"8",rx:"1.5"}),(0,y.jsx)("path",{d:"M4 7h.5M6 7h.5M8 7h.5M10 7h.5M4 10h7"})]}),lightning:()=>(0,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M9 2L3 9h4l-1 5 6-7H8z",fill:"currentColor",fillOpacity:.2})}),variable:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M4 3c-2 3-2 7 0 10M12 3c2 3 2 7 0 10"}),(0,y.jsx)("path",{d:"M6 7.5h.5l1 1 1-1h.5M6 10l1.5-1.5M9 10l-1.5-1.5"})]}),users:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"6",cy:"6",r:"2"}),(0,y.jsx)("path",{d:"M2.5 12c.5-2 2-3 3.5-3s3 1 3.5 3"}),(0,y.jsx)("circle",{cx:"11",cy:"5",r:"1.5"}),(0,y.jsx)("path",{d:"M10 10.5c.5-1 1.2-1.5 2-1.5 1 0 2 .8 2.3 2"})]}),grid:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("rect",{x:"2.5",y:"2.5",width:"4",height:"4"}),(0,y.jsx)("rect",{x:"9.5",y:"2.5",width:"4",height:"4"}),(0,y.jsx)("rect",{x:"2.5",y:"9.5",width:"4",height:"4"}),(0,y.jsx)("rect",{x:"9.5",y:"9.5",width:"4",height:"4"})]}),eye:()=>(0,y.jsxs)(Y,{children:[(0,y.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,y.jsx)("circle",{cx:"8",cy:"8",r:"1.8"})]}),slide:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1"}),(0,y.jsx)("path",{d:"M5 6h6M5 8.5h4M5 11h5"})]}),gear:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("circle",{cx:"8",cy:"8",r:"2"}),(0,y.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,y.jsx)(Y,{children:(0,y.jsx)("path",{d:"M3 13V3h7l-1 2.5L10 8H3"})}),dup:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1"}),(0,y.jsx)("path",{d:"M3 9V3h6"})]}),layout:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("path",{d:"M2.5 3.5h11v9h-11z"}),(0,y.jsx)("path",{d:"M2.5 7h11M7 7v5.5"})]}),panelLeft:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),(0,y.jsx)("path",{d:"M6 3v10"}),(0,y.jsx)("rect",{x:"2.5",y:"3.5",width:"3.5",height:"9",fill:"currentColor",fillOpacity:.18,stroke:"none"})]}),panelRight:()=>(0,y.jsxs)(Y,{children:[(0,y.jsx)("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),(0,y.jsx)("path",{d:"M10 3v10"}),(0,y.jsx)("rect",{x:"10",y:"3.5",width:"3.5",height:"9",fill:"currentColor",fillOpacity:.18,stroke:"none"})]})};var ws=[{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.poll",type:"trigger.poll",label:"Something new shows up",hint:"Checks a command every so often; runs once per new item",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"},{id:"node.owner.notify",type:"owner.notify",label:"Tell me",hint:"Send yourself a note through your notifications",glyph:"g-action",icon:"msg"},{id:"node.owner.ask",type:"owner.ask",label:"Ask me to decide",hint:"A decision card; goes on with yes, no or no answer",glyph:"g-branch",icon:"flag"},{id:"node.person.message",type:"person.message",label:"Message someone",hint:"Write to an employee or a client, once you approve the text",glyph:"g-action",icon:"msg"},{id:"node.person.wait",type:"person.wait",label:"Wait for their reply",hint:"Hold until they answer or send a file, with a deadline and reminders",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"}]}],xs=[{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.)"}]}],ks=[{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}],Cp=[{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 bs(e){for(let t of ws){let n=t.items.find(r=>r.type===e);if(n)return n.label}return e}function Np(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.poll":return n("actionId")?`new items from ${n("actionId")}`:"";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"owner.notify":return r(n("text"));case"owner.ask":return r(n("ask"));case"person.message":return[n("to")&&`to ${n("to")}`,r(n("text"))].filter(Boolean).join(" \u2014 ");case"person.wait":return n("timeout")?`waits up to ${n("timeout")}`:"";case"branch":{let o=Array.isArray(t.cases)?t.cases.length:0;return o?`${o} way${o===1?"":"s"} out`:""}default:return""}}var Ep={"owner.ask":{main:"yes",other:["no","expired"]},"person.message":{main:"sent",other:["declined"]},"person.wait":{main:"reply",other:["timeout"]}},Ag="unsure";function Bi(e){return typeof e=="string"?e:""}function zg(e){let t=e.config??{};return e.type==="branch"?[...(Array.isArray(t.cases)?t.cases:[]).map(r=>Bi(r?.to)),Bi(t.default)]:e.type==="rule"?[...(Array.isArray(t.rules)?t.rules:[]).map(r=>Bi(r?.to)),Bi(t.default?.to)]:e.type==="classify"?[...Array.isArray(t.labels)?t.labels.map(String):t.labels&&typeof t.labels=="object"?Object.keys(t.labels):[],Ag]:[]}function jn(e,t=[]){if(e.type==="end")return[];let n=Ep[e.type],r=n?[{name:void 0,label:n.main},...n.other.map(i=>({name:i,label:i}))]:zg(e).filter(Boolean).map(i=>({name:i,label:i})),o=new Set(r.map(i=>i.name??""));n&&o.add(n.main);for(let i of t){if(i.from!==e.id)continue;let a=i.fromPort??"";o.has(a)||(o.add(a),r.push({name:i.fromPort,label:i.fromPort??""}))}return r.length||r.push({name:void 0,label:""}),r}function _s(e,t,n){let r=n?Ep[n]:void 0,o=r&&t.fromPort===r.main?void 0:t.fromPort,i=e.findIndex(a=>(a.name??"")===(o??""));return i<0?0:i}function br(e,t,n){return e*(t+1)/(n+1)}function Dg(e,t){let n=new Map(e.map((s,c)=>[s.id,c])),r=e.map(()=>[]),o=e.map(()=>0);t.forEach((s,c)=>{let d=n.get(s.from),p=n.get(s.to);d===void 0||p===void 0||d===p||(r[d].push(c),o[p]++)});for(let s of r)s.sort((c,d)=>t[c].port-t[d].port);let i=new Set,a=e.map(()=>0),u=[...e.keys()].filter(s=>o[s]===0).concat([...e.keys()]);for(let s of u){if(a[s])continue;let c=[[s,0]];for(a[s]=1;c.length;){let d=c[c.length-1],[p,g]=d;if(g>=r[p].length){a[p]=2,c.pop();continue}d[1]++;let v=r[p][g],b=n.get(t[v].to);a[b]===1?i.add(v):a[b]===0&&(a[b]=1,c.push([b,0]))}}return t.forEach((s,c)=>{s.from===s.to&&i.add(c)}),i}function Tp(e,t,n={}){let r=n.gapX??110,o=n.gapY??40,i=n.margin??40;if(!e.length)return{};let a=new Map(e.map((_,O)=>[_.id,O])),u=Dg(e,t),s=e.map(_=>({id:_.id,w:_.w,h:_.h,ports:Math.max(1,_.ports),dummy:!1,layer:0,out:[],inn:[],key:0,pos:0,c:0})),c=[];t.forEach((_,O)=>{if(u.has(O))return;let B=a.get(_.from),G=a.get(_.to);B===void 0||G===void 0||c.push({a:B,b:G,port:_.port})});let d=s.map(()=>0),p=s.map(()=>[]);for(let _ of c)p[_.a].push(_.b),d[_.b]++;let g=[...s.keys()].filter(_=>d[_]===0),v=[];for(;g.length;){let _=g.shift();v.push(_);for(let O of p[_])s[O].layer=Math.max(s[O].layer,s[_].layer+1),--d[O]===0&&g.push(O)}{let _=s.map(()=>[]);for(let $ of c)_[$.a].push({b:$.b,port:$.port});_.forEach($=>$.sort((J,ee)=>J.port-ee.port));let O=0,B=new Set,G=$=>{let J=[$];for(;J.length;){let ee=J.pop();if(!B.has(ee)){B.add(ee),s[ee].key=O++;for(let le=_[ee].length-1;le>=0;le--)J.push(_[ee][le].b)}}};v.forEach($=>{c.some(J=>J.b===$)||G($)}),v.forEach(G)}for(let _ of c){let O=_.a,B=_.port;for(let G=s[_.a].layer+1;G<s[_.b].layer;G++){let $=s.length;s.push({id:"",w:0,h:0,ports:1,dummy:!0,layer:G,out:[],inn:[],key:s[_.a].key+(G-s[_.a].layer)/100,pos:0,c:0}),s[O].out.push({v:$,port:B}),s[$].inn.push({v:O,port:B}),O=$,B=0}s[O].out.push({v:_.b,port:B}),s[_.b].inn.push({v:O,port:B})}let b=Math.max(...s.map(_=>_.layer))+1,w=Array.from({length:b},()=>[]);s.forEach((_,O)=>w[_.layer].push(O)),w.forEach(_=>_.sort((O,B)=>s[O].key-s[B].key));let V=()=>w.forEach(_=>_.forEach((O,B)=>{s[O].pos=B}));V();let f=(_,O)=>(O+1)/(s[_].ports+1)-.5,h=()=>{let _=0;for(let O=0;O+1<b;O++){let B=[];for(let G of w[O])for(let $ of s[G].out)B.push([s[G].pos+f(G,$.port)*.9,s[$.v].pos]);for(let G=0;G<B.length;G++)for(let $=G+1;$<B.length;$++)(B[G][0]-B[$][0])*(B[G][1]-B[$][1])<0&&_++}return _},m=w.map(_=>[..._]),x=h();for(let _=0;_<12&&x>0;_++){let O=_%2===0,B=O?[...Array(b).keys()].slice(1):[...Array(b).keys()].reverse().slice(1);for(let $ of B){let J=new Map;for(let ee of w[$]){let le=O?s[ee].inn.map(we=>s[we.v].pos+f(we.v,we.port)*.9):s[ee].out.map(we=>s[we.v].pos-f(ee,we.port)*.9);J.set(ee,le.length?le.reduce((we,nt)=>we+nt,0)/le.length:s[ee].pos)}w[$].sort((ee,le)=>J.get(ee)-J.get(le)),w[$].forEach((ee,le)=>{s[ee].pos=le})}let G=h();G<x&&(x=G,m=w.map($=>[...$]))}m.forEach((_,O)=>{w[O]=_}),V();let C=_=>s[_].dummy?8:s[_].h,F=(_,O)=>s[_].dummy&&s[O].dummy?12:s[_].dummy||s[O].dummy?o/2:o,L=(_,O)=>C(_)/2+F(_,O)+C(O)/2;for(let _ of w){let O=0;_.forEach((G,$)=>{$&&(O+=L(_[$-1],G)),s[G].c=O});let B=O/2;_.forEach(G=>{s[G].c-=B})}let R=(_,O)=>s[_].c-C(_)/2+(s[_].dummy?C(_)/2:br(C(_),O,s[_].ports)),H=(_,O)=>{let B=[0];for(let J=1;J<_.length;J++)B.push(B[J-1]+L(_[J-1],_[J]));let G=[];_.forEach((J,ee)=>{let le=s[J].dummy?.3:1;for(G.push({sum:(O[ee]-B[ee])*le,w:le,n:1});G.length>1;){let we=G[G.length-1],nt=G[G.length-2];if(nt.sum/nt.w<=we.sum/we.w)break;G.splice(G.length-2,2,{sum:nt.sum+we.sum,w:nt.w+we.w,n:nt.n+we.n})}});let $=0;for(let J of G)for(let ee=0;ee<J.n;ee++,$++)s[_[$]].c=J.sum/J.w+B[$]};for(let _=0;_<8;_++){let O=_%2===0,B=O?[...Array(b).keys()].slice(1):[...Array(b).keys()].reverse().slice(1);for(let G of B){let $=w[G].map(J=>{let ee=O?s[J].inn.map(le=>R(le.v,le.port)):s[J].out.map(le=>s[le.v].c-(R(J,le.port)-s[J].c));return ee.length?ee.reduce((le,we)=>le+we,0)/ee.length:s[J].c});H(w[G],$)}}let z=[],Ce=i;for(let _ of w){z.push(Ce);let O=Math.max(0,..._.filter(B=>!s[B].dummy).map(B=>s[B].w));Ce+=(O||40)+r}let tt=s.filter(_=>!_.dummy),vt=Math.min(...tt.map(_=>_.c-_.h/2)),zt={};for(let _ of tt)zt[_.id]={x:Math.round(z[_.layer]),y:Math.round(_.c-_.h/2-vt+i)};return zt}var Wg={trigger:220,branch:240,action:220,end:160,agent:240,checkpoint:220,transform:220},jg={trigger:46,branch:92,action:78,end:46,agent:104,checkpoint:92,transform:78},Ug=26;function Ss(e){return e.startsWith("trigger.")?"trigger":e.startsWith("action.")?"action":e}function et(e,t=[]){let n=Ss(e.type),r=jn(e,t).length,o=Math.max(jg[n]??92,r>1?18+Ug*r:0);return{w:Wg[n]??220,h:o}}function Cs(e,t,n){let{w:r,h:o}=et(e,n),i=jn(e,n),a=_s(i,t,e.type);return{x:(e.position?.x??0)+r,y:(e.position?.y??0)+br(o,a,i.length)}}function Pp(e,t){let{h:n}=et(e,t);return{x:e.position?.x??0,y:(e.position?.y??0)+n/2}}function vo(e,t){let n=new Map(e.map(r=>[r.id,r]));return Tp(e.map(r=>({id:r.id,...et(r,t),ports:jn(r,t).length})),t.filter(r=>n.has(r.from)&&n.has(r.to)).map(r=>{let o=n.get(r.from);return{from:r.from,to:r.to,port:_s(jn(o,t),r,o.type)}}))}function Mp(e){return e.some(t=>!t.position)?!0:e.length>1&&new Set(e.map(t=>`${t.position.x},${t.position.y}`)).size===1}var j=ge(De(),1);function bn(e){return e.position?.x??0}function Et(e){return e.position?.y??0}function Fp(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 $g(e,t,n){return`M ${e.x} ${e.y} C ${e.x+28*2} ${e.y}, ${e.x+28*2} ${n}, ${e.x} ${n} L ${t.x} ${n} C ${t.x-28*2} ${n}, ${t.x-28*2} ${t.y}, ${t.x} ${t.y}`}function Hg(e){let{n:t,edges:n,selected:r,state:o}=e,{w:i,h:a}=et(t,n),u=jn(t,n),s=Ss(t.type),c=Np(t.type,t.config??{}),d=t.config,p=s==="trigger"?d.source==="cron"?"clock":d.source==="webhook"||d.source==="hook"?"hook":d.source==="manual"?"play":"gitlab":s==="agent"?"box":s==="branch"?"branch":s==="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":s==="checkpoint"?"flag":s==="transform"?"variable":"stop",g=K[p]??K.box,v=["node",`t-${s}`,r&&"is-selected",e.drop&&"is-drop",o==="running"&&"is-running",o==="visited"&&"is-visited",o==="error"&&"is-error"].filter(Boolean).join(" "),b={left:bn(t),top:Et(t),width:i,height:a},w=d.agentId,V=d.prompt;return(0,j.jsxs)("div",{className:v,style:b,tabIndex:0,role:"button","data-node":t.id,"aria-label":`${bs(t.type)} ${t.id}`,"aria-pressed":r,onPointerDown:f=>e.onMouseDown?.(f,t),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),e.onClick?.(f,t))},onClick:f=>e.onClick?.(f,t),onDoubleClick:f=>e.onDoubleClick?.(f,t),children:[(0,j.jsx)("div",{className:"node__stripe"}),(0,j.jsxs)("div",{className:"node__head",children:[(0,j.jsx)("div",{className:"node__icon",children:(0,j.jsx)(g,{})}),(0,j.jsxs)("div",{className:"node__meta",children:[(0,j.jsx)("div",{className:"node__kind",children:bs(t.type)}),(0,j.jsx)("div",{className:"node__name",children:t.id})]}),s!=="trigger"&&s!=="end"&&(0,j.jsx)("div",{className:"node__chev",children:(0,j.jsx)(K.more,{})})]}),c&&(0,j.jsx)("div",{className:"node__body",children:(0,j.jsx)("div",{className:"node__row node__row--summary",children:c})}),s!=="trigger"&&(0,j.jsx)("div",{className:"handle h-in",title:"Drop a connection here",onPointerDown:f=>e.onPortDown?.(f,t,null),onPointerEnter:()=>e.onPortEnter?.(t),onPointerLeave:()=>e.onPortLeave?.()}),u.map((f,h)=>(0,j.jsx)("div",{className:"handle h-out"+(f.label?" has-label":""),style:{top:br(a,h,u.length)},title:f.label?`Leaves here when: ${f.label}`:"Drag to connect",onPointerDown:m=>e.onPortDown?.(m,t,f),children:f.label&&(0,j.jsx)("span",{className:"handle__label",children:f.label})},f.name??""))]})}function Bg({nodes:e,edges:t,viewBox:n,selection:r,hostRef:o}){let[i,a]=(0,Le.useState)(!1);if(!e.length)return null;let u=60,s=e.map(H=>bn(H)),c=e.map(H=>Et(H)),d=e.map(H=>et(H,t).w),p=e.map(H=>et(H,t).h),g=Math.min(...s)-u,v=Math.min(...c)-u,b=Math.max(...s.map((H,z)=>H+d[z]))+u,w=Math.max(...c.map((H,z)=>H+p[z]))+u,V=b-g,f=w-v,h=o.current?.getBoundingClientRect(),m=h?.width??800,x=h?.height??500,C=-n.tx/n.zoom,F=-n.ty/n.zoom,L=m/n.zoom,R=x/n.zoom;return(0,j.jsxs)("div",{className:"cv__mini"+(i?" is-collapsed":""),children:[(0,j.jsxs)("div",{className:"cv__mini-head",children:[(0,j.jsx)("span",{children:"Map"}),(0,j.jsx)("button",{onClick:()=>a(!i),children:(0,j.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:(0,j.jsx)("path",{d:i?"M2 4l3 3 3-3":"M2 6l3-3 3 3",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round"})})})]}),!i&&(0,j.jsxs)("svg",{viewBox:`${g} ${v} ${V} ${f}`,preserveAspectRatio:"xMidYMid meet",children:[(0,j.jsx)("rect",{className:"mini-view",x:C,y:F,width:L,height:R}),e.map(H=>{let z=et(H,t),Ce=r?.kind==="node"&&r.id===H.id;return(0,j.jsx)("rect",{className:"mini-node"+(Ce?" sel":""),x:bn(H),y:Et(H),width:z.w,height:z.h,rx:3},H.id)})]})]})}var Ns=.2,Lp=2,Gg=.6;function Ip(e,t){let n=1/0,r=1/0,o=-1/0,i=-1/0;for(let a of e){let u=et(a,t);n=Math.min(n,bn(a)),r=Math.min(r,Et(a)),o=Math.max(o,bn(a)+u.w),i=Math.max(i,Et(a)+u.h)}return{minX:n,minY:r,maxX:o,maxY:i}}function Rp(e){let{nodes:t,edges:n,selection:r,setSelection:o,onNodeMove:i,onAddNode:a,onConnect:u,runState:s,viewBox:c,setViewBox:d}=e,p=e.editable!==!1,g=(0,Le.useRef)(null),[v,b]=(0,Le.useState)(null),[w,V]=(0,Le.useState)(null),[f,h]=(0,Le.useState)(!1),[m,x]=(0,Le.useState)(null),[C,F]=(0,Le.useState)(null),[L,R]=(0,Le.useState)(null),{zoom:H,tx:z,ty:Ce}=c,tt=(0,Le.useMemo)(()=>new Map(t.map(N=>[N.id,N])),[t]),vt=(N,D)=>{let I=g.current;if(!I)return{x:0,y:0};let Q=I.getBoundingClientRect();return{x:(N-Q.left-z)/H,y:(D-Q.top-Ce)/H}},zt=N=>{let D=N.target;D!==N.currentTarget&&!D.classList.contains("cv__viewport")&&!D.classList.contains("cv__edges")||N.button!==0&&N.button!==1||(o(null),F({startX:N.clientX,startY:N.clientY,tx:z,ty:Ce}))},_=(N,D)=>{if(N.target.classList.contains("handle")||(N.stopPropagation(),o({kind:"node",id:D.id}),!p))return;let I=vt(N.clientX,N.clientY);b({id:D.id,offX:I.x-bn(D),offY:I.y-Et(D)})},O=(N,D,I)=>{if(N.stopPropagation(),N.preventDefault(),!p||!I)return;let Q=Cs(D,{from:D.id,fromPort:I.name,to:""},n);V({from:{id:D.id,port:I},start:Q,x:Q.x,y:Q.y})},B=N=>{w&&x(N.id)},G=()=>x(null);(0,Le.useEffect)(()=>{if(!v&&!w&&!C)return;let N=I=>{if(v){let Q=vt(I.clientX,I.clientY);i(v.id,Math.round(Q.x-v.offX),Math.round(Q.y-v.offY))}else if(w){let Q=vt(I.clientX,I.clientY);V(se=>se&&{...se,x:Q.x,y:Q.y});let te=document.elementFromPoint(I.clientX,I.clientY)?.closest("[data-node]");x(te?te.dataset.node??null:null)}else C&&d(Q=>({...Q,tx:C.tx+(I.clientX-C.startX),ty:C.ty+(I.clientY-C.startY)}))},D=()=>{w&&m&&m!==w.from.id&&!tt.get(m)?.type.startsWith("trigger.")&&u({from:w.from.id,fromPort:w.from.port.name,to:m}),v&&e.onNodeMoved?.(v.id),b(null),V(null),F(null),x(null)};return window.addEventListener("pointermove",N),window.addEventListener("pointerup",D),window.addEventListener("pointercancel",D),()=>{window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",D),window.removeEventListener("pointercancel",D)}},[v,w,C,m,u,i,d,tt]);let $=N=>{if(!N.ctrlKey&&!N.metaKey&&Math.abs(N.deltaY)<30){d(ae=>({...ae,tx:ae.tx-N.deltaX,ty:ae.ty-N.deltaY}));return}let D=g.current;if(!D)return;let I=D.getBoundingClientRect(),Q=N.clientX-I.left,te=N.clientY-I.top,se=-N.deltaY*.0015;d(ae=>{let yt=Math.min(Lp,Math.max(Ns,ae.zoom*(1+se))),rt=yt/ae.zoom;return{zoom:yt,tx:Q-(Q-ae.tx)*rt,ty:te-(te-ae.ty)*rt}})};(0,Le.useEffect)(()=>{let N=g.current;if(!N)return;let D=I=>{(I.ctrlKey||I.metaKey)&&I.preventDefault()};return N.addEventListener("wheel",D,{passive:!1}),()=>N.removeEventListener("wheel",D)},[]);let J=N=>{let D=g.current?.getBoundingClientRect(),I=(D?.width??800)/2,Q=(D?.height??500)/2;d(te=>{let se=Math.min(Lp,Math.max(Ns,te.zoom*N)),ae=se/te.zoom;return{zoom:se,tx:I-(I-te.tx)*ae,ty:Q-(Q-te.ty)*ae}})},ee=(N=!1)=>{let D=g.current;if(!D||!t.length)return;let I=D.getBoundingClientRect();if(!I.width||!I.height)return;let Q=48,te=Ip(t,n),se=te.maxX-te.minX+Q*2,ae=te.maxY-te.minY+Q*2+40,yt=N?Math.min(Gg,1):Ns,rt=Math.max(yt,Math.min(1,I.width/se,I.height/ae)),Gn=(te.maxX-te.minX)*rt,Dt=(te.maxY-te.minY)*rt;d({zoom:rt,tx:(Gn+Q*2<=I.width?(I.width-Gn)/2:Q)-te.minX*rt,ty:(Dt+Q*2<=I.height?(I.height-Dt)/2:Q)-te.minY*rt})};(0,Le.useEffect)(()=>{e.fitSignal&&requestAnimationFrame(()=>ee(!0))},[e.fitSignal]),(0,Le.useEffect)(()=>{let N=()=>ee(),D=g.current;return D?.addEventListener("wfe:fit",N),()=>D?.removeEventListener("wfe:fit",N)});let le=N=>{p&&(N.preventDefault(),h(!0))},we=()=>h(!1),nt=N=>{if(N.preventDefault(),h(!1),!p)return;let D=N.dataTransfer.getData("application/x-wfe-item");if(D)try{let I=JSON.parse(D),Q=vt(N.clientX,N.clientY);a(I,Q.x-100,Q.y-40)}catch{}},zs=N=>{let D=N.id??"",I=["wfe-edge"];return r?.kind==="edge"&&r.id===D&&I.push("is-selected"),L===D&&I.push("is-hover"),s?.currentEdgeId===D&&I.push("is-running"),D&&s?.visitedEdges?.has(D)&&I.push("is-visited"),I.join(" ")},Sn=N=>s?.currentNodeId===N.id?"running":s?.visitedNodes?.has(N.id)?"visited":null,Te=(0,Le.useMemo)(()=>{let N=t.length?Ip(t,n):{minX:0,minY:0,maxX:800,maxY:600};return{x:Math.min(0,N.minX)-400,y:Math.min(0,N.minY)-400,w:Math.max(N.maxX,0)-Math.min(0,N.minX)+800,h:Math.max(N.maxY,0)-Math.min(0,N.minY)+800}},[t,n]),Hn=(N,D,I,Q)=>{let te=Math.max(I,Q);for(let se of t){let ae=et(se,n);bn(se)+ae.w>=Math.min(N.x,D.x)-40&&bn(se)<=Math.max(N.x,D.x)+40&&(te=Math.max(te,Et(se)+ae.h))}return te+36},Bn=(0,Le.useMemo)(()=>w?(0,j.jsx)("svg",{className:"cv__ghost-edge",style:{left:Te.x,top:Te.y},width:Te.w,height:Te.h,viewBox:`${Te.x} ${Te.y} ${Te.w} ${Te.h}`,children:(0,j.jsx)("path",{d:Fp(w.start,{x:w.x,y:w.y})})}):null,[w,Te]);return(0,j.jsxs)("div",{className:"cv"+(C?" is-panning":"")+(f?" is-drop-target":"")+(w?" is-connecting":""),ref:g,onWheel:$,onPointerDown:zt,onDragOver:le,onDragLeave:we,onDrop:nt,children:[(0,j.jsxs)("div",{className:"cv__viewport",style:{transform:`translate(${z}px, ${Ce}px) scale(${H})`},children:[(0,j.jsxs)("svg",{className:"cv__edges",style:{left:Te.x,top:Te.y},width:Te.w,height:Te.h,viewBox:`${Te.x} ${Te.y} ${Te.w} ${Te.h}`,children:[(0,j.jsxs)("defs",{children:[(0,j.jsx)("marker",{id:"arr",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto",children:(0,j.jsx)("path",{d:"M0 0L10 5L0 10z",fill:"currentColor"})}),(0,j.jsx)("marker",{id:"arr-acc",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto",children:(0,j.jsx)("path",{d:"M0 0L10 5L0 10z",fill:"var(--accent)"})})]}),n.map((N,D)=>{let I=tt.get(N.from),Q=tt.get(N.to);if(!I||!Q)return null;let te=N.id??`e-${D}`,se=Cs(I,N,n),ae=Pp(Q,n),yt=ae.x<se.x+24,rt=yt?$g(se,ae,Hn(se,ae,Et(I)+et(I,n).h,Et(Q)+et(Q,n).h)):Fp(se,ae),Gn=s?.currentEdgeId===te||s?.visitedEdges?.has(te)?"url(#arr-acc)":"url(#arr)",Dt=N.label&&!(I.type==="branch"||I.type==="rule"||I.type==="classify")?N.label:"",Pt=yt?{x:(se.x+ae.x)/2,y:Hn(se,ae,Et(I)+et(I,n).h,Et(Q)+et(Q,n).h)}:{x:(se.x+ae.x)/2,y:(se.y+ae.y)/2};return(0,j.jsxs)("g",{children:[(0,j.jsx)("path",{className:"edge-bg",d:rt,onPointerEnter:()=>R(te),onPointerLeave:()=>R(null),onClick:()=>o({kind:"edge",id:te})}),(0,j.jsx)("path",{className:zs(N)+(yt?" is-loop":""),d:rt,markerEnd:Gn}),Dt&&(0,j.jsxs)("g",{transform:`translate(${Pt.x},${Pt.y})`,children:[(0,j.jsx)("rect",{className:"edge-label-bg",x:-Dt.length*3.6-6,y:-9,rx:3,width:Dt.length*7.2+12,height:18}),(0,j.jsx)("text",{className:"edge-label",y:4,textAnchor:"middle",children:Dt})]})]},te)})]}),Bn,t.map(N=>(0,j.jsx)(Hg,{n:N,edges:n,selected:r?.kind==="node"&&r.id===N.id,state:Sn(N),drop:!!w&&m===N.id,onMouseDown:_,onPortDown:O,onPortEnter:B,onPortLeave:G,onClick:(D,I)=>{D.stopPropagation(),o({kind:"node",id:I.id})}},N.id))]}),(0,j.jsxs)("div",{className:"cv__controls",role:"toolbar","aria-label":"Zoom",children:[(0,j.jsx)("button",{type:"button",title:"Zoom out","aria-label":"Zoom out",onClick:()=>J(1/1.2),children:(0,j.jsx)(K.zoomout,{})}),(0,j.jsxs)("div",{className:"cv__zoom",children:[Math.round(H*100),"%"]}),(0,j.jsx)("button",{type:"button",title:"Zoom in","aria-label":"Zoom in",onClick:()=>J(1.2),children:(0,j.jsx)(K.zoomin,{})}),(0,j.jsx)("button",{type:"button",title:"Fit the workflow in view (F)","aria-label":"Fit",onClick:()=>ee(),children:(0,j.jsx)(K.fit,{})})]}),(0,j.jsx)(Bg,{nodes:t,edges:n,viewBox:c,selection:r,hostRef:g})]})}var fe=ge(Ut(),1);var Vg=[{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"]}],Kg=[{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"}],Yg=[{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."}],Qg=[{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`."}],Xg=[{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."}],Jg=[{path:"labels",type:"array",description:"Current label list on the entity. Use with a `branch` node to route on label state."}],qg=[{path:"emoji",type:"string",description:"The emoji reaction that was applied (echoes the input for debugging)."}],Zg=[{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."}],em=[{path:"durationMs",type:"number",description:"Duration logged, in milliseconds (echoed for downstream use)."}],tm=[{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."}],nm=[{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."}],rm=[{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."}],om=[{path:"port",type:"string",description:"Which outgoing port matched. Downstream edges with `fromPort` matching this value will fire."}],im=[{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"'}],am=[{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)."}],lm=[{path:"event",type:"any",description:"Payload of the event that resumed this checkpoint. Fields mirror whichever trigger source delivered the resume event."}],sm=[{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."}],um=[{path:"emittedAt",type:"string",description:"ISO-8601 time the signal was published."}],cm=[{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."}],dm=[{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)."}],Es={"trigger.channel":{summary:"Raw event payload from the source channel. Shape varies by `source` \u2014 the Context panel filters accordingly.",fields:Vg},"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."}]},"trigger.poll":{summary:"Runs a registered action on an interval and starts one run per new item it prints (one JSON object per line). The item is the payload.",fields:[{path:"",type:"any",description:"The item's own fields, e.g. `{{trigger.msgId}}`, `{{trigger.text}}`. Whatever the poll command printed for this item."}]},agent:{summary:"Agent response after executing the prompt template.",fields:Kg},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:im},transform:{summary:"Value picked from upstream context (path mode) or rendered template bundle (template mode).",fields:am},branch:{summary:"Which outgoing port fired. Downstream edges match via `fromPort`.",fields:om},"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:Yg},"action.createIssue":{summary:"Created an issue on GitLab/GitHub.",fields:Qg},"action.setLabel":{summary:"Added/removed labels on a GitLab issue or MR.",fields:Xg},"action.readLabel":{summary:"Fetched the current label list \u2014 useful before a `branch`.",fields:Jg},"action.react":{summary:"Emoji reaction on a message (Telegram/WhatsApp).",fields:qg},"action.editMessage":{summary:"Edited an existing message in place.",fields:Zg},"action.logTime":{summary:"Logged time spent on a GitLab issue/MR.",fields:em},"action.callHTTP":{summary:"Made an outbound HTTP request with templated params.",fields:tm},"action.run":{summary:"Invoked a registered action from the action registry. Output is the full ActionRunResult.",fields:nm},"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:rm},subProcess:{summary:"Spawned a child workflow and waited for its completion.",fields:dm},"signal.emit":{summary:"Published a signal to the bus. Runs elsewhere can resume on it via `signal.wait`.",fields:um},"signal.wait":{summary:"Paused until a matching signal arrives. Resumes with that signal in this node's output.",fields:sm},"timer.boundary":{summary:"Paused until a timer elapses. Resumes with timing metadata.",fields:cm},checkpoint:{summary:"Paused until a matching resume event arrives on this entity.",fields:lm},end:{summary:"Terminal node \u2014 closes the run with the configured status. No output downstream.",fields:[]},"owner.notify":{summary:"Told the owner, through the node's notifications.",fields:[{path:"text",type:"string",description:"What the owner was told."},{path:"sentAt",type:"string",description:"When (ISO time)."}]},"owner.ask":{summary:"The owner's answer on a decision card. Leaves on port yes, no or expired.",fields:[{path:"port",type:"string",description:"yes, no or expired.",example:'"yes"'},{path:"choice",type:"string",description:"The option the owner picked, when the card offered choices."},{path:"text",type:"string",description:"The draft as the owner approved it, after any edit."},{path:"note",type:"string",description:"The owner's note on the card."},{path:"cardId",type:"string",description:"The decision card's id."}]},"person.message":{summary:"A message to a person, sent once the owner approved it. Leaves on port sent or declined.",fields:[{path:"text",type:"string",description:"The text that was sent (the owner may have edited it)."},{path:"channel",type:"string",description:"Channel it went out on."},{path:"chatId",type:"string",description:"The person's chat."},{path:"messageId",type:"string",description:"Id of the sent message, when the channel gives one."},{path:"approved",type:"string",description:"start (approved with the run) or step (on its own card)."}]},"person.wait":{summary:"A person's reply. Leaves on port reply, or timeout when the deadline passed.",fields:[{path:"text",type:"string",description:"What the person wrote."},{path:"from",type:"string",description:"Sender id."},{path:"media",type:"any",description:"Attached file, when they sent one."},{path:"reminders",type:"number",description:"Reminders sent before the reply came."},{path:"timedOut",type:"bool",description:"True on the timeout port."}]}};function Op(e,t={}){let n=Es[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=ge(De(),1);function W({title:e,children:t,defaultOpen:n=!0,right:r}){let[o,i]=(0,fe.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)(K.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)(K.err,{}),n]})]})}function A({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 _n({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 Gi({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 ke({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 Vi({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 Tt({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 pm(e){return typeof e=="boolean"?"boolean":typeof e=="number"?"number":Array.isArray(e)?"list":e&&typeof e=="object"?"json":"string"}function $n({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)(fm,{k:s,v:c,allowedTypes:o,keyPlaceholder:n,valuePlaceholder:r,onKey:p=>{let g=a.slice();g[d]=[p,g[d][1]],u(g)},onValue:p=>{let g=a.slice();g[d]=[g[d][0],p],u(g)},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 fm({k:e,v:t,allowedTypes:n,keyPlaceholder:r,valuePlaceholder:o,onKey:i,onValue:a,onRemove:u}){let[s,c]=(0,fe.useState)(pm(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(g=>g.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)(Un,{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)(Vi,{checked:!!t,onChange:p=>a(p),label:String(!!t)}),s==="list"&&(0,l.jsx)(Tt,{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 Un({value:e,onChange:t,placeholder:n,rows:r=3}){let[o,i]=(0,fe.useState)(!1),[a,u]=(0,fe.useState)(0),s=(0,fe.useRef)(null),c=(0,fe.useMemo)(()=>{let g=[];return xs.forEach(v=>v.items.forEach(b=>g.push({group:v.group,...b}))),g},[]),d=g=>{let v=s.current;if(!v)return;let b=v.selectionStart,w=e.slice(0,b),V=e.slice(b),h=w.endsWith("{{")?w:w+"{{",m=h+g+"}}"+V;t(m),i(!1),requestAnimationFrame(()=>{v.focus();let x=h.length+g.length+2;v.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:g=>t(g.target.value),onKeyDown:g=>{if(!o){g.key==="{"&&g.shiftKey&&i(!0);return}g.key==="ArrowDown"?(g.preventDefault(),u(v=>(v+1)%c.length)):g.key==="ArrowUp"?(g.preventDefault(),u(v=>(v-1+c.length)%c.length)):g.key==="Enter"||g.key==="Tab"?(g.preventDefault(),d(c[a].path)):g.key==="Escape"&&i(!1)}}),(0,l.jsxs)("div",{className:"fld__hint",style:{display:"flex",alignItems:"center",gap:6,marginTop:4},children:[(0,l.jsx)(K.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)(K.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:xs.map(g=>(0,l.jsxs)(fe.Fragment,{children:[(0,l.jsx)("div",{className:"expr__pop-group",style:{padding:"4px 10px",fontSize:10,color:"var(--muted)",textTransform:"uppercase",letterSpacing:.5},children:g.group}),g.items.map(v=>{let b=c.findIndex(V=>V.path===v.path);return(0,l.jsxs)("div",{onMouseEnter:()=>u(b),onClick:()=>d(v.path),style:{padding:"4px 10px",cursor:"pointer",fontSize:11,display:"flex",justifyContent:"space-between",gap:12,fontFamily:"var(--ax-mono, ui-monospace)",background:b===a?"var(--accent-soft)":"transparent"},children:[(0,l.jsx)("span",{children:`{{${v.path}}}`}),(0,l.jsx)("span",{style:{color:"var(--muted)",fontSize:10},children:v.type})]},v.path)})]},g.group))})]})}function hm({value:e,onChange:t,agents:n}){let[r,o]=(0,fe.useState)(!1),[i,a]=(0,fe.useState)(""),u=(0,fe.useRef)(null);(0,fe.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)(K.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)(A,{value:e??"",onChange:t,placeholder:"agent-id",mono:!0})})]})}var Ms={"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}},gm=Object.entries(Ms).map(([e,t])=>({value:e,label:t.wired?`${t.label} \u2713`:`${t.label} \u26A0 schema-only`}));function mm({node:e,patchData:t}){let n=e.config,r=n.filter??{},o=p=>t({filter:{...r,...p}}),i=String(n.source??"whatsapp-message"),a=Ms[i]??Ms["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)(W,{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)(ke,{value:i,onChange:p=>t({source:p,filter:{}}),options:gm})}),(0,l.jsx)("div",{style:{fontSize:12,color:"var(--muted)",lineHeight:1.5,marginTop:-6,marginBottom:12},children:a.fires})]}),d&&(0,l.jsxs)(W,{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)(A,{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)(A,{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)(A,{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)(Tt,{mono:!0,value:Array.isArray(r.labels)?r.labels:[],onChange:p=>o({labels:p}),placeholder:"bug, needs-review"})})]}),u&&(0,l.jsx)(W,{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)(Vi,{checked:!!n.passthrough,onChange:p=>t({passthrough:p}),label:"Let the default agent also reply"})})})]})}function vm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{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)(A,{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. Europe/London, America/New_York). Defaults to UTC.",children:(0,l.jsx)(A,{mono:!0,value:String(n.timezone??"UTC"),onChange:r=>t({timezone:r}),placeholder:"Europe/London"})}),(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."]})]})}function ym({node:e,patchData:t}){let n=e.config,r=Array.isArray(n.filter)?n.filter.length:0;return(0,l.jsxs)(W,{title:"Poll",children:[(0,l.jsx)(k,{label:"Which saved action",hint:"Slug of a registered action (.agentx/actions/<id>.json). It must print one JSON object per line.",children:(0,l.jsx)(A,{mono:!0,value:String(n.actionId??""),onChange:o=>t({actionId:o}),placeholder:"list-new-messages"})}),(0,l.jsx)(k,{label:"Every (seconds)",hint:"How often the action runs. 5 or more; defaults to 60.",children:(0,l.jsx)(_n,{value:n.everySeconds,onChange:o=>t({everySeconds:o}),placeholder:"60"})}),(0,l.jsx)(k,{label:"Item key",hint:"Field that identifies an item, e.g. msgId. Each key starts one run, once.",children:(0,l.jsx)(A,{mono:!0,value:String(n.key??""),onChange:o=>t({key:o}),placeholder:"id"})}),(0,l.jsxs)("div",{style:{fontSize:12,color:"var(--muted)",lineHeight:1.5,marginTop:4},children:["The first poll only records what is already there. After that, each new item starts one run with its fields as ",(0,l.jsx)("span",{className:"mono",children:"{{trigger.*}}"}),"."," ",r>0?`${r} filter condition(s) set.`:"No filter."," Edit ",(0,l.jsx)("span",{className:"mono",children:"filter"})," under Advanced."]})]})}var Ts=[{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 wm({node:e,patchData:t}){let n=e.config,r=String(n.event??"on:"),i=Ts.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)(W,{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)(A,{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:Ts.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:Ts.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 xm(e){return(0,l.jsx)(W,{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 km({node:e,patchData:t,agents:n}){let r=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(W,{title:"Agent",children:[(0,l.jsx)(k,{label:"Which agent runs",children:(0,l.jsx)(hm,{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)(Un,{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)(W,{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)(ke,{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)(_n,{value:r.timeoutMinutes,onChange:o=>t({timeoutMinutes:o}),placeholder:"5"})})]})]})}function bm({node:e,patchData:t}){let n=e.config,[r,o]=(0,fe.useState)(n.template&&typeof n.template=="object"?"template":"path");return(0,l.jsxs)(W,{title:"Transform",children:[(0,l.jsx)(k,{label:"Mode",children:(0,l.jsx)(ke,{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)(A,{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)($n,{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 _m({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)(W,{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,g)=>g!==c)),children:(0,l.jsx)(K.trash,{})})]}),(0,l.jsx)(k,{label:"If",children:(0,l.jsx)(ke,{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)(A,{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)(A,{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)(A,{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)(A,{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)(K.plus,{})," Add case"]})]}),(0,l.jsx)(W,{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)(A,{mono:!0,value:String(n.default??"fallback"),onChange:s=>t({default:s})})})})]})}function Sm({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)(W,{title:"Checkpoint",children:(0,l.jsx)(k,{label:"Name",hint:"Human label shown in logs + run timelines",children:(0,l.jsx)(A,{value:String(n.name??e.id),onChange:a=>t({name:a}),placeholder:"await-label-change"})})}),(0,l.jsxs)(W,{title:"Wait for",children:[(0,l.jsx)(k,{label:"Source",hint:"Which kind of event unpauses this run",children:(0,l.jsx)(ke,{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)(Tt,{mono:!0,value:Array.isArray(r.labels)?r.labels:[],onChange:a=>o({labels:a.length?a:void 0})})})]}),(0,l.jsx)(W,{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)(A,{mono:!0,value:String(i.eventIdLike??""),onChange:a=>t({resumeMatch:{...i,eventIdLike:a||void 0}})})})})]})}function Cm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{title:"Terminal",children:[(0,l.jsx)(k,{label:"Status",children:(0,l.jsx)(ke,{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)(Gi,{value:String(n.summary??""),onChange:r=>t({summary:r}),rows:2})})]})}var Nm=["gitlab","github","whatsapp","telegram","discord","slack"],Ps=new Map,Ap=6e4;function Em(e){let[t,n]=(0,fe.useState)(()=>{let r=Ps.get(e);return r&&Date.now()-r.at<Ap?{chats:r.chats,source:r.source,loading:!1}:{chats:[],source:"",loading:!0}});return(0,fe.useEffect)(()=>{let r=!1,o=Ps.get(e);if(o&&Date.now()-o.at<Ap){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 Tm({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=Em(a),s=`chats-${a}`;return(0,l.jsxs)(W,{title:"Send message",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ke,{value:a,onChange:c=>t({channel:c}),options:Nm})}),(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)(A,{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)(Un,{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)(A,{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)(A,{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)(ke,{value:String(r.parseMode??"markdown"),onChange:c=>t({parseMode:c}),options:["markdown","plain","html"]})})]})}function Pm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(W,{title:"Target",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ke,{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)(A,{mono:!0,value:String(n.project??""),onChange:r=>t({project:r}),placeholder:"acme/web"})})]}),(0,l.jsxs)(W,{title:"Issue",children:[(0,l.jsx)(k,{label:"Title",children:(0,l.jsx)(Un,{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)(Un,{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)(Tt,{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)(Tt,{mono:!0,value:Array.isArray(n.assignees)?n.assignees:[],onChange:r=>t({assignees:r}),placeholder:"alice, bob"})})]})]})}function Mm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(W,{title:"Target",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ke,{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)(ke,{value:String(n.kind??"issue"),onChange:r=>t({kind:r}),options:["issue","merge_request"]})}),(0,l.jsx)(k,{label:"Project",children:(0,l.jsx)(A,{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)(A,{mono:!0,value:String(n.iid??""),onChange:r=>t({iid:r}),placeholder:"{{trigger.issue.iid}}"})})]}),(0,l.jsxs)(W,{title:"Labels",children:[(0,l.jsx)(k,{label:"Add",hint:"Comma-separated list",children:(0,l.jsx)(Tt,{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)(Tt,{value:Array.isArray(n.remove)?n.remove:[],onChange:r=>t({remove:r}),placeholder:"Triage"})})]})]})}function Fm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{title:"Read labels",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ke,{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)(ke,{value:String(n.kind??"issue"),onChange:r=>t({kind:r}),options:["issue","merge_request"]})}),(0,l.jsx)(k,{label:"Project",children:(0,l.jsx)(A,{mono:!0,value:String(n.project??""),onChange:r=>t({project:r})})}),(0,l.jsx)(k,{label:"Issue number",children:(0,l.jsx)(A,{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 Lm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{title:"React",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ke,{value:String(n.channel??"telegram"),onChange:r=>t({channel:r}),options:["telegram","whatsapp"]})}),(0,l.jsx)(k,{label:"Chat id",children:(0,l.jsx)(A,{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)(A,{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)(A,{value:String(n.emoji??"\u{1F440}"),onChange:r=>t({emoji:r})})})]})}function Im({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{title:"Edit message",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ke,{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)(A,{mono:!0,value:String(n.chatId??""),onChange:r=>t({chatId:r})})}),(0,l.jsx)(k,{label:"Message id",children:(0,l.jsx)(A,{mono:!0,value:String(n.messageId??""),onChange:r=>t({messageId:r})})}),(0,l.jsx)(k,{label:"Replace the text with",children:(0,l.jsx)(Un,{value:String(n.text??""),onChange:r=>t({text:r}),rows:3})}),(0,l.jsx)(k,{label:"Text formatting",children:(0,l.jsx)(ke,{value:String(n.parseMode??"plain"),onChange:r=>t({parseMode:r}),options:["plain","markdown","html"]})})]})}function Rm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{title:"Log time",children:[(0,l.jsx)(k,{label:"Channel",children:(0,l.jsx)(ke,{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)(A,{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)(_n,{value:n.durationMs,onChange:r=>t({durationMs:r}),placeholder:"900000"})})]})}function Om({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(W,{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)(A,{mono:!0,value:String(n.actionId??""),onChange:r=>t({actionId:r}),placeholder:"deploy-staging"})})}),(0,l.jsx)(W,{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)($n,{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 Am({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(W,{title:"Request",children:[(0,l.jsx)(k,{label:"URL",children:(0,l.jsx)(A,{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)(ke,{value:String(n.method??"POST"),onChange:r=>t({method:r}),options:["GET","POST","PUT","PATCH","DELETE"]})})]}),(0,l.jsx)(W,{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)(Un,{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)(W,{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)($n,{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 zm=["text","long-text","number","boolean","date","select","multi-select","file"];function zp({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)(W,{title:"Form",children:[(0,l.jsx)(k,{label:"Title",hint:"Header shown to the assignee above the form",children:(0,l.jsx)(A,{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)(A,{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)(A,{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)(A,{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)(A,{value:e.secondaryAction?.label??"",onChange:s=>t({...e,secondaryAction:{key:e.secondaryAction?.key??"secondary",label:s}}),placeholder:"label (e.g. Reject)"})]})})]}),(0,l.jsxs)(W,{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)(A,{mono:!0,value:s.key,onChange:d=>r(c,{key:d})})}),(0,l.jsx)(k,{label:"Label",children:(0,l.jsx)(A,{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)(ke,{value:s.type,onChange:d=>r(c,{type:d}),options:zm.slice()})}),(0,l.jsx)(k,{label:"",children:(0,l.jsx)(Vi,{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)(Tt,{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)(A,{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)(_n,{value:s.validate?.min,onChange:d=>o(c,{min:d})})}),(0,l.jsx)(k,{label:"Max",children:(0,l.jsx)(_n,{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)(A,{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 Dm({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)(W,{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)(A,{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)(A,{value:String(n.title??""),onChange:o=>t({title:o})})}),(0,l.jsx)(k,{label:"Description",children:(0,l.jsx)(Gi,{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)(A,{mono:!0,value:String(n.dueIn??""),onChange:o=>t({dueIn:o}),placeholder:"P2D"})})]}),(0,l.jsx)(zp,{form:r,patch:o=>t({form:o})})]})}function Wm({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)(W,{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)(A,{mono:!0,value:String(n.startableBy??""),onChange:o=>t({startableBy:o}),placeholder:"role:public"})})}),(0,l.jsx)(zp,{form:r,patch:o=>t({form:o})})]})}function jm({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{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)(A,{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)($n,{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 Um({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{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)(A,{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)(ke,{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)($n,{value:n.payload??{},onChange:r=>t({payload:r}),keyPlaceholder:"payload key",valuePlaceholder:"{{trigger.iid}}",emptyHint:"Empty signal payload."})})]})}function $m({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(W,{title:"Wait for signal",children:[(0,l.jsx)(k,{label:"Name",children:(0,l.jsx)(A,{mono:!0,value:String(n.name??""),onChange:r=>t({name:r}),placeholder:"approved"})}),(0,l.jsx)(k,{label:"Scope",children:(0,l.jsx)(ke,{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)($n,{value:n.match??{},onChange:r=>t({match:r}),keyPlaceholder:"payload key",valuePlaceholder:"expected value",emptyHint:"No filter \u2014 matches any payload."})})]})}function Hm({node:e,patchData:t}){let n=e.config;return(0,l.jsx)(W,{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)(A,{mono:!0,value:String(n.after??""),onChange:r=>t({after:r}),placeholder:"PT1H"})})})}function Bm({node:e,patchData:t}){let n=e.config;return(0,l.jsx)(W,{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)(ke,{value:String(n.mode??"fanOut"),onChange:r=>t({mode:r}),options:["fanOut","join"]})})})}function Gm({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)(W,{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)(Tt,{mono:!0,value:r,onChange:i,placeholder:"{{classify.result}}, {{trigger.values.amount}}"})})}),(0,l.jsxs)(W,{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)(A,{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)(Tt,{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)($n,{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)(W,{title:"Default",children:(0,l.jsx)(k,{label:"Goes to",children:(0,l.jsx)(A,{mono:!0,value:String(n.default?.to??"fallback"),onChange:c=>t({default:{...n.default??{},to:c}})})})})]})}var Vm={"trigger.channel":e=>(0,l.jsx)(mm,{...e}),"trigger.cron":e=>(0,l.jsx)(vm,{...e}),"trigger.poll":e=>(0,l.jsx)(ym,{...e}),"trigger.hook":e=>(0,l.jsx)(wm,{...e}),"trigger.manual":e=>(0,l.jsx)(xm,{...e}),"trigger.form":e=>(0,l.jsx)(Wm,{...e}),agent:e=>(0,l.jsx)(km,{...e}),transform:e=>(0,l.jsx)(bm,{...e}),branch:e=>(0,l.jsx)(_m,{...e}),"gateway.parallel":e=>(0,l.jsx)(Bm,{...e}),rule:e=>(0,l.jsx)(Gm,{...e}),checkpoint:e=>(0,l.jsx)(Sm,{...e}),userTask:e=>(0,l.jsx)(Dm,{...e}),subProcess:e=>(0,l.jsx)(jm,{...e}),"signal.emit":e=>(0,l.jsx)(Um,{...e}),"signal.wait":e=>(0,l.jsx)($m,{...e}),"timer.boundary":e=>(0,l.jsx)(Hm,{...e}),end:e=>(0,l.jsx)(Cm,{...e}),"action.send":e=>(0,l.jsx)(Tm,{...e}),"action.createIssue":e=>(0,l.jsx)(Pm,{...e}),"action.setLabel":e=>(0,l.jsx)(Mm,{...e}),"action.readLabel":e=>(0,l.jsx)(Fm,{...e}),"action.react":e=>(0,l.jsx)(Lm,{...e}),"action.editMessage":e=>(0,l.jsx)(Im,{...e}),"action.logTime":e=>(0,l.jsx)(Rm,{...e}),"action.callHTTP":e=>(0,l.jsx)(Am,{...e}),"action.run":e=>(0,l.jsx)(Om,{...e})};function Dp(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:g,onDeleteWorkflow:v,isNew:b}=e;if(!t)return(0,l.jsx)(Zm,{meta:p,patchMeta:g,onDeleteWorkflow:v,isNew:b});if(t.kind==="edge"){let V=r.find(f=>f.id===t.id);return V?(0,l.jsx)(ev,{edge:{...V,id:V.id??""},patch:o,onDelete:()=>a(t)}):null}let w=n.find(V=>V.id===t.id);return w?(0,l.jsx)(Km,{node:w,nodes:n,edges:r,patch:o,patchData:i,onDelete:()=>a(t),onDuplicate:()=>u(t),validation:s,runOutput:c?.outputs?.[w.id],agents:d}):null}function Km({node:e,nodes:t,edges:n,patch:r,patchData:o,onDelete:i,onDuplicate:a,validation:u,runOutput:s,agents:c}){let[d,p]=(0,fe.useState)("config"),g=Vm[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:v=>r({id:v.target.value})}),(0,l.jsx)("button",{className:"btn btn--ghost-icon",title:"Duplicate",onClick:a,children:(0,l.jsx)(K.dup,{})}),(0,l.jsx)("button",{className:"btn btn--ghost-icon",title:"Delete",onClick:i,children:(0,l.jsx)(K.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)(K.gear,{})," Config"]}),(0,l.jsxs)("button",{className:"insp__tab"+(d==="advanced"?" is-active":""),onClick:()=>p("advanced"),children:[(0,l.jsx)(K.layout,{})," Advanced"]}),(0,l.jsxs)("button",{className:"insp__tab"+(d==="preview"?" is-active":""),onClick:()=>p("preview"),children:[(0,l.jsx)(K.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:[g?g({node:e,nodes:t,patch:r,patchData:o,agents:c}):(0,l.jsx)(W,{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)(Qm,{node:e,nodes:t,edges:n})]}),d==="advanced"&&(0,l.jsx)(qm,{node:e,patchData:o}),d==="preview"&&(0,l.jsx)(W,{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)(W,{title:"Issues",right:(0,l.jsx)("span",{className:"card__kind",style:{color:"var(--err)"},children:u.length}),children:u.map((v,b)=>(0,l.jsxs)("div",{className:"fld__err",style:{padding:"6px 0"},children:[(0,l.jsx)(K.warn,{})," ",v.message]},b))})]})]})}function Ym(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 Qm({node:e,nodes:t,edges:n}){let r=(0,fe.useMemo)(()=>Ym(e.id,t,n),[e.id,t,n]);return r.length===0?(0,l.jsx)(W,{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)(W,{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)(Xm,{node:o},o.id))})})}function Xm({node:e}){let t=Es[e.type],n=t?Op(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)(Jm,{nodeId:e.id,field:r},r.path))})]})}function Jm({nodeId:e,field:t}){let[n,r]=(0,fe.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 qm({node:e,patchData:t}){let[n,r]=(0,fe.useState)(()=>JSON.stringify(e.config,null,2)),[o,i]=(0,fe.useState)(null);return(0,fe.useMemo)(()=>{r(JSON.stringify(e.config,null,2)),i(null)},[e.id]),(0,l.jsxs)(W,{title:"Raw config JSON",children:[(0,l.jsx)(Gi,{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)(K.check,{})," Apply"]}),(0,l.jsxs)("button",{className:"btn btn--ghost-icon",onClick:()=>r(JSON.stringify(e.config,null,2)),children:[(0,l.jsx)(K.undo,{})," Reset"]})]}),o&&(0,l.jsxs)("div",{className:"fld__err",style:{color:"var(--err)",fontSize:11,marginTop:4},children:[(0,l.jsx)(K.err,{})," ",o]})]})}function Zm({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)(W,{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)(A,{mono:!0,value:e.id,onChange:i=>r&&t({id:i})})}),(0,l.jsx)(k,{label:"Title",children:(0,l.jsx)(A,{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)(Gi,{rows:2,value:e.description??"",onChange:i=>t({description:i})})})]}),(0,l.jsxs)(W,{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)(_n,{value:e.priority,onChange:i=>t({priority:i??0}),placeholder:"0"})}),(0,l.jsx)(k,{label:"",children:(0,l.jsx)(Vi,{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)(Tt,{mono:!0,value:e.envAllow??[],onChange:i=>t({envAllow:i}),placeholder:"GITLAB_TOKEN, SLACK_WEBHOOK"})})]}),(0,l.jsxs)(W,{title:"Retention",defaultOpen:!1,children:[(0,l.jsx)(k,{label:"How many runs to keep",children:(0,l.jsx)(_n,{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)(_n,{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)(K.trash,{})," Delete workflow"]})})]})]})}function ev({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)(K.trash,{})})]})}),(0,l.jsxs)("div",{className:"insp__body",children:[(0,l.jsx)(W,{title:"Label",children:(0,l.jsx)(k,{label:"Label",hint:"Shown on the edge (cosmetic only)",children:(0,l.jsx)(A,{mono:!0,value:e.label??"",onChange:r=>t({label:r})})})}),(0,l.jsx)(W,{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)(A,{mono:!0,value:e.fromPort??"",onChange:r=>t({fromPort:r||void 0})})})})]})]})}var At=ge(Ut(),1);var re=ge(De(),1);function Wp({onLoadTemplate:e,onAdd:t}){let[n,r]=(0,At.useState)(""),[o,i]=(0,At.useState)([]);(0,At.useEffect)(()=>{let s=!0;return fetch("/api/n8n/workflows").then(c=>c.json()).then(c=>{if(!s)return;let d=(c.workflows??[]).filter(p=>p.webhookUrl).map(p=>({id:"n8n."+p.id,type:"action.callHTTP",label:p.name,hint:p.active?"Hands this over to n8n":"In n8n, but switched off there",glyph:"g-action",icon:"globe",config:{url:p.webhookUrl,method:"POST",body:"{{trigger}}"}}));i(d.length?[{section:"From your n8n",items:d}]:[])}).catch(()=>{}),()=>{s=!1}},[]);let a=(0,At.useMemo)(()=>[...ws,...o],[o]),u=(0,At.useMemo)(()=>{if(!n.trim())return a;let s=n.toLowerCase();return a.map(c=>({...c,items:c.items.filter(d=>d.label.toLowerCase().includes(s)||d.hint.toLowerCase().includes(s)||d.type.includes(s))})).filter(c=>c.items.length>0)},[n,a]);return(0,re.jsxs)("div",{className:"pal",children:[(0,re.jsxs)("div",{className:"pal__search",children:[(0,re.jsx)(K.search,{}),(0,re.jsx)("input",{value:n,onChange:s=>r(s.target.value),placeholder:"Find a step\u2026","aria-label":"Find a step to add"}),(0,re.jsx)("kbd",{children:"/"})]}),(0,re.jsxs)("div",{className:"pal__scroll",children:[u.map(s=>(0,re.jsxs)(At.Fragment,{children:[(0,re.jsxs)("div",{className:"pal__section",children:[(0,re.jsx)("span",{children:s.section}),(0,re.jsx)("span",{className:"pal__section-count",children:s.items.length.toString().padStart(2,"0")})]}),s.items.map(c=>(0,re.jsx)(tv,{item:c,onAdd:t},c.id))]},s.section)),!n&&(0,re.jsxs)(re.Fragment,{children:[(0,re.jsxs)("div",{className:"pal__section",children:[(0,re.jsx)("span",{children:"Templates"}),(0,re.jsx)("span",{className:"pal__section-count",children:ks.length.toString().padStart(2,"0")})]}),ks.map(s=>(0,re.jsxs)("button",{type:"button",className:"pal__tpl",onClick:()=>e(s),children:[(0,re.jsx)("div",{className:"pal__tpl-dots",children:[0,1,2].map(c=>(0,re.jsx)("span",{className:c<s.dots?"on":""},c))}),(0,re.jsx)("div",{className:"pal__tpl-title",children:s.title}),(0,re.jsx)("div",{className:"pal__tpl-hint",children:s.hint})]},s.id))]})]}),(0,re.jsxs)("div",{className:"pal__foot",children:[(0,re.jsx)(K.lightning,{}),(0,re.jsx)("span",{children:"Select a step to add it, or drag it onto the canvas"})]})]})}function tv({item:e,onAdd:t}){let n=K[e.icon]??K.box;return(0,re.jsxs)("div",{className:"pal__item",draggable:!0,onDragStart:o=>{o.dataTransfer.setData("application/x-wfe-item",JSON.stringify(e)),o.dataTransfer.effectAllowed="copy";let i=document.createElement("div");i.textContent=e.label,i.style.cssText="position:absolute;top:-1000px;padding:6px 10px;background:var(--ax-accent);color:var(--ax-bg);border-radius:6px;font:500 12px var(--ax-font);",document.body.appendChild(i),o.dataTransfer.setDragImage(i,10,10),setTimeout(()=>document.body.removeChild(i),0)},role:"button",tabIndex:0,title:`Add \u201C${e.label}\u201D`,onClick:()=>t(e),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t(e))},children:[(0,re.jsx)("div",{className:"pal__glyph "+e.glyph,children:(0,re.jsx)(n,{})}),(0,re.jsxs)("div",{className:"pal__meta",children:[(0,re.jsx)("div",{className:"pal__label",children:e.label}),(0,re.jsx)("div",{className:"pal__hint",children:e.hint})]})]})}var Fs=ge(Ut(),1);var M=ge(De(),1);function jp(e){return(0,M.jsxs)("div",{className:"tb",role:"toolbar","aria-label":"Workflow editor",children:[(0,M.jsxs)("div",{className:"tb__main",children:[(0,M.jsx)("button",{type:"button",className:"btn btn--ghost-icon tb__menu"+(e.menuOpen?" is-active":""),"aria-expanded":e.menuOpen,"aria-controls":"wfe-menu",title:(e.menuOpen?"Hide":"Show")+" the side menu ([)","aria-label":(e.menuOpen?"Hide":"Show")+" the side menu",onClick:()=>e.setMenuOpen(!e.menuOpen),children:(0,M.jsx)(K.panelLeft,{})}),(0,M.jsxs)("div",{className:"tb__crumbs",children:[(0,M.jsx)("button",{type:"button",className:"tb__back",onClick:e.onBack,title:"Back to Workflows",children:"Workflows"}),(0,M.jsx)("span",{className:"sep","aria-hidden":"true",children:"/"}),(0,M.jsx)("input",{value:e.title,"aria-label":"Workflow title",onChange:t=>e.setTitle(t.target.value)})]}),(0,M.jsxs)("div",{className:"tb__status "+e.status,role:"status",children:[(0,M.jsx)("span",{className:"dot"}),e.statusLabel??(e.status==="is-dirty"?"unsaved":e.status==="is-running"?"running":e.status==="is-validating"?"checking\u2026":"saved")]}),(0,M.jsx)("div",{className:"tb__spacer"}),(0,M.jsx)("button",{type:"button",className:"btn btn--ghost-icon tb__opt",title:"Undo (\u2318Z)","aria-label":"Undo",onClick:e.onUndo,disabled:!e.canUndo,children:(0,M.jsx)(K.undo,{})}),(0,M.jsx)("button",{type:"button",className:"btn btn--ghost-icon tb__opt",title:"Redo (\u2318\u21E7Z)","aria-label":"Redo",onClick:e.onRedo,disabled:!e.canRedo,children:(0,M.jsx)(K.redo,{})}),(0,M.jsxs)("button",{type:"button",className:"btn btn--ghost tb__arrange",title:"Arrange the steps left to right (L)",onClick:e.onLayout,children:[(0,M.jsx)(K.layout,{}),(0,M.jsx)("span",{children:"Arrange"})]}),(0,M.jsx)("button",{type:"button",className:"btn btn--ghost-icon tb__opt",title:"Fit the workflow in view (F)","aria-label":"Fit in view",onClick:e.onFit,children:(0,M.jsx)(K.fit,{})}),(0,M.jsx)("button",{type:"button",className:"btn btn--ghost-icon tb__opt",title:"Keyboard shortcuts (?)","aria-label":"Keyboard shortcuts",onClick:e.onHelp,children:(0,M.jsx)(K.kbd,{})})]}),(0,M.jsxs)("div",{className:"tb__actions",children:[e.canSave&&(0,M.jsxs)("button",{type:"button",className:"btn btn--outline",onClick:e.onSave,children:[(0,M.jsx)(K.save,{})," ",(0,M.jsx)("span",{children:"Save"})]}),(0,M.jsx)("button",{type:"button",className:"btn btn--primary tb__run",onClick:e.onRun,title:"Walk through the steps without running them",children:e.running?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(K.stop2,{})," ",(0,M.jsx)("span",{children:"Stop"})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(K.run,{})," ",(0,M.jsx)("span",{children:"Preview"})]})})]})]})}function Up({running:e,script:t,cursor:n,onStop:r}){if(!e)return null;let o=t.filter(i=>i.nodeId);return(0,M.jsxs)("div",{className:"run",children:[(0,M.jsxs)("div",{className:"run__head",children:[(0,M.jsx)(K.lightning,{}),(0,M.jsx)("div",{className:"run__title",children:"Live run"}),(0,M.jsxs)("span",{className:"run__chip",children:[(0,M.jsx)("span",{className:"dot"})," streaming"]}),(0,M.jsx)("button",{className:"btn btn--ghost-icon",onClick:r,style:{height:24,width:24},children:(0,M.jsx)(K.x,{})})]}),(0,M.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,M.jsxs)("div",{className:c.join(" "),children:[(0,M.jsx)("div",{className:"run__marker",children:s?(0,M.jsx)(K.check,{}):a+1}),(0,M.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,M.jsx)("div",{className:"run__step-title",children:i.title}),i.body&&(0,M.jsx)("div",{className:"run__step-body",dangerouslySetInnerHTML:{__html:i.body}})]})]},a)})}),(0,M.jsxs)("div",{className:"run__foot",children:[(0,M.jsxs)("span",{children:[Math.min(n+1,t.length),"/",t.length]}),(0,M.jsxs)("span",{children:[t.length?Math.round((n+1)/t.length*100):0,"%"]})]})]})}function $p({open:e,onClose:t}){return e?(0,M.jsx)("div",{className:"kbd-overlay",onClick:t,children:(0,M.jsxs)("div",{className:"kbd-card",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",onClick:r=>r.stopPropagation(),children:[(0,M.jsx)("h3",{children:"Keyboard shortcuts"}),[["Save workflow","\u2318S"],["Undo / Redo","\u2318Z / \u2318\u21E7Z"],["Delete selection","Delete"],["Duplicate step","\u2318D"],["Move the selected step","\u2190 \u2192 \u2191 \u2193"],["Arrange the steps","L"],["Fit in view","F"],["Show or hide the side menu","["],["Preview","\u2318\u23CE"],["Find a step to add","/"],["Close this","Esc"]].map(([r,o])=>(0,M.jsxs)("div",{className:"row",children:[(0,M.jsx)("span",{children:r}),(0,M.jsx)("span",{children:o.split(" ").map((i,a)=>(0,M.jsxs)(Fs.Fragment,{children:[i.includes("/")?i.split("/").map((u,s)=>(0,M.jsxs)(Fs.Fragment,{children:[s>0&&" / ",(0,M.jsx)("kbd",{children:u.trim()})]},s)):(0,M.jsx)("kbd",{children:i})," "]},a))})]},r))]})}):null}function nv(){if(window.AX_LOCAL_TOKEN)return window.AX_LOCAL_TOKEN;try{return localStorage.getItem("ax_token")||""}catch{return""}}function qt(){let e={"Content-Type":"application/json","X-Requested-With":"agentx-board"},t=nv();return t&&(e.Authorization="Bearer "+t),e}async function Hp(e){let t=await fetch("/api/workflows/"+encodeURIComponent(e),{headers:qt()});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:qt()});return t.ok?(await t.json()).layout:null}async function Gp(e){let t=await fetch("/api/workflows/"+encodeURIComponent(e.id)+"/validate",{method:"POST",headers:qt(),body:JSON.stringify(e)});return t.ok?await t.json():{ok:!1,issues:[{path:"",message:"HTTP "+t.status}]}}async function Ls(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:qt(),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 Vp(e,t){return(await fetch("/api/workflows/"+encodeURIComponent(e)+"/layout",{method:"PUT",headers:qt(),body:JSON.stringify(t)})).ok}async function Kp(e){return(await fetch("/api/workflows/"+encodeURIComponent(e),{method:"DELETE",headers:qt()})).ok}async function Yp(){try{let e=await fetch("/api/agents",{headers:qt()});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 Be=ge(Ut(),1),oe=ge(De(),1),Rs="agentx.editor.chat.v1";function Qp({currentWorkflow:e,onApplyWorkflow:t,agentId:n}){let[r,o]=(0,Be.useState)(!1),[i,a]=(0,Be.useState)(()=>av()),[u,s]=(0,Be.useState)(""),[c,d]=(0,Be.useState)(!1),p=(0,Be.useRef)(null),g=(0,Be.useRef)(null);(0,Be.useEffect)(()=>{let f=i.filter(h=>!h.pending).map(h=>({role:h.role,content:h.content}));try{sessionStorage.setItem(Rs,JSON.stringify(f))}catch{}},[i]),(0,Be.useEffect)(()=>{let f=p.current;f&&(f.scrollTop=f.scrollHeight)},[i,r]),(0,Be.useEffect)(()=>{r&&g.current?.focus()},[r]);let v=(0,Be.useCallback)(async()=>{let f=u.trim();if(!f||c)return;let h=i.filter(x=>!x.pending).map(x=>({role:x.role,content:x.content})),m=[...i,{role:"user",content:f},{role:"assistant",content:"\u2026",pending:!0}];a(m),s(""),d(!0);try{let x=await fetch("/api/workflows/editor/chat",{method:"POST",credentials:"same-origin",headers:qt(),body:JSON.stringify({messages:[...h,{role:"user",content:f}],currentWorkflow:e,agentId:n})}),C=await x.json().catch(()=>({}));x.ok?a(F=>Is(F,{role:"assistant",content:C.reply||"",workflow:C.workflow||void 0})):a(F=>Is(F,{role:"assistant",content:"",error:C.error||`HTTP ${x.status}`}))}catch(x){a(C=>Is(C,{role:"assistant",content:"",error:x?.message||"network error"}))}finally{d(!1)}},[n,c,e,u,i]),b=()=>{a([]);try{sessionStorage.removeItem(Rs)}catch{}},w=f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),v())},V=(0,Be.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(`
1471
+ `),[]);return(0,oe.jsxs)(oe.Fragment,{children:[!r&&(0,oe.jsxs)("button",{className:"ax-chat__pill","aria-label":"Open workflow assistant",onClick:()=>o(!0),children:[(0,oe.jsx)("span",{className:"ax-chat__pill-glyph",children:"\u2728"}),(0,oe.jsx)("span",{className:"ax-chat__pill-text",children:"Ask AI to build\u2026"})]}),r&&(0,oe.jsxs)("div",{className:"ax-chat__panel",role:"dialog","aria-label":"Workflow assistant",children:[(0,oe.jsxs)("header",{className:"ax-chat__head",children:[(0,oe.jsxs)("div",{className:"ax-chat__title",children:[(0,oe.jsx)("span",{className:"ax-chat__dot"})," Workflow assistant"]}),(0,oe.jsxs)("div",{className:"ax-chat__head-actions",children:[(0,oe.jsx)("button",{className:"ax-chat__iconbtn",onClick:b,title:"Clear conversation",children:"\u232B"}),(0,oe.jsx)("button",{className:"ax-chat__iconbtn",onClick:()=>o(!1),title:"Collapse",children:"\u25BC"})]})]}),(0,oe.jsxs)("div",{className:"ax-chat__body",ref:p,children:[i.length===0&&(0,oe.jsx)("pre",{className:"ax-chat__empty",children:V}),i.map((f,h)=>(0,oe.jsx)(rv,{m:f,onApply:t},h))]}),(0,oe.jsxs)("footer",{className:"ax-chat__foot",children:[(0,oe.jsx)("textarea",{ref:g,className:"ax-chat__input",value:u,onChange:f=>s(f.target.value),onKeyDown:w,placeholder:"Describe the workflow you want\u2026 (Enter to send, Shift+Enter for newline)",rows:2,disabled:c}),(0,oe.jsx)("button",{className:"ax-chat__send",onClick:()=>void v(),disabled:c||!u.trim(),children:c?"\u2026":"Send"})]})]}),(0,oe.jsx)("style",{children:lv})]})}function rv({m:e,onApply:t}){if(e.error)return(0,oe.jsxs)("div",{className:"ax-chat__msg ax-chat__msg--err",children:["\u26A0 ",e.error]});if(e.pending)return(0,oe.jsx)("div",{className:"ax-chat__msg ax-chat__msg--assistant ax-chat__msg--pending",children:(0,oe.jsxs)("span",{className:"ax-chat__typing",children:[(0,oe.jsx)("span",{}),(0,oe.jsx)("span",{}),(0,oe.jsx)("span",{})]})});let n=e.role==="user"?"ax-chat__msg ax-chat__msg--user":"ax-chat__msg ax-chat__msg--assistant",r=ov(e.content,!!e.workflow),o=e.role==="assistant"?iv(r):Ki(r);return(0,oe.jsxs)("div",{className:n,children:[(0,oe.jsx)("div",{className:"ax-chat__text",dangerouslySetInnerHTML:{__html:o}}),e.workflow&&(0,oe.jsxs)("div",{className:"ax-chat__apply",children:[(0,oe.jsx)("button",{className:"ax-chat__applybtn",onClick:()=>t(e.workflow),children:"Apply to canvas"}),(0,oe.jsx)("span",{className:"ax-chat__apply-hint",children:"replaces the current workflow"})]})]})}function ov(e,t){return t?e.replace(/```(?:json)?\s*\n[\s\S]*?```/g,"").trim():e}function Ki(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function iv(e){let t=[],n=e.replace(/```([a-zA-Z0-9_-]*)\n([\s\S]*?)```/g,(d,p,g)=>{let v=Ki(g.replace(/\n+$/,"")),b=p?` class="lang-${Ki(p)}"`:"";return t.push(`<pre><code${b}>${v}</code></pre>`),`\0CODE${t.length-1}\0`});n=Ki(n),n=n.replace(/`([^`\n]+)`/g,(d,p)=>`<code>${p}</code>`),n=n.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(d,p,g)=>`<a href="${/^https?:\/\/|^\//.test(g)?g:"#"}" 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(`
1472
1472
  `),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 g=/^(#{1,3})\s+(.+)/.exec(p);if(g){s(),a();let w=g[1].length+2;o.push(`<h${w}>${g[2]}</h${w}>`);continue}let v=/^\s*[-*]\s+(.+)/.exec(p);if(v){s(),i!=="ul"&&(a(),o.push("<ul>"),i="ul"),o.push(`<li>${v[1]}</li>`);continue}let b=/^\s*\d+\.\s+(.+)/.exec(p);if(b){s(),i!=="ol"&&(a(),o.push("<ol>"),i="ol"),o.push(`<li>${b[1]}</li>`);continue}a(),u.push(p)}s(),a();let c=o.join(`
1473
- `);return c=c.replace(/CODE(\d+)/g,(d,p)=>t[Number(p)]||""),c}function Ls(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 av(){try{let e=sessionStorage.getItem(Is);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 lv=`
1473
+ `);return c=c.replace(/CODE(\d+)/g,(d,p)=>t[Number(p)]||""),c}function Is(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 av(){try{let e=sessionStorage.getItem(Rs);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 lv=`
1474
1474
  .ax-chat__pill {
1475
1475
  position: fixed; bottom: 18px; right: 18px; z-index: 40;
1476
1476
  display: flex; align-items: center; gap: 8px;
@@ -1613,15 +1613,15 @@ Error generating stack: `+i.message+`
1613
1613
  .ax-chat__head { background: linear-gradient(135deg, rgba(107,91,255,0.15), rgba(139,92,246,0.08)); }
1614
1614
  .ax-chat__input { background: #2a2a2a; color: #eee; border-color: rgba(255,255,255,0.15); }
1615
1615
  }
1616
- `;function yo(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:sv(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 Rs(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 wo(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 sv(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 Os="__trigger__";var Ee=ge(De(),1);function uv(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:cv(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 r={id:"e-"+Math.random().toString(36).slice(2,8),from:t.conn.from,to:t.conn.to};return t.conn.fromPort!==void 0&&(r.fromPort=t.conn.fromPort),e.edges.some(o=>o.from===r.from&&(o.fromPort??"")===(r.fromPort??"")&&o.to===r.to)?e:{...e,edges:[...e.edges,r]}}case"delete":{let n=t.selection??e.selection;return n?n.kind==="node"?n.id===Os?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===Os)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=vo(e.nodes,e.edges);return{...e,nodes:e.nodes.map(r=>n[r.id]?{...r,position:n[r.id]}:r)}}case"setAll":return t.state}}function cv(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 dv(e){let[t,n]=(0,U.useReducer)(uv,e),r=(0,U.useRef)([]),o=(0,U.useRef)([]),i=(0,U.useRef)(t);(0,U.useEffect)(()=>{i.current=t},[t]);let a=(0,U.useCallback)(v=>{v.type==="select"||v.type==="moveNode"||(r.current.push(i.current),r.current.length>50&&r.current.shift(),o.current=[]),n(v)},[]),u=(0,U.useCallback)(()=>{let v=r.current.pop();v&&(o.current.push(i.current),n({type:"setAll",state:v}))},[]),s=(0,U.useCallback)(()=>{let v=o.current.pop();v&&(r.current.push(i.current),n({type:"setAll",state:v}))},[]),c=(0,U.useRef)(null),d=(0,U.useCallback)(()=>{c.current||(c.current=i.current)},[]),p=(0,U.useCallback)(()=>{let v=c.current;c.current=null,!(!v||v===i.current)&&(r.current.push(v),r.current.length>50&&r.current.shift(),o.current=[])},[]),g=(0,U.useCallback)(v=>{r.current=[],o.current=[],n({type:"setAll",state:v})},[]);return{state:t,dispatch:a,undo:u,redo:s,forceReset:g,beginMove:d,endMove:p,canUndo:r.current.length>0,canRedo:o.current.length>0}}function pv(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 fv(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}var Jp="wfe.menu",Yi="(max-width: 900px)";function hv(){try{let e=localStorage.getItem(Jp);return window.matchMedia(Yi).matches?!1:e!=="closed"}catch{return!0}}function Ki(e){return JSON.stringify([e.meta,e.nodes,e.edges])}function qp(e){let{state:t,dispatch:n,undo:r,redo:o,forceReset:i,beginMove:a,endMove:u,canUndo:s,canRedo:c}=dv({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:d,nodes:p,edges:g,selection:v,isNew:b}=t,w=e.owner,G=(0,U.useRef)(t);(0,U.useEffect)(()=>{G.current=t},[t]);let[f,h]=(0,U.useState)(hv),[m,x]=(0,U.useState)(e.isNew?"add":"edit"),[C,F]=(0,U.useState)({zoom:.75,tx:40,ty:60}),[L,R]=(0,U.useState)(0),H=()=>R(T=>T+1),z=(0,U.useCallback)(T=>{h(T);try{window.matchMedia(Yi).matches||localStorage.setItem(Jp,T?"open":"closed")}catch{}},[]),Se=(0,U.useRef)(!0);(0,U.useEffect)(()=>{if(Se.current){Se.current=!1;return}let T=window.setTimeout(H,180);return()=>window.clearTimeout(T)},[f]);let[tt,vt]=(0,U.useState)(!1),[zt,_]=(0,U.useState)(null),[O,V]=(0,U.useState)(""),B=(0,U.useRef)(null),$=(T,E="ok")=>{_({msg:T,kind:E}),B.current&&window.clearTimeout(B.current),B.current=window.setTimeout(()=>_(null),E==="err"?5e3:2e3)},[J,Z]=(0,U.useState)(Cp);(0,U.useEffect)(()=>{(async()=>{let T=await Yp();if(!T.length)return;let E=T.map((q,oe)=>({id:q.id,name:q.name||q.id,tags:[],color:oe*37%360}));Z(E)})()},[]);let[le,we]=(0,U.useState)(""),nt=(T,E)=>{let q=T;if(Mp(q.nodes)){let Pe=vo(q.nodes,q.edges);q={...q,nodes:q.nodes.map(be=>Pe[be.id]?{...be,position:Pe[be.id]}:be)}}let oe=Xp(q,E);i(oe),we(E?"":Ki(oe)),H()};(0,U.useEffect)(()=>{let T=e.workflowId||"new-workflow";if(e.isNew){nt(wo(T),!0);return}let E=!0;return(async()=>{try{let[q,oe]=await Promise.all([Hp(T),Bp(T)]);E&&nt(yo(q,oe),!1)}catch(q){if(!E)return;$(`Could not open "${T}": ${q.message}`,"err"),nt(wo(T),!0)}})(),()=>{E=!1}},[e.workflowId,e.isNew]);let Sn=d.id!=="loading"&&Ki({meta:d,nodes:p,edges:g})!==le;(0,U.useEffect)(()=>{e.onDirty?.(Sn)},[Sn]);let Te=O||(Sn?"is-dirty":"is-saved"),Hn=(0,U.useCallback)(async()=>{if(!w){$("Only the owner can save a workflow","err");return}let T=G.current,{workflow:E,layout:q}=Rs({meta:T.meta,nodes:T.nodes,edges:T.edges});V("is-validating");let oe=await Gp(E);if(!oe.ok){V(""),$(oe.issues[0]?.message?`Not saved: ${oe.issues[0].message}`:`${oe.issues.length} problem${oe.issues.length===1?"":"s"} to fix first`,"err");return}let Pe=await Fs(E,{create:T.isNew});if(!Pe.ok&&Pe.kind==="yaml-authored"){let Ce=Pe.path||"(unknown path)";if(!confirm(`This workflow is YAML-authored on disk:
1616
+ `;function yo(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:sv(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 Os(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 wo(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 sv(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 As="__trigger__";var Ee=ge(De(),1);function uv(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:cv(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 r={id:"e-"+Math.random().toString(36).slice(2,8),from:t.conn.from,to:t.conn.to};return t.conn.fromPort!==void 0&&(r.fromPort=t.conn.fromPort),e.edges.some(o=>o.from===r.from&&(o.fromPort??"")===(r.fromPort??"")&&o.to===r.to)?e:{...e,edges:[...e.edges,r]}}case"delete":{let n=t.selection??e.selection;return n?n.kind==="node"?n.id===As?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===As)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=vo(e.nodes,e.edges);return{...e,nodes:e.nodes.map(r=>n[r.id]?{...r,position:n[r.id]}:r)}}case"setAll":return t.state}}function cv(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 dv(e){let[t,n]=(0,U.useReducer)(uv,e),r=(0,U.useRef)([]),o=(0,U.useRef)([]),i=(0,U.useRef)(t);(0,U.useEffect)(()=>{i.current=t},[t]);let a=(0,U.useCallback)(v=>{v.type==="select"||v.type==="moveNode"||(r.current.push(i.current),r.current.length>50&&r.current.shift(),o.current=[]),n(v)},[]),u=(0,U.useCallback)(()=>{let v=r.current.pop();v&&(o.current.push(i.current),n({type:"setAll",state:v}))},[]),s=(0,U.useCallback)(()=>{let v=o.current.pop();v&&(r.current.push(i.current),n({type:"setAll",state:v}))},[]),c=(0,U.useRef)(null),d=(0,U.useCallback)(()=>{c.current||(c.current=i.current)},[]),p=(0,U.useCallback)(()=>{let v=c.current;c.current=null,!(!v||v===i.current)&&(r.current.push(v),r.current.length>50&&r.current.shift(),o.current=[])},[]),g=(0,U.useCallback)(v=>{r.current=[],o.current=[],n({type:"setAll",state:v})},[]);return{state:t,dispatch:a,undo:u,redo:s,forceReset:g,beginMove:d,endMove:p,canUndo:r.current.length>0,canRedo:o.current.length>0}}function pv(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 fv(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}var Jp="wfe.menu",Qi="(max-width: 900px)";function hv(){try{let e=localStorage.getItem(Jp);return window.matchMedia(Qi).matches?!1:e!=="closed"}catch{return!0}}function Yi(e){return JSON.stringify([e.meta,e.nodes,e.edges])}function qp(e){let{state:t,dispatch:n,undo:r,redo:o,forceReset:i,beginMove:a,endMove:u,canUndo:s,canRedo:c}=dv({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:d,nodes:p,edges:g,selection:v,isNew:b}=t,w=e.owner,V=(0,U.useRef)(t);(0,U.useEffect)(()=>{V.current=t},[t]);let[f,h]=(0,U.useState)(hv),[m,x]=(0,U.useState)(e.isNew?"add":"edit"),[C,F]=(0,U.useState)({zoom:.75,tx:40,ty:60}),[L,R]=(0,U.useState)(0),H=()=>R(T=>T+1),z=(0,U.useCallback)(T=>{h(T);try{window.matchMedia(Qi).matches||localStorage.setItem(Jp,T?"open":"closed")}catch{}},[]),Ce=(0,U.useRef)(!0);(0,U.useEffect)(()=>{if(Ce.current){Ce.current=!1;return}let T=window.setTimeout(H,180);return()=>window.clearTimeout(T)},[f]);let[tt,vt]=(0,U.useState)(!1),[zt,_]=(0,U.useState)(null),[O,B]=(0,U.useState)(""),G=(0,U.useRef)(null),$=(T,E="ok")=>{_({msg:T,kind:E}),G.current&&window.clearTimeout(G.current),G.current=window.setTimeout(()=>_(null),E==="err"?5e3:2e3)},[J,ee]=(0,U.useState)(Cp);(0,U.useEffect)(()=>{(async()=>{let T=await Yp();if(!T.length)return;let E=T.map((q,Z)=>({id:q.id,name:q.name||q.id,tags:[],color:Z*37%360}));ee(E)})()},[]);let[le,we]=(0,U.useState)(""),nt=(T,E)=>{let q=T;if(Mp(q.nodes)){let Pe=vo(q.nodes,q.edges);q={...q,nodes:q.nodes.map(be=>Pe[be.id]?{...be,position:Pe[be.id]}:be)}}let Z=Xp(q,E);i(Z),we(E?"":Yi(Z)),H()};(0,U.useEffect)(()=>{let T=e.workflowId||"new-workflow";if(e.isNew){nt(wo(T),!0);return}let E=!0;return(async()=>{try{let[q,Z]=await Promise.all([Hp(T),Bp(T)]);E&&nt(yo(q,Z),!1)}catch(q){if(!E)return;$(`Could not open "${T}": ${q.message}`,"err"),nt(wo(T),!0)}})(),()=>{E=!1}},[e.workflowId,e.isNew]);let Sn=d.id!=="loading"&&Yi({meta:d,nodes:p,edges:g})!==le;(0,U.useEffect)(()=>{e.onDirty?.(Sn)},[Sn]);let Te=O||(Sn?"is-dirty":"is-saved"),Hn=(0,U.useCallback)(async()=>{if(!w){$("Only the owner can save a workflow","err");return}let T=V.current,{workflow:E,layout:q}=Os({meta:T.meta,nodes:T.nodes,edges:T.edges});B("is-validating");try{let Z=await Gp(E);if(!Z.ok){B(""),$(Z.issues[0]?.message?`Not saved: ${Z.issues[0].message}`:`${Z.issues.length} problem${Z.issues.length===1?"":"s"} to fix first`,"err");return}let Pe=await Ls(E,{create:T.isNew});if(!Pe.ok&&Pe.kind==="yaml-authored"){let xo=Pe.path||"(unknown path)";if(!confirm(`This workflow is YAML-authored on disk:
1617
1617
 
1618
- ${Ce}
1618
+ ${xo}
1619
1619
 
1620
1620
  Saving from the editor will overwrite the YAML as JSON and discard any comments in the YAML file.
1621
1621
 
1622
- Continue and convert to JSON?`)){V(""),$("Not saved: the YAML file is kept as it is","err");return}Pe=await Fs(E,{create:T.isNew,convertFromYaml:!0})}if(V(""),!Pe.ok){$(Pe.issues?.[0]?.message??"Save failed","err");return}try{await Vp(E.id,q)}catch{}let be={...T,isNew:!1};we(Ki(be)),$("Saved","ok"),T.isNew&&(i(be),e.onSaved?.(E.id))},[w,i]),Bn=(0,U.useCallback)(T=>n({type:"delete",selection:T}),[n]),N=(0,U.useCallback)(T=>n({type:"duplicate",selection:T}),[n]),D=(0,U.useCallback)((T,E,q)=>{n({type:"addNode",item:T,x:Math.round(E),y:Math.round(q)}),x("edit")},[n]),I=(0,U.useCallback)(T=>n({type:"connect",conn:T}),[n]),Q=(0,U.useCallback)((T,E,q)=>{a(),n({type:"moveNode",id:T,x:E,y:q})},[n,a]),ee=(0,U.useCallback)(T=>{n({type:"select",selection:T,commit:!0}),T&&x("edit")},[n]),se=T=>{let E=document.querySelector("#wfe-root .cv")?.getBoundingClientRect(),q=((E?.width??800)/2-C.tx)/C.zoom,oe=((E?.height??500)/2-C.ty)/C.zoom;D(T,q-110,oe-40),window.matchMedia(Yi).matches&&z(!1)},ae=()=>{n({type:"layout"}),H()},yt=()=>document.querySelector("#wfe-root .cv")?.dispatchEvent(new Event("wfe:fit")),rt=T=>{v&&(v.kind==="node"&&n({type:"patchNode",id:v.id,patch:T}),v.kind==="edge"&&n({type:"patchEdge",id:v.id,patch:T}))},Gn=T=>{!v||v.kind!=="node"||n({type:"patchNodeData",id:v.id,patch:T})},Dt=async T=>{if(!confirm(`Replace the current workflow with the "${T.title}" template?`))return;let E=await gv(T.id,d.id),q=vo(E.nodes,E.edges);n({type:"setAll",state:{...Xp({...E,nodes:E.nodes.map(oe=>({...oe,position:oe.position??q[oe.id]}))},b),isNew:b}}),H(),$(`Loaded ${T.title}`,"ok")},[Pt,Qi]=(0,U.useState)(!1),[Zt,Xi]=(0,U.useState)(-1),_r=(0,U.useMemo)(()=>fv(t),[t]),Wt=(0,U.useRef)(null),Ji=()=>{Wt.current&&window.clearInterval(Wt.current),Qi(!1),V("")},zs=()=>{Qi(!0),Xi(0),V("is-running"),Wt.current&&window.clearInterval(Wt.current),Wt.current=window.setInterval(()=>{Xi(T=>T>=_r.length-1?(Wt.current&&window.clearInterval(Wt.current),Qi(!1),V(""),T):T+1)},900)};(0,U.useEffect)(()=>()=>{Wt.current&&window.clearInterval(Wt.current),B.current&&window.clearTimeout(B.current)},[]);let Ds=(0,U.useMemo)(()=>{if(!Pt&&Zt<0)return null;let T=new Set,E=new Set,q=null,oe=null;for(let be=0;be<=Zt;be++){let Ce=_r[be];Ce&&(Ce.nodeId&&(be===Zt?q=Ce.nodeId:T.add(Ce.nodeId)),Ce.edgeId&&(be===Zt?oe=Ce.edgeId:E.add(Ce.edgeId)))}let Pe={};for(let be=0;be<=Zt;be++){let Ce=_r[be];!Ce||!Ce.nodeId||!Ce.body||(Pe[Ce.nodeId]=Ce.body)}return{visitedNodes:T,visitedEdges:E,currentNodeId:q,currentEdgeId:oe,outputs:Pe}},[Pt,Zt,_r]),tf=(0,U.useMemo)(()=>pv(t),[t]),nf=v?.kind==="node"?tf[v.id]:void 0;(0,U.useEffect)(()=>{let T=E=>{let q=document.activeElement,oe=!!q&&(/^(INPUT|TEXTAREA|SELECT)$/.test(q.tagName)||q.isContentEditable),Pe=E.metaKey||E.ctrlKey;if(E.key==="?"&&!oe){vt(!0);return}if(E.key==="Escape"){tt?vt(!1):f&&window.matchMedia(Yi).matches&&z(!1);return}if(Pe&&E.key.toLowerCase()==="z"&&!E.shiftKey)oe||(E.preventDefault(),r());else if(Pe&&(E.key.toLowerCase()==="y"||E.shiftKey&&E.key.toLowerCase()==="z"))oe||(E.preventDefault(),o());else if(Pe&&E.key.toLowerCase()==="s")E.preventDefault(),Hn();else if(Pe&&E.key==="Enter")E.preventDefault(),Pt?Ji():zs();else if(Pe&&E.key.toLowerCase()==="d"&&!oe&&v)E.preventDefault(),N(v);else{if(Pe||E.altKey||oe)return;if((E.key==="Delete"||E.key==="Backspace")&&v)E.preventDefault(),Bn(v);else if(E.key==="/")E.preventDefault(),z(!0),x("add"),window.setTimeout(()=>document.querySelector("#wfe-root .pal__search input")?.focus(),0);else if(E.key==="[")E.preventDefault(),z(!f);else if(E.key==="f"||E.key==="F")E.preventDefault(),yt();else if(E.key==="l"||E.key==="L")E.preventDefault(),ae();else if(E.key.startsWith("Arrow")&&v?.kind==="node"){let be=G.current.nodes.find(of=>of.id===v.id);if(!be)return;E.preventDefault();let Ce=E.shiftKey?50:10,qi=be.position??{x:0,y:0},Ws={ArrowLeft:[-Ce,0],ArrowRight:[Ce,0],ArrowUp:[0,-Ce],ArrowDown:[0,Ce]}[E.key]??[0,0];n({type:"patchNode",id:be.id,patch:{position:{x:qi.x+Ws[0],y:qi.y+Ws[1]}}})}}};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[v,Pt,r,o,Hn,Bn,N,f,tt,z]),(0,U.useEffect)(()=>{let T=E=>{Sn&&(E.preventDefault(),E.returnValue="")};return window.addEventListener("beforeunload",T),()=>window.removeEventListener("beforeunload",T)},[Sn]);let rf=async()=>{if(b||!confirm(`Delete workflow "${d.id}"? This cannot be undone.`))return;await Kp(d.id)?(we(Ki(G.current)),$("Deleted","ok"),window.setTimeout(()=>e.onBack(!0),500)):$(w?"Delete failed":"Only the owner can delete a workflow","err")};return(0,Ee.jsxs)("div",{className:"app","data-menu":f?"open":"closed",children:[(0,Ee.jsx)(jp,{title:d.title,setTitle:T=>n({type:"setTitle",title:T}),status:Te,canUndo:s,canRedo:c,onUndo:r,onRedo:o,onSave:()=>void Hn(),onRun:()=>Pt?Ji():zs(),running:Pt,onHelp:()=>vt(!0),onLayout:ae,onFit:yt,onBack:()=>e.onBack(),menuOpen:f,setMenuOpen:z,canSave:w}),(0,Ee.jsxs)("aside",{id:"wfe-menu",className:"menu","aria-label":"Side menu",hidden:!f,children:[(0,Ee.jsxs)("div",{className:"menu__tabs",role:"tablist","aria-label":"Side menu",children:[w&&(0,Ee.jsx)("button",{type:"button",role:"tab","aria-selected":m==="add",className:m==="add"?"is-on":"",onClick:()=>x("add"),children:"Add a step"}),(0,Ee.jsx)("button",{type:"button",role:"tab","aria-selected":m==="edit"||!w,className:m==="edit"||!w?"is-on":"",onClick:()=>x("edit"),children:v?.kind==="node"?"This step":v?.kind==="edge"?"This connection":"Workflow"}),(0,Ee.jsx)("button",{type:"button",className:"btn btn--ghost-icon menu__close","aria-label":"Hide the side menu",title:"Hide the side menu ([)",onClick:()=>z(!1),children:(0,Ee.jsx)(K.x,{})})]}),!w&&(0,Ee.jsx)("p",{className:"menu__note",children:"Only the owner can change and save this workflow. You can look around."}),(0,Ee.jsx)("div",{className:"menu__body",children:m==="add"&&w?(0,Ee.jsx)(Wp,{onLoadTemplate:Dt,onAdd:se}):(0,Ee.jsx)(Dp,{selection:v,nodes:p,edges:g,patch:rt,patchData:Gn,onDelete:Bn,onDuplicate:N,validation:nf,runState:Ds,agents:J,meta:d,patchMeta:T=>n({type:"patchMeta",patch:T}),onDeleteWorkflow:w?rf:void 0,isNew:b})})]}),(0,Ee.jsx)(Rp,{nodes:p,edges:g,selection:v,setSelection:ee,onNodeMove:Q,onNodeMoved:u,onAddNode:D,onConnect:I,onDelete:Bn,runState:Ds,viewBox:C,setViewBox:F,fitSignal:L,editable:w}),(0,Ee.jsx)(Up,{running:Pt||Zt>=0,script:_r,cursor:Zt,onStop:()=>{Ji(),Xi(-1)}}),(0,Ee.jsx)($p,{open:tt,onClose:()=>vt(!1)}),w&&(0,Ee.jsx)(Qp,{currentWorkflow:Rs({meta:d,nodes:p,edges:g}).workflow,onApplyWorkflow:T=>{let E=yo(T),q=vo(E.nodes,E.edges);n({type:"setAll",state:{meta:E.meta,nodes:E.nodes.map(oe=>({...oe,position:oe.position??q[oe.id]})),edges:E.edges,selection:null,isNew:b}}),H(),$("Applied the workflow from the chat","ok")}}),zt&&(0,Ee.jsxs)("div",{className:"toast"+(zt.kind==="err"?" err":""),role:zt.kind==="err"?"alert":"status",children:[(0,Ee.jsx)("span",{className:"dot"}),zt.msg]})]})}function Xp(e,t){return{meta:e.meta,nodes:e.nodes,edges:e.edges,selection:null,isNew:t}}async function gv(e,t){return e==="tpl.blank"?wo(t||"new-workflow"):e==="tpl.whatsapp"?yo(mv(t)):e==="tpl.mr"?yo(vv(t)):wo(t||"new-workflow")}function mv(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}})
1622
+ Continue and convert to JSON?`)){B(""),$("Not saved: the YAML file is kept as it is","err");return}Pe=await Ls(E,{create:T.isNew,convertFromYaml:!0})}if(B(""),!Pe.ok){$(Pe.issues?.[0]?.message??"Save failed","err");return}let be=await Vp(E.id,q).catch(()=>!1),_e={...T,isNew:!1};we(Yi(_e)),$(be?"Saved":"Saved, but the step positions were not",be?"ok":"err"),T.isNew&&(i(_e),e.onSaved?.(E.id))}catch(Z){B(""),$(`Not saved: ${Z?.message??Z}`,"err")}},[w,i]),Bn=(0,U.useCallback)(T=>n({type:"delete",selection:T}),[n]),N=(0,U.useCallback)(T=>n({type:"duplicate",selection:T}),[n]),D=(0,U.useCallback)((T,E,q)=>{n({type:"addNode",item:T,x:Math.round(E),y:Math.round(q)}),x("edit")},[n]),I=(0,U.useCallback)(T=>n({type:"connect",conn:T}),[n]),Q=(0,U.useCallback)((T,E,q)=>{a(),n({type:"moveNode",id:T,x:E,y:q})},[n,a]),te=(0,U.useCallback)(T=>{n({type:"select",selection:T,commit:!0}),T&&x("edit")},[n]),se=T=>{let E=document.querySelector("#wfe-root .cv")?.getBoundingClientRect(),q=((E?.width??800)/2-C.tx)/C.zoom,Z=((E?.height??500)/2-C.ty)/C.zoom;D(T,q-110,Z-40),window.matchMedia(Qi).matches&&z(!1)},ae=()=>{n({type:"layout"}),H()},yt=()=>document.querySelector("#wfe-root .cv")?.dispatchEvent(new Event("wfe:fit")),rt=T=>{v&&(v.kind==="node"&&n({type:"patchNode",id:v.id,patch:T}),v.kind==="edge"&&n({type:"patchEdge",id:v.id,patch:T}))},Gn=T=>{!v||v.kind!=="node"||n({type:"patchNodeData",id:v.id,patch:T})},Dt=async T=>{if(!confirm(`Replace the current workflow with the "${T.title}" template?`))return;let E=await gv(T.id,d.id),q=vo(E.nodes,E.edges);n({type:"setAll",state:{...Xp({...E,nodes:E.nodes.map(Z=>({...Z,position:Z.position??q[Z.id]}))},b),isNew:b}}),H(),$(`Loaded ${T.title}`,"ok")},[Pt,Xi]=(0,U.useState)(!1),[Zt,Ji]=(0,U.useState)(-1),_r=(0,U.useMemo)(()=>fv(t),[t]),Wt=(0,U.useRef)(null),qi=()=>{Wt.current&&window.clearInterval(Wt.current),Xi(!1),B("")},Ds=()=>{Xi(!0),Ji(0),B("is-running"),Wt.current&&window.clearInterval(Wt.current),Wt.current=window.setInterval(()=>{Ji(T=>T>=_r.length-1?(Wt.current&&window.clearInterval(Wt.current),Xi(!1),B(""),T):T+1)},900)};(0,U.useEffect)(()=>()=>{Wt.current&&window.clearInterval(Wt.current),G.current&&window.clearTimeout(G.current)},[]);let Ws=(0,U.useMemo)(()=>{if(!Pt&&Zt<0)return null;let T=new Set,E=new Set,q=null,Z=null;for(let be=0;be<=Zt;be++){let _e=_r[be];_e&&(_e.nodeId&&(be===Zt?q=_e.nodeId:T.add(_e.nodeId)),_e.edgeId&&(be===Zt?Z=_e.edgeId:E.add(_e.edgeId)))}let Pe={};for(let be=0;be<=Zt;be++){let _e=_r[be];!_e||!_e.nodeId||!_e.body||(Pe[_e.nodeId]=_e.body)}return{visitedNodes:T,visitedEdges:E,currentNodeId:q,currentEdgeId:Z,outputs:Pe}},[Pt,Zt,_r]),tf=(0,U.useMemo)(()=>pv(t),[t]),nf=v?.kind==="node"?tf[v.id]:void 0;(0,U.useEffect)(()=>{let T=E=>{let q=document.activeElement,Z=!!q&&(/^(INPUT|TEXTAREA|SELECT)$/.test(q.tagName)||q.isContentEditable),Pe=E.metaKey||E.ctrlKey;if(E.key==="?"&&!Z){vt(!0);return}if(E.key==="Escape"){tt?vt(!1):f&&window.matchMedia(Qi).matches&&z(!1);return}if(Pe&&E.key.toLowerCase()==="z"&&!E.shiftKey)Z||(E.preventDefault(),r());else if(Pe&&(E.key.toLowerCase()==="y"||E.shiftKey&&E.key.toLowerCase()==="z"))Z||(E.preventDefault(),o());else if(Pe&&E.key.toLowerCase()==="s")E.preventDefault(),Hn();else if(Pe&&E.key==="Enter")E.preventDefault(),Pt?qi():Ds();else if(Pe&&E.key.toLowerCase()==="d"&&!Z&&v)E.preventDefault(),N(v);else{if(Pe||E.altKey||Z)return;if((E.key==="Delete"||E.key==="Backspace")&&v)E.preventDefault(),Bn(v);else if(E.key==="/")E.preventDefault(),z(!0),x("add"),window.setTimeout(()=>document.querySelector("#wfe-root .pal__search input")?.focus(),0);else if(E.key==="[")E.preventDefault(),z(!f);else if(E.key==="f"||E.key==="F")E.preventDefault(),yt();else if(E.key==="l"||E.key==="L")E.preventDefault(),ae();else if(E.key.startsWith("Arrow")&&v?.kind==="node"){let be=V.current.nodes.find(of=>of.id===v.id);if(!be)return;E.preventDefault();let _e=E.shiftKey?50:10,xo=be.position??{x:0,y:0},Zi={ArrowLeft:[-_e,0],ArrowRight:[_e,0],ArrowUp:[0,-_e],ArrowDown:[0,_e]}[E.key]??[0,0];n({type:"patchNode",id:be.id,patch:{position:{x:xo.x+Zi[0],y:xo.y+Zi[1]}}})}}};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[v,Pt,r,o,Hn,Bn,N,f,tt,z]),(0,U.useEffect)(()=>{let T=E=>{Sn&&(E.preventDefault(),E.returnValue="")};return window.addEventListener("beforeunload",T),()=>window.removeEventListener("beforeunload",T)},[Sn]);let rf=async()=>{if(b||!confirm(`Delete workflow "${d.id}"? This cannot be undone.`))return;await Kp(d.id)?(we(Yi(V.current)),$("Deleted","ok"),window.setTimeout(()=>e.onBack(!0),500)):$(w?"Delete failed":"Only the owner can delete a workflow","err")};return(0,Ee.jsxs)("div",{className:"app","data-menu":f?"open":"closed",children:[(0,Ee.jsx)(jp,{title:d.title,setTitle:T=>n({type:"setTitle",title:T}),status:Te,canUndo:s,canRedo:c,onUndo:r,onRedo:o,onSave:()=>void Hn(),onRun:()=>Pt?qi():Ds(),running:Pt,onHelp:()=>vt(!0),onLayout:ae,onFit:yt,onBack:()=>e.onBack(),menuOpen:f,setMenuOpen:z,canSave:w}),(0,Ee.jsxs)("aside",{id:"wfe-menu",className:"menu","aria-label":"Side menu",hidden:!f,children:[(0,Ee.jsxs)("div",{className:"menu__tabs",role:"tablist","aria-label":"Side menu",children:[w&&(0,Ee.jsx)("button",{type:"button",role:"tab","aria-selected":m==="add",className:m==="add"?"is-on":"",onClick:()=>x("add"),children:"Add a step"}),(0,Ee.jsx)("button",{type:"button",role:"tab","aria-selected":m==="edit"||!w,className:m==="edit"||!w?"is-on":"",onClick:()=>x("edit"),children:v?.kind==="node"?"This step":v?.kind==="edge"?"This connection":"Workflow"}),(0,Ee.jsx)("button",{type:"button",className:"btn btn--ghost-icon menu__close","aria-label":"Hide the side menu",title:"Hide the side menu ([)",onClick:()=>z(!1),children:(0,Ee.jsx)(K.x,{})})]}),!w&&(0,Ee.jsx)("p",{className:"menu__note",children:"Only the owner can change and save this workflow. You can look around."}),(0,Ee.jsx)("div",{className:"menu__body",children:m==="add"&&w?(0,Ee.jsx)(Wp,{onLoadTemplate:Dt,onAdd:se}):(0,Ee.jsx)(Dp,{selection:v,nodes:p,edges:g,patch:rt,patchData:Gn,onDelete:Bn,onDuplicate:N,validation:nf,runState:Ws,agents:J,meta:d,patchMeta:T=>n({type:"patchMeta",patch:T}),onDeleteWorkflow:w?rf:void 0,isNew:b})})]}),(0,Ee.jsx)(Rp,{nodes:p,edges:g,selection:v,setSelection:te,onNodeMove:Q,onNodeMoved:u,onAddNode:D,onConnect:I,onDelete:Bn,runState:Ws,viewBox:C,setViewBox:F,fitSignal:L,editable:w}),(0,Ee.jsx)(Up,{running:Pt||Zt>=0,script:_r,cursor:Zt,onStop:()=>{qi(),Ji(-1)}}),(0,Ee.jsx)($p,{open:tt,onClose:()=>vt(!1)}),w&&(0,Ee.jsx)(Qp,{currentWorkflow:Os({meta:d,nodes:p,edges:g}).workflow,onApplyWorkflow:T=>{let E=yo(T),q=vo(E.nodes,E.edges);n({type:"setAll",state:{meta:E.meta,nodes:E.nodes.map(Z=>({...Z,position:Z.position??q[Z.id]})),edges:E.edges,selection:null,isNew:b}}),H(),$("Applied the workflow from the chat","ok")}}),zt&&(0,Ee.jsxs)("div",{className:"toast"+(zt.kind==="err"?" err":""),role:zt.kind==="err"?"alert":"status",children:[(0,Ee.jsx)("span",{className:"dot"}),zt.msg]})]})}function Xp(e,t){return{meta:e.meta,nodes:e.nodes,edges:e.edges,selection:null,isNew:t}}async function gv(e,t){return e==="tpl.blank"?wo(t||"new-workflow"):e==="tpl.whatsapp"?yo(mv(t)):e==="tpl.mr"?yo(vv(t)):wo(t||"new-workflow")}function mv(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}})
1623
1623
 
1624
- {{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 vv(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 ef=ge(De(),1);function yv(e,t){if(document.getElementById(e))return;let n=document.createElement("style");n.id=e,n.textContent=t,document.head.appendChild(n)}function wv(e,t){yv("wfe-redesign-css",Us),e.id="wfe-root";let n=(0,Zp.createRoot)(e);return n.render((0,ef.jsx)(qp,{...t})),{unmount:()=>n.unmount()}}window.AXWorkflowEditor={mount:wv};document.dispatchEvent(new Event("ax:workflow-editor-ready"));})();
1624
+ {{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 vv(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 ef=ge(De(),1);function yv(e,t){if(document.getElementById(e))return;let n=document.createElement("style");n.id=e,n.textContent=t,document.head.appendChild(n)}function wv(e,t){yv("wfe-redesign-css",Us);let n=document.createElement("div");n.id="wfe-root",e.appendChild(n);let r=(0,Zp.createRoot)(n);return r.render((0,ef.jsx)(qp,{...t})),{unmount:()=>{r.unmount(),n.remove()}}}window.AXWorkflowEditor={mount:wv};document.dispatchEvent(new Event("ax:workflow-editor-ready"));})();
1625
1625
  /*! Bundled license information:
1626
1626
 
1627
1627
  react/cjs/react.production.min.js: