@hienlh/ppm 0.8.54 → 0.8.55

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 (158) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/bun.lock +250 -1
  3. package/dist/web/assets/_basePickBy-CZovQgWd.js +1 -0
  4. package/dist/web/assets/_baseUniq-ClnvscgW.js +1 -0
  5. package/dist/web/assets/{api-client-TUmacMRS.js → api-client-DpGMOZNf.js} +1 -1
  6. package/dist/web/assets/api-settings--eVrUeZM.js +1 -0
  7. package/dist/web/assets/arc-C2Qaz-ch.js +1 -0
  8. package/dist/web/assets/architecture-PBZL5I3N-ChOahOB7.js +1 -0
  9. package/dist/web/assets/architectureDiagram-2XIMDMQ5-Jq91S_rs.js +36 -0
  10. package/dist/web/assets/array-BGFCBI0e.js +1 -0
  11. package/dist/web/assets/blockDiagram-WCTKOSBZ-CKGufRTy.js +132 -0
  12. package/dist/web/assets/c4Diagram-IC4MRINW-BNP2L9r_.js +10 -0
  13. package/dist/web/assets/channel-w7yboq56.js +1 -0
  14. package/dist/web/assets/chat-tab-BUOCxR2G.js +7 -0
  15. package/dist/web/assets/chunk-4BX2VUAB-BptTlTyl.js +1 -0
  16. package/dist/web/assets/chunk-55IACEB6-C4mUdyio.js +1 -0
  17. package/dist/web/assets/chunk-7E7YKBS2-6xAQfBwa.js +1 -0
  18. package/dist/web/assets/chunk-7R4GIKGN-DXaGAn_K.js +80 -0
  19. package/dist/web/assets/chunk-C72U2L5F-DOtEiN5f.js +1 -0
  20. package/dist/web/assets/chunk-CFjPhJqf.js +1 -0
  21. package/dist/web/assets/chunk-EGIJ26TM-D0KJTa_T.js +1 -0
  22. package/dist/web/assets/chunk-FMBD7UC4-C_1aG0eb.js +15 -0
  23. package/dist/web/assets/chunk-GEFDOKGD-DwVPiYfW.js +2 -0
  24. package/dist/web/assets/chunk-GLR3WWYH-D9pZakqr.js +2 -0
  25. package/dist/web/assets/chunk-HHEYEP7N-Dld5BpGB.js +1 -0
  26. package/dist/web/assets/chunk-JSJVCQXG-BSrqCL_3.js +1 -0
  27. package/dist/web/assets/chunk-KX2RTZJC-BCxGmbzy.js +1 -0
  28. package/dist/web/assets/chunk-KYZI473N-BKO5gMeU.js +53 -0
  29. package/dist/web/assets/chunk-L3YUKLVL-3wBgkSvL.js +1 -0
  30. package/dist/web/assets/chunk-MX3YWQON-BgjSEzus.js +1 -0
  31. package/dist/web/assets/chunk-NQ4KR5QH-DLrZwBEm.js +220 -0
  32. package/dist/web/assets/chunk-O4XLMI2P-BurQy8tt.js +7 -0
  33. package/dist/web/assets/chunk-OZEHJAEY-YTn24bGg.js +1 -0
  34. package/dist/web/assets/chunk-PQ6SQG4A-BxtUGYhW.js +1 -0
  35. package/dist/web/assets/chunk-PU5JKC2W-B66ELkQm.js +70 -0
  36. package/dist/web/assets/chunk-QZHKN3VN-DwSXwtjH.js +1 -0
  37. package/dist/web/assets/chunk-R5LLSJPH-euR2RxLN.js +1 -0
  38. package/dist/web/assets/chunk-WL4C6EOR-_2CBOJdI.js +189 -0
  39. package/dist/web/assets/chunk-XIRO2GV7-kqQ0g6wW.js +1 -0
  40. package/dist/web/assets/chunk-XPW4576I-CtcaMb09.js +32 -0
  41. package/dist/web/assets/chunk-XZSTWKYB-BYxFzZwS.js +94 -0
  42. package/dist/web/assets/chunk-YBOYWFTD-Dx_fX35n.js +1 -0
  43. package/dist/web/assets/classDiagram-VBA2DB6C-BpJ6Oog2.js +1 -0
  44. package/dist/web/assets/classDiagram-v2-RAHNMMFH-Bj8gIhkP.js +1 -0
  45. package/dist/web/assets/clone-BSi6cgDh.js +1 -0
  46. package/dist/web/assets/code-editor-os78eUN8.js +1 -0
  47. package/dist/web/assets/columns-2-ChOTgl3e.js +1 -0
  48. package/dist/web/assets/cose-bilkent-S5V4N54A-CHHjH2dV.js +1 -0
  49. package/dist/web/assets/cytoscape.esm-Ccan6xou.js +321 -0
  50. package/dist/web/assets/dagre-CNtSxiE_.js +1 -0
  51. package/dist/web/assets/dagre-KLK3FWXG-ChenfPp1.js +4 -0
  52. package/dist/web/assets/database-viewer-DTwe0h8F.js +1 -0
  53. package/dist/web/assets/defaultLocale-CRZydyG6.js +1 -0
  54. package/dist/web/assets/diagram-E7M64L7V-CzKYZM0Y.js +24 -0
  55. package/dist/web/assets/diagram-IFDJBPK2-ChB_paPo.js +43 -0
  56. package/dist/web/assets/diagram-P4PSJMXO-D1eW1dkL.js +24 -0
  57. package/dist/web/assets/diff-viewer-CSyOOmS2.js +4 -0
  58. package/dist/web/assets/dist-Cce3efmT.js +1 -0
  59. package/dist/web/assets/{dist-QgqOdSYG.js → dist-T0Vhi0Mh.js} +1 -1
  60. package/dist/web/assets/erDiagram-INFDFZHY-mCvUFSn6.js +70 -0
  61. package/dist/web/assets/flowDiagram-PKNHOUZH-14ohZ1M1.js +162 -0
  62. package/dist/web/assets/ganttDiagram-A5KZAMGK-DIX0pLbk.js +292 -0
  63. package/dist/web/assets/git-graph-CwYW3F4P.js +1 -0
  64. package/dist/web/assets/gitGraph-HDMCJU4V-CEee2FCA.js +1 -0
  65. package/dist/web/assets/gitGraphDiagram-K3NZZRJ6-yEWZbdf_.js +65 -0
  66. package/dist/web/assets/graphlib-DhOZxqsh.js +1 -0
  67. package/dist/web/assets/index-WKLuYsBY.css +2 -0
  68. package/dist/web/assets/index-yMR7OUDx.js +37 -0
  69. package/dist/web/assets/info-3K5VOQVL-ce_pi3En.js +1 -0
  70. package/dist/web/assets/infoDiagram-LFFYTUFH-BzqyoqXw.js +2 -0
  71. package/dist/web/assets/init-B8gtcn7T.js +1 -0
  72. package/dist/web/assets/input-Brjz2Vv-.js +41 -0
  73. package/dist/web/assets/isArrayLikeObject-B4pdpV8V.js +1 -0
  74. package/dist/web/assets/isEmpty-C0YYdhYj.js +1 -0
  75. package/dist/web/assets/ishikawaDiagram-PHBUUO56-olazD6dZ.js +70 -0
  76. package/dist/web/assets/journeyDiagram-4ABVD52K-CttDH9bb.js +139 -0
  77. package/dist/web/assets/jsx-runtime-BRW_vwa9.js +1 -0
  78. package/dist/web/assets/kanban-definition-K7BYSVSG-BBXbI37U.js +89 -0
  79. package/dist/web/assets/katex-Bbu770d9.js +265 -0
  80. package/dist/web/assets/keybindings-store-B-BLLKiZ.js +1 -0
  81. package/dist/web/assets/line-DBLLF7lH.js +1 -0
  82. package/dist/web/assets/linear-BLFWatDe.js +1 -0
  83. package/dist/web/assets/markdown-renderer-DQWY7QvX.js +69 -0
  84. package/dist/web/assets/math-DwgHI-Cu.js +1 -0
  85. package/dist/web/assets/mermaid-parser.core-BKiGOTjR.js +4 -0
  86. package/dist/web/assets/mindmap-definition-YRQLILUH-DoT7m4Sz.js +68 -0
  87. package/dist/web/assets/ordinal-CCj7PWgZ.js +1 -0
  88. package/dist/web/assets/packet-RMMSAZCW-CdYSLjRL.js +1 -0
  89. package/dist/web/assets/path-DZF-JdEe.js +1 -0
  90. package/dist/web/assets/pie-UPGHQEXC-Bm5LiD-6.js +1 -0
  91. package/dist/web/assets/pieDiagram-SKSYHLDU-Bkh2E4zE.js +30 -0
  92. package/dist/web/assets/postgres-viewer-Ctv7NTI_.js +1 -0
  93. package/dist/web/assets/preload-helper-qlgyTAkD.js +1 -0
  94. package/dist/web/assets/quadrantDiagram-337W2JSQ-B7zgALOL.js +7 -0
  95. package/dist/web/assets/radar-KQ55EAFF-C4PnyG7_.js +1 -0
  96. package/dist/web/assets/react-BGf7KNLk.js +1 -0
  97. package/dist/web/assets/react-nm2Ru1Pt.js +1 -0
  98. package/dist/web/assets/requirementDiagram-Z7DCOOCP-D_5GXNRo.js +73 -0
  99. package/dist/web/assets/rough.esm-VLpapkIG.js +1 -0
  100. package/dist/web/assets/sankeyDiagram-WA2Y5GQK-BA9EFAAe.js +10 -0
  101. package/dist/web/assets/sequenceDiagram-2WXFIKYE-fyWIrHiG.js +145 -0
  102. package/dist/web/assets/settings-store-Bbhg_ptG.js +2 -0
  103. package/dist/web/assets/settings-tab-Daap0c_B.js +1 -0
  104. package/dist/web/assets/sqlite-viewer-DtNk76CE.js +1 -0
  105. package/dist/web/assets/src-BoSBNdA_.js +1 -0
  106. package/dist/web/assets/stateDiagram-RAJIS63D-DfRBcaBu.js +1 -0
  107. package/dist/web/assets/stateDiagram-v2-FVOUBMTO-CMN4M2Em.js +1 -0
  108. package/dist/web/assets/{tab-store-NOBndc0_.js → tab-store-dpsCvqhH.js} +1 -1
  109. package/dist/web/assets/{table-B6neW6Hr.js → table-Yo02WRH-.js} +1 -1
  110. package/dist/web/assets/{tag-DJUYe5BQ.js → tag-CaC1ng2E.js} +1 -1
  111. package/dist/web/assets/{terminal-tab-0Y48dynP.js → terminal-tab-JEpjt3RD.js} +2 -2
  112. package/dist/web/assets/timeline-definition-YZTLITO2-DYfwJ1jM.js +61 -0
  113. package/dist/web/assets/treemap-KZPCXAKY-2_y-mhkz.js +1 -0
  114. package/dist/web/assets/{use-monaco-theme-DwP4EHdO.js → use-monaco-theme-DHbyUrzJ.js} +1 -1
  115. package/dist/web/assets/vennDiagram-LZ73GAT5-DqbKNRD9.js +34 -0
  116. package/dist/web/assets/xychartDiagram-JWTSCODW-DhUL86qT.js +7 -0
  117. package/dist/web/index.html +13 -11
  118. package/dist/web/sw.js +1 -1
  119. package/package.json +2 -1
  120. package/snapshot-state.md +1526 -0
  121. package/src/providers/claude-agent-sdk.ts +7 -0
  122. package/src/server/index.ts +25 -16
  123. package/src/server/routes/accounts.ts +3 -8
  124. package/src/services/account-selector.service.ts +52 -9
  125. package/src/services/fs-browse.service.ts +10 -7
  126. package/src/web/app.tsx +8 -0
  127. package/src/web/components/chat/account-dialogs.tsx +377 -0
  128. package/src/web/components/chat/message-list.tsx +196 -45
  129. package/src/web/components/chat/usage-badge.tsx +56 -20
  130. package/src/web/components/settings/settings-tab.tsx +2 -5
  131. package/src/web/components/shared/diagram-overlay.tsx +139 -0
  132. package/src/web/components/shared/image-overlay.tsx +45 -0
  133. package/src/web/components/shared/markdown-renderer.tsx +55 -2
  134. package/src/web/stores/diagram-overlay-store.ts +16 -0
  135. package/src/web/stores/image-overlay-store.ts +18 -0
  136. package/test-tokens.mjs +212 -0
  137. package/.claude.bak/agent-memory/tester/MEMORY.md +0 -3
  138. package/.claude.bak/agent-memory/tester/project-ppm-test-conventions.md +0 -32
  139. package/dist/web/assets/api-settings-D4bgXrLU.js +0 -1
  140. package/dist/web/assets/chat-tab-CgVh-OsO.js +0 -7
  141. package/dist/web/assets/code-editor-DgvZlpB7.js +0 -1
  142. package/dist/web/assets/columns-2-BZ5wv2wA.js +0 -1
  143. package/dist/web/assets/database-viewer-CRZksTo-.js +0 -1
  144. package/dist/web/assets/diff-viewer-CPNLuddT.js +0 -4
  145. package/dist/web/assets/git-graph-BCtMSQwB.js +0 -1
  146. package/dist/web/assets/index-CfSJP_Fv.css +0 -2
  147. package/dist/web/assets/index-DcJqqWbL.js +0 -37
  148. package/dist/web/assets/input-CE3bFwLk.js +0 -41
  149. package/dist/web/assets/jsx-runtime-wQxeESYQ.js +0 -1
  150. package/dist/web/assets/keybindings-store-C1HiSDRb.js +0 -1
  151. package/dist/web/assets/markdown-renderer-Ci7qz558.js +0 -59
  152. package/dist/web/assets/postgres-viewer-C8PRJ87B.js +0 -1
  153. package/dist/web/assets/react-CYzKIDNi.js +0 -1
  154. package/dist/web/assets/react-rgzL83kk.js +0 -1
  155. package/dist/web/assets/settings-store-DL2KEbtc.js +0 -2
  156. package/dist/web/assets/settings-tab-CqnP28Dq.js +0 -1
  157. package/dist/web/assets/sqlite-viewer-BSceyudC.js +0 -1
  158. /package/dist/web/assets/{utils-DC-bdPS3.js → utils-btZ8C8-R.js} +0 -0
