@meetquinn/animactl 0.1.30 → 0.1.31

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 (116) hide show
  1. package/dist/server/cli/cli-errors.js +4 -0
  2. package/dist/server/messages/contact-policy.service.d.ts +9 -0
  3. package/dist/server/messages/contact-policy.service.d.ts.map +1 -1
  4. package/dist/server/messages/contact-policy.service.js +44 -16
  5. package/dist/server/tests/contact-policy.test.js +45 -4
  6. package/dist/web/assets/{FileViewer-2hthjdQD.js → FileViewer-BtzV0xCy.js} +3 -3
  7. package/dist/web/assets/{OwnerPickerForm-BOG15_5q.js → OwnerPickerForm-Dad51XVK.js} +1 -1
  8. package/dist/web/assets/{SlackTimeline-DJMHtjVN.js → SlackTimeline-CEQmQliZ.js} +1 -1
  9. package/dist/web/assets/{UsageHeatmap-DIM_N0fI.js → UsageHeatmap-BW-EDtlf.js} +1 -1
  10. package/dist/web/assets/{activity-CF_uXyqx.js → activity-DxOg0Zpw.js} +1 -1
  11. package/dist/web/assets/{arc-DN3rV-nI.js → arc-fS3jqr6M.js} +1 -1
  12. package/dist/web/assets/architecture-7EHR7CIX-JFavxCHZ.js +1 -0
  13. package/dist/web/assets/{architectureDiagram-3BPJPVTR-BjOQPVOb.js → architectureDiagram-3BPJPVTR-CDsOHh13.js} +1 -1
  14. package/dist/web/assets/arrow-right-rNbgcgPM.js +1 -0
  15. package/dist/web/assets/{blockDiagram-GPEHLZMM-CxnJJyNZ.js → blockDiagram-GPEHLZMM-Dafvh8yC.js} +1 -1
  16. package/dist/web/assets/{c4Diagram-AAUBKEIU-MJtkpqPP.js → c4Diagram-AAUBKEIU-BqFnkKWL.js} +1 -1
  17. package/dist/web/assets/channel-CM3nHrAD.js +1 -0
  18. package/dist/web/assets/{channels-DAmTOZbW.js → channels-CFYn9Uzy.js} +1 -1
  19. package/dist/web/assets/{chunk-2J33WTMH-DH7F6Toz.js → chunk-2J33WTMH-BEmf3Qku.js} +1 -1
  20. package/dist/web/assets/{chunk-3OPIFGDE-SXmEESKD.js → chunk-3OPIFGDE-CtmMZbUU.js} +1 -1
  21. package/dist/web/assets/{chunk-4BX2VUAB-DB0OPa2S.js → chunk-4BX2VUAB-CacBYgOE.js} +1 -1
  22. package/dist/web/assets/{chunk-55IACEB6-DGr-WOhv.js → chunk-55IACEB6-BXURqjLZ.js} +1 -1
  23. package/dist/web/assets/{chunk-5ZQYHXKU-Vgr4jBt1.js → chunk-5ZQYHXKU-D_5qZ4Zv.js} +1 -1
  24. package/dist/web/assets/{chunk-727SXJPM-CWaX9Qk5.js → chunk-727SXJPM-BU31EEG5.js} +1 -1
  25. package/dist/web/assets/{chunk-AQP2D5EJ-CFTKUNkn.js → chunk-AQP2D5EJ-DTtKK5xv.js} +1 -1
  26. package/dist/web/assets/{chunk-BSJP7CBP-DD2WqzXl.js → chunk-BSJP7CBP-C5nluir4.js} +1 -1
  27. package/dist/web/assets/{chunk-CSCIHK7Q-xxNdF5BX.js → chunk-CSCIHK7Q-BeNiRoDm.js} +3 -3
  28. package/dist/web/assets/{chunk-FMBD7UC4-D637Lg0-.js → chunk-FMBD7UC4-LV5XAtCz.js} +1 -1
  29. package/dist/web/assets/{chunk-KSCS5N6A-B9pu9Zdk.js → chunk-KSCS5N6A-D80hU7za.js} +1 -1
  30. package/dist/web/assets/{chunk-L5ZTLDWV-DYHe5z-p.js → chunk-L5ZTLDWV-DtSiy2JS.js} +1 -1
  31. package/dist/web/assets/{chunk-LZXEDZCA-C2A3MD3P.js → chunk-LZXEDZCA-CFWlwpSj.js} +2 -2
  32. package/dist/web/assets/{chunk-ND2GUHAM-CzVnJeg1.js → chunk-ND2GUHAM-Cks69kWo.js} +1 -1
  33. package/dist/web/assets/{chunk-NZK2D7GU-Bi3zqbUv.js → chunk-NZK2D7GU-BKDBTHUK.js} +1 -1
  34. package/dist/web/assets/{chunk-O5CBEL6O-B7YJjftf.js → chunk-O5CBEL6O-Dh_KkhDf.js} +1 -1
  35. package/dist/web/assets/chunk-QZHKN3VN-CXmYofd4.js +1 -0
  36. package/dist/web/assets/chunk-WU5MYG2G-BAvj0V8I.js +1 -0
  37. package/dist/web/assets/{chunk-XPW4576I-BRwQ5uRX.js → chunk-XPW4576I-BaeieIoE.js} +1 -1
  38. package/dist/web/assets/classDiagram-4FO5ZUOK-CqWCXo7M.js +1 -0
  39. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-CqWCXo7M.js +1 -0
  40. package/dist/web/assets/{copy-CrJlq9AF.js → copy-DI3PIiTH.js} +1 -1
  41. package/dist/web/assets/{cose-bilkent-S5V4N54A-T1Va7b5W.js → cose-bilkent-S5V4N54A-Illz9lmk.js} +1 -1
  42. package/dist/web/assets/{dagre-BM42HDAG-BP0-K47r.js → dagre-BM42HDAG-uzpuT_vy.js} +1 -1
  43. package/dist/web/assets/{diagram-2AECGRRQ-CezL6GWB.js → diagram-2AECGRRQ-BCPKQqtp.js} +1 -1
  44. package/dist/web/assets/{diagram-5GNKFQAL-DAToGWTN.js → diagram-5GNKFQAL-ComD16wh.js} +1 -1
  45. package/dist/web/assets/{diagram-KO2AKTUF-CkbuKqVt.js → diagram-KO2AKTUF-BzSas2Wg.js} +1 -1
  46. package/dist/web/assets/{diagram-LMA3HP47-Ccw5LzTI.js → diagram-LMA3HP47-Di6iEw3F.js} +1 -1
  47. package/dist/web/assets/{diagram-OG6HWLK6-DM8PEKD_.js → diagram-OG6HWLK6-BiJvsy5z.js} +1 -1
  48. package/dist/web/assets/{dist-CwHmnwO6.js → dist-BVWlbvC4.js} +1 -1
  49. package/dist/web/assets/{erDiagram-TEJ5UH35-DtZHusNf.js → erDiagram-TEJ5UH35-2dFfOUHh.js} +1 -1
  50. package/dist/web/assets/eventmodeling-FCH6USID-BHZ_hWV_.js +1 -0
  51. package/dist/web/assets/{files-BySZvVoJ.js → files-fW_iAV7E.js} +1 -1
  52. package/dist/web/assets/{flowDiagram-I6XJVG4X-BtiRpY_v.js → flowDiagram-I6XJVG4X-DENcgZKO.js} +1 -1
  53. package/dist/web/assets/{ganttDiagram-6RSMTGT7-CvsbKTJa.js → ganttDiagram-6RSMTGT7-CGsf5ccc.js} +1 -1
  54. package/dist/web/assets/gitGraph-WXDBUCRP-DhWA66Cy.js +1 -0
  55. package/dist/web/assets/{gitGraphDiagram-PVQCEYII-D2UEiEmu.js → gitGraphDiagram-PVQCEYII-BQIgIegs.js} +1 -1
  56. package/dist/web/assets/{index-CbAhFc-0.js → index-DlHETnHC.js} +2 -2
  57. package/dist/web/assets/info-J43DQDTF-CEcqsbJ5.js +1 -0
  58. package/dist/web/assets/{infoDiagram-5YYISTIA-C1JIXj0K.js → infoDiagram-5YYISTIA-MrkM0y-m.js} +1 -1
  59. package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-CrV-BAK2.js → ishikawaDiagram-YF4QCWOH-Dr8UsvPX.js} +1 -1
  60. package/dist/web/assets/{journeyDiagram-JHISSGLW-C5UZDjPg.js → journeyDiagram-JHISSGLW-DGypTGb1.js} +1 -1
  61. package/dist/web/assets/{kanban-definition-UN3LZRKU-CmAcW_Gm.js → kanban-definition-UN3LZRKU-yYXyv91m.js} +1 -1
  62. package/dist/web/assets/{kb-CrNRBaRa.js → kb-f003GncV.js} +1 -1
  63. package/dist/web/assets/{lightbulb-BZTBGg7G.js → lightbulb-17VUUl6S.js} +1 -1
  64. package/dist/web/assets/{line-BeG27-zH.js → line-CX3cghIS.js} +1 -1
  65. package/dist/web/assets/{linear-D6Qub4j1.js → linear-87q8d4nG.js} +1 -1
  66. package/dist/web/assets/{login-DF6d0xuk.js → login-DptYMeSz.js} +1 -1
  67. package/dist/web/assets/{mermaid-parser.core-OQrfCf7Q.js → mermaid-parser.core-DZTDfv4-.js} +2 -2
  68. package/dist/web/assets/{mermaid.core-DnM6i6kF.js → mermaid.core-BhLaljEz.js} +3 -3
  69. package/dist/web/assets/{mindmap-definition-RKZ34NQL-C90Pg8IG.js → mindmap-definition-RKZ34NQL-Cgrh68Ws.js} +1 -1
  70. package/dist/web/assets/{onboarding-Ds4m8CzL.js → onboarding-CGAqAgFX.js} +1 -1
  71. package/dist/web/assets/packet-YPE3B663-BmMYdqRg.js +1 -0
  72. package/dist/web/assets/pie-LRSECV5Y-1wIF2xtw.js +1 -0
  73. package/dist/web/assets/{pieDiagram-4H26LBE5-DMHbg7t6.js → pieDiagram-4H26LBE5-CsIniA7U.js} +1 -1
  74. package/dist/web/assets/{profile-D8xJTQW-.js → profile-BCiWQjvh.js} +1 -1
  75. package/dist/web/assets/{quadrantDiagram-W4KKPZXB-CdlyTllG.js → quadrantDiagram-W4KKPZXB-ppRpf4TS.js} +1 -1
  76. package/dist/web/assets/radar-GUYGQ44K-p1z2JqZu.js +1 -0
  77. package/dist/web/assets/{reminders-Cls3R6H7.js → reminders-CYmvRDWq.js} +1 -1
  78. package/dist/web/assets/{requirementDiagram-4Y6WPE33-CJJ8Lrck.js → requirementDiagram-4Y6WPE33-lnX3NUSy.js} +1 -1
  79. package/dist/web/assets/{sankeyDiagram-5OEKKPKP-BGraj5n6.js → sankeyDiagram-5OEKKPKP-DGuhoGFR.js} +1 -1
  80. package/dist/web/assets/search-BB_1c6y5.js +1 -0
  81. package/dist/web/assets/{sequenceDiagram-3UESZ5HK-B8g-XwoX.js → sequenceDiagram-3UESZ5HK-C-LlJv8b.js} +1 -1
  82. package/dist/web/assets/{settings-9rtkfxfO.js → settings-BfsiJmaF.js} +1 -1
  83. package/dist/web/assets/{src-DOSXYjwH.js → src-B2YqOS_g.js} +1 -1
  84. package/dist/web/assets/{stateDiagram-AJRCARHV-tzHGG25a.js → stateDiagram-AJRCARHV-m_XE9xkX.js} +1 -1
  85. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-eKkkGk4l.js +1 -0
  86. package/dist/web/assets/{timeline-definition-PNZ67QCA-Bm5F6kuI.js → timeline-definition-PNZ67QCA-BD126VRM.js} +1 -1
  87. package/dist/web/assets/treeView-BLDUP644-Bt9NKcs-.js +1 -0
  88. package/dist/web/assets/treemap-LRROVOQU-Bw9RdNCX.js +1 -0
  89. package/dist/web/assets/{useInfiniteQuery-D4aujXNJ.js → useInfiniteQuery-BYCmT0Iw.js} +1 -1
  90. package/dist/web/assets/{useNow-BwVNU1Kt.js → useNow-BbEkaqh-.js} +1 -1
  91. package/dist/web/assets/{vennDiagram-CIIHVFJN-CD9fmg50.js → vennDiagram-CIIHVFJN-DLM0FNBN.js} +1 -1
  92. package/dist/web/assets/wardley-L42UT6IY-DpsUZBpc.js +1 -0
  93. package/dist/web/assets/{wardleyDiagram-YWT4CUSO-CKu3d4sB.js → wardleyDiagram-YWT4CUSO-DQgt20IC.js} +1 -1
  94. package/dist/web/assets/{xychartDiagram-2RQKCTM6-CRRLjHSX.js → xychartDiagram-2RQKCTM6-CUCAmkCj.js} +1 -1
  95. package/dist/web/index.html +1 -1
  96. package/docs/agent/guide.md +1 -2
  97. package/docs/guide/working-with-your-agent.md +1 -1
  98. package/package.json +1 -1
  99. package/dist/web/assets/architecture-7EHR7CIX-DU_giWjw.js +0 -1
  100. package/dist/web/assets/arrow-right-Da05Wwlp.js +0 -1
  101. package/dist/web/assets/channel-BfxUxG5f.js +0 -1
  102. package/dist/web/assets/chunk-QZHKN3VN-NhFAU-9O.js +0 -1
  103. package/dist/web/assets/chunk-WU5MYG2G-CZXAqd3y.js +0 -1
  104. package/dist/web/assets/classDiagram-4FO5ZUOK-Dy777uwp.js +0 -1
  105. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-Dy777uwp.js +0 -1
  106. package/dist/web/assets/eventmodeling-FCH6USID-CDO-goTv.js +0 -1
  107. package/dist/web/assets/gitGraph-WXDBUCRP-Cn7wn299.js +0 -1
  108. package/dist/web/assets/info-J43DQDTF-BHUyVizh.js +0 -1
  109. package/dist/web/assets/packet-YPE3B663-B_2RTGcc.js +0 -1
  110. package/dist/web/assets/pie-LRSECV5Y-ieCDED7Y.js +0 -1
  111. package/dist/web/assets/radar-GUYGQ44K-CpqbrBX-.js +0 -1
  112. package/dist/web/assets/search-BoEnT13J.js +0 -1
  113. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-DeLaPJhU.js +0 -1
  114. package/dist/web/assets/treeView-BLDUP644-WRDNuShD.js +0 -1
  115. package/dist/web/assets/treemap-LRROVOQU-BlaZCSii.js +0 -1
  116. package/dist/web/assets/wardley-L42UT6IY-C-Xkgr9M.js +0 -1
