@1agents/dsh-a2a 0.0.0-stage → 0.1.1

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 (144) hide show
  1. package/README.md +57 -2
  2. package/cordis.patch.yml +10 -0
  3. package/dist/approvals.js +50 -0
  4. package/dist/cli.js +32596 -0
  5. package/dist/executor.js +24896 -0
  6. package/dist/index.js +32595 -0
  7. package/dist/sdk-runtime.js +166 -0
  8. package/dist/server.js +32581 -0
  9. package/dist/shared/a2a/workbench-ui.js +186 -0
  10. package/dist/workbench-ui/app.css +453 -0
  11. package/dist/workbench-ui/app.js +13 -0
  12. package/dist/workbench-ui/chunk-23JHGYT3.js +1 -0
  13. package/dist/workbench-ui/chunk-3H6STGPV.js +1 -0
  14. package/dist/workbench-ui/chunk-3SNBBMGH.js +1 -0
  15. package/dist/workbench-ui/chunk-3XJZ6DIE.js +1 -0
  16. package/dist/workbench-ui/chunk-44KDLLKJ.js +1 -0
  17. package/dist/workbench-ui/chunk-46H7FU5Y.js +7 -0
  18. package/dist/workbench-ui/chunk-4N44QPL7.js +1 -0
  19. package/dist/workbench-ui/chunk-4YN4BS7I.js +1 -0
  20. package/dist/workbench-ui/chunk-53EG4IVQ.js +96 -0
  21. package/dist/workbench-ui/chunk-5FIPUNR4.js +1 -0
  22. package/dist/workbench-ui/chunk-6DWWYA6G.js +2 -0
  23. package/dist/workbench-ui/chunk-6FU3T633.js +99 -0
  24. package/dist/workbench-ui/chunk-6XKIHRA4.js +1 -0
  25. package/dist/workbench-ui/chunk-7GIX43Y5.js +1 -0
  26. package/dist/workbench-ui/chunk-7Q4WBGX6.js +4 -0
  27. package/dist/workbench-ui/chunk-A3BQM7HR.js +1 -0
  28. package/dist/workbench-ui/chunk-AFCFDDOP.js +24 -0
  29. package/dist/workbench-ui/chunk-AG67EUYD.js +89 -0
  30. package/dist/workbench-ui/chunk-AGJHMMTN.js +1 -0
  31. package/dist/workbench-ui/chunk-AO6JUBV6.js +41 -0
  32. package/dist/workbench-ui/chunk-AUSLTP43.js +72 -0
  33. package/dist/workbench-ui/chunk-AVZL46TT.js +1 -0
  34. package/dist/workbench-ui/chunk-AZRIGIV2.js +168 -0
  35. package/dist/workbench-ui/chunk-B2LIVH37.js +1 -0
  36. package/dist/workbench-ui/chunk-B7YX5TR5.js +1 -0
  37. package/dist/workbench-ui/chunk-BCB4X4XX.js +1 -0
  38. package/dist/workbench-ui/chunk-BCRQUL2A.js +88 -0
  39. package/dist/workbench-ui/chunk-BI6UHHQP.js +1 -0
  40. package/dist/workbench-ui/chunk-BLSLQ4AQ.js +120 -0
  41. package/dist/workbench-ui/chunk-C3QSRS6E.js +1 -0
  42. package/dist/workbench-ui/chunk-CK7M2PJ3.js +62 -0
  43. package/dist/workbench-ui/chunk-CM6LZ7TU.js +1 -0
  44. package/dist/workbench-ui/chunk-CP63H27F.js +36 -0
  45. package/dist/workbench-ui/chunk-CPUMMIS2.js +70 -0
  46. package/dist/workbench-ui/chunk-CSEIBI5U.js +2 -0
  47. package/dist/workbench-ui/chunk-CUS65DKZ.js +161 -0
  48. package/dist/workbench-ui/chunk-CVQY7TNC.js +1 -0
  49. package/dist/workbench-ui/chunk-D6S3XBIX.js +106 -0
  50. package/dist/workbench-ui/chunk-E253Y562.js +1 -0
  51. package/dist/workbench-ui/chunk-EADDJUDC.js +1 -0
  52. package/dist/workbench-ui/chunk-EBGJ3YXG.js +206 -0
  53. package/dist/workbench-ui/chunk-EKPVZ3WY.js +8 -0
  54. package/dist/workbench-ui/chunk-EQDCEAFY.js +1 -0
  55. package/dist/workbench-ui/chunk-ES3SSDJY.js +40 -0
  56. package/dist/workbench-ui/chunk-ESFD2H7N.js +231 -0
  57. package/dist/workbench-ui/chunk-FVOHPMS6.js +1 -0
  58. package/dist/workbench-ui/chunk-FXMQAGVT.js +1 -0
  59. package/dist/workbench-ui/chunk-GGTADRXD.js +24 -0
  60. package/dist/workbench-ui/chunk-GHIVPGNQ.js +1 -0
  61. package/dist/workbench-ui/chunk-GLU2YQV2.js +1 -0
  62. package/dist/workbench-ui/chunk-GOCKBYSM.js +1 -0
  63. package/dist/workbench-ui/chunk-H2KMMTJB.js +1 -0
  64. package/dist/workbench-ui/chunk-HGVLDNPP.js +39 -0
  65. package/dist/workbench-ui/chunk-HSAVC5GY.js +1 -0
  66. package/dist/workbench-ui/chunk-HSEAD2JH.js +1 -0
  67. package/dist/workbench-ui/chunk-HSIHOBTY.js +1 -0
  68. package/dist/workbench-ui/chunk-IZXOKUGG.js +67 -0
  69. package/dist/workbench-ui/chunk-JFT2LC2T.js +1 -0
  70. package/dist/workbench-ui/chunk-JHL3ZDYK.js +3 -0
  71. package/dist/workbench-ui/chunk-JMORLCZG.js +257 -0
  72. package/dist/workbench-ui/chunk-JR4SIX7A.js +1 -0
  73. package/dist/workbench-ui/chunk-K23HAGEH.js +30 -0
  74. package/dist/workbench-ui/chunk-K43JDCBH.js +1 -0
  75. package/dist/workbench-ui/chunk-KINKFJY7.js +1 -0
  76. package/dist/workbench-ui/chunk-KKQSA4LI.js +2 -0
  77. package/dist/workbench-ui/chunk-KOUZX3UX.js +1 -0
  78. package/dist/workbench-ui/chunk-KR4DRHW2.js +78 -0
  79. package/dist/workbench-ui/chunk-KT4DJNOR.js +1 -0
  80. package/dist/workbench-ui/chunk-KTPNKRRZ.js +292 -0
  81. package/dist/workbench-ui/chunk-LFHIPGSU.js +7 -0
  82. package/dist/workbench-ui/chunk-LWDL4HZB.js +125 -0
  83. package/dist/workbench-ui/chunk-MVYC3CY4.js +1 -0
  84. package/dist/workbench-ui/chunk-NWUPALCY.js +129 -0
  85. package/dist/workbench-ui/chunk-NY7C662Z.js +1 -0
  86. package/dist/workbench-ui/chunk-O76WTHWP.js +1 -0
  87. package/dist/workbench-ui/chunk-OTF7YHRE.js +162 -0
  88. package/dist/workbench-ui/chunk-P6TKKRKP.js +1 -0
  89. package/dist/workbench-ui/chunk-PFHOOWV3.js +1 -0
  90. package/dist/workbench-ui/chunk-PUQLANIM.js +1 -0
  91. package/dist/workbench-ui/chunk-PZCGBYVO.js +1 -0
  92. package/dist/workbench-ui/chunk-QOHUZGP4.js +1 -0
  93. package/dist/workbench-ui/chunk-QSEG3OFF.js +1 -0
  94. package/dist/workbench-ui/chunk-QYPOXZIA.js +84 -0
  95. package/dist/workbench-ui/chunk-R6SOF3JC.js +1 -0
  96. package/dist/workbench-ui/chunk-RCLOYU5F.js +1 -0
  97. package/dist/workbench-ui/chunk-RSRUP64S.js +1 -0
  98. package/dist/workbench-ui/chunk-RVAIT6JW.js +1 -0
  99. package/dist/workbench-ui/chunk-S2CCN3II.js +1 -0
  100. package/dist/workbench-ui/chunk-S2Q52W46.js +1 -0
  101. package/dist/workbench-ui/chunk-S2W5THJ5.js +1 -0
  102. package/dist/workbench-ui/chunk-S6ZQZNOX.js +1 -0
  103. package/dist/workbench-ui/chunk-S74PLMMS.js +1 -0
  104. package/dist/workbench-ui/chunk-S7C4HKEY.js +1 -0
  105. package/dist/workbench-ui/chunk-SDTB3Q65.js +1 -0
  106. package/dist/workbench-ui/chunk-SLPRGYUV.js +32 -0
  107. package/dist/workbench-ui/chunk-SQE76S5B.js +1 -0
  108. package/dist/workbench-ui/chunk-SSDZPVPW.js +1 -0
  109. package/dist/workbench-ui/chunk-SVI7DGIE.js +1 -0
  110. package/dist/workbench-ui/chunk-T6QKLZ4H.js +62 -0
  111. package/dist/workbench-ui/chunk-TJNRPTFL.js +1 -0
  112. package/dist/workbench-ui/chunk-TP6U4EDH.js +2 -0
  113. package/dist/workbench-ui/chunk-TYAAT3GQ.js +1 -0
  114. package/dist/workbench-ui/chunk-U6OCY4ZH.js +1 -0
  115. package/dist/workbench-ui/chunk-UAN3NLRF.js +1 -0
  116. package/dist/workbench-ui/chunk-UMLU3FIX.js +1 -0
  117. package/dist/workbench-ui/chunk-URIY2OTM.js +1 -0
  118. package/dist/workbench-ui/chunk-V2NUKAA7.js +38 -0
  119. package/dist/workbench-ui/chunk-V4QLL4TE.js +139 -0
  120. package/dist/workbench-ui/chunk-VASHXUK4.js +2 -0
  121. package/dist/workbench-ui/chunk-VJLIWNIU.js +1 -0
  122. package/dist/workbench-ui/chunk-VQNQFBID.js +1 -0
  123. package/dist/workbench-ui/chunk-VSIWU7XA.js +3 -0
  124. package/dist/workbench-ui/chunk-VSJASPUZ.js +321 -0
  125. package/dist/workbench-ui/chunk-VXPNUNUX.js +3 -0
  126. package/dist/workbench-ui/chunk-WBKLDCV6.js +1 -0
  127. package/dist/workbench-ui/chunk-WOKJM3FY.js +1 -0
  128. package/dist/workbench-ui/chunk-X3U3NA3X.js +34 -0
  129. package/dist/workbench-ui/chunk-XBYU7M4J.js +1 -0
  130. package/dist/workbench-ui/chunk-XBZAO4ID.js +10 -0
  131. package/dist/workbench-ui/chunk-XLLPZ2WO.js +1 -0
  132. package/dist/workbench-ui/chunk-YFVL4NJL.js +1 -0
  133. package/dist/workbench-ui/chunk-YRFQENM4.js +1 -0
  134. package/dist/workbench-ui/chunk-YUADQVB2.js +1 -0
  135. package/dist/workbench-ui/chunk-Z3TCAKM5.js +1 -0
  136. package/dist/workbench-ui/chunk-Z6QR6FRE.js +10 -0
  137. package/dist/workbench-ui/chunk-ZJPSORPP.js +3 -0
  138. package/dist/workbench-ui/chunk-ZLGCSTR2.js +15 -0
  139. package/dist/workbench-ui/chunk-ZLR4SG5X.js +1 -0
  140. package/dist/workbench-ui/chunk-ZND3TTGF.js +1 -0
  141. package/dist/workbench-ui/chunk-ZOP3ZYH7.js +2 -0
  142. package/dist/workbench-ui/index.html +14 -0
  143. package/dist/workbench.js +222 -0
  144. package/package.json +33 -4