@@ -0,0 +1,89 @@
1
+ import"./chunk-GEFDOKGD-DwVPiYfW.js";import{g as e,h as t}from"./src-BoSBNdA_.js";import{$ as n,K as r,L as i,Q as a,b as o,d as s,tt as c}from"./chunk-7R4GIKGN-DXaGAn_K.js";import{t as l}from"./chunk-HHEYEP7N-Dld5BpGB.js";import"./dist-Cce3efmT.js";import"./chunk-PU5JKC2W-B66ELkQm.js";import{t as u}from"./chunk-FMBD7UC4-C_1aG0eb.js";import"./chunk-YBOYWFTD-Dx_fX35n.js";import"./chunk-PQ6SQG4A-BxtUGYhW.js";import{a as d,c as f,i as p}from"./chunk-KYZI473N-BKO5gMeU.js";import{n as m,t as h}from"./chunk-XPW4576I-CtcaMb09.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,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,31],h=[6,7,11,24],g=[1,6,13,16,17,20,23],_=[1,35],v=[1,36],y=[1,6,7,11,13,16,17,20,23],b=[1,38],x={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`KANBAN`,11:`EOF`,13:`SPACELIST`,16:`ICON`,17:`CLASS`,20:`NODE_DSTART`,21:`NODE_DESCR`,22:`NODE_DEND`,23:`NODE_ID`,24:`SHAPE_DATA`},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,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],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-1].id),r.addNode(a[s-2].length,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 16:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 17:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 18:case 23:r.decorateNode({class:a[s]});break;case 19:r.getLogger().trace(`SPACELIST`);break;case 20:r.getLogger().trace(`Node: `,a[s-1].id),r.addNode(0,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 21:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 22:r.decorateNode({icon:a[s]});break;case 27: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 28:this.$={id:a[s],descr:a[s],type:0};break;case 29: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;case 30:this.$=a[s-1]+a[s];break;case 31:this.$=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,16:a,17:o,18:17,19:18,20:s,23: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,16:a,17:o,18:17,19:18,20:s,23:c},{6:r,9:22,12:11,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},{6:u,7:d,10:23,11:f},e(p,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:c}),e(p,[2,19]),e(p,[2,21],{15:30,24:m}),e(p,[2,22]),e(p,[2,23]),e(h,[2,25]),e(h,[2,26]),e(h,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:d,10:34,11:f},{1:[2,7],6:r,12:21,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},e(g,[2,14],{7:_,11:v}),e(y,[2,8]),e(y,[2,9]),e(y,[2,10]),e(p,[2,16],{15:37,24:m}),e(p,[2,17]),e(p,[2,18]),e(p,[2,20],{24:b}),e(h,[2,31]),{21:[1,39]},{22:[1,40]},e(g,[2,13],{7:_,11:v}),e(y,[2,11]),e(y,[2,12]),e(p,[2,15],{24:b}),e(h,[2,30]),{22:[1,41]},e(h,[2,27]),e(h,[2,29])],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
+ `+h.showPosition()+`
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`)};x.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
+ `+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()+`
5
+ `+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:t(function(e,t,n,r){switch(n){case 0:return this.pushState(`shapeData`),t.yytext=``,24;case 1:return this.pushState(`shapeDataStr`),24;case 2:return this.popState(),24;case 3:return t.yytext=t.yytext.replace(/\n\s*/g,`<br/>`),24;case 4:return 24;case 5:this.popState();break;case 6:return e.getLogger().trace(`Found comment`,t.yytext),6;case 7:return 8;case 8:this.begin(`CLASS`);break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:e.getLogger().trace(`Begin icon`),this.begin(`ICON`);break;case 12:return e.getLogger().trace(`SPACELINE`),6;case 13:return 7;case 14:return 16;case 15:e.getLogger().trace(`end icon`),this.popState();break;case 16:return e.getLogger().trace(`Exploding node`),this.begin(`NODE`),20;case 17:return e.getLogger().trace(`Cloud`),this.begin(`NODE`),20;case 18:return e.getLogger().trace(`Explosion Bang`),this.begin(`NODE`),20;case 19:return e.getLogger().trace(`Cloud Bang`),this.begin(`NODE`),20;case 20:return this.begin(`NODE`),20;case 21:return this.begin(`NODE`),20;case 22:return this.begin(`NODE`),20;case 23:return this.begin(`NODE`),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin(`NSTR2`);break;case 28:return`NODE_DESCR`;case 29:this.popState();break;case 30:e.getLogger().trace(`Starting NSTR`),this.begin(`NSTR`);break;case 31:return e.getLogger().trace(`description:`,t.yytext),`NODE_DESCR`;case 32:this.popState();break;case 33:return this.popState(),e.getLogger().trace(`node end ))`),`NODE_DEND`;case 34:return this.popState(),e.getLogger().trace(`node end )`),`NODE_DEND`;case 35:return this.popState(),e.getLogger().trace(`node end ...`,t.yytext),`NODE_DEND`;case 36:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 37:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 38:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 39:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 40:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 41:return e.getLogger().trace(`Long description:`,t.yytext),21;case 42:return e.getLogger().trace(`Long description:`,t.yytext),21}},`anonymous`),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}})();function S(){this.yy={}}return t(S,`Parser`),S.prototype=x,x.Parser=S,new S})();g.parser=g;var _=g,v=[],y=[],b=0,x={},S=t(()=>{v=[],y=[],b=0,x={}},`clear`),C=t(e=>{if(v.length===0)return null;let t=v[0].level,n=null;for(let e=v.length-1;e>=0;e--)if(v[e].level===t&&!n&&(n=v[e]),v[e].level<t)throw Error(`Items without section detected, found section ("`+v[e].label+`")`);return e===n?.level?null:n},`getSection`),w=t(function(){return y},`getSections`),T=t(function(){let e=[],t=[],n=w(),r=o();for(let e of n){let n={id:e.id,label:i(e.label??``,r),labelType:`markdown`,isGroup:!0,ticket:e.ticket,shape:`kanbanSection`,level:e.level,look:r.look};t.push(n);let a=v.filter(t=>t.parentId===e.id);for(let n of a){let a={id:n.id,parentId:e.id,label:i(n.label??``,r),labelType:`markdown`,isGroup:!1,ticket:n?.ticket,priority:n?.priority,assigned:n?.assigned,icon:n?.icon,shape:`kanbanItem`,level:n.level,rx:5,ry:5,cssStyles:[`text-align: left`]};t.push(a)}}return{nodes:t,edges:e,other:{},config:o()}},`getData`),E=t((e,t,n,r,a)=>{let c=o(),l=c.mindmap?.padding??s.mindmap.padding;switch(r){case D.ROUNDED_RECT:case D.RECT:case D.HEXAGON:l*=2}let u={id:i(t,c)||`kbn`+ b++,level:e,label:i(n,c),width:c.mindmap?.maxNodeWidth??s.mindmap.maxNodeWidth,padding:l,isGroup:!1};if(a!==void 0){let e;e=a.includes(`
7
+ `)?a+`
8
+ `:`{
9
+ `+a+`
10
+ }`;let t=m(e,{schema:h});if(t.shape&&(t.shape!==t.shape.toLowerCase()||t.shape.includes(`_`)))throw Error(`No such shape: ${t.shape}. Shape names should be lowercase.`);t?.shape&&t.shape===`kanbanItem`&&(u.shape=t?.shape),t?.label&&(u.label=t?.label),t?.icon&&(u.icon=t?.icon.toString()),t?.assigned&&(u.assigned=t?.assigned.toString()),t?.ticket&&(u.ticket=t?.ticket.toString()),t?.priority&&(u.priority=t?.priority)}let d=C(e);d?u.parentId=d.id||`kbn`+ b++:y.push(u),v.push(u)},`addNode`),D={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},O={clear:S,addNode:E,getSections:w,getData:T,nodeType:D,getType:t((t,n)=>{switch(e.debug(`In get type`,t,n),t){case`[`:return D.RECT;case`(`:return n===`)`?D.ROUNDED_RECT:D.CLOUD;case`((`:return D.CIRCLE;case`)`:return D.CLOUD;case`))`:return D.BANG;case`{{`:return D.HEXAGON;default:return D.DEFAULT}},`getType`),setElementForId:t((e,t)=>{x[e]=t},`setElementForId`),decorateNode:t(e=>{if(!e)return;let t=o(),n=v[v.length-1];e.icon&&(n.icon=i(e.icon,t)),e.class&&(n.cssClasses=i(e.class,t))},`decorateNode`),type2Str:t(e=>{switch(e){case D.DEFAULT:return`no-border`;case D.RECT:return`rect`;case D.ROUNDED_RECT:return`rounded-rect`;case D.CIRCLE:return`circle`;case D.CLOUD:return`cloud`;case D.BANG:return`bang`;case D.HEXAGON:return`hexgon`;default:return`no-border`}},`type2Str`),getLogger:t(()=>e,`getLogger`),getElementById:t(e=>x[e],`getElementById`)},k={draw:t(async(t,n,i,a)=>{e.debug(`Rendering kanban diagram
11
+ `+t);let c=a.db.getData(),u=o();u.htmlLabels=!1;let m=l(n),h=m.append(`g`);h.attr(`class`,`sections`);let g=m.append(`g`);g.attr(`class`,`items`);let _=c.nodes.filter(e=>e.isGroup),v=0,y=[],b=25;for(let e of _){let t=u?.kanban?.sectionWidth||200;v+=1,e.x=t*v+(v-1)*10/2,e.width=t,e.y=0,e.height=t*3,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+` section-`+v;let n=await p(h,e);b=Math.max(b,n?.labelBBox?.height),y.push(n)}let x=0;for(let e of _){let t=y[x];x+=1;let n=u?.kanban?.sectionWidth||200,r=-n*3/2+b,i=r,a=c.nodes.filter(t=>t.parentId===e.id);for(let t of a){if(t.isGroup)throw Error(`Groups within groups are not allowed in Kanban diagrams`);t.x=e.x,t.width=n-1.5*10;let r=(await d(g,t,{config:u})).node().getBBox();t.y=i+r.height/2,await f(t),i=t.y+r.height/2+10/2}let o=t.cluster.select(`rect`),s=Math.max(i-r+30,50)+(b-25);o.attr(`height`,s)}r(void 0,m,u.mindmap?.padding??s.kanban.padding,u.mindmap?.useMaxWidth??s.kanban.useMaxWidth)},`draw`)},A=t(e=>{let r=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e[`lineColor`+t]=e[`lineColor`+t]||e[`cScaleInv`+t],c(e[`lineColor`+t])?e[`lineColor`+t]=n(e[`lineColor`+t],20):e[`lineColor`+t]=a(e[`lineColor`+t],20);let i=t((t,r)=>e.darkMode?a(t,r):n(t,r),`adjuster`);for(let t=0;t<e.THEME_COLOR_LIMIT;t++){let n=``+(17-3*t);r+=`
12
+ .section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path {
13
+ fill: ${i(e[`cScale`+t],10)};
14
+ stroke: ${i(e[`cScale`+t],10)};
15
+
16
+ }
17
+ .section-${t-1} text {
18
+ fill: ${e[`cScaleLabel`+t]};
19
+ }
20
+ .node-icon-${t-1} {
21
+ font-size: 40px;
22
+ color: ${e[`cScaleLabel`+t]};
23
+ }
24
+ .section-edge-${t-1}{
25
+ stroke: ${e[`cScale`+t]};
26
+ }
27
+ .edge-depth-${t-1}{
28
+ stroke-width: ${n};
29
+ }
30
+ .section-${t-1} line {
31
+ stroke: ${e[`cScaleInv`+t]} ;
32
+ stroke-width: 3;
33
+ }
34
+
35
+ .disabled, .disabled circle, .disabled text {
36
+ fill: lightgray;
37
+ }
38
+ .disabled text {
39
+ fill: #efefef;
40
+ }
41
+
42
+ .node rect,
43
+ .node circle,
44
+ .node ellipse,
45
+ .node polygon,
46
+ .node path {
47
+ fill: ${e.background};
48
+ stroke: ${e.nodeBorder};
49
+ stroke-width: 1px;
50
+ }
51
+
52
+ .kanban-ticket-link {
53
+ fill: ${e.background};
54
+ stroke: ${e.nodeBorder};
55
+ text-decoration: underline;
56
+ }
57
+ `}return r},`genSections`),j={db:O,renderer:k,parser:_,styles:t(e=>`
58
+ .edge {
59
+ stroke-width: 3;
60
+ }
61
+ ${A(e)}
62
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
63
+ fill: ${e.git0};
64
+ }
65
+ .section-root text {
66
+ fill: ${e.gitBranchLabel0};
67
+ }
68
+ .icon-container {
69
+ height:100%;
70
+ display: flex;
71
+ justify-content: center;
72
+ align-items: center;
73
+ }
74
+ .edge {
75
+ fill: none;
76
+ }
77
+ .cluster-label, .label {
78
+ color: ${e.textColor};
79
+ fill: ${e.textColor};
80
+ }
81
+ .kanban-label {
82
+ dy: 1em;
83
+ alignment-baseline: middle;
84
+ text-anchor: middle;
85
+ dominant-baseline: middle;
86
+ text-align: center;
87
+ }
88
+ ${u()}
89
+ `,`getStyles`)};export{j as diagram};