@@ -1,6 +1,6 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/c4Diagram-AAUBKEIU-MJtkpqPP.js","assets/dist-CwHmnwO6.js","assets/index-CbAhFc-0.js","assets/index-DIncpmwE.css","assets/src-DOSXYjwH.js","assets/chunk-5ZQYHXKU-Vgr4jBt1.js","assets/chunk-CSCIHK7Q-xxNdF5BX.js","assets/FileViewer-2hthjdQD.js","assets/useNow-BwVNU1Kt.js","assets/copy-CrJlq9AF.js","assets/lightbulb-BZTBGg7G.js","assets/FileViewer-DEcVZfaU.css","assets/chunk-ND2GUHAM-CzVnJeg1.js","assets/flowDiagram-I6XJVG4X-BtiRpY_v.js","assets/chunk-O5CBEL6O-B7YJjftf.js","assets/channel-BfxUxG5f.js","assets/chunk-2J33WTMH-DH7F6Toz.js","assets/chunk-3OPIFGDE-SXmEESKD.js","assets/chunk-L5ZTLDWV-DYHe5z-p.js","assets/chunk-NZK2D7GU-Bi3zqbUv.js","assets/rough.esm-CSKSodPl.js","assets/chunk-55IACEB6-DGr-WOhv.js","assets/chunk-BSJP7CBP-DD2WqzXl.js","assets/chunk-FMBD7UC4-D637Lg0-.js","assets/chunk-KSCS5N6A-B9pu9Zdk.js","assets/line-BeG27-zH.js","assets/path-BWPyau1x.js","assets/array-BifhSqXX.js","assets/chunk-LZXEDZCA-C2A3MD3P.js","assets/chunk-XPW4576I-BRwQ5uRX.js","assets/erDiagram-TEJ5UH35-DtZHusNf.js","assets/gitGraphDiagram-PVQCEYII-D2UEiEmu.js","assets/mermaid-parser.core-OQrfCf7Q.js","assets/chunk-4BX2VUAB-DB0OPa2S.js","assets/chunk-QZHKN3VN-NhFAU-9O.js","assets/ganttDiagram-6RSMTGT7-CvsbKTJa.js","assets/linear-D6Qub4j1.js","assets/defaultLocale-C8Fc0cco.js","assets/init-D6jRqBbL.js","assets/infoDiagram-5YYISTIA-C1JIXj0K.js","assets/chunk-WU5MYG2G-CZXAqd3y.js","assets/pieDiagram-4H26LBE5-DMHbg7t6.js","assets/ordinal-hYBb2elL.js","assets/arc-DN3rV-nI.js","assets/quadrantDiagram-W4KKPZXB-CdlyTllG.js","assets/xychartDiagram-2RQKCTM6-CRRLjHSX.js","assets/requirementDiagram-4Y6WPE33-CJJ8Lrck.js","assets/sequenceDiagram-3UESZ5HK-B8g-XwoX.js","assets/classDiagram-4FO5ZUOK-Dy777uwp.js","assets/chunk-727SXJPM-CWaX9Qk5.js","assets/classDiagram-v2-Q7XG4LA2-Dy777uwp.js","assets/stateDiagram-AJRCARHV-tzHGG25a.js","assets/dagre-Bx709z4p.js","assets/graphlib-B8gBHxth.js","assets/chunk-AQP2D5EJ-CFTKUNkn.js","assets/stateDiagram-v2-BHNVJYJU-DeLaPJhU.js","assets/journeyDiagram-JHISSGLW-C5UZDjPg.js","assets/timeline-definition-PNZ67QCA-Bm5F6kuI.js","assets/mindmap-definition-RKZ34NQL-C90Pg8IG.js","assets/kanban-definition-UN3LZRKU-CmAcW_Gm.js","assets/sankeyDiagram-5OEKKPKP-BGraj5n6.js","assets/diagram-LMA3HP47-Ccw5LzTI.js","assets/diagram-2AECGRRQ-CezL6GWB.js","assets/blockDiagram-GPEHLZMM-CxnJJyNZ.js","assets/diagram-5GNKFQAL-DAToGWTN.js","assets/architectureDiagram-3BPJPVTR-BjOQPVOb.js","assets/cytoscape.esm-FqbQrHcz.js","assets/diagram-KO2AKTUF-CkbuKqVt.js","assets/ishikawaDiagram-YF4QCWOH-CrV-BAK2.js","assets/vennDiagram-CIIHVFJN-CD9fmg50.js","assets/diagram-OG6HWLK6-DM8PEKD_.js","assets/wardleyDiagram-YWT4CUSO-CKu3d4sB.js"])))=>i.map(i=>d[i]);
2
- import{p as e}from"./FileViewer-2hthjdQD.js";import{wr as t}from"./index-CbAhFc-0.js";import{_ as n,g as r,h as i,p as a}from"./src-DOSXYjwH.js";import{C as o,E as s,I as c,L as l,N as u,P as d,Q as f,S as p,T as m,V as h,W as g,X as _,Z as v,_ as y,b,c as x,g as S,l as C,m as w,n as T,p as E,q as ee,r as te,t as D,u as O}from"./chunk-CSCIHK7Q-xxNdF5BX.js";import{S as ne,a as re,f as k,g as A,h as ie,i as ae,o as oe,v as se,x as ce,y as le}from"./chunk-5ZQYHXKU-Vgr4jBt1.js";import{t as ue}from"./chunk-WU5MYG2G-CZXAqd3y.js";import{i as de,o as fe}from"./chunk-O5CBEL6O-B7YJjftf.js";import"./chunk-BSJP7CBP-DD2WqzXl.js";import"./chunk-L5ZTLDWV-DYHe5z-p.js";import"./chunk-NZK2D7GU-Bi3zqbUv.js";import"./chunk-3OPIFGDE-SXmEESKD.js";import"./chunk-KSCS5N6A-B9pu9Zdk.js";import{n as pe}from"./chunk-LZXEDZCA-C2A3MD3P.js";import{n as me,t as he}from"./chunk-XPW4576I-BRwQ5uRX.js";function ge(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function _e(e){if(e==null)return!0;if(ce(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!ne(e)&&!se(e)&&!le(e)?!1:e.length===0;if(typeof e==`object`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return ge(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var j=`comm`,ve=`rule`,ye=`decl`,be=`@import`,xe=`@namespace`,Se=`@keyframes`,Ce=`@layer`,we=Math.abs,M=String.fromCharCode;function Te(e){return e.trim()}function N(e,t,n){return e.replace(t,n)}function P(e,t){return e.charCodeAt(t)|0}function F(e,t,n){return e.slice(t,n)}function I(e){return e.length}function Ee(e){return e.length}function L(e,t){return t.push(e),e}var R=1,z=1,De=0,B=0,V=0,H=``;function Oe(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:R,column:z,length:o,return:``,siblings:s}}function ke(){return V}function Ae(){return V=B>0?P(H,--B):0,z--,V===10&&(z=1,R--),V}function U(){return V=B<De?P(H,B++):0,z++,V===10&&(z=1,R++),V}function W(){return P(H,B)}function G(){return B}function K(e,t){return F(H,e,t)}function q(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function je(e){return R=z=1,De=I(H=e),B=0,[]}function Me(e){return H=``,e}function Ne(e){return Te(K(B-1,Ie(e===91?e+2:e===40?e+1:e)))}function Pe(e){for(;(V=W())&&V<33;)U();return q(e)>2||q(V)>3?``:` `}function Fe(e,t){for(;--t&&U()&&!(V<48||V>102||V>57&&V<65||V>70&&V<97););return K(e,G()+(t<6&&W()==32&&U()==32))}function Ie(e){for(;U();)switch(V){case e:return B;case 34:case 39:e!==34&&e!==39&&Ie(V);break;case 40:e===41&&Ie(e);break;case 92:U();break}return B}function Le(e,t){for(;U()&&e+V!==57&&!(e+V===84&&W()===47););return`/*`+K(t,B-1)+`*`+M(e===47?e:U())}function Re(e){for(;!q(W());)U();return K(e,B)}function ze(e){return Me(J(``,null,null,null,[``],e=je(e),0,[0],e))}function J(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=U()){case 40:m!=108&&P(w,d-1)==58?(v++,w+=`(`):w+=Ne(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=Ne(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=M(y);break}w+=Pe(m);break;case 92:w+=Fe(G()-1,7);continue;case 47:switch(W()){case 42:case 47:L(Ve(Le(U(),G()),t,n,c),c),(q(m||1)==5||q(W()||1)==5)&&I(w)&&F(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=I(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=M(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=N(w,/\f/g,``)),p>0&&(I(w)-d||h===0)&&L(p>32?He(w+`;`,r,n,d-1,c):He(N(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(L(C=Be(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)J(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(P(w,3)===110)break;case 108:if(P(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?J(e,C,C,r&&L(Be(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):J(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+I(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&Ae()==125)continue}switch(w+=M(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(I(w)-1)*_,_=1;break;case 64:W()===45&&(w+=Ne(U())),f=W(),u=d=I(b=w+=Re(G())),y++;break;case 45:m===45&&I(w)==2&&(h=0)}}return a}function Be(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=Ee(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=F(e,f+1,f=we(g=o[h])),b=e;v<m;++v)(b=Te(g>0?p[v]+` `+y:N(y,/&\f/g,p[v])))&&(c[_++]=b);return Oe(e,t,n,i===0?ve:s,c,l,u,d)}function Ve(e,t,n,r){return Oe(e,t,n,j,M(ke()),F(e,2,-2),0,r)}function He(e,t,n,r,i){return Oe(e,t,n,ye,F(e,0,r),F(e,r+1,-1),r,i)}function Ue(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function We(e,t,n,r){switch(e.type){case Ce:if(e.children.length)break;case be:case xe:case ye:return e.return=e.return||e.value;case j:return``;case Se:return e.return=e.value+`{`+Ue(e.children,r)+`}`;case ve:if(!I(e.value=e.props.join(`,`)))return``}return I(n=Ue(e.children,r))?e.return=e.value+`{`+n+`}`:``}function Ge(e){var t=Ee(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}var Ke=`c4`,qe={id:Ke,detector:i(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./c4Diagram-AAUBKEIU-MJtkpqPP.js`);return{diagram:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]));return{id:Ke,diagram:e}},`loader`)},Je=`flowchart`,Ye={id:Je,detector:i((e,t)=>t?.flowchart?.defaultRenderer===`dagre-wrapper`||t?.flowchart?.defaultRenderer===`elk`?!1:/^\s*graph/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-BtiRpY_v.js`);return{diagram:e}},__vite__mapDeps([13,14,4,2,3,5,1,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,26,27,28,12,29]));return{id:Je,diagram:e}},`loader`)},Xe=`flowchart-v2`,Ze={id:Xe,detector:i((e,t)=>t?.flowchart?.defaultRenderer===`dagre-d3`?!1:(t?.flowchart?.defaultRenderer===`elk`&&(t.layout=`elk`),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer===`dagre-wrapper`?!0:/^\s*flowchart/.test(e)),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-BtiRpY_v.js`);return{diagram:e}},__vite__mapDeps([13,14,4,2,3,5,1,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,26,27,28,12,29]));return{id:Xe,diagram:e}},`loader`)},Qe=`er`,$e={id:Qe,detector:i(e=>/^\s*erDiagram/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./erDiagram-TEJ5UH35-DtZHusNf.js`);return{diagram:e}},__vite__mapDeps([30,14,4,2,3,5,1,6,7,8,9,10,11,15,16,17,18,19,20,21,22,24,25,26,27,28]));return{id:Qe,diagram:e}},`loader`)},et=`gitGraph`,tt={id:et,detector:i(e=>/^\s*gitGraph/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./gitGraphDiagram-PVQCEYII-D2UEiEmu.js`);return{diagram:e}},__vite__mapDeps([31,32,2,3,4,5,1,6,7,8,9,10,11,33,34]));return{id:et,diagram:e}},`loader`)},nt=`gantt`,rt={id:nt,detector:i(e=>/^\s*gantt/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./ganttDiagram-6RSMTGT7-CvsbKTJa.js`);return{diagram:e}},__vite__mapDeps([35,2,3,1,36,4,37,38,5,6,7,8,9,10,11]));return{id:nt,diagram:e}},`loader`)},it=`info`,at={id:it,detector:i(e=>/^\s*info/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./infoDiagram-5YYISTIA-C1JIXj0K.js`);return{diagram:e}},__vite__mapDeps([39,32,2,3,4,6,7,8,9,10,11,40]));return{id:it,diagram:e}},`loader`)},ot=`pie`,st={id:ot,detector:i(e=>/^\s*pie/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./pieDiagram-4H26LBE5-DMHbg7t6.js`);return{diagram:e}},__vite__mapDeps([41,1,2,3,32,4,26,42,38,43,27,5,6,7,8,9,10,11,33,40]));return{id:ot,diagram:e}},`loader`)},ct=`quadrantChart`,lt={id:ct,detector:i(e=>/^\s*quadrantChart/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./quadrantDiagram-W4KKPZXB-CdlyTllG.js`);return{diagram:e}},__vite__mapDeps([44,36,4,2,3,37,38,6,7,8,9,10,11]));return{id:ct,diagram:e}},`loader`)},ut=`xychart`,dt={id:ut,detector:i(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./xychartDiagram-2RQKCTM6-CRRLjHSX.js`);return{diagram:e}},__vite__mapDeps([45,14,4,2,3,5,1,6,7,8,9,10,11,36,37,38,42,25,26,27,40]));return{id:ut,diagram:e}},`loader`)},ft=`requirement`,pt={id:ft,detector:i(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./requirementDiagram-4Y6WPE33-CJJ8Lrck.js`);return{diagram:e}},__vite__mapDeps([46,14,4,2,3,5,1,6,7,8,9,10,11,16,17,18,19,20,21,22,24,25,26,27,28]));return{id:ft,diagram:e}},`loader`)},mt=`sequence`,ht={id:mt,detector:i(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./sequenceDiagram-3UESZ5HK-B8g-XwoX.js`);return{diagram:e}},__vite__mapDeps([47,1,2,3,4,5,6,7,8,9,10,11,12,34,29]));return{id:mt,diagram:e}},`loader`)},gt=`class`,_t={id:gt,detector:i((e,t)=>t?.class?.defaultRenderer===`dagre-wrapper`?!1:/^\s*classDiagram/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./classDiagram-4FO5ZUOK-Dy777uwp.js`);return{diagram:e}},__vite__mapDeps([48,14,4,2,3,5,1,6,7,8,9,10,11,16,17,18,19,20,21,49,23,28,24,25,26,27,22,12]));return{id:gt,diagram:e}},`loader`)},vt=`classDiagram`,yt={id:vt,detector:i((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer===`dagre-wrapper`?!0:/^\s*classDiagram-v2/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./classDiagram-v2-Q7XG4LA2-Dy777uwp.js`);return{diagram:e}},__vite__mapDeps([50,14,4,2,3,5,1,6,7,8,9,10,11,16,17,18,19,20,21,49,23,28,24,25,26,27,22,12]));return{id:vt,diagram:e}},`loader`)},bt=`state`,xt={id:bt,detector:i((e,t)=>t?.state?.defaultRenderer===`dagre-wrapper`?!1:/^\s*stateDiagram/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./stateDiagram-AJRCARHV-tzHGG25a.js`);return{diagram:e}},__vite__mapDeps([51,14,4,2,3,5,1,6,7,8,9,10,11,25,26,27,52,53,16,17,18,19,20,21,54,28,24,22]));return{id:bt,diagram:e}},`loader`)},St=`stateDiagram`,Ct={id:St,detector:i((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer===`dagre-wrapper`),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./stateDiagram-v2-BHNVJYJU-DeLaPJhU.js`);return{diagram:e}},__vite__mapDeps([55,14,4,2,3,5,1,6,7,8,9,10,11,16,17,18,19,20,21,54,28,24,25,26,27,22]));return{id:St,diagram:e}},`loader`)},wt=`journey`,Tt={id:wt,detector:i(e=>/^\s*journey/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./journeyDiagram-JHISSGLW-C5UZDjPg.js`);return{diagram:e}},__vite__mapDeps([56,4,2,3,43,1,26,6,7,8,9,10,11,23,12]));return{id:wt,diagram:e}},`loader`)},Et={draw:i((e,t,n)=>{r.debug(`rendering svg for syntax error
3
- `);let i=ue(t),a=i.append(`g`);i.attr(`viewBox`,`0 0 2412 512`),x(i,100,512,!0),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),a.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),a.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},Dt=Et,Ot={db:{},renderer:Et,parser:{parse:i(()=>{},`parse`)}},kt=`flowchart-elk`,At={id:kt,detector:i((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer===`elk`?(t.layout=`elk`,!0):!1,`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-BtiRpY_v.js`);return{diagram:e}},__vite__mapDeps([13,14,4,2,3,5,1,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,26,27,28,12,29]));return{id:kt,diagram:e}},`loader`)},jt=`timeline`,Mt={id:jt,detector:i(e=>/^\s*timeline/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./timeline-definition-PNZ67QCA-Bm5F6kuI.js`);return{diagram:e}},__vite__mapDeps([57,4,2,3,43,1,26,5,6,7,8,9,10,11,40]));return{id:jt,diagram:e}},`loader`)},Nt=`mindmap`,Pt={id:Nt,detector:i(e=>/^\s*mindmap/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./mindmap-definition-RKZ34NQL-C90Pg8IG.js`);return{diagram:e}},__vite__mapDeps([58,14,4,2,3,5,1,6,7,8,9,10,11,16,17,18,19,20,21,22,24,25,26,27,28]));return{id:Nt,diagram:e}},`loader`)},Ft=`kanban`,It={id:Ft,detector:i(e=>/^\s*kanban/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./kanban-definition-UN3LZRKU-CmAcW_Gm.js`);return{diagram:e}},__vite__mapDeps([59,14,4,2,3,5,1,6,7,8,9,10,11,17,18,19,20,23,40,29]));return{id:Ft,diagram:e}},`loader`)},Lt=`sankey`,Rt={id:Lt,detector:i(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./sankeyDiagram-5OEKKPKP-BGraj5n6.js`);return{diagram:e}},__vite__mapDeps([60,4,2,3,42,38,6,7,8,9,10,11]));return{id:Lt,diagram:e}},`loader`)},zt=`packet`,Bt={id:zt,detector:i(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./diagram-LMA3HP47-Ccw5LzTI.js`);return{diagram:e}},__vite__mapDeps([61,32,2,3,4,5,1,6,7,8,9,10,11,33,40]));return{id:zt,diagram:e}},`loader`)},Vt=`radar`,Ht={id:Vt,detector:i(e=>/^\s*radar-beta/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./diagram-2AECGRRQ-CezL6GWB.js`);return{diagram:e}},__vite__mapDeps([62,32,2,3,4,5,1,6,7,8,9,10,11,33,40]));return{id:Vt,diagram:e}},`loader`)},Ut=`block`,Wt={id:Ut,detector:i(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./blockDiagram-GPEHLZMM-CxnJJyNZ.js`);return{diagram:e}},__vite__mapDeps([63,14,4,2,3,5,1,6,7,8,9,10,11,25,26,27,53,15,22,23,18]));return{id:Ut,diagram:e}},`loader`)},Gt=`treeView`,Kt={id:Gt,detector:i(e=>/^\s*treeView-beta/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./diagram-5GNKFQAL-DAToGWTN.js`);return{diagram:e}},__vite__mapDeps([64,32,2,3,4,5,1,6,7,8,9,10,11,33,34,40]));return{id:Gt,diagram:e}},`loader`)},qt=`architecture`,Jt={id:qt,detector:i(e=>/^\s*architecture/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./architectureDiagram-3BPJPVTR-BjOQPVOb.js`);return{diagram:e}},__vite__mapDeps([65,2,3,14,4,5,1,6,7,8,9,10,11,32,66,33,40]));return{id:qt,diagram:e}},`loader`)},Yt=`eventmodeling`,Xt={id:Yt,detector:i(e=>/^\s*eventmodeling/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./diagram-KO2AKTUF-CkbuKqVt.js`);return{diagram:e}},__vite__mapDeps([67,32,2,3,4,5,1,6,7,8,9,10,11,33]));return{id:Yt,diagram:e}},`loader`)},Zt=`ishikawa`,Qt={id:Zt,detector:i(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./ishikawaDiagram-YF4QCWOH-CrV-BAK2.js`);return{diagram:e}},__vite__mapDeps([68,4,2,3,5,1,6,7,8,9,10,11,40,20]));return{id:Zt,diagram:e}},`loader`)},$t=`venn`,en={id:$t,detector:i(e=>/^\s*venn-beta/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./vennDiagram-CIIHVFJN-CD9fmg50.js`);return{diagram:e}},__vite__mapDeps([69,4,2,3,5,1,6,7,8,9,10,11,40,20]));return{id:$t,diagram:e}},`loader`)},tn=`treemap`,nn={id:tn,detector:i(e=>/^\s*treemap/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./diagram-OG6HWLK6-DM8PEKD_.js`);return{diagram:e}},__vite__mapDeps([70,32,2,3,4,37,42,38,5,1,6,7,8,9,10,11,16,33,19,40]));return{id:tn,diagram:e}},`loader`)},rn=`wardley-beta`,an={id:rn,detector:i(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./wardleyDiagram-YWT4CUSO-CKu3d4sB.js`);return{diagram:e}},__vite__mapDeps([71,32,2,3,4,5,1,6,7,8,9,10,11,33,40]));return{id:rn,diagram:e}},`loader`)},on=!1,Y=i(()=>{on||(on=!0,u(`error`,Ot,e=>e.toLowerCase().trim()===`error`),u(`---`,{db:{clear:i(()=>{},`clear`)},styles:{},renderer:{draw:i(()=>{},`draw`)},parser:{parse:i(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},`parse`)},init:i(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),d(At,Pt,Jt),d(qe,It,yt,_t,$e,rt,at,st,pt,ht,Ze,Ye,Mt,tt,Ct,xt,Tt,lt,Rt,Bt,dt,Wt,Xt,Kt,Ht,Qt,nn,en,an))},`addDiagrams`),sn=i(async()=>{r.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(w).map(async([e,{detector:t,loader:n}])=>{if(n)try{p(e)}catch{try{let{diagram:e,id:r}=await n();u(r,e,t)}catch(t){throw r.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete w[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){r.error(`Failed to load ${e.length} external diagrams`);for(let t of e)r.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),cn=`graphics-document document`;function ln(e,t){e.attr(`role`,cn),t!==``&&e.attr(`aria-roledescription`,t)}i(ln,`setA11yDiagramInfo`);function un(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}i(un,`addSVGa11yTitleDescription`);var dn=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{i(this,`Diagram`)}static async fromText(t,n={}){let r=b(),i=E(t,r);t=oe(t)+`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/c4Diagram-AAUBKEIU-BqFnkKWL.js","assets/dist-BVWlbvC4.js","assets/index-DlHETnHC.js","assets/index-DIncpmwE.css","assets/src-B2YqOS_g.js","assets/chunk-5ZQYHXKU-D_5qZ4Zv.js","assets/chunk-CSCIHK7Q-BeNiRoDm.js","assets/FileViewer-BtzV0xCy.js","assets/useNow-BbEkaqh-.js","assets/copy-DI3PIiTH.js","assets/lightbulb-17VUUl6S.js","assets/FileViewer-DEcVZfaU.css","assets/chunk-ND2GUHAM-Cks69kWo.js","assets/flowDiagram-I6XJVG4X-DENcgZKO.js","assets/chunk-O5CBEL6O-Dh_KkhDf.js","assets/channel-CM3nHrAD.js","assets/chunk-2J33WTMH-BEmf3Qku.js","assets/chunk-3OPIFGDE-CtmMZbUU.js","assets/chunk-L5ZTLDWV-DtSiy2JS.js","assets/chunk-NZK2D7GU-BKDBTHUK.js","assets/rough.esm-CSKSodPl.js","assets/chunk-55IACEB6-BXURqjLZ.js","assets/chunk-BSJP7CBP-C5nluir4.js","assets/chunk-FMBD7UC4-LV5XAtCz.js","assets/chunk-KSCS5N6A-D80hU7za.js","assets/line-CX3cghIS.js","assets/path-BWPyau1x.js","assets/array-BifhSqXX.js","assets/chunk-LZXEDZCA-CFWlwpSj.js","assets/chunk-XPW4576I-BaeieIoE.js","assets/erDiagram-TEJ5UH35-2dFfOUHh.js","assets/gitGraphDiagram-PVQCEYII-BQIgIegs.js","assets/mermaid-parser.core-DZTDfv4-.js","assets/chunk-4BX2VUAB-CacBYgOE.js","assets/chunk-QZHKN3VN-CXmYofd4.js","assets/ganttDiagram-6RSMTGT7-CGsf5ccc.js","assets/linear-87q8d4nG.js","assets/defaultLocale-C8Fc0cco.js","assets/init-D6jRqBbL.js","assets/infoDiagram-5YYISTIA-MrkM0y-m.js","assets/chunk-WU5MYG2G-BAvj0V8I.js","assets/pieDiagram-4H26LBE5-CsIniA7U.js","assets/ordinal-hYBb2elL.js","assets/arc-fS3jqr6M.js","assets/quadrantDiagram-W4KKPZXB-ppRpf4TS.js","assets/xychartDiagram-2RQKCTM6-CUCAmkCj.js","assets/requirementDiagram-4Y6WPE33-lnX3NUSy.js","assets/sequenceDiagram-3UESZ5HK-C-LlJv8b.js","assets/classDiagram-4FO5ZUOK-CqWCXo7M.js","assets/chunk-727SXJPM-BU31EEG5.js","assets/classDiagram-v2-Q7XG4LA2-CqWCXo7M.js","assets/stateDiagram-AJRCARHV-m_XE9xkX.js","assets/dagre-Bx709z4p.js","assets/graphlib-B8gBHxth.js","assets/chunk-AQP2D5EJ-DTtKK5xv.js","assets/stateDiagram-v2-BHNVJYJU-eKkkGk4l.js","assets/journeyDiagram-JHISSGLW-DGypTGb1.js","assets/timeline-definition-PNZ67QCA-BD126VRM.js","assets/mindmap-definition-RKZ34NQL-Cgrh68Ws.js","assets/kanban-definition-UN3LZRKU-yYXyv91m.js","assets/sankeyDiagram-5OEKKPKP-DGuhoGFR.js","assets/diagram-LMA3HP47-Di6iEw3F.js","assets/diagram-2AECGRRQ-BCPKQqtp.js","assets/blockDiagram-GPEHLZMM-Dafvh8yC.js","assets/diagram-5GNKFQAL-ComD16wh.js","assets/architectureDiagram-3BPJPVTR-CDsOHh13.js","assets/cytoscape.esm-FqbQrHcz.js","assets/diagram-KO2AKTUF-BzSas2Wg.js","assets/ishikawaDiagram-YF4QCWOH-Dr8UsvPX.js","assets/vennDiagram-CIIHVFJN-DLM0FNBN.js","assets/diagram-OG6HWLK6-BiJvsy5z.js","assets/wardleyDiagram-YWT4CUSO-DQgt20IC.js"])))=>i.map(i=>d[i]);
2
+ import{p as e}from"./FileViewer-BtzV0xCy.js";import{wr as t}from"./index-DlHETnHC.js";import{_ as n,g as r,h as i,p as a}from"./src-B2YqOS_g.js";import{C as o,E as s,I as c,L as l,N as u,P as d,Q as f,S as p,T as m,V as h,W as g,X as _,Z as v,_ as y,b,c as x,g as S,l as C,m as w,n as T,p as E,q as ee,r as te,t as D,u as O}from"./chunk-CSCIHK7Q-BeNiRoDm.js";import{S as ne,a as re,f as k,g as A,h as ie,i as ae,o as oe,v as se,x as ce,y as le}from"./chunk-5ZQYHXKU-D_5qZ4Zv.js";import{t as ue}from"./chunk-WU5MYG2G-BAvj0V8I.js";import{i as de,o as fe}from"./chunk-O5CBEL6O-Dh_KkhDf.js";import"./chunk-BSJP7CBP-C5nluir4.js";import"./chunk-L5ZTLDWV-DtSiy2JS.js";import"./chunk-NZK2D7GU-BKDBTHUK.js";import"./chunk-3OPIFGDE-CtmMZbUU.js";import"./chunk-KSCS5N6A-D80hU7za.js";import{n as pe}from"./chunk-LZXEDZCA-CFWlwpSj.js";import{n as me,t as he}from"./chunk-XPW4576I-BaeieIoE.js";function ge(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function _e(e){if(e==null)return!0;if(ce(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!ne(e)&&!se(e)&&!le(e)?!1:e.length===0;if(typeof e==`object`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return ge(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var j=`comm`,ve=`rule`,ye=`decl`,be=`@import`,xe=`@namespace`,Se=`@keyframes`,Ce=`@layer`,we=Math.abs,M=String.fromCharCode;function Te(e){return e.trim()}function N(e,t,n){return e.replace(t,n)}function P(e,t){return e.charCodeAt(t)|0}function F(e,t,n){return e.slice(t,n)}function I(e){return e.length}function Ee(e){return e.length}function L(e,t){return t.push(e),e}var R=1,z=1,De=0,B=0,V=0,H=``;function Oe(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:R,column:z,length:o,return:``,siblings:s}}function ke(){return V}function Ae(){return V=B>0?P(H,--B):0,z--,V===10&&(z=1,R--),V}function U(){return V=B<De?P(H,B++):0,z++,V===10&&(z=1,R++),V}function W(){return P(H,B)}function G(){return B}function K(e,t){return F(H,e,t)}function q(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function je(e){return R=z=1,De=I(H=e),B=0,[]}function Me(e){return H=``,e}function Ne(e){return Te(K(B-1,Ie(e===91?e+2:e===40?e+1:e)))}function Pe(e){for(;(V=W())&&V<33;)U();return q(e)>2||q(V)>3?``:` `}function Fe(e,t){for(;--t&&U()&&!(V<48||V>102||V>57&&V<65||V>70&&V<97););return K(e,G()+(t<6&&W()==32&&U()==32))}function Ie(e){for(;U();)switch(V){case e:return B;case 34:case 39:e!==34&&e!==39&&Ie(V);break;case 40:e===41&&Ie(e);break;case 92:U();break}return B}function Le(e,t){for(;U()&&e+V!==57&&!(e+V===84&&W()===47););return`/*`+K(t,B-1)+`*`+M(e===47?e:U())}function Re(e){for(;!q(W());)U();return K(e,B)}function ze(e){return Me(J(``,null,null,null,[``],e=je(e),0,[0],e))}function J(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=U()){case 40:m!=108&&P(w,d-1)==58?(v++,w+=`(`):w+=Ne(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=Ne(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=M(y);break}w+=Pe(m);break;case 92:w+=Fe(G()-1,7);continue;case 47:switch(W()){case 42:case 47:L(Ve(Le(U(),G()),t,n,c),c),(q(m||1)==5||q(W()||1)==5)&&I(w)&&F(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=I(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=M(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=N(w,/\f/g,``)),p>0&&(I(w)-d||h===0)&&L(p>32?He(w+`;`,r,n,d-1,c):He(N(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(L(C=Be(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)J(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(P(w,3)===110)break;case 108:if(P(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?J(e,C,C,r&&L(Be(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):J(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+I(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&Ae()==125)continue}switch(w+=M(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(I(w)-1)*_,_=1;break;case 64:W()===45&&(w+=Ne(U())),f=W(),u=d=I(b=w+=Re(G())),y++;break;case 45:m===45&&I(w)==2&&(h=0)}}return a}function Be(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=Ee(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=F(e,f+1,f=we(g=o[h])),b=e;v<m;++v)(b=Te(g>0?p[v]+` `+y:N(y,/&\f/g,p[v])))&&(c[_++]=b);return Oe(e,t,n,i===0?ve:s,c,l,u,d)}function Ve(e,t,n,r){return Oe(e,t,n,j,M(ke()),F(e,2,-2),0,r)}function He(e,t,n,r,i){return Oe(e,t,n,ye,F(e,0,r),F(e,r+1,-1),r,i)}function Ue(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function We(e,t,n,r){switch(e.type){case Ce:if(e.children.length)break;case be:case xe:case ye:return e.return=e.return||e.value;case j:return``;case Se:return e.return=e.value+`{`+Ue(e.children,r)+`}`;case ve:if(!I(e.value=e.props.join(`,`)))return``}return I(n=Ue(e.children,r))?e.return=e.value+`{`+n+`}`:``}function Ge(e){var t=Ee(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}var Ke=`c4`,qe={id:Ke,detector:i(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./c4Diagram-AAUBKEIU-BqFnkKWL.js`);return{diagram:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]));return{id:Ke,diagram:e}},`loader`)},Je=`flowchart`,Ye={id:Je,detector:i((e,t)=>t?.flowchart?.defaultRenderer===`dagre-wrapper`||t?.flowchart?.defaultRenderer===`elk`?!1:/^\s*graph/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-DENcgZKO.js`);return{diagram:e}},__vite__mapDeps([13,14,4,2,3,5,1,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,26,27,28,12,29]));return{id:Je,diagram:e}},`loader`)},Xe=`flowchart-v2`,Ze={id:Xe,detector:i((e,t)=>t?.flowchart?.defaultRenderer===`dagre-d3`?!1:(t?.flowchart?.defaultRenderer===`elk`&&(t.layout=`elk`),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer===`dagre-wrapper`?!0:/^\s*flowchart/.test(e)),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-DENcgZKO.js`);return{diagram:e}},__vite__mapDeps([13,14,4,2,3,5,1,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,26,27,28,12,29]));return{id:Xe,diagram:e}},`loader`)},Qe=`er`,$e={id:Qe,detector:i(e=>/^\s*erDiagram/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./erDiagram-TEJ5UH35-2dFfOUHh.js`);return{diagram:e}},__vite__mapDeps([30,14,4,2,3,5,1,6,7,8,9,10,11,15,16,17,18,19,20,21,22,24,25,26,27,28]));return{id:Qe,diagram:e}},`loader`)},et=`gitGraph`,tt={id:et,detector:i(e=>/^\s*gitGraph/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./gitGraphDiagram-PVQCEYII-BQIgIegs.js`);return{diagram:e}},__vite__mapDeps([31,32,2,3,4,5,1,6,7,8,9,10,11,33,34]));return{id:et,diagram:e}},`loader`)},nt=`gantt`,rt={id:nt,detector:i(e=>/^\s*gantt/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./ganttDiagram-6RSMTGT7-CGsf5ccc.js`);return{diagram:e}},__vite__mapDeps([35,2,3,1,36,4,37,38,5,6,7,8,9,10,11]));return{id:nt,diagram:e}},`loader`)},it=`info`,at={id:it,detector:i(e=>/^\s*info/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./infoDiagram-5YYISTIA-MrkM0y-m.js`);return{diagram:e}},__vite__mapDeps([39,32,2,3,4,6,7,8,9,10,11,40]));return{id:it,diagram:e}},`loader`)},ot=`pie`,st={id:ot,detector:i(e=>/^\s*pie/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./pieDiagram-4H26LBE5-CsIniA7U.js`);return{diagram:e}},__vite__mapDeps([41,1,2,3,32,4,26,42,38,43,27,5,6,7,8,9,10,11,33,40]));return{id:ot,diagram:e}},`loader`)},ct=`quadrantChart`,lt={id:ct,detector:i(e=>/^\s*quadrantChart/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./quadrantDiagram-W4KKPZXB-ppRpf4TS.js`);return{diagram:e}},__vite__mapDeps([44,36,4,2,3,37,38,6,7,8,9,10,11]));return{id:ct,diagram:e}},`loader`)},ut=`xychart`,dt={id:ut,detector:i(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./xychartDiagram-2RQKCTM6-CUCAmkCj.js`);return{diagram:e}},__vite__mapDeps([45,14,4,2,3,5,1,6,7,8,9,10,11,36,37,38,42,25,26,27,40]));return{id:ut,diagram:e}},`loader`)},ft=`requirement`,pt={id:ft,detector:i(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./requirementDiagram-4Y6WPE33-lnX3NUSy.js`);return{diagram:e}},__vite__mapDeps([46,14,4,2,3,5,1,6,7,8,9,10,11,16,17,18,19,20,21,22,24,25,26,27,28]));return{id:ft,diagram:e}},`loader`)},mt=`sequence`,ht={id:mt,detector:i(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./sequenceDiagram-3UESZ5HK-C-LlJv8b.js`);return{diagram:e}},__vite__mapDeps([47,1,2,3,4,5,6,7,8,9,10,11,12,34,29]));return{id:mt,diagram:e}},`loader`)},gt=`class`,_t={id:gt,detector:i((e,t)=>t?.class?.defaultRenderer===`dagre-wrapper`?!1:/^\s*classDiagram/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./classDiagram-4FO5ZUOK-CqWCXo7M.js`);return{diagram:e}},__vite__mapDeps([48,14,4,2,3,5,1,6,7,8,9,10,11,16,17,18,19,20,21,49,23,28,24,25,26,27,22,12]));return{id:gt,diagram:e}},`loader`)},vt=`classDiagram`,yt={id:vt,detector:i((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer===`dagre-wrapper`?!0:/^\s*classDiagram-v2/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./classDiagram-v2-Q7XG4LA2-CqWCXo7M.js`);return{diagram:e}},__vite__mapDeps([50,14,4,2,3,5,1,6,7,8,9,10,11,16,17,18,19,20,21,49,23,28,24,25,26,27,22,12]));return{id:vt,diagram:e}},`loader`)},bt=`state`,xt={id:bt,detector:i((e,t)=>t?.state?.defaultRenderer===`dagre-wrapper`?!1:/^\s*stateDiagram/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./stateDiagram-AJRCARHV-m_XE9xkX.js`);return{diagram:e}},__vite__mapDeps([51,14,4,2,3,5,1,6,7,8,9,10,11,25,26,27,52,53,16,17,18,19,20,21,54,28,24,22]));return{id:bt,diagram:e}},`loader`)},St=`stateDiagram`,Ct={id:St,detector:i((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer===`dagre-wrapper`),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./stateDiagram-v2-BHNVJYJU-eKkkGk4l.js`);return{diagram:e}},__vite__mapDeps([55,14,4,2,3,5,1,6,7,8,9,10,11,16,17,18,19,20,21,54,28,24,25,26,27,22]));return{id:St,diagram:e}},`loader`)},wt=`journey`,Tt={id:wt,detector:i(e=>/^\s*journey/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./journeyDiagram-JHISSGLW-DGypTGb1.js`);return{diagram:e}},__vite__mapDeps([56,4,2,3,43,1,26,6,7,8,9,10,11,23,12]));return{id:wt,diagram:e}},`loader`)},Et={draw:i((e,t,n)=>{r.debug(`rendering svg for syntax error
3
+ `);let i=ue(t),a=i.append(`g`);i.attr(`viewBox`,`0 0 2412 512`),x(i,100,512,!0),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),a.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),a.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},Dt=Et,Ot={db:{},renderer:Et,parser:{parse:i(()=>{},`parse`)}},kt=`flowchart-elk`,At={id:kt,detector:i((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer===`elk`?(t.layout=`elk`,!0):!1,`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-DENcgZKO.js`);return{diagram:e}},__vite__mapDeps([13,14,4,2,3,5,1,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,26,27,28,12,29]));return{id:kt,diagram:e}},`loader`)},jt=`timeline`,Mt={id:jt,detector:i(e=>/^\s*timeline/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./timeline-definition-PNZ67QCA-BD126VRM.js`);return{diagram:e}},__vite__mapDeps([57,4,2,3,43,1,26,5,6,7,8,9,10,11,40]));return{id:jt,diagram:e}},`loader`)},Nt=`mindmap`,Pt={id:Nt,detector:i(e=>/^\s*mindmap/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./mindmap-definition-RKZ34NQL-Cgrh68Ws.js`);return{diagram:e}},__vite__mapDeps([58,14,4,2,3,5,1,6,7,8,9,10,11,16,17,18,19,20,21,22,24,25,26,27,28]));return{id:Nt,diagram:e}},`loader`)},Ft=`kanban`,It={id:Ft,detector:i(e=>/^\s*kanban/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./kanban-definition-UN3LZRKU-yYXyv91m.js`);return{diagram:e}},__vite__mapDeps([59,14,4,2,3,5,1,6,7,8,9,10,11,17,18,19,20,23,40,29]));return{id:Ft,diagram:e}},`loader`)},Lt=`sankey`,Rt={id:Lt,detector:i(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./sankeyDiagram-5OEKKPKP-DGuhoGFR.js`);return{diagram:e}},__vite__mapDeps([60,4,2,3,42,38,6,7,8,9,10,11]));return{id:Lt,diagram:e}},`loader`)},zt=`packet`,Bt={id:zt,detector:i(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./diagram-LMA3HP47-Di6iEw3F.js`);return{diagram:e}},__vite__mapDeps([61,32,2,3,4,5,1,6,7,8,9,10,11,33,40]));return{id:zt,diagram:e}},`loader`)},Vt=`radar`,Ht={id:Vt,detector:i(e=>/^\s*radar-beta/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./diagram-2AECGRRQ-BCPKQqtp.js`);return{diagram:e}},__vite__mapDeps([62,32,2,3,4,5,1,6,7,8,9,10,11,33,40]));return{id:Vt,diagram:e}},`loader`)},Ut=`block`,Wt={id:Ut,detector:i(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./blockDiagram-GPEHLZMM-Dafvh8yC.js`);return{diagram:e}},__vite__mapDeps([63,14,4,2,3,5,1,6,7,8,9,10,11,25,26,27,53,15,22,23,18]));return{id:Ut,diagram:e}},`loader`)},Gt=`treeView`,Kt={id:Gt,detector:i(e=>/^\s*treeView-beta/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./diagram-5GNKFQAL-ComD16wh.js`);return{diagram:e}},__vite__mapDeps([64,32,2,3,4,5,1,6,7,8,9,10,11,33,34,40]));return{id:Gt,diagram:e}},`loader`)},qt=`architecture`,Jt={id:qt,detector:i(e=>/^\s*architecture/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./architectureDiagram-3BPJPVTR-CDsOHh13.js`);return{diagram:e}},__vite__mapDeps([65,2,3,14,4,5,1,6,7,8,9,10,11,32,66,33,40]));return{id:qt,diagram:e}},`loader`)},Yt=`eventmodeling`,Xt={id:Yt,detector:i(e=>/^\s*eventmodeling/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./diagram-KO2AKTUF-BzSas2Wg.js`);return{diagram:e}},__vite__mapDeps([67,32,2,3,4,5,1,6,7,8,9,10,11,33]));return{id:Yt,diagram:e}},`loader`)},Zt=`ishikawa`,Qt={id:Zt,detector:i(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./ishikawaDiagram-YF4QCWOH-Dr8UsvPX.js`);return{diagram:e}},__vite__mapDeps([68,4,2,3,5,1,6,7,8,9,10,11,40,20]));return{id:Zt,diagram:e}},`loader`)},$t=`venn`,en={id:$t,detector:i(e=>/^\s*venn-beta/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./vennDiagram-CIIHVFJN-DLM0FNBN.js`);return{diagram:e}},__vite__mapDeps([69,4,2,3,5,1,6,7,8,9,10,11,40,20]));return{id:$t,diagram:e}},`loader`)},tn=`treemap`,nn={id:tn,detector:i(e=>/^\s*treemap/.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./diagram-OG6HWLK6-BiJvsy5z.js`);return{diagram:e}},__vite__mapDeps([70,32,2,3,4,37,42,38,5,1,6,7,8,9,10,11,16,33,19,40]));return{id:tn,diagram:e}},`loader`)},rn=`wardley-beta`,an={id:rn,detector:i(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:i(async()=>{let{diagram:e}=await t(async()=>{let{diagram:e}=await import(`./wardleyDiagram-YWT4CUSO-DQgt20IC.js`);return{diagram:e}},__vite__mapDeps([71,32,2,3,4,5,1,6,7,8,9,10,11,33,40]));return{id:rn,diagram:e}},`loader`)},on=!1,Y=i(()=>{on||(on=!0,u(`error`,Ot,e=>e.toLowerCase().trim()===`error`),u(`---`,{db:{clear:i(()=>{},`clear`)},styles:{},renderer:{draw:i(()=>{},`draw`)},parser:{parse:i(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},`parse`)},init:i(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),d(At,Pt,Jt),d(qe,It,yt,_t,$e,rt,at,st,pt,ht,Ze,Ye,Mt,tt,Ct,xt,Tt,lt,Rt,Bt,dt,Wt,Xt,Kt,Ht,Qt,nn,en,an))},`addDiagrams`),sn=i(async()=>{r.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(w).map(async([e,{detector:t,loader:n}])=>{if(n)try{p(e)}catch{try{let{diagram:e,id:r}=await n();u(r,e,t)}catch(t){throw r.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete w[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){r.error(`Failed to load ${e.length} external diagrams`);for(let t of e)r.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),cn=`graphics-document document`;function ln(e,t){e.attr(`role`,cn),t!==``&&e.attr(`aria-roledescription`,t)}i(ln,`setA11yDiagramInfo`);function un(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}i(un,`addSVGa11yTitleDescription`);var dn=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{i(this,`Diagram`)}static async fromText(t,n={}){let r=b(),i=E(t,r);t=oe(t)+`
4
4
  `;try{p(i)}catch{let e=o(i);if(!e)throw new D(`Diagram ${i} not found.`);let{id:t,diagram:n}=await e();u(t,n)}let{db:a,parser:s,renderer:c,init:l}=p(i);return s.parser&&(s.parser.yy=a),a.clear?.(),l?.(r),n.title&&a.setDiagramTitle?.(n.title),await s.parse(t),new e(i,t,a,s,c)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},fn=[],pn=i(()=>{fn.forEach(e=>{e()}),fn=[]},`attachFunctions`),mn=i(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,``).trimStart(),`cleanupComments`);function hn(e){let t=e.match(y);if(!t)return{text:e,metadata:{}};let n=me(t[1],{schema:he})??{};n=typeof n==`object`&&!Array.isArray(n)?n:{};let r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:e.slice(t[0].length),metadata:r}}i(hn,`extractFrontMatter`);var gn=i(e=>e.replace(/\r\n?/g,`
5
5
  `).replace(/<(\w+)([^>]*)>/g,(e,t,n)=>`<`+t+n.replace(/="([^"]*)"/g,`='$1'`)+`>`),`cleanupText`),_n=i(e=>{let{text:t,metadata:n}=hn(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||={},a.gantt.displayMode=r),{title:i,config:a,text:t}},`processFrontmatter`),vn=i(e=>{let t=A.detectInit(e)??{},n=A.detectDirective(e,`wrap`);return Array.isArray(n)?t.wrap=n.some(({type:e})=>e===`wrap`):n?.type===`wrap`&&(t.wrap=!0),{text:ie(e),directive:t}},`processDirectives`);function yn(e){let t=_n(gn(e)),n=vn(t.text),r=ae(t.config,n.directive);return e=mn(n.text),{code:e,title:t.title,config:r}}i(yn,`preprocessDiagram`);function bn(e){let t=new TextEncoder().encode(e),n=Array.from(t,e=>String.fromCodePoint(e)).join(``);return btoa(n)}i(bn,`toBase64`);var xn=5e4,Sn=`graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa`,Cn=`sandbox`,wn=`loose`,Tn=`http://www.w3.org/2000/svg`,En=`http://www.w3.org/1999/xlink`,Dn=`http://www.w3.org/1999/xhtml`,On=`100%`,kn=`100%`,An=`border:0;margin:0;`,jn=`margin:0`,Mn=`allow-top-navigation-by-user-activation allow-popups`,Nn=`The "iframe" tag is not supported by your browser.`,Pn=[`foreignobject`],Fn=[`dominant-baseline`];function In(e){let t=yn(e);return c(),T(t.config??{}),t}i(In,`processAndSetConfigs`);async function Ln(e,t){Y();try{let{code:t,config:n}=In(e);return{diagramType:(await Yn(t)).type,config:n}}catch(e){if(t?.suppressErrors)return!1;throw e}}i(Ln,`parse`);var Rn=i((e,t,n=[])=>`.${e} ${t} ${l(`{ ${n.join(` !important; `)} !important; }`)}`,`cssImportantStyles`),zn=i((e,t=new Map)=>{let n=new CSSStyleSheet;if(e.fontFamily!==void 0&&n.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,n.cssRules.length),e.altFontFamily!==void 0&&n.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,n.cssRules.length),t instanceof Map){let r=m(e)?[`> *`,`span`]:[`rect`,`polygon`,`ellipse`,`circle`,`path`];t.forEach(e=>{_e(e.styles)||r.forEach(t=>{n.insertRule(Rn(e.id,t,e.styles),n.cssRules.length)}),_e(e.textStyles)||n.insertRule(Rn(e.id,`tspan`,(e?.textStyles||[]).map(e=>e.replace(`color`,`fill`))),n.cssRules.length)})}let r=``;if(e.themeCSS!==void 0)if(typeof n.replaceSync==`function`){let t=new CSSStyleSheet;t.replaceSync(e.themeCSS),r=C(t)+`
6
6
  `}else r+=`${e.themeCSS}
@@ -1,4 +1,4 @@
1
- import{g as e,h as t}from"./src-DOSXYjwH.js";import{$ as n,b as r,et as i,f as a,k as o,nt as s,x as c,z as l}from"./chunk-CSCIHK7Q-xxNdF5BX.js";import"./chunk-5ZQYHXKU-Vgr4jBt1.js";import"./chunk-O5CBEL6O-B7YJjftf.js";import"./chunk-BSJP7CBP-DD2WqzXl.js";import"./chunk-L5ZTLDWV-DYHe5z-p.js";import{t as u}from"./chunk-55IACEB6-DGr-WOhv.js";import{t as d}from"./chunk-2J33WTMH-DH7F6Toz.js";import"./chunk-NZK2D7GU-Bi3zqbUv.js";import"./chunk-3OPIFGDE-SXmEESKD.js";import"./chunk-KSCS5N6A-B9pu9Zdk.js";import{r as f,t as p}from"./chunk-LZXEDZCA-C2A3MD3P.js";var m=[];for(let e=0;e<256;++e)m.push((e+256).toString(16).slice(1));function h(e,t=0){return(m[e[t+0]]+m[e[t+1]]+m[e[t+2]]+m[e[t+3]]+`-`+m[e[t+4]]+m[e[t+5]]+`-`+m[e[t+6]]+m[e[t+7]]+`-`+m[e[t+8]]+m[e[t+9]]+`-`+m[e[t+10]]+m[e[t+11]]+m[e[t+12]]+m[e[t+13]]+m[e[t+14]]+m[e[t+15]]).toLowerCase()}var g=new Uint8Array(16);function _(){return crypto.getRandomValues(g)}function v(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():y(e,t,n)}function y(e,t,n){e||={};let r=e.random??e.rng?.()??_();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return h(r)}var b=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,13],i=[1,12],a=[1,15],o=[1,16],s=[1,20],c=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],p=[6,7,11],m=[1,6,13,15,16,19,22],h=[1,33],g=[1,34],_=[1,6,7,11,13,15,16,19,22],v={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`MINDMAP`,11:`EOF`,13:`SPACELIST`,15:`ICON`,16:`CLASS`,19:`NODE_DSTART`,20:`NODE_DESCR`,21:`NODE_DEND`,22:`NODE_ID`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 16:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 17:case 21:r.decorateNode({class:a[s]});break;case 18:r.getLogger().trace(`SPACELIST`);break;case 19:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 20:r.decorateNode({icon:a[s]});break;case 25:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 26:this.$={id:a[s],descr:a[s],type:r.nodeType.DEFAULT};break;case 27:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])};break}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:r,12:21,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},{6:r,9:22,12:11,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},{6:u,7:d,10:23,11:f},e(p,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:c}),e(p,[2,18]),e(p,[2,19]),e(p,[2,20]),e(p,[2,21]),e(p,[2,23]),e(p,[2,24]),e(p,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:d,10:32,11:f},{1:[2,7],6:r,12:21,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},e(m,[2,14],{7:h,11:g}),e(_,[2,8]),e(_,[2,9]),e(_,[2,10]),e(p,[2,15]),e(p,[2,16]),e(p,[2,17]),{20:[1,35]},{21:[1,36]},e(m,[2,13],{7:h,11:g}),e(_,[2,11]),e(_,[2,12]),{21:[1,37]},e(p,[2,25]),e(p,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{g as e,h as t}from"./src-B2YqOS_g.js";import{$ as n,b as r,et as i,f as a,k as o,nt as s,x as c,z as l}from"./chunk-CSCIHK7Q-BeNiRoDm.js";import"./chunk-5ZQYHXKU-D_5qZ4Zv.js";import"./chunk-O5CBEL6O-Dh_KkhDf.js";import"./chunk-BSJP7CBP-C5nluir4.js";import"./chunk-L5ZTLDWV-DtSiy2JS.js";import{t as u}from"./chunk-55IACEB6-BXURqjLZ.js";import{t as d}from"./chunk-2J33WTMH-BEmf3Qku.js";import"./chunk-NZK2D7GU-BKDBTHUK.js";import"./chunk-3OPIFGDE-CtmMZbUU.js";import"./chunk-KSCS5N6A-D80hU7za.js";import{r as f,t as p}from"./chunk-LZXEDZCA-CFWlwpSj.js";var m=[];for(let e=0;e<256;++e)m.push((e+256).toString(16).slice(1));function h(e,t=0){return(m[e[t+0]]+m[e[t+1]]+m[e[t+2]]+m[e[t+3]]+`-`+m[e[t+4]]+m[e[t+5]]+`-`+m[e[t+6]]+m[e[t+7]]+`-`+m[e[t+8]]+m[e[t+9]]+`-`+m[e[t+10]]+m[e[t+11]]+m[e[t+12]]+m[e[t+13]]+m[e[t+14]]+m[e[t+15]]).toLowerCase()}var g=new Uint8Array(16);function _(){return crypto.getRandomValues(g)}function v(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():y(e,t,n)}function y(e,t,n){e||={};let r=e.random??e.rng?.()??_();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return h(r)}var b=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,13],i=[1,12],a=[1,15],o=[1,16],s=[1,20],c=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],p=[6,7,11],m=[1,6,13,15,16,19,22],h=[1,33],g=[1,34],_=[1,6,7,11,13,15,16,19,22],v={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`MINDMAP`,11:`EOF`,13:`SPACELIST`,15:`ICON`,16:`CLASS`,19:`NODE_DSTART`,20:`NODE_DESCR`,21:`NODE_DEND`,22:`NODE_ID`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 16:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 17:case 21:r.decorateNode({class:a[s]});break;case 18:r.getLogger().trace(`SPACELIST`);break;case 19:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 20:r.decorateNode({icon:a[s]});break;case 25:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 26:this.$={id:a[s],descr:a[s],type:r.nodeType.DEFAULT};break;case 27:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])};break}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:r,12:21,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},{6:r,9:22,12:11,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},{6:u,7:d,10:23,11:f},e(p,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:c}),e(p,[2,18]),e(p,[2,19]),e(p,[2,20]),e(p,[2,21]),e(p,[2,23]),e(p,[2,24]),e(p,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:d,10:32,11:f},{1:[2,7],6:r,12:21,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},e(m,[2,14],{7:h,11:g}),e(_,[2,8]),e(_,[2,9]),e(_,[2,10]),e(p,[2,15]),e(p,[2,16]),e(p,[2,17]),{20:[1,35]},{21:[1,36]},e(m,[2,13],{7:h,11:g}),e(_,[2,11]),e(_,[2,12]),{21:[1,37]},e(p,[2,25]),e(p,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};v.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(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
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{A as e,I as t,L as n,M as r,N as i,P as a,_ as o,a as s,c,d as l,g as u,h as d,i as ee,j as f,k as p,l as m,m as h,n as g,o as _,p as te,r as v,s as y,t as ne,u as re,v as b}from"./OwnerPickerForm-BOG15_5q.js";import{$n as ie,An as x,Er as S,Ht as C,Kn as ae,M as oe,N as w,Nn as T,Ot as E,Pt as D,Rn as O,Vt as k,Xt as se,Yn as ce,_ as le,_n as ue,an as de,ar as A,bt as fe,dr as pe,er as me,fr as he,g as j,gn as ge,h as _e,hn as ve,in as M,j as N,jn as P,kr as ye,lr as be,on as xe,sn as Se,v as Ce,xr as we}from"./index-CbAhFc-0.js";var F=ye(S(),1),I=he();function Te({last:e=!1,n:t,current:n,done:r,onClick:i}){return(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{onClick:i,title:i?`Go back to this step`:void 0,className:[`font-sans flex h-6 w-6 items-center justify-center rounded-full border text-[11px] font-semibold transition-colors`,r?`border-health-ok bg-health-ok-soft text-health-ok`:t===n?`border-accent bg-accent text-white`:`border-border-soft text-text-subtle`,i?`cursor-pointer hover:opacity-60`:``].join(` `),children:t}),!e&&(0,I.jsx)(`span`,{className:[`h-px w-8 transition-colors`,t<n?`bg-health-ok/40`:`bg-border-soft`].join(` `)})]})}function Ee({error:e,onChoose:t,saving:n,value:r}){return(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,I.jsx)(R,{label:`Slack`,platform:`slack`,disabled:n,pending:n&&r===`slack`,enterClassName:`animate-in fade-in slide-in-from-bottom-3 fill-mode-both duration-500 delay-150 motion-reduce:animate-none`,onChoose:()=>t(`slack`)}),(0,I.jsx)(R,{label:`Feishu`,platform:`feishu`,disabled:n,pending:n&&r===`feishu`,enterClassName:`animate-in fade-in slide-in-from-bottom-3 fill-mode-both duration-500 delay-200 motion-reduce:animate-none`,onChoose:()=>t(`feishu`)})]}),e&&(0,I.jsx)(`p`,{className:`font-sans mt-4 text-center text-[12px] text-health-error`,children:e})]})}var L={slack:`hover:border-brand-slack/45 hover:shadow-brand-slack`,feishu:`hover:border-brand-feishu/45 hover:shadow-brand-feishu`};function R({disabled:e,enterClassName:t,label:n,onChoose:r,pending:i,platform:a}){return(0,I.jsxs)(`button`,{type:`button`,onClick:r,disabled:e,className:[`group relative flex flex-col items-center gap-3.5 rounded-lg border px-4 py-8 text-center transition-all duration-200`,t??``,i?`border-accent bg-accent-soft/40 shadow-sm`:`border-border-soft bg-surface hover:-translate-y-0.5 hover:bg-surface-elevated ${L[a]}`,e&&!i?`opacity-50`:``,e?`cursor-wait`:`cursor-pointer active:translate-y-0 active:scale-[0.98]`].join(` `),children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`flex h-12 w-12 items-center justify-center rounded-md bg-white shadow-sm ring-1 ring-border-soft transition-transform duration-200 group-hover:scale-105`,children:a===`slack`?(0,I.jsx)(De,{className:`h-7 w-7`}):(0,I.jsx)(Oe,{className:`h-7 w-7`})}),(0,I.jsx)(`span`,{className:`font-sans text-[13px] font-medium tracking-wide text-text-muted`,children:n}),i&&(0,I.jsx)(`span`,{className:`absolute right-2.5 top-2.5`,"aria-hidden":!0,children:(0,I.jsx)(se,{className:`h-3.5 w-3.5 animate-spin text-accent`})})]})}function De({className:e=`h-5 w-5`}){return(0,I.jsx)(`svg`,{className:e,viewBox:`0 0 2447.6 2452.5`,xmlns:`http://www.w3.org/2000/svg`,children:(0,I.jsxs)(`g`,{clipRule:`evenodd`,fillRule:`evenodd`,children:[(0,I.jsx)(`path`,{d:`m897.4 0c-135.3.1-244.8 109.9-244.7 245.2-.1 135.3 109.5 245.1 244.8 245.2h244.8v-245.1c.1-135.3-109.5-245.1-244.9-245.3.1 0 .1 0 0 0m0 654h-652.6c-135.3.1-244.9 109.9-244.8 245.2-.2 135.3 109.4 245.1 244.7 245.3h652.7c135.3-.1 244.9-109.9 244.8-245.2.1-135.4-109.5-245.2-244.8-245.3z`,fill:`#36C5F0`}),(0,I.jsx)(`path`,{d:`m2447.6 899.2c.1-135.3-109.5-245.1-244.8-245.2-135.3.1-244.9 109.9-244.8 245.2v245.3h244.8c135.3-.1 244.9-109.9 244.8-245.3zm-652.7 0v-654c.1-135.2-109.4-245-244.7-245.2-135.3.1-244.9 109.9-244.8 245.2v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.3z`,fill:`#2EB67D`}),(0,I.jsx)(`path`,{d:`m1550.1 2452.5c135.3-.1 244.9-109.9 244.8-245.2.1-135.3-109.5-245.1-244.8-245.2h-244.8v245.2c-.1 135.2 109.5 245 244.8 245.2zm0-654.1h652.7c135.3-.1 244.9-109.9 244.8-245.2.2-135.3-109.4-245.1-244.7-245.3h-652.7c-135.3.1-244.9 109.9-244.8 245.2-.1 135.4 109.4 245.2 244.7 245.3z`,fill:`#ECB22E`}),(0,I.jsx)(`path`,{d:`m0 1553.2c-.1 135.3 109.5 245.1 244.8 245.2 135.3-.1 244.9-109.9 244.8-245.2v-245.2h-244.8c-135.3.1-244.9 109.9-244.8 245.2zm652.7 0v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.2v-653.9c.2-135.3-109.4-245.1-244.7-245.3-135.4 0-244.9 109.8-244.8 245.1 0 0 0 .1 0 0`,fill:`#E01E5A`})]})})}function Oe({className:e=`h-5 w-5`}){return(0,I.jsx)(`img`,{src:`/feishu-logo.png`,alt:`Feishu`,className:e,draggable:!1})}var z=`https://applink.feishu.cn/client/web_app/open?preview=onboarding-qr`;function ke({agentId:e,initialError:t,initialRegistration:n,onConnect:r,onPendingConnectSource:i,onPhaseChange:a,initialConnectSource:o,previewPhase:c}){let l=c!==void 0,[u,d]=(0,F.useState)(c??Ae(n,t,o));(0,F.useEffect)(()=>{a?.(u)},[u,a]);let[f,p]=(0,F.useState)(n??null),[h,g]=(0,F.useState)(t),[_,te]=(0,F.useState)(``),[v,y]=(0,F.useState)(``),[ne,b]=(0,F.useState)(!1),[ie,x]=(0,F.useState)(!1),[S,C]=(0,F.useState)(!1),[oe,w]=(0,F.useState)(o??(n?.state===`connected`?`registerApp`:null)),T=(0,F.useRef)(null),E=(0,F.useRef)(0);function D(){T.current!==null&&(clearTimeout(T.current),T.current=null)}function O(){D(),C(!1),T.current=setTimeout(()=>{C(!0)},ee)}(0,F.useEffect)(()=>()=>{T.current!==null&&clearTimeout(T.current)},[]),re({agentId:e,enabled:!l&&m(f),registration:f,onStatus:e=>{p(e),e.verificationUrl&&(D(),x(!1),C(!1),d(e=>e===`connected`?e:`authorizing`)),e.state===`connected`&&k(`registerApp`),e.state===`failed`&&(D(),x(!1),C(!1),g(e.error?.description??e.error?.message),d(e=>e===`connected`?e:`fallback`))},onError:e=>{g(e instanceof Error?e.message:`Could not refresh Feishu app setup`)}});function k(e){D(),x(!1),C(!1),w(e),i?.(e),d(`permissions`),ae()}function le(){let e=oe??`registerApp`;d(`connected`),r?.({source:e})}async function ue(){if(ie||l)return;let t=E.current+1;E.current=t,x(!0),C(!1),g(void 0),p(null),d(`fallback`),O();let n=!1;try{let r=await ce(e);if(t!==E.current)return;p(r),r.state===`connected`?k(`registerApp`):r.state===`failed`?(g(r.error?.description??r.error?.message),d(`fallback`)):r.verificationUrl?d(`authorizing`):m(r)&&(n=!0)}catch(e){if(t!==E.current)return;g(e instanceof Error?e.message:`Could not start creating your Feishu app.`),d(`fallback`)}finally{t===E.current&&!n&&(D(),x(!1),C(!1))}}async function de(){if(!(ne||!_.trim()||!v.trim())){E.current+=1,D(),x(!1),C(!1),p(null),b(!0),g(void 0);try{await P(e,{appId:_.trim(),appSecret:v.trim()}),y(``),k(`manual`)}catch(e){g(e instanceof Error?e.message:`Feishu connection failed`)}finally{b(!1)}}}let A=f?.verificationUrl??(l?z:void 0);return(0,I.jsxs)(`div`,{className:`space-y-5`,children:[u===`authorizing`&&A&&A?(0,I.jsx)(s,{verificationUrl:A}):null,u===`fallback`&&(0,I.jsx)(Ne,{appId:_,appSecret:v,saving:ne,onAppId:te,onAppSecret:y,onRetry:()=>void ue(),onSubmit:()=>void de(),retrying:ie,retrySlow:S}),u===`permissions`&&(0,I.jsx)(je,{agentId:e,onContinue:le,preview:l}),u===`connected`&&(0,I.jsx)(`div`,{className:`flex justify-center py-6`,children:(0,I.jsx)(se,{className:`h-6 w-6 animate-spin text-accent`,"aria-hidden":!0})}),h&&u!==`fallback`&&(0,I.jsx)(`p`,{className:`font-sans text-[12px] text-health-error`,children:h})]})}function Ae(e,t,n){return n?`permissions`:t||e?.state===`failed`?`fallback`:e?.state===`connected`?`permissions`:`authorizing`}function je({agentId:e,onContinue:t,preview:r}){let[i,a]=(0,F.useState)(null),[o,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)(!1),u=be({queryKey:A.agentFeishuScopes(e),queryFn:()=>O(e),enabled:!r}),{isError:d,isFetching:ee,refetch:f}=u,p=r?B():u.data,m=p?.recommended.state,h=i??m;async function _(){a(null);let e=(await f()).data?.recommended.state;(e===`granted`||e===`missing`)&&a(e)}if(!p&&!d)return(0,I.jsx)(`div`,{className:`flex justify-center py-6`,children:(0,I.jsx)(se,{className:`h-6 w-6 animate-spin text-accent`,"aria-hidden":!0})});if(h===`granted`)return(0,I.jsxs)(`div`,{className:`space-y-3 rounded-sm border border-health-ok/30 bg-health-ok-soft px-4 py-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(n,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-health-ok`}),(0,I.jsx)(`p`,{className:`font-serif text-[13px] leading-snug text-text`,children:`Recommended Feishu permissions are on. Your Feishu bot is good to go.`})]}),(0,I.jsx)(w,{className:`w-full`,onClick:t,children:`Start activity`})]});let te=p?.recommended.authUrl,y=p?.recommended.authUrls;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(g,{scopes:v(p),authUrl:te,authUrls:y,confirmedMissing:i===`missing`,showPerms:o,onTogglePerms:()=>s(e=>!e),onRecheck:()=>void _(),isRechecking:ee,statusLine:(0,I.jsxs)(I.Fragment,{children:[p?.recommended.message&&i!==`missing`&&(0,I.jsxs)(`div`,{className:`break-words font-sans text-[11px] text-text-subtle`,children:[`Last check: `,p.recommended.message]}),d&&!p?.recommended.message&&(0,I.jsx)(`div`,{className:`font-sans text-[11px] text-text-subtle`,children:`Could not check Feishu permissions.`})]}),footer:(0,I.jsx)(`div`,{className:`border-t border-border-soft pt-3`,children:(0,I.jsx)(`button`,{type:`button`,onClick:()=>l(!0),className:`font-sans text-[12px] text-text-muted underline decoration-text-subtle/40 underline-offset-2 transition-colors hover:text-text`,children:`Skip for now`})})}),c&&(0,I.jsx)(Me,{onKeepSettingUp:()=>l(!1),onSkipAnyway:()=>{l(!1),t()}})]})}function Me({onKeepSettingUp:e,onSkipAnyway:t}){let{dialogRef:n,initialFocusRef:r,titleId:i,descriptionId:a}=N(!0);return(0,I.jsx)(`div`,{ref:n,tabIndex:-1,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/30 px-4`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":i,"aria-describedby":a,children:(0,I.jsxs)(`div`,{className:`w-full max-w-sm space-y-4 rounded-lg border border-border-soft bg-surface px-5 py-4 shadow-lg`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,I.jsx)(M,{className:`mt-0.5 h-[18px] w-[18px] shrink-0 text-health-error`,"aria-hidden":!0}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(`div`,{id:i,className:`font-serif text-[14px] font-semibold leading-tight text-text`,children:`Skipping leaves some teammate and document features off`}),(0,I.jsx)(`p`,{id:a,className:`font-serif text-[13px] leading-relaxed text-text-muted`,children:`Your Feishu bot keeps sending and receiving messages, but it won’t recognize teammates by name, work fully in group chats with people and other bots, or work with Feishu Drive and cloud documents. Looking people up by email or phone also stays off. You can authorize anytime from the agent’s profile.`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-4 pt-0.5`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:t,className:`font-sans text-[12px] text-text-muted underline decoration-text-subtle/40 underline-offset-2 transition-colors hover:text-text`,children:`Skip anyway`}),(0,I.jsx)(w,{ref:r,size:`sm`,onClick:e,children:`Keep setting up`})]})]})})}function B(){let e=j.map(e=>({capability:e.capability,description:e.description,granted:!1,label:e.label,scope:e.scope}));return{appId:`cli_preview`,connected:!0,profileName:{authUrl:`https://open.feishu.cn/app/cli_preview/auth?preview=recommended-scopes`,granted:!1,scope:`contact:user.basic_profile:readonly`,state:`missing`},recommended:{authUrl:`https://open.feishu.cn/app/cli_preview/auth?preview=recommended-scopes`,authUrls:[{authUrl:`https://open.feishu.cn/app/cli_preview/auth?preview=recommended-scopes`,label:`Recommended permissions`,scopes:e.map(e=>e.scope)}],granted:!1,missingScopes:e.map(e=>e.scope),scopes:e,state:`missing`}}}function Ne({appId:e,appSecret:t,onAppId:n,onAppSecret:r,onRetry:i,onSubmit:a,retrying:o,retrySlow:s,saving:l}){let u=l||!e.trim()||!t.trim();return(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-2 rounded-sm border border-border-soft bg-surface px-4 py-3`,children:[(0,I.jsx)(w,{className:`w-full`,onClick:i,disabled:l||o,children:o?(0,I.jsx)(_,{}):`Try creating a new Feishu app again`}),o&&s&&(0,I.jsx)(c,{})]}),(0,I.jsx)(y,{appId:e,appSecret:t,description:`We couldn't finish creating the new app. Connect an app you already have to continue.`,disabled:u,saving:l,onAppId:n,onAppSecret:r,onSubmit:a})]})}var Pe={feishu:`Feishu`,slack:`Slack`},Fe=15e3;function V({firstRun:n,onClose:s,onComplete:c,teams:ee,defaultTeamId:g}){let _=pe(),v=typeof window<`u`?new URLSearchParams(window.location.search):new URLSearchParams,y=Number(v.get(`_previewStep`)??0),S=v.get(`_previewFeishu`)??void 0,O=v.get(`_previewPlatform`)??void 0,he=v.get(`_previewStep`),[j,M]=(0,F.useState)((S?S===`permissions`||S===`connected`?`permissions`:`connect`:he===`platform`?`platform`:y===1?`agent`:y===2?`connect`:y===3?O===`feishu`?`permissions`:`owner`:void 0)??(n?`platform`:`agent`)),[N,P]=(0,F.useState)(S?`feishu`:O??`slack`),[ye,we]=(0,F.useState)(!1),[L,R]=(0,F.useState)(!1),[De,Oe]=(0,F.useState)(),[z,Ae]=(0,F.useState)(``),[je,Me]=(0,F.useState)(!1),[B,Ne]=(0,F.useState)(``),[V,Ie]=(0,F.useState)(ve),[Le,Re]=(0,F.useState)(ue().find(e=>e.kind===`claude-code`)?.defaultModel??``),[ze,Be]=(0,F.useState)(ge),[Ve,He]=(0,F.useState)(!1),[Ue,We]=(0,F.useState)(null),[Ge,H]=(0,F.useState)(!1),Ke=ee??[],[qe]=(0,F.useState)(g??`default`),Je=Ke.find(e=>e.id===qe),Ye=Je?`${Je.home.replace(/\/+$/,``)}/agents`:le,[U,Xe]=(0,F.useState)(S?`preview-agent`:null),[Ze,Qe]=(0,F.useState)(null),[$e,et]=(0,F.useState)(!1),[tt,nt]=(0,F.useState)(),[rt,it]=(0,F.useState)(!1),[at,ot]=(0,F.useState)(null),[st,ct]=(0,F.useState)(),[lt,W]=(0,F.useState)(S),[ut,dt]=(0,F.useState)(S===`permissions`||S===`connected`?`registerApp`:null),ft=(0,F.useRef)(null),G=(0,F.useRef)(0),pt=(0,F.useRef)(null),{data:K,error:q}=be({queryKey:A.providerAvailability(),queryFn:fe}),{data:mt}=be({queryKey:A.workspacePlatform(),queryFn:E}),J=(0,F.useMemo)(()=>f(ue(),K),[K]),Y=(0,F.useMemo)(()=>[`agent`,...N===`slack`?[`connect`,`owner`]:[`connect`,`permissions`]],[N]),ht=j===`platform`,gt=Math.max(0,Y.indexOf(j)),_t=N===`feishu`&&lt===`connected`,X=_e(z.trim()),{pollUntil:vt}=re({agentId:U??X}),yt=e=>J.find(t=>t.kind===e)?.label??e,bt=e=>e===`xhigh`?`Extra High`:e&&e.charAt(0).toUpperCase()+e.slice(1),Z=J.find(e=>e.kind===V),xt=p(Z,Le,K),St=i(Z,K),Ct=a(Z,K),wt=r(Z,K),Tt=t(J,K),Et=!K&&!q,Q=$e,Dt=tt,Ot=rt,kt=X?Ce(X,Ue??Ye):`${Ue??Ye}/<name>`;(0,F.useEffect)(()=>{if(!K||i(J.find(e=>e.kind===V),K))return;let t=e(J,K);t&&setTimeout(()=>{Ie(t.kind),Re(t.defaultModel)},0)},[K,V,J]),(0,F.useEffect)(()=>{if(j!==`agent`)return;let e=setTimeout(()=>ft.current?.focus(),50);return()=>clearTimeout(e)},[j]),(0,F.useEffect)(()=>{if(O||S||!mt||ye)return;let e=setTimeout(()=>P(mt),0);return()=>clearTimeout(e)},[mt,ye,O,S]),(0,F.useEffect)(()=>{if(j===`platform`||Y.includes(j))return;let e=setTimeout(()=>M(Y[Y.length-1]??`agent`),0);return()=>clearTimeout(e)},[j,Y]);let At=(0,F.useCallback)(async()=>{U&&(ae(),await x().catch(()=>void 0)),s(U??void 0)},[U,s]);(0,F.useEffect)(()=>{function e(e){if(!(e.key!==`Escape`||Q)){if(Ge){H(!1);return}At()}}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[At,Q,Ge]),(0,F.useEffect)(()=>()=>{G.current+=1,$()},[]);function jt(e){let t=J.find(t=>t.kind===e),n=t?.defaultModel??``,r=p(t,n,K);Ie(e),Re(n),Be(r.includes(`xhigh`)?ge:r[0]??``)}async function Mt(e){if(!L){R(!0),Oe(void 0);try{let[t]=await Promise.all([D(e),new Promise(e=>setTimeout(e,220))]);P(t),_.setQueryData(A.workspacePlatform(),t),M(`agent`)}catch(e){Oe(e instanceof Error?e.message:`Failed to save workspace platform`)}finally{R(!1)}}}function Nt(e){L||(we(!0),P(e),Mt(e))}function $(){pt.current!==null&&(window.clearTimeout(pt.current),pt.current=null)}function Pt(e){$(),it(!1),pt.current=window.setTimeout(()=>{G.current===e&&it(!0)},Fe)}async function Ft(e,t){let n=await ce(e,{botName:z.trim()||void 0});return G.current===t?(ot(n),vt(n,{agentId:e,isCurrentRun:()=>G.current===t,onStatus:ot,shouldContinue:e=>m(e)&&!e.verificationUrl})):null}async function It(){if($e||(Me(!0),!X||!B.trim()||!St))return;let e=G.current+1,t=N===`feishu`&&!!U&&(lt===`permissions`||lt===`connected`);G.current=e,et(!0),nt(N===`feishu`&&!U?`feishu`:`agent`),Qe(null),t||(ot(null),ct(void 0),W(void 0),dt(null)),N===`feishu`&&!t?Pt(e):$();let n=U,r={kind:V,model:Le,...xt.length>0&&ze?{reasoningEffort:ze}:{}};try{if(n)await ie(n,{displayName:z.trim(),role:B.trim()}),await me(n,r),ae();else{let e=await T({name:z.trim(),role:B.trim(),homePath:kt,provider:r,teamId:qe});n=e.id,Xe(e.id)}if(G.current!==e)return;if(N===`feishu`){if(t){M(`permissions`);return}try{let t=await Ft(n,e);if(!t||G.current!==e)return;if(t.state===`connected`){dt(`registerApp`),W(`permissions`),M(`permissions`);return}if(t.state===`failed`){ct(t.error?.description??t.error?.message??`Could not start Feishu app setup`),W(`fallback`),M(`connect`);return}W(`authorizing`),M(`connect`);return}catch(t){if(G.current!==e)return;ct(t instanceof Error?t.message:`Could not start Feishu app setup`),W(`fallback`),M(`connect`);return}}M(`connect`)}catch(t){if(G.current!==e)return;Qe(t instanceof Error?t.message:U?`Failed to update agent`:`Failed to create agent`)}finally{G.current===e&&($(),et(!1),nt(void 0),it(!1))}}async function Lt(){await x(),M(`owner`)}async function Rt(e,t=U){dt(e),await x(),t&&c?.(t,`feishu`,e===`registerApp`)}function zt(e){W(e),e===`permissions`&&M(`permissions`)}function Bt(){U&&c?.(U)}let Vt=j===`platform`?`Where does your team work?`:j===`agent`?`Create your agent`:j===`connect`?N===`feishu`?`Create Feishu bot`:`Connect to ${Pe[N]}`:j===`permissions`?`Authorize Feishu permissions`:`Pick an owner`,Ht=(()=>{if(!Q){if(!X)return`Enter a name`;if(!B.trim())return`Enter a role`;if(q)return`Provider check failed`;if(Et)return`Checking providers...`;if(!St)return`Install a provider first`}})(),Ut=Q?Dt===`feishu`?`Creating your Feishu app…`:U?`Saving…`:`Creating…`:Ht??(U?`Save & continue →`:`Create agent →`);if(Ge)return(0,I.jsx)(`div`,{className:`fixed inset-0 z-50 overflow-y-auto bg-page/70 backdrop-blur-sm`,children:(0,I.jsx)(`div`,{className:`flex min-h-full w-full items-center justify-center px-4 py-8`,children:(0,I.jsxs)(`div`,{className:`relative w-full max-w-2xl rounded-sm border border-border-soft bg-surface shadow-deep`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border-soft px-5 py-4`,children:[(0,I.jsx)(`span`,{className:`font-serif text-[15px] font-semibold text-text`,children:`Choose home folder`}),(0,I.jsx)(`button`,{onClick:()=>H(!1),className:`flex h-8 w-8 items-center justify-center rounded-sm text-text-muted hover:bg-surface-elevated hover:text-text`,children:(0,I.jsx)(C,{className:`h-4 w-4`})})]}),(0,I.jsx)(`div`,{className:`p-5`,children:(0,I.jsx)(oe,{onChoose:e=>{We(e),H(!1)},onCancel:()=>H(!1)})})]})})});let Wt=(0,I.jsxs)(`div`,{className:`relative w-full max-w-xl rounded-sm border border-border-soft bg-surface shadow-deep`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border-soft px-6 py-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[j===`agent`&&n&&(0,I.jsx)(`button`,{onClick:()=>M(`platform`),className:`-ml-1.5 flex h-7 w-7 items-center justify-center rounded-sm text-text-subtle transition-colors hover:bg-surface-elevated hover:text-text-muted`,title:`Back to platform`,children:(0,I.jsx)(xe,{className:`h-4 w-4`})}),!ht&&(0,I.jsx)(`div`,{className:`flex items-center gap-1`,children:Y.map((e,t)=>(0,I.jsx)(Te,{n:t+1,current:_t?Y.length+1:gt+1,done:_t||t<gt,last:t===Y.length-1,onClick:t<gt&&!(N===`feishu`&&e===`connect`)?()=>M(e):void 0},e))}),(0,I.jsx)(`span`,{className:`font-serif text-[15px] font-semibold text-text`,children:Vt})]}),(!n||U)&&(0,I.jsx)(`button`,{onClick:()=>void At(),className:`flex h-8 w-8 items-center justify-center rounded-sm text-text-muted hover:bg-surface-elevated hover:text-text`,title:`Close`,children:(0,I.jsx)(C,{className:`h-4 w-4`})})]}),j===`agent`&&(0,I.jsxs)(`div`,{className:`animate-in fade-in slide-in-from-right-4 fill-mode-both duration-300 motion-reduce:animate-none px-6 py-6`,children:[(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`font-sans mb-1.5 block text-[12px] font-medium uppercase tracking-[0.08em] text-text-muted`,children:`Name`}),(0,I.jsx)(`input`,{ref:ft,type:`text`,value:z,onChange:e=>Ae(e.target.value),onKeyDown:e=>{e.key===`Enter`&&It()},placeholder:`e.g. Aria`,className:`w-full rounded-sm border border-border-soft bg-surface px-3 py-2 font-serif text-[15px] text-text placeholder:text-text-subtle focus:border-accent focus:outline-none`}),je&&!X&&(0,I.jsx)(`p`,{className:`font-sans mt-1 text-[11px] text-health-error`,children:`Name must include at least one letter or number.`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`font-sans mb-1.5 block text-[12px] font-medium uppercase tracking-[0.08em] text-text-muted`,children:`Role`}),(0,I.jsx)(`input`,{type:`text`,value:B,onChange:e=>Ne(e.target.value),onKeyDown:e=>{e.key===`Enter`&&It()},placeholder:`e.g. Full-stack developer`,className:`w-full rounded-sm border border-border-soft bg-surface px-3 py-2 font-serif text-[15px] text-text placeholder:text-text-subtle focus:border-accent focus:outline-none`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`font-sans mb-1.5 block text-[12px] font-medium uppercase tracking-[0.08em] text-text-muted`,children:`Provider`}),K&&Tt.length===J.length?(0,I.jsx)(`p`,{className:`font-sans text-[12px] text-health-warn`,children:`No providers detected. Install Claude Code, Codex CLI, Kimi CLI, Grok Build, or OpenCode first.`}):(0,I.jsxs)(`div`,{className:[`grid grid-cols-1 gap-2`,xt.length>0?`sm:grid-cols-3`:`sm:grid-cols-2`].join(` `),children:[(0,I.jsxs)(h,{value:V,onValueChange:e=>jt(e),children:[(0,I.jsx)(o,{className:`!h-auto w-full py-2 font-serif text-[15px]`,children:(0,I.jsx)(b,{children:e=>yt(e)})}),(0,I.jsx)(d,{children:J.map(e=>{let t=a(e,K);return(0,I.jsxs)(u,{value:e.kind,disabled:!!t,children:[e.label,t?`: ${t}`:``]},e.kind)})})]}),(0,I.jsxs)(h,{value:Le,onValueChange:e=>{if(!e)return;let t=p(Z,e,K);Re(e),Be(t.includes(`xhigh`)?`xhigh`:t[0]??``)},children:[(0,I.jsx)(o,{className:`!h-auto w-full py-2 font-serif text-[15px]`,children:(0,I.jsx)(b,{children:e=>te(e)})}),(0,I.jsx)(d,{children:(Z?.models??[]).map(e=>(0,I.jsx)(u,{value:e,children:te(e)},e))})]}),xt.length>0&&(0,I.jsxs)(h,{value:ze,onValueChange:e=>{e&&Be(e)},children:[(0,I.jsx)(o,{className:`!h-auto w-full py-2 font-serif text-[15px]`,children:(0,I.jsx)(b,{children:e=>bt(e)})}),(0,I.jsx)(d,{children:xt.map(e=>(0,I.jsx)(u,{value:e,children:bt(e)},e))})]})]}),Ct&&(0,I.jsx)(`p`,{className:`font-sans mt-1 text-[11px] text-health-warn`,children:Ct}),wt&&!Ct&&(0,I.jsx)(`p`,{className:`font-sans mt-1 text-[10px] text-text-subtle`,children:wt}),Et&&(0,I.jsx)(`p`,{className:`font-sans mt-1 text-[11px] text-text-subtle`,children:`Checking installed provider CLIs...`}),q&&(0,I.jsxs)(`p`,{className:`font-sans mt-1 text-[11px] text-health-error`,children:[`Provider check failed:`,` `,q instanceof Error?q.message:String(q)]})]}),!U&&(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>He(e=>!e),className:`font-sans flex items-center gap-1 text-[12px] text-text-muted hover:text-text transition-colors`,children:[Ve?(0,I.jsx)(Se,{className:`h-3.5 w-3.5`}):(0,I.jsx)(de,{className:`h-3.5 w-3.5`}),`Where it lives`]}),Ve&&(0,I.jsxs)(`div`,{className:`mt-2 rounded-sm border border-border-soft bg-surface-elevated p-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`font-mono text-[13px] text-text break-all`,children:kt}),(0,I.jsx)(`div`,{className:`font-sans mt-0.5 text-[11px] text-text-subtle`,children:`Will be created automatically`}),(0,I.jsxs)(`p`,{className:`font-sans mt-2 text-[12px] text-text-muted`,children:[`Your agent's memory lives here, in its own`,` `,(0,I.jsx)(`strong`,{className:`font-semibold text-text`,children:`home folder`}),` under the team's folder.`]})]}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>H(!0),className:`font-sans shrink-0 text-[12px] text-text-muted underline decoration-text-muted/40 underline-offset-2 hover:text-text hover:decoration-text/40 transition-colors`,children:`Change…`})]}),Ue&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>We(null),className:`font-sans mt-2 text-[11px] text-text-subtle underline underline-offset-2 hover:text-text transition-colors`,children:`Reset to default`})]})]})]}),Ze&&(0,I.jsx)(`p`,{className:`font-sans mt-3 text-[12px] text-health-error`,children:Ze}),(0,I.jsxs)(`div`,{className:`mt-6`,children:[(0,I.jsxs)(w,{className:`w-full`,onClick:()=>void It(),disabled:Q||!!Ht,children:[Q&&(0,I.jsx)(se,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),Ut]}),Dt===`feishu`&&Ot&&(0,I.jsx)(`p`,{className:`mt-2 text-center font-sans text-[11px] text-text-subtle`,children:`This is taking longer than usual.`})]})]}),j===`connect`&&U&&N===`slack`&&(0,I.jsx)(`div`,{className:`px-6 py-6`,children:(0,I.jsx)(l,{agentId:U,onConnect:Lt})}),(j===`connect`||j===`permissions`)&&U&&N===`feishu`&&(0,I.jsx)(`div`,{className:`px-6 py-6`,children:(0,I.jsx)(ke,{agentId:U,initialError:st,initialRegistration:at,initialConnectSource:ut??void 0,previewPhase:S,onPhaseChange:zt,onPendingConnectSource:dt,onConnect:e=>void Rt(e.source)})}),j===`owner`&&U&&N===`slack`&&(0,I.jsx)(`div`,{className:`px-6 py-6`,children:(0,I.jsx)(ne,{agentId:U,onConfirm:Bt,onSkip:Bt,submitLabel:`Start onboarding →`,skipLabel:`Start without owner →`,showRationale:!0})})]});return n?(0,I.jsx)(`div`,{className:`fixed inset-0 overflow-y-auto bg-surface`,children:ht?(0,I.jsx)(`div`,{className:`flex min-h-full w-full flex-col items-center justify-center px-4 py-12`,children:(0,I.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center text-center`,children:[(0,I.jsxs)(`div`,{className:`animate-in fade-in slide-in-from-bottom-2 fill-mode-both duration-500 motion-reduce:animate-none flex items-center justify-center gap-2.5`,children:[(0,I.jsx)(k,{className:`h-8 w-8 text-accent`}),(0,I.jsx)(`span`,{className:`font-serif text-[34px] font-semibold leading-none text-text`,children:`Anima`})]}),(0,I.jsx)(`p`,{className:`animate-in fade-in slide-in-from-bottom-2 fill-mode-both duration-500 delay-75 motion-reduce:animate-none mt-4 max-w-sm text-balance font-serif text-[15px] leading-relaxed text-text-muted`,children:`AI teammates in your chat, building shared team context.`}),(0,I.jsx)(`span`,{"aria-hidden":!0,className:`animate-in fade-in fill-mode-both duration-500 delay-100 motion-reduce:animate-none mt-11 h-px w-8 bg-border-strong/50`}),(0,I.jsx)(`p`,{className:`animate-in fade-in fill-mode-both duration-500 delay-100 motion-reduce:animate-none mt-5 font-sans text-[11px] font-semibold uppercase tracking-[0.18em] text-text-subtle`,children:`Where does your team work?`}),(0,I.jsx)(`div`,{className:`mt-3 w-full`,children:(0,I.jsx)(Ee,{error:De,onChoose:Nt,saving:L,value:N})})]})}):(0,I.jsxs)(`div`,{className:`flex min-h-full w-full flex-col items-center justify-center gap-6 px-4 py-12`,children:[(0,I.jsxs)(`div`,{className:`animate-in fade-in fill-mode-both duration-500 motion-reduce:animate-none flex items-center justify-center gap-2`,children:[(0,I.jsx)(k,{className:`h-6 w-6 text-accent`}),(0,I.jsx)(`span`,{className:`font-serif text-[22px] font-semibold text-text`,children:`Anima`})]}),Wt]})}):Wt}function Ie(){let e=we();return(0,I.jsx)(V,{firstRun:!0,onClose:t=>e(t?`/agents/${t}/profile`:`/`),onComplete:(t,n,r)=>e(`/agents/${t}/activity`,{state:n?{onboardingConnected:n,feishuGreetingBanner:!!r}:void 0})})}function Le({onClose:e,teams:t,defaultTeamId:n}){let r=we();return(0,I.jsx)(`div`,{className:`fixed inset-0 z-50 overflow-y-auto bg-page/70 backdrop-blur-sm`,children:(0,I.jsx)(`div`,{className:`flex min-h-full w-full items-center justify-center px-4 py-8`,children:(0,I.jsx)(V,{firstRun:!1,teams:t,defaultTeamId:n,onClose:t=>{e(),t&&r(`/agents/${t}/profile`)},onComplete:(t,n,i)=>{e(),r(`/agents/${t}/activity`,{state:n?{onboardingConnected:n,feishuGreetingBanner:!!i}:void 0})}})})})}export{Le as AgentCreateModal,Ie as OnboardingPage};
1
+ import{A as e,I as t,L as n,M as r,N as i,P as a,_ as o,a as s,c,d as l,g as u,h as d,i as ee,j as f,k as p,l as m,m as h,n as g,o as _,p as te,r as v,s as y,t as ne,u as re,v as b}from"./OwnerPickerForm-Dad51XVK.js";import{$n as ie,An as x,Er as S,Ht as C,Kn as ae,M as oe,N as w,Nn as T,Ot as E,Pt as D,Rn as O,Vt as k,Xt as se,Yn as ce,_ as le,_n as ue,an as de,ar as A,bt as fe,dr as pe,er as me,fr as he,g as j,gn as ge,h as _e,hn as ve,in as M,j as N,jn as P,kr as ye,lr as be,on as xe,sn as Se,v as Ce,xr as we}from"./index-DlHETnHC.js";var F=ye(S(),1),I=he();function Te({last:e=!1,n:t,current:n,done:r,onClick:i}){return(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{onClick:i,title:i?`Go back to this step`:void 0,className:[`font-sans flex h-6 w-6 items-center justify-center rounded-full border text-[11px] font-semibold transition-colors`,r?`border-health-ok bg-health-ok-soft text-health-ok`:t===n?`border-accent bg-accent text-white`:`border-border-soft text-text-subtle`,i?`cursor-pointer hover:opacity-60`:``].join(` `),children:t}),!e&&(0,I.jsx)(`span`,{className:[`h-px w-8 transition-colors`,t<n?`bg-health-ok/40`:`bg-border-soft`].join(` `)})]})}function Ee({error:e,onChoose:t,saving:n,value:r}){return(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,I.jsx)(R,{label:`Slack`,platform:`slack`,disabled:n,pending:n&&r===`slack`,enterClassName:`animate-in fade-in slide-in-from-bottom-3 fill-mode-both duration-500 delay-150 motion-reduce:animate-none`,onChoose:()=>t(`slack`)}),(0,I.jsx)(R,{label:`Feishu`,platform:`feishu`,disabled:n,pending:n&&r===`feishu`,enterClassName:`animate-in fade-in slide-in-from-bottom-3 fill-mode-both duration-500 delay-200 motion-reduce:animate-none`,onChoose:()=>t(`feishu`)})]}),e&&(0,I.jsx)(`p`,{className:`font-sans mt-4 text-center text-[12px] text-health-error`,children:e})]})}var L={slack:`hover:border-brand-slack/45 hover:shadow-brand-slack`,feishu:`hover:border-brand-feishu/45 hover:shadow-brand-feishu`};function R({disabled:e,enterClassName:t,label:n,onChoose:r,pending:i,platform:a}){return(0,I.jsxs)(`button`,{type:`button`,onClick:r,disabled:e,className:[`group relative flex flex-col items-center gap-3.5 rounded-lg border px-4 py-8 text-center transition-all duration-200`,t??``,i?`border-accent bg-accent-soft/40 shadow-sm`:`border-border-soft bg-surface hover:-translate-y-0.5 hover:bg-surface-elevated ${L[a]}`,e&&!i?`opacity-50`:``,e?`cursor-wait`:`cursor-pointer active:translate-y-0 active:scale-[0.98]`].join(` `),children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`flex h-12 w-12 items-center justify-center rounded-md bg-white shadow-sm ring-1 ring-border-soft transition-transform duration-200 group-hover:scale-105`,children:a===`slack`?(0,I.jsx)(De,{className:`h-7 w-7`}):(0,I.jsx)(Oe,{className:`h-7 w-7`})}),(0,I.jsx)(`span`,{className:`font-sans text-[13px] font-medium tracking-wide text-text-muted`,children:n}),i&&(0,I.jsx)(`span`,{className:`absolute right-2.5 top-2.5`,"aria-hidden":!0,children:(0,I.jsx)(se,{className:`h-3.5 w-3.5 animate-spin text-accent`})})]})}function De({className:e=`h-5 w-5`}){return(0,I.jsx)(`svg`,{className:e,viewBox:`0 0 2447.6 2452.5`,xmlns:`http://www.w3.org/2000/svg`,children:(0,I.jsxs)(`g`,{clipRule:`evenodd`,fillRule:`evenodd`,children:[(0,I.jsx)(`path`,{d:`m897.4 0c-135.3.1-244.8 109.9-244.7 245.2-.1 135.3 109.5 245.1 244.8 245.2h244.8v-245.1c.1-135.3-109.5-245.1-244.9-245.3.1 0 .1 0 0 0m0 654h-652.6c-135.3.1-244.9 109.9-244.8 245.2-.2 135.3 109.4 245.1 244.7 245.3h652.7c135.3-.1 244.9-109.9 244.8-245.2.1-135.4-109.5-245.2-244.8-245.3z`,fill:`#36C5F0`}),(0,I.jsx)(`path`,{d:`m2447.6 899.2c.1-135.3-109.5-245.1-244.8-245.2-135.3.1-244.9 109.9-244.8 245.2v245.3h244.8c135.3-.1 244.9-109.9 244.8-245.3zm-652.7 0v-654c.1-135.2-109.4-245-244.7-245.2-135.3.1-244.9 109.9-244.8 245.2v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.3z`,fill:`#2EB67D`}),(0,I.jsx)(`path`,{d:`m1550.1 2452.5c135.3-.1 244.9-109.9 244.8-245.2.1-135.3-109.5-245.1-244.8-245.2h-244.8v245.2c-.1 135.2 109.5 245 244.8 245.2zm0-654.1h652.7c135.3-.1 244.9-109.9 244.8-245.2.2-135.3-109.4-245.1-244.7-245.3h-652.7c-135.3.1-244.9 109.9-244.8 245.2-.1 135.4 109.4 245.2 244.7 245.3z`,fill:`#ECB22E`}),(0,I.jsx)(`path`,{d:`m0 1553.2c-.1 135.3 109.5 245.1 244.8 245.2 135.3-.1 244.9-109.9 244.8-245.2v-245.2h-244.8c-135.3.1-244.9 109.9-244.8 245.2zm652.7 0v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.2v-653.9c.2-135.3-109.4-245.1-244.7-245.3-135.4 0-244.9 109.8-244.8 245.1 0 0 0 .1 0 0`,fill:`#E01E5A`})]})})}function Oe({className:e=`h-5 w-5`}){return(0,I.jsx)(`img`,{src:`/feishu-logo.png`,alt:`Feishu`,className:e,draggable:!1})}var z=`https://applink.feishu.cn/client/web_app/open?preview=onboarding-qr`;function ke({agentId:e,initialError:t,initialRegistration:n,onConnect:r,onPendingConnectSource:i,onPhaseChange:a,initialConnectSource:o,previewPhase:c}){let l=c!==void 0,[u,d]=(0,F.useState)(c??Ae(n,t,o));(0,F.useEffect)(()=>{a?.(u)},[u,a]);let[f,p]=(0,F.useState)(n??null),[h,g]=(0,F.useState)(t),[_,te]=(0,F.useState)(``),[v,y]=(0,F.useState)(``),[ne,b]=(0,F.useState)(!1),[ie,x]=(0,F.useState)(!1),[S,C]=(0,F.useState)(!1),[oe,w]=(0,F.useState)(o??(n?.state===`connected`?`registerApp`:null)),T=(0,F.useRef)(null),E=(0,F.useRef)(0);function D(){T.current!==null&&(clearTimeout(T.current),T.current=null)}function O(){D(),C(!1),T.current=setTimeout(()=>{C(!0)},ee)}(0,F.useEffect)(()=>()=>{T.current!==null&&clearTimeout(T.current)},[]),re({agentId:e,enabled:!l&&m(f),registration:f,onStatus:e=>{p(e),e.verificationUrl&&(D(),x(!1),C(!1),d(e=>e===`connected`?e:`authorizing`)),e.state===`connected`&&k(`registerApp`),e.state===`failed`&&(D(),x(!1),C(!1),g(e.error?.description??e.error?.message),d(e=>e===`connected`?e:`fallback`))},onError:e=>{g(e instanceof Error?e.message:`Could not refresh Feishu app setup`)}});function k(e){D(),x(!1),C(!1),w(e),i?.(e),d(`permissions`),ae()}function le(){let e=oe??`registerApp`;d(`connected`),r?.({source:e})}async function ue(){if(ie||l)return;let t=E.current+1;E.current=t,x(!0),C(!1),g(void 0),p(null),d(`fallback`),O();let n=!1;try{let r=await ce(e);if(t!==E.current)return;p(r),r.state===`connected`?k(`registerApp`):r.state===`failed`?(g(r.error?.description??r.error?.message),d(`fallback`)):r.verificationUrl?d(`authorizing`):m(r)&&(n=!0)}catch(e){if(t!==E.current)return;g(e instanceof Error?e.message:`Could not start creating your Feishu app.`),d(`fallback`)}finally{t===E.current&&!n&&(D(),x(!1),C(!1))}}async function de(){if(!(ne||!_.trim()||!v.trim())){E.current+=1,D(),x(!1),C(!1),p(null),b(!0),g(void 0);try{await P(e,{appId:_.trim(),appSecret:v.trim()}),y(``),k(`manual`)}catch(e){g(e instanceof Error?e.message:`Feishu connection failed`)}finally{b(!1)}}}let A=f?.verificationUrl??(l?z:void 0);return(0,I.jsxs)(`div`,{className:`space-y-5`,children:[u===`authorizing`&&A&&A?(0,I.jsx)(s,{verificationUrl:A}):null,u===`fallback`&&(0,I.jsx)(Ne,{appId:_,appSecret:v,saving:ne,onAppId:te,onAppSecret:y,onRetry:()=>void ue(),onSubmit:()=>void de(),retrying:ie,retrySlow:S}),u===`permissions`&&(0,I.jsx)(je,{agentId:e,onContinue:le,preview:l}),u===`connected`&&(0,I.jsx)(`div`,{className:`flex justify-center py-6`,children:(0,I.jsx)(se,{className:`h-6 w-6 animate-spin text-accent`,"aria-hidden":!0})}),h&&u!==`fallback`&&(0,I.jsx)(`p`,{className:`font-sans text-[12px] text-health-error`,children:h})]})}function Ae(e,t,n){return n?`permissions`:t||e?.state===`failed`?`fallback`:e?.state===`connected`?`permissions`:`authorizing`}function je({agentId:e,onContinue:t,preview:r}){let[i,a]=(0,F.useState)(null),[o,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)(!1),u=be({queryKey:A.agentFeishuScopes(e),queryFn:()=>O(e),enabled:!r}),{isError:d,isFetching:ee,refetch:f}=u,p=r?B():u.data,m=p?.recommended.state,h=i??m;async function _(){a(null);let e=(await f()).data?.recommended.state;(e===`granted`||e===`missing`)&&a(e)}if(!p&&!d)return(0,I.jsx)(`div`,{className:`flex justify-center py-6`,children:(0,I.jsx)(se,{className:`h-6 w-6 animate-spin text-accent`,"aria-hidden":!0})});if(h===`granted`)return(0,I.jsxs)(`div`,{className:`space-y-3 rounded-sm border border-health-ok/30 bg-health-ok-soft px-4 py-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(n,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-health-ok`}),(0,I.jsx)(`p`,{className:`font-serif text-[13px] leading-snug text-text`,children:`Recommended Feishu permissions are on. Your Feishu bot is good to go.`})]}),(0,I.jsx)(w,{className:`w-full`,onClick:t,children:`Start activity`})]});let te=p?.recommended.authUrl,y=p?.recommended.authUrls;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(g,{scopes:v(p),authUrl:te,authUrls:y,confirmedMissing:i===`missing`,showPerms:o,onTogglePerms:()=>s(e=>!e),onRecheck:()=>void _(),isRechecking:ee,statusLine:(0,I.jsxs)(I.Fragment,{children:[p?.recommended.message&&i!==`missing`&&(0,I.jsxs)(`div`,{className:`break-words font-sans text-[11px] text-text-subtle`,children:[`Last check: `,p.recommended.message]}),d&&!p?.recommended.message&&(0,I.jsx)(`div`,{className:`font-sans text-[11px] text-text-subtle`,children:`Could not check Feishu permissions.`})]}),footer:(0,I.jsx)(`div`,{className:`border-t border-border-soft pt-3`,children:(0,I.jsx)(`button`,{type:`button`,onClick:()=>l(!0),className:`font-sans text-[12px] text-text-muted underline decoration-text-subtle/40 underline-offset-2 transition-colors hover:text-text`,children:`Skip for now`})})}),c&&(0,I.jsx)(Me,{onKeepSettingUp:()=>l(!1),onSkipAnyway:()=>{l(!1),t()}})]})}function Me({onKeepSettingUp:e,onSkipAnyway:t}){let{dialogRef:n,initialFocusRef:r,titleId:i,descriptionId:a}=N(!0);return(0,I.jsx)(`div`,{ref:n,tabIndex:-1,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/30 px-4`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":i,"aria-describedby":a,children:(0,I.jsxs)(`div`,{className:`w-full max-w-sm space-y-4 rounded-lg border border-border-soft bg-surface px-5 py-4 shadow-lg`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,I.jsx)(M,{className:`mt-0.5 h-[18px] w-[18px] shrink-0 text-health-error`,"aria-hidden":!0}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(`div`,{id:i,className:`font-serif text-[14px] font-semibold leading-tight text-text`,children:`Skipping leaves some teammate and document features off`}),(0,I.jsx)(`p`,{id:a,className:`font-serif text-[13px] leading-relaxed text-text-muted`,children:`Your Feishu bot keeps sending and receiving messages, but it won’t recognize teammates by name, work fully in group chats with people and other bots, or work with Feishu Drive and cloud documents. Looking people up by email or phone also stays off. You can authorize anytime from the agent’s profile.`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-4 pt-0.5`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:t,className:`font-sans text-[12px] text-text-muted underline decoration-text-subtle/40 underline-offset-2 transition-colors hover:text-text`,children:`Skip anyway`}),(0,I.jsx)(w,{ref:r,size:`sm`,onClick:e,children:`Keep setting up`})]})]})})}function B(){let e=j.map(e=>({capability:e.capability,description:e.description,granted:!1,label:e.label,scope:e.scope}));return{appId:`cli_preview`,connected:!0,profileName:{authUrl:`https://open.feishu.cn/app/cli_preview/auth?preview=recommended-scopes`,granted:!1,scope:`contact:user.basic_profile:readonly`,state:`missing`},recommended:{authUrl:`https://open.feishu.cn/app/cli_preview/auth?preview=recommended-scopes`,authUrls:[{authUrl:`https://open.feishu.cn/app/cli_preview/auth?preview=recommended-scopes`,label:`Recommended permissions`,scopes:e.map(e=>e.scope)}],granted:!1,missingScopes:e.map(e=>e.scope),scopes:e,state:`missing`}}}function Ne({appId:e,appSecret:t,onAppId:n,onAppSecret:r,onRetry:i,onSubmit:a,retrying:o,retrySlow:s,saving:l}){let u=l||!e.trim()||!t.trim();return(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-2 rounded-sm border border-border-soft bg-surface px-4 py-3`,children:[(0,I.jsx)(w,{className:`w-full`,onClick:i,disabled:l||o,children:o?(0,I.jsx)(_,{}):`Try creating a new Feishu app again`}),o&&s&&(0,I.jsx)(c,{})]}),(0,I.jsx)(y,{appId:e,appSecret:t,description:`We couldn't finish creating the new app. Connect an app you already have to continue.`,disabled:u,saving:l,onAppId:n,onAppSecret:r,onSubmit:a})]})}var Pe={feishu:`Feishu`,slack:`Slack`},Fe=15e3;function V({firstRun:n,onClose:s,onComplete:c,teams:ee,defaultTeamId:g}){let _=pe(),v=typeof window<`u`?new URLSearchParams(window.location.search):new URLSearchParams,y=Number(v.get(`_previewStep`)??0),S=v.get(`_previewFeishu`)??void 0,O=v.get(`_previewPlatform`)??void 0,he=v.get(`_previewStep`),[j,M]=(0,F.useState)((S?S===`permissions`||S===`connected`?`permissions`:`connect`:he===`platform`?`platform`:y===1?`agent`:y===2?`connect`:y===3?O===`feishu`?`permissions`:`owner`:void 0)??(n?`platform`:`agent`)),[N,P]=(0,F.useState)(S?`feishu`:O??`slack`),[ye,we]=(0,F.useState)(!1),[L,R]=(0,F.useState)(!1),[De,Oe]=(0,F.useState)(),[z,Ae]=(0,F.useState)(``),[je,Me]=(0,F.useState)(!1),[B,Ne]=(0,F.useState)(``),[V,Ie]=(0,F.useState)(ve),[Le,Re]=(0,F.useState)(ue().find(e=>e.kind===`claude-code`)?.defaultModel??``),[ze,Be]=(0,F.useState)(ge),[Ve,He]=(0,F.useState)(!1),[Ue,We]=(0,F.useState)(null),[Ge,H]=(0,F.useState)(!1),Ke=ee??[],[qe]=(0,F.useState)(g??`default`),Je=Ke.find(e=>e.id===qe),Ye=Je?`${Je.home.replace(/\/+$/,``)}/agents`:le,[U,Xe]=(0,F.useState)(S?`preview-agent`:null),[Ze,Qe]=(0,F.useState)(null),[$e,et]=(0,F.useState)(!1),[tt,nt]=(0,F.useState)(),[rt,it]=(0,F.useState)(!1),[at,ot]=(0,F.useState)(null),[st,ct]=(0,F.useState)(),[lt,W]=(0,F.useState)(S),[ut,dt]=(0,F.useState)(S===`permissions`||S===`connected`?`registerApp`:null),ft=(0,F.useRef)(null),G=(0,F.useRef)(0),pt=(0,F.useRef)(null),{data:K,error:q}=be({queryKey:A.providerAvailability(),queryFn:fe}),{data:mt}=be({queryKey:A.workspacePlatform(),queryFn:E}),J=(0,F.useMemo)(()=>f(ue(),K),[K]),Y=(0,F.useMemo)(()=>[`agent`,...N===`slack`?[`connect`,`owner`]:[`connect`,`permissions`]],[N]),ht=j===`platform`,gt=Math.max(0,Y.indexOf(j)),_t=N===`feishu`&&lt===`connected`,X=_e(z.trim()),{pollUntil:vt}=re({agentId:U??X}),yt=e=>J.find(t=>t.kind===e)?.label??e,bt=e=>e===`xhigh`?`Extra High`:e&&e.charAt(0).toUpperCase()+e.slice(1),Z=J.find(e=>e.kind===V),xt=p(Z,Le,K),St=i(Z,K),Ct=a(Z,K),wt=r(Z,K),Tt=t(J,K),Et=!K&&!q,Q=$e,Dt=tt,Ot=rt,kt=X?Ce(X,Ue??Ye):`${Ue??Ye}/<name>`;(0,F.useEffect)(()=>{if(!K||i(J.find(e=>e.kind===V),K))return;let t=e(J,K);t&&setTimeout(()=>{Ie(t.kind),Re(t.defaultModel)},0)},[K,V,J]),(0,F.useEffect)(()=>{if(j!==`agent`)return;let e=setTimeout(()=>ft.current?.focus(),50);return()=>clearTimeout(e)},[j]),(0,F.useEffect)(()=>{if(O||S||!mt||ye)return;let e=setTimeout(()=>P(mt),0);return()=>clearTimeout(e)},[mt,ye,O,S]),(0,F.useEffect)(()=>{if(j===`platform`||Y.includes(j))return;let e=setTimeout(()=>M(Y[Y.length-1]??`agent`),0);return()=>clearTimeout(e)},[j,Y]);let At=(0,F.useCallback)(async()=>{U&&(ae(),await x().catch(()=>void 0)),s(U??void 0)},[U,s]);(0,F.useEffect)(()=>{function e(e){if(!(e.key!==`Escape`||Q)){if(Ge){H(!1);return}At()}}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[At,Q,Ge]),(0,F.useEffect)(()=>()=>{G.current+=1,$()},[]);function jt(e){let t=J.find(t=>t.kind===e),n=t?.defaultModel??``,r=p(t,n,K);Ie(e),Re(n),Be(r.includes(`xhigh`)?ge:r[0]??``)}async function Mt(e){if(!L){R(!0),Oe(void 0);try{let[t]=await Promise.all([D(e),new Promise(e=>setTimeout(e,220))]);P(t),_.setQueryData(A.workspacePlatform(),t),M(`agent`)}catch(e){Oe(e instanceof Error?e.message:`Failed to save workspace platform`)}finally{R(!1)}}}function Nt(e){L||(we(!0),P(e),Mt(e))}function $(){pt.current!==null&&(window.clearTimeout(pt.current),pt.current=null)}function Pt(e){$(),it(!1),pt.current=window.setTimeout(()=>{G.current===e&&it(!0)},Fe)}async function Ft(e,t){let n=await ce(e,{botName:z.trim()||void 0});return G.current===t?(ot(n),vt(n,{agentId:e,isCurrentRun:()=>G.current===t,onStatus:ot,shouldContinue:e=>m(e)&&!e.verificationUrl})):null}async function It(){if($e||(Me(!0),!X||!B.trim()||!St))return;let e=G.current+1,t=N===`feishu`&&!!U&&(lt===`permissions`||lt===`connected`);G.current=e,et(!0),nt(N===`feishu`&&!U?`feishu`:`agent`),Qe(null),t||(ot(null),ct(void 0),W(void 0),dt(null)),N===`feishu`&&!t?Pt(e):$();let n=U,r={kind:V,model:Le,...xt.length>0&&ze?{reasoningEffort:ze}:{}};try{if(n)await ie(n,{displayName:z.trim(),role:B.trim()}),await me(n,r),ae();else{let e=await T({name:z.trim(),role:B.trim(),homePath:kt,provider:r,teamId:qe});n=e.id,Xe(e.id)}if(G.current!==e)return;if(N===`feishu`){if(t){M(`permissions`);return}try{let t=await Ft(n,e);if(!t||G.current!==e)return;if(t.state===`connected`){dt(`registerApp`),W(`permissions`),M(`permissions`);return}if(t.state===`failed`){ct(t.error?.description??t.error?.message??`Could not start Feishu app setup`),W(`fallback`),M(`connect`);return}W(`authorizing`),M(`connect`);return}catch(t){if(G.current!==e)return;ct(t instanceof Error?t.message:`Could not start Feishu app setup`),W(`fallback`),M(`connect`);return}}M(`connect`)}catch(t){if(G.current!==e)return;Qe(t instanceof Error?t.message:U?`Failed to update agent`:`Failed to create agent`)}finally{G.current===e&&($(),et(!1),nt(void 0),it(!1))}}async function Lt(){await x(),M(`owner`)}async function Rt(e,t=U){dt(e),await x(),t&&c?.(t,`feishu`,e===`registerApp`)}function zt(e){W(e),e===`permissions`&&M(`permissions`)}function Bt(){U&&c?.(U)}let Vt=j===`platform`?`Where does your team work?`:j===`agent`?`Create your agent`:j===`connect`?N===`feishu`?`Create Feishu bot`:`Connect to ${Pe[N]}`:j===`permissions`?`Authorize Feishu permissions`:`Pick an owner`,Ht=(()=>{if(!Q){if(!X)return`Enter a name`;if(!B.trim())return`Enter a role`;if(q)return`Provider check failed`;if(Et)return`Checking providers...`;if(!St)return`Install a provider first`}})(),Ut=Q?Dt===`feishu`?`Creating your Feishu app…`:U?`Saving…`:`Creating…`:Ht??(U?`Save & continue →`:`Create agent →`);if(Ge)return(0,I.jsx)(`div`,{className:`fixed inset-0 z-50 overflow-y-auto bg-page/70 backdrop-blur-sm`,children:(0,I.jsx)(`div`,{className:`flex min-h-full w-full items-center justify-center px-4 py-8`,children:(0,I.jsxs)(`div`,{className:`relative w-full max-w-2xl rounded-sm border border-border-soft bg-surface shadow-deep`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border-soft px-5 py-4`,children:[(0,I.jsx)(`span`,{className:`font-serif text-[15px] font-semibold text-text`,children:`Choose home folder`}),(0,I.jsx)(`button`,{onClick:()=>H(!1),className:`flex h-8 w-8 items-center justify-center rounded-sm text-text-muted hover:bg-surface-elevated hover:text-text`,children:(0,I.jsx)(C,{className:`h-4 w-4`})})]}),(0,I.jsx)(`div`,{className:`p-5`,children:(0,I.jsx)(oe,{onChoose:e=>{We(e),H(!1)},onCancel:()=>H(!1)})})]})})});let Wt=(0,I.jsxs)(`div`,{className:`relative w-full max-w-xl rounded-sm border border-border-soft bg-surface shadow-deep`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border-soft px-6 py-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[j===`agent`&&n&&(0,I.jsx)(`button`,{onClick:()=>M(`platform`),className:`-ml-1.5 flex h-7 w-7 items-center justify-center rounded-sm text-text-subtle transition-colors hover:bg-surface-elevated hover:text-text-muted`,title:`Back to platform`,children:(0,I.jsx)(xe,{className:`h-4 w-4`})}),!ht&&(0,I.jsx)(`div`,{className:`flex items-center gap-1`,children:Y.map((e,t)=>(0,I.jsx)(Te,{n:t+1,current:_t?Y.length+1:gt+1,done:_t||t<gt,last:t===Y.length-1,onClick:t<gt&&!(N===`feishu`&&e===`connect`)?()=>M(e):void 0},e))}),(0,I.jsx)(`span`,{className:`font-serif text-[15px] font-semibold text-text`,children:Vt})]}),(!n||U)&&(0,I.jsx)(`button`,{onClick:()=>void At(),className:`flex h-8 w-8 items-center justify-center rounded-sm text-text-muted hover:bg-surface-elevated hover:text-text`,title:`Close`,children:(0,I.jsx)(C,{className:`h-4 w-4`})})]}),j===`agent`&&(0,I.jsxs)(`div`,{className:`animate-in fade-in slide-in-from-right-4 fill-mode-both duration-300 motion-reduce:animate-none px-6 py-6`,children:[(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`font-sans mb-1.5 block text-[12px] font-medium uppercase tracking-[0.08em] text-text-muted`,children:`Name`}),(0,I.jsx)(`input`,{ref:ft,type:`text`,value:z,onChange:e=>Ae(e.target.value),onKeyDown:e=>{e.key===`Enter`&&It()},placeholder:`e.g. Aria`,className:`w-full rounded-sm border border-border-soft bg-surface px-3 py-2 font-serif text-[15px] text-text placeholder:text-text-subtle focus:border-accent focus:outline-none`}),je&&!X&&(0,I.jsx)(`p`,{className:`font-sans mt-1 text-[11px] text-health-error`,children:`Name must include at least one letter or number.`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`font-sans mb-1.5 block text-[12px] font-medium uppercase tracking-[0.08em] text-text-muted`,children:`Role`}),(0,I.jsx)(`input`,{type:`text`,value:B,onChange:e=>Ne(e.target.value),onKeyDown:e=>{e.key===`Enter`&&It()},placeholder:`e.g. Full-stack developer`,className:`w-full rounded-sm border border-border-soft bg-surface px-3 py-2 font-serif text-[15px] text-text placeholder:text-text-subtle focus:border-accent focus:outline-none`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`font-sans mb-1.5 block text-[12px] font-medium uppercase tracking-[0.08em] text-text-muted`,children:`Provider`}),K&&Tt.length===J.length?(0,I.jsx)(`p`,{className:`font-sans text-[12px] text-health-warn`,children:`No providers detected. Install Claude Code, Codex CLI, Kimi CLI, Grok Build, or OpenCode first.`}):(0,I.jsxs)(`div`,{className:[`grid grid-cols-1 gap-2`,xt.length>0?`sm:grid-cols-3`:`sm:grid-cols-2`].join(` `),children:[(0,I.jsxs)(h,{value:V,onValueChange:e=>jt(e),children:[(0,I.jsx)(o,{className:`!h-auto w-full py-2 font-serif text-[15px]`,children:(0,I.jsx)(b,{children:e=>yt(e)})}),(0,I.jsx)(d,{children:J.map(e=>{let t=a(e,K);return(0,I.jsxs)(u,{value:e.kind,disabled:!!t,children:[e.label,t?`: ${t}`:``]},e.kind)})})]}),(0,I.jsxs)(h,{value:Le,onValueChange:e=>{if(!e)return;let t=p(Z,e,K);Re(e),Be(t.includes(`xhigh`)?`xhigh`:t[0]??``)},children:[(0,I.jsx)(o,{className:`!h-auto w-full py-2 font-serif text-[15px]`,children:(0,I.jsx)(b,{children:e=>te(e)})}),(0,I.jsx)(d,{children:(Z?.models??[]).map(e=>(0,I.jsx)(u,{value:e,children:te(e)},e))})]}),xt.length>0&&(0,I.jsxs)(h,{value:ze,onValueChange:e=>{e&&Be(e)},children:[(0,I.jsx)(o,{className:`!h-auto w-full py-2 font-serif text-[15px]`,children:(0,I.jsx)(b,{children:e=>bt(e)})}),(0,I.jsx)(d,{children:xt.map(e=>(0,I.jsx)(u,{value:e,children:bt(e)},e))})]})]}),Ct&&(0,I.jsx)(`p`,{className:`font-sans mt-1 text-[11px] text-health-warn`,children:Ct}),wt&&!Ct&&(0,I.jsx)(`p`,{className:`font-sans mt-1 text-[10px] text-text-subtle`,children:wt}),Et&&(0,I.jsx)(`p`,{className:`font-sans mt-1 text-[11px] text-text-subtle`,children:`Checking installed provider CLIs...`}),q&&(0,I.jsxs)(`p`,{className:`font-sans mt-1 text-[11px] text-health-error`,children:[`Provider check failed:`,` `,q instanceof Error?q.message:String(q)]})]}),!U&&(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>He(e=>!e),className:`font-sans flex items-center gap-1 text-[12px] text-text-muted hover:text-text transition-colors`,children:[Ve?(0,I.jsx)(Se,{className:`h-3.5 w-3.5`}):(0,I.jsx)(de,{className:`h-3.5 w-3.5`}),`Where it lives`]}),Ve&&(0,I.jsxs)(`div`,{className:`mt-2 rounded-sm border border-border-soft bg-surface-elevated p-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`font-mono text-[13px] text-text break-all`,children:kt}),(0,I.jsx)(`div`,{className:`font-sans mt-0.5 text-[11px] text-text-subtle`,children:`Will be created automatically`}),(0,I.jsxs)(`p`,{className:`font-sans mt-2 text-[12px] text-text-muted`,children:[`Your agent's memory lives here, in its own`,` `,(0,I.jsx)(`strong`,{className:`font-semibold text-text`,children:`home folder`}),` under the team's folder.`]})]}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>H(!0),className:`font-sans shrink-0 text-[12px] text-text-muted underline decoration-text-muted/40 underline-offset-2 hover:text-text hover:decoration-text/40 transition-colors`,children:`Change…`})]}),Ue&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>We(null),className:`font-sans mt-2 text-[11px] text-text-subtle underline underline-offset-2 hover:text-text transition-colors`,children:`Reset to default`})]})]})]}),Ze&&(0,I.jsx)(`p`,{className:`font-sans mt-3 text-[12px] text-health-error`,children:Ze}),(0,I.jsxs)(`div`,{className:`mt-6`,children:[(0,I.jsxs)(w,{className:`w-full`,onClick:()=>void It(),disabled:Q||!!Ht,children:[Q&&(0,I.jsx)(se,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),Ut]}),Dt===`feishu`&&Ot&&(0,I.jsx)(`p`,{className:`mt-2 text-center font-sans text-[11px] text-text-subtle`,children:`This is taking longer than usual.`})]})]}),j===`connect`&&U&&N===`slack`&&(0,I.jsx)(`div`,{className:`px-6 py-6`,children:(0,I.jsx)(l,{agentId:U,onConnect:Lt})}),(j===`connect`||j===`permissions`)&&U&&N===`feishu`&&(0,I.jsx)(`div`,{className:`px-6 py-6`,children:(0,I.jsx)(ke,{agentId:U,initialError:st,initialRegistration:at,initialConnectSource:ut??void 0,previewPhase:S,onPhaseChange:zt,onPendingConnectSource:dt,onConnect:e=>void Rt(e.source)})}),j===`owner`&&U&&N===`slack`&&(0,I.jsx)(`div`,{className:`px-6 py-6`,children:(0,I.jsx)(ne,{agentId:U,onConfirm:Bt,onSkip:Bt,submitLabel:`Start onboarding →`,skipLabel:`Start without owner →`,showRationale:!0})})]});return n?(0,I.jsx)(`div`,{className:`fixed inset-0 overflow-y-auto bg-surface`,children:ht?(0,I.jsx)(`div`,{className:`flex min-h-full w-full flex-col items-center justify-center px-4 py-12`,children:(0,I.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center text-center`,children:[(0,I.jsxs)(`div`,{className:`animate-in fade-in slide-in-from-bottom-2 fill-mode-both duration-500 motion-reduce:animate-none flex items-center justify-center gap-2.5`,children:[(0,I.jsx)(k,{className:`h-8 w-8 text-accent`}),(0,I.jsx)(`span`,{className:`font-serif text-[34px] font-semibold leading-none text-text`,children:`Anima`})]}),(0,I.jsx)(`p`,{className:`animate-in fade-in slide-in-from-bottom-2 fill-mode-both duration-500 delay-75 motion-reduce:animate-none mt-4 max-w-sm text-balance font-serif text-[15px] leading-relaxed text-text-muted`,children:`AI teammates in your chat, building shared team context.`}),(0,I.jsx)(`span`,{"aria-hidden":!0,className:`animate-in fade-in fill-mode-both duration-500 delay-100 motion-reduce:animate-none mt-11 h-px w-8 bg-border-strong/50`}),(0,I.jsx)(`p`,{className:`animate-in fade-in fill-mode-both duration-500 delay-100 motion-reduce:animate-none mt-5 font-sans text-[11px] font-semibold uppercase tracking-[0.18em] text-text-subtle`,children:`Where does your team work?`}),(0,I.jsx)(`div`,{className:`mt-3 w-full`,children:(0,I.jsx)(Ee,{error:De,onChoose:Nt,saving:L,value:N})})]})}):(0,I.jsxs)(`div`,{className:`flex min-h-full w-full flex-col items-center justify-center gap-6 px-4 py-12`,children:[(0,I.jsxs)(`div`,{className:`animate-in fade-in fill-mode-both duration-500 motion-reduce:animate-none flex items-center justify-center gap-2`,children:[(0,I.jsx)(k,{className:`h-6 w-6 text-accent`}),(0,I.jsx)(`span`,{className:`font-serif text-[22px] font-semibold text-text`,children:`Anima`})]}),Wt]})}):Wt}function Ie(){let e=we();return(0,I.jsx)(V,{firstRun:!0,onClose:t=>e(t?`/agents/${t}/profile`:`/`),onComplete:(t,n,r)=>e(`/agents/${t}/activity`,{state:n?{onboardingConnected:n,feishuGreetingBanner:!!r}:void 0})})}function Le({onClose:e,teams:t,defaultTeamId:n}){let r=we();return(0,I.jsx)(`div`,{className:`fixed inset-0 z-50 overflow-y-auto bg-page/70 backdrop-blur-sm`,children:(0,I.jsx)(`div`,{className:`flex min-h-full w-full items-center justify-center px-4 py-8`,children:(0,I.jsx)(V,{firstRun:!1,teams:t,defaultTeamId:n,onClose:t=>{e(),t&&r(`/agents/${t}/profile`)},onComplete:(t,n,i)=>{e(),r(`/agents/${t}/activity`,{state:n?{onboardingConnected:n,feishuGreetingBanner:!!i}:void 0})}})})})}export{Le as AgentCreateModal,Ie as OnboardingPage};
@@ -0,0 +1 @@
1
+ import{p as e}from"./mermaid-parser.core-DZTDfv4-.js";export{e as createPacketServices};
@@ -0,0 +1 @@
1
+ import{d as e}from"./mermaid-parser.core-DZTDfv4-.js";export{e as createPieServices};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./mermaid-parser.core-OQrfCf7Q.js";import{g as t,h as n}from"./src-DOSXYjwH.js";import{H as r,K as i,U as a,a as o,c as s,f as c,v as l,w as u,x as d,y as f}from"./chunk-CSCIHK7Q-xxNdF5BX.js";import{t as p}from"./ordinal-hYBb2elL.js";import{n as m}from"./path-BWPyau1x.js";import{m as h}from"./dist-CwHmnwO6.js";import{t as g}from"./arc-DN3rV-nI.js";import{t as _}from"./array-BifhSqXX.js";import{i as v,p as y}from"./chunk-5ZQYHXKU-Vgr4jBt1.js";import{t as b}from"./chunk-WU5MYG2G-CZXAqd3y.js";import{t as x}from"./chunk-4BX2VUAB-DB0OPa2S.js";function S(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function C(e){return e}function w(){var e=C,t=S,n=null,r=m(0),i=m(h),a=m(0);function o(o){var s,c=(o=_(o)).length,l,u,d=0,f=Array(c),p=Array(c),m=+r.apply(this,arguments),g=Math.min(h,Math.max(-h,i.apply(this,arguments)-m)),v,y=Math.min(Math.abs(g)/c,a.apply(this,arguments)),b=y*(g<0?-1:1),x;for(s=0;s<c;++s)(x=p[f[s]=s]=+e(o[s],s,o))>0&&(d+=x);for(t==null?n!=null&&f.sort(function(e,t){return n(o[e],o[t])}):f.sort(function(e,n){return t(p[e],p[n])}),s=0,u=d?(g-c*b)/d:0;s<c;++s,m=v)l=f[s],x=p[l],v=m+(x>0?x*u:0)+b,p[l]={data:o[l],index:s,value:x,startAngle:m,endAngle:v,padAngle:y};return p}return o.value=function(t){return arguments.length?(e=typeof t==`function`?t:m(+t),o):e},o.sortValues=function(e){return arguments.length?(t=e,n=null,o):t},o.sort=function(e){return arguments.length?(n=e,t=null,o):n},o.startAngle=function(e){return arguments.length?(r=typeof e==`function`?e:m(+e),o):r},o.endAngle=function(e){return arguments.length?(i=typeof e==`function`?e:m(+e),o):i},o.padAngle=function(e){return arguments.length?(a=typeof e==`function`?e:m(+e),o):a},o}var T=c.pie,E={sections:new Map,showData:!1,config:T},D=E.sections,O=E.showData,k=structuredClone(T),A={getConfig:n(()=>structuredClone(k),`getConfig`),clear:n(()=>{D=new Map,O=E.showData,o()},`clear`),setDiagramTitle:i,getDiagramTitle:u,setAccTitle:a,getAccTitle:f,setAccDescription:r,getAccDescription:l,addSection:n(({label:e,value:n})=>{if(n<0)throw Error(`"${e}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);D.has(e)||(D.set(e,n),t.debug(`added new section: ${e}, with value: ${n}`))},`addSection`),getSections:n(()=>D,`getSections`),setShowData:n(e=>{O=e},`setShowData`),getShowData:n(()=>O,`getShowData`)},j=n((e,t)=>{x(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},`populateDb`),M={parse:n(async n=>{let r=await e(`pie`,n);t.debug(r),j(r,A)},`parse`)},N=n(e=>`
1
+ import{t as e}from"./mermaid-parser.core-DZTDfv4-.js";import{g as t,h as n}from"./src-B2YqOS_g.js";import{H as r,K as i,U as a,a as o,c as s,f as c,v as l,w as u,x as d,y as f}from"./chunk-CSCIHK7Q-BeNiRoDm.js";import{t as p}from"./ordinal-hYBb2elL.js";import{n as m}from"./path-BWPyau1x.js";import{m as h}from"./dist-BVWlbvC4.js";import{t as g}from"./arc-fS3jqr6M.js";import{t as _}from"./array-BifhSqXX.js";import{i as v,p as y}from"./chunk-5ZQYHXKU-D_5qZ4Zv.js";import{t as b}from"./chunk-WU5MYG2G-BAvj0V8I.js";import{t as x}from"./chunk-4BX2VUAB-CacBYgOE.js";function S(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function C(e){return e}function w(){var e=C,t=S,n=null,r=m(0),i=m(h),a=m(0);function o(o){var s,c=(o=_(o)).length,l,u,d=0,f=Array(c),p=Array(c),m=+r.apply(this,arguments),g=Math.min(h,Math.max(-h,i.apply(this,arguments)-m)),v,y=Math.min(Math.abs(g)/c,a.apply(this,arguments)),b=y*(g<0?-1:1),x;for(s=0;s<c;++s)(x=p[f[s]=s]=+e(o[s],s,o))>0&&(d+=x);for(t==null?n!=null&&f.sort(function(e,t){return n(o[e],o[t])}):f.sort(function(e,n){return t(p[e],p[n])}),s=0,u=d?(g-c*b)/d:0;s<c;++s,m=v)l=f[s],x=p[l],v=m+(x>0?x*u:0)+b,p[l]={data:o[l],index:s,value:x,startAngle:m,endAngle:v,padAngle:y};return p}return o.value=function(t){return arguments.length?(e=typeof t==`function`?t:m(+t),o):e},o.sortValues=function(e){return arguments.length?(t=e,n=null,o):t},o.sort=function(e){return arguments.length?(n=e,t=null,o):n},o.startAngle=function(e){return arguments.length?(r=typeof e==`function`?e:m(+e),o):r},o.endAngle=function(e){return arguments.length?(i=typeof e==`function`?e:m(+e),o):i},o.padAngle=function(e){return arguments.length?(a=typeof e==`function`?e:m(+e),o):a},o}var T=c.pie,E={sections:new Map,showData:!1,config:T},D=E.sections,O=E.showData,k=structuredClone(T),A={getConfig:n(()=>structuredClone(k),`getConfig`),clear:n(()=>{D=new Map,O=E.showData,o()},`clear`),setDiagramTitle:i,getDiagramTitle:u,setAccTitle:a,getAccTitle:f,setAccDescription:r,getAccDescription:l,addSection:n(({label:e,value:n})=>{if(n<0)throw Error(`"${e}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);D.has(e)||(D.set(e,n),t.debug(`added new section: ${e}, with value: ${n}`))},`addSection`),getSections:n(()=>D,`getSections`),setShowData:n(e=>{O=e},`setShowData`),getShowData:n(()=>O,`getShowData`)},j=n((e,t)=>{x(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},`populateDb`),M={parse:n(async n=>{let r=await e(`pie`,n);t.debug(r),j(r,A)},`parse`)},N=n(e=>`
2
2
  .pieCircle{
3
3
  stroke: ${e.pieStrokeColor};
4
4
  stroke-width : ${e.pieStrokeWidth};
@@ -1,2 +1,2 @@
1
- import{l as e,n as t,o as n,s as r}from"./UsageHeatmap-DIM_N0fI.js";import{C as i,D as a,E as o,F as s,L as c,M as l,N as u,O as d,P as f,S as p,T as m,_ as h,a as g,b as _,c as ee,d as v,f as y,g as b,h as x,i as S,j as C,k as w,l as T,m as E,n as D,o as O,p as k,r as A,s as j,t as M,u as N,w as P,x as te,y as F}from"./OwnerPickerForm-BOG15_5q.js";import{$n as I,$t as L,Dn as R,En as z,Er as B,G as V,Gn as H,Gt as ne,Hn as re,Ht as U,I as ie,Jt as ae,K as oe,Kn as W,Kt as se,M as ce,N as G,On as le,Ot as K,P as ue,Pn as de,Qn as fe,Qt as pe,Rn as me,S as he,Sr as ge,Tn as _e,Un as ve,Vn as ye,Wt as be,Xn as xe,Xt as Se,Yn as Ce,Yt as we,Zn as Te,_n as Ee,a as De,an as Oe,ar as q,bt as ke,cn as Ae,dn as je,er as Me,fn as Ne,fr as Pe,gn as Fe,j as Ie,jn as Le,kr as Re,lr as J,m as ze,n as Be,nn as Ve,pn as He,qt as Ue,r as We,rn as Ge,sn as Ke,sr as qe,tr as Je,un as Ye,vr as Xe,x as Ze,xn as Qe,yn as $e}from"./index-CbAhFc-0.js";import{d as et,f as tt,s as nt,t as rt,u as Y}from"./useNow-BwVNU1Kt.js";var it=Ye(`clipboard-copy`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]),at=Ye(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),X=Re(B(),1),Z=Pe(),Q=(0,X.forwardRef)(function({label:e,children:t,highlight:n},r){return(0,Z.jsxs)(`div`,{ref:r,className:[`grid grid-cols-[6rem_1fr] md:grid-cols-[8rem_1fr] items-start gap-3 md:gap-4 rounded-sm py-2.5 md:py-3 transition-[box-shadow] duration-300`,n?`shadow-[0_0_0_2px_var(--color-accent)]`:`shadow-none`].join(` `),children:[(0,Z.jsx)(`span`,{className:`chrome pt-1 text-[11px] tracking-wide text-text-muted`,children:e}),(0,Z.jsx)(`div`,{className:`min-w-0`,children:t})]})});function ot({value:e,mono:t=!1}){return e==null?(0,Z.jsx)(`span`,{className:`font-serif italic text-[14px] text-text-subtle`,children:`—`}):(0,Z.jsx)(`span`,{className:t?`font-mono text-[12px] md:text-[13px] text-text`:`font-serif text-[13px] md:text-[15px] text-text`,children:e})}function $({title:e,children:t}){return(0,Z.jsxs)(`section`,{className:`mt-10 first:mt-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-3 flex items-baseline gap-3`,children:[(0,Z.jsx)(`h2`,{className:`caps text-text-muted`,children:e}),(0,Z.jsx)(`span`,{className:`h-px flex-1 bg-border-soft`})]}),(0,Z.jsx)(`div`,{children:t})]})}function st({onEdit:e,children:t}){return(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:e,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e())},className:`group -mx-2 -my-1 flex min-w-0 cursor-text items-center gap-2 rounded-sm px-2 py-1 outline-none transition-colors hover:bg-surface-elevated focus-visible:bg-surface-elevated`,children:[(0,Z.jsx)(`span`,{className:`min-w-0`,children:t}),(0,Z.jsx)(we,{className:`size-3.5 shrink-0 text-text-subtle opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 [@media(hover:none)]:opacity-50`})]})}function ct(){return(0,Z.jsx)(`span`,{className:`font-sans text-[11px] tracking-wide text-health-ok`,children:`Saved`})}function lt({message:e}){return(0,Z.jsx)(`span`,{className:`font-sans text-[11px] tracking-wide text-health-error`,children:e})}function ut(e){return e instanceof Error?e.message:String(e)}var dt=X.forwardRef(function(e,t){let{render:n,className:r,id:s,name:c,value:l,disabled:u=!1,onValueChange:f,defaultValue:h,autoFocus:g=!1,style:ee,...v}=e,{state:y,name:b,disabled:x,setTouched:S,setDirty:C,validityData:w,setFocused:T,setFilled:E,validationMode:D,validation:O}=a(),k=x||u,A=b??c,j={...y,disabled:k},{labelId:M}=o(),N=m({id:s});V(()=>{let e=l!=null;O.inputRef.current?.value||e&&l!==``?E(!0):e&&l===``&&E(!1)},[O.inputRef,E,l]);let I=X.useRef(null);V(()=>{g&&I.current===i(P(I.current))&&T(!0)},[g,T]);let[L]=p({controlled:l,default:h,name:`FieldControl`,state:`value`}),R=l!==void 0,z=R?L:void 0,B=oe(()=>O.inputRef.current?.value);return te(O.inputRef,N,z,B),ie(`input`,e,{ref:[t,I],state:j,props:[{id:N,disabled:k,name:A,ref:O.inputRef,"aria-labelledby":M,autoFocus:g,...R?{value:z}:{defaultValue:h},onChange(e){let t=e.currentTarget.value;f?.(t,F(_,e.nativeEvent)),C(t!==w.initialValue),E(t!==``)},onFocus(){T(!0)},onBlur(e){S(!0),T(!1),D===`onBlur`&&O.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(S(!0),O.commit(e.currentTarget.value))}},O.getInputValidationProps(),v],stateAttributesMapping:d})}),ft=X.forwardRef(function(e,t){return(0,Z.jsx)(dt,{ref:t,...e})});function pt({className:e,type:t,...n}){return(0,Z.jsx)(ft,{type:t,"data-slot":`input`,className:ue(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm`,e),...n})}var mt=new Set(ze);function ht({startPath:e,onChoose:t,onClose:n}){let{dialogRef:r,titleId:i}=Ie(!0);return(0,X.useEffect)(()=>{function e(e){e.key===`Escape`&&n()}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]),(0,Z.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-page/70 backdrop-blur-sm`,onClick:n,children:(0,Z.jsxs)(`div`,{ref:r,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-labelledby":i,className:`mx-4 max-h-[90dvh] w-full max-w-2xl overflow-y-auto rounded-sm border border-border-soft bg-surface p-5 shadow-deep`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(`div`,{id:i,className:`mb-4 font-serif text-[16px] font-semibold text-text`,children:`Choose home folder`}),(0,Z.jsx)(ce,{startPath:e,onChoose:t,onCancel:n,confirmLabel:`Choose`})]})})}function gt({value:e,onCommit:t}){let[n,r]=(0,X.useState)(!1),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(!1),[c,l]=(0,X.useState)(),[u,d]=(0,X.useState)(!1);async function f(){if(!(!i||o)){s(!0),l(void 0);try{await t(i),a(null),d(!0),setTimeout(()=>d(!1),4e3)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(!1)}}}function p(){d(!1),l(void 0),r(!0)}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Q,{label:`Home`,children:i===null?(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:p,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),p())},className:`group -mx-2 -my-1 flex min-w-0 cursor-pointer items-center gap-2 rounded-sm px-2 py-1 outline-none transition-colors hover:bg-surface-elevated focus-visible:bg-surface-elevated`,children:[e?(0,Z.jsx)(`span`,{className:`block break-words font-serif text-[13px] md:text-[15px] text-text`,children:e}):(0,Z.jsx)(`span`,{className:`font-serif italic text-[14px] text-text-subtle`,children:`Not configured`}),(0,Z.jsx)(`span`,{className:`font-sans text-[12px] text-accent opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 [@media(hover:none)]:opacity-50`,children:`Change`})]}),u&&(0,Z.jsx)(ct,{}),c&&(0,Z.jsx)(lt,{message:c})]}):(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`span`,{className:`block break-words font-mono text-[13px] text-text`,children:i}),(0,Z.jsx)(`span`,{className:`font-sans text-[11px] tracking-wide text-text-muted`,children:`Applies automatically when this agent is idle.`})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(G,{size:`sm`,disabled:o,onClick:()=>void f(),className:`min-h-[44px]`,children:o?`Saving…`:`Save`}),(0,Z.jsx)(G,{size:`sm`,variant:`ghost`,disabled:o,onClick:()=>a(null),className:`min-h-[44px]`,children:`Cancel`}),c&&(0,Z.jsx)(lt,{message:c})]})]})}),n&&(0,Z.jsx)(ht,{startPath:e||void 0,onChoose:e=>{r(!1),a(e)},onClose:()=>r(!1)})]})}function _t({teams:e,value:t,onCommit:n}){let[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(),[l,u]=(0,X.useState)(!1),d=(0,X.useRef)(!1);if(e.length<=1)return null;async function f(e){if(!e||e===t){i(!1);return}if(!a){d.current=!0,o(!0),c(void 0);try{await n(e),u(!0),setTimeout(()=>u(!1),4e3),i(!1)}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1),d.current=!1}}}let p=e.find(e=>e.id===t)?.name??t;return(0,Z.jsx)(Q,{label:`Team`,children:r?(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(E,{value:t,defaultOpen:!0,onValueChange:e=>e&&void f(e),onOpenChange:e=>{!e&&!d.current&&i(!1)},children:[(0,Z.jsx)(h,{className:`h-8 w-52 font-serif text-[14px]`,disabled:a,children:p}),(0,Z.jsx)(x,{children:e.map(e=>(0,Z.jsx)(b,{value:e.id,className:`font-serif text-[14px]`,children:e.name},e.id))})]}),s&&(0,Z.jsx)(lt,{message:s})]}):(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(st,{onEdit:()=>i(!0),children:(0,Z.jsx)(`span`,{className:`font-serif text-[13px] md:text-[15px] text-text`,children:p})}),l&&(0,Z.jsx)(ct,{})]})})}function vt(e,t,n){let r=w(e,t,n);return r.length===0?``:r.includes(`xhigh`)?Fe:r[0]??``}function yt({isActive:e,sessionBoundaryChanged:t=!1,saving:n,onConfirm:r,onCancel:i}){let a=t?` Switching provider or Claude Code session mode starts a fresh provider session; MEMORY.md, notes, and activity history stay intact.`:``;return(0,Z.jsx)(De,{open:!0,title:e?`Save and apply when idle?`:`Apply provider change?`,description:e?`Anima is mid-item. Save this config now; this agent will reload itself after the item finishes.${a}`:`Save this config now; this agent will reload itself automatically.${a}`,variant:`warn`,busy:n,confirmLabel:`Save`,busyLabel:`Saving…`,confirmVariant:`default`,onConfirm:r,onCancel:i})}function bt(e){return Object.keys(e??{}).sort().map(e=>({id:`existing-${e}`,key:e,originalKey:e,value:``}))}function xt(e){let t={},n=new Set;for(let r of e){let e=r.key.trim(),i=r.originalKey;if(r.deleted){i&&(t[i]=null);continue}if(!e&&!r.value.trim()&&!i)continue;if(!e)return{error:`Every env var needs a key.`};if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(e))return{error:`${e} is not a valid environment variable key.`};if(mt.has(e))return{error:`${e} is managed by Anima and cannot be set here.`};if(n.has(e))return{error:`${e} is listed more than once.`};n.add(e);let a=r.value;if(i&&i!==e){if(!a)return{error:`Enter a value to rename ${i}.`};t[i]=null,t[e]=a;continue}if(!i&&!a)return{error:`Enter a value for ${e}.`};a&&(t[e]=a)}return{patch:t}}function St({provider:e,providerOptions:t,providerAvailability:n,isActive:r,onCommit:i}){let[a,o]=(0,X.useState)(!1),s=`reasoningEffort`in e?e.reasoningEffort??``:``,c=t.find(t=>t.kind===e.kind),l=w(c,e.model,n).length>0,u=!!e.runtimeCommand||(e.runtimeArgs?.length??0)>0,d=Object.keys(e.env??{}).sort(),f=[e.runtimeCommand??c?.command??e.kind].concat(e.runtimeArgs??[]).join(` `);return(0,Z.jsxs)(Q,{label:`Runtime`,children:[(0,Z.jsx)(st,{onEdit:()=>o(!0),children:(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-y-0.5`,children:[(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-baseline`,children:[(0,Z.jsx)(`span`,{className:`font-serif text-[13px] md:text-[15px] text-text-muted`,children:y(e.kind,t)}),(0,Z.jsx)(`span`,{className:`font-sans mx-1.5 text-[12px] text-text-subtle`,children:`·`}),(0,Z.jsx)(`span`,{className:`font-serif text-[13px] md:text-[15px] text-text`,children:k(e.model)||`—`}),l&&s&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`font-sans mx-1.5 text-[12px] text-text-subtle`,children:`·`}),(0,Z.jsx)(`span`,{className:`font-serif text-[13px] md:text-[15px] text-text-muted`,children:k(s)})]}),`fastMode`in e&&e.fastMode&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`font-sans mx-1.5 text-[12px] text-text-subtle`,children:`·`}),(0,Z.jsx)(`span`,{className:`font-serif text-[13px] md:text-[15px] text-text-muted`,children:`Fast mode requested`})]})]}),u&&(0,Z.jsx)(`span`,{className:`max-w-md truncate font-mono text-[12px] text-text-muted`,title:f,children:f}),d.length>0&&(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Z.jsxs)(`span`,{className:`shrink-0 font-sans text-[12px] text-text-muted`,children:[d.length,` env var`,d.length===1?``:`s`]}),(0,Z.jsx)(`span`,{className:`max-w-sm truncate font-mono text-[12px] text-text-subtle`,children:d.join(`, `)})]})]})}),a&&(0,Z.jsx)(Ct,{provider:e,providerOptions:t,providerAvailability:n,isActive:r,onCommit:i,onClose:()=>o(!1)})]})}function Ct({provider:t,providerOptions:n,providerAvailability:r,isActive:i,onCommit:a,onClose:o}){let c=w(n.find(e=>e.kind===t.kind),t.model,r),d=`reasoningEffort`in t&&c.length>0?t.reasoningEffort??``:``,p=!!t.runtimeCommand||(t.runtimeArgs?.length??0)>0,m=`fastMode`in t&&(t.fastMode??!1),g=p||m,[_,ee]=(0,X.useState)(t.kind),[v,S]=(0,X.useState)(t.model),[C,T]=(0,X.useState)(d),[D,O]=(0,X.useState)(t.runtimeCommand??``),[A,j]=(0,X.useState)((t.runtimeArgs??[]).join(`
1
+ import{l as e,n as t,o as n,s as r}from"./UsageHeatmap-BW-EDtlf.js";import{C as i,D as a,E as o,F as s,L as c,M as l,N as u,O as d,P as f,S as p,T as m,_ as h,a as g,b as _,c as ee,d as v,f as y,g as b,h as x,i as S,j as C,k as w,l as T,m as E,n as D,o as O,p as k,r as A,s as j,t as M,u as N,w as P,x as te,y as F}from"./OwnerPickerForm-Dad51XVK.js";import{$n as I,$t as L,Dn as R,En as z,Er as B,G as V,Gn as H,Gt as ne,Hn as re,Ht as U,I as ie,Jt as ae,K as oe,Kn as W,Kt as se,M as ce,N as G,On as le,Ot as K,P as ue,Pn as de,Qn as fe,Qt as pe,Rn as me,S as he,Sr as ge,Tn as _e,Un as ve,Vn as ye,Wt as be,Xn as xe,Xt as Se,Yn as Ce,Yt as we,Zn as Te,_n as Ee,a as De,an as Oe,ar as q,bt as ke,cn as Ae,dn as je,er as Me,fn as Ne,fr as Pe,gn as Fe,j as Ie,jn as Le,kr as Re,lr as J,m as ze,n as Be,nn as Ve,pn as He,qt as Ue,r as We,rn as Ge,sn as Ke,sr as qe,tr as Je,un as Ye,vr as Xe,x as Ze,xn as Qe,yn as $e}from"./index-DlHETnHC.js";import{d as et,f as tt,s as nt,t as rt,u as Y}from"./useNow-BbEkaqh-.js";var it=Ye(`clipboard-copy`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]),at=Ye(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),X=Re(B(),1),Z=Pe(),Q=(0,X.forwardRef)(function({label:e,children:t,highlight:n},r){return(0,Z.jsxs)(`div`,{ref:r,className:[`grid grid-cols-[6rem_1fr] md:grid-cols-[8rem_1fr] items-start gap-3 md:gap-4 rounded-sm py-2.5 md:py-3 transition-[box-shadow] duration-300`,n?`shadow-[0_0_0_2px_var(--color-accent)]`:`shadow-none`].join(` `),children:[(0,Z.jsx)(`span`,{className:`chrome pt-1 text-[11px] tracking-wide text-text-muted`,children:e}),(0,Z.jsx)(`div`,{className:`min-w-0`,children:t})]})});function ot({value:e,mono:t=!1}){return e==null?(0,Z.jsx)(`span`,{className:`font-serif italic text-[14px] text-text-subtle`,children:`—`}):(0,Z.jsx)(`span`,{className:t?`font-mono text-[12px] md:text-[13px] text-text`:`font-serif text-[13px] md:text-[15px] text-text`,children:e})}function $({title:e,children:t}){return(0,Z.jsxs)(`section`,{className:`mt-10 first:mt-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-3 flex items-baseline gap-3`,children:[(0,Z.jsx)(`h2`,{className:`caps text-text-muted`,children:e}),(0,Z.jsx)(`span`,{className:`h-px flex-1 bg-border-soft`})]}),(0,Z.jsx)(`div`,{children:t})]})}function st({onEdit:e,children:t}){return(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:e,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e())},className:`group -mx-2 -my-1 flex min-w-0 cursor-text items-center gap-2 rounded-sm px-2 py-1 outline-none transition-colors hover:bg-surface-elevated focus-visible:bg-surface-elevated`,children:[(0,Z.jsx)(`span`,{className:`min-w-0`,children:t}),(0,Z.jsx)(we,{className:`size-3.5 shrink-0 text-text-subtle opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 [@media(hover:none)]:opacity-50`})]})}function ct(){return(0,Z.jsx)(`span`,{className:`font-sans text-[11px] tracking-wide text-health-ok`,children:`Saved`})}function lt({message:e}){return(0,Z.jsx)(`span`,{className:`font-sans text-[11px] tracking-wide text-health-error`,children:e})}function ut(e){return e instanceof Error?e.message:String(e)}var dt=X.forwardRef(function(e,t){let{render:n,className:r,id:s,name:c,value:l,disabled:u=!1,onValueChange:f,defaultValue:h,autoFocus:g=!1,style:ee,...v}=e,{state:y,name:b,disabled:x,setTouched:S,setDirty:C,validityData:w,setFocused:T,setFilled:E,validationMode:D,validation:O}=a(),k=x||u,A=b??c,j={...y,disabled:k},{labelId:M}=o(),N=m({id:s});V(()=>{let e=l!=null;O.inputRef.current?.value||e&&l!==``?E(!0):e&&l===``&&E(!1)},[O.inputRef,E,l]);let I=X.useRef(null);V(()=>{g&&I.current===i(P(I.current))&&T(!0)},[g,T]);let[L]=p({controlled:l,default:h,name:`FieldControl`,state:`value`}),R=l!==void 0,z=R?L:void 0,B=oe(()=>O.inputRef.current?.value);return te(O.inputRef,N,z,B),ie(`input`,e,{ref:[t,I],state:j,props:[{id:N,disabled:k,name:A,ref:O.inputRef,"aria-labelledby":M,autoFocus:g,...R?{value:z}:{defaultValue:h},onChange(e){let t=e.currentTarget.value;f?.(t,F(_,e.nativeEvent)),C(t!==w.initialValue),E(t!==``)},onFocus(){T(!0)},onBlur(e){S(!0),T(!1),D===`onBlur`&&O.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(S(!0),O.commit(e.currentTarget.value))}},O.getInputValidationProps(),v],stateAttributesMapping:d})}),ft=X.forwardRef(function(e,t){return(0,Z.jsx)(dt,{ref:t,...e})});function pt({className:e,type:t,...n}){return(0,Z.jsx)(ft,{type:t,"data-slot":`input`,className:ue(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm`,e),...n})}var mt=new Set(ze);function ht({startPath:e,onChoose:t,onClose:n}){let{dialogRef:r,titleId:i}=Ie(!0);return(0,X.useEffect)(()=>{function e(e){e.key===`Escape`&&n()}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]),(0,Z.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-page/70 backdrop-blur-sm`,onClick:n,children:(0,Z.jsxs)(`div`,{ref:r,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-labelledby":i,className:`mx-4 max-h-[90dvh] w-full max-w-2xl overflow-y-auto rounded-sm border border-border-soft bg-surface p-5 shadow-deep`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(`div`,{id:i,className:`mb-4 font-serif text-[16px] font-semibold text-text`,children:`Choose home folder`}),(0,Z.jsx)(ce,{startPath:e,onChoose:t,onCancel:n,confirmLabel:`Choose`})]})})}function gt({value:e,onCommit:t}){let[n,r]=(0,X.useState)(!1),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(!1),[c,l]=(0,X.useState)(),[u,d]=(0,X.useState)(!1);async function f(){if(!(!i||o)){s(!0),l(void 0);try{await t(i),a(null),d(!0),setTimeout(()=>d(!1),4e3)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(!1)}}}function p(){d(!1),l(void 0),r(!0)}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Q,{label:`Home`,children:i===null?(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:p,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),p())},className:`group -mx-2 -my-1 flex min-w-0 cursor-pointer items-center gap-2 rounded-sm px-2 py-1 outline-none transition-colors hover:bg-surface-elevated focus-visible:bg-surface-elevated`,children:[e?(0,Z.jsx)(`span`,{className:`block break-words font-serif text-[13px] md:text-[15px] text-text`,children:e}):(0,Z.jsx)(`span`,{className:`font-serif italic text-[14px] text-text-subtle`,children:`Not configured`}),(0,Z.jsx)(`span`,{className:`font-sans text-[12px] text-accent opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 [@media(hover:none)]:opacity-50`,children:`Change`})]}),u&&(0,Z.jsx)(ct,{}),c&&(0,Z.jsx)(lt,{message:c})]}):(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`span`,{className:`block break-words font-mono text-[13px] text-text`,children:i}),(0,Z.jsx)(`span`,{className:`font-sans text-[11px] tracking-wide text-text-muted`,children:`Applies automatically when this agent is idle.`})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(G,{size:`sm`,disabled:o,onClick:()=>void f(),className:`min-h-[44px]`,children:o?`Saving…`:`Save`}),(0,Z.jsx)(G,{size:`sm`,variant:`ghost`,disabled:o,onClick:()=>a(null),className:`min-h-[44px]`,children:`Cancel`}),c&&(0,Z.jsx)(lt,{message:c})]})]})}),n&&(0,Z.jsx)(ht,{startPath:e||void 0,onChoose:e=>{r(!1),a(e)},onClose:()=>r(!1)})]})}function _t({teams:e,value:t,onCommit:n}){let[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(),[l,u]=(0,X.useState)(!1),d=(0,X.useRef)(!1);if(e.length<=1)return null;async function f(e){if(!e||e===t){i(!1);return}if(!a){d.current=!0,o(!0),c(void 0);try{await n(e),u(!0),setTimeout(()=>u(!1),4e3),i(!1)}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1),d.current=!1}}}let p=e.find(e=>e.id===t)?.name??t;return(0,Z.jsx)(Q,{label:`Team`,children:r?(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(E,{value:t,defaultOpen:!0,onValueChange:e=>e&&void f(e),onOpenChange:e=>{!e&&!d.current&&i(!1)},children:[(0,Z.jsx)(h,{className:`h-8 w-52 font-serif text-[14px]`,disabled:a,children:p}),(0,Z.jsx)(x,{children:e.map(e=>(0,Z.jsx)(b,{value:e.id,className:`font-serif text-[14px]`,children:e.name},e.id))})]}),s&&(0,Z.jsx)(lt,{message:s})]}):(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(st,{onEdit:()=>i(!0),children:(0,Z.jsx)(`span`,{className:`font-serif text-[13px] md:text-[15px] text-text`,children:p})}),l&&(0,Z.jsx)(ct,{})]})})}function vt(e,t,n){let r=w(e,t,n);return r.length===0?``:r.includes(`xhigh`)?Fe:r[0]??``}function yt({isActive:e,sessionBoundaryChanged:t=!1,saving:n,onConfirm:r,onCancel:i}){let a=t?` Switching provider or Claude Code session mode starts a fresh provider session; MEMORY.md, notes, and activity history stay intact.`:``;return(0,Z.jsx)(De,{open:!0,title:e?`Save and apply when idle?`:`Apply provider change?`,description:e?`Anima is mid-item. Save this config now; this agent will reload itself after the item finishes.${a}`:`Save this config now; this agent will reload itself automatically.${a}`,variant:`warn`,busy:n,confirmLabel:`Save`,busyLabel:`Saving…`,confirmVariant:`default`,onConfirm:r,onCancel:i})}function bt(e){return Object.keys(e??{}).sort().map(e=>({id:`existing-${e}`,key:e,originalKey:e,value:``}))}function xt(e){let t={},n=new Set;for(let r of e){let e=r.key.trim(),i=r.originalKey;if(r.deleted){i&&(t[i]=null);continue}if(!e&&!r.value.trim()&&!i)continue;if(!e)return{error:`Every env var needs a key.`};if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(e))return{error:`${e} is not a valid environment variable key.`};if(mt.has(e))return{error:`${e} is managed by Anima and cannot be set here.`};if(n.has(e))return{error:`${e} is listed more than once.`};n.add(e);let a=r.value;if(i&&i!==e){if(!a)return{error:`Enter a value to rename ${i}.`};t[i]=null,t[e]=a;continue}if(!i&&!a)return{error:`Enter a value for ${e}.`};a&&(t[e]=a)}return{patch:t}}function St({provider:e,providerOptions:t,providerAvailability:n,isActive:r,onCommit:i}){let[a,o]=(0,X.useState)(!1),s=`reasoningEffort`in e?e.reasoningEffort??``:``,c=t.find(t=>t.kind===e.kind),l=w(c,e.model,n).length>0,u=!!e.runtimeCommand||(e.runtimeArgs?.length??0)>0,d=Object.keys(e.env??{}).sort(),f=[e.runtimeCommand??c?.command??e.kind].concat(e.runtimeArgs??[]).join(` `);return(0,Z.jsxs)(Q,{label:`Runtime`,children:[(0,Z.jsx)(st,{onEdit:()=>o(!0),children:(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-y-0.5`,children:[(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-baseline`,children:[(0,Z.jsx)(`span`,{className:`font-serif text-[13px] md:text-[15px] text-text-muted`,children:y(e.kind,t)}),(0,Z.jsx)(`span`,{className:`font-sans mx-1.5 text-[12px] text-text-subtle`,children:`·`}),(0,Z.jsx)(`span`,{className:`font-serif text-[13px] md:text-[15px] text-text`,children:k(e.model)||`—`}),l&&s&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`font-sans mx-1.5 text-[12px] text-text-subtle`,children:`·`}),(0,Z.jsx)(`span`,{className:`font-serif text-[13px] md:text-[15px] text-text-muted`,children:k(s)})]}),`fastMode`in e&&e.fastMode&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`font-sans mx-1.5 text-[12px] text-text-subtle`,children:`·`}),(0,Z.jsx)(`span`,{className:`font-serif text-[13px] md:text-[15px] text-text-muted`,children:`Fast mode requested`})]})]}),u&&(0,Z.jsx)(`span`,{className:`max-w-md truncate font-mono text-[12px] text-text-muted`,title:f,children:f}),d.length>0&&(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Z.jsxs)(`span`,{className:`shrink-0 font-sans text-[12px] text-text-muted`,children:[d.length,` env var`,d.length===1?``:`s`]}),(0,Z.jsx)(`span`,{className:`max-w-sm truncate font-mono text-[12px] text-text-subtle`,children:d.join(`, `)})]})]})}),a&&(0,Z.jsx)(Ct,{provider:e,providerOptions:t,providerAvailability:n,isActive:r,onCommit:i,onClose:()=>o(!1)})]})}function Ct({provider:t,providerOptions:n,providerAvailability:r,isActive:i,onCommit:a,onClose:o}){let c=w(n.find(e=>e.kind===t.kind),t.model,r),d=`reasoningEffort`in t&&c.length>0?t.reasoningEffort??``:``,p=!!t.runtimeCommand||(t.runtimeArgs?.length??0)>0,m=`fastMode`in t&&(t.fastMode??!1),g=p||m,[_,ee]=(0,X.useState)(t.kind),[v,S]=(0,X.useState)(t.model),[C,T]=(0,X.useState)(d),[D,O]=(0,X.useState)(t.runtimeCommand??``),[A,j]=(0,X.useState)((t.runtimeArgs??[]).join(`
2
2
  `)),[M,N]=(0,X.useState)(m),[P,te]=(0,X.useState)(g),[F,I]=(0,X.useState)(()=>bt(t.env)),[L,R]=(0,X.useState)(),[z,B]=(0,X.useState)(!1),[V,H]=(0,X.useState)(null),{dialogRef:ne,titleId:re,isTopmostDialog:ie}=Ie(!0),oe=(0,X.useCallback)(()=>{z||o()},[z,o]);(0,X.useEffect)(()=>{function e(e){e.key===`Escape`&&ie()&&oe()}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[oe,ie]);let W=n.find(e=>e.kind===_),se=W?.models??[],ce=w(W,v,r),le=ce.length>0,K=_!==t.kind,ue=r?f(W,r):void 0,de=l(W,r),fe=!r||!W||u(W,r),pe=le?C:void 0,me=K||v!==t.model||(pe??``)!==d,he=me&&!fe;function ge(e){return e.kind===t.kind||!r?!0:u(e,r)}function _e(e){if(!e)return;let t=n.find(t=>t.kind===e);!t||!ge(t)||(ee(t.kind),S(t.defaultModel),T(vt(t,t.defaultModel,r)),O(``),j(``),N(!1),R(void 0))}function ve(e){!e||!W||(S(e),T(vt(W,e,r)),R(void 0))}function ye(e,t){I(n=>n.map(n=>n.id===e?{...n,...t}:n)),R(void 0)}function be(){I(e=>[...e,{id:`new-${Date.now()}-${e.length}`,key:``,value:``}]),R(void 0)}function xe(){let n={};me&&(n.kind=_,n.model=v,pe&&(n.reasoningEffort=pe));let r=D.trim(),i=e(A),a=me;if(K)r&&(n.runtimeCommand=r),i.length>0&&(n.runtimeArgs=i),$e(_)&&M&&(n.fastMode=!0);else{let e=t.runtimeCommand??``,o=t.runtimeArgs??[];r!==e&&(n.runtimeCommand=r||null,a=!0),JSON.stringify(i)!==JSON.stringify(o)&&(n.runtimeArgs=i.length>0?i:null,a=!0),$e(_)&&M!==m&&(n.fastMode=M,a=!0)}let o=xt(F);return`error`in o?{error:o.error}:(Object.keys(o.patch).length>0&&(n.env=o.patch),{update:n,launchAffecting:a})}async function Se(e,t){B(!0),R(void 0);try{await a(e,{envOnly:t}),o()}catch(e){R(ut(e)),H(null)}finally{B(!1)}}function Ce(){if(z||he)return;let e=xe();if(`error`in e){R(e.error);return}let{update:t,launchAffecting:n}=e;if(Object.keys(t).length===0){o();return}n?H({update:t,sessionBoundaryChanged:K}):Se(t,!0)}let we=`chrome pt-1 text-[11px] tracking-wide text-text-muted`,Te=`grid gap-2.5 py-5 md:grid-cols-[6.5rem_1fr] md:gap-6`;return(0,Z.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-stretch justify-center bg-page/70 backdrop-blur-sm md:items-center md:p-4`,onClick:oe,children:(0,Z.jsxs)(`div`,{ref:ne,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-labelledby":re,className:`flex h-full w-full flex-col overflow-y-auto border-border bg-surface shadow-deep md:h-auto md:max-h-[85vh] md:max-w-2xl md:rounded-sm md:border`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border-soft px-6 py-4`,children:[(0,Z.jsx)(`div`,{id:re,className:`min-w-0 font-serif text-[17px] font-semibold text-text`,children:`Runtime`}),(0,Z.jsx)(`button`,{type:`button`,onClick:oe,disabled:z,"aria-label":`Close`,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-sm text-text-muted transition-colors hover:bg-surface-elevated hover:text-text disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-text-muted`,children:(0,Z.jsx)(U,{className:`h-4 w-4`})})]}),(0,Z.jsxs)(`div`,{className:`flex-1 divide-y divide-border-soft px-6`,children:[(0,Z.jsxs)(`div`,{className:Te,children:[(0,Z.jsx)(`div`,{className:we,children:`Provider`}),(0,Z.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,Z.jsxs)(`div`,{className:`grid grid-cols-3 items-center gap-2 md:flex md:flex-wrap`,children:[(0,Z.jsxs)(E,{value:_,onValueChange:_e,children:[(0,Z.jsx)(h,{className:`!h-[44px] w-full font-serif text-[14px] md:!h-8 md:w-36`,disabled:z,children:y(_,n)}),(0,Z.jsx)(x,{children:n.map(e=>{let t=r?s(e,r):void 0;return(0,Z.jsxs)(b,{value:e.kind,disabled:!ge(e),className:`font-serif text-[14px]`,children:[e.label,t?` · ${t}`:``]},e.kind)})})]}),(0,Z.jsxs)(E,{value:v,onValueChange:ve,children:[(0,Z.jsx)(h,{className:`!h-[44px] w-full font-serif text-[14px] md:!h-8 md:w-48`,disabled:z,children:k(v)}),(0,Z.jsx)(x,{children:se.map(e=>(0,Z.jsx)(b,{value:e,className:`font-serif text-[14px]`,children:k(e)},e))})]}),le&&(0,Z.jsxs)(E,{value:C,onValueChange:e=>{e&&T(e)},children:[(0,Z.jsx)(h,{className:`!h-[44px] w-full font-serif text-[14px] md:!h-8 md:w-28`,disabled:z,children:C?k(C):(0,Z.jsx)(`span`,{className:`text-text-subtle`,children:`Effort`})}),(0,Z.jsx)(x,{children:ce.map(e=>(0,Z.jsx)(b,{value:e,className:`font-serif text-[14px]`,children:k(e)},e))})]})]}),ue&&(0,Z.jsx)(`div`,{className:`font-sans text-[11px] leading-snug text-text-muted`,children:ue}),de&&!ue&&(0,Z.jsx)(`div`,{className:`font-sans text-[10px] leading-snug text-text-subtle`,children:de}),K&&(0,Z.jsxs)(`div`,{className:`font-sans text-[11px] leading-snug text-text-muted`,children:[`Starts a fresh provider session; memory, notes, and history stay intact.`,p?` The command override below was cleared; it was written for the old provider.`:``,m?` Fast mode was turned off; provider settings do not transfer.`:``]})]})]}),(0,Z.jsxs)(`div`,{className:Te,children:[(0,Z.jsx)(`div`,{className:we,children:`Environment`}),(0,Z.jsxs)(`div`,{className:`space-y-2.5`,children:[F.length>0&&(0,Z.jsx)(`div`,{className:`space-y-1.5`,children:F.map(e=>(0,Z.jsxs)(`div`,{className:e.deleted?`opacity-45`:``,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(pt,{value:e.key,disabled:z||e.deleted,placeholder:`KEY`,onChange:t=>ye(e.id,{key:t.currentTarget.value}),className:`h-[44px] w-36 shrink-0 font-mono text-[12px] sm:w-44 md:h-8 ${e.deleted?`line-through`:``}`}),(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`select-none font-mono text-[12px] text-text-subtle`,children:`=`}),(0,Z.jsx)(pt,{value:e.value,disabled:z||e.deleted,placeholder:e.originalKey?`unchanged`:`value`,onChange:t=>ye(e.id,{value:t.currentTarget.value}),className:`h-[44px] min-w-0 flex-1 font-mono text-[12px] md:h-8`}),(0,Z.jsx)(`button`,{type:`button`,disabled:z,title:e.deleted?`Keep this variable`:e.originalKey?`Remove on save`:`Discard`,onClick:()=>{e.originalKey?ye(e.id,{deleted:!e.deleted}):I(t=>t.filter(t=>t.id!==e.id))},className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-sm text-text-subtle transition-colors hover:bg-surface-elevated hover:text-text disabled:opacity-40`,children:e.deleted?(0,Z.jsx)(at,{className:`h-3.5 w-3.5`}):(0,Z.jsx)(U,{className:`h-3.5 w-3.5`})})]}),mt.has(e.key.trim())&&!e.deleted&&(0,Z.jsxs)(`div`,{className:`mt-1 font-sans text-[11px] text-health-warn`,children:[e.key.trim(),` is managed by Anima and cannot be set here.`]})]},e.id))}),(0,Z.jsxs)(`button`,{type:`button`,disabled:z,onClick:be,className:`inline-flex items-center gap-1.5 font-sans text-[12px] text-text-muted transition-colors hover:text-text disabled:opacity-40`,children:[(0,Z.jsx)(ae,{className:`h-3.5 w-3.5`}),`Add variable`]})]})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":P,onClick:()=>te(e=>!e),className:`chrome flex min-h-[44px] w-full items-center gap-1.5 py-4 text-left text-[11px] tracking-wide text-text-muted transition-colors hover:text-text md:min-h-0`,children:[(0,Z.jsx)(Oe,{"aria-hidden":!0,className:`h-3.5 w-3.5 transition-transform ${P?`rotate-90`:``}`}),`Advanced`]}),P&&(0,Z.jsxs)(`div`,{className:`space-y-5 pb-5`,children:[$e(_)&&(0,Z.jsxs)(`div`,{className:`grid gap-2.5 md:grid-cols-[6.5rem_1fr] md:gap-6`,children:[(0,Z.jsx)(`div`,{className:we,children:`Fast mode`}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsxs)(`label`,{className:`flex min-h-[44px] w-fit cursor-pointer items-center gap-2.5 md:min-h-0`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:M,disabled:z,onChange:e=>{N(e.currentTarget.checked),R(void 0)},className:`h-4 w-4 accent-accent`}),(0,Z.jsx)(`span`,{className:`font-sans text-[13px] text-text`,children:`Request fast mode`})]}),_===`claude-code`?(0,Z.jsx)(`p`,{className:`font-sans pl-[26px] text-[11px] leading-snug text-text-muted`,children:`Asks Claude for faster responses each session. A request, not a guarantee: sessions run at standard speed unless the Anthropic organization has fast mode enabled with usage credits.`}):(0,Z.jsx)(`p`,{className:`font-sans pl-[26px] text-[11px] leading-snug text-text-muted`,children:`Runs supported Codex models up to 1.5× faster. GPT-5.6 and GPT-5.5 use 2.5× ChatGPT credits; API-key sessions use Priority pricing.`})]})]}),(0,Z.jsxs)(`div`,{className:`grid gap-2.5 md:grid-cols-[6.5rem_1fr] md:gap-6`,children:[(0,Z.jsx)(`div`,{className:we,children:`Command`}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsxs)(`div`,{className:`overflow-hidden rounded-sm border border-border-soft bg-surface-elevated/50 transition-colors focus-within:border-border`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 px-3`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`select-none font-mono text-[12px] text-text-subtle`,children:`$`}),(0,Z.jsx)(`input`,{value:D,disabled:z,autoCapitalize:`off`,autoComplete:`off`,spellCheck:!1,placeholder:W?.command??_,onChange:e=>{O(e.currentTarget.value),R(void 0)},className:`h-9 w-full min-w-0 bg-transparent font-mono text-[12.5px] text-text placeholder:text-text-subtle focus:outline-none disabled:cursor-wait disabled:opacity-60`})]}),(0,Z.jsx)(`textarea`,{value:A,disabled:z,autoCapitalize:`off`,autoComplete:`off`,spellCheck:!1,rows:3,placeholder:_===`claude-code`?`--chrome`:`--flag`,onChange:e=>{j(e.currentTarget.value),R(void 0)},className:`block min-h-[64px] w-full resize-y border-t border-border-soft/70 bg-transparent py-2 pl-7 pr-3 font-mono text-[12.5px] leading-relaxed text-text placeholder:text-text-subtle focus:outline-none disabled:cursor-wait disabled:opacity-60`})]}),(0,Z.jsx)(`p`,{className:`font-sans text-[11px] leading-snug text-text-muted`,children:`One argv entry per line. Empty falls back to the Providers-page settings.`})]})]})]})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2 border-t border-border-soft px-6 py-3.5`,children:[L&&(0,Z.jsx)(`span`,{className:`mr-auto min-w-0 py-1`,children:(0,Z.jsx)(lt,{message:L})}),(0,Z.jsx)(G,{variant:`ghost`,disabled:z,onClick:o,className:`min-h-[44px] md:min-h-0`,children:`Cancel`}),(0,Z.jsxs)(G,{disabled:z||he,onClick:Ce,className:`min-h-[44px] md:min-h-0`,children:[(0,Z.jsx)(Ae,{}),z?`Saving…`:`Save`]})]}),V&&(0,Z.jsx)(yt,{isActive:i,sessionBoundaryChanged:V.sessionBoundaryChanged,saving:z,onConfirm:()=>void Se(V.update,!1),onCancel:()=>H(null)})]})})}function wt({value:e,placeholder:t,ariaLabel:n,display:r,inputClassName:i,onCommit:a}){let[o,s]=(0,X.useState)(!1),[c,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(),[m,h]=(0,X.useState)(!1);function g(){l(e),p(void 0),h(!1),s(!0)}async function _(){if(!u){if(c===e){s(!1);return}d(!0),p(void 0);try{await a(c),s(!1),h(!0),setTimeout(()=>h(!1),3e3)}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(!1)}}}return o?(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(pt,{autoFocus:!0,value:c,placeholder:t,disabled:u,"aria-label":n,onChange:e=>l(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),_()):e.key===`Escape`&&(e.preventDefault(),s(!1))},className:i}),(0,Z.jsxs)(G,{size:`sm`,className:`min-h-[44px] md:min-h-0`,disabled:u,onClick:()=>void _(),children:[(0,Z.jsx)(Ae,{}),u?`Saving…`:`Save`]}),(0,Z.jsxs)(G,{size:`sm`,variant:`ghost`,className:`min-h-[44px] md:min-h-0`,disabled:u,onClick:()=>s(!1),children:[(0,Z.jsx)(U,{}),`Cancel`]}),f&&(0,Z.jsx)(lt,{message:f})]}):(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Z.jsx)(st,{onEdit:g,children:r(e,!e)}),m&&(0,Z.jsx)(ct,{})]})}function Tt({agent:e,onCommitName:t,onCommitRole:n,children:r}){let i=he(e),a=Ze(e);return(0,Z.jsxs)(`div`,{className:`flex items-center gap-5 md:gap-6`,children:[a?(0,Z.jsx)(`img`,{src:a,alt:``,className:`h-20 w-20 shrink-0 rounded-xl object-cover shadow-deep ring-1 ring-border-soft md:h-24 md:w-24`}):(0,Z.jsx)(`span`,{className:`flex h-20 w-20 shrink-0 items-center justify-center rounded-xl bg-muted font-serif text-[32px] font-semibold text-text-muted ring-1 ring-border-soft md:h-24 md:w-24`,children:i.charAt(0).toUpperCase()}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(wt,{value:e.profile?.displayName??``,placeholder:`Unnamed`,ariaLabel:`Agent name`,inputClassName:`h-9 w-64 max-w-full font-serif text-[18px] font-semibold`,onCommit:t,display:(e,t)=>t?(0,Z.jsx)(`span`,{className:`display text-[24px] font-semibold italic tracking-tight text-text-subtle md:text-[28px]`,children:`Unnamed`}):(0,Z.jsx)(`span`,{className:`display block truncate text-[24px] font-semibold leading-tight tracking-tight text-text md:text-[28px]`,children:e})}),(0,Z.jsx)(`div`,{className:`mt-1`,children:(0,Z.jsx)(wt,{value:e.profile?.role??``,placeholder:`No role`,ariaLabel:`Agent role`,inputClassName:`h-8 w-full max-w-md font-serif text-[14px]`,onCommit:n,display:(e,t)=>t?(0,Z.jsx)(`span`,{className:`font-serif text-[14px] italic text-text-subtle`,children:`No role`}):(0,Z.jsx)(`span`,{className:`block break-words font-serif text-[14px] leading-snug text-text-muted md:text-[15px]`,children:e})})}),r&&(0,Z.jsx)(`div`,{className:`mt-2.5`,children:r})]})]})}function Et({stats:e}){if(!e||e.currentContextTokens===void 0){let t=e?.autoCompactWindow&&e.autoCompactWindow>0?`awaiting next item`:null;return(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`span`,{className:`font-serif italic text-[14px] text-text-subtle`,children:`—`}),t&&(0,Z.jsx)(`div`,{className:`font-sans mt-1 text-[11px] tracking-wide text-text-subtle`,children:t})]})}let t=e.currentContextTokens,n=e.autoCompactWindow,r=e.contextWindow,i=n&&n>0&&(r===void 0||r<=0||n<=r)?{denom:n,label:`to compact`,detail:[`${Y(t)} / ${Y(n)}`,r?`model window ${Y(r)}`:null].filter(Boolean).join(` · `)}:r&&r>0?{denom:r,label:`full`,detail:`${Y(t)} / ${Y(r)} model window`}:null;if(i){let e=Math.min(100,Math.round(t/i.denom*100)),n=e>=90?`bg-health-error`:e>=75?`bg-health-warn`:`bg-accent`;return(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,Z.jsxs)(`span`,{className:`font-serif text-[18px] leading-none text-text`,children:[e,`%`]}),(0,Z.jsx)(`span`,{className:`font-sans text-[11px] tracking-wide text-text-muted`,children:i.label})]}),(0,Z.jsx)(`div`,{className:`mt-2 h-1 w-44 max-w-full overflow-hidden rounded-full bg-border-soft`,children:(0,Z.jsx)(`span`,{className:`block h-full rounded-full ${n}`,style:{width:`${e}%`}})}),(0,Z.jsx)(`div`,{className:`font-sans mt-1.5 text-[11px] tracking-wide text-text-subtle`,children:i.detail})]})}return(0,Z.jsx)(`div`,{className:`min-w-0`,children:(0,Z.jsxs)(`div`,{className:`font-mono text-[13px] text-text`,children:[Y(t),` tokens`]})})}function Dt({children:e}){return(0,Z.jsx)(`div`,{className:`chrome mb-1.5 text-[10px] uppercase tracking-[0.1em] text-text-subtle`,children:e})}function Ot({stats:e,session:t,now:n}){let r=t?.currentStartedAt??t?.createdAt;return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-10 gap-y-4 py-1`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(Dt,{children:`Context`}),(0,Z.jsx)(Et,{stats:e})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(Dt,{children:`Compactions`}),e?.sessionCompactionCount===void 0?(0,Z.jsx)(`span`,{className:`font-serif italic text-[14px] text-text-subtle`,children:`—`}):(0,Z.jsx)(`span`,{className:`font-mono text-[15px] leading-none text-text`,children:e.sessionCompactionCount})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(Dt,{children:`Started`}),r?(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`span`,{className:`font-mono text-[15px] leading-none text-text`,children:tt(r)}),(0,Z.jsxs)(`span`,{className:`font-sans ml-2 text-[11px] tracking-wide text-text-subtle`,children:[`up `,et(r,n)]})]}):(0,Z.jsx)(`span`,{className:`font-serif italic text-[14px] text-text-subtle`,children:`—`})]})]})}function kt({agentId:e,agentName:t,onConnect:n}){let r=t?.trim()||`Anima {user}`,[i,a]=(0,X.useState)(`create`),[o,s]=(0,X.useState)(`manual`),[c,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(``),[f,p]=(0,X.useState)(null),[m,h]=(0,X.useState)(!1),[_,v]=(0,X.useState)(!1),[y,b]=(0,X.useState)(!1),[x,C]=(0,X.useState)(!1),[w,E]=(0,X.useState)(),D=(0,X.useRef)(0),k=(0,X.useRef)(!0),A=(0,X.useRef)(null),j=y||!c.trim()||!u.trim(),M=T(f),P=f?.verificationUrl,te=!!(M&&P);(0,X.useEffect)(()=>(k.current=!0,()=>{k.current=!1,D.current+=1,F()}),[]),N({agentId:e,enabled:M,registration:f,onStatus:e=>{p(e),e.verificationUrl&&F(),e.state===`connected`&&(C(!0),F(),W(),n?.()),e.state===`failed`&&(F(),s(`failed`),E(e.error?.description??e.error?.message),a(`existing`))},onError:e=>{E(e instanceof Error?e.message:`Could not refresh Feishu app registration`)}});function F(){A.current!==null&&(clearTimeout(A.current),A.current=null)}function I(){F(),v(!1),A.current=setTimeout(()=>{v(!0)},S)}function L(e){return k.current&&D.current===e}async function R(){if(m)return;let t=D.current+1;D.current=t,h(!0),I(),E(void 0),C(!1);try{let i=await Ce(e,{botName:r});if(!L(t))return;p(i),i.state===`connected`?(C(!0),F(),W(),n?.()):i.state===`failed`?(F(),s(`failed`),E(i.error?.description??i.error?.message),a(`existing`)):i.verificationUrl&&F()}catch(e){if(!L(t))return;F(),E(e instanceof Error?e.message:`Could not start creating your Feishu app.`),s(`failed`),a(`existing`)}finally{L(t)&&h(!1)}}async function z(){if(!j){D.current+=1,F(),p(null),h(!1),v(!1),b(!0),E(void 0);try{await Le(e,{appId:c.trim(),appSecret:u.trim()}),C(!0),d(``),W(),n?.()}catch(e){E(e instanceof Error?e.message:`Feishu connection failed`)}finally{b(!1)}}}function B(e){s(e),a(`existing`)}function V(){a(`create`),E(void 0)}function H(){F(),p(null),E(void 0),s(`manual`),a(`create`),R()}return(0,Z.jsxs)(`div`,{className:`space-y-5`,children:[i===`create`&&(0,Z.jsxs)(Z.Fragment,{children:[te&&P?(0,Z.jsx)(g,{frame:`card`,verificationUrl:P}):(0,Z.jsxs)(`div`,{className:`rounded-sm border border-border-soft bg-surface-elevated px-4 py-3`,children:[(0,Z.jsx)(G,{className:`w-full`,onClick:()=>void R(),disabled:m||!!M,children:m||M?(0,Z.jsx)(O,{}):`Create Feishu app`}),(m||M)&&_&&(0,Z.jsx)(`div`,{className:`mt-2`,children:(0,Z.jsx)(ee,{})})]}),(0,Z.jsx)(`button`,{type:`button`,className:`font-sans text-[12px] text-text-muted underline decoration-text-muted/40 underline-offset-2 transition-colors hover:text-text hover:decoration-text/40`,onClick:()=>B(`manual`),children:`Use an existing Feishu app`})]}),i===`existing`&&(0,Z.jsx)(At,{appId:c,appSecret:u,disabled:j,reason:o,saving:y,onAppId:l,onAppSecret:d,onBack:V,onRetry:H,onSubmit:()=>void z()}),w&&(0,Z.jsx)(`p`,{className:`font-sans text-[12px] text-health-error`,children:w}),x&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-sm border border-health-ok/30 bg-health-ok-soft px-4 py-3`,children:[(0,Z.jsx)(Ae,{className:`h-4 w-4 text-health-ok`}),(0,Z.jsx)(`span`,{className:`font-serif text-[13px] text-text`,children:`Feishu app credentials saved.`})]})]})}function At({appId:e,appSecret:t,disabled:n,onAppId:r,onAppSecret:i,onBack:a,onRetry:o,onSubmit:s,reason:c,saving:l}){return(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[c===`manual`&&(0,Z.jsx)(`button`,{type:`button`,className:`font-sans text-[12px] text-text-muted underline decoration-text-muted/40 underline-offset-2 transition-colors hover:text-text hover:decoration-text/40`,onClick:a,children:`Create a new Feishu app`}),c===`failed`&&(0,Z.jsx)(`div`,{className:`rounded-sm border border-border-soft bg-surface px-4 py-3`,children:(0,Z.jsx)(G,{className:`w-full`,onClick:o,disabled:l,children:`Try creating a new Feishu app again`})}),(0,Z.jsx)(j,{appId:e,appSecret:t,description:c===`failed`?`We couldn't finish creating the new app. Connect an app you already have to continue.`:`Connect an app you already have to continue.`,disabled:n,saving:l,onAppId:r,onAppSecret:i,onSubmit:s})]})}function jt({agentId:e}){let[t,n]=(0,X.useState)(null),[r,i]=(0,X.useState)(!1),{data:a,isError:o,isFetching:s,refetch:l}=J({queryKey:q.agentFeishuScopes(e),queryFn:()=>me(e)}),u=a?.appId,d=t?.agentId===e&&t.appId===u?t.state:null,f=a?.recommended,p=f?.state??a?.profileName.state;if(d!==`granted`&&!o&&(!a||p===`granted`||p===`not_connected`))return null;let m=f?.authUrl??a?.profileName.authUrl,h=f?.authUrls,g=A(a),_=d===`missing`;async function ee(){n(null);let t=await l(),r=t.data?.recommended.state??t.data?.profileName.state;(r===`granted`||r===`missing`)&&n({agentId:e,appId:t.data?.appId,state:r})}if(d===`granted`)return(0,Z.jsx)(`div`,{className:`rounded-md border border-health-ok/30 bg-health-ok-soft px-4 py-3`,children:(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(c,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-health-ok`}),(0,Z.jsx)(`p`,{className:`font-serif text-[13px] leading-snug text-text`,children:`Recommended Feishu permissions are on. Your Feishu bot is good to go.`})]})});let v=f?.message??a?.profileName.message;return(0,Z.jsx)(D,{scopes:g,authUrl:m,authUrls:h,confirmedMissing:_,showPerms:r,onTogglePerms:()=>i(e=>!e),onRecheck:()=>void ee(),isRechecking:s,statusLine:(0,Z.jsxs)(Z.Fragment,{children:[v&&d!==`missing`&&(0,Z.jsxs)(`div`,{className:`break-words font-sans text-[11px] text-text-subtle`,children:[`Last check: `,v]}),o&&!v&&(0,Z.jsx)(`div`,{className:`font-sans text-[11px] text-text-subtle`,children:`Could not check Feishu permissions.`})]})})}function Mt({agentId:e}){let{data:t}=J({queryKey:q.agentSlackManifestUpdate(e),queryFn:()=>ve(e)}),[n,r]=(0,X.useState)(``),[i,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(!1),[c,l]=(0,X.useState)(null),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(null),[m,h]=(0,X.useState)(!1);if(!t?.needsUpdate)return null;async function g(){if(t){l(null);try{await We(t.manifestUpdateYaml),a(!0),setTimeout(()=>a(!1),2500)}catch{s(!0),l(`Copy failed. Manifest details are open below so you can copy the full YAML manually.`)}}}async function _(){if(!(!n.trim()||u)){d(!0),p(null);try{await Je(e,{botToken:n.trim()}),r(``),H(e),qe.invalidateQueries({queryKey:q.agentSlackManifestUpdate(e)})}catch(e){p(ut(e))}finally{d(!1)}}}return(0,Z.jsxs)(`div`,{className:`overflow-hidden rounded-sm border border-health-warn/30 bg-health-warn-soft`,children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>h(e=>!e),"aria-expanded":m,className:`flex w-full items-center gap-3 px-4 py-2.5 text-left`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-serif text-[14px] font-semibold text-text`,children:`Slack app update available`}),(0,Z.jsxs)(`span`,{className:`shrink-0 rounded-sm border border-health-warn/30 px-1.5 py-0.5 font-mono text-[10px] text-health-warn`,children:[`v`,t.agentVersion,`→v`,t.currentVersion]}),(0,Z.jsx)(Ke,{className:`h-3.5 w-3.5 shrink-0 text-text-muted transition-transform ${m?`rotate-180`:``}`})]}),m&&(0,Z.jsxs)(`div`,{className:`space-y-4 px-4 pb-4 pt-1`,children:[(0,Z.jsx)(`div`,{className:`font-serif text-[13px] leading-snug text-text-muted`,children:`Shortcuts and other new features require a one-time Slack app reinstall.`}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`div`,{className:`font-sans text-[11px] font-semibold uppercase tracking-wide text-text-subtle`,children:`Step 1 · Update app manifest`}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>void g(),className:`inline-flex min-h-[44px] items-center gap-1 rounded-sm border border-border-soft px-2 py-1 font-sans text-[11px] text-text hover:border-border hover:bg-surface md:min-h-0`,children:[i?(0,Z.jsx)(Ae,{className:`h-3 w-3`}):(0,Z.jsx)(Ve,{className:`h-3 w-3`}),i?`Copied`:`Copy full manifest`]}),t.appManifestUrl&&(0,Z.jsxs)(`a`,{href:t.appManifestUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex min-h-[44px] items-center gap-1 font-sans text-[11px] text-accent underline decoration-accent/40 underline-offset-2 hover:decoration-accent md:min-h-0`,children:[`Open App Manifest `,(0,Z.jsx)(L,{className:`h-3 w-3`})]})]})]}),(0,Z.jsx)(`div`,{className:`font-serif text-[13px] leading-snug text-text-muted`,children:`Open the Slack app manifest editor, replace its YAML with the copied manifest, then save.`}),(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>s(e=>!e),className:`inline-flex items-center gap-1 font-sans text-[11px] text-text-subtle underline decoration-text-subtle/40 underline-offset-2 hover:text-text-muted hover:decoration-text-muted/40`,children:[(0,Z.jsx)(Ke,{className:`h-3 w-3 transition-transform ${o?`rotate-180`:``}`}),o?`Hide manifest details`:`Show manifest details`]}),o&&(0,Z.jsx)(`pre`,{className:`max-h-52 overflow-auto rounded-sm border border-border-soft bg-surface px-3 py-2 font-mono text-[11px] leading-relaxed text-text-muted`,children:t.manifestUpdateYaml}),c&&(0,Z.jsxs)(`div`,{className:`flex items-start gap-1.5 font-sans text-[12px] text-health-error`,children:[(0,Z.jsx)(U,{className:`mt-px h-3.5 w-3.5 shrink-0`}),(0,Z.jsx)(`span`,{children:c})]})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`div`,{className:`font-sans text-[11px] font-semibold uppercase tracking-wide text-text-subtle`,children:`Step 2 · Reinstall and save token`}),t.reinstallUrl&&(0,Z.jsxs)(`a`,{href:t.reinstallUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex shrink-0 items-center gap-1 font-sans text-[11px] text-accent underline decoration-accent/40 underline-offset-2 hover:decoration-accent`,children:[`Reinstall `,(0,Z.jsx)(L,{className:`h-3 w-3`})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,Z.jsx)(`input`,{type:`text`,value:n,onChange:e=>{r(e.target.value),p(null)},placeholder:`Paste new xoxb-… Bot User OAuth Token`,className:`min-w-0 flex-1 rounded-sm border border-border bg-muted/30 px-3 py-1.5 font-mono text-[12px] text-text placeholder:font-sans placeholder:text-text-muted focus:outline-none focus:ring-1 focus:ring-ring`}),(0,Z.jsx)(G,{onClick:()=>void _(),disabled:u||!n.trim(),children:u?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Se,{className:`h-3.5 w-3.5 animate-spin`}),`Saving`]}):`Save`})]}),f&&(0,Z.jsxs)(`div`,{className:`flex items-start gap-1.5 font-sans text-[12px] text-health-error`,children:[(0,Z.jsx)(U,{className:`mt-px h-3.5 w-3.5 shrink-0`}),(0,Z.jsx)(`span`,{children:f})]})]})]})]})}function Nt(e,t){if(!e||!t)return null;let n=e.endsWith(`/`)?e:`${e}/`;return t.startsWith(n)?t.slice(n.length):null}function Pt({agentId:e,homePath:t,skill:n}){let[r,i]=(0,X.useState)(!1),a=Nt(t,n.sourcePath),o=a?Qe(e,`${a}/SKILL.md`):null;return(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),"aria-expanded":r,className:`group flex w-full items-baseline gap-2.5 py-2 text-left`,children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-serif text-[14px] leading-snug text-text`,children:n.name}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-sans text-[12px] text-text-subtle transition-colors group-hover:text-text-muted`,children:r?``:n.description}),(0,Z.jsx)(Ke,{className:`h-3 w-3 shrink-0 self-center text-text-subtle/50 transition-transform ${r?`rotate-180`:``}`})]}),r&&(0,Z.jsxs)(`div`,{className:`space-y-2 pb-3 pr-6`,children:[n.description&&(0,Z.jsx)(`p`,{className:`max-w-prose font-sans text-[12px] leading-relaxed text-text-muted`,children:n.description}),n.sourcePath&&(0,Z.jsx)(`div`,{className:`break-all font-mono text-[11px] text-text-subtle`,children:n.sourcePath}),o&&(0,Z.jsxs)(Xe,{to:o,className:`inline-flex items-center gap-1 font-sans text-[11px] text-text-subtle underline decoration-text-subtle/40 underline-offset-2 hover:text-text-muted hover:decoration-text-muted/40`,children:[(0,Z.jsx)(pe,{className:`h-3 w-3`}),`Open in Files`]})]})]})}function Ft({agentId:e,homePath:t,skills:n}){return(0,Z.jsx)(`div`,{className:`divide-y divide-border-soft/60`,children:n.map(n=>(0,Z.jsx)(Pt,{agentId:e,homePath:t,skill:n},`${n.sourcePath??``}:${n.dirName}`))})}function It({agentId:e,homePath:t,source:n}){let[r,i]=(0,X.useState)(n.kind===`common`||n.kind===`local`||n.kind===`provider`);return(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),"aria-expanded":r,className:`flex w-full items-baseline gap-2 py-1.5 text-left`,title:n.path,children:[(0,Z.jsx)(Ke,{className:`h-3 w-3 shrink-0 self-center text-text-subtle/50 transition-transform ${r?`rotate-180`:``}`}),(0,Z.jsx)(`span`,{className:`font-sans text-[12px] font-medium text-text-muted`,children:n.label}),(0,Z.jsx)(`span`,{className:`font-mono text-[11px] text-text-subtle`,children:n.skills.length})]}),r&&(0,Z.jsx)(`div`,{className:`ml-5`,children:(0,Z.jsx)(Ft,{agentId:e,homePath:t,skills:n.skills})})]})}function Lt({agentId:e,emptyHint:t,homePath:n,label:r,path:i,skills:a,sources:o}){let s=o?.filter(e=>e.skills.length>0)??[];return(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`chrome mb-1 flex items-baseline gap-1.5 text-[10px] uppercase tracking-[0.1em] text-text-subtle`,title:i,children:[(0,Z.jsx)(`span`,{children:r}),(0,Z.jsxs)(`span`,{className:`normal-case tracking-normal text-text-subtle/60`,children:[`· `,a.length]})]}),a.length===0?(0,Z.jsxs)(`div`,{className:`py-1`,children:[(0,Z.jsx)(`p`,{className:`font-serif text-[13px] italic text-text-subtle`,children:`None yet`}),t&&(0,Z.jsx)(`p`,{className:`mt-1 break-all font-mono text-[11px] text-text-muted`,children:t})]}):s.length>1?(0,Z.jsx)(`div`,{className:`space-y-1`,children:s.map(t=>(0,Z.jsx)(It,{agentId:e,homePath:n,source:t},`${t.kind}:${t.path}`))}):(0,Z.jsx)(Ft,{agentId:e,homePath:n,skills:a})]})}function Rt({agentId:e,homePath:t}){let{data:n,isLoading:r}=J({queryKey:q.agentSkills(e),queryFn:()=>re(e),enabled:!!e,staleTime:6e4});return r||!n?(0,Z.jsx)(`div`,{className:`space-y-1`,children:[1,2,3].map(e=>(0,Z.jsx)(`div`,{className:`h-4 w-32 animate-pulse rounded bg-surface-elevated`},e))}):(0,Z.jsxs)(`div`,{className:`space-y-7`,children:[(0,Z.jsx)(Lt,{agentId:e,label:`This agent`,path:n.localPath,skills:n.local,sources:n.localSources,homePath:t,emptyHint:n.localPath}),(0,Z.jsx)(Lt,{agentId:e,label:`Shared`,path:n.globalPath,skills:n.global,sources:n.globalSources,homePath:t})]})}var zt=`flex h-11 w-full items-center gap-2.5 px-3.5 text-left font-serif text-[14px] transition-colors disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent`,Bt=`text-text hover:bg-surface-elevated`,Vt=`text-health-error hover:bg-health-error-soft/60`;function Ht({action:e}){return(0,Z.jsxs)(`button`,{type:`button`,disabled:e.disabled,title:e.disabled?e.disabledReason:void 0,onClick:e.onSelect,className:`${zt} ${e.danger?Vt:Bt}`,children:[(0,Z.jsx)(`span`,{className:`shrink-0 ${e.danger?`text-health-error`:`text-text-muted`}`,"aria-hidden":!0,children:e.icon}),e.label]})}function Ut({enabled:e,toggling:t,copyingDiagnostics:n,diagnosticsCopied:r,showRestart:i,onToggleEnabled:a,onRotateSession:o,onRestart:s,onCopyDiagnostics:c,onRemove:l}){let u=`h-4 w-4`;return(0,Z.jsxs)(`aside`,{"aria-label":`Agent actions`,className:`w-60 shrink-0`,children:[(0,Z.jsx)(`div`,{className:`divide-y divide-border-soft overflow-hidden rounded-sm border border-border-soft bg-surface`,children:[...i?[{key:`restart`,label:`Restart agent`,icon:(0,Z.jsx)(se,{className:u}),disabled:!e,disabledReason:`Agent is disabled. Enable it to run.`,onSelect:s}]:[],{key:`rotate`,label:`Rotate session`,icon:(0,Z.jsx)(ne,{className:u}),onSelect:o},{key:`diagnostics`,label:r?`Copied`:`Copy diagnostics`,icon:r?(0,Z.jsx)(Ge,{className:`${u} text-health-ok`}):(0,Z.jsx)(it,{className:u}),disabled:n,onSelect:c},{key:`toggle`,label:t?`Saving…`:e?`Disable`:`Enable`,icon:(0,Z.jsx)(Ue,{className:u}),disabled:t,onSelect:()=>a(!e)}].map(e=>(0,Z.jsx)(Ht,{action:e},e.key))}),(0,Z.jsx)(`div`,{className:`mt-3 overflow-hidden rounded-sm border border-health-error/25 bg-surface`,children:(0,Z.jsx)(Ht,{action:{key:`remove`,label:`Remove agent`,icon:(0,Z.jsx)(be,{className:u}),danger:!0,onSelect:l}})})]})}function Wt(){let{agent:e,enabled:t,toggling:n,copyingDiagnostics:r,diagnosticsCopied:i,providerAction:a,restartBlocked:o,toggleEnabled:s,requestDisable:c,copyDiagnostics:l,confirmRotateSession:u,confirmRestart:d,confirmRemove:f,modal:p}=Be();return e?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ut,{enabled:t,toggling:n,copyingDiagnostics:r,diagnosticsCopied:i,showRestart:!a&&!o,onToggleEnabled:e=>e?void s(!0):c(),onRotateSession:u,onRestart:d,onCopyDiagnostics:()=>void l(),onRemove:f}),p]}):null}function Gt({totals:e,compact:t=!1}){let n=[[`Uncached input`,e.inputTokens],[`Cache read`,e.cacheReadInputTokens],[`Cache write`,e.cacheCreationInputTokens],[`Output`,e.outputTokens]];return(0,Z.jsx)(`div`,{className:`grid ${t?`grid-cols-2 gap-3 sm:grid-cols-4`:`grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-4`}`,children:n.map(([e,t])=>(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`div`,{className:`font-mono text-[10px] uppercase tracking-[0.08em] text-text-subtle`,children:e}),(0,Z.jsx)(`div`,{className:`mt-1 font-serif text-[17px] tabular-nums text-text`,children:Y(t)})]},e))})}function Kt({agentId:e}){let i=n(),{data:a,isLoading:o,isError:s}=J({queryKey:q.agentTokenUsage(e,i.from,i.through,i.timezone),queryFn:()=>r(i,e),refetchInterval:3e4}),c=a?.agents[0];return o?(0,Z.jsx)(`div`,{className:`h-36 animate-pulse rounded-sm bg-surface-elevated`}):s||!c?(0,Z.jsx)(`p`,{className:`font-serif text-[13px] text-text-muted`,children:`Token usage is unavailable right now.`}):(0,Z.jsxs)(`div`,{className:`space-y-5`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`font-serif text-[28px] tabular-nums leading-none text-text`,children:Y(c.totalTokens)}),(0,Z.jsx)(`div`,{className:`mt-1 font-sans text-[11px] uppercase tracking-[0.11em] text-text-subtle`,children:`Tokens processed · 52 weeks`})]}),(0,Z.jsx)(qt,{coverageStartedAt:c.coverageStartedAt})]}),(0,Z.jsx)(t,{coverageStartedAt:c.coverageStartedAt,days:c.days,from:i.from,through:i.through}),(0,Z.jsx)(Gt,{totals:c}),(0,Z.jsx)(`p`,{className:`font-sans text-[11px] leading-relaxed text-text-muted`,children:`Provider-reported tokens only. Reasoning tokens are included in output and are never counted twice.`})]})}function qt({coverageStartedAt:e}){return e?(0,Z.jsxs)(`span`,{className:`max-w-xs text-right font-sans text-[11px] leading-relaxed text-text-muted`,children:[`Exact since `,new Date(e).toLocaleDateString()]}):(0,Z.jsx)(`span`,{className:`max-w-xs font-sans text-[11px] leading-relaxed text-text-muted`,children:`Exact tracking starts when this agent runtime next starts.`})}function Jt({label:e,value:t}){return(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`div`,{className:`chrome text-[10px] tracking-[0.1em] text-text-subtle`,children:e}),(0,Z.jsx)(`div`,{className:`mt-0.5 break-all font-mono text-[12px] text-text`,children:t||`—`})]})}function Yt(){let e=(0,X.useRef)(null),{agentId:t}=ge();(0,X.useEffect)(()=>{e.current?.scrollTo(0,0)},[t]);let{data:n,isError:r}=J({queryKey:q.agent(t??``),queryFn:()=>de(t),enabled:!!t,retry:!1}),{data:i=[]}=le(),{data:a=`slack`}=J({queryKey:q.workspacePlatform(),queryFn:K}),o=Ne(),s=je().find(e=>e.agentId===t),{data:c=null}=J({queryKey:q.providerAvailability(),queryFn:ke}),l=i.find(e=>e.agentId===t)?.currentItemId,{data:u}=J({queryKey:q.agentSession(t??``,l),queryFn:()=>ye(t),enabled:!!t}),[d,f]=(0,X.useState)(!1),[p,m]=(0,X.useState)(!1),[h,g]=(0,X.useState)(!1),[_,ee]=(0,X.useState)(!1),[y,b]=(0,X.useState)(null);function x(e=`Saved. This agent will apply the change when the current item finishes.`){b(e),setTimeout(()=>b(null),6e3)}function S(e){D&&x(e)}let w=rt(),T=C(Ee(),c);if(!t)return null;if(r)return(0,Z.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-surface`,children:(0,Z.jsx)(`span`,{className:`font-serif text-[14px] text-text-muted`,children:`Agent not found.`})});if(!n)return(0,Z.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-surface`,children:(0,Z.jsx)(`div`,{className:`h-6 w-28 animate-pulse rounded bg-surface-elevated`})});if(!n.provider)return null;let E=u?.latestProviderStats,D=!!i.find(e=>e.agentId===t)?.currentItemId,O=u?.archived?.length??0,k=n.createdAt??u?.createdAt,A=R(n),j=_e(n),N=z(n),P=j||!N&&a===`feishu`,te=!j&&(A||!N&&a===`slack`);async function F(e){if(!t)return;let n={},r={};(`displayName`in e||`role`in e)&&(`displayName`in e&&(n.displayName=e.displayName),`role`in e&&(n.role=e.role)),(`kind`in e||`model`in e||`reasoningEffort`in e)&&(`kind`in e&&(r.kind=e.kind),`model`in e&&(r.model=e.model),`reasoningEffort`in e&&(r.reasoningEffort=e.reasoningEffort)),(Object.keys(n).length>0||Object.keys(r).length>0)&&(Object.keys(n).length>0&&await I(t,n),Object.keys(r).length>0&&await Me(t,r),S(),H(t))}async function B(){if(!(!t||d)){f(!0);try{await xe(t),H(t)}catch{}finally{f(!1)}}}async function V(){if(!(!t||p)){m(!0);try{await Te(t),H(t)}catch{}finally{m(!1)}}}async function re(e){t&&(await fe(t,{homePath:e}),S(),H(t))}async function ie(e){t&&(await He(t,e),H(t),qe.invalidateQueries({queryKey:q.teams()}))}async function ae(e,n){t&&(await Me(t,e),S(n.envOnly?`Saved. This agent will apply launch env changes when the current item finishes.`:void 0),H(t))}return(0,Z.jsx)(`div`,{ref:e,className:`absolute inset-0 overflow-y-auto bg-surface px-6 py-8 md:px-10 md:py-8`,children:(0,Z.jsxs)(`div`,{className:`flex gap-12`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 max-w-3xl flex-1`,children:[y&&(0,Z.jsxs)(`div`,{className:`relative mb-8 rounded-sm border border-health-warn/30 bg-health-warn-soft px-4 py-3 pl-5`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`absolute left-0 top-2 bottom-2 w-px bg-health-warn/60`}),(0,Z.jsx)(`span`,{className:`font-serif text-[14px] text-text`,children:y})]}),(0,Z.jsx)(Tt,{agent:n,onCommitName:e=>F({displayName:e}),onCommitRole:e=>F({role:e}),children:(0,Z.jsx)(`div`,{className:`flex flex-col gap-y-1 font-sans text-[12px] tracking-wide text-text-subtle md:flex-row md:flex-wrap md:items-center md:gap-x-2`,children:[k?(0,Z.jsxs)(`span`,{title:new Date(k).toLocaleString(),children:[`Created `,tt(k)]},`created`):null,u?.updatedAt?(0,Z.jsxs)(`span`,{title:new Date(u.updatedAt).toLocaleString(),children:[`Last active `,nt(u.updatedAt,w)]},`active`):null,N?(0,Z.jsxs)(`span`,{children:[O,` session`,O===1?``:`s`,` archived`]},`archived`):null].filter(e=>e!==null).map((e,t)=>(0,Z.jsxs)(`span`,{className:`flex items-center gap-x-2`,children:[t>0&&(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`hidden md:inline`,children:`·`}),e]},e.key))})}),(0,Z.jsxs)($,{title:`Setup`,children:[(0,Z.jsxs)(`div`,{className:`divide-y divide-border-soft`,children:[(0,Z.jsx)(gt,{value:n.homePath??``,onCommit:re}),(0,Z.jsx)(_t,{teams:o,value:n.teamId??`default`,onCommit:ie}),s&&(0,Z.jsxs)(`div`,{className:`relative py-3 pl-5`,role:`status`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`absolute left-0 top-3 bottom-3 w-px bg-health-warn/60`}),(0,Z.jsxs)(`span`,{className:`font-serif text-[13px] leading-snug text-text-muted`,children:[`This agent references team `,(0,Z.jsxs)(`span`,{className:`font-mono text-text`,children:[`"`,s.teamId,`"`]}),`, which no longer exists. It is running under the default team - reassign it above to repair.`]})]}),(0,Z.jsx)(St,{provider:n.provider,providerOptions:T,providerAvailability:c,isActive:D,onCommit:ae}),(0,Z.jsx)(Q,{label:`Owner`,children:n.owner?(()=>{let e=n.owner,t=(0,Z.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[e.avatarUrl?(0,Z.jsx)(`img`,{src:e.avatarUrl,alt:``,className:`h-8 w-8 shrink-0 rounded-full object-cover`}):(0,Z.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted font-sans text-[12px] font-bold text-text-muted`,children:e.displayName.charAt(0).toUpperCase()}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col leading-tight`,children:[(0,Z.jsx)(`span`,{className:`font-serif text-[15px] text-text`,children:e.displayName}),e.handle&&(0,Z.jsxs)(`span`,{className:`font-sans text-[13px] text-text-muted`,children:[`@`,e.handle]})]})]});return A?(0,Z.jsx)(st,{onEdit:()=>g(!0),children:t}):t})():A?(0,Z.jsx)(`button`,{type:`button`,onClick:()=>g(!0),className:`font-sans text-[13px] text-accent underline decoration-accent/40 underline-offset-2 hover:decoration-accent transition-colors`,children:`Assign owner →`}):(0,Z.jsx)(ot,{})}),A&&(0,Z.jsx)(Q,{label:`Slack`,children:(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1`,children:[(0,Z.jsxs)(`span`,{className:`font-serif text-[15px] text-text`,children:[`@`,n.id]}),n.slack.workspaceName&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`font-sans text-[13px] text-text-subtle`,children:`·`}),(0,Z.jsx)(`span`,{className:`font-sans text-[13px] text-text-muted`,children:n.slack.workspaceName})]})]}),(0,Z.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[n.slack.appId&&(0,Z.jsx)(`a`,{href:`https://api.slack.com/apps/${n.slack.appId}/general`,target:`_blank`,rel:`noreferrer`,title:`Slack App Settings`,className:`flex h-[44px] w-[44px] items-center justify-center rounded-sm text-text-subtle opacity-40 transition-all hover:bg-surface-elevated hover:opacity-100 md:h-7 md:w-7`,children:(0,Z.jsx)(L,{className:`h-3.5 w-3.5`})}),(0,Z.jsx)(`button`,{onClick:()=>void B(),disabled:d,title:`Sync avatar from Slack`,className:`flex h-[44px] w-[44px] items-center justify-center rounded-sm text-text-subtle opacity-40 transition-all hover:bg-surface-elevated hover:opacity-100 disabled:opacity-20 md:h-7 md:w-7`,children:(0,Z.jsx)(ne,{className:`h-3.5 w-3.5 ${d?`animate-spin`:``}`})})]})]})}),j&&(0,Z.jsxs)(Q,{label:`Feishu`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1`,children:[(0,Z.jsx)(`span`,{className:`break-all font-mono text-[13px] text-text`,children:n.feishu.appId||`—`}),(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>ee(e=>!e),"aria-expanded":_,className:`inline-flex items-center gap-1 font-sans text-[11px] text-text-subtle underline decoration-text-subtle/40 underline-offset-2 hover:text-text-muted hover:decoration-text-muted/40`,children:[(0,Z.jsx)(Ke,{className:`h-3 w-3 transition-transform ${_?`rotate-180`:``}`}),_?`Hide details`:`Details`]})]}),(0,Z.jsx)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:(0,Z.jsx)(`button`,{onClick:()=>void V(),disabled:p,title:`Sync avatar from Feishu`,className:`flex h-[44px] w-[44px] items-center justify-center rounded-sm text-text-subtle opacity-40 transition-all hover:bg-surface-elevated hover:opacity-100 disabled:opacity-20 md:h-7 md:w-7`,children:(0,Z.jsx)(ne,{className:`h-3.5 w-3.5 ${p?`animate-spin`:``}`})})})]}),_&&(0,Z.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Z.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[(0,Z.jsx)(Jt,{label:`Bot Open ID`,value:n.feishu.botOpenId}),(0,Z.jsx)(Jt,{label:`Credentials`,value:`Configured`}),(0,Z.jsx)(Jt,{label:`Delivery`,value:`Long-lived connection`})]}),(0,Z.jsx)(`p`,{className:`font-sans text-[12px] leading-relaxed text-text-muted`,children:`Feishu credentials are stored in the agent config and injected by Anima at runtime. Secret values are hidden in the dashboard.`})]})]})]}),A&&(0,Z.jsx)(`div`,{className:`mt-4`,children:(0,Z.jsx)(Mt,{agentId:t})}),j&&(0,Z.jsx)(`div`,{className:`mt-4`,children:(0,Z.jsx)(jt,{agentId:t})})]}),h&&A&&(0,Z.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-page/70 backdrop-blur-sm`,children:(0,Z.jsxs)(`div`,{className:`relative mx-4 max-h-[90dvh] w-full max-w-md overflow-y-auto rounded-sm border border-border-soft bg-surface shadow-deep`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border-soft px-5 py-4`,children:[(0,Z.jsx)(`span`,{className:`font-serif text-[15px] font-semibold text-text`,children:n.owner?`Change owner`:`Assign owner`}),(0,Z.jsx)(`button`,{onClick:()=>g(!1),className:`flex h-8 w-8 items-center justify-center rounded-sm text-text-muted hover:bg-surface-elevated hover:text-text`,children:(0,Z.jsx)(U,{className:`h-4 w-4`})})]}),(0,Z.jsx)(`div`,{className:`p-5`,children:(0,Z.jsx)(M,{agentId:t,onConfirm:()=>{g(!1),H(t)},submitLabel:n.owner?`Change owner →`:`Assign owner →`,autoFocus:!0,showRationale:!0},t)})]})}),N&&(0,Z.jsx)($,{title:`This session`,children:(0,Z.jsx)(Ot,{stats:E,session:u??void 0,now:w})}),(0,Z.jsx)($,{title:`Token usage`,children:(0,Z.jsx)(Kt,{agentId:t})}),te&&!A&&(0,Z.jsx)($,{title:`Slack`,children:(0,Z.jsx)(v,{agentId:t,onConnect:()=>H(t)})}),P&&!j&&(0,Z.jsx)($,{title:`Feishu`,children:(0,Z.jsx)(kt,{agentId:t,agentName:n.profile.displayName,onConnect:()=>H(t)},t)}),(0,Z.jsx)($,{title:`Skills`,children:(0,Z.jsx)(Rt,{agentId:t,homePath:n.homePath??``})})]}),(0,Z.jsx)(`div`,{className:`hidden lg:block`,children:(0,Z.jsx)(Wt,{})})]})})}export{Yt as default};
@@ -1,4 +1,4 @@
1
- import{g as e,h as t,p as n}from"./src-DOSXYjwH.js";import{D as r,H as i,K as a,U as o,a as s,c,f as l,v as u,w as d,x as f,y as p,z as m}from"./chunk-CSCIHK7Q-xxNdF5BX.js";import{t as h}from"./linear-D6Qub4j1.js";var g=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[1,7],s=[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],c=[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],l=[55,56,57],u=[2,36],d=[1,37],f=[1,36],p=[1,38],m=[1,35],h=[1,43],g=[1,41],_=[1,45],v=[1,14],y=[1,23],b=[1,18],x=[1,19],S=[1,20],C=[1,21],w=[1,22],T=[1,24],E=[1,25],D=[1,26],O=[1,27],k=[1,28],A=[1,29],j=[1,32],M=[1,33],N=[1,34],P=[1,39],F=[1,40],I=[1,42],L=[1,44],R=[1,63],z=[1,62],B=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],ee=[1,66],te=[1,67],ne=[1,68],re=[1,69],ie=[1,70],ae=[1,71],oe=[1,72],se=[1,73],ce=[1,74],le=[1,75],ue=[1,76],de=[1,77],V=[4,5,6,7,8,9,10,11,12,13,14,15,18],H=[1,91],U=[1,92],W=[1,93],G=[1,100],K=[1,94],q=[1,97],J=[1,95],Y=[1,96],X=[1,98],Z=[1,99],fe=[1,103],pe=[10,55,56,57],Q=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],me={trace:t(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:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 23:this.$=a[s];break;case 24:this.$=a[s-1]+``+a[s];break;case 26:this.$=a[s-1]+a[s];break;case 27:this.$=[a[s].trim()];break;case 28:a[s-2].push(a[s].trim()),this.$=a[s-2];break;case 29:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 37:this.$=[];break;case 42:this.$=a[s].trim(),r.setDiagramTitle(this.$);break;case 43:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 44:case 45:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 46:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 47:r.addPoint(a[s-3],``,a[s-1],a[s],[]);break;case 48:r.addPoint(a[s-4],a[s-3],a[s-1],a[s],[]);break;case 49:r.addPoint(a[s-4],``,a[s-2],a[s-1],a[s]);break;case 50:r.addPoint(a[s-5],a[s-4],a[s-2],a[s-1],a[s]);break;case 51:r.setXAxisLeftText(a[s-2]),r.setXAxisRightText(a[s]);break;case 52:a[s-1].text+=` ⟶ `,r.setXAxisLeftText(a[s-1]);break;case 53:r.setXAxisLeftText(a[s]);break;case 54:r.setYAxisBottomText(a[s-2]),r.setYAxisTopText(a[s]);break;case 55:a[s-1].text+=` ⟶ `,r.setYAxisBottomText(a[s-1]);break;case 56:r.setYAxisBottomText(a[s]);break;case 57:r.setQuadrant1Text(a[s]);break;case 58:r.setQuadrant2Text(a[s]);break;case 59:r.setQuadrant3Text(a[s]);break;case 60:r.setQuadrant4Text(a[s]);break;case 64:this.$={text:a[s],type:`text`};break;case 65:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 66:this.$={text:a[s],type:`text`};break;case 67:this.$={text:a[s],type:`markdown`};break;case 68:this.$=a[s];break;case 69:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[{18:n,26:1,27:2,28:r,55:i,56:a,57:o},{1:[3]},{18:n,26:8,27:2,28:r,55:i,56:a,57:o},{18:n,26:9,27:2,28:r,55:i,56:a,57:o},e(s,[2,33],{29:10}),e(c,[2,61]),e(c,[2,62]),e(c,[2,63]),{1:[2,30]},{1:[2,31]},e(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:f,10:p,12:m,13:h,14:g,15:_,18:v,25:y,35:b,37:x,39:S,41:C,42:w,48:T,50:E,51:D,52:O,53:k,54:A,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),e(s,[2,34]),{27:46,55:i,56:a,57:o},e(l,[2,37]),e(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:f,10:p,12:m,13:h,14:g,15:_,18:v,25:y,35:b,37:x,39:S,41:C,42:w,48:T,50:E,51:D,52:O,53:k,54:A,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),e(l,[2,39]),e(l,[2,40]),e(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},e(l,[2,45]),e(l,[2,46]),{18:[1,51]},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:52,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:53,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:54,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:55,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:56,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:57,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,44:[1,58],47:[1,59],58:61,59:60,63:N,64:P,65:F,66:I,67:L},e(B,[2,64]),e(B,[2,66]),e(B,[2,67]),e(B,[2,70]),e(B,[2,71]),e(B,[2,72]),e(B,[2,73]),e(B,[2,74]),e(B,[2,75]),e(B,[2,76]),e(B,[2,77]),e(B,[2,78]),e(B,[2,79]),e(B,[2,80]),e(B,[2,81]),e(s,[2,35]),e(l,[2,38]),e(l,[2,42]),e(l,[2,43]),e(l,[2,44]),{3:65,4:ee,5:te,6:ne,7:re,8:ie,9:ae,10:oe,11:se,12:ce,13:le,14:ue,15:de,21:64},e(l,[2,53],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,49:[1,78],63:N,64:P,65:F,66:I,67:L}),e(l,[2,56],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,49:[1,79],63:N,64:P,65:F,66:I,67:L}),e(l,[2,57],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),e(l,[2,58],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),e(l,[2,59],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),e(l,[2,60],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),{45:[1,80]},{44:[1,81]},e(B,[2,65]),e(B,[2,82]),e(B,[2,83]),e(B,[2,84]),{3:83,4:ee,5:te,6:ne,7:re,8:ie,9:ae,10:oe,11:se,12:ce,13:le,14:ue,15:de,18:[1,82]},e(V,[2,23]),e(V,[2,1]),e(V,[2,2]),e(V,[2,3]),e(V,[2,4]),e(V,[2,5]),e(V,[2,6]),e(V,[2,7]),e(V,[2,8]),e(V,[2,9]),e(V,[2,10]),e(V,[2,11]),e(V,[2,12]),e(l,[2,52],{58:31,43:84,4:d,5:f,10:p,12:m,13:h,14:g,15:_,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),e(l,[2,55],{58:31,43:85,4:d,5:f,10:p,12:m,13:h,14:g,15:_,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),{46:[1,86]},{45:[1,87]},{4:H,5:U,6:W,8:G,11:K,13:q,16:90,17:J,18:Y,19:X,20:Z,22:89,23:88},e(V,[2,24]),e(l,[2,51],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),e(l,[2,54],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),e(l,[2,47],{22:89,16:90,23:101,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),{46:[1,102]},e(l,[2,29],{10:fe}),e(pe,[2,27],{16:104,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),e(Q,[2,25]),e(Q,[2,13]),e(Q,[2,14]),e(Q,[2,15]),e(Q,[2,16]),e(Q,[2,17]),e(Q,[2,18]),e(Q,[2,19]),e(Q,[2,20]),e(Q,[2,21]),e(Q,[2,22]),e(l,[2,49],{10:fe}),e(l,[2,48],{22:89,16:90,23:105,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),{4:H,5:U,6:W,8:G,11:K,13:q,16:90,17:J,18:Y,19:X,20:Z,22:106},e(Q,[2,26]),e(l,[2,50],{10:fe}),e(pe,[2,28],{16:104,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z})],defaultActions:{8:[2,30],9:[2,31]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{g as e,h as t,p as n}from"./src-B2YqOS_g.js";import{D as r,H as i,K as a,U as o,a as s,c,f as l,v as u,w as d,x as f,y as p,z as m}from"./chunk-CSCIHK7Q-BeNiRoDm.js";import{t as h}from"./linear-87q8d4nG.js";var g=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[1,7],s=[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],c=[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],l=[55,56,57],u=[2,36],d=[1,37],f=[1,36],p=[1,38],m=[1,35],h=[1,43],g=[1,41],_=[1,45],v=[1,14],y=[1,23],b=[1,18],x=[1,19],S=[1,20],C=[1,21],w=[1,22],T=[1,24],E=[1,25],D=[1,26],O=[1,27],k=[1,28],A=[1,29],j=[1,32],M=[1,33],N=[1,34],P=[1,39],F=[1,40],I=[1,42],L=[1,44],R=[1,63],z=[1,62],B=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],ee=[1,66],te=[1,67],ne=[1,68],re=[1,69],ie=[1,70],ae=[1,71],oe=[1,72],se=[1,73],ce=[1,74],le=[1,75],ue=[1,76],de=[1,77],V=[4,5,6,7,8,9,10,11,12,13,14,15,18],H=[1,91],U=[1,92],W=[1,93],G=[1,100],K=[1,94],q=[1,97],J=[1,95],Y=[1,96],X=[1,98],Z=[1,99],fe=[1,103],pe=[10,55,56,57],Q=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],me={trace:t(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:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 23:this.$=a[s];break;case 24:this.$=a[s-1]+``+a[s];break;case 26:this.$=a[s-1]+a[s];break;case 27:this.$=[a[s].trim()];break;case 28:a[s-2].push(a[s].trim()),this.$=a[s-2];break;case 29:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 37:this.$=[];break;case 42:this.$=a[s].trim(),r.setDiagramTitle(this.$);break;case 43:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 44:case 45:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 46:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 47:r.addPoint(a[s-3],``,a[s-1],a[s],[]);break;case 48:r.addPoint(a[s-4],a[s-3],a[s-1],a[s],[]);break;case 49:r.addPoint(a[s-4],``,a[s-2],a[s-1],a[s]);break;case 50:r.addPoint(a[s-5],a[s-4],a[s-2],a[s-1],a[s]);break;case 51:r.setXAxisLeftText(a[s-2]),r.setXAxisRightText(a[s]);break;case 52:a[s-1].text+=` ⟶ `,r.setXAxisLeftText(a[s-1]);break;case 53:r.setXAxisLeftText(a[s]);break;case 54:r.setYAxisBottomText(a[s-2]),r.setYAxisTopText(a[s]);break;case 55:a[s-1].text+=` ⟶ `,r.setYAxisBottomText(a[s-1]);break;case 56:r.setYAxisBottomText(a[s]);break;case 57:r.setQuadrant1Text(a[s]);break;case 58:r.setQuadrant2Text(a[s]);break;case 59:r.setQuadrant3Text(a[s]);break;case 60:r.setQuadrant4Text(a[s]);break;case 64:this.$={text:a[s],type:`text`};break;case 65:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 66:this.$={text:a[s],type:`text`};break;case 67:this.$={text:a[s],type:`markdown`};break;case 68:this.$=a[s];break;case 69:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[{18:n,26:1,27:2,28:r,55:i,56:a,57:o},{1:[3]},{18:n,26:8,27:2,28:r,55:i,56:a,57:o},{18:n,26:9,27:2,28:r,55:i,56:a,57:o},e(s,[2,33],{29:10}),e(c,[2,61]),e(c,[2,62]),e(c,[2,63]),{1:[2,30]},{1:[2,31]},e(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:f,10:p,12:m,13:h,14:g,15:_,18:v,25:y,35:b,37:x,39:S,41:C,42:w,48:T,50:E,51:D,52:O,53:k,54:A,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),e(s,[2,34]),{27:46,55:i,56:a,57:o},e(l,[2,37]),e(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:f,10:p,12:m,13:h,14:g,15:_,18:v,25:y,35:b,37:x,39:S,41:C,42:w,48:T,50:E,51:D,52:O,53:k,54:A,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),e(l,[2,39]),e(l,[2,40]),e(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},e(l,[2,45]),e(l,[2,46]),{18:[1,51]},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:52,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:53,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:54,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:55,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:56,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:57,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,44:[1,58],47:[1,59],58:61,59:60,63:N,64:P,65:F,66:I,67:L},e(B,[2,64]),e(B,[2,66]),e(B,[2,67]),e(B,[2,70]),e(B,[2,71]),e(B,[2,72]),e(B,[2,73]),e(B,[2,74]),e(B,[2,75]),e(B,[2,76]),e(B,[2,77]),e(B,[2,78]),e(B,[2,79]),e(B,[2,80]),e(B,[2,81]),e(s,[2,35]),e(l,[2,38]),e(l,[2,42]),e(l,[2,43]),e(l,[2,44]),{3:65,4:ee,5:te,6:ne,7:re,8:ie,9:ae,10:oe,11:se,12:ce,13:le,14:ue,15:de,21:64},e(l,[2,53],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,49:[1,78],63:N,64:P,65:F,66:I,67:L}),e(l,[2,56],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,49:[1,79],63:N,64:P,65:F,66:I,67:L}),e(l,[2,57],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),e(l,[2,58],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),e(l,[2,59],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),e(l,[2,60],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),{45:[1,80]},{44:[1,81]},e(B,[2,65]),e(B,[2,82]),e(B,[2,83]),e(B,[2,84]),{3:83,4:ee,5:te,6:ne,7:re,8:ie,9:ae,10:oe,11:se,12:ce,13:le,14:ue,15:de,18:[1,82]},e(V,[2,23]),e(V,[2,1]),e(V,[2,2]),e(V,[2,3]),e(V,[2,4]),e(V,[2,5]),e(V,[2,6]),e(V,[2,7]),e(V,[2,8]),e(V,[2,9]),e(V,[2,10]),e(V,[2,11]),e(V,[2,12]),e(l,[2,52],{58:31,43:84,4:d,5:f,10:p,12:m,13:h,14:g,15:_,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),e(l,[2,55],{58:31,43:85,4:d,5:f,10:p,12:m,13:h,14:g,15:_,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),{46:[1,86]},{45:[1,87]},{4:H,5:U,6:W,8:G,11:K,13:q,16:90,17:J,18:Y,19:X,20:Z,22:89,23:88},e(V,[2,24]),e(l,[2,51],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),e(l,[2,54],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),e(l,[2,47],{22:89,16:90,23:101,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),{46:[1,102]},e(l,[2,29],{10:fe}),e(pe,[2,27],{16:104,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),e(Q,[2,25]),e(Q,[2,13]),e(Q,[2,14]),e(Q,[2,15]),e(Q,[2,16]),e(Q,[2,17]),e(Q,[2,18]),e(Q,[2,19]),e(Q,[2,20]),e(Q,[2,21]),e(Q,[2,22]),e(l,[2,49],{10:fe}),e(l,[2,48],{22:89,16:90,23:105,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),{4:H,5:U,6:W,8:G,11:K,13:q,16:90,17:J,18:Y,19:X,20:Z,22:106},e(Q,[2,26]),e(l,[2,50],{10:fe}),e(pe,[2,28],{16:104,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z})],defaultActions:{8:[2,30],9:[2,31]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};me.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(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
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -0,0 +1 @@
1
+ import{l as e}from"./mermaid-parser.core-DZTDfv4-.js";export{e as createRadarServices};