@@ -0,0 +1,13 @@
1
+ import"./chunk-SQE76S5B.js";var Ge,S,Vt,zn,ie,Wt,Jt,Kt,pt,qe,Ee,Qt,ht,ft,mt,Vn,Je={},Ke=[],Jn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Xe=Array.isArray;function te(e,n){for(var r in n)e[r]=n[r];return e}function vt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Kn(e,n,r){var o,a,s,c={};for(s in n)s=="key"?o=n[s]:s=="ref"?a=n[s]:c[s]=n[s];if(arguments.length>2&&(c.children=arguments.length>3?Ge.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)c[s]===void 0&&(c[s]=e.defaultProps[s]);return ze(e,c,o,a,null)}function ze(e,n,r,o,a){var s={type:e,props:n,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Vt,__i:-1,__u:0};return a==null&&S.vnode!=null&&S.vnode(s),s}function C(e){return e.children}function Ve(e,n){this.props=e,this.context=n}function Ie(e,n){if(n==null)return e.__?Ie(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Ie(e):null}function Qn(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,o=[],a=[],s=te({},n);s.__v=n.__v+1,S.vnode&&S.vnode(s),_t(e.__P,s,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,o,r??Ie(n),!!(32&n.__u),a),s.__v=n.__v,s.__.__k[s.__i]=s,Yt(o,s,a),n.__e=n.__=null,s.__e!=r&&Gt(s)}}function Gt(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),Gt(e)}function Bt(e){(!e.__d&&(e.__d=!0)&&ie.push(e)&&!Qe.__r++||Wt!=S.debounceRendering)&&((Wt=S.debounceRendering)||Jt)(Qe)}function Qe(){try{for(var e,n=1;ie.length;)ie.length>n&&ie.sort(Kt),e=ie.shift(),n=ie.length,Qn(e)}finally{ie.length=Qe.__r=0}}function Xt(e,n,r,o,a,s,c,l,d,u,f){var p,_,b,x,m,I,w,y=o&&o.__k||Ke,P=n.length;for(d=Gn(r,n,y,d,P),p=0;p<P;p++)(b=r.__k[p])!=null&&(_=b.__i!=-1&&y[b.__i]||Je,b.__i=p,I=_t(e,b,_,a,s,c,l,d,u,f),x=b.__e,b.ref&&_.ref!=b.ref&&(_.ref&&bt(_.ref,null,b),f.push(b.ref,b.__c||x,b)),m==null&&x!=null&&(m=x),(w=!!(4&b.__u))||_.__k===b.__k?(d=Zt(b,d,e,w),w&&_.__e&&(_.__e=null)):typeof b.type=="function"&&I!==void 0?d=I:x&&(d=x.nextSibling),b.__u&=-7);return r.__e=m,d}function Gn(e,n,r,o,a){var s,c,l,d,u,f=r.length,p=f,_=0;for(e.__k=new Array(a),s=0;s<a;s++)(c=n[s])!=null&&typeof c!="boolean"&&typeof c!="function"?(typeof c=="string"||typeof c=="number"||typeof c=="bigint"||c.constructor==String?c=e.__k[s]=ze(null,c,null,null,null):Xe(c)?c=e.__k[s]=ze(C,{children:c},null,null,null):c.constructor===void 0&&c.__b>0?c=e.__k[s]=ze(c.type,c.props,c.key,c.ref?c.ref:null,c.__v):e.__k[s]=c,d=s+_,c.__=e,c.__b=e.__b+1,l=null,(u=c.__i=Xn(c,r,d,p))!=-1&&(p--,(l=r[u])&&(l.__u|=2)),l==null||l.__v==null?(u==-1&&(a>f?_--:a<f&&_++),typeof c.type!="function"&&(c.__u|=4)):u!=d&&(u==d-1?_--:u==d+1?_++:(u>d?_--:_++,c.__u|=4))):e.__k[s]=null;if(p)for(s=0;s<f;s++)(l=r[s])!=null&&(2&l.__u)==0&&(l.__e==o&&(o=Ie(l)),tn(l,l));return o}function Zt(e,n,r,o){var a,s;if(typeof e.type=="function"){for(a=e.__k,s=0;a&&s<a.length;s++)a[s]&&(a[s].__=e,n=Zt(a[s],n,r,o));return n}e.__e!=n&&(o&&(n&&e.type&&!n.parentNode&&(n=Ie(e)),r.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function Xn(e,n,r,o){var a,s,c,l=e.key,d=e.type,u=n[r],f=u!=null&&(2&u.__u)==0;if(u===null&&l==null||f&&l==u.key&&d==u.type)return r;if(o>(f?1:0)){for(a=r-1,s=r+1;a>=0||s<n.length;)if((u=n[c=a>=0?a--:s++])!=null&&(2&u.__u)==0&&l==u.key&&d==u.type)return c}return-1}function qt(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||Jn.test(n)?r:r+"px"}function Be(e,n,r,o,a){var s,c;e:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(n in o)r&&n in r||qt(e.style,n,"");if(r)for(n in r)o&&r[n]==o[n]||qt(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")s=n!=(n=n.replace(Qt,"$1")),c=n.toLowerCase(),n=c in e||n=="onFocusOut"||n=="onFocusIn"?c.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+s]=r,r?o?r[Ee]=o[Ee]:(r[Ee]=ht,e.addEventListener(n,s?mt:ft,s)):e.removeEventListener(n,s?mt:ft,s);else{if(a=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function zt(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[qe]==null)n[qe]=ht++;else if(n[qe]<r[Ee])return;return r(S.event?S.event(n):n)}}}function _t(e,n,r,o,a,s,c,l,d,u){var f,p,_,b,x,m,I,w,y,P,j,h,N,U,K,$=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(d=!!(32&r.__u),s=[l=n.__e=r.__e]),(f=S.__b)&&f(n);e:if(typeof $=="function")try{if(w=n.props,y=$.prototype&&$.prototype.render,P=(f=$.contextType)&&o[f.__c],j=f?P?P.props.value:f.__:o,r.__c?I=(p=n.__c=r.__c).__=p.__E:(y?n.__c=p=new $(w,j):(n.__c=p=new Ve(w,j),p.constructor=$,p.render=Yn),P&&P.sub(p),p.state||(p.state={}),p.__n=o,_=p.__d=!0,p.__h=[],p._sb=[]),y&&p.__s==null&&(p.__s=p.state),y&&$.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=te({},p.__s)),te(p.__s,$.getDerivedStateFromProps(w,p.__s))),b=p.props,x=p.state,p.__v=n,_)y&&$.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),y&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(y&&$.getDerivedStateFromProps==null&&w!==b&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(w,j),n.__v==r.__v||!p.__e&&p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(w,p.__s,j)===!1){n.__v!=r.__v&&(p.props=w,p.state=p.__s,p.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(q){q&&(q.__=n)}),Ke.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&c.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(w,p.__s,j),y&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(b,x,m)})}if(p.context=j,p.props=w,p.__P=e,p.__e=!1,h=S.__r,N=0,y)p.state=p.__s,p.__d=!1,h&&h(n),f=p.render(p.props,p.state,p.context),Ke.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,h&&h(n),f=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++N<25);p.state=p.__s,p.getChildContext!=null&&(o=te(te({},o),p.getChildContext())),y&&!_&&p.getSnapshotBeforeUpdate!=null&&(m=p.getSnapshotBeforeUpdate(b,x)),U=f!=null&&f.type===C&&f.key==null?en(f.props.children):f,l=Xt(e,Xe(U)?U:[U],n,r,o,a,s,c,l,d,u),p.base=n.__e,n.__u&=-161,p.__h.length&&c.push(p),I&&(p.__E=p.__=null)}catch(q){if(n.__v=null,d||s!=null)if(q.then){for(n.__u|=d?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;s[s.indexOf(l)]=null,n.__e=l}else{for(K=s.length;K--;)vt(s[K]);gt(n)}else n.__e=r.__e,n.__k=r.__k,q.then||gt(n);S.__e(q,n,r)}else s==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):l=n.__e=Zn(r.__e,n,r,o,a,s,c,d,u);return(f=S.diffed)&&f(n),128&n.__u?void 0:l}function gt(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(gt))}function Yt(e,n,r){for(var o=0;o<r.length;o++)bt(r[o],r[++o],r[++o]);S.__c&&S.__c(n,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(s){s.call(a)})}catch(s){S.__e(s,a.__v)}})}function en(e){return typeof e!="object"||e==null||e.__b>0?e:Xe(e)?e.map(en):e.constructor!==void 0?null:te({},e)}function Zn(e,n,r,o,a,s,c,l,d){var u,f,p,_,b,x,m,I=r.props||Je,w=n.props,y=n.type;if(y=="svg"?a="http://www.w3.org/2000/svg":y=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),s!=null){for(u=0;u<s.length;u++)if((b=s[u])&&"setAttribute"in b==!!y&&(y?b.localName==y:b.nodeType==3)){e=b,s[u]=null;break}}if(e==null){if(y==null)return document.createTextNode(w);e=document.createElementNS(a,y,w.is&&w),l&&(S.__m&&S.__m(n,s),l=!1),s=null}if(y==null)I===w||l&&e.data==w||(e.data=w);else{if(s=y=="textarea"&&w.defaultValue!=null?null:s&&Ge.call(e.childNodes),!l&&s!=null)for(I={},u=0;u<e.attributes.length;u++)I[(b=e.attributes[u]).name]=b.value;for(u in I)b=I[u],u=="dangerouslySetInnerHTML"?p=b:u=="children"||u in w||u=="value"&&"defaultValue"in w||u=="checked"&&"defaultChecked"in w||Be(e,u,null,b,a);for(u in w)b=w[u],u=="children"?_=b:u=="dangerouslySetInnerHTML"?f=b:u=="value"?x=b:u=="checked"?m=b:l&&typeof b!="function"||I[u]===b||Be(e,u,b,I[u],a);if(f)l||p&&(f.__html==p.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),n.__k=[];else if(p&&(e.innerHTML=""),Xt(n.type=="template"?e.content:e,Xe(_)?_:[_],n,r,o,y=="foreignObject"?"http://www.w3.org/1999/xhtml":a,s,c,s?s[0]:r.__k&&Ie(r,0),l,d),s!=null)for(u=s.length;u--;)vt(s[u]);l&&y!="textarea"||(u="value",y=="progress"&&x==null?e.removeAttribute("value"):x!=null&&(x!==e[u]||y=="progress"&&!x||y=="option"&&x!=I[u])&&Be(e,u,x,I[u],a),u="checked",m!=null&&m!=e[u]&&Be(e,u,m,I[u],a))}return e}function bt(e,n,r){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&n==null||(e.__u=e(n))}else e.current=n}catch(a){S.__e(a,r)}}function tn(e,n,r){var o,a;if(S.unmount&&S.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||bt(o,null,n)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(s){S.__e(s,n)}o.base=o.__P=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&tn(o[a],n,r||typeof e.type!="function");r||vt(e.__e),e.__c=e.__=e.__e=void 0}function Yn(e,n,r){return this.constructor(e,r)}function nn(e,n,r){var o,a,s,c;n==document&&(n=document.documentElement),S.__&&S.__(e,n),a=(o=typeof r=="function")?null:r&&r.__k||n.__k,s=[],c=[],_t(n,e=(!o&&r||n).__k=Kn(C,null,[e]),a||Je,Je,n.namespaceURI,!o&&r?[r]:a?null:n.firstChild?Ge.call(n.childNodes):null,s,!o&&r?r:a?a.__e:n.firstChild,o,c),Yt(s,e,c)}Ge=Ke.slice,S={__e:function(e,n,r,o){for(var a,s,c;n=n.__;)if((a=n.__c)&&!a.__)try{if((s=a.constructor)&&s.getDerivedStateFromError!=null&&(a.setState(s.getDerivedStateFromError(e)),c=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,o||{}),c=a.__d),c)return a.__E=a}catch(l){e=l}throw e}},Vt=0,zn=function(e){return e!=null&&e.constructor===void 0},Ve.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=te({},this.state),typeof e=="function"&&(e=e(te({},r),this.props)),e&&te(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),Bt(this))},Ve.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Bt(this))},Ve.prototype.render=C,ie=[],Jt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Kt=function(e,n){return e.__v.__b-n.__v.__b},Qe.__r=0,pt=Math.random().toString(8),qe="__d"+pt,Ee="__a"+pt,Qt=/(PointerCapture)$|Capture$/i,ht=0,ft=zt(!1),mt=zt(!0),Vn=0;var xe,D,yt,rn,je=0,pn=[],L=S,on=L.__b,sn=L.__r,an=L.diffed,cn=L.__c,ln=L.unmount,dn=L.__;function Ye(e,n){L.__h&&L.__h(D,e,je||n),je=0;var r=D.__H||(D.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function g(e){return je=1,er(mn,e)}function er(e,n,r){var o=Ye(xe++,2);if(o.t=e,!o.__c&&(o.__=[r?r(n):mn(void 0,n),function(l){var d=o.__N?o.__N[0]:o.__[0],u=o.t(d,l);d!==u&&(o.__N=[u,o.__[1]],o.__c.setState({}))}],o.__c=D,!D.__f)){var a=function(l,d,u){if(!o.__c.__H)return!0;var f=o.__c.__H.__.filter(function(_){return _.__c});if(f.every(function(_){return!_.__N}))return!s||s.call(this,l,d,u);var p=o.__c.props!==l;return f.some(function(_){if(_.__N){var b=_.__[0];_.__=_.__N,_.__N=void 0,b!==_.__[0]&&(p=!0)}}),s&&s.call(this,l,d,u)||p};D.__f=!0;var s=D.shouldComponentUpdate,c=D.componentWillUpdate;D.componentWillUpdate=function(l,d,u){if(this.__e){var f=s;s=void 0,a(l,d,u),s=f}c&&c.call(this,l,d,u)},D.shouldComponentUpdate=a}return o.__N||o.__}function T(e,n){var r=Ye(xe++,3);!L.__s&&kt(r.__H,n)&&(r.__=e,r.u=n,D.__H.__h.push(r))}function fn(e,n){var r=Ye(xe++,4);!L.__s&&kt(r.__H,n)&&(r.__=e,r.u=n,D.__h.push(r))}function E(e){return je=5,Me(function(){return{current:e}},[])}function Me(e,n){var r=Ye(xe++,7);return kt(r.__H,n)&&(r.__=e(),r.__H=n,r.__h=e),r.__}function ne(e,n){return je=8,Me(function(){return e},n)}function tr(){for(var e;e=pn.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(Ze),n.__h.some(wt),n.__h=[]}catch(r){n.__h=[],L.__e(r,e.__v)}}}L.__b=function(e){D=null,on&&on(e)},L.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),dn&&dn(e,n)},L.__r=function(e){sn&&sn(e),xe=0;var n=(D=e.__c).__H;n&&(yt===D?(n.__h=[],D.__h=[],n.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(n.__h.some(Ze),n.__h.some(wt),n.__h=[],xe=0)),yt=D},L.diffed=function(e){an&&an(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(pn.push(n)!==1&&rn===L.requestAnimationFrame||((rn=L.requestAnimationFrame)||nr)(tr)),n.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),yt=D=null},L.__c=function(e,n){n.some(function(r){try{r.__h.some(Ze),r.__h=r.__h.filter(function(o){return!o.__||wt(o)})}catch(o){n.some(function(a){a.__h&&(a.__h=[])}),n=[],L.__e(o,r.__v)}}),cn&&cn(e,n)},L.unmount=function(e){ln&&ln(e);var n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(o){try{Ze(o)}catch(a){n=a}}),r.__H=void 0,n&&L.__e(n,r.__v))};var un=typeof requestAnimationFrame=="function";function nr(e){var n,r=function(){clearTimeout(o),un&&cancelAnimationFrame(n),setTimeout(e)},o=setTimeout(r,35);un&&(n=requestAnimationFrame(r))}function Ze(e){var n=D,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),D=n}function wt(e){var n=D;e.__c=e.__(),D=n}function kt(e,n){return!e||e.length!==n.length||n.some(function(r,o){return r!==e[o]})}function mn(e,n){return typeof n=="function"?n(e):n}var rr="/workbench/ui/api",V=class extends Error{constructor(r,o,a){super(r);this.status=o;this.code=a}status;code},et=new EventTarget;async function ce(e,n={}){let r=await fetch(`${rr}${e}`,{...n,credentials:"same-origin",headers:n.body?{"Content-Type":"application/json"}:void 0});if(r.ok)return await r.json();let o=r.statusText,a,s=await r.text();try{let c=JSON.parse(s);o=c.message||(typeof c.error=="string"?c.error:c.error?.message)||o,a=typeof c.code=="string"?c.code:typeof c.error=="string"?c.error:void 0}catch{o=s||o}throw r.status===401&&a==="login_required"&&et.dispatchEvent(new Event("required")),new V(o,r.status,a)}var G=(e,n)=>ce(e,{method:"POST",body:JSON.stringify(n)}),tt={status:()=>ce("/session"),login:e=>G("/session",{token:e}),logout:()=>ce("/session",{method:"DELETE"})},O={list(e,n=0,r=100){let o=new URLSearchParams({filter:e,offset:String(n),limit:String(r)});return ce(`/tasks?${o}`)},get:e=>ce(`/tasks/${encodeURIComponent(e)}`),dshSession:e=>ce(`/dsh/tasks/${encodeURIComponent(e)}`),chat:(e,n,r)=>{let o=new URLSearchParams({limit:String(r)});return n!==void 0&&o.set("before",String(n)),ce(`/tasks/${encodeURIComponent(e)}/chat?${o}`)},decide:(e,n,r)=>G(`/tasks/${encodeURIComponent(e)}/reviews/${encodeURIComponent(n)}/decisions`,r),refresh:e=>G(`/tasks/${encodeURIComponent(e)}/refresh`,{}),continueTask:(e,n)=>G(`/tasks/${encodeURIComponent(e)}/continue`,{prompt:n}),accept:e=>G(`/tasks/${encodeURIComponent(e)}/acceptance`,{}),answerProcessRequest:(e,n,r)=>G(`/tasks/${encodeURIComponent(e)}/process-requests/${encodeURIComponent(n)}/answers`,r),listAgents:()=>ce("/agents"),createAgent:e=>G("/agents",e),updateAgent:(e,n)=>G(`/agents/${encodeURIComponent(e)}/settings`,n),publishAgent:(e,n)=>G(`/agents/${encodeURIComponent(e)}/publish`,n),registerAgentPath:e=>G("/agents/register-path",e)};function nt(e,n="zh-CN"){let r=(l,d)=>n==="zh-CN"?l:d,o=e?.serviceInfo,a=o?.connectionAlias||e?.service,s=r("\u672A\u8BB0\u5F55","Not recorded");if(o?.kind==="gateway_workflow")s=r("ACP \u5185\u7F6E\u534F\u8C03\u5668","ACP built-in coordinator");else if(o?.kind==="a2a"||o?.kind==="activepieces"){let l=o.kind==="a2a"?"A2A":"Activepieces",d=o.locality==="loopback"?r("\u672C\u673A","Loopback"):o.host?.includes(":")&&!o.host.startsWith("[")?`[${o.host}]`:o.host;s=o.host&&d?`${l} \xB7 ${d}${o.port?`:${o.port}`:""}`:`${l} \xB7 ${r("\u7AEF\u70B9\u672A\u8BB0\u5F55","Endpoint not recorded")}`}let c={backend_run:r("\u6267\u884C\u56DE\u6267","Execution receipt"),target_snapshot:r("\u6D3E\u5355\u5FEB\u7167","Dispatch snapshot"),workflow_run:r("\u6D41\u7A0B\u8BB0\u5F55","Workflow record"),unrecorded:r("\u672A\u8BB0\u5F55","Not recorded")};return{service:s,serviceNote:a&&o?.kind!=="gateway_workflow"?r(`\u8FDE\u63A5\u522B\u540D ${a}`,`Connection alias ${a}`):void 0,serviceSource:o&&c[o.source]||c.unrecorded,connectionAlias:a}}function le(e,n="zh-CN"){let r=(d,u)=>n==="zh-CN"?d:u,o=r("\u672A\u8BB0\u5F55","Not recorded"),a={temporary:r("\u4E34\u65F6\u4EFB\u52A1","Temporary task"),resident:r("\u5E38\u9A7B\u89D2\u8272","Resident role"),workflow:r("\u5DE5\u4F5C\u6D41","Workflow"),unknown:o},s=e&&a[e.kind]||o,c=o,l;return e?.kind==="resident"||e?.kind==="workflow"?(c=e.targetName||e.roleId||o,e.kind==="resident"&&e.agentPreset&&(l=r(`\u9884\u8BBE ${e.agentPreset}`,`Preset ${e.agentPreset}`))):e?.agentPreset?c=e.agentPreset:e?.kind==="temporary"&&e.presetStatus==="host_default"&&(c=r("\u5BBF\u4E3B\u9ED8\u8BA4","Host default"),l=r("\u5B9E\u9645\u9884\u8BBE\u672A\u8BB0\u5F55","Effective preset not recorded")),{mode:s,role:c,roleNote:l,service:nt(e,n).service}}function gn(e){let n=/^#acp\/tasks(?:\/([^?]+))?(?:\?(.*))?$/.exec(e);if(!n)return null;try{let r=n[1]?decodeURIComponent(n[1]):void 0;if(r&&(r.length>512||/[\u0000-\u001f/]/.test(r)))return null;let o=new URLSearchParams(n[2]||""),a=o.get("review")||void 0;return a&&(a.length>512||/[\u0000-\u001f]/.test(a))?null:{jobId:r,reviewId:a,full:!!r&&o.get("mode")!=="drawer"}}catch{return null}}function rt(e){if(!e.jobId)return"#acp/tasks";let n=new URLSearchParams;return e.reviewId&&n.set("review",e.reviewId),e.full||n.set("mode","drawer"),`#acp/tasks/${encodeURIComponent(e.jobId)}${n.size?`?${n}`:""}`}function At(e){return[...e].sort((n,r)=>r.createdAt.localeCompare(n.createdAt))[0]}function hn(e){if(e)try{let n=new URL(e);return["https:","http:"].includes(n.protocol)&&!n.username&&!n.password?n.href:void 0}catch{return}}function vn(e,n){let r=new Map(n.map(c=>[c.jobId,c])),o=new Set([e.jobId]),a=e,s=0;for(;a.parentJobRef&&!o.has(a.parentJobRef.jobId);){let c=r.get(a.parentJobRef.jobId);if(!c)break;o.add(c.jobId),s++,a=c}return s}var or=0;function t(e,n,r,o,a,s){n||(n={});var c,l,d=n;if("ref"in d)for(l in d={},n)l=="ref"?c=n[l]:d[l]=n[l];var u={type:e,props:d,key:r,ref:c,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--or,__i:-1,__u:0,__source:a,__self:s};if(typeof e=="function"&&(c=e.defaultProps))for(l in c)d[l]===void 0&&(d[l]=c[l]);return S.vnode&&S.vnode(u),u}var H=navigator.language?.toLowerCase().startsWith("zh")?"zh-CN":"en",i=(e,n)=>H==="zh-CN"?e:n,It=e=>e instanceof Error?e.message:String(e),ge=e=>e.title||e.jobId,ot=e=>e==="trial"?i("\u8BD5\u8DD1","Trial"):e==="formal"?i("\u6B63\u5F0F","Formal"):i("\u4E34\u65F6","Temporary");function _n(){let e=()=>gn(location.hash)??{full:!1},[n,r]=g(e);return T(()=>{let o=()=>r(e());return window.addEventListener("hashchange",o),()=>window.removeEventListener("hashchange",o)},[]),n}function B(e){location.hash=rt(e)}function xt(e){let r={not_started:["\u672A\u5F00\u59CB","Not started"],submitted:["\u5DF2\u63D0\u4EA4","Submitted"],working:["\u8FDB\u884C\u4E2D","Working"],completed:["\u5DF2\u5B8C\u6210","Completed"],failed:["\u5931\u8D25","Failed"],canceled:["\u5DF2\u53D6\u6D88","Canceled"],rejected:["\u5DF2\u62D2\u7EDD","Rejected"],unknown:["\u5F85\u6838\u5B9E","Unknown"],input_required:["\u9700\u8981\u5904\u7406","Needs input"],auth_required:["\u9700\u8981\u8BA4\u8BC1","Needs authentication"],waiting_human:["\u5F85\u4EBA\u5DE5\u786E\u8BA4","Awaiting review"],awaiting_human:["\u5F85\u4EBA\u5DE5\u786E\u8BA4","Awaiting review"],pending:["\u5F85\u786E\u8BA4","Pending"],approved:["\u5DF2\u901A\u8FC7","Approved"],changes_requested:["\u8981\u6C42\u4FEE\u6539","Changes requested"],superseded:["\u5DF2\u88AB\u66FF\u4EE3","Superseded"],awaiting_validation:["\u7B49\u5F85\u6821\u9A8C","Awaiting validation"],processing:["\u6B63\u5728\u7EED\u8DD1","Resuming"],resuming:["\u7B49\u5F85\u7EED\u8DD1","Waiting to resume"],applied:["\u5DF2\u5904\u7406","Applied"],tool_blocked:["\u5DE5\u5177\u672A\u83B7\u6279\u51C6","Tool not approved"],unwatched:["\u53D1\u8D77\u65B9\u5DF2\u505C\u6B62\u7B49\u5F85","Caller stopped waiting"],accepted:["\u5DF2\u9A8C\u6536","Accepted"],acceptance_changes:["\u9A8C\u6536\u8981\u6C42\u4FEE\u6539","Acceptance: changes requested"]}[e];return r?i(...r):e}function bn(e){let r={"job.created":["\u4EFB\u52A1\u521B\u5EFA","Task created"],"job.migrated":["\u5386\u53F2\u4EFB\u52A1\u8FC1\u5165","Imported from earlier record"],"job.acceptance_recorded":["\u4E1A\u52A1\u9A8C\u6536\u5DF2\u8BB0\u5F55","Business acceptance recorded"],"attempt.prepared":["\u65B0\u4E00\u8F6E\u6267\u884C\u5DF2\u51C6\u5907","New attempt prepared"],"attempt.dispatching":["\u6B63\u5728\u6D3E\u53D1\u7ED9\u6267\u884C\u7AEF","Dispatching to the executor"],"attempt.accepted":["\u6267\u884C\u7AEF\u5DF2\u63A5\u6536\u4EFB\u52A1","Executor accepted the task"],"attempt.submission_failed":["\u6D3E\u53D1\u5931\u8D25","Dispatch failed"],"attempt.submission_unknown":["\u6D3E\u53D1\u7ED3\u679C\u5F85\u6838\u5B9E","Dispatch result needs verification"],"attempt.state_changed":["\u6267\u884C\u72B6\u6001\u53D8\u5316","Execution status changed"],"attempt.result_updated":["\u6267\u884C\u7ED3\u679C\u66F4\u65B0","Result updated"],"attempt.observation_conflict":["\u72B6\u6001\u89C2\u6D4B\u51B2\u7A81","Conflicting status observation"],"attempt.cancellation_requested":["\u5DF2\u8BF7\u6C42\u53D6\u6D88","Cancellation requested"],"human_review.comment":["\u4EBA\u5DE5\u5BA1\u6838\uFF1A\u5DF2\u7559\u8A00","Review: comment added"],"human_review.approve":["\u4EBA\u5DE5\u5BA1\u6838\uFF1A\u5DF2\u901A\u8FC7","Review: approved"],"human_review.changes_requested":["\u4EBA\u5DE5\u5BA1\u6838\uFF1A\u8981\u6C42\u4FEE\u6539","Review: changes requested"],"human_review.cancel":["\u4EBA\u5DE5\u5BA1\u6838\uFF1A\u5DF2\u53D6\u6D88\u4EFB\u52A1","Review: task canceled"],"process.opened":["\u8FC7\u7A0B\u8BF7\u6C42\uFF1A\u7B49\u5F85\u5904\u7406","Process request opened"],"process.answered":["\u8FC7\u7A0B\u8BF7\u6C42\uFF1A\u5DF2\u5904\u7406","Process request answered"],"process.expired":["\u8FC7\u7A0B\u8BF7\u6C42\uFF1A\u5DF2\u8FC7\u671F","Process request expired"]}[e];return r?i(...r):e}function yn(e){let n={research:["\u4E34\u65F6\u667A\u80FD\u4F53\u5206\u6790","Project analysis"],file_check:["\u62A5\u544A\u6587\u4EF6\u68C0\u67E5","Report file check"],summary:["\u6587\u7A3F\u751F\u6210","Writing"],project_script:["\u6587\u7A3F\u751F\u6210","Writing"],human_review:["\u4EBA\u5DE5\u5BA1\u6838","Human review"],human_resume:["\u7EED\u8DD1\u5904\u7406","Resuming workflow"],awaiting_human:["\u4EBA\u5DE5\u5BA1\u6838","Human review"],make:["\u8BBE\u8BA1\u5236\u4F5C","Production"],ppt_production:["\u8BBE\u8BA1\u5236\u4F5C","Production"],validate:["\u673A\u5668\u6821\u9A8C","Validation"],review:["\u72EC\u7ACB\u9A8C\u6536","Independent review"],independent_review:["\u72EC\u7ACB\u9A8C\u6536","Independent review"],finished:["\u4EA4\u4ED8\u5B8C\u6210","Delivered"],waiting_children:["\u7B49\u5F85\u6267\u884C\u7ED3\u679C","Waiting for execution"]};return n[e]?i(...n[e]):e}function Ct(e){return e.displayStatus||(e.pendingReviewId?"waiting_human":e.executionStatus)}function re({value:e}){return t("span",{class:`acp-status acp-status-${e.replace(/[^a-z_]/gi,"")}`,children:xt(e)})}function st(e){let n=Ct(e),r=e.businessAcceptance?.reviewStatus;return n!=="completed"?n:r==="accepted"?"accepted":r==="changes_requested"?"acceptance_changes":n}function J(e){if(!e)return"\u2014";let n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString(H,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Tt(e){if(e===void 0)return"\u2014";let n=Math.floor(e/6e4);return n<60?i(`${n} \u5206\u949F`,`${n} min`):i(`${Math.floor(n/60)} \u5C0F\u65F6 ${n%60} \u5206\u949F`,`${Math.floor(n/60)} h ${n%60} min`)}function sr(e){return e.replace(/```[^\n]*\n?/g," ").replace(/^\s*\|?[\s:|-]+\|[\s:|-]*$/gm," ").replace(/!?\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(#{1,6}|>|[-*+]|\d+\.)\s+/gm,"").replace(/[|*_`~]/g," ")}function wn(e){let n=Array.from(sr(e||"").replace(/\s+/g," ").trim());return n.length>50?`${n.slice(0,49).join("")}\u2026`:n.join("")||"\u2014"}function De({execution:e}){let n=le(e,H);return t("span",{class:"acp-execution-role",title:[n.role,n.roleNote].filter(Boolean).join(" \xB7 "),children:[t("span",{children:n.role}),n.roleNote&&t("small",{children:n.roleNote})]})}function Ce({execution:e}){let n=nt(e,H);return t("span",{class:"acp-execution-service",title:[n.service,n.serviceNote].filter(Boolean).join(" \xB7 "),children:[t("span",{children:n.service}),n.serviceNote&&t("small",{children:n.serviceNote})]})}function Rt({execution:e}){let n=nt(e,H);return t(C,{children:[t("dt",{children:i("\u670D\u52A1\u6765\u6E90\u4F9D\u636E","Service evidence")}),t("dd",{children:n.serviceSource}),n.connectionAlias&&t(C,{children:[t("dt",{children:i("\u914D\u7F6E\u8FDE\u63A5\u522B\u540D","Configured connection alias")}),t("dd",{children:n.connectionAlias})]})]})}function at({title:e,description:n}){return t("div",{class:"acp-empty",children:[t("strong",{children:e}),n&&t("p",{children:n})]})}function Te({title:e,message:n,onRetry:r}){return t("div",{class:"acp-error",role:"alert",children:[t("strong",{children:e}),t("p",{children:n}),r&&t("button",{type:"button",class:"acp-button",onClick:r,children:i("\u91CD\u8BD5","Retry")})]})}var ar={developing:[],published:[]};function kn(e){if(e instanceof V){if(e.code==="conflict")return i("\u8FD9\u4E2A\u540D\u5B57\u5DF2\u7ECF\u5728\u7528","That name is already in use");if(e.code==="not_found")return i("\u627E\u4E0D\u5230\u8FD9\u4EFD\u5F00\u53D1\u8349\u7A3F","Draft not found");if(e.code==="invalid")return i("\u8BBE\u7F6E\u683C\u5F0F\u4E0D\u6B63\u786E\u3002\u9009\u9879\u5199\u6210 id=value\uFF0C\u6A21\u578B\u9879\u53EF\u4EE5\u5199\u6210 model:id=value","Settings are not valid. Write options as id=value")}return e instanceof Error?e.message:String(e)}function ir(e){return e==="trial"?i("\u8BD5\u8DD1","Trial"):e==="formal"?i("\u6B63\u5F0F","Formal"):i("\u4E34\u65F6","Temporary")}function An(e){return e.map(n=>`${n.model&&n.id!=="model"?"model:":""}${n.id}=${n.value}`).join(`
2
+ `)}function cr(e){return e.split(`
3
+ `).map(n=>n.trim()).filter(Boolean).map(n=>{let r=!1,o=n;o.startsWith("model:")&&(r=!0,o=o.slice(6));let a=o.indexOf("="),s=a>0?o.slice(0,a).trim():"",c=a>0?o.slice(a+1).trim():"";if(!s||!c)throw new Error(i("\u6BCF\u4E00\u884C\u5199\u6210 id=value","Write each option as id=value"));return s==="model"&&(r=!0),{id:s,value:c,...r?{model:!0}:{}}})}function lr(e,n){return n==="developing"?e.developing:e.published}function xn({refreshKey:e,onOpenTask:n}){let[r,o]=g(0),[a,s]=g("developing"),[c,l]=g(ar),[d,u]=g([]),[f,p]=g(""),[_,b]=g(!1),[x,m]=g(!1),[I,w]=g(""),[y,P]=g("grok-build"),[j,h]=g("acp"),[N,U]=g("standard"),[K,$]=g(""),[q,_e]=g(""),[Re,Se]=g(!0),[X,Z]=g(""),[de,oe]=g(""),[ue,be]=g(!1),[ye,Y]=g(""),[M,se]=g("grok-build"),[pe,R]=g(""),[ae,W]=g(""),[we,ke]=g(""),[Ae,ee]=g(""),[fe,me]=g(""),[Oe,Ue]=g(!1);T(()=>{let v=!1;return Se(!0),(async()=>{try{let[F,Pe]=await Promise.all([O.listAgents(),O.list("all",0,100)]);if(v)return;l(F),u(Pe.items),Z("")}catch(F){v||Z(kn(F))}finally{v||Se(!1)}})(),()=>{v=!0}},[e,r]);let k=lr(c,a),z=c.connections??[],Q=q||z[0]?.connectionId||"",A=[...c.developing,...c.published].find(v=>v.agentId===f),qn=A?[A.agentId,A.modeId,A.targetId,A.roleId,A.acpAgent,An(A.options)].join("|"):"";T(()=>{A&&(Y(A.name),se(A.acpAgent||""),R(A.roleId||""),W(A.targetId||""),ke(A.modeId||""),ee(An(A.options)),me(A.releaseName||A.name),Ue(!1))},[qn]);let Ht=()=>({name:ye.trim(),acpAgent:M.trim(),...pe.trim()?{roleId:pe.trim()}:{},...ae.trim()?{targetId:ae.trim()}:{},...we.trim()?{modeId:we.trim()}:{},...Ae.trim()?{options:cr(Ae)}:{}}),He=async v=>{be(!0),oe(""),Z("");try{await v()}catch(F){Z(kn(F))}finally{be(!1)}};return t("div",{class:"acp-agent-module",children:[t("p",{class:"acp-agent-note",children:i("\u53D1\u5E03\u51BB\u7ED3\u7684\u662F\u5DE5\u4F5C\u53F0\u91CC\u7684\u4E00\u884C\u540D\u5B57\u3002\u6267\u884C\u5BBF\u4E3B\u4ECD\u6309\u8BE5\u5DE5\u4F5C\u533A\u548C ACP Agent \u6700\u8FD1\u4E00\u6B21\u5DF2\u63A5\u53D7\u7684 ACP \u8BBE\u7F6E\u56DE\u653E\uFF0C\u53D1\u5E03\u7ED3\u679C\u5199\u8FDB\u5BBF\u4E3B\u7F13\u5B58\u8FD8\u6CA1\u63A5\u4E0A\u3002\u5BA1\u6838\u901A\u8FC7\u4E0D\u4F1A\u4E0A\u7EBF\u3002","Publishing freezes a workbench name. The execution host still replays the last accepted ACP settings for that workspace and ACP agent. Syncing a release into the host cache is not connected. Approving a review does not publish.")}),t("nav",{class:"acp-workbench-views","aria-label":i("\u667A\u80FD\u4F53\u9636\u6BB5","Agent phase"),children:[t("button",{type:"button","aria-pressed":a==="developing",onClick:()=>s("developing"),children:[i("\u5F00\u53D1\u4E2D","In development"),t("span",{children:c.developing.length})]}),t("button",{type:"button","aria-pressed":a==="published",onClick:()=>s("published"),children:[i("\u5DF2\u4E0A\u7EBF","Published"),t("span",{children:c.published.length})]})]}),X&&t(Te,{title:i("\u667A\u80FD\u4F53\u8BFB\u53D6\u6216\u4FDD\u5B58\u5931\u8D25","Could not load or save agents"),message:X,onRetry:()=>o(v=>v+1)}),Re&&t("p",{class:"acp-muted",children:i("\u6B63\u5728\u8F7D\u5165\u2026","Loading\u2026")}),!Re&&!X&&!k.length&&!_&&!x&&t(at,{title:a==="developing"?i("\u8FD8\u6CA1\u6709\u5F00\u53D1\u4E2D\u7684\u667A\u80FD\u4F53","No agents in development"):i("\u8FD8\u6CA1\u6709\u5DF2\u4E0A\u7EBF\u7684\u540D\u5B57","No published names"),description:i("\u5E38\u9A7B\u89D2\u8272\u4F1A\u76F4\u63A5\u51FA\u73B0\u5728\u5DF2\u4E0A\u7EBF\u3002\u65B0\u7684\u8BD5\u8DD1\u4ECE\u5F00\u53D1\u4E2D\u7684\u8349\u7A3F\u5F00\u59CB\u3002","Resident roles appear under Published. A new trial starts from a developing draft.")}),t("div",{class:"acp-agent-layout",children:[t("div",{class:"acp-agent-list",children:[a==="developing"&&t(C,{children:[t("button",{type:"button",class:"acp-button",onClick:()=>{b(!0),m(!1),p(""),Y(""),se("grok-build"),R(""),W(""),ke(""),ee("")},children:i("\u65B0\u5EFA\u8349\u7A3F","New draft")}),t("button",{type:"button",class:"acp-button",onClick:()=>{m(!0),b(!1),p("")},children:i("\u6309\u8DEF\u5F84\u767B\u8BB0","Register a path")})]}),k.map(v=>t("button",{type:"button",class:`acp-agent-row${f===v.agentId?" is-selected":""}`,onClick:()=>{p(v.agentId),b(!1),m(!1)},children:[t("strong",{children:v.name}),t("small",{children:v.acpAgent||v.agentPreset||v.origin}),t("small",{children:[i("\u4EFB\u52A1","Tasks")," ",v.taskCount," \xB7 ",i("\u5F85\u786E\u8BA4","Waiting")," ",v.pendingCount]})]},v.agentId))]}),t("div",{class:"acp-agent-detail",children:[x&&t("form",{class:"acp-agent-form",onSubmit:v=>{v.preventDefault(),He(async()=>{let F=K.trim(),Pe=F.indexOf("/");if(j==="native"&&F&&Pe<=0)throw new Error(i("\u6A21\u578B\u5199\u6210 provider/model\uFF0C\u4F8B\u5982 minimax-cn/MiniMax-M3.1-Flash","Write the model as provider/model"));let We=await O.registerAgentPath({path:I.trim(),connectionId:Q,...j==="acp"?{acpAgent:y.trim()}:{agentPreset:N.trim(),...F?{provider:F.slice(0,Pe),model:F.slice(Pe+1)}:{}}});l(We),m(!1),s("developing"),p(We.registered[0]?.agentId??""),oe(i(`\u5DF2\u767B\u8BB0 ${We.registered.map(ut=>ut.name).join("\u3001")}\u3002\u6BCF\u4E2A\u90FD\u6709\u81EA\u5DF1\u7684\u6267\u884C\u76EE\u6807\uFF0C\u6D3E\u53D1\u65F6\u5BBF\u4E3B\u8BFB\u53D6 agent \u6587\u4EF6\u4F5C\u4E3A\u89D2\u8272\u8BF4\u660E\u3002`,`Registered ${We.registered.map(ut=>ut.name).join(", ")}. Each has its own target; the host reads the agent file as its role at dispatch.`))})},children:[t("h3",{children:i("\u6309\u8DEF\u5F84\u767B\u8BB0","Register a path")}),t("p",{class:"acp-muted",children:i("\u8BFB\u53D6\u8FD9\u4E2A\u76EE\u5F55\u4E0B\u7684 agents/*.md\uFF0C\u6BCF\u4E2A\u6587\u4EF6\u767B\u8BB0\u6210\u4E00\u4E2A\u5F00\u53D1\u4E2D\u7684\u667A\u80FD\u4F53\uFF0C\u540D\u5B57\u662F\u201C\u6587\u4EF6\u540D@\u8FD0\u884C\u65B9\u5F0F\u201D\uFF0C\u5DE5\u4F5C\u76EE\u5F55\u5C31\u662F\u8FD9\u4E2A\u76EE\u5F55\u3002\u540C\u4E00\u4E2A\u76EE\u5F55\u53EF\u4EE5\u5206\u522B\u767B\u8BB0 grok\u3001DSH \u539F\u751F\u7B49\u591A\u79CD\u8FD0\u884C\u65B9\u5F0F\uFF1B\u540C\u4E00\u79CD\u8FD0\u884C\u65B9\u5F0F\u518D\u767B\u8BB0\u4E00\u6B21\u4F1A\u66F4\u65B0\u539F\u6709\u8BB0\u5F55\u3002","Each agents/*.md under the directory becomes a developing agent named name@runtime that runs in that directory. One directory can be registered on several runtimes; registering the same runtime again updates its records.")}),t("label",{children:[i("\u76EE\u5F55\u8DEF\u5F84","Directory"),t("input",{value:I,placeholder:"/absolute/path/to/scenario",onInput:v=>w(v.currentTarget.value)})]}),t("label",{children:[i("\u8FD0\u884C\u65B9\u5F0F","Runtime"),t("select",{value:j,onChange:v=>h(v.currentTarget.value==="native"?"native":"acp"),children:[t("option",{value:"acp",children:i("ACP Agent","ACP agent")}),t("option",{value:"native",children:i("DSH \u539F\u751F\u9884\u8BBE","DSH-native preset")})]})]}),j==="acp"?t("label",{children:["ACP Agent",t("input",{value:y,placeholder:"grok-build",onInput:v=>P(v.currentTarget.value)})]}):t(C,{children:[t("label",{children:[i("\u9884\u8BBE","Preset"),t("input",{value:N,placeholder:"standard",onInput:v=>U(v.currentTarget.value)})]}),t("label",{children:[i("\u6A21\u578B\uFF08\u53EF\u9009\uFF09","Model (optional)"),t("input",{value:K,placeholder:"minimax-cn/MiniMax-M3.1-Flash",onInput:v=>$(v.currentTarget.value)})]})]}),t("label",{children:[i("\u6267\u884C\u8FDE\u63A5","Connection"),t("select",{value:Q,onChange:v=>_e(v.currentTarget.value),children:z.map(v=>t("option",{value:v.connectionId,children:[v.connectionId," \xB7 ",v.remote]},v.connectionId))})]}),t("button",{type:"submit",class:"acp-button",disabled:ue||!I.trim()||!Q||!(j==="acp"?y.trim():N.trim()),children:i("\u767B\u8BB0","Register")})]}),_&&t("form",{class:"acp-agent-form",onSubmit:v=>{v.preventDefault(),He(async()=>{let F=await O.createAgent(Ht());l(F),b(!1),p(F.draft.agentId),s("developing"),oe(i("\u8349\u7A3F\u5DF2\u4FDD\u5B58\u3002\u6D3E\u53D1\u4ECD\u4E0D\u4F1A\u8BFB\u53D6\u8FD9\u4EFD\u8349\u7A3F\uFF0C\u8981\u53D1\u5E03\u540E\u65B0\u4EFB\u52A1\u624D\u6302\u5230\u8FD9\u4E2A\u540D\u5B57\u3002","Draft saved. Dispatch does not read it until you publish, and new tasks then use that name."))})},children:[t("h3",{children:i("\u65B0\u5EFA\u5F00\u53D1\u8349\u7A3F","New developing draft")}),t(In,{name:ye,acpAgent:M,roleId:pe,targetId:ae,modeId:we,optionText:Ae,onName:Y,onAgent:se,onRole:R,onTarget:W,onMode:ke,onOptions:ee}),t("button",{type:"submit",class:"acp-button",disabled:ue||!ye.trim()||!M.trim(),children:i("\u4FDD\u5B58\u8349\u7A3F","Save draft")})]}),A&&!_&&!x&&t(C,{children:[t("h3",{children:A.name}),t("p",{class:"acp-muted",children:A.origin==="resident"?i("\u8FD9\u662F\u5DF2\u7ECF\u5728\u8DD1\u7684\u5E38\u9A7B\u89D2\u8272\uFF0C\u4E0D\u8981\u6C42\u5148\u8865\u4E00\u6B21\u8BD5\u8DD1\u3002","This resident role is already running. It does not require a prior trial."):A.origin==="release"?i("\u8FD9\u662F\u5DF2\u53D1\u5E03\u7684\u540D\u5B57\u3002\u4E4B\u540E\u518D\u6539 ACP \u8BBE\u7F6E\uFF0C\u53EA\u6539\u5F00\u53D1\u4E2D\u7684\u8349\u7A3F\u3002","This is a published name. Later ACP setting edits update the developing draft."):i("\u8FD9\u662F\u5F00\u53D1\u8349\u7A3F\u3002\u8BD5\u8DD1\u4EFB\u52A1\u4F1A\u6302\u5728\u8FD9\u91CC\u3002\u5BA1\u6838\u901A\u8FC7\u4E0D\u4F1A\u81EA\u52A8\u4E0A\u7EBF\u3002","This is a developing draft. Trial tasks attach here. A passed review does not publish it.")}),A.counterpartId&&t("button",{type:"button",class:"acp-link",onClick:()=>{let v=[...c.developing,...c.published].find(F=>F.agentId===A.counterpartId);v&&(s(v.phase),p(v.agentId))},children:A.phase==="developing"?i("\u67E5\u770B\u5DF2\u4E0A\u7EBF\u7684\u540D\u5B57","Open the published name"):i("\u67E5\u770B\u5F00\u53D1\u4E2D\u7684\u8349\u7A3F","Open the developing draft")}),t("dl",{class:"acp-agent-facts",children:[t("div",{children:[t("dt",{children:"ACP Agent"}),t("dd",{children:A.acpAgent||"\u2014"})]}),A.origin!=="resident"&&A.agentPreset&&t("div",{children:[t("dt",{children:i("\u9884\u8BBE","Preset")}),t("dd",{children:A.agentPreset})]}),A.provider&&t("div",{children:[t("dt",{children:i("\u6A21\u578B","Model")}),t("dd",{children:[A.provider,"/",A.model]})]}),t("div",{children:[t("dt",{children:i("\u6A21\u5F0F","Mode")}),t("dd",{children:A.modeId||"\u2014"})]}),t("div",{children:[t("dt",{children:i("\u6267\u884C\u76EE\u6807","Target")}),t("dd",{children:A.targetId||"\u2014"})]}),t("div",{children:[t("dt",{children:i("\u89D2\u8272","Role")}),t("dd",{children:A.roleId||"\u2014"})]}),A.source&&t("div",{children:[t("dt",{children:i("\u6765\u6E90","Source")}),t("dd",{children:A.source.file})]})]}),A.description&&t("p",{children:A.description}),A.options.length>0&&t("ul",{children:A.options.map(v=>t("li",{children:[v.id,"=",v.value]},v.id))}),t("h4",{children:i("\u540D\u4E0B\u4EFB\u52A1","Tasks")}),d.filter(v=>v.agentId===A.agentId).length===0&&t("p",{class:"acp-muted",children:i("\u8FD8\u6CA1\u6709\u6302\u5230\u8FD9\u6761\u8BB0\u5F55\u4E0A\u7684\u4EFB\u52A1\u3002","No tasks are attached to this record yet.")}),t("ul",{children:d.filter(v=>v.agentId===A.agentId).map(v=>t("li",{children:t("button",{type:"button",class:"acp-link",onClick:()=>n(v.jobId),children:[ir(v.channel)," \xB7 ",v.title||v.jobId]})},v.jobId))}),A.origin==="draft"&&t("form",{class:"acp-agent-form",onSubmit:v=>{v.preventDefault(),He(async()=>{let F=await O.updateAgent(A.agentId,Ht());l(F),oe(i("\u8349\u7A3F\u5DF2\u66F4\u65B0\u3002\u6B63\u5728\u8DD1\u7684\u53D1\u5E03\u540D\u5B57\u6CA1\u6709\u53D8\u3002","Draft updated. The published name stays as it was."))})},children:[t("h4",{children:i("\u4FEE\u6539\u8349\u7A3F","Edit draft")}),t(In,{name:ye,acpAgent:M,roleId:pe,targetId:ae,modeId:we,optionText:Ae,onName:Y,onAgent:se,onRole:R,onTarget:W,onMode:ke,onOptions:ee}),t("small",{children:i("\u9009\u9879\u7559\u7A7A\u8868\u793A\u4E0D\u4FEE\u6539\u3002\u6A21\u578B\u9879\u5199 model=\u503C\uFF0C\u6216 model:\u9009\u9879id=\u503C\u3002","Leave options blank to keep them. Write a model as model=value, or model:id=value.")}),t("button",{type:"submit",class:"acp-button",disabled:ue,children:i("\u4FDD\u5B58\u4FEE\u6539","Save changes")})]}),A.origin==="draft"&&t("form",{class:"acp-agent-form",onSubmit:v=>{v.preventDefault(),He(async()=>{let F=await O.publishAgent(A.agentId,{releaseName:fe.trim(),...Oe?{replace:!0}:{}});l(F),s("published"),p(`release:${fe.trim()}`),oe(i("\u540D\u5B57\u5DF2\u53D1\u5E03\u3002\u65B0\u7684\u6B63\u5F0F\u4EFB\u52A1\u4F1A\u6302\u5230\u8FD9\u4E2A\u540D\u5B57\u3002\u5BBF\u4E3B\u56DE\u653E\u4ECD\u7528\u8BE5\u5DE5\u4F5C\u533A\u6700\u8FD1\u4E00\u6B21 ACP \u8BBE\u7F6E\u3002","Name published. New formal tasks use it. Host replay still uses the latest ACP settings for that workspace."))})},children:[t("h4",{children:i("\u53D1\u5E03\u4E00\u884C\u540D\u5B57","Publish a name")}),t("label",{children:[i("\u540D\u5B57","Name"),t("input",{value:fe,onInput:v=>me(v.currentTarget.value)})]}),t("label",{children:[t("input",{type:"checkbox",checked:Oe,onChange:v=>Ue(v.currentTarget.checked)}),i("\u8986\u76D6\u540C\u540D\u7684\u5DF2\u53D1\u5E03\u8BB0\u5F55","Replace the published record with this name")]}),t("button",{type:"submit",class:"acp-button",disabled:ue||!fe.trim(),children:i("\u53D1\u5E03","Publish")})]}),de&&t("p",{children:de})]})]})]})]})}function In(e){return t(C,{children:[t("label",{children:[i("\u540D\u79F0","Name"),t("input",{value:e.name,onInput:n=>e.onName(n.currentTarget.value)})]}),t("label",{children:["ACP Agent",t("input",{value:e.acpAgent,placeholder:"grok-build",onInput:n=>e.onAgent(n.currentTarget.value)})]}),t("label",{children:[i("\u89D2\u8272 ID","Role ID"),t("input",{value:e.roleId,onInput:n=>e.onRole(n.currentTarget.value)})]}),t("label",{children:[i("\u6267\u884C\u76EE\u6807 ID","Target ID"),t("input",{value:e.targetId,onInput:n=>e.onTarget(n.currentTarget.value)})]}),t("label",{children:["modeId",t("input",{value:e.modeId,placeholder:"mode id",onInput:n=>e.onMode(n.currentTarget.value)})]}),t("label",{children:[i("ACP \u9009\u9879","ACP options"),t("textarea",{rows:4,value:e.optionText,placeholder:`model=grok-2
4
+ reasoningEffort=high`,onInput:n=>e.onOptions(n.currentTarget.value)})]})]})}function Cn(e){let n=e.trim();if(!n)return e;let r=c=>{if(c==null)return c;let l=c;if(typeof c=="string"){let d=c.trim();try{let u=JSON.parse(d);u!==null&&typeof u=="object"&&!Array.isArray(u)&&(l=u)}catch{}}if(typeof l=="object"&&l!==null&&!Array.isArray(l)){let d=l,u=["content","content_concise","raw_output","output_for_prompt","formatted_output","output"];for(let f of u)if(f in d&&d[f]!==void 0&&d[f]!==null)return d[f]}return c},o=c=>{let l=r(c);if(l==null)return"";if(typeof l=="object")return JSON.stringify(l,null,2);if(typeof l=="string"){let d=l.trim();try{let u=JSON.parse(d);if(u!==null&&typeof u=="object")return JSON.stringify(u,null,2)}catch{}return l}return String(l)},a=c=>{try{let l=JSON.parse(c);if(l!==null&&typeof l=="object"){if(!Array.isArray(l)){let d={GrepSearch:["file_matches"],ReadFile:["FileContent","content","content_concise","raw_output"]};if(typeof l.type=="string"&&l.type in d){let f=d[l.type];for(let p of f)if(p in l&&l[p]!==void 0&&l[p]!==null)return o(l[p])}let u=["output_for_prompt","formatted_output","FileContent","content","content_concise","raw_output","output"];for(let f of u)if(f in l&&l[f]!==void 0&&l[f]!==null)return o(l[f])}return JSON.stringify(l,null,2)}return null}catch{return null}},s=a(n);if(s!==null)return s;if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))try{let c=JSON.parse(n);if(typeof c=="string"){let l=a(c.trim());if(l!==null)return l}}catch{}return e}function Tn(e,n,r=3){let o=e===void 0||e===""?[]:e.split(`
5
+ `),a=n.split(`
6
+ `),s=0;for(;s<o.length&&s<a.length&&o[s]===a[s];)s++;let c=o.length,l=a.length;for(;c>s&&l>s&&o[c-1]===a[l-1];)c--,l--;let d=o.slice(Math.max(0,s-r),s).map(f=>({type:"ctx",text:f})),u=o.slice(c,c+r).map(f=>({type:"ctx",text:f}));return[...d,...o.slice(s,c).map(f=>({type:"del",text:f})),...a.slice(s,l).map(f=>({type:"add",text:f})),...u]}function Rn(e,n=",",r=2e3){let o=[],a=[],s="",c=!1,l=()=>{a.push(s),s="",o.push(a),a=[]};for(let d=0;d<e.length;d++){let u=e[d];if(c)u==='"'?e[d+1]==='"'?(s+='"',d++):c=!1:s+=u;else if(u==='"'&&s==="")c=!0;else if(u===n)a.push(s),s="";else if(u===`
7
+ `||u==="\r"){if(u==="\r"&&e[d+1]===`
8
+ `&&d++,l(),o.length>=r)return{rows:o,truncated:d<e.length-1}}else s+=u}return(s!==""||a.length)&&l(),{rows:o,truncated:!1}}var dr={md:"markdown",markdown:"markdown",mdx:"markdown",json:"json",jsonc:"json",jsonl:"code",ndjson:"code",csv:"csv",tsv:"csv",png:"image",jpg:"image",jpeg:"image",gif:"image",webp:"image",svg:"image",ico:"image",bmp:"image",avif:"image",mp4:"video",webm:"video",mov:"video",m4v:"video",mp3:"audio",wav:"audio",m4a:"audio",flac:"audio",aac:"audio",oga:"audio",ogg:"audio",pdf:"pdf",html:"html",htm:"html",txt:"text",log:"text",js:"code",jsx:"code",mjs:"code",cjs:"code",ts:"code",tsx:"code",css:"code",scss:"code",py:"code",go:"code",rs:"code",c:"code",h:"code",cpp:"code",hpp:"code",java:"code",rb:"code",php:"code",sh:"code",bash:"code",zsh:"code",yaml:"code",yml:"code",toml:"code",ini:"code",xml:"code",sql:"code",diff:"code",patch:"code",dockerfile:"code",env:"text",conf:"text",doc:"unsupported",docx:"unsupported",xls:"unsupported",xlsx:"unsupported",ppt:"unsupported",pptx:"unsupported",zip:"unsupported",gz:"unsupported",tar:"unsupported",bin:"unsupported"},ur=[["image/","image"],["video/","video"],["audio/","audio"],["application/pdf","pdf"],["text/html","html"],["text/markdown","markdown"],["text/csv","csv"],["application/json","json"],["text/","text"]],St=e=>{let n=e.split(/[\\/]/).pop()||e,r=n.lastIndexOf(".");return r>0||r===0&&n.length>1?n.slice(r+1).toLowerCase():n.toLowerCase()};function Sn(e,n){let r=dr[St(e)];if(r)return r;let o=(n||"").toLowerCase().split(";")[0].trim();for(let[a,s]of ur)if(o.startsWith(a))return s;return"unsupported"}var Pt=e=>e==="markdown"||e==="code"||e==="json"||e==="csv"||e==="text";function Pn(e){if(!Number.isFinite(e)||e<0)return"";if(e<1024)return`${e} B`;let n=["KB","MB","GB"],r=e/1024,o=0;for(;r>=1024&&o<n.length-1;)r/=1024,o++;return`${r.toFixed(r<10?1:0)} ${n[o]}`}var jt={json:()=>import("./chunk-P6TKKRKP.js"),bash:()=>import("./chunk-B2LIVH37.js"),python:()=>import("./chunk-7GIX43Y5.js"),javascript:()=>import("./chunk-Z3TCAKM5.js"),typescript:()=>import("./chunk-QOHUZGP4.js"),xml:()=>import("./chunk-YFVL4NJL.js"),css:()=>import("./chunk-NY7C662Z.js"),scss:()=>import("./chunk-S7C4HKEY.js"),yaml:()=>import("./chunk-HSAVC5GY.js"),go:()=>import("./chunk-YRFQENM4.js"),rust:()=>import("./chunk-TYAAT3GQ.js"),cpp:()=>import("./chunk-K43JDCBH.js"),c:()=>import("./chunk-O76WTHWP.js"),ini:()=>import("./chunk-CVQY7TNC.js"),sql:()=>import("./chunk-E253Y562.js"),dockerfile:()=>import("./chunk-BI6UHHQP.js"),markdown:()=>import("./chunk-PUQLANIM.js"),diff:()=>import("./chunk-S74PLMMS.js"),java:()=>import("./chunk-KT4DJNOR.js"),ruby:()=>import("./chunk-4N44QPL7.js"),php:()=>import("./chunk-CSEIBI5U.js")},pr={js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",py:"python",sh:"bash",zsh:"bash",shell:"bash",yml:"yaml",toml:"ini",conf:"ini",html:"xml",htm:"xml",rs:"rust",rb:"ruby",h:"c",hpp:"cpp",jsonc:"json",patch:"diff",md:"markdown",jsonl:"json",ndjson:"json"};function it(e){let n=e.includes(".")||e.includes("/")?St(e):e.toLowerCase(),r=pr[n]||n;return Object.hasOwn(jt,r)?r:void 0}var En,Et=new Map;async function fr(e){En??=import("./chunk-VSIWU7XA.js").then(r=>r.default);let n=await En;return Et.has(e)||Et.set(e,jt[e]().then(r=>n.registerLanguage(e,r.default))),await Et.get(e),n}async function Mt(e,n){let r=l=>l.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");if(!n||!Object.hasOwn(jt,n))return e.split(`
9
+ `).map(r);let a=(await fr(n)).highlight(e,{language:n,ignoreIllegals:!0}).value,s=[],c=[];for(let l of a.split(`
10
+ `)){let d=c.join("")+l,u=/<span[^>]*>|<\/span>/g,f,p=[...c];for(;f=u.exec(l);)f[0]==="</span>"?p.pop():p.push(f[0]);d+="</span>".repeat(p.length),c=p,s.push(d)}return s}async function jn(e,n){return(await Mt(e,n)).join(`
11
+ `)}var Mn,Dt=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");async function mr(){let[{Marked:e},n]=await Promise.all([import("./chunk-IZXOKUGG.js"),import("./chunk-KOUZX3UX.js")]),r=new e({gfm:!0,breaks:!1});r.use({async:!1,renderer:{code({text:a,lang:s}){let c=(s||"").trim().split(/\s+/)[0]||"";return c==="mermaid"?`<div class="fp-mermaid" data-mermaid="${encodeURIComponent(a)}"><pre>${Dt(a)}</pre></div>`:`<pre class="fp-md-code"><code class="hljs" data-lang="${Dt(c)}">${Dt(a)}</code></pre>`}}});let o=n.default;return{marked:r,purify:o}}async function he(e,n={}){Mn??=mr();let{marked:r,purify:o}=await Mn,a=r.parse(e),s=new DOMParser().parseFromString(o.sanitize(a,{ADD_ATTR:["data-mermaid","data-lang"]}),"text/html");for(let c of s.querySelectorAll("a[href]")){let l=c.getAttribute("href")||"",d=n.resolveUrl?n.resolveUrl(l,"link"):l;if(d===void 0){c.removeAttribute("href");continue}c.setAttribute("href",d),/^(https?:)?\/\//i.test(d)&&(c.setAttribute("target","_blank"),c.setAttribute("rel","noopener noreferrer"))}for(let c of s.querySelectorAll("img[src]")){let l=n.resolveUrl?n.resolveUrl(c.getAttribute("src")||"","image"):c.getAttribute("src");l===void 0?c.remove():(c.setAttribute("src",l),c.setAttribute("loading","lazy"))}for(let c of s.querySelectorAll("code.hljs[data-lang]")){let l=it(c.dataset.lang||"");l&&(c.innerHTML=await jn(c.textContent||"",l))}return s.body.innerHTML}var Dn,Ln,gr=0;async function Le(e,n="light"){let r=[...e.querySelectorAll(".fp-mermaid[data-mermaid]")].filter(a=>a.dataset.drawnTheme!==n);if(!r.length)return;Dn??=import("./chunk-Z6QR6FRE.js").then(a=>a.default);let o=await Dn;Ln!==n&&(o.initialize({startOnLoad:!1,securityLevel:"strict",theme:n==="dark"?"dark":"default"}),Ln=n);for(let a of r){let s="";try{s=decodeURIComponent(a.dataset.mermaid||"")}catch{continue}try{let{svg:c}=await o.render(`fp-mermaid-${++gr}`,s);a.innerHTML=c,a.dataset.drawnTheme=n}catch{a.classList.add("fp-mermaid-error"),a.textContent=s,a.dataset.drawnTheme=n}}}var hr={loading:"Loading\u2026",failed:"Could not load this file",open:"Open in new tab",unsupported:"No preview for this file type",truncated:"Showing the first part of a large file",noSource:"This file has no readable location",empty:"Empty file"},vr=2*1024*1024;function Lt(e){try{let n=new URL(e,typeof location>"u"?"http://localhost":location.href);return(n.protocol==="http:"||n.protocol==="https:"||n.protocol==="blob:")&&!n.username&&!n.password}catch{return!1}}function _r(e,n,r,o,a){let[s,c]=g({status:"idle"});return T(()=>{if(!Pt(e))return c({status:"idle"});if(r!==void 0){let d=r.length>o;return c({status:"ready",text:d?r.slice(0,o):r,truncated:d})}if(!n||!Lt(n))return c({status:"error",message:""});let l=new AbortController;return c({status:"loading"}),(async()=>{let d=await(a?a(n):fetch(n,{credentials:"same-origin",signal:l.signal}));if(!d.ok)throw new Error(`${d.status} ${d.statusText}`.trim());let u=await d.arrayBuffer(),f=u.byteLength>o;c({status:"ready",text:new TextDecoder().decode(f?u.slice(0,o):u),truncated:f})})().catch(d=>{l.signal.aborted||c({status:"error",message:d instanceof Error?d.message:String(d)})}),()=>l.abort()},[e,n,r,o,a]),s}function br(e){return e||(typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}function yr({text:e,theme:n,options:r,onOpenLink:o,diagrams:a}){let[s,c]=g(""),l=E(null);return T(()=>{let d=!0;return he(e,r).then(u=>d&&c(u)).catch(()=>d&&c("")),()=>{d=!1}},[e,r]),T(()=>{a&&s&&l.current&&Le(l.current,n)},[s,n,a]),t("div",{ref:l,class:"fp-md",dangerouslySetInnerHTML:{__html:s},onClick:d=>{let u=d.target.closest("a"),f=u?.getAttribute("href");if(!(!u||!f))if(f.startsWith("#")){d.preventDefault();let p=decodeURIComponent(f.slice(1));l.current?.querySelector(`[id="${p.replace(/"/g,'\\"')}"]`)?.scrollIntoView({behavior:"smooth"})}else o&&(d.preventDefault(),o(f))}})}function wr({text:e,lang:n,targetLine:r}){let[o,a]=g(null),s=E(null);T(()=>{let d=!0;return a(null),Mt(e,n).then(u=>d&&a(u)).catch(()=>d&&a(e.split(`
12
+ `))),()=>{d=!1}},[e,n]),T(()=>{o&&r&&s.current?.scrollIntoView({block:"center"})},[o,r]);let c=Me(()=>e.split(`
13
+ `),[e]);return t("div",{class:"fp-code",role:"region","aria-label":"code",children:(o??c).map((d,u)=>t("div",{ref:r===u+1?s:void 0,class:`fp-code-row${r===u+1?" fp-code-target":""}`,children:[t("span",{class:"fp-code-no",children:u+1}),o?t("span",{class:"fp-code-text hljs",dangerouslySetInnerHTML:{__html:d||" "}}):t("span",{class:"fp-code-text",children:d||" "})]},u))})}function kr({text:e,delimiter:n}){let{rows:r,truncated:o}=Me(()=>Rn(e,n),[e,n]);if(!r.length)return null;let[a,...s]=r;return t("div",{class:"fp-table-wrap",children:[t("table",{class:"fp-table",children:[t("thead",{children:t("tr",{children:a.map((c,l)=>t("th",{children:c},l))})}),t("tbody",{children:s.map((c,l)=>t("tr",{children:c.map((d,u)=>t("td",{children:d},u))},l))})]}),o&&t("p",{class:"fp-note",children:`Showing the first ${r.length} rows`})]})}function Ar(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function ct(e){let[n,r]=g(!1);T(()=>r(!1),[e.url]);let o={...hr,...e.labels},a=Sn(e.name,e.mediaType),s=br(e.theme),c=e.url&&Lt(e.url)?e.url:void 0,l=_r(a,c,e.content,e.maxTextBytes??vr,e.fetcher),d;if(Pt(a))if(l.status==="error")d=t("p",{class:"fp-note fp-error",role:"alert",children:[l.message||o.noSource,l.message?` \xB7 ${o.failed}`:""]});else if(l.status!=="ready")d=t("p",{class:"fp-note",role:"status",children:o.loading});else if(!l.text.trim())d=t("p",{class:"fp-note",children:o.empty});else{let u=a==="json"?Ar(l.text):l.text;d=t(C,{children:[a==="markdown"?t(yr,{text:u,theme:s,options:e.markdown,onOpenLink:e.onOpenLink,diagrams:e.diagrams??!0}):a==="csv"?t(kr,{text:u,delimiter:e.name.toLowerCase().endsWith(".tsv")?" ":","}):t(wr,{text:u,lang:a==="json"?"json":a==="text"?void 0:it(e.name),targetLine:e.targetLine}),l.truncated&&t("p",{class:"fp-note",children:o.truncated})]})}else c?n&&(a==="image"||a==="video"||a==="audio")?d=t("p",{class:"fp-note fp-error",role:"alert",children:o.failed}):a==="image"?d=t("div",{class:"fp-media",children:t("img",{src:c,alt:e.name,loading:"lazy",onError:()=>r(!0)})}):a==="video"?d=t("div",{class:"fp-media",children:t("video",{src:c,controls:!0,preload:"metadata",onError:()=>r(!0)})}):a==="audio"?d=t("div",{class:"fp-media",children:t("audio",{src:c,controls:!0,preload:"metadata",onError:()=>r(!0)})}):a==="pdf"?d=t("iframe",{class:"fp-frame",src:c,title:e.name}):a==="html"?d=t("iframe",{class:"fp-frame",src:c,title:e.name,sandbox:"",referrerpolicy:"no-referrer"}):d=t("p",{class:"fp-note",children:o.unsupported}):d=t("p",{class:"fp-note",children:a==="unsupported"?o.unsupported:o.noSource});return t("section",{class:`fp-root${e.class?` ${e.class}`:""}`,"data-fp-theme":s,"data-fp-kind":a,children:[!e.hideHeader&&t("header",{class:"fp-header",children:[t("strong",{class:"fp-name",title:e.path||e.name,children:e.name}),e.size!==void 0&&t("span",{class:"fp-size",children:Pn(e.size)}),c&&t("a",{class:"fp-open",href:c,target:"_blank",rel:"noopener noreferrer",children:o.open})]}),t("div",{class:"fp-body",children:d})]})}function lt({text:e,theme:n,onOpenFile:r,streaming:o,diagrams:a=!0}){let[s,c]=g(""),l=E(null);return T(()=>{let d=!0;return he(e).then(u=>d&&c(u)).catch(()=>d&&c("")),()=>{d=!1}},[e]),T(()=>{a&&s&&!o&&l.current&&Le(l.current,n)},[s,o,n,a]),t("div",{ref:l,class:"fp-md cv-md",dangerouslySetInnerHTML:{__html:s},onClick:d=>{let u=d.target.closest("a")?.getAttribute("href");if(!u||/^(https?:|mailto:|#)/i.test(u)||!r)return;d.preventDefault();let f=/^(.*?)(?::(\d+))?$/.exec(decodeURIComponent(u.split("#")[0]));r(f?.[1]||u,f?.[2]?Number(f[2]):void 0)}})}var Ir={empty:"No messages yet",loading:"Loading messages\u2026",loadEarlier:"Load earlier messages",loadingEarlier:"Loading\u2026",retry:"Retry",thinking:"Thinking",input:"Input",output:"Output",showMore:"Show all",allowed:"Allowed",denied:"Denied",waiting:"Waiting for an answer",plan:"Plan",you:"You",agent:"Agent"},dt=4e3;function Ne({label:e,children:n,open:r}){return t("details",{class:"cv-fold",open:r,children:[t("summary",{children:e}),n]})}function $e({text:e,limit:n,labels:r}){let[o,a]=g(!1),s=!o&&e.length>n;return t(C,{children:[t("pre",{class:"cv-pre",children:s?e.slice(0,n):e}),s&&t("button",{type:"button",class:"cv-link",onClick:()=>a(!0),children:r.showMore})]})}function xr({path:e,oldText:n,newText:r,onOpenFile:o}){let a=Tn(n,r);return t("div",{class:"cv-diff",children:[t("button",{type:"button",class:"cv-link cv-diff-path",onClick:()=>o?.(e),children:e}),t("pre",{class:"cv-pre",children:a.map((s,c)=>t("div",{class:`cv-diff-${s.type}`,children:[s.type==="add"?"+ ":s.type==="del"?"- ":" ",s.text]},c))})]})}function Cr(e){return e.isError||e.status==="failed"?"failed":e.status==="pending"||e.status==="in_progress"||e.status===void 0&&e.output===void 0?"running":"done"}function Nt({call:e,labels:n,onOpenFile:r}){let o=Cr(e),a=e.output===void 0?void 0:Cn(e.output);return t("div",{class:`cv-tool cv-tool-${o}`,children:[t("div",{class:"cv-tool-head",children:[t("span",{class:"cv-dot","aria-hidden":"true"}),t("strong",{children:e.toolName}),e.kind&&t("span",{class:"cv-tag",children:e.kind}),e.locations?.map(s=>t("button",{type:"button",class:"cv-chip",onClick:()=>r?.(s.path,s.line),children:[s.path.split("/").pop(),s.line?`:${s.line}`:""]},`${s.path}:${s.line??""}`))]}),e.diffs?.map((s,c)=>t(xr,{...s,onOpenFile:r},c)),e.input&&e.input!=="{}"&&t(Ne,{label:n.input,children:t($e,{text:e.input,limit:dt,labels:n})}),a!==void 0&&a!==""&&t(Ne,{label:n.output,children:t($e,{text:a,limit:dt,labels:n})}),e.permission&&t("p",{class:"cv-note",children:e.permission.resolved==="allow"?n.allowed:e.permission.resolved==="deny"?n.denied:n.waiting})]})}function Tr({item:e,results:n,theme:r,labels:o,onOpenFile:a,diagrams:s}){switch(e.kind){case"user":return t("div",{class:"cv-row cv-user",children:t("div",{class:"cv-bubble",children:t($e,{text:e.content,limit:2e4,labels:o})})});case"assistant_text":return t("div",{class:"cv-row cv-agent",children:t(lt,{diagrams:s,text:e.content,theme:r,streaming:e.streaming,onOpenFile:a})});case"thinking":return t("div",{class:"cv-row",children:t(Ne,{label:o.thinking,children:t($e,{text:e.content,limit:dt,labels:o})})});case"tool_use":{let c=e.calls.length?e.calls:[{toolName:e.toolName,input:e.input,toolCallId:e.toolCallId}];return t("div",{class:"cv-row",children:c.map((l,d)=>{let u=l.output===void 0&&l.toolCallId?n.get(l.toolCallId):void 0,f=u?{...l,output:u.content,isError:u.isError}:l;return t(Nt,{call:f,labels:o,onOpenFile:a},l.id||l.toolCallId||d)})})}case"tool_result":return t("div",{class:"cv-row",children:t(Nt,{call:{toolName:e.toolName||"tool",input:"",output:e.content,isError:e.isError},labels:o,onOpenFile:a})});case"permission_request":return t("div",{class:"cv-row",children:t("div",{class:"cv-tool",children:[t("div",{class:"cv-tool-head",children:t("strong",{children:e.toolName})}),t("p",{class:"cv-note",children:e.resolved==="allow"?o.allowed:e.resolved==="deny"?o.denied:o.waiting})]})});case"ask_user_question":return t("div",{class:"cv-row",children:t("div",{class:"cv-tool",children:[e.questions.map((c,l)=>t("div",{children:[t("strong",{children:[c.header?`${c.header} \xB7 `:"",c.question]}),c.options&&t("ul",{class:"cv-options",children:c.options.map(d=>t("li",{children:[d.label,d.description?` \u2014 ${d.description}`:""]},d.label))})]},l)),e.resolved===void 0&&t("p",{class:"cv-note",children:o.waiting})]})});case"exit_plan_mode":return t("div",{class:"cv-row",children:t(Ne,{label:o.plan,open:!0,children:t(lt,{diagrams:s,text:e.planContent,theme:r,onOpenFile:a})})});case"error":return t("div",{class:"cv-row",children:t("p",{class:"cv-error",role:"alert",children:e.content})});case"turn_receipt":return t("div",{class:"cv-row",children:t("p",{class:`cv-receipt cv-receipt-${e.status}`,children:e.content})});case"subagent_turn":return t("div",{class:"cv-row",children:t(Ne,{label:e.label,children:[e.thinking&&t($e,{text:e.thinking,limit:dt,labels:o}),e.calls.map((c,l)=>t(Nt,{call:c,labels:o,onOpenFile:a},l)),e.output&&t(lt,{diagrams:s,text:e.output,theme:r,streaming:e.streaming,onOpenFile:a})]})});default:return null}}function $t(e){let n={...Ir,...e.labels},r=e.theme??(typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),o=E(null),a=E(null),s=E(!0),c=E({height:0,firstId:"",count:0}),l=new Map;for(let f of e.items)f.kind==="tool_result"&&f.toolCallId&&l.set(f.toolCallId,f);let d=new Set(e.items.flatMap(f=>f.kind==="tool_use"?f.calls.filter(p=>p.output===void 0&&p.toolCallId&&l.has(p.toolCallId)).map(p=>p.toolCallId):[])),u=e.items.filter(f=>!(f.kind==="tool_result"&&f.toolCallId&&d.has(f.toolCallId)));return fn(()=>{let f=o.current;if(!f)return;let p=c.current;p.firstId!==""&&e.items.length>p.count&&e.items[0]?.id!==p.firstId?f.scrollTop+=f.scrollHeight-p.height:(e.stickToBottom??!0)&&s.current&&(f.scrollTop=f.scrollHeight),c.current={height:f.scrollHeight,firstId:e.items[0]?.id??"",count:e.items.length}},[e.items]),T(()=>{let f=a.current,p=o.current;if(!f||!p||!e.hasMore||e.loadingMore||!e.onLoadMore||typeof IntersectionObserver>"u")return;let _=new IntersectionObserver(b=>{b.some(x=>x.isIntersecting)&&e.onLoadMore?.()},{root:p,rootMargin:"200px 0px 0px 0px"});return _.observe(f),()=>_.disconnect()},[e.hasMore,e.loadingMore,e.onLoadMore,e.items.length]),t("div",{ref:o,class:`cv-root${e.class?` ${e.class}`:""}`,"data-fp-theme":r,onScroll:f=>{let p=f.currentTarget;s.current=p.scrollHeight-p.scrollTop-p.clientHeight<80},children:[t("div",{ref:a}),e.hasMore&&t("button",{type:"button",class:"cv-more",disabled:e.loadingMore,onClick:e.onLoadMore,children:e.loadingMore?n.loadingEarlier:n.loadEarlier}),e.loading&&t("p",{class:"cv-note",role:"status",children:n.loading}),e.error&&t("p",{class:"cv-error",role:"alert",children:[e.error," ",e.onRetry&&t("button",{type:"button",class:"cv-link",onClick:e.onRetry,children:n.retry})]}),!e.loading&&!e.error&&u.length===0&&t("p",{class:"cv-note",children:n.empty}),u.map(f=>t(Tr,{item:f,results:l,theme:r,labels:n,onOpenFile:e.onOpenFile,diagrams:e.diagrams??!0},f.id))]})}function Ft(e,{pageSize:n=40,enabled:r=!0}={}){let[o,a]=g([]),[s,c]=g({loading:!1,loadingMore:!1,hasMore:!1,error:void 0}),l=E(void 0),d=E(),u=E(0),f=E(!1),p=ne(x=>{if(f.current)return;f.current=!0;let m=u.current;d.current=new AbortController,c(I=>({...I,error:void 0,loading:x,loadingMore:!x})),e(x?void 0:l.current,n,d.current.signal).then(I=>{m===u.current&&(l.current=I.nextCursor,a(w=>{if(x)return I.items;let y=new Set(w.map(P=>P.id));return[...I.items.filter(P=>!y.has(P.id)),...w]}),c({loading:!1,loadingMore:!1,hasMore:I.hasMore,error:void 0}))}).catch(I=>{m===u.current&&c(w=>({...w,loading:!1,loadingMore:!1,error:I instanceof Error?I.message:String(I)}))}).finally(()=>{m===u.current&&(f.current=!1)})},[e,n]),_=ne(()=>{u.current++,d.current?.abort(),f.current=!1,l.current=void 0,a([]),p(!0)},[p]);T(()=>{if(r)return _(),()=>{u.current++,d.current?.abort(),f.current=!1}},[r,_]);let b=ne(()=>{s.hasMore&&!f.current&&p(!1)},[s.hasMore,p]);return{items:o,...s,loadMore:b,reload:_}}var Nn=H==="zh-CN"?{loading:"\u6B63\u5728\u8BFB\u53D6\u2026",failed:"\u65E0\u6CD5\u8BFB\u53D6\u8BE5\u6587\u4EF6",open:"\u65B0\u7A97\u53E3\u6253\u5F00",unsupported:"\u6B64\u7C7B\u578B\u6587\u4EF6\u6682\u4E0D\u652F\u6301\u9884\u89C8",truncated:"\u6587\u4EF6\u8F83\u5927\uFF0C\u4EC5\u663E\u793A\u5F00\u5934\u90E8\u5206",noSource:"\u8BE5\u4EA7\u7269\u6CA1\u6709\u53EF\u8BFB\u53D6\u7684\u5730\u5740",empty:"\u7A7A\u6587\u4EF6"}:void 0,Rr=H==="zh-CN"?{empty:"\u6682\u65E0\u5BF9\u8BDD\u5185\u5BB9",loading:"\u6B63\u5728\u8BFB\u53D6\u5BF9\u8BDD\u2026",loadEarlier:"\u52A0\u8F7D\u66F4\u65E9\u7684\u5BF9\u8BDD",loadingEarlier:"\u52A0\u8F7D\u4E2D\u2026",retry:"\u91CD\u8BD5",thinking:"\u601D\u8003",input:"\u8F93\u5165",output:"\u8F93\u51FA",showMore:"\u663E\u793A\u5168\u90E8",allowed:"\u5DF2\u5141\u8BB8",denied:"\u5DF2\u62D2\u7EDD",waiting:"\u7B49\u5F85\u56DE\u7B54",plan:"\u8BA1\u5212",you:"\u4F60",agent:"\u667A\u80FD\u4F53"}:void 0;function $n(e,n){let r=hn(n.url);if(r)return r;if(!(!n.sha256||!/^[a-f0-9]{64}$/.test(n.sha256)))return new URL(`/workbench/ui/api/tasks/${encodeURIComponent(e)}/artifacts/${n.sha256}`,location.origin).href}function Fn(e,n){return e.path?.split("/").pop()||(n?decodeURIComponent(new URL(n).pathname.split("/").pop()||""):"")||i("\u4EA7\u7269","Artifact")}function On({jobId:e,artifact:n,active:r,onPreview:o}){let a=$n(e,n),s=Fn(n,a);return a?t("span",{class:"acp-artifact-row",children:[t("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:s}),t("button",{type:"button",class:"acp-link","aria-pressed":r,onClick:()=>o(n),children:r?i("\u9884\u89C8\u4E2D","Previewing"):i("\u9884\u89C8","Preview")})]}):n.path?t("span",{class:"acp-muted",children:[s," \xB7 ",t("code",{children:n.path})]}):null}function Un({jobId:e,artifact:n,onClose:r}){let o=$n(e,n),a=Fn(n,o),s=E(null);return T(()=>{s.current?.focus({preventScroll:!0});let c=l=>{l.key==="Escape"&&(l.stopPropagation(),r())};return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[r]),t("section",{class:"acp-artifact-drawer",role:"dialog","aria-label":a,children:[t("header",{class:"acp-artifact-drawer-header",children:[t("div",{children:[t("strong",{children:a}),n.path&&t("small",{title:n.path,children:n.path})]}),o&&t("a",{class:"acp-button",href:o,target:"_blank",rel:"noopener noreferrer",children:i("\u65B0\u7A97\u53E3\u6253\u5F00","Open in new tab")}),t("button",{type:"button",class:"acp-button",ref:s,onClick:r,children:i("\u5173\u95ED","Close")})]}),t("div",{class:"acp-artifact-drawer-body",children:o?t(ct,{name:a,path:n.path,url:o,mediaType:n.mediaType,diagrams:!1,hideHeader:!0,labels:Nn},o):t("p",{class:"acp-muted",children:i("\u8BE5\u4EA7\u7269\u6CA1\u6709\u53EF\u8BFB\u53D6\u7684\u5730\u5740","This artifact has no readable address")})})]})}function Hn({markdown:e,path:n}){return t(ct,{name:n?.split("/").pop()||"report.md",path:n,content:e,diagrams:!1,hideHeader:!0,labels:Nn})}function Wn({jobId:e,onOpenFile:n}){let r=ne(async(a,s)=>{let c=await O.chat(e,a===void 0?void 0:Number(a),s);return{items:c.items,hasMore:c.hasMore,nextCursor:c.nextCursor}},[e]),o=Ft(r,{pageSize:40});return t("div",{class:"acp-chat",children:t($t,{items:o.items,loading:o.loading,loadingMore:o.loadingMore,hasMore:o.hasMore,error:o.error,onLoadMore:o.loadMore,onRetry:o.reload,diagrams:!1,labels:Rr,onOpenFile:n})})}function ve({source:e,class:n,onOpenFile:r}){let[o,a]=g("");return T(()=>{let s=!0;return he(e).then(c=>s&&a(c)).catch(()=>s&&a("")),()=>{s=!1}},[e]),o?t("div",{class:`fp-md acp-md${n?` ${n}`:""}`,dangerouslySetInnerHTML:{__html:o},onClick:s=>{let c=s.target.closest("a")?.getAttribute("href");!c||/^(https?:|mailto:|#)/i.test(c)||!r||(s.preventDefault(),r(decodeURIComponent(c.split("#")[0]).replace(/:\d+$/,"")))}}):t("p",{class:n,children:e})}var Sr=e=>({pending:i("\u5F85\u56DE\u7B54","Waiting"),answered:i("\u5DF2\u56DE\u7B54","Answered"),cancelled:i("\u5DF2\u53D6\u6D88","Cancelled"),expired:i("\u5DF2\u8FC7\u671F","Expired")})[e]||e;function Pr(e){if(e instanceof V){if(e.code==="expired")return i("\u8FD9\u5219\u8FC7\u7A0B\u8BF7\u6C42\u5DF2\u7ECF\u8FC7\u671F","This process request has expired");if(e.code==="already_decided")return i("\u8FD9\u5219\u8FC7\u7A0B\u8BF7\u6C42\u5DF2\u7ECF\u5904\u7406\u8FC7","This process request was already handled");if(e.code==="idempotency_conflict")return i("\u8FD9\u6B21\u63D0\u4EA4\u548C\u4E0A\u6B21\u8BB0\u5F55\u4E0D\u4E00\u81F4","This submit does not match the recorded answer")}return e instanceof Error?e.message:String(e)}function Er({question:e,value:n,onChange:r}){if(e.options?.length&&e.multiSelect){let o=Array.isArray(n)?n:[];return t("div",{children:e.options.map(a=>t("label",{children:[t("input",{type:"checkbox",checked:o.includes(a.label),onChange:s=>{let c=new Set(o);s.currentTarget.checked?c.add(a.label):c.delete(a.label),r([...c])}}),a.label,a.description&&t("small",{children:a.description})]},a.label))})}return e.options?.length?t("div",{children:e.options.map(o=>t("label",{children:[t("input",{type:"radio",name:e.id,checked:n===o.label,onChange:()=>r(o.label)}),o.label,o.description&&t("small",{children:o.description})]},o.label))}):t("textarea",{value:typeof n=="string"?n:"",onInput:o=>r(o.currentTarget.value)})}function Ot({jobId:e,requests:n,onReload:r}){let o=n??[],[a,s]=g({}),[c,l]=g({}),[d,u]=g(""),[f,p]=g(""),_=E({});if(!o.length)return null;let b=m=>(_.current[m]??=crypto.randomUUID(),_.current[m]),x=async(m,I,w,y=!1)=>{let P=I==="rejected"?c[m.requestId]?.trim():"";u(m.requestId),p("");try{await O.answerProcessRequest(e,m.requestId,{clientRequestId:b(m.requestId),outcome:I,...w?{answers:a[m.requestId]??{}}:{},...P?{note:P}:{},...y?{stopTask:!0}:{}}),r()}catch(j){p(Pr(j))}finally{u("")}};return t("section",{class:"acp-detail-section",children:[t("h3",{children:i("\u8FC7\u7A0B\u8BF7\u6C42","Process requests")}),f&&t("p",{class:"acp-muted",children:f}),o.map(m=>{let I=m.kind!=="question"||(m.questions??[]).every(w=>{let y=a[m.requestId]?.[w.question];return Array.isArray(y)?y.length>0:!!(y&&y.trim())});return t("article",{class:"acp-process-request",children:[t("strong",{children:m.kind==="plan"?i("\u8BA1\u5212\u5BA1\u6279","Plan approval"):m.kind==="permission"?i("\u5DE5\u5177\u5BA1\u6279","Tool approval"):i("\u63D0\u95EE","Question")}),t("small",{children:[i("\u622A\u6B62","Deadline")," ",new Date(m.deadlineAt).toLocaleString()]}),m.planContent&&t(ve,{source:m.planContent}),m.kind==="permission"&&t(C,{children:[t("p",{children:m.toolTitle}),m.toolDetail&&t("pre",{class:"acp-tool-detail",children:m.toolDetail})]}),m.questions?.map(w=>t(C,{children:[t("p",{children:[w.header?`${w.header} \xB7 `:"",w.question]}),m.canAnswer&&t(Er,{question:w,value:a[m.requestId]?.[w.question],onChange:y=>s(P=>({...P,[m.requestId]:{...P[m.requestId],[w.question]:y}}))})]},w.id)),m.canAnswer&&m.kind==="question"&&t("div",{class:"acp-agent-actions",children:[t("button",{type:"button",class:"acp-button",disabled:d===m.requestId||!I,onClick:()=>{x(m,"accepted",!0)},children:i("\u63D0\u4EA4\u56DE\u7B54","Submit answer")}),t("button",{type:"button",class:"acp-button",disabled:d===m.requestId,onClick:()=>{x(m,"cancelled",!1)},children:i("\u53D6\u6D88\u8FD9\u6B21\u63D0\u95EE","Cancel question")})]}),m.canAnswer&&m.kind!=="question"&&t("textarea",{class:"acp-reject-note",maxLength:2e3,placeholder:i("\u62D2\u7EDD\u7406\u7531\uFF08\u53EF\u9009\uFF09","Reason for rejecting (optional)"),value:c[m.requestId]??"",onInput:w=>{let y=w.currentTarget.value;l(P=>({...P,[m.requestId]:y}))}}),m.canAnswer&&m.kind==="plan"&&t("div",{class:"acp-agent-actions",children:[t("button",{type:"button",class:"acp-button",disabled:d===m.requestId,onClick:()=>{x(m,"approved",!1)},children:i("\u6279\u51C6\u8BA1\u5212","Approve plan")}),t("button",{type:"button",class:"acp-button",disabled:d===m.requestId,onClick:()=>{x(m,"rejected",!1)},children:i("\u9000\u56DE\u8BA1\u5212","Reject plan")}),t("button",{type:"button",class:"acp-button",disabled:d===m.requestId,onClick:()=>{x(m,"abandoned",!1)},children:i("\u653E\u5F03","Abandon")})]}),m.canAnswer&&m.kind==="permission"&&t("div",{class:"acp-agent-actions",children:[t("button",{type:"button",class:"acp-button acp-primary",disabled:d===m.requestId,onClick:()=>{x(m,"approved",!1)},children:i("\u5141\u8BB8\u672C\u6B21","Allow once")}),t("button",{type:"button",class:"acp-button",disabled:d===m.requestId,onClick:()=>{x(m,"rejected",!1)},children:i("\u62D2\u7EDD\u8FD9\u6B21\u8C03\u7528","Reject this call")}),t("button",{type:"button",class:"acp-button acp-danger",title:i("\u62D2\u7EDD\u5E76\u53D6\u6D88\u6574\u4E2A\u4EFB\u52A1\uFF0CAgent \u4E0D\u4F1A\u518D\u6362\u65B9\u5F0F\u91CD\u8BD5","Reject and cancel the task so the agent cannot retry another way"),disabled:d===m.requestId,onClick:()=>{x(m,"rejected",!1,!0)},children:i("\u62D2\u7EDD\u5E76\u505C\u6B62\u4EFB\u52A1","Reject and stop task")}),t("button",{type:"button",class:"acp-button",disabled:d===m.requestId,onClick:()=>{x(m,"cancelled",!1)},children:i("\u53D6\u6D88","Cancel")})]}),!m.canAnswer&&t("small",{children:[Sr(m.status),m.kind==="permission"&&m.answer?.outcome==="approved"&&` \xB7 ${i("\u5DF2\u5141\u8BB8","Allowed")}`,m.kind==="permission"&&m.answer?.outcome==="rejected"&&` \xB7 ${m.answer.stopTask?i("\u5DF2\u62D2\u7EDD\u5E76\u505C\u6B62\u4EFB\u52A1","Rejected and stopped the task"):i("\u5DF2\u62D2\u7EDD","Rejected")}`,m.answer?.decidedBy?.kind==="coach"&&` \xB7 ${i("\u6559\u7EC3\u51B3\u5B9A","Decided by the coach")}`,m.answer?.note&&` \xB7 ${m.answer.note}`]})]},m.requestId)})]})}var Fe=e=>e instanceof Error?e.message:String(e),jr="\u4E0A\u4E00\u8F6E\u6267\u884C\u4E2D\u65AD\u4E86\uFF0C\u5DF2\u7ECF\u5B8C\u6210\u7684\u4E0D\u7528\u91CD\u505A\uFF0C\u8BF7\u63A5\u7740\u628A\u4EFB\u52A1\u505A\u5B8C\u3002",Mr=window.parent!==window;function Dr({detail:e}){let n=e.attempts.find(c=>c.attemptId===e.currentAttemptId)?.backendRunRef?.taskId,[r,o]=g(null);T(()=>{if(o(null),!Mr||!n)return;let c=!0;return O.dshSession(n).then(l=>c&&o(l),()=>c&&o(null)),()=>{c=!1}},[n,e.executionStatus]);let a=r?.available?r.sessionId:void 0;if(!a)return null;let s=r.task?.running===!0;return t("button",{type:"button",class:"acp-button acp-primary",disabled:s,title:s?i("A2A \u4EFB\u52A1\u4ECD\u5728\u6267\u884C\uFF0C\u7ED3\u675F\u540E\u53EF\u63A5\u7BA1","The A2A task is still running; take over once it ends"):i("\u5728 DSH \u4F1A\u8BDD\u4E2D\u7EE7\u7EED\u5904\u7406\uFF1B\u6EE1\u610F\u540E\u8BA9\u667A\u80FD\u4F53\u8C03\u7528 submit_to_review \u63D0\u4EA4\u56DE\u5DE5\u4F5C\u6D41","Continue in the DSH session; when satisfied, have the agent call submit_to_review"),onClick:()=>window.parent.postMessage({type:"1agents:open-session",sessionId:a},location.origin),children:s?i("\u6267\u884C\u4E2D\u2026","Running\u2026"):i("\u5728 DSH \u4E2D\u63A5\u7BA1","Take over in DSH")})}function Lr({execution:e}){let n=le(e,H);return t("small",{class:"acp-execution-caption",children:[t("span",{children:[n.mode," \xB7 ",n.role]}),t("span",{children:t(Ce,{execution:e})})]})}function Nr({execution:e}){let n=le(e,H);return t(C,{children:[t("span",{children:[i("\u4EFB\u52A1\u65B9\u5F0F","Task mode"),t("strong",{children:n.mode})]}),t("span",{children:[i("\u89D2\u8272\u6216\u9884\u8BBE","Role / preset"),t("strong",{children:t(De,{execution:e})})]}),t("span",{children:[i("\u6267\u884C\u670D\u52A1","Execution service"),t("strong",{children:t(Ce,{execution:e})})]})]})}function Bn({jobId:e,requestedReviewId:n,full:r,onChanged:o}){let[a,s]=g(null),[c,l]=g(""),[d,u]=g(!1),[f,p]=g(!0),[_,b]=g(n?"review":"overview"),[x,m]=g(n),[I,w]=g(""),[y,P]=g(!1),[j,h]=g(""),[N,U]=g(""),[K,$]=g(!1),[q,_e]=g(),[Re,Se]=g(!1),[X,Z]=g(null),[de,oe]=g(!1),[ue,be]=g(""),ye=ne(()=>_e(void 0),[]),Y=E(null),M=E(!0),se=E(!1),pe=E(null),R=a?.reviews.find(k=>k.reviewId===x),ae=At(a?.reviews||[]),W=ne(async()=>{if(!se.current){se.current=!0;try{let k=await O.get(e);if(!M.current)return;s(k),l(""),m(z=>z||n||k.pendingReviewId||At(k.reviews)?.reviewId)}catch(k){M.current&&l(Fe(k))}finally{M.current&&(p(!1),se.current=!1)}}},[e]),we=async()=>{Se(!0);try{let k=await O.refresh(e);if(!M.current)return;s(k),l(""),o()}catch(k){M.current&&l(Fe(k))}finally{M.current&&Se(!1)}},ke=async()=>{u(!0),l("");try{let k=await O.accept(e);if(!M.current)return;s(k),o()}catch(k){M.current&&l(Fe(k))}finally{M.current&&u(!1)}},Ae=async()=>{oe(!0),be("");try{let k=await O.continueTask(e,X??"");if(!M.current)return;s(k),Z(null),o()}catch(k){M.current&&be(Fe(k))}finally{M.current&&oe(!1)}};T(()=>{M.current=!0,W();let k=window.setInterval(()=>{document.hidden||W()},5e3);return()=>{M.current=!1,window.clearInterval(k)}},[W]),T(()=>{n&&(m(n),b("review"),U(""),w(""))},[n]),T(()=>{a&&pe.current?.focus()},[!!a]),T(()=>_e(void 0),[e]);let ee=k=>{m(k),b("review"),U(""),h(""),w(""),B({jobId:e,reviewId:k,full:r})},fe=k=>{let z=(a?.artifacts||[]).flatMap(Q=>Q.artifacts).find(Q=>typeof Q=="object"&&Q.path===k);z&&_e(z)},me=async k=>{if(!R||y||R.status!=="pending"||!R.canReview)return;if((k==="changes_requested"||k==="comment")&&!I.trim()){U(i("\u8BF7\u586B\u5199\u5177\u4F53\u610F\u89C1\u3002","Please enter feedback."));return}let z=JSON.stringify([R.reviewId,R.revision,R.digest,k,I.trim()]);Y.current?.key!==z&&(Y.current={key:z,id:crypto.randomUUID()});let Q={action:k,revision:R.revision,digest:R.digest,clientRequestId:Y.current.id,...I.trim()?{note:I.trim()}:{}};P(!0),U(""),h("");try{if(await O.decide(R.jobId||e,R.reviewId,Q),!M.current)return;w(""),$(!1),Y.current=null,h(k==="comment"?i("\u8BC4\u8BBA\u5DF2\u4FDD\u5B58\uFF0C\u5BA1\u6838\u4ECD\u5F85\u786E\u8BA4\u3002","Comment saved. Review remains pending."):i("\u51B3\u5B9A\u5DF2\u4FDD\u5B58\uFF0C\u6B63\u5728\u540C\u6B65\u4EFB\u52A1\u8FDB\u5C55\u3002","Decision saved. Synchronizing task progress.")),await W(),o()}catch(A){if(!M.current)return;U(A instanceof V&&A.status===403&&/browser_review_required|same.origin|browser/i.test(A.message)?i("\u5F53\u524D\u8FDE\u63A5\u4E0D\u80FD\u63D0\u4EA4\u4EBA\u5DE5\u51B3\u5B9A\u3002\u8BF7\u5728\u4EFB\u52A1\u6240\u5728\u8282\u70B9\u7684 Web \u9875\u9762\u767B\u5F55\u540E\u5904\u7406\u5BA1\u6838\u3002","This connection cannot submit human decisions. Open the node\u2019s web page and sign in to review."):A instanceof V&&A.status===409?i("\u7248\u672C\u6216\u5BA1\u6838\u72B6\u6001\u5DF2\u7ECF\u53D8\u5316\u3002\u8BF7\u6838\u5BF9\u5F53\u524D\u72B6\u6001\uFF1B\u65E7\u7248\u672C\u7684\u51B3\u5B9A\u4E0D\u4F1A\u653E\u884C\u65B0\u7248\u3002","The version or review state changed. Check the latest state before deciding."):Fe(A)),A instanceof V&&A.status===409&&await W()}finally{M.current&&P(!1)}},Oe=async()=>{let k=new URL(window.location.href);k.hash=rt({jobId:e,reviewId:_==="review"?x:void 0,full:!0});try{await navigator.clipboard.writeText(k.href),h(i("\u4EFB\u52A1\u94FE\u63A5\u5DF2\u590D\u5236","Task link copied"))}catch{h(i("\u65E0\u6CD5\u590D\u5236\u94FE\u63A5\uFF0C\u53EF\u590D\u5236\u5730\u5740\u680F\u94FE\u63A5","Could not copy. Copy the address bar URL."))}},Ue=[["overview",i("\u6982\u89C8","Overview")],["progress",i("\u8FDB\u5C55","Progress")],["review",i("\u4EA7\u7269\u4E0E\u5BA1\u6838","Artifacts & review")],["chat",i("\u5BF9\u8BDD","Conversation")],["events",i("\u4E8B\u4EF6\u8BB0\u5F55","Events")]];return t("aside",{class:"acp-detail","aria-label":i("\u4EFB\u52A1\u8BE6\u60C5","Task details"),children:[t("header",{class:"acp-detail-header",children:[t("div",{class:"acp-detail-tools",children:[t("span",{children:i("\u4EFB\u52A1\u8BE6\u60C5","Task details")}),t("div",{children:[a&&t(Dr,{detail:a}),a&&(a.displayStatus==="unwatched"||a.stale)&&t("button",{type:"button",class:"acp-button",disabled:Re,onClick:we,children:Re?i("\u6B63\u5728\u67E5\u8BE2\u2026","Querying\u2026"):i("\u91CD\u65B0\u67E5\u8BE2","Query again")}),a?.canAccept&&t("button",{type:"button",class:"acp-button acp-primary",disabled:d,onClick:()=>{ke()},children:i("\u5DF2\u9605","Mark as read")}),a?.canContinue&&X===null&&t("button",{type:"button",class:"acp-button acp-primary",onClick:()=>{be(""),Z(jr)},children:i("\u7EE7\u7EED","Continue")}),t("button",{type:"button",class:"acp-button",onClick:Oe,children:i("\u590D\u5236\u94FE\u63A5","Copy link")}),t("button",{type:"button",class:"acp-button",onClick:()=>B({jobId:e,reviewId:n,full:!r}),children:r?i("\u8FD4\u56DE\u8868\u683C","Back to table"):i("\u5C55\u5F00\u6574\u9875","Full page")}),t("button",{type:"button",class:"acp-button",onClick:()=>B({full:!1}),children:i("\u5173\u95ED","Close")})]})]}),t("div",{class:"acp-breadcrumb",children:[a?.ancestors?.map(k=>t(C,{children:[t("button",{type:"button",class:"acp-link",onClick:()=>B({jobId:k.jobId,full:r}),children:ge(k)}),t("span",{children:"\u203A"})]},k.jobId)),t("span",{children:e})]}),t("h2",{ref:pe,tabIndex:-1,children:a?ge(a):i("\u6B63\u5728\u8BFB\u53D6\u4EFB\u52A1\u2026","Loading task\u2026")}),a&&t("p",{class:"acp-channel-line",children:[t(re,{value:st(a)}),t("span",{class:"acp-mode-label",children:ot(a.channel)}),a.agentName&&t("span",{children:a.agentName}),a.stale&&t("span",{class:"acp-stale",children:i("\u5F53\u524D\u4E3A\u7F13\u5B58\u72B6\u6001\uFF0C\u7B49\u5F85\u540C\u6B65","Cached status; awaiting synchronization")})]}),a?.pendingProcessRequestId&&_!=="overview"&&t("button",{type:"button",class:"acp-link",onClick:()=>b("overview"),children:i("\u6709\u8FC7\u7A0B\u8BF7\u6C42\u5F85\u56DE\u7B54","A process request is waiting")})]}),t("nav",{class:"acp-detail-tabs","aria-label":i("\u4EFB\u52A1\u8BE6\u60C5\u89C6\u56FE","Task detail views"),role:"tablist",children:Ue.map(([k,z])=>t("button",{id:`acp-detail-tab-${k}`,type:"button",role:"tab","aria-selected":_===k,"aria-controls":"acp-detail-content",onClick:()=>b(k),children:z},k))}),t("div",{class:"acp-detail-content",id:"acp-detail-content",role:"tabpanel","aria-labelledby":`acp-detail-tab-${_}`,children:[c&&t(Te,{title:i("\u4EFB\u52A1\u8BE6\u60C5\u8BFB\u53D6\u5931\u8D25","Could not load task details"),message:c,onRetry:()=>{W()}}),f&&t("p",{class:"acp-muted",children:i("\u6B63\u5728\u8F7D\u5165\u2026","Loading\u2026")}),a?.canContinue&&X!==null&&t("div",{class:"acp-review-form",children:[t("label",{htmlFor:"acp-continue-prompt",children:i("\u5728\u539F\u4F1A\u8BDD\u91CC\u65B0\u5F00\u4E00\u8F6E\uFF0C\u53D1\u7ED9\u6267\u884C\u8005\u7684\u8BDD","Message for a new round in the same session")}),t("textarea",{id:"acp-continue-prompt",value:X,disabled:de,onInput:k=>Z(k.currentTarget.value)}),ue&&t("p",{role:"alert",class:"acp-decision-error",children:ue}),t("div",{class:"acp-review-buttons",children:[t("button",{type:"button",class:"acp-button acp-primary",disabled:de||!X.trim(),onClick:()=>{Ae()},children:de?i("\u6B63\u5728\u63D0\u4EA4\u2026","Submitting\u2026"):i("\u63D0\u4EA4\u5E76\u7EE7\u7EED","Submit and continue")}),t("button",{type:"button",class:"acp-link",disabled:de,onClick:()=>Z(null),children:i("\u53D6\u6D88","Cancel")})]})]}),a&&t(C,{children:[_==="overview"&&t(Fr,{detail:a,onReview:k=>ee(k),onReload:()=>{W()},onOpenFile:fe}),_==="progress"&&t(Or,{detail:a,onReview:k=>ee(k),onReload:()=>{W()},full:r}),_==="review"&&t(C,{children:[t(Hr,{detail:a,review:R,requestedReviewId:x,onSelect:ee,previewing:q,onPreview:_e}),R&&t(C,{children:[ae&&ae.reviewId!==R.reviewId&&t("div",{class:"acp-notice",children:[i("\u6B63\u5728\u67E5\u770B\u5386\u53F2\u7248\u672C\u3002","Viewing a historical version.")," ",t("button",{type:"button",class:"acp-link",onClick:()=>ee(ae.reviewId),children:i("\u67E5\u770B\u6700\u65B0\u7248\u672C \u2192","View latest version \u2192")})]}),R.status==="approved"&&!["completed","failed","canceled","rejected"].includes(a.executionStatus)&&R.resumeStatus==="pending"&&t("div",{class:"acp-notice",role:"status",children:i("\u672C\u7248\u5DF2\u901A\u8FC7\uFF0C\u7B49\u5F85\u7CFB\u7EDF\u7EE7\u7EED\u5904\u7406\u3002","This version is approved. Waiting for the workflow to resume.")}),R.resumeError&&t("p",{role:"alert",class:"acp-decision-error",children:R.resumeError}),t(Wr,{review:R}),R.status==="pending"&&R.canReview&&t("div",{class:"acp-review-form",children:[t("label",{htmlFor:"acp-review-feedback",children:i("\u5BA1\u6838\u610F\u89C1","Review feedback")}),t("textarea",{id:"acp-review-feedback",value:I,disabled:y,onInput:k=>w(k.currentTarget.value),placeholder:i("\u53EF\u6CE8\u660E\u5177\u4F53\u9875\u7801\uFF1B\u8981\u6C42\u4FEE\u6539\u65F6\u8BF7\u586B\u5199\u610F\u89C1\u3002","Reference page numbers. Feedback is required when requesting changes.")}),t("div",{class:"acp-review-buttons",children:[t("button",{type:"button",class:"acp-link",disabled:y,onClick:()=>{me("comment")},children:i("\u53D1\u8868\u8BC4\u8BBA","Comment")}),t("button",{type:"button",class:"acp-button",disabled:y,onClick:()=>B({full:!1}),children:i("\u7A0D\u540E\u5904\u7406","Later")}),t("button",{type:"button",class:"acp-button",disabled:y,onClick:()=>{me("changes_requested")},children:i("\u8981\u6C42\u4FEE\u6539","Request changes")}),t("button",{type:"button",class:"acp-button acp-primary",disabled:y,onClick:()=>{me("approve")},children:y?i("\u6B63\u5728\u63D0\u4EA4\u2026","Submitting\u2026"):i(`\u901A\u8FC7 ${R.revision}`,`Approve ${R.revision}`)})]}),t("details",{class:"acp-more-actions",children:[t("summary",{children:i("\u66F4\u591A\u64CD\u4F5C","More actions")}),K?t("div",{class:"acp-cancel-confirm",children:[t("p",{children:i("\u653E\u5F03\u5C06\u7EC8\u6B62\u5F53\u524D\u5DE5\u4F5C\u6D41\uFF0C\u5DF2\u6709\u4EA7\u7269\u4E0E\u5386\u53F2\u4FDD\u7559\u3002","Abandoning ends this workflow and retains existing artifacts and history.")}),t("button",{type:"button",class:"acp-button",disabled:y,onClick:()=>$(!1),children:i("\u7EE7\u7EED\u4FDD\u7559","Keep task")}),t("button",{type:"button",class:"acp-button acp-danger",disabled:y,onClick:()=>{me("cancel")},children:i("\u786E\u8BA4\u653E\u5F03\u4EFB\u52A1","Confirm abandon")})]}):t("button",{type:"button",class:"acp-link",onClick:()=>$(!0),children:i("\u653E\u5F03\u4EFB\u52A1","Abandon task")})]})]}),R.status==="pending"&&!R.canReview&&t("p",{class:"acp-muted",children:i("\u6B64\u5BA1\u6838\u672A\u5206\u914D\u7ED9\u5F53\u524D\u7528\u6237\u3002","This review is not assigned to the current user.")})]}),j&&t("p",{class:"acp-decision-message",role:"status",children:j}),N&&t("p",{class:"acp-decision-error",role:"alert",children:N})]}),_==="chat"&&t(Wn,{jobId:e,onOpenFile:fe}),_==="events"&&t(C,{children:[t(Ur,{detail:a}),t(Br,{detail:a})]})]})]}),q&&t(Un,{jobId:e,artifact:q,onClose:ye})]})}function $r({detail:e}){let n=e.businessAcceptance;return n?t("section",{class:"acp-detail-section",children:[t("h3",{children:i("\u4E1A\u52A1\u9A8C\u6536","Business acceptance")}),t("dl",{class:"acp-acceptance-record",children:[t("dt",{children:i("\u7ED3\u679C\u7248\u672C","Result revision")}),t("dd",{children:n.resultRevision}),t("dt",{children:i("\u8BB0\u5F55\u65F6\u95F4","Recorded")}),t("dd",{children:J(n.recordedAt)}),n.decidedBy&&t(C,{children:[t("dt",{children:i("\u5904\u7406\u4EBA","Decided by")}),t("dd",{children:n.decidedBy.kind==="coach"?i("\u6559\u7EC3","Coach"):i("\u4EBA","Person")})]}),n.note&&t(C,{children:[t("dt",{children:i("\u8BF4\u660E","Note")}),t("dd",{children:n.note})]})]})]}):null}function Fr({detail:e,onReview:n,onReload:r,onOpenFile:o}){let s=e.attempts.find(c=>c.attemptId===e.currentAttemptId)?.result?.resultSummary;return t(C,{children:[t(Ot,{jobId:e.jobId,requests:e.processRequests?.filter(c=>c.status==="pending"),onReload:r}),e.executionStatus==="completed"&&t($r,{detail:e}),e.pendingReviewId&&t("p",{class:"acp-notice",children:[i("\u6709\u4EA7\u7269\u7B49\u5F85\u4F60\u5BA1\u6838\u3002","An artifact is waiting for your review.")," ",t("button",{type:"button",class:"acp-link",onClick:()=>n(e.pendingReviewId),children:i("\u53BB\u5BA1\u6838","Review")})]}),e.description&&t("section",{class:"acp-detail-section",children:[t("h3",{children:i("\u4EFB\u52A1\u63CF\u8FF0","Task description")}),t(ve,{source:e.description,onOpenFile:o})]}),s?t("section",{class:"acp-detail-section",children:[t("h3",{children:i("\u6700\u65B0\u56DE\u7B54","Latest answer")}),t(ve,{source:s,onOpenFile:o})]}):e.progressSummary&&t("section",{class:"acp-detail-section",children:[t("h3",{children:i("\u5F53\u524D\u8FDB\u5C55","Current progress")}),t(ve,{source:e.progressSummary,onOpenFile:o})]}),t("div",{class:"acp-task-facts",children:[t("span",{children:[i("\u521B\u5EFA","Created"),t("strong",{children:J(e.createdAt)})]}),t("span",{children:[i("\u6700\u8FD1\u66F4\u65B0","Last updated"),t("strong",{children:J(e.updatedAt)})]}),e.progress?.executionElapsedMs!==void 0&&t("span",{children:[i("\u5B9E\u9645\u6267\u884C","Execution time"),t("strong",{children:Tt(e.progress.executionElapsedMs)})]}),e.progress?.humanWaitingMs!==void 0&&t("span",{children:[i("\u4EBA\u5DE5\u7B49\u5F85","Human wait"),t("strong",{children:Tt(e.progress.humanWaitingMs)})]})]})]})}function Or({detail:e,onReview:n,onReload:r,full:o}){let a=e.progress?.stages||[];return t(C,{children:[t(Ot,{jobId:e.jobId,requests:e.processRequests?.filter(s=>s.status!=="pending"),onReload:r}),a.length>0&&t("section",{class:"acp-detail-section",children:[t("h3",{children:i("\u9636\u6BB5\u8FDB\u5C55","Stage progress")}),t("ol",{class:"acp-stage-list",children:a.map(s=>t("li",{children:[t("span",{class:`acp-stage-dot acp-stage-dot-${s.status}`,"aria-hidden":"true",children:s.status==="completed"||s.status==="approved"?"\u2713":"\u2022"}),t("div",{children:[t("strong",{children:s.name}),t("small",{children:s.planned?i("\u8BA1\u5212\u9636\u6BB5 \xB7 \u5C1A\u672A\u521B\u5EFA\u6267\u884C\u4EFB\u52A1","Planned stage \xB7 no execution task yet"):s.jobId?t("button",{type:"button",class:"acp-link",onClick:()=>B({jobId:s.jobId,full:o}),children:i("\u67E5\u770B\u6267\u884C\u4EFB\u52A1","Open execution task")}):""})]}),s.stage==="human_review"&&e.pendingReviewId?t("button",{type:"button",class:"acp-link",onClick:()=>n(e.pendingReviewId),children:t(re,{value:s.status})}):t(re,{value:s.status})]},s.stage))})]}),t("section",{class:"acp-detail-section",children:[t("h3",{children:i("\u6267\u884C\u8F6E\u6B21","Execution attempts")}),e.attempts.length?[...e.attempts].reverse().map((s,c)=>t("details",{class:"acp-attempt",open:c===0,children:[t("summary",{children:[t("span",{children:[s.attemptId===e.currentAttemptId?i("\u5F53\u524D\u6267\u884C","Current attempt"):i("\u5386\u53F2\u6267\u884C","Past attempt")," ","\xB7 ",J(s.createdAt||s.updatedAt)]}),t(re,{value:s.executionStatus})]}),s.stale&&t("p",{class:"acp-stale",children:i("\u6B64\u8F6E\u72B6\u6001\u5F85\u6838\u5B9E\uFF1B\u5386\u53F2\u5728\u9014\u6267\u884C\u4E0D\u4F1A\u88AB\u9690\u85CF\u3002","This attempt needs verification; unresolved prior work remains visible.")}),s.diagnostic&&t("p",{class:"acp-decision-error",children:s.diagnostic}),s.attemptId!==e.currentAttemptId&&s.result?.resultSummary&&t("div",{class:"acp-result-summary",children:t(ve,{source:s.result.resultSummary})})]},s.attemptId)):t("p",{class:"acp-muted",children:i("\u6682\u65E0\u6267\u884C\u8BB0\u5F55","No execution attempts")})]}),t("section",{class:"acp-detail-section",children:[t("h3",{children:i("\u76F4\u63A5\u5B50\u4EFB\u52A1","Direct subtasks")}),e.children.length?e.children.map(s=>t("button",{type:"button",class:"acp-child-task",onClick:()=>B({jobId:s.jobId,full:o}),children:[t("span",{children:[ge(s),t(Lr,{execution:s.execution})]}),t(re,{value:Ct(s)})]},s.jobId)):t("p",{class:"acp-muted",children:i("\u5F53\u524D\u6CA1\u6709\u5DF2\u521B\u5EFA\u7684\u5B50\u4EFB\u52A1","No subtasks have been created")})]})]})}function Ur({detail:e}){return t(C,{children:t("section",{class:"acp-detail-section",children:[t("h3",{children:i("\u6267\u884C\u4FE1\u606F","Execution details")}),t("div",{class:"acp-task-facts",children:t(Nr,{execution:e.execution})}),[...e.attempts].reverse().map(n=>{let r=le(n.execution,H);return t("details",{class:"acp-attempt",children:[t("summary",{children:t("span",{children:[n.attemptId===e.currentAttemptId?i("\u5F53\u524D\u6267\u884C","Current attempt"):i("\u5386\u53F2\u6267\u884C","Past attempt")," ","\xB7 ",n.attemptId]})}),t("dl",{children:[t("dt",{children:i("\u4EFB\u52A1\u65B9\u5F0F","Task mode")}),t("dd",{children:r.mode}),t("dt",{children:i("\u89D2\u8272\u6216\u9884\u8BBE","Role / preset")}),t("dd",{children:t(De,{execution:n.execution})}),t("dt",{children:i("\u6267\u884C\u670D\u52A1","Execution service")}),t("dd",{children:t(Ce,{execution:n.execution})}),t(Rt,{execution:n.execution}),t("dt",{children:i("\u539F\u59CB\u76EE\u6807 ID","Raw target ID")}),t("dd",{children:n.execution?.targetId||n.targetId||i("\u672A\u8BB0\u5F55","Not recorded")}),t("dt",{children:i("\u66F4\u65B0\u65F6\u95F4","Updated")}),t("dd",{children:J(n.updatedAt)}),n.previousAttemptId&&t(C,{children:[t("dt",{children:i("\u63A5\u7EED\u6267\u884C","Continues attempt")}),t("dd",{children:n.previousAttemptId})]})]})]},n.attemptId)}),t("details",{class:"acp-context",children:[t("summary",{children:i("\u4EFB\u52A1\u6765\u6E90","Task source")}),t("dl",{children:[t(Rt,{execution:e.execution}),t("dt",{children:i("\u539F\u59CB\u76EE\u6807 ID","Raw target ID")}),t("dd",{children:e.execution?.targetId||e.targetId}),e.execution?.roleId&&t(C,{children:[t("dt",{children:i("\u89D2\u8272 ID","Role ID")}),t("dd",{children:e.execution.roleId})]}),e.execution?.agentPreset&&t(C,{children:[t("dt",{children:i("\u8BB0\u5F55\u7684\u9884\u8BBE","Recorded preset")}),t("dd",{children:e.execution.agentPreset})]}),e.execution?.connectionId&&t(C,{children:[t("dt",{children:i("\u8FDE\u63A5 ID","Connection ID")}),t("dd",{children:e.execution.connectionId})]}),e.execution?.provider&&t(C,{children:[t("dt",{children:i("\u6267\u884C\u540E\u7AEF","Execution backend")}),t("dd",{children:e.execution.provider})]}),t("dt",{children:i("\u6765\u6E90\u4F1A\u8BDD","Origin session")}),t("dd",{children:e.originSessionId}),t("dt",{children:i("\u4EFB\u52A1\u8D26\u672C","Ledger source")}),t("dd",{children:e.sourceId}),e.parentAttemptId&&t(C,{children:[t("dt",{children:i("\u6240\u5C5E\u7236\u6267\u884C\u8F6E\u6B21","Parent attempt")}),t("dd",{children:e.parentAttemptId})]})]})]})]})})}function Hr({detail:e,review:n,requestedReviewId:r,onSelect:o,previewing:a,onPreview:s}){let c=[...e.progress?.availableResults||[]];for(let l of e.artifacts||[])c.some(d=>d.revision===l.revision)||c.push({revision:l.revision,artifacts:l.artifacts.map(d=>typeof d=="string"?{url:d}:d),deliveryReady:e.executionStatus==="completed"});return t(C,{children:[c.length>0&&t("section",{class:"acp-detail-section",children:[t("h3",{children:i("\u5DF2\u6709\u4EA7\u7269","Available artifacts")}),c.map(l=>t("div",{class:"acp-artifact-group",children:[t("strong",{children:[l.revision," \xB7"," ",l.deliveryReady?i("\u6700\u7EC8\u4EA4\u4ED8","Final delivery"):i("\u5236\u4F5C\u7A3F","Draft")]}),l.artifacts.map((d,u)=>t(On,{jobId:e.jobId,artifact:d,active:!!a&&(a.url||a.path)===(d.url||d.path),onPreview:s},`${d.url||d.path}:${u}`))]},l.revision))]}),c.length===0&&t("section",{class:"acp-detail-section",children:[t("h3",{children:i("\u5DF2\u6709\u4EA7\u7269","Available artifacts")}),t("p",{class:"acp-muted",children:i("\u8FD9\u4E2A\u4EFB\u52A1\u8FD8\u6CA1\u6709\u767B\u8BB0\u4EA7\u7269\u3002\u4EA7\u7269\u4E0D\u4F1A\u4ECE\u5BF9\u8BDD\u5185\u5BB9\u91CC\u63A8\u65AD\uFF1A\u667A\u80FD\u4F53\u9700\u8981\u6309\u4EFB\u52A1\u8981\u6C42\u628A\u6587\u4EF6\u5199\u5230\u6307\u5B9A\u7684\u4EFB\u52A1\u76EE\u5F55\uFF0C\u5E76\u767B\u8BB0\u5230\u4EA7\u7269\u6E05\u5355\uFF0C\u6267\u884C\u7AEF\u6821\u9A8C\u901A\u8FC7\u540E\u624D\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002","No artifacts are registered for this task. They are never inferred from the conversation: the agent must write files to the task directory and list them in the artifact manifest, and the executor verifies them before they appear here.")})]}),e.reviews.length>0?t(C,{children:[t("div",{class:"acp-review-heading",children:[t("h3",{children:i("\u9636\u6BB5\u4EA7\u7269\u5BA1\u6838","Stage artifact review")}),t("label",{children:[i("\u7248\u672C","Version"),t("select",{value:n?.reviewId||r||"",onChange:l=>o(l.currentTarget.value),children:[r&&!n&&t("option",{value:r,children:i("\u672A\u627E\u5230\u8BF7\u6C42\u7684\u7248\u672C","Requested version unavailable")}),[...e.reviews].reverse().map(l=>t("option",{value:l.reviewId,children:[l.revision," \xB7 ",xt(l.status)]},l.reviewId))]})]})]}),n?t(C,{children:[t("div",{class:"acp-review-version",children:[t(re,{value:n.status}),t("span",{children:n.revision}),t("span",{children:J(n.createdAt)})]}),t("h3",{children:n.preview.title||n.title}),n.preview.kind==="markdown"&&t("section",{class:"acp-report-preview",children:[t("p",{class:"acp-muted",children:[i("\u62A5\u544A\u6587\u4EF6\uFF1A","Report file: "),t("code",{children:n.preview.reportPath})]}),t(Hn,{markdown:n.preview.markdown||"",path:n.preview.reportPath})]}),n.preview.slides.map((l,d)=>t("section",{class:"acp-script-slide",children:[t("h4",{children:[t("span",{children:String(d+1).padStart(2,"0")}),l.title]}),t("p",{class:"acp-slide-message",children:l.message}),t("ul",{children:l.body.map((u,f)=>t("li",{children:u},f))}),l.visual&&t("p",{children:[t("span",{class:"acp-muted",children:i("\u753B\u9762\u5EFA\u8BAE\uFF1A","Visual: ")}),l.visual]}),l.notes&&t("p",{children:l.notes}),t("details",{class:"acp-slide-sources",children:[t("summary",{children:i("\u4E8B\u5B9E\u4E0E\u7D20\u6750\u4F9D\u636E","Facts and sources")}),l.facts.length>0&&t("ul",{children:l.facts.map((u,f)=>t("li",{children:u},f))}),t("ul",{children:l.sources.map((u,f)=>t("li",{children:t("code",{children:u})},f))})]})]},`${n.reviewId}:${d}`)),t("details",{class:"acp-context",children:[t("summary",{children:i("\u5BA1\u6838\u7248\u672C\u6807\u8BC6","Review version reference")}),t("dl",{children:[t("dt",{children:i("\u5185\u5BB9\u6458\u8981","Content digest")}),t("dd",{children:t("code",{children:n.digest})}),t("dt",{children:i("\u4F5C\u8005\u6267\u884C\u8F6E\u6B21","Author attempt")}),t("dd",{children:n.authorAttemptId||n.attemptId})]})]})]}):t("p",{class:"acp-decision-error",children:i("\u627E\u4E0D\u5230\u94FE\u63A5\u5BF9\u5E94\u7684\u5BA1\u6838\u7248\u672C\uFF0C\u8BF7\u9009\u62E9\u53EF\u7528\u7248\u672C\u3002","The linked review version is unavailable. Select an available version.")})]}):t(at,{title:i("\u5F53\u524D\u6CA1\u6709\u9636\u6BB5\u5BA1\u6838","No stage review"),description:e.parentJobRef?i("\u53EF\u4EE5\u8FD4\u56DE\u7236\u4EFB\u52A1\u67E5\u770B\u5B8C\u6574\u4EA4\u4ED8\u4E0E\u5BA1\u6838\u3002","Open the parent task to see workflow reviews."):i("\u4EA7\u7269\u5F62\u6210\u540E\uFF0C\u4F1A\u5728\u8FD9\u91CC\u5C55\u793A\u53EF\u786E\u8BA4\u7684\u7248\u672C\u3002","Reviewable versions appear here once artifacts are ready.")})]})}function Wr({review:e}){let n={comment:i("\u53D1\u8868\u8BC4\u8BBA","Commented"),approve:i("\u901A\u8FC7","Approved"),changes_requested:i("\u8981\u6C42\u4FEE\u6539","Requested changes"),cancel:i("\u653E\u5F03\u4EFB\u52A1","Abandoned task")};return t("section",{class:"acp-detail-section",children:[t("h3",{children:i("\u610F\u89C1\u4E0E\u51B3\u5B9A","Feedback and decisions")}),e.history.length?e.history.map((r,o)=>t("article",{class:"acp-review-event",children:[t("header",{children:[t("strong",{children:r.actor.displayName||r.actor.id}),t("span",{children:n[r.action]}),t("time",{children:J(r.at)})]}),r.note&&t("p",{children:r.note})]},`${r.at}:${o}`)):t("p",{class:"acp-muted",children:i("\u5F53\u524D\u7248\u672C\u5C1A\u65E0\u610F\u89C1\u6216\u51B3\u5B9A","No feedback or decisions for this version")})]})}function Br({detail:e}){return t("section",{class:"acp-detail-section",children:[t("h3",{children:i("\u4EFB\u52A1\u4E8B\u4EF6","Task events")}),e.events.length?t("ol",{class:"acp-event-list",children:[...e.events].reverse().map(n=>t("li",{children:[t("time",{children:J(n.observedAt)}),t("div",{children:[t("strong",{title:n.type,children:bn(n.type)}),n.attemptId&&t("small",{children:[i("\u6267\u884C\u8F6E\u6B21\uFF1A","Attempt: "),n.attemptId]}),n.data!==void 0&&t("details",{children:[t("summary",{children:i("\u6280\u672F\u8BE6\u60C5","Technical details")}),t("pre",{children:JSON.stringify(n.data,null,2)})]})]})]},n.eventId))}):t("p",{class:"acp-muted",children:i("\u6682\u65E0\u4EFB\u52A1\u4E8B\u4EF6","No task events")})]})}var qr=["all","pending","working","failed"],zr={all:0,pending:0,working:0,failed:0},Ut=100;function Vr({onDone:e}){let[n,r]=g(""),[o,a]=g(""),[s,c]=g(!1);return t("form",{class:"acp-login",onSubmit:l=>{l.preventDefault(),c(!0),a(""),tt.login(n.trim()).then(()=>e()).catch(d=>a(It(d))).finally(()=>c(!1))},children:[t("h1",{children:i("\u4EFB\u52A1\u5DE5\u4F5C\u53F0","Task workbench")}),t("p",{class:"acp-muted",children:i("\u8F93\u5165 A2A \u7F51\u5173\u914D\u7F6E\u91CC\u7684 workbench.token\u3002\u767B\u5F55\u53EA\u5728\u672C\u673A\u8FD9\u4E2A\u7F51\u5173\u4E0A\u6709\u6548\uFF0C12 \u5C0F\u65F6\u540E\u9700\u8981\u91CD\u65B0\u767B\u5F55\u3002","Enter workbench.token from the A2A gateway config. The login is valid on this gateway for 12 hours.")}),t("label",{children:[i("\u5DE5\u4F5C\u53F0\u4EE4\u724C","Workbench token"),t("input",{type:"password",autoComplete:"current-password",value:n,onInput:l=>r(l.currentTarget.value)})]}),o&&t("p",{class:"acp-decision-error",role:"alert",children:o}),t("button",{type:"submit",class:"acp-button acp-primary",disabled:s||!n.trim(),children:i("\u767B\u5F55","Sign in")})]})}function Jr({onLogout:e}){let n=_n(),[r,o]=g("tasks"),[a,s]=g("all"),[c,l]=g(0),[d,u]=g(null),[f,p]=g(!0),[_,b]=g(""),[x,m]=g(0),I=E(0),w=E(!1);T(()=>{let h=++I.current,N=!1;w.current=!1,p(!0);let U=async()=>{if(!w.current){w.current=!0;try{let $=await O.list(a,c,Ut);!N&&h===I.current&&(u($),b(""))}catch($){!N&&h===I.current&&b(It($))}finally{!N&&h===I.current&&(p(!1),w.current=!1)}}};U();let K=window.setInterval(()=>{U()},5e3);return()=>{N=!0,window.clearInterval(K)}},[a,c,x]),T(()=>{n.jobId&&o("tasks")},[n.jobId]),T(()=>{let h=N=>{N.key==="Escape"&&n.jobId&&B({full:!1})};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n.jobId]);let y=[...d?.items||[]].sort((h,N)=>N.updatedAt.localeCompare(h.updatedAt)),P=d?.counts||zr,j=(h,N)=>B({jobId:h.jobId,reviewId:N,full:!1});return t("section",{class:`acp-workbench${n.jobId?" has-detail":""}${n.full?" is-full-detail":""}`,children:[t("header",{class:"acp-workbench-header",children:[t("div",{class:"acp-workbench-title",children:[t("h1",{children:i("\u4EFB\u52A1\u5DE5\u4F5C\u53F0","Task workbench")}),t("nav",{class:"acp-module-switch","aria-label":i("\u5DE5\u4F5C\u53F0\u6A21\u5757","Workbench modules"),children:[t("button",{type:"button","aria-pressed":r==="tasks",onClick:()=>o("tasks"),children:i("\u4EFB\u52A1","Tasks")}),t("button",{type:"button","aria-pressed":r==="agents",onClick:()=>{o("agents"),n.jobId&&B({full:!1})},children:i("\u667A\u80FD\u4F53","Agents")})]})]}),t("div",{class:"acp-header-actions",children:[t("button",{type:"button",class:"acp-button",onClick:()=>m(h=>h+1),disabled:f,children:i("\u5237\u65B0","Refresh")}),e&&t("button",{type:"button",class:"acp-button",onClick:e,children:i("\u9000\u51FA\u767B\u5F55","Sign out")})]})]}),t("p",{class:"acp-workbench-source",children:i("\u6570\u636E\u6765\u6E90\uFF1A\u672C\u673A A2A \u7F51\u5173\u8D26\u672C\u3002","Source: this A2A gateway ledger.")}),r==="agents"?t(xn,{refreshKey:x,onOpenTask:h=>{o("tasks"),B({jobId:h,full:!1})}}):t(C,{children:[t("nav",{class:"acp-workbench-views","aria-label":i("\u4EFB\u52A1\u89C6\u56FE","Task views"),children:qr.map(h=>t("button",{type:"button","aria-pressed":a===h,onClick:()=>{s(h),l(0)},children:[{all:i("\u5168\u90E8\u4EFB\u52A1","All tasks"),pending:i("\u5F85\u6211\u786E\u8BA4","My reviews"),working:i("\u8FDB\u884C\u4E2D","Working"),failed:i("\u5F02\u5E38","Needs attention")}[h],d&&t("span",{children:P[h]})]},h))}),t("div",{class:"acp-workbench-body",children:[t("div",{class:"acp-workbench-table",children:[_&&t(Te,{title:i("\u4EFB\u52A1\u8BFB\u53D6\u5931\u8D25","Could not load tasks"),message:_,onRetry:()=>m(h=>h+1)}),t("table",{children:[t("thead",{children:t("tr",{children:[t("th",{children:i("\u4EFB\u52A1\u540D\u79F0","Task")}),t("th",{children:i("\u4EFB\u52A1\u6027\u8D28","Task kind")}),t("th",{children:i("\u6267\u884C\u72B6\u6001","Status")}),t("th",{children:i("\u4EFB\u52A1\u65B9\u5F0F","Task mode")}),t("th",{children:i("\u89D2\u8272\u6216\u9884\u8BBE","Role / preset")}),t("th",{children:i("\u6267\u884C\u670D\u52A1","Execution service")}),t("th",{children:i("\u5F53\u524D\u9636\u6BB5","Phase")}),t("th",{children:i("\u5F85\u529E\u4E0E\u5361\u70B9","Action / blocker")}),t("th",{children:i("\u6700\u8FD1\u8FDB\u5C55","Last updated")})]})}),t("tbody",{children:[!f&&!y.length&&t("tr",{children:t("td",{colSpan:9,class:"acp-muted",children:a==="all"?i("\u5F53\u524D\u6CA1\u6709 ACP \u6267\u884C\u4EFB\u52A1","No ACP execution tasks yet"):i("\u5F53\u524D\u89C6\u56FE\u6CA1\u6709\u5339\u914D\u7684\u4EFB\u52A1","No tasks in this view")})}),y.map(h=>t("tr",{class:`acp-task-row${n.jobId===h.jobId?" is-selected":""}`,children:[t("td",{children:t("div",{class:"acp-task-name",style:{paddingLeft:`${Math.min(vn(h,y),6)*16}px`},children:t("button",{type:"button",class:"acp-link acp-name-link",title:ge(h),onClick:()=>j(h,a==="pending"?h.pendingReviewId:void 0),children:[t("span",{class:"acp-title-text",children:ge(h)}),t("small",{title:h.jobId,children:h.jobId.length>12?`${h.jobId.slice(0,8)}\u2026`:h.jobId})]})})}),t("td",{children:[t("span",{class:"acp-mode-label",children:ot(h.channel)}),h.agentName&&t("small",{class:"acp-cell-note",children:h.agentName})]}),t("td",{children:[t(re,{value:st(h)}),!!h.unresolvedAttemptIds?.length&&t("small",{class:"acp-stale",children:i("\u6709\u5F85\u6838\u5B9E\u7684\u5386\u53F2\u6267\u884C","Prior execution needs verification")}),h.stale&&t("small",{class:"acp-stale",children:i("\u72B6\u6001\u5F85\u540C\u6B65","Awaiting sync")})]}),t("td",{children:t("span",{class:"acp-mode-label",children:le(h.execution,H).mode})}),t("td",{children:t(De,{execution:h.execution})}),t("td",{children:t(Ce,{execution:h.execution})}),t("td",{children:yn(h.phase||"")||"\u2014"}),t("td",{children:[h.pendingReviewId&&t("button",{type:"button",class:"acp-link",onClick:()=>j(h,h.pendingReviewId),children:i("\u67E5\u770B\u5E76\u786E\u8BA4","Review content")}),h.pendingProcessRequestId&&t("button",{type:"button",class:"acp-link",onClick:()=>j(h),children:i("\u56DE\u7B54\u8FC7\u7A0B\u8BF7\u6C42","Answer request")}),!h.pendingReviewId&&!h.pendingProcessRequestId&&t("span",{class:"acp-task-blocker",title:h.progressSummary,children:wn(h.progressSummary)})]}),t("td",{class:"acp-task-updated",children:J(h.updatedAt)})]},h.jobId))]})]}),d&&t("div",{class:"acp-pagination",children:[t("span",{children:i(`${d.total} \u6761\u4EFB\u52A1\u8BB0\u5F55`,`${d.total} task records`)}),t("button",{type:"button",class:"acp-button",disabled:c===0||f,onClick:()=>l(Math.max(0,c-Ut)),children:i("\u4E0A\u4E00\u9875","Previous")}),t("button",{type:"button",class:"acp-button",disabled:c+y.length>=d.total||f,onClick:()=>l(c+Ut),children:i("\u4E0B\u4E00\u9875","Next")})]})]}),n.jobId&&t(Bn,{jobId:n.jobId,requestedReviewId:n.reviewId,full:n.full,onChanged:()=>m(h=>h+1)},n.jobId)]})]})]})}function Kr(){let[e,n]=g("checking"),[r,o]=g(!0);return T(()=>{tt.status().then(s=>{o(s.loginRequired!==!1),n(s.authenticated?"ready":"login")}).catch(()=>n("login"));let a=()=>n("login");return et.addEventListener("required",a),()=>et.removeEventListener("required",a)},[]),e==="checking"?t("p",{class:"acp-muted acp-boot",children:i("\u6B63\u5728\u8FDE\u63A5\u7F51\u5173\u2026","Connecting to the gateway\u2026")}):e==="login"?t(Vr,{onDone:()=>n("ready")}):t(Jr,{onLogout:r?()=>{tt.logout().finally(()=>n("login"))}:void 0})}nn(t(Kr,{}),document.getElementById("app"));
@@ -0,0 +1 @@
1
+ import{a as e,b as r}from"./chunk-YUADQVB2.js";import"./chunk-CUS65DKZ.js";import"./chunk-SQE76S5B.js";export{e as TreeViewModule,r as createTreeViewServices};
@@ -0,0 +1 @@
1
+ import{a as e,b as t,c as a,d as o,e as i,g as s,l as u,x as d,y as l}from"./chunk-CUS65DKZ.js";var f=class extends l{static{e(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},m={parser:{TokenBuilder:e(()=>new f,"TokenBuilder"),ValueConverter:e(()=>new d,"ValueConverter")}};function v(c=i){let r=o(a(c),s),n=o(t({shared:r}),u,m);return r.ServiceRegistry.register(n),{shared:r,Info:n}}e(v,"createInfoServices");export{m as a,v as b};
@@ -0,0 +1 @@
1
+ import{a as e,b as r}from"./chunk-SVI7DGIE.js";import"./chunk-CUS65DKZ.js";import"./chunk-SQE76S5B.js";export{e as PieModule,r as createPieServices};
@@ -0,0 +1 @@
1
+ import{a as t,b as s,c as d,d as o,e as l,g as u,p as c,w as f,y as m}from"./chunk-CUS65DKZ.js";var v=class extends m{static{t(this,"RailroadAbnfTokenBuilder")}constructor(){super(["railroad-abnf-beta"])}},b=class extends f{static{t(this,"RailroadAbnfValueConverter")}runConverter(r,e,a){let i=super.runConverter(r,e,a);if(r.name==="TITLE"&&typeof i=="string"){let n=i.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1)}return i}runCustomConverter(r,e,a){if(r.name==="ABNF_STRING")return e.slice(1,-1)}},A={parser:{TokenBuilder:t(()=>new v,"TokenBuilder"),ValueConverter:t(()=>new b,"ValueConverter")}};function C(r=l){let e=o(d(r),u),a=o(s({shared:e}),c,A);return e.ServiceRegistry.register(a),{shared:e,RailroadAbnf:a}}t(C,"createRailroadAbnfServices");export{A as a,C as b};
@@ -0,0 +1 @@
1
+ function Y(a,t,s){if(a&&a.length){let[e,n]=t,o=Math.PI/180*s,r=Math.cos(o),h=Math.sin(o);for(let i of a){let[l,c]=i;i[0]=(l-e)*r-(c-n)*h+e,i[1]=(l-e)*h+(c-n)*r+n}}}function zt(a,t){return a[0]===t[0]&&a[1]===t[1]}function Wt(a,t,s,e=1){let n=s,o=Math.max(t,.1),r=a[0]&&a[0][0]&&typeof a[0][0]=="number"?[a]:a,h=[0,0];if(n)for(let l of r)Y(l,h,n);let i=(function(l,c,d){let p=[];for(let M of l){let m=[...M];zt(m[0],m[m.length-1])||m.push([m[0][0],m[0][1]]),m.length>2&&p.push(m)}let u=[];c=Math.max(c,.1);let f=[];for(let M of p)for(let m=0;m<M.length-1;m++){let P=M[m],x=M[m+1];if(P[1]!==x[1]){let w=Math.min(P[1],x[1]);f.push({ymin:w,ymax:Math.max(P[1],x[1]),x:w===P[1]?P[0]:x[0],islope:(x[0]-P[0])/(x[1]-P[1])})}}if(f.sort(((M,m)=>M.ymin<m.ymin?-1:M.ymin>m.ymin?1:M.x<m.x?-1:M.x>m.x?1:M.ymax===m.ymax?0:(M.ymax-m.ymax)/Math.abs(M.ymax-m.ymax))),!f.length)return u;let g=[],k=f[0].ymin,b=0;for(;g.length||f.length;){if(f.length){let M=-1;for(let m=0;m<f.length&&!(f[m].ymin>k);m++)M=m;f.splice(0,M+1).forEach((m=>{g.push({s:k,edge:m})}))}if(g=g.filter((M=>!(M.edge.ymax<=k))),g.sort(((M,m)=>M.edge.x===m.edge.x?0:(M.edge.x-m.edge.x)/Math.abs(M.edge.x-m.edge.x))),(d!==1||b%c==0)&&g.length>1)for(let M=0;M<g.length;M+=2){let m=M+1;if(m>=g.length)break;let P=g[M].edge,x=g[m].edge;u.push([[Math.round(P.x),k],[Math.round(x.x),k]])}k+=d,g.forEach((M=>{M.edge.x=M.edge.x+d*M.edge.islope})),b++}return u})(r,o,e);if(n){for(let l of r)Y(l,h,-n);(function(l,c,d){let p=[];l.forEach((u=>p.push(...u))),Y(p,c,d)})(i,h,-n)}return i}function F(a,t){var s;let e=t.hachureAngle+90,n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.round(Math.max(n,.1));let o=1;return t.roughness>=1&&(((s=t.randomizer)===null||s===void 0?void 0:s.next())||Math.random())>.7&&(o=n),Wt(a,n,e,o||1)}var q=class{constructor(t){this.helper=t}fillPolygons(t,s){return this._fillPolygons(t,s)}_fillPolygons(t,s){let e=F(t,s);return{type:"fillSketch",ops:this.renderLines(e,s)}}renderLines(t,s){let e=[];for(let n of t)e.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],s));return e}};function X(a){let t=a[0],s=a[1];return Math.sqrt(Math.pow(t[0]-s[0],2)+Math.pow(t[1]-s[1],2))}var at=class extends q{fillPolygons(t,s){let e=s.hachureGap;e<0&&(e=4*s.strokeWidth),e=Math.max(e,.1);let n=F(t,Object.assign({},s,{hachureGap:e})),o=Math.PI/180*s.hachureAngle,r=[],h=.5*e*Math.cos(o),i=.5*e*Math.sin(o);for(let[l,c]of n)X([l,c])&&r.push([[l[0]-h,l[1]+i],[...c]],[[l[0]+h,l[1]-i],[...c]]);return{type:"fillSketch",ops:this.renderLines(r,s)}}},ot=class extends q{fillPolygons(t,s){let e=this._fillPolygons(t,s),n=Object.assign({},s,{hachureAngle:s.hachureAngle+90}),o=this._fillPolygons(t,n);return e.ops=e.ops.concat(o.ops),e}},ht=class{constructor(t){this.helper=t}fillPolygons(t,s){let e=F(t,s=Object.assign({},s,{hachureAngle:0}));return this.dotsOnLines(e,s)}dotsOnLines(t,s){let e=[],n=s.hachureGap;n<0&&(n=4*s.strokeWidth),n=Math.max(n,.1);let o=s.fillWeight;o<0&&(o=s.strokeWidth/2);let r=n/4;for(let h of t){let i=X(h),l=i/n,c=Math.ceil(l)-1,d=i-c*n,p=(h[0][0]+h[1][0])/2-n/4,u=Math.min(h[0][1],h[1][1]);for(let f=0;f<c;f++){let g=u+d+f*n,k=p-r+2*Math.random()*r,b=g-r+2*Math.random()*r,M=this.helper.ellipse(k,b,o,o,s);e.push(...M.ops)}}return{type:"fillSketch",ops:e}}},rt=class{constructor(t){this.helper=t}fillPolygons(t,s){let e=F(t,s);return{type:"fillSketch",ops:this.dashedLine(e,s)}}dashedLine(t,s){let e=s.dashOffset<0?s.hachureGap<0?4*s.strokeWidth:s.hachureGap:s.dashOffset,n=s.dashGap<0?s.hachureGap<0?4*s.strokeWidth:s.hachureGap:s.dashGap,o=[];return t.forEach((r=>{let h=X(r),i=Math.floor(h/(e+n)),l=(h+n-i*(e+n))/2,c=r[0],d=r[1];c[0]>d[0]&&(c=r[1],d=r[0]);let p=Math.atan((d[1]-c[1])/(d[0]-c[0]));for(let u=0;u<i;u++){let f=u*(e+n),g=f+e,k=[c[0]+f*Math.cos(p)+l*Math.cos(p),c[1]+f*Math.sin(p)+l*Math.sin(p)],b=[c[0]+g*Math.cos(p)+l*Math.cos(p),c[1]+g*Math.sin(p)+l*Math.sin(p)];o.push(...this.helper.doubleLineOps(k[0],k[1],b[0],b[1],s))}})),o}},it=class{constructor(t){this.helper=t}fillPolygons(t,s){let e=s.hachureGap<0?4*s.strokeWidth:s.hachureGap,n=s.zigzagOffset<0?e:s.zigzagOffset,o=F(t,s=Object.assign({},s,{hachureGap:e+n}));return{type:"fillSketch",ops:this.zigzagLines(o,n,s)}}zigzagLines(t,s,e){let n=[];return t.forEach((o=>{let r=X(o),h=Math.round(r/(2*s)),i=o[0],l=o[1];i[0]>l[0]&&(i=o[1],l=o[0]);let c=Math.atan((l[1]-i[1])/(l[0]-i[0]));for(let d=0;d<h;d++){let p=2*d*s,u=2*(d+1)*s,f=Math.sqrt(2*Math.pow(s,2)),g=[i[0]+p*Math.cos(c),i[1]+p*Math.sin(c)],k=[i[0]+u*Math.cos(c),i[1]+u*Math.sin(c)],b=[g[0]+f*Math.cos(c+Math.PI/4),g[1]+f*Math.sin(c+Math.PI/4)];n.push(...this.helper.doubleLineOps(g[0],g[1],b[0],b[1],e),...this.helper.doubleLineOps(b[0],b[1],k[0],k[1],e))}})),n}},S={},ct=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},Et=0,tt=1,bt=2,Z={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function et(a,t){return a.type===t}function gt(a){let t=[],s=(function(r){let h=new Array;for(;r!=="";)if(r.match(/^([ \t\r\n,]+)/))r=r.substr(RegExp.$1.length);else if(r.match(/^([aAcChHlLmMqQsStTvVzZ])/))h[h.length]={type:Et,text:RegExp.$1},r=r.substr(RegExp.$1.length);else{if(!r.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];h[h.length]={type:tt,text:`${parseFloat(RegExp.$1)}`},r=r.substr(RegExp.$1.length)}return h[h.length]={type:bt,text:""},h})(a),e="BOD",n=0,o=s[n];for(;!et(o,bt);){let r=0,h=[];if(e==="BOD"){if(o.text!=="M"&&o.text!=="m")return gt("M0,0"+a);n++,r=Z[o.text],e=o.text}else et(o,tt)?r=Z[e]:(n++,r=Z[o.text],e=o.text);if(!(n+r<s.length))throw new Error("Path data ended short");for(let i=n;i<n+r;i++){let l=s[i];if(!et(l,tt))throw new Error("Param not a number: "+e+","+l.text);h[h.length]=+l.text}if(typeof Z[e]!="number")throw new Error("Bad segment: "+e);{let i={key:e,data:h};t.push(i),n+=r,o=s[n],e==="M"&&(e="L"),e==="m"&&(e="l")}}return t}function Ot(a){let t=0,s=0,e=0,n=0,o=[];for(let{key:r,data:h}of a)switch(r){case"M":o.push({key:"M",data:[...h]}),[t,s]=h,[e,n]=h;break;case"m":t+=h[0],s+=h[1],o.push({key:"M",data:[t,s]}),e=t,n=s;break;case"L":o.push({key:"L",data:[...h]}),[t,s]=h;break;case"l":t+=h[0],s+=h[1],o.push({key:"L",data:[t,s]});break;case"C":o.push({key:"C",data:[...h]}),t=h[4],s=h[5];break;case"c":{let i=h.map(((l,c)=>c%2?l+s:l+t));o.push({key:"C",data:i}),t=i[4],s=i[5];break}case"Q":o.push({key:"Q",data:[...h]}),t=h[2],s=h[3];break;case"q":{let i=h.map(((l,c)=>c%2?l+s:l+t));o.push({key:"Q",data:i}),t=i[2],s=i[3];break}case"A":o.push({key:"A",data:[...h]}),t=h[5],s=h[6];break;case"a":t+=h[5],s+=h[6],o.push({key:"A",data:[h[0],h[1],h[2],h[3],h[4],t,s]});break;case"H":o.push({key:"H",data:[...h]}),t=h[0];break;case"h":t+=h[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...h]}),s=h[0];break;case"v":s+=h[0],o.push({key:"V",data:[s]});break;case"S":o.push({key:"S",data:[...h]}),t=h[2],s=h[3];break;case"s":{let i=h.map(((l,c)=>c%2?l+s:l+t));o.push({key:"S",data:i}),t=i[2],s=i[3];break}case"T":o.push({key:"T",data:[...h]}),t=h[0],s=h[1];break;case"t":t+=h[0],s+=h[1],o.push({key:"T",data:[t,s]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=e,s=n}return o}function Lt(a){let t=[],s="",e=0,n=0,o=0,r=0,h=0,i=0;for(let{key:l,data:c}of a){switch(l){case"M":t.push({key:"M",data:[...c]}),[e,n]=c,[o,r]=c;break;case"C":t.push({key:"C",data:[...c]}),e=c[4],n=c[5],h=c[2],i=c[3];break;case"L":t.push({key:"L",data:[...c]}),[e,n]=c;break;case"H":e=c[0],t.push({key:"L",data:[e,n]});break;case"V":n=c[0],t.push({key:"L",data:[e,n]});break;case"S":{let d=0,p=0;s==="C"||s==="S"?(d=e+(e-h),p=n+(n-i)):(d=e,p=n),t.push({key:"C",data:[d,p,...c]}),h=c[0],i=c[1],e=c[2],n=c[3];break}case"T":{let[d,p]=c,u=0,f=0;s==="Q"||s==="T"?(u=e+(e-h),f=n+(n-i)):(u=e,f=n);let g=e+2*(u-e)/3,k=n+2*(f-n)/3,b=d+2*(u-d)/3,M=p+2*(f-p)/3;t.push({key:"C",data:[g,k,b,M,d,p]}),h=u,i=f,e=d,n=p;break}case"Q":{let[d,p,u,f]=c,g=e+2*(d-e)/3,k=n+2*(p-n)/3,b=u+2*(d-u)/3,M=f+2*(p-f)/3;t.push({key:"C",data:[g,k,b,M,u,f]}),h=d,i=p,e=u,n=f;break}case"A":{let d=Math.abs(c[0]),p=Math.abs(c[1]),u=c[2],f=c[3],g=c[4],k=c[5],b=c[6];d===0||p===0?(t.push({key:"C",data:[e,n,k,b,k,b]}),e=k,n=b):(e!==k||n!==b)&&(Tt(e,n,k,b,d,p,u,f,g).forEach((function(M){t.push({key:"C",data:M})})),e=k,n=b);break}case"Z":t.push({key:"Z",data:[]}),e=o,n=r}s=l}return t}function R(a,t,s){return[a*Math.cos(s)-t*Math.sin(s),a*Math.sin(s)+t*Math.cos(s)]}function Tt(a,t,s,e,n,o,r,h,i,l){let c=(d=r,Math.PI*d/180);var d;let p=[],u=0,f=0,g=0,k=0;if(l)[u,f,g,k]=l;else{[a,t]=R(a,t,-c),[s,e]=R(s,e,-c);let T=(a-s)/2,v=(t-e)/2,_=T*T/(n*n)+v*v/(o*o);_>1&&(_=Math.sqrt(_),n*=_,o*=_);let W=n*n,E=o*o,It=W*E-W*v*v-E*T*T,Ct=W*v*v+E*T*T,kt=(h===i?-1:1)*Math.sqrt(Math.abs(It/Ct));g=kt*n*v/o+(a+s)/2,k=kt*-o*T/n+(t+e)/2,u=Math.asin(parseFloat(((t-k)/o).toFixed(9))),f=Math.asin(parseFloat(((e-k)/o).toFixed(9))),a<g&&(u=Math.PI-u),s<g&&(f=Math.PI-f),u<0&&(u=2*Math.PI+u),f<0&&(f=2*Math.PI+f),i&&u>f&&(u-=2*Math.PI),!i&&f>u&&(f-=2*Math.PI)}let b=f-u;if(Math.abs(b)>120*Math.PI/180){let T=f,v=s,_=e;f=i&&f>u?u+120*Math.PI/180*1:u+120*Math.PI/180*-1,p=Tt(s=g+n*Math.cos(f),e=k+o*Math.sin(f),v,_,n,o,r,0,i,[f,T,g,k])}b=f-u;let M=Math.cos(u),m=Math.sin(u),P=Math.cos(f),x=Math.sin(f),w=Math.tan(b/4),L=4/3*n*w,A=4/3*o*w,V=[a,t],D=[a+L*m,t-A*M],C=[s+L*x,e-A*P],Mt=[s,e];if(D[0]=2*V[0]-D[0],D[1]=2*V[1]-D[1],l)return[D,C,Mt].concat(p);{p=[D,C,Mt].concat(p);let T=[];for(let v=0;v<p.length;v+=3){let _=R(p[v][0],p[v][1],c),W=R(p[v+1][0],p[v+1][1],c),E=R(p[v+2][0],p[v+2][1],c);T.push([_[0],_[1],W[0],W[1],E[0],E[1]])}return T}}var Gt={randOffset:function(a,t){return y(a,t)},randOffsetWithRange:function(a,t,s){return J(a,t,s)},ellipse:function(a,t,s,e,n){let o=At(s,e,n);return lt(a,t,n,o).opset},doubleLineOps:function(a,t,s,e,n){return I(a,t,s,e,n,!0)}};function Dt(a,t,s,e,n){return{type:"path",ops:I(a,t,s,e,n)}}function N(a,t,s){let e=(a||[]).length;if(e>2){let n=[];for(let o=0;o<e-1;o++)n.push(...I(a[o][0],a[o][1],a[o+1][0],a[o+1][1],s));return t&&n.push(...I(a[e-1][0],a[e-1][1],a[0][0],a[0][1],s)),{type:"path",ops:n}}return e===2?Dt(a[0][0],a[0][1],a[1][0],a[1][1],s):{type:"path",ops:[]}}function $t(a,t,s,e,n){return(function(o,r){return N(o,!0,r)})([[a,t],[a+s,t],[a+s,t+e],[a,t+e]],n)}function yt(a,t){if(a.length){let s=typeof a[0][0]=="number"?[a]:a,e=Q(s[0],1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:Q(s[0],1.5*(1+.22*t.roughness),xt(t));for(let o=1;o<s.length;o++){let r=s[o];if(r.length){let h=Q(r,1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:Q(r,1.5*(1+.22*t.roughness),xt(t));for(let l of h)l.op!=="move"&&e.push(l);for(let l of i)l.op!=="move"&&n.push(l)}}return{type:"path",ops:e.concat(n)}}return{type:"path",ops:[]}}function At(a,t,s){let e=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(a/2,2)+Math.pow(t/2,2))/2)),n=Math.ceil(Math.max(s.curveStepCount,s.curveStepCount/Math.sqrt(200)*e)),o=2*Math.PI/n,r=Math.abs(a/2),h=Math.abs(t/2),i=1-s.curveFitting;return r+=y(r*i,s),h+=y(h*i,s),{increment:o,rx:r,ry:h}}function lt(a,t,s,e){let[n,o]=Pt(e.increment,a,t,e.rx,e.ry,1,e.increment*J(.1,J(.4,1,s),s),s),r=K(n,null,s);if(!s.disableMultiStroke&&s.roughness!==0){let[h]=Pt(e.increment,a,t,e.rx,e.ry,1.5,0,s),i=K(h,null,s);r=r.concat(i)}return{estimatedPoints:o,opset:{type:"path",ops:r}}}function mt(a,t,s,e,n,o,r,h,i){let l=a,c=t,d=Math.abs(s/2),p=Math.abs(e/2);d+=y(.01*d,i),p+=y(.01*p,i);let u=n,f=o;for(;u<0;)u+=2*Math.PI,f+=2*Math.PI;f-u>2*Math.PI&&(u=0,f=2*Math.PI);let g=2*Math.PI/i.curveStepCount,k=Math.min(g/2,(f-u)/2),b=vt(k,l,c,d,p,u,f,1,i);if(!i.disableMultiStroke){let M=vt(k,l,c,d,p,u,f,1.5,i);b.push(...M)}return r&&(h?b.push(...I(l,c,l+d*Math.cos(u),c+p*Math.sin(u),i),...I(l,c,l+d*Math.cos(f),c+p*Math.sin(f),i)):b.push({op:"lineTo",data:[l,c]},{op:"lineTo",data:[l+d*Math.cos(u),c+p*Math.sin(u)]})),{type:"path",ops:b}}function wt(a,t){let s=Lt(Ot(gt(a))),e=[],n=[0,0],o=[0,0];for(let{key:r,data:h}of s)switch(r){case"M":o=[h[0],h[1]],n=[h[0],h[1]];break;case"L":e.push(...I(o[0],o[1],h[0],h[1],t)),o=[h[0],h[1]];break;case"C":{let[i,l,c,d,p,u]=h;e.push(...Rt(i,l,c,d,p,u,o,t)),o=[p,u];break}case"Z":e.push(...I(o[0],o[1],n[0],n[1],t)),o=[n[0],n[1]]}return{type:"path",ops:e}}function st(a,t){let s=[];for(let e of a)if(e.length){let n=t.maxRandomnessOffset||0,o=e.length;if(o>2){s.push({op:"move",data:[e[0][0]+y(n,t),e[0][1]+y(n,t)]});for(let r=1;r<o;r++)s.push({op:"lineTo",data:[e[r][0]+y(n,t),e[r][1]+y(n,t)]})}}return{type:"fillPath",ops:s}}function G(a,t){return(function(s,e){let n=s.fillStyle||"hachure";if(!S[n])switch(n){case"zigzag":S[n]||(S[n]=new at(e));break;case"cross-hatch":S[n]||(S[n]=new ot(e));break;case"dots":S[n]||(S[n]=new ht(e));break;case"dashed":S[n]||(S[n]=new rt(e));break;case"zigzag-line":S[n]||(S[n]=new it(e));break;default:n="hachure",S[n]||(S[n]=new q(e))}return S[n]})(t,Gt).fillPolygons(a,t)}function xt(a){let t=Object.assign({},a);return t.randomizer=void 0,a.seed&&(t.seed=a.seed+1),t}function _t(a){return a.randomizer||(a.randomizer=new ct(a.seed||0)),a.randomizer.next()}function J(a,t,s,e=1){return s.roughness*e*(_t(s)*(t-a)+a)}function y(a,t,s=1){return J(-a,a,t,s)}function I(a,t,s,e,n,o=!1){let r=o?n.disableMultiStrokeFill:n.disableMultiStroke,h=ut(a,t,s,e,n,!0,!1);if(r)return h;let i=ut(a,t,s,e,n,!0,!0);return h.concat(i)}function ut(a,t,s,e,n,o,r){let h=Math.pow(a-s,2)+Math.pow(t-e,2),i=Math.sqrt(h),l=1;l=i<200?1:i>500?.4:-.0016668*i+1.233334;let c=n.maxRandomnessOffset||0;c*c*100>h&&(c=i/10);let d=c/2,p=.2+.2*_t(n),u=n.bowing*n.maxRandomnessOffset*(e-t)/200,f=n.bowing*n.maxRandomnessOffset*(a-s)/200;u=y(u,n,l),f=y(f,n,l);let g=[],k=()=>y(d,n,l),b=()=>y(c,n,l),M=n.preserveVertices;return o&&(r?g.push({op:"move",data:[a+(M?0:k()),t+(M?0:k())]}):g.push({op:"move",data:[a+(M?0:y(c,n,l)),t+(M?0:y(c,n,l))]})),r?g.push({op:"bcurveTo",data:[u+a+(s-a)*p+k(),f+t+(e-t)*p+k(),u+a+2*(s-a)*p+k(),f+t+2*(e-t)*p+k(),s+(M?0:k()),e+(M?0:k())]}):g.push({op:"bcurveTo",data:[u+a+(s-a)*p+b(),f+t+(e-t)*p+b(),u+a+2*(s-a)*p+b(),f+t+2*(e-t)*p+b(),s+(M?0:b()),e+(M?0:b())]}),g}function Q(a,t,s){if(!a.length)return[];let e=[];e.push([a[0][0]+y(t,s),a[0][1]+y(t,s)]),e.push([a[0][0]+y(t,s),a[0][1]+y(t,s)]);for(let n=1;n<a.length;n++)e.push([a[n][0]+y(t,s),a[n][1]+y(t,s)]),n===a.length-1&&e.push([a[n][0]+y(t,s),a[n][1]+y(t,s)]);return K(e,null,s)}function K(a,t,s){let e=a.length,n=[];if(e>3){let o=[],r=1-s.curveTightness;n.push({op:"move",data:[a[1][0],a[1][1]]});for(let h=1;h+2<e;h++){let i=a[h];o[0]=[i[0],i[1]],o[1]=[i[0]+(r*a[h+1][0]-r*a[h-1][0])/6,i[1]+(r*a[h+1][1]-r*a[h-1][1])/6],o[2]=[a[h+1][0]+(r*a[h][0]-r*a[h+2][0])/6,a[h+1][1]+(r*a[h][1]-r*a[h+2][1])/6],o[3]=[a[h+1][0],a[h+1][1]],n.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[3][0],o[3][1]]})}if(t&&t.length===2){let h=s.maxRandomnessOffset;n.push({op:"lineTo",data:[t[0]+y(h,s),t[1]+y(h,s)]})}}else e===3?(n.push({op:"move",data:[a[1][0],a[1][1]]}),n.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[2][0],a[2][1]]})):e===2&&n.push(...ut(a[0][0],a[0][1],a[1][0],a[1][1],s,!0,!0));return n}function Pt(a,t,s,e,n,o,r,h){let i=[],l=[];if(h.roughness===0){a/=4,l.push([t+e*Math.cos(-a),s+n*Math.sin(-a)]);for(let c=0;c<=2*Math.PI;c+=a){let d=[t+e*Math.cos(c),s+n*Math.sin(c)];i.push(d),l.push(d)}l.push([t+e*Math.cos(0),s+n*Math.sin(0)]),l.push([t+e*Math.cos(a),s+n*Math.sin(a)])}else{let c=y(.5,h)-Math.PI/2;l.push([y(o,h)+t+.9*e*Math.cos(c-a),y(o,h)+s+.9*n*Math.sin(c-a)]);let d=2*Math.PI+c-.01;for(let p=c;p<d;p+=a){let u=[y(o,h)+t+e*Math.cos(p),y(o,h)+s+n*Math.sin(p)];i.push(u),l.push(u)}l.push([y(o,h)+t+e*Math.cos(c+2*Math.PI+.5*r),y(o,h)+s+n*Math.sin(c+2*Math.PI+.5*r)]),l.push([y(o,h)+t+.98*e*Math.cos(c+r),y(o,h)+s+.98*n*Math.sin(c+r)]),l.push([y(o,h)+t+.9*e*Math.cos(c+.5*r),y(o,h)+s+.9*n*Math.sin(c+.5*r)])}return[l,i]}function vt(a,t,s,e,n,o,r,h,i){let l=o+y(.1,i),c=[];c.push([y(h,i)+t+.9*e*Math.cos(l-a),y(h,i)+s+.9*n*Math.sin(l-a)]);for(let d=l;d<=r;d+=a)c.push([y(h,i)+t+e*Math.cos(d),y(h,i)+s+n*Math.sin(d)]);return c.push([t+e*Math.cos(r),s+n*Math.sin(r)]),c.push([t+e*Math.cos(r),s+n*Math.sin(r)]),K(c,null,i)}function Rt(a,t,s,e,n,o,r,h){let i=[],l=[h.maxRandomnessOffset||1,(h.maxRandomnessOffset||1)+.3],c=[0,0],d=h.disableMultiStroke?1:2,p=h.preserveVertices;for(let u=0;u<d;u++)u===0?i.push({op:"move",data:[r[0],r[1]]}):i.push({op:"move",data:[r[0]+(p?0:y(l[0],h)),r[1]+(p?0:y(l[0],h))]}),c=p?[n,o]:[n+y(l[u],h),o+y(l[u],h)],i.push({op:"bcurveTo",data:[a+y(l[u],h),t+y(l[u],h),s+y(l[u],h),e+y(l[u],h),c[0],c[1]]});return i}function j(a){return[...a]}function St(a,t=0){let s=a.length;if(s<3)throw new Error("A curve must have at least three points.");let e=[];if(s===3)e.push(j(a[0]),j(a[1]),j(a[2]),j(a[2]));else{let n=[];n.push(a[0],a[0]);for(let h=1;h<a.length;h++)n.push(a[h]),h===a.length-1&&n.push(a[h]);let o=[],r=1-t;e.push(j(n[0]));for(let h=1;h+2<n.length;h++){let i=n[h];o[0]=[i[0],i[1]],o[1]=[i[0]+(r*n[h+1][0]-r*n[h-1][0])/6,i[1]+(r*n[h+1][1]-r*n[h-1][1])/6],o[2]=[n[h+1][0]+(r*n[h][0]-r*n[h+2][0])/6,n[h+1][1]+(r*n[h][1]-r*n[h+2][1])/6],o[3]=[n[h+1][0],n[h+1][1]],e.push(o[1],o[2],o[3])}}return e}function B(a,t){return Math.pow(a[0]-t[0],2)+Math.pow(a[1]-t[1],2)}function jt(a,t,s){let e=B(t,s);if(e===0)return B(a,t);let n=((a[0]-t[0])*(s[0]-t[0])+(a[1]-t[1])*(s[1]-t[1]))/e;return n=Math.max(0,Math.min(1,n)),B(a,z(t,s,n))}function z(a,t,s){return[a[0]+(t[0]-a[0])*s,a[1]+(t[1]-a[1])*s]}function pt(a,t,s,e){let n=e||[];if((function(h,i){let l=h[i+0],c=h[i+1],d=h[i+2],p=h[i+3],u=3*c[0]-2*l[0]-p[0];u*=u;let f=3*c[1]-2*l[1]-p[1];f*=f;let g=3*d[0]-2*p[0]-l[0];g*=g;let k=3*d[1]-2*p[1]-l[1];return k*=k,u<g&&(u=g),f<k&&(f=k),u+f})(a,t)<s){let h=a[t+0];n.length?(o=n[n.length-1],r=h,Math.sqrt(B(o,r))>1&&n.push(h)):n.push(h),n.push(a[t+3])}else{let i=a[t+0],l=a[t+1],c=a[t+2],d=a[t+3],p=z(i,l,.5),u=z(l,c,.5),f=z(c,d,.5),g=z(p,u,.5),k=z(u,f,.5),b=z(g,k,.5);pt([i,p,g,b],0,s,n),pt([b,k,f,d],0,s,n)}var o,r;return n}function qt(a,t){return U(a,0,a.length,t)}function U(a,t,s,e,n){let o=n||[],r=a[t],h=a[s-1],i=0,l=1;for(let c=t+1;c<s-1;++c){let d=jt(a[c],r,h);d>i&&(i=d,l=c)}return Math.sqrt(i)>e?(U(a,t,l+1,e,o),U(a,l,s,e,o)):(o.length||o.push(r),o.push(h)),o}function nt(a,t=.15,s){let e=[],n=(a.length-1)/3;for(let o=0;o<n;o++)pt(a,3*o,t,e);return s&&s>0?U(e,0,e.length,s):e}var O="none",$=class{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,s,e){return{shape:t,sets:s||[],options:e||this.defaultOptions}}line(t,s,e,n,o){let r=this._o(o);return this._d("line",[Dt(t,s,e,n,r)],r)}rectangle(t,s,e,n,o){let r=this._o(o),h=[],i=$t(t,s,e,n,r);if(r.fill){let l=[[t,s],[t+e,s],[t+e,s+n],[t,s+n]];r.fillStyle==="solid"?h.push(st([l],r)):h.push(G([l],r))}return r.stroke!==O&&h.push(i),this._d("rectangle",h,r)}ellipse(t,s,e,n,o){let r=this._o(o),h=[],i=At(e,n,r),l=lt(t,s,r,i);if(r.fill)if(r.fillStyle==="solid"){let c=lt(t,s,r,i).opset;c.type="fillPath",h.push(c)}else h.push(G([l.estimatedPoints],r));return r.stroke!==O&&h.push(l.opset),this._d("ellipse",h,r)}circle(t,s,e,n){let o=this.ellipse(t,s,e,e,n);return o.shape="circle",o}linearPath(t,s){let e=this._o(s);return this._d("linearPath",[N(t,!1,e)],e)}arc(t,s,e,n,o,r,h=!1,i){let l=this._o(i),c=[],d=mt(t,s,e,n,o,r,h,!0,l);if(h&&l.fill)if(l.fillStyle==="solid"){let p=Object.assign({},l);p.disableMultiStroke=!0;let u=mt(t,s,e,n,o,r,!0,!1,p);u.type="fillPath",c.push(u)}else c.push((function(p,u,f,g,k,b,M){let m=p,P=u,x=Math.abs(f/2),w=Math.abs(g/2);x+=y(.01*x,M),w+=y(.01*w,M);let L=k,A=b;for(;L<0;)L+=2*Math.PI,A+=2*Math.PI;A-L>2*Math.PI&&(L=0,A=2*Math.PI);let V=(A-L)/M.curveStepCount,D=[];for(let C=L;C<=A;C+=V)D.push([m+x*Math.cos(C),P+w*Math.sin(C)]);return D.push([m+x*Math.cos(A),P+w*Math.sin(A)]),D.push([m,P]),G([D],M)})(t,s,e,n,o,r,l));return l.stroke!==O&&c.push(d),this._d("arc",c,l)}curve(t,s){let e=this._o(s),n=[],o=yt(t,e);if(e.fill&&e.fill!==O)if(e.fillStyle==="solid"){let r=yt(t,Object.assign(Object.assign({},e),{disableMultiStroke:!0,roughness:e.roughness?e.roughness+e.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(r.ops)})}else{let r=[],h=t;if(h.length){let i=typeof h[0][0]=="number"?[h]:h;for(let l of i)l.length<3?r.push(...l):l.length===3?r.push(...nt(St([l[0],l[0],l[1],l[2]]),10,(1+e.roughness)/2)):r.push(...nt(St(l),10,(1+e.roughness)/2))}r.length&&n.push(G([r],e))}return e.stroke!==O&&n.push(o),this._d("curve",n,e)}polygon(t,s){let e=this._o(s),n=[],o=N(t,!0,e);return e.fill&&(e.fillStyle==="solid"?n.push(st([t],e)):n.push(G([t],e))),e.stroke!==O&&n.push(o),this._d("polygon",n,e)}path(t,s){let e=this._o(s),n=[];if(!t)return this._d("path",n,e);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let o=e.fill&&e.fill!=="transparent"&&e.fill!==O,r=e.stroke!==O,h=!!(e.simplification&&e.simplification<1),i=(function(c,d,p){let u=Lt(Ot(gt(c))),f=[],g=[],k=[0,0],b=[],M=()=>{b.length>=4&&g.push(...nt(b,d)),b=[]},m=()=>{M(),g.length&&(f.push(g),g=[])};for(let{key:x,data:w}of u)switch(x){case"M":m(),k=[w[0],w[1]],g.push(k);break;case"L":M(),g.push([w[0],w[1]]);break;case"C":if(!b.length){let L=g.length?g[g.length-1]:k;b.push([L[0],L[1]])}b.push([w[0],w[1]]),b.push([w[2],w[3]]),b.push([w[4],w[5]]);break;case"Z":M(),g.push([k[0],k[1]])}if(m(),!p)return f;let P=[];for(let x of f){let w=qt(x,p);w.length&&P.push(w)}return P})(t,1,h?4-4*(e.simplification||1):(1+e.roughness)/2),l=wt(t,e);if(o)if(e.fillStyle==="solid")if(i.length===1){let c=wt(t,Object.assign(Object.assign({},e),{disableMultiStroke:!0,roughness:e.roughness?e.roughness+e.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(c.ops)})}else n.push(st(i,e));else n.push(G(i,e));return r&&(h?i.forEach((c=>{n.push(N(c,!1,e))})):n.push(l)),this._d("path",n,e)}opsToPath(t,s){let e="";for(let n of t.ops){let o=typeof s=="number"&&s>=0?n.data.map((r=>+r.toFixed(s))):n.data;switch(n.op){case"move":e+=`M${o[0]} ${o[1]} `;break;case"bcurveTo":e+=`C${o[0]} ${o[1]}, ${o[2]} ${o[3]}, ${o[4]} ${o[5]} `;break;case"lineTo":e+=`L${o[0]} ${o[1]} `}}return e.trim()}toPaths(t){let s=t.sets||[],e=t.options||this.defaultOptions,n=[];for(let o of s){let r=null;switch(o.type){case"path":r={d:this.opsToPath(o),stroke:e.stroke,strokeWidth:e.strokeWidth,fill:O};break;case"fillPath":r={d:this.opsToPath(o),stroke:O,strokeWidth:0,fill:e.fill||O};break;case"fillSketch":r=this.fillSketch(o,e)}r&&n.push(r)}return n}fillSketch(t,s){let e=s.fillWeight;return e<0&&(e=s.strokeWidth/2),{d:this.opsToPath(t),stroke:s.fill||O,strokeWidth:e,fill:O}}_mergedShape(t){return t.filter(((s,e)=>e===0||s.op!=="move"))}},ft=class{constructor(t,s){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new $(s)}draw(t){let s=t.sets||[],e=t.options||this.getDefaultOptions(),n=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(let r of s)switch(r.type){case"path":n.save(),n.strokeStyle=e.stroke==="none"?"transparent":e.stroke,n.lineWidth=e.strokeWidth,e.strokeLineDash&&n.setLineDash(e.strokeLineDash),e.strokeLineDashOffset&&(n.lineDashOffset=e.strokeLineDashOffset),this._drawToContext(n,r,o),n.restore();break;case"fillPath":{n.save(),n.fillStyle=e.fill||"";let h=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(n,r,o,h),n.restore();break}case"fillSketch":this.fillSketch(n,r,e)}}fillSketch(t,s,e){let n=e.fillWeight;n<0&&(n=e.strokeWidth/2),t.save(),e.fillLineDash&&t.setLineDash(e.fillLineDash),e.fillLineDashOffset&&(t.lineDashOffset=e.fillLineDashOffset),t.strokeStyle=e.fill||"",t.lineWidth=n,this._drawToContext(t,s,e.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,s,e,n="nonzero"){t.beginPath();for(let o of s.ops){let r=typeof e=="number"&&e>=0?o.data.map((h=>+h.toFixed(e))):o.data;switch(o.op){case"move":t.moveTo(r[0],r[1]);break;case"bcurveTo":t.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);break;case"lineTo":t.lineTo(r[0],r[1])}}s.type==="fillPath"?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,s,e,n,o){let r=this.gen.line(t,s,e,n,o);return this.draw(r),r}rectangle(t,s,e,n,o){let r=this.gen.rectangle(t,s,e,n,o);return this.draw(r),r}ellipse(t,s,e,n,o){let r=this.gen.ellipse(t,s,e,n,o);return this.draw(r),r}circle(t,s,e,n){let o=this.gen.circle(t,s,e,n);return this.draw(o),o}linearPath(t,s){let e=this.gen.linearPath(t,s);return this.draw(e),e}polygon(t,s){let e=this.gen.polygon(t,s);return this.draw(e),e}arc(t,s,e,n,o,r,h=!1,i){let l=this.gen.arc(t,s,e,n,o,r,h,i);return this.draw(l),l}curve(t,s){let e=this.gen.curve(t,s);return this.draw(e),e}path(t,s){let e=this.gen.path(t,s);return this.draw(e),e}},H="http://www.w3.org/2000/svg",dt=class{constructor(t,s){this.svg=t,this.gen=new $(s)}draw(t){let s=t.sets||[],e=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,o=n.createElementNS(H,"g"),r=t.options.fixedDecimalPlaceDigits;for(let h of s){let i=null;switch(h.type){case"path":i=n.createElementNS(H,"path"),i.setAttribute("d",this.opsToPath(h,r)),i.setAttribute("stroke",e.stroke),i.setAttribute("stroke-width",e.strokeWidth+""),i.setAttribute("fill","none"),e.strokeLineDash&&i.setAttribute("stroke-dasharray",e.strokeLineDash.join(" ").trim()),e.strokeLineDashOffset&&i.setAttribute("stroke-dashoffset",`${e.strokeLineDashOffset}`);break;case"fillPath":i=n.createElementNS(H,"path"),i.setAttribute("d",this.opsToPath(h,r)),i.setAttribute("stroke","none"),i.setAttribute("stroke-width","0"),i.setAttribute("fill",e.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||i.setAttribute("fill-rule","evenodd");break;case"fillSketch":i=this.fillSketch(n,h,e)}i&&o.appendChild(i)}return o}fillSketch(t,s,e){let n=e.fillWeight;n<0&&(n=e.strokeWidth/2);let o=t.createElementNS(H,"path");return o.setAttribute("d",this.opsToPath(s,e.fixedDecimalPlaceDigits)),o.setAttribute("stroke",e.fill||""),o.setAttribute("stroke-width",n+""),o.setAttribute("fill","none"),e.fillLineDash&&o.setAttribute("stroke-dasharray",e.fillLineDash.join(" ").trim()),e.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${e.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,s){return this.gen.opsToPath(t,s)}line(t,s,e,n,o){let r=this.gen.line(t,s,e,n,o);return this.draw(r)}rectangle(t,s,e,n,o){let r=this.gen.rectangle(t,s,e,n,o);return this.draw(r)}ellipse(t,s,e,n,o){let r=this.gen.ellipse(t,s,e,n,o);return this.draw(r)}circle(t,s,e,n){let o=this.gen.circle(t,s,e,n);return this.draw(o)}linearPath(t,s){let e=this.gen.linearPath(t,s);return this.draw(e)}polygon(t,s){let e=this.gen.polygon(t,s);return this.draw(e)}arc(t,s,e,n,o,r,h=!1,i){let l=this.gen.arc(t,s,e,n,o,r,h,i);return this.draw(l)}curve(t,s){let e=this.gen.curve(t,s);return this.draw(e)}path(t,s){let e=this.gen.path(t,s);return this.draw(e)}},Ft={canvas:(a,t)=>new ft(a,t),svg:(a,t)=>new dt(a,t),generator:a=>new $(a),newSeed:()=>$.newSeed()};export{Ft as a};
@@ -0,0 +1,7 @@
1
+ import{G as re,N as se,S as oe,T as le,U as he,V as ce,W as de,X as ue,Y as Et,Z as Tt,h as ne,j as D}from"./chunk-LWDL4HZB.js";import"./chunk-VXPNUNUX.js";import{b as ct,h as mt,o as Dt}from"./chunk-JR4SIX7A.js";import{a as s}from"./chunk-5FIPUNR4.js";import"./chunk-SQE76S5B.js";var zt=(function(){var t=s(function(Y,r,l,u){for(l=l||{},u=Y.length;u--;l[Y[u]]=r);return l},"o"),a=[1,3],p=[1,4],f=[1,5],o=[1,6],x=[1,7],_=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],h=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],c=[55,56,57],k=[2,36],m=[1,37],q=[1,36],y=[1,38],b=[1,35],T=[1,43],g=[1,41],A=[1,45],dt=[1,14],ut=[1,23],xt=[1,18],ft=[1,19],ot=[1,20],St=[1,21],lt=[1,22],i=[1,24],It=[1,25],wt=[1,26],Bt=[1,27],Rt=[1,28],Nt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Wt=[1,66],Ut=[1,67],Qt=[1,68],Ot=[1,69],Ht=[1,70],Xt=[1,71],Mt=[1,72],Yt=[1,73],jt=[1,74],Gt=[1,75],Kt=[1,76],Zt=[1,77],B=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],rt=[1,99],_t=[1,103],Jt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],At={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:s(function(r,l,u,d,S,e,ht){var n=e.length-1;switch(S){case 23:this.$=e[n];break;case 24:this.$=e[n-1]+""+e[n];break;case 26:this.$=e[n-1]+e[n];break;case 27:this.$=[e[n].trim()];break;case 28:e[n-2].push(e[n].trim()),this.$=e[n-2];break;case 29:this.$=e[n-4],d.addClass(e[n-2],e[n]);break;case 37:this.$=[];break;case 42:this.$=e[n].trim(),d.setDiagramTitle(this.$);break;case 43:this.$=e[n].trim(),d.setAccTitle(this.$);break;case 44:case 45:this.$=e[n].trim(),d.setAccDescription(this.$);break;case 46:d.addSection(e[n].substr(8)),this.$=e[n].substr(8);break;case 47:d.addPoint(e[n-3],"",e[n-1],e[n],[]);break;case 48:d.addPoint(e[n-4],e[n-3],e[n-1],e[n],[]);break;case 49:d.addPoint(e[n-4],"",e[n-2],e[n-1],e[n]);break;case 50:d.addPoint(e[n-5],e[n-4],e[n-2],e[n-1],e[n]);break;case 51:d.setXAxisLeftText(e[n-2]),d.setXAxisRightText(e[n]);break;case 52:e[n-1].text+=" \u27F6 ",d.setXAxisLeftText(e[n-1]);break;case 53:d.setXAxisLeftText(e[n]);break;case 54:d.setYAxisBottomText(e[n-2]),d.setYAxisTopText(e[n]);break;case 55:e[n-1].text+=" \u27F6 ",d.setYAxisBottomText(e[n-1]);break;case 56:d.setYAxisBottomText(e[n]);break;case 57:d.setQuadrant1Text(e[n]);break;case 58:d.setQuadrant2Text(e[n]);break;case 59:d.setQuadrant3Text(e[n]);break;case 60:d.setQuadrant4Text(e[n]);break;case 64:this.$={text:e[n],type:"text"};break;case 65:this.$={text:e[n-1].text+""+e[n],type:e[n-1].type};break;case 66:this.$={text:e[n],type:"text"};break;case 67:this.$={text:e[n],type:"markdown"};break;case 68:this.$=e[n];break;case 69:this.$=e[n-1]+""+e[n];break}},"anonymous"),table:[{18:a,26:1,27:2,28:p,55:f,56:o,57:x},{1:[3]},{18:a,26:8,27:2,28:p,55:f,56:o,57:x},{18:a,26:9,27:2,28:p,55:f,56:o,57:x},t(_,[2,33],{29:10}),t(h,[2,61]),t(h,[2,62]),t(h,[2,63]),{1:[2,30]},{1:[2,31]},t(c,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:m,5:q,10:y,12:b,13:T,14:g,15:A,18:dt,25:ut,35:xt,37:ft,39:ot,41:St,42:lt,48:i,50:It,51:wt,52:Bt,53:Rt,54:Nt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(_,[2,34]),{27:46,55:f,56:o,57:x},t(c,[2,37]),t(c,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:m,5:q,10:y,12:b,13:T,14:g,15:A,18:dt,25:ut,35:xt,37:ft,39:ot,41:St,42:lt,48:i,50:It,51:wt,52:Bt,53:Rt,54:Nt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(c,[2,39]),t(c,[2,40]),t(c,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(c,[2,45]),t(c,[2,46]),{18:[1,51]},{4:m,5:q,10:y,12:b,13:T,14:g,15:A,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:q,10:y,12:b,13:T,14:g,15:A,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:q,10:y,12:b,13:T,14:g,15:A,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:q,10:y,12:b,13:T,14:g,15:A,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:q,10:y,12:b,13:T,14:g,15:A,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:q,10:y,12:b,13:T,14:g,15:A,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:q,8:H,10:y,12:b,13:T,14:g,15:A,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(_,[2,35]),t(c,[2,38]),t(c,[2,42]),t(c,[2,43]),t(c,[2,44]),{3:65,4:Wt,5:Ut,6:Qt,7:Ot,8:Ht,9:Xt,10:Mt,11:Yt,12:jt,13:Gt,14:Kt,15:Zt,21:64},t(c,[2,53],{59:60,58:61,4:m,5:q,8:H,10:y,12:b,13:T,14:g,15:A,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(c,[2,56],{59:60,58:61,4:m,5:q,8:H,10:y,12:b,13:T,14:g,15:A,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(c,[2,57],{59:60,58:61,4:m,5:q,8:H,10:y,12:b,13:T,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,58],{59:60,58:61,4:m,5:q,8:H,10:y,12:b,13:T,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,59],{59:60,58:61,4:m,5:q,8:H,10:y,12:b,13:T,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,60],{59:60,58:61,4:m,5:q,8:H,10:y,12:b,13:T,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Wt,5:Ut,6:Qt,7:Ot,8:Ht,9:Xt,10:Mt,11:Yt,12:jt,13:Gt,14:Kt,15:Zt,18:[1,82]},t(B,[2,23]),t(B,[2,1]),t(B,[2,2]),t(B,[2,3]),t(B,[2,4]),t(B,[2,5]),t(B,[2,6]),t(B,[2,7]),t(B,[2,8]),t(B,[2,9]),t(B,[2,10]),t(B,[2,11]),t(B,[2,12]),t(c,[2,52],{58:31,43:84,4:m,5:q,10:y,12:b,13:T,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(c,[2,55],{58:31,43:85,4:m,5:q,10:y,12:b,13:T,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:rt,22:89,23:88},t(B,[2,24]),t(c,[2,51],{59:60,58:61,4:m,5:q,8:H,10:y,12:b,13:T,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,54],{59:60,58:61,4:m,5:q,8:H,10:y,12:b,13:T,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:rt}),{46:[1,102]},t(c,[2,29],{10:_t}),t(Jt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:rt}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(c,[2,49],{10:_t}),t(c,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:rt}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:rt,22:106},t(N,[2,26]),t(c,[2,50],{10:_t}),t(Jt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:rt})],defaultActions:{8:[2,30],9:[2,31]},parseError:s(function(r,l){if(l.recoverable)this.trace(r);else{var u=new Error(r);throw u.hash=l,u}},"parseError"),parse:s(function(r){var l=this,u=[0],d=[],S=[null],e=[],ht=this.table,n="",pt=0,$t=0,te=0,Ce=2,ee=1,Le=e.slice.call(arguments,1),z=Object.create(this.lexer),j={yy:{}};for(var Ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ft)&&(j.yy[Ft]=this.yy[Ft]);z.setInput(r,j.yy),j.yy.lexer=z,j.yy.parser=this,typeof z.yylloc>"u"&&(z.yylloc={});var Pt=z.yylloc;e.push(Pt);var Ee=z.options&&z.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function De(R){u.length=u.length-2*R,S.length=S.length-R,e.length=e.length-R}s(De,"popStack");function ie(){var R;return R=d.pop()||z.lex()||ee,typeof R!="number"&&(R instanceof Array&&(d=R,R=d.pop()),R=l.symbols_[R]||R),R}s(ie,"lex");for(var I,vt,G,W,Ne,Ct,st={},yt,M,ae,bt;;){if(G=u[u.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((I===null||typeof I>"u")&&(I=ie()),W=ht[G]&&ht[G][I]),typeof W>"u"||!W.length||!W[0]){var Lt="";bt=[];for(yt in ht[G])this.terminals_[yt]&&yt>Ce&&bt.push("'"+this.terminals_[yt]+"'");z.showPosition?Lt="Parse error on line "+(pt+1)+`:
2
+ `+z.showPosition()+`
3
+ Expecting `+bt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Lt="Parse error on line "+(pt+1)+": Unexpected "+(I==ee?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Lt,{text:z.match,token:this.terminals_[I]||I,line:z.yylineno,loc:Pt,expected:bt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+I);switch(W[0]){case 1:u.push(I),S.push(z.yytext),e.push(z.yylloc),u.push(W[1]),I=null,vt?(I=vt,vt=null):($t=z.yyleng,n=z.yytext,pt=z.yylineno,Pt=z.yylloc,te>0&&te--);break;case 2:if(M=this.productions_[W[1]][1],st.$=S[S.length-M],st._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},Ee&&(st._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),Ct=this.performAction.apply(st,[n,$t,pt,j.yy,W[1],S,e].concat(Le)),typeof Ct<"u")return Ct;M&&(u=u.slice(0,-1*M*2),S=S.slice(0,-1*M),e=e.slice(0,-1*M)),u.push(this.productions_[W[1]][0]),S.push(st.$),e.push(st._$),ae=ht[u[u.length-2]][u[u.length-1]],u.push(ae);break;case 3:return!0}}return!0},"parse")},ve=(function(){var Y={EOF:1,parseError:s(function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},"parseError"),setInput:s(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var l=r.length,u=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),u.length-1&&(this.yylineno-=u.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:u?(u.length===d.length?this.yylloc.first_column:0)+d[d.length-u.length].length-u[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
5
+ `+l+"^"},"showPosition"),test_match:s(function(r,l){var u,d,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),d=r[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],u=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var e in S)this[e]=S[e];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,l,u,d;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),e=0;e<S.length;e++)if(u=this._input.match(this.rules[S[e]]),u&&(!l||u[0].length>l[0].length)){if(l=u,d=e,this.options.backtrack_lexer){if(r=this.test_match(u,S[e]),r!==!1)return r;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(r=this.test_match(l,S[d]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:s(function(){var l=this.next();return l||this.lex()},"lex"),begin:s(function(l){this.conditionStack.push(l)},"begin"),popState:s(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:s(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:s(function(l){this.begin(l)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(l,u,d,S){var e=S;switch(d){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;break;case 5:return this.popState(),"title_value";break;case 6:return this.begin("acc_title"),37;break;case 7:return this.popState(),"acc_title_value";break;case 8:return this.begin("acc_descr"),39;break;case 9:return this.popState(),"acc_descr_value";break;case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;break;case 29:return this.begin("point_start"),44;break;case 30:return this.begin("point_x"),45;break;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;break;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return Y})();At.lexer=ve;function gt(){this.yy={}}return s(gt,"Parser"),gt.prototype=At,At.Parser=gt,new gt})();zt.parser=zt;var ze=zt,w=ne(),Ve=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{s(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:D.quadrantChart?.chartWidth||500,chartWidth:D.quadrantChart?.chartHeight||500,titlePadding:D.quadrantChart?.titlePadding||10,titleFontSize:D.quadrantChart?.titleFontSize||20,quadrantPadding:D.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:D.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:D.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:D.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:D.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:D.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:D.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:D.quadrantChart?.pointTextPadding||5,pointLabelFontSize:D.quadrantChart?.pointLabelFontSize||12,pointRadius:D.quadrantChart?.pointRadius||5,xAxisPosition:D.quadrantChart?.xAxisPosition||"top",yAxisPosition:D.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:D.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:D.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:w.quadrant1Fill,quadrant2Fill:w.quadrant2Fill,quadrant3Fill:w.quadrant3Fill,quadrant4Fill:w.quadrant4Fill,quadrant1TextFill:w.quadrant1TextFill,quadrant2TextFill:w.quadrant2TextFill,quadrant3TextFill:w.quadrant3TextFill,quadrant4TextFill:w.quadrant4TextFill,quadrantPointFill:w.quadrantPointFill,quadrantPointTextFill:w.quadrantPointTextFill,quadrantXAxisTextFill:w.quadrantXAxisTextFill,quadrantYAxisTextFill:w.quadrantYAxisTextFill,quadrantTitleFill:w.quadrantTitleFill,quadrantInternalBorderStrokeFill:w.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:w.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,ct.info("clear called")}setData(t){this.data={...this.data,...t}}addPoints(t){this.data.points=[...t,...this.data.points]}addClass(t,a){this.classes.set(t,a)}setConfig(t){ct.trace("setConfig called with: ",t),this.config={...this.config,...t}}setThemeConfig(t){ct.trace("setThemeConfig called with: ",t),this.themeConfig={...this.themeConfig,...t}}calculateSpace(t,a,p,f){let o=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,x={top:t==="top"&&a?o:0,bottom:t==="bottom"&&a?o:0},_=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,h={left:this.config.yAxisPosition==="left"&&p?_:0,right:this.config.yAxisPosition==="right"&&p?_:0},c=this.config.titleFontSize+this.config.titlePadding*2,k={top:f?c:0},m=this.config.quadrantPadding+h.left,q=this.config.quadrantPadding+x.top+k.top,y=this.config.chartWidth-this.config.quadrantPadding*2-h.left-h.right,b=this.config.chartHeight-this.config.quadrantPadding*2-x.top-x.bottom-k.top,T=y/2,g=b/2;return{xAxisSpace:x,yAxisSpace:h,titleSpace:k,quadrantSpace:{quadrantLeft:m,quadrantTop:q,quadrantWidth:y,quadrantHalfWidth:T,quadrantHeight:b,quadrantHalfHeight:g}}}getAxisLabels(t,a,p,f){let{quadrantSpace:o,titleSpace:x}=f,{quadrantHalfHeight:_,quadrantHeight:h,quadrantLeft:c,quadrantHalfWidth:k,quadrantTop:m,quadrantWidth:q}=o,y=!!this.data.xAxisRightText,b=!!this.data.yAxisTopText,T=[];return this.data.xAxisLeftText&&a&&T.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:c+(y?k/2:0),y:t==="top"?this.config.xAxisLabelPadding+x.top:this.config.xAxisLabelPadding+m+h+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:y?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&a&&T.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:c+k+(y?k/2:0),y:t==="top"?this.config.xAxisLabelPadding+x.top:this.config.xAxisLabelPadding+m+h+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:y?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&p&&T.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+c+q+this.config.quadrantPadding,y:m+h-(b?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:b?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&p&&T.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+c+q+this.config.quadrantPadding,y:m+_-(b?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:b?"center":"left",horizontalPos:"top",rotation:-90}),T}getQuadrants(t){let{quadrantSpace:a}=t,{quadrantHalfHeight:p,quadrantLeft:f,quadrantHalfWidth:o,quadrantTop:x}=a,_=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f+o,y:x,width:o,height:p,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f,y:x,width:o,height:p,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f,y:x+p,width:o,height:p,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f+o,y:x+p,width:o,height:p,fill:this.themeConfig.quadrant4Fill}];for(let h of _)h.text.x=h.x+h.width/2,this.data.points.length===0?(h.text.y=h.y+h.height/2,h.text.horizontalPos="middle"):(h.text.y=h.y+this.config.quadrantTextTopPadding,h.text.horizontalPos="top");return _}getQuadrantPoints(t){let{quadrantSpace:a}=t,{quadrantHeight:p,quadrantLeft:f,quadrantTop:o,quadrantWidth:x}=a,_=Dt().domain([0,1]).range([f,x+f]),h=Dt().domain([0,1]).range([p+o,o]);return this.data.points.map(k=>{let m=this.classes.get(k.className);return m&&(k={...m,...k}),{x:_(k.x),y:h(k.y),fill:k.color??this.themeConfig.quadrantPointFill,radius:k.radius??this.config.pointRadius,text:{text:k.text,fill:this.themeConfig.quadrantPointTextFill,x:_(k.x),y:h(k.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:k.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:k.strokeWidth??"0px"}})}getBorders(t){let a=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:p}=t,{quadrantHalfHeight:f,quadrantHeight:o,quadrantLeft:x,quadrantHalfWidth:_,quadrantTop:h,quadrantWidth:c}=p;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x-a,y1:h,x2:x+c+a,y2:h},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x+c,y1:h+a,x2:x+c,y2:h+o-a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x-a,y1:h+o,x2:x+c+a,y2:h+o},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x,y1:h+a,x2:x,y2:h+o-a},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:x+_,y1:h+a,x2:x+_,y2:h+o-a},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:x+a,y1:h+f,x2:x+c-a,y2:h+f}]}getTitle(t){if(t)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){let t=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),a=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),p=this.config.showTitle&&!!this.data.titleText,f=this.data.points.length>0?"bottom":this.config.xAxisPosition,o=this.calculateSpace(f,t,a,p);return{points:this.getQuadrantPoints(o),quadrants:this.getQuadrants(o),axisLabels:this.getAxisLabels(f,t,a,o),borderLines:this.getBorders(o),title:this.getTitle(p)}}},qt=class extends Error{static{s(this,"InvalidStyleError")}constructor(t,a,p){super(`value for ${t} ${a} is invalid, please use a valid ${p}`),this.name="InvalidStyleError"}};function Vt(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}s(Vt,"validateHexCode");function xe(t){return!/^\d+$/.test(t)}s(xe,"validateNumber");function fe(t){return!/^\d+px$/.test(t)}s(fe,"validateSizeInPixels");function O(t){return re(t.trim(),Tt())}s(O,"textSanitizer");var V=new Ve;function ge(t){V.setData({quadrant1Text:O(t.text)})}s(ge,"setQuadrant1Text");function pe(t){V.setData({quadrant2Text:O(t.text)})}s(pe,"setQuadrant2Text");function ye(t){V.setData({quadrant3Text:O(t.text)})}s(ye,"setQuadrant3Text");function be(t){V.setData({quadrant4Text:O(t.text)})}s(be,"setQuadrant4Text");function Te(t){V.setData({xAxisLeftText:O(t.text)})}s(Te,"setXAxisLeftText");function me(t){V.setData({xAxisRightText:O(t.text)})}s(me,"setXAxisRightText");function qe(t){V.setData({yAxisTopText:O(t.text)})}s(qe,"setYAxisTopText");function ke(t){V.setData({yAxisBottomText:O(t.text)})}s(ke,"setYAxisBottomText");function kt(t){let a={};for(let p of t){let[f,o]=p.trim().split(/\s*:\s*/);if(f==="radius"){if(xe(o))throw new qt(f,o,"number");a.radius=parseInt(o)}else if(f==="color"){if(Vt(o))throw new qt(f,o,"hex code");a.color=o}else if(f==="stroke-color"){if(Vt(o))throw new qt(f,o,"hex code");a.strokeColor=o}else if(f==="stroke-width"){if(fe(o))throw new qt(f,o,"number of pixels (eg. 10px)");a.strokeWidth=o}else throw new Error(`style named ${f} is not supported.`)}return a}s(kt,"parseStyles");function Se(t,a,p,f,o){let x=kt(o);V.addPoints([{x:p,y:f,text:O(t.text),className:a,...x}])}s(Se,"addPoint");function _e(t,a){V.addClass(t,kt(a))}s(_e,"addClass");function Ae(t){V.setConfig({chartWidth:t})}s(Ae,"setWidth");function Fe(t){V.setConfig({chartHeight:t})}s(Fe,"setHeight");function Pe(){let t=Tt(),{themeVariables:a,quadrantChart:p}=t;return p&&V.setConfig(p),V.setThemeConfig({quadrant1Fill:a.quadrant1Fill,quadrant2Fill:a.quadrant2Fill,quadrant3Fill:a.quadrant3Fill,quadrant4Fill:a.quadrant4Fill,quadrant1TextFill:a.quadrant1TextFill,quadrant2TextFill:a.quadrant2TextFill,quadrant3TextFill:a.quadrant3TextFill,quadrant4TextFill:a.quadrant4TextFill,quadrantPointFill:a.quadrantPointFill,quadrantPointTextFill:a.quadrantPointTextFill,quadrantXAxisTextFill:a.quadrantXAxisTextFill,quadrantYAxisTextFill:a.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:a.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:a.quadrantInternalBorderStrokeFill,quadrantTitleFill:a.quadrantTitleFill}),V.setData({titleText:Et()}),V.build()}s(Pe,"getQuadrantData");var Ie=s(function(){V.clear(),oe()},"clear"),we={setWidth:Ae,setHeight:Fe,setQuadrant1Text:ge,setQuadrant2Text:pe,setQuadrant3Text:ye,setQuadrant4Text:be,setXAxisLeftText:Te,setXAxisRightText:me,setYAxisTopText:qe,setYAxisBottomText:ke,parseStyles:kt,addPoint:Se,addClass:_e,getQuadrantData:Pe,clear:Ie,setAccTitle:le,getAccTitle:he,setDiagramTitle:ue,getDiagramTitle:Et,getAccDescription:de,setAccDescription:ce},Be=s((t,a,p,f)=>{function o(i){return i==="top"?"hanging":"middle"}s(o,"getDominantBaseLine");function x(i){return i==="left"?"start":"middle"}s(x,"getTextAnchor");function _(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}s(_,"getTransformation");let h=Tt();ct.debug(`Rendering quadrant chart
7
+ `+t);let c=h.securityLevel,k;c==="sandbox"&&(k=mt("#i"+a));let q=(c==="sandbox"?mt(k.nodes()[0].contentDocument.body):mt("body")).select(`[id="${a}"]`),y=q.append("g").attr("class","main"),b=h.quadrantChart?.chartWidth??500,T=h.quadrantChart?.chartHeight??500;se(q,T,b,h.quadrantChart?.useMaxWidth??!0),q.attr("viewBox","0 0 "+b+" "+T),f.db.setHeight(T),f.db.setWidth(b);let g=f.db.getQuadrantData(),A=y.append("g").attr("class","quadrants"),dt=y.append("g").attr("class","border"),ut=y.append("g").attr("class","data-points"),xt=y.append("g").attr("class","labels"),ft=y.append("g").attr("class","title");g.title&&ft.append("text").attr("x",0).attr("y",0).attr("fill",g.title.fill).attr("font-size",g.title.fontSize).attr("dominant-baseline",o(g.title.horizontalPos)).attr("text-anchor",x(g.title.verticalPos)).attr("transform",_(g.title)).text(g.title.text),g.borderLines&&dt.selectAll("line").data(g.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);let ot=A.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class","quadrant");ot.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ot.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>o(i.text.horizontalPos)).attr("text-anchor",i=>x(i.text.verticalPos)).attr("transform",i=>_(i.text)).text(i=>i.text.text),xt.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>o(i.horizontalPos)).attr("text-anchor",i=>x(i.verticalPos)).attr("transform",i=>_(i));let lt=ut.selectAll("g.data-point").data(g.points).enter().append("g").attr("class","data-point");lt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),lt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>o(i.text.horizontalPos)).attr("text-anchor",i=>x(i.text.verticalPos)).attr("transform",i=>_(i.text))},"draw"),Re={draw:Be},Xe={parser:ze,db:we,renderer:Re,styles:s(()=>"","styles")};export{Xe as diagram};
@@ -0,0 +1 @@
1
+ import"./chunk-SQE76S5B.js";function D(e){let t=e.regex,o="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",b=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),a=t.concat(b,/(::\w+)*/),n={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},_={className:"doctag",begin:"@[A-Za-z]+"},r={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[_]}),e.COMMENT("^=begin","^=end",{contains:[_],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],i={className:"subst",begin:/#\{/,end:/\}/,keywords:n},E={className:"string",contains:[e.BACKSLASH_ESCAPE,i],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,i]})]}]},g="[1-9](_?[0-9])*|0",d="[0-9](_?[0-9])*",N={className:"number",relevance:0,variants:[{begin:`\\b(${g})(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},l={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:n}]},s=[E,{variants:[{match:[/class\s+/,a,/\s+<\s+/,a]},{match:[/\b(class|module)\s+/,a]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:n},{match:[/(include|extend)\s+/,a],scope:{2:"title.class"},keywords:n},{relevance:0,match:[a,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:b,scope:"title.class"},{match:[/def/,/\s+/,o],scope:{1:"keyword",3:"title.function"},contains:[l]},{begin:"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[E,{begin:o}],relevance:0},N,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:n},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,i],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(r,c),relevance:0}].concat(r,c);i.contains=s,l.contains=s;let A=[{begin:/^\s*=>/,starts:{end:"$",contains:s}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:n,contains:s}}];return c.unshift(r),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:n,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(A).concat(c).concat(s)}}export{D as default};
@@ -0,0 +1 @@
1
+ import{a as r,b as s,c as l,d as a,e as c,g as v,j as u,x as E,y as m}from"./chunk-CUS65DKZ.js";var V=class extends m{static{r(this,"EventModelingTokenBuilder")}constructor(){super(["eventmodeling"])}},S=new Set(["cmd","command"]),y=new Set(["evt","event"]),d=new Set(["rmo","readmodel"]),h=new Set(["pcr","processor"]),M=new Set(["ui"]);function T(e){let t=e.validation.EventModelingValidator,o=e.validation.ValidationRegistry;if(o){let i={EmTimeFrame:t.checkSourceFrameTypes.bind(t),EmResetFrame:t.checkSourceFrameTypes.bind(t)};o.register(i,t)}}r(T,"registerValidationChecks");var k=class{static{r(this,"EventModelingValidator")}checkSourceFrameTypes(e,t){e.sourceFrames.length!==0&&(S.has(e.modelEntityType)?this.validateSources(e,new Set([...M,...h]),"command","ui or processor",t):y.has(e.modelEntityType)?this.validateSources(e,S,"event","command",t):d.has(e.modelEntityType)?this.validateSources(e,y,"read model","event",t):h.has(e.modelEntityType)?this.validateSources(e,d,"processor","read model",t):M.has(e.modelEntityType)&&this.validateSources(e,d,"ui","read model",t))}validateSources(e,t,o,i,g){for(let p of e.sourceFrames){let n=p.ref;n!==void 0&&!t.has(n.modelEntityType)&&g("error",`A ${o} can only receive input from a ${i}, not from '${n.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},C={parser:{TokenBuilder:r(()=>new V,"TokenBuilder"),ValueConverter:r(()=>new E,"ValueConverter")},validation:{EventModelingValidator:r(()=>new k,"EventModelingValidator")}};function w(e=c){let t=a(l(e),v),o=a(s({shared:t}),u,C);return t.ServiceRegistry.register(o),T(o),{shared:t,EventModel:o}}r(w,"createEventModelingServices");export{C as a,w as b};