@moonshot-ai/kimi-code 0.20.1 → 0.20.2

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 (73) hide show
  1. package/dist/main.mjs +6949 -6621
  2. package/dist-web/assets/CodeBlockNode-Cj5GCBwy.js +22 -0
  3. package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-DPPhMZ1J.js → CodeBlockShell.vue_vue_type_style_index_0_lang-BZQYvYGg.js} +1 -1
  4. package/dist-web/assets/{Tooltip-D4SNb85I.js → Tooltip-FXn3ewBz.js} +1 -1
  5. package/dist-web/assets/{arc-ByMO5pI7.js → arc---yONsFG.js} +1 -1
  6. package/dist-web/assets/{architectureDiagram-3BPJPVTR-Dvmwtelo.js → architectureDiagram-3BPJPVTR-Cu5NFSbj.js} +1 -1
  7. package/dist-web/assets/{blockDiagram-GPEHLZMM-lDGeez1y.js → blockDiagram-GPEHLZMM-eAkllecr.js} +1 -1
  8. package/dist-web/assets/{c4Diagram-AAUBKEIU-BpX1rFb4.js → c4Diagram-AAUBKEIU-BcJyf2yX.js} +1 -1
  9. package/dist-web/assets/channel-BTxFVrej.js +1 -0
  10. package/dist-web/assets/{chunk-2J33WTMH-jodlcE5W.js → chunk-2J33WTMH-DzpuDCg4.js} +1 -1
  11. package/dist-web/assets/{chunk-4BX2VUAB-BrZvBuhT.js → chunk-4BX2VUAB-DPF55Xbc.js} +1 -1
  12. package/dist-web/assets/{chunk-55IACEB6-BMZITsHm.js → chunk-55IACEB6-Ct2k4oQF.js} +1 -1
  13. package/dist-web/assets/{chunk-727SXJPM-Cmhtbm26.js → chunk-727SXJPM-DcWnL_ZJ.js} +1 -1
  14. package/dist-web/assets/{chunk-AQP2D5EJ-yt2A8pJF.js → chunk-AQP2D5EJ-2N1ZTMho.js} +1 -1
  15. package/dist-web/assets/{chunk-FMBD7UC4-C5EABTZN.js → chunk-FMBD7UC4-jNBVe-u1.js} +1 -1
  16. package/dist-web/assets/{chunk-ND2GUHAM-CVMSNFBB.js → chunk-ND2GUHAM-BTBgmjVQ.js} +1 -1
  17. package/dist-web/assets/{chunk-QZHKN3VN-F9qv3qjM.js → chunk-QZHKN3VN-xUCxw3pg.js} +1 -1
  18. package/dist-web/assets/classDiagram-4FO5ZUOK-B47dzfoS.js +1 -0
  19. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-B47dzfoS.js +1 -0
  20. package/dist-web/assets/{cose-bilkent-S5V4N54A-BTsTGLXV.js → cose-bilkent-S5V4N54A-ByEZXDA-.js} +1 -1
  21. package/dist-web/assets/{dagre-BM42HDAG-DrzkpEQT.js → dagre-BM42HDAG-BSfstE2-.js} +1 -1
  22. package/dist-web/assets/{diagram-2AECGRRQ-e1GfngTa.js → diagram-2AECGRRQ-CpI86-tI.js} +1 -1
  23. package/dist-web/assets/{diagram-5GNKFQAL-ousok5qp.js → diagram-5GNKFQAL-B4WYOJbp.js} +1 -1
  24. package/dist-web/assets/{diagram-KO2AKTUF-DyZixoAA.js → diagram-KO2AKTUF-dmm87H0J.js} +1 -1
  25. package/dist-web/assets/{diagram-LMA3HP47-DYvup0AJ.js → diagram-LMA3HP47-CAFHWRvJ.js} +1 -1
  26. package/dist-web/assets/{diagram-OG6HWLK6-DjeAOuOP.js → diagram-OG6HWLK6-CvbELbqm.js} +1 -1
  27. package/dist-web/assets/{erDiagram-TEJ5UH35-DW158lKF.js → erDiagram-TEJ5UH35-BATGAYdA.js} +1 -1
  28. package/dist-web/assets/{flowDiagram-I6XJVG4X-CNe29HBu.js → flowDiagram-I6XJVG4X-BjHCXPMa.js} +1 -1
  29. package/dist-web/assets/{ganttDiagram-6RSMTGT7-DNXeqbuv.js → ganttDiagram-6RSMTGT7-DyP4c3YT.js} +1 -1
  30. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-DxrQ7BFf.js → gitGraphDiagram-PVQCEYII-NzukZ15I.js} +1 -1
  31. package/dist-web/assets/index-BYnLiw5r.css +1 -0
  32. package/dist-web/assets/index-CCjot4qV.js +284 -0
  33. package/dist-web/assets/{index-CO3YU1Qs.js → index-Cfg9noDi.js} +2 -2
  34. package/dist-web/assets/{index-JMCtP-Ps.js → index-D4Er4P8I.js} +1 -1
  35. package/dist-web/assets/{index10-CgqlibfL.js → index10-C4yIRdle.js} +2 -2
  36. package/dist-web/assets/{index11-DEbZPqF_.js → index11-CqNiMTbJ.js} +2 -2
  37. package/dist-web/assets/{index5-6RR-0mhw.js → index5-DKdkj0GC.js} +1 -1
  38. package/dist-web/assets/{index6-Dd2WDK6a.js → index6-DsK3MiZT.js} +1 -1
  39. package/dist-web/assets/index7-DHshPD9x.js +1 -0
  40. package/dist-web/assets/index8-CeUCBmKU.js +2 -0
  41. package/dist-web/assets/{infoDiagram-5YYISTIA-bsQXw5Cf.js → infoDiagram-5YYISTIA-6n_F_-MA.js} +1 -1
  42. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-k8l6Qdjw.js → ishikawaDiagram-YF4QCWOH-CoaeNeqj.js} +1 -1
  43. package/dist-web/assets/{journeyDiagram-JHISSGLW-cYfBbMdz.js → journeyDiagram-JHISSGLW-Bi-m1_1y.js} +1 -1
  44. package/dist-web/assets/{kanban-definition-UN3LZRKU-CTnpueoW.js → kanban-definition-UN3LZRKU-DHxtNMaD.js} +1 -1
  45. package/dist-web/assets/katex-DnlPpQZa.js +257 -0
  46. package/dist-web/assets/{linear-CdKUj4Ug.js → linear-CgHyf5UH.js} +1 -1
  47. package/dist-web/assets/{mermaid.core-UWDZO4h_.js → mermaid.core-CtXm064v.js} +4 -4
  48. package/dist-web/assets/{mhchem-KEf2LMH_.js → mhchem-DtR62fUK.js} +1 -1
  49. package/dist-web/assets/{mindmap-definition-RKZ34NQL-3z79U-lX.js → mindmap-definition-RKZ34NQL-ClpCUmIA.js} +1 -1
  50. package/dist-web/assets/{pieDiagram-4H26LBE5-CMDgRqd9.js → pieDiagram-4H26LBE5-DvYtw1Bp.js} +1 -1
  51. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-DX1F2ToM.js → quadrantDiagram-W4KKPZXB-Dle7c6-0.js} +1 -1
  52. package/dist-web/assets/{requirementDiagram-4Y6WPE33-DoWnnNLY.js → requirementDiagram-4Y6WPE33--X5AnAhp.js} +1 -1
  53. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-ClNy2w1_.js → sankeyDiagram-5OEKKPKP-BUszdT9f.js} +1 -1
  54. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-BfJgBlpQ.js → sequenceDiagram-3UESZ5HK-CDwqGrfV.js} +1 -1
  55. package/dist-web/assets/{stateDiagram-AJRCARHV-KaDNy_Jo.js → stateDiagram-AJRCARHV-Kmd6YXse.js} +1 -1
  56. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CvgWdsVg.js +1 -0
  57. package/dist-web/assets/{timeline-definition-PNZ67QCA-DaKQHHIC.js → timeline-definition-PNZ67QCA-o-RAswWS.js} +1 -1
  58. package/dist-web/assets/{vennDiagram-CIIHVFJN-Cw9sx89s.js → vennDiagram-CIIHVFJN-DljQ_s6w.js} +1 -1
  59. package/dist-web/assets/{vue.runtime.esm-bundler-DNelV8ct.js → vue.runtime.esm-bundler-BP7sjueK.js} +1 -1
  60. package/dist-web/assets/{wardley-L42UT6IY-fWMnczak.js → wardley-L42UT6IY-CW9wuVhK.js} +1 -1
  61. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-Bi8Phs9U.js → wardleyDiagram-YWT4CUSO-Bh0wtRMV.js} +1 -1
  62. package/dist-web/assets/{xychartDiagram-2RQKCTM6-DR3dlDte.js → xychartDiagram-2RQKCTM6-BAjJ0sMH.js} +1 -1
  63. package/dist-web/index.html +2 -2
  64. package/package.json +2 -2
  65. package/dist-web/assets/CodeBlockNode-Ds9FDojm.js +0 -22
  66. package/dist-web/assets/channel-CFIWdU7V.js +0 -1
  67. package/dist-web/assets/classDiagram-4FO5ZUOK-HfSWUU5X.js +0 -1
  68. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-HfSWUU5X.js +0 -1
  69. package/dist-web/assets/index-Dv5UmLv8.css +0 -1
  70. package/dist-web/assets/index-uGnch3Jw.js +0 -273
  71. package/dist-web/assets/index7-DhrSWRIG.js +0 -1
  72. package/dist-web/assets/index8-C1M9n-68.js +0 -2
  73. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BGR-zf4G.js +0 -1
@@ -1,4 +1,4 @@
1
- import{s as ei,g as si,q as Lt,p as ni,a as ai,b as ri,_ as a,l as Et,I as oi,e as hi,z as li,D as dt,i as ci,F as It,G as ui,K as gi,am as xi,a9 as Tt}from"./mermaid.core-UWDZO4h_.js";import{i as di}from"./init-Gi6I4Gst.js";import{o as fi}from"./ordinal-Cboi1Yqb.js";import{l as Dt}from"./linear-CdKUj4Ug.js";import"./index-uGnch3Jw.js";import"./defaultLocale-DX6XiGOO.js";function pi(t,i,e){t=+t,i=+i,e=(n=arguments.length)<2?(i=t,t=0,1):n<3?1:+e;for(var s=-1,n=Math.max(0,Math.ceil((i-t)/e))|0,g=new Array(n);++s<n;)g[s]=t+s*e;return g}function lt(){var t=fi().unknown(void 0),i=t.domain,e=t.range,s=0,n=1,g,c,p=!1,k=0,v=0,P=.5;delete t.unknown;function S(){var m=i().length,E=n<s,D=E?n:s,L=E?s:n;g=(L-D)/Math.max(1,m-k+v*2),p&&(g=Math.floor(g)),D+=(L-D-g*(m-k))*P,c=g*(1-k),p&&(D=Math.round(D),c=Math.round(c));var I=pi(m).map(function(f){return D+g*f});return e(E?I.reverse():I)}return t.domain=function(m){return arguments.length?(i(m),S()):i()},t.range=function(m){return arguments.length?([s,n]=m,s=+s,n=+n,S()):[s,n]},t.rangeRound=function(m){return[s,n]=m,s=+s,n=+n,p=!0,S()},t.bandwidth=function(){return c},t.step=function(){return g},t.round=function(m){return arguments.length?(p=!!m,S()):p},t.padding=function(m){return arguments.length?(k=Math.min(1,v=+m),S()):k},t.paddingInner=function(m){return arguments.length?(k=Math.min(1,m),S()):k},t.paddingOuter=function(m){return arguments.length?(v=+m,S()):v},t.align=function(m){return arguments.length?(P=Math.max(0,Math.min(1,m)),S()):P},t.copy=function(){return lt(i(),[s,n]).round(p).paddingInner(k).paddingOuter(v).align(P)},di.apply(S(),arguments)}var ct=(function(){var t=a(function(F,o,l,u){for(l=l||{},u=F.length;u--;l[F[u]]=o);return l},"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],n=[1,5],g=[1,6],c=[1,7],p=[1,5,10,12,14,16,18,19,21,23,34,35,36],k=[1,25],v=[1,26],P=[1,28],S=[1,29],m=[1,30],E=[1,31],D=[1,32],L=[1,33],I=[1,34],f=[1,35],R=[1,36],h=[1,37],W=[1,43],O=[1,42],X=[1,47],Y=[1,50],C=[1,10,12,14,16,18,19,21,23,34,35,36],U=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],y=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],A=[1,64],V={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(o,l,u,x,w,r,Q){var d=r.length-1;switch(w){case 5:x.setOrientation(r[d]);break;case 9:x.setDiagramTitle(r[d].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[d]);break;case 13:x.setLineData(r[d-1],r[d]);break;case 14:x.setBarData({text:"",type:"text"},r[d]);break;case 15:x.setBarData(r[d-1],r[d]);break;case 16:this.$=r[d].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[d].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[d-1];break;case 20:this.$=[Number(r[d-2]),...r[d]];break;case 21:this.$=[Number(r[d])];break;case 22:x.setXAxisTitle(r[d]);break;case 23:x.setXAxisTitle(r[d-1]);break;case 24:x.setXAxisTitle({type:"text",text:""});break;case 25:x.setXAxisBand(r[d]);break;case 26:x.setXAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 27:this.$=r[d-1];break;case 28:this.$=[r[d-2],...r[d]];break;case 29:this.$=[r[d]];break;case 30:x.setYAxisTitle(r[d]);break;case 31:x.setYAxisTitle(r[d-1]);break;case 32:x.setYAxisTitle({type:"text",text:""});break;case 33:x.setYAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 37:this.$={text:r[d],type:"text"};break;case 38:this.$={text:r[d],type:"text"};break;case 39:this.$={text:r[d],type:"markdown"};break;case 40:this.$=r[d];break;case 41:this.$=r[d-1]+""+r[d];break}},"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,34:n,35:g,36:c}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,34:n,35:g,36:c}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:g,36:c}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(p,[2,34]),t(p,[2,35]),t(p,[2,36]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,34:n,35:g,36:c}),{1:[2,3]},t(p,[2,5]),t(i,[2,7],{4:22,34:n,35:g,36:c}),{11:23,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h},{11:39,13:38,24:W,27:O,29:40,30:41,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h},{11:45,15:44,27:X,33:46,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h},{11:49,17:48,24:Y,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h},{11:52,17:51,24:Y,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h},{20:[1,53]},{22:[1,54]},t(C,[2,18]),{1:[2,2]},t(C,[2,8]),t(C,[2,9]),t(U,[2,37],{40:55,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h}),t(U,[2,38]),t(U,[2,39]),t(y,[2,40]),t(y,[2,42]),t(y,[2,43]),t(y,[2,44]),t(y,[2,45]),t(y,[2,46]),t(y,[2,47]),t(y,[2,48]),t(y,[2,49]),t(y,[2,50]),t(y,[2,51]),t(C,[2,10]),t(C,[2,22],{30:41,29:56,24:W,27:O}),t(C,[2,24]),t(C,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h},t(C,[2,11]),t(C,[2,30],{33:60,27:X}),t(C,[2,32]),{31:[1,61]},t(C,[2,12]),{17:62,24:Y},{25:63,27:A},t(C,[2,14]),{17:65,24:Y},t(C,[2,16]),t(C,[2,17]),t(y,[2,41]),t(C,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(C,[2,31]),{27:[1,69]},t(C,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(C,[2,15]),t(C,[2,26]),t(C,[2,27]),{11:59,32:72,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h},t(C,[2,33]),t(C,[2,19]),{25:73,27:A},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(o,l){if(l.recoverable)this.trace(o);else{var u=new Error(o);throw u.hash=l,u}},"parseError"),parse:a(function(o){var l=this,u=[0],x=[],w=[null],r=[],Q=this.table,d="",tt=0,St=0,Zt=2,_t=1,Jt=r.slice.call(arguments,1),T=Object.create(this.lexer),$={yy:{}};for(var at in this.yy)Object.prototype.hasOwnProperty.call(this.yy,at)&&($.yy[at]=this.yy[at]);T.setInput(o,$.yy),$.yy.lexer=T,$.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var rt=T.yylloc;r.push(rt);var ti=T.options&&T.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ii(B){u.length=u.length-2*B,w.length=w.length-B,r.length=r.length-B}a(ii,"popStack");function kt(){var B;return B=x.pop()||T.lex()||_t,typeof B!="number"&&(B instanceof Array&&(x=B,B=x.pop()),B=l.symbols_[B]||B),B}a(kt,"lex");for(var M,q,z,ot,G={},it,N,Rt,et;;){if(q=u[u.length-1],this.defaultActions[q]?z=this.defaultActions[q]:((M===null||typeof M>"u")&&(M=kt()),z=Q[q]&&Q[q][M]),typeof z>"u"||!z.length||!z[0]){var ht="";et=[];for(it in Q[q])this.terminals_[it]&&it>Zt&&et.push("'"+this.terminals_[it]+"'");T.showPosition?ht="Parse error on line "+(tt+1)+`:
1
+ import{s as ei,g as si,q as Lt,p as ni,a as ai,b as ri,_ as a,l as Et,I as oi,e as hi,z as li,D as dt,i as ci,F as It,G as ui,K as gi,am as xi,a9 as Tt}from"./mermaid.core-CtXm064v.js";import{i as di}from"./init-Gi6I4Gst.js";import{o as fi}from"./ordinal-Cboi1Yqb.js";import{l as Dt}from"./linear-CgHyf5UH.js";import"./index-CCjot4qV.js";import"./defaultLocale-DX6XiGOO.js";function pi(t,i,e){t=+t,i=+i,e=(n=arguments.length)<2?(i=t,t=0,1):n<3?1:+e;for(var s=-1,n=Math.max(0,Math.ceil((i-t)/e))|0,g=new Array(n);++s<n;)g[s]=t+s*e;return g}function lt(){var t=fi().unknown(void 0),i=t.domain,e=t.range,s=0,n=1,g,c,p=!1,k=0,v=0,P=.5;delete t.unknown;function S(){var m=i().length,E=n<s,D=E?n:s,L=E?s:n;g=(L-D)/Math.max(1,m-k+v*2),p&&(g=Math.floor(g)),D+=(L-D-g*(m-k))*P,c=g*(1-k),p&&(D=Math.round(D),c=Math.round(c));var I=pi(m).map(function(f){return D+g*f});return e(E?I.reverse():I)}return t.domain=function(m){return arguments.length?(i(m),S()):i()},t.range=function(m){return arguments.length?([s,n]=m,s=+s,n=+n,S()):[s,n]},t.rangeRound=function(m){return[s,n]=m,s=+s,n=+n,p=!0,S()},t.bandwidth=function(){return c},t.step=function(){return g},t.round=function(m){return arguments.length?(p=!!m,S()):p},t.padding=function(m){return arguments.length?(k=Math.min(1,v=+m),S()):k},t.paddingInner=function(m){return arguments.length?(k=Math.min(1,m),S()):k},t.paddingOuter=function(m){return arguments.length?(v=+m,S()):v},t.align=function(m){return arguments.length?(P=Math.max(0,Math.min(1,m)),S()):P},t.copy=function(){return lt(i(),[s,n]).round(p).paddingInner(k).paddingOuter(v).align(P)},di.apply(S(),arguments)}var ct=(function(){var t=a(function(F,o,l,u){for(l=l||{},u=F.length;u--;l[F[u]]=o);return l},"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],n=[1,5],g=[1,6],c=[1,7],p=[1,5,10,12,14,16,18,19,21,23,34,35,36],k=[1,25],v=[1,26],P=[1,28],S=[1,29],m=[1,30],E=[1,31],D=[1,32],L=[1,33],I=[1,34],f=[1,35],R=[1,36],h=[1,37],W=[1,43],O=[1,42],X=[1,47],Y=[1,50],C=[1,10,12,14,16,18,19,21,23,34,35,36],U=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],y=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],A=[1,64],V={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(o,l,u,x,w,r,Q){var d=r.length-1;switch(w){case 5:x.setOrientation(r[d]);break;case 9:x.setDiagramTitle(r[d].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[d]);break;case 13:x.setLineData(r[d-1],r[d]);break;case 14:x.setBarData({text:"",type:"text"},r[d]);break;case 15:x.setBarData(r[d-1],r[d]);break;case 16:this.$=r[d].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[d].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[d-1];break;case 20:this.$=[Number(r[d-2]),...r[d]];break;case 21:this.$=[Number(r[d])];break;case 22:x.setXAxisTitle(r[d]);break;case 23:x.setXAxisTitle(r[d-1]);break;case 24:x.setXAxisTitle({type:"text",text:""});break;case 25:x.setXAxisBand(r[d]);break;case 26:x.setXAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 27:this.$=r[d-1];break;case 28:this.$=[r[d-2],...r[d]];break;case 29:this.$=[r[d]];break;case 30:x.setYAxisTitle(r[d]);break;case 31:x.setYAxisTitle(r[d-1]);break;case 32:x.setYAxisTitle({type:"text",text:""});break;case 33:x.setYAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 37:this.$={text:r[d],type:"text"};break;case 38:this.$={text:r[d],type:"text"};break;case 39:this.$={text:r[d],type:"markdown"};break;case 40:this.$=r[d];break;case 41:this.$=r[d-1]+""+r[d];break}},"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,34:n,35:g,36:c}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,34:n,35:g,36:c}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:g,36:c}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(p,[2,34]),t(p,[2,35]),t(p,[2,36]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,34:n,35:g,36:c}),{1:[2,3]},t(p,[2,5]),t(i,[2,7],{4:22,34:n,35:g,36:c}),{11:23,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h},{11:39,13:38,24:W,27:O,29:40,30:41,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h},{11:45,15:44,27:X,33:46,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h},{11:49,17:48,24:Y,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h},{11:52,17:51,24:Y,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h},{20:[1,53]},{22:[1,54]},t(C,[2,18]),{1:[2,2]},t(C,[2,8]),t(C,[2,9]),t(U,[2,37],{40:55,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h}),t(U,[2,38]),t(U,[2,39]),t(y,[2,40]),t(y,[2,42]),t(y,[2,43]),t(y,[2,44]),t(y,[2,45]),t(y,[2,46]),t(y,[2,47]),t(y,[2,48]),t(y,[2,49]),t(y,[2,50]),t(y,[2,51]),t(C,[2,10]),t(C,[2,22],{30:41,29:56,24:W,27:O}),t(C,[2,24]),t(C,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h},t(C,[2,11]),t(C,[2,30],{33:60,27:X}),t(C,[2,32]),{31:[1,61]},t(C,[2,12]),{17:62,24:Y},{25:63,27:A},t(C,[2,14]),{17:65,24:Y},t(C,[2,16]),t(C,[2,17]),t(y,[2,41]),t(C,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(C,[2,31]),{27:[1,69]},t(C,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(C,[2,15]),t(C,[2,26]),t(C,[2,27]),{11:59,32:72,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:I,48:f,49:R,50:h},t(C,[2,33]),t(C,[2,19]),{25:73,27:A},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(o,l){if(l.recoverable)this.trace(o);else{var u=new Error(o);throw u.hash=l,u}},"parseError"),parse:a(function(o){var l=this,u=[0],x=[],w=[null],r=[],Q=this.table,d="",tt=0,St=0,Zt=2,_t=1,Jt=r.slice.call(arguments,1),T=Object.create(this.lexer),$={yy:{}};for(var at in this.yy)Object.prototype.hasOwnProperty.call(this.yy,at)&&($.yy[at]=this.yy[at]);T.setInput(o,$.yy),$.yy.lexer=T,$.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var rt=T.yylloc;r.push(rt);var ti=T.options&&T.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ii(B){u.length=u.length-2*B,w.length=w.length-B,r.length=r.length-B}a(ii,"popStack");function kt(){var B;return B=x.pop()||T.lex()||_t,typeof B!="number"&&(B instanceof Array&&(x=B,B=x.pop()),B=l.symbols_[B]||B),B}a(kt,"lex");for(var M,q,z,ot,G={},it,N,Rt,et;;){if(q=u[u.length-1],this.defaultActions[q]?z=this.defaultActions[q]:((M===null||typeof M>"u")&&(M=kt()),z=Q[q]&&Q[q][M]),typeof z>"u"||!z.length||!z[0]){var ht="";et=[];for(it in Q[q])this.terminals_[it]&&it>Zt&&et.push("'"+this.terminals_[it]+"'");T.showPosition?ht="Parse error on line "+(tt+1)+`:
2
2
  `+T.showPosition()+`
3
3
  Expecting `+et.join(", ")+", got '"+(this.terminals_[M]||M)+"'":ht="Parse error on line "+(tt+1)+": Unexpected "+(M==_t?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(ht,{text:T.match,token:this.terminals_[M]||M,line:T.yylineno,loc:rt,expected:et})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+M);switch(z[0]){case 1:u.push(M),w.push(T.yytext),r.push(T.yylloc),u.push(z[1]),M=null,St=T.yyleng,d=T.yytext,tt=T.yylineno,rt=T.yylloc;break;case 2:if(N=this.productions_[z[1]][1],G.$=w[w.length-N],G._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},ti&&(G._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),ot=this.performAction.apply(G,[d,St,tt,$.yy,z[1],w,r].concat(Jt)),typeof ot<"u")return ot;N&&(u=u.slice(0,-1*N*2),w=w.slice(0,-1*N),r=r.slice(0,-1*N)),u.push(this.productions_[z[1]][0]),w.push(G.$),r.push(G._$),Rt=Q[u[u.length-2]][u[u.length-1]],u.push(Rt);break;case 3:return!0}}return!0},"parse")},_=(function(){var F={EOF:1,parseError:a(function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},"parseError"),setInput:a(function(o,l){return this.yy=l||this.yy||{},this._input=o,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:a(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:a(function(o){var l=o.length,u=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),u.length-1&&(this.yylineno-=u.length-1);var w=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:u?(u.length===x.length?this.yylloc.first_column:0)+x[x.length-u.length].length-u[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(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:a(function(o){this.unput(this.match.slice(o))},"less"),pastInput:a(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
@@ -26,8 +26,8 @@
26
26
  })();
27
27
  </script>
28
28
  <title>Kimi Code Web</title>
29
- <script type="module" crossorigin src="/assets/index-uGnch3Jw.js"></script>
30
- <link rel="stylesheet" crossorigin href="/assets/index-Dv5UmLv8.css">
29
+ <script type="module" crossorigin src="/assets/index-CCjot4qV.js"></script>
30
+ <link rel="stylesheet" crossorigin href="/assets/index-BYnLiw5r.css">
31
31
  </head>
32
32
  <body>
33
33
  <div id="app"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moonshot-ai/kimi-code",
3
- "version": "0.20.1",
3
+ "version": "0.20.2",
4
4
  "description": "The Starting Point for Next-Gen Agents",
5
5
  "license": "MIT",
6
6
  "author": "Moonshot AI",
@@ -67,8 +67,8 @@
67
67
  "yazl": "^3.3.1",
68
68
  "zod": "^4.3.6",
69
69
  "@moonshot-ai/acp-adapter": "^0.3.1",
70
- "@moonshot-ai/kimi-code-oauth": "^0.2.2",
71
70
  "@moonshot-ai/kimi-code-sdk": "^0.10.1",
71
+ "@moonshot-ai/kimi-code-oauth": "^0.2.2",
72
72
  "@moonshot-ai/kimi-telemetry": "^0.1.1",
73
73
  "@moonshot-ai/kimi-web": "^0.1.2",
74
74
  "@moonshot-ai/migration-legacy": "^0.1.14",
@@ -1,22 +0,0 @@
1
- import{bR as Vl,ci as Jl,bQ as fl,M as vl,bl as Gl,af as ll,bZ as Yl,c0 as ml,aU as L,bT as Kl,bE as U,az as Ql,c1 as ol,c2 as Xl,aI as pl,aL as je,s as Pn,bk as pt,cj as il,u as rl,I as Zl,A as eo,bJ as Cn,aY as at,bL as no,v as T,aw as ut,au as Bn,t as dt,bB as to,bb as ht,q as g,ck as lo,c4 as oo,c5 as io,c7 as ro,a0 as ao,c3 as al,aD as uo,bO as so,T as co,as as ne,b$ as fo,cl as vo}from"./index-uGnch3Jw.js";import{i as V,t as mo}from"./safeRaf-DGuzXxDK.js";import{V as po}from"./CodeBlockShell.vue_vue_type_style_index_0_lang-DPPhMZ1J.js";var xn=(k,w,C)=>new Promise((i,ue)=>{var xe=P=>{try{J(C.next(P))}catch(O){ue(O)}},_=P=>{try{J(C.throw(P))}catch(O){ue(O)}},J=P=>P.done?i(P.value):Promise.resolve(P.value).then(xe,_);J((C=C.apply(k,w)).next())});let ul=!1,rn=null,an=null,st=!1,un=null;function ho(){return xn(this,null,function*(){if(un)return un;un=xn(null,null,function*(){if(!an){if(st)return null;try{if(an=(function(k){const w=k;if(typeof w?.useMonaco=="function")return w;const C=k?.default;return typeof C?.useMonaco=="function"?C:null})(yield Vl(()=>import("./__vite-optional-peer-dep_stream-monaco_markstream-vue-BIHI7g3E.js"),[])),!an)return st=!0,null}catch{return st=!0,null}}try{return yield(function(k){return xn(this,null,function*(){return ul?void 0:rn||(rn=xn(null,null,function*(){const C=globalThis?.MonacoEnvironment;C&&(typeof C.getWorker=="function"||typeof C.getWorkerUrl=="function")||typeof k?.preloadMonacoWorkers!="function"||(yield k.preloadMonacoWorkers()),ul=!0}).finally(()=>{rn=null}),rn)})})(an),Jl(),an}catch{return null}});try{return yield un}finally{un=null}})}var yo=Object.defineProperty,go=Object.defineProperties,wo=Object.getOwnPropertyDescriptors,dl=Object.getOwnPropertySymbols,bo=Object.prototype.hasOwnProperty,So=Object.prototype.propertyIsEnumerable,sl=(k,w,C)=>w in k?yo(k,w,{enumerable:!0,configurable:!0,writable:!0,value:C}):k[w]=C,H=(k,w)=>{for(var C in w||(w={}))bo.call(w,C)&&sl(k,C,w[C]);if(dl)for(var C of dl(w))So.call(w,C)&&sl(k,C,w[C]);return k},ve=(k,w)=>go(k,wo(w)),N=(k,w,C)=>new Promise((i,ue)=>{var xe=P=>{try{J(C.next(P))}catch(O){ue(O)}},_=P=>{try{J(C.throw(P))}catch(O){ue(O)}},J=P=>P.done?i(P.value):Promise.resolve(P.value).then(xe,_);J((C=C.apply(k,w)).next())});const ko={class:"html-preview-frame__header"},Co={class:"html-preview-frame__title"},xo={class:"html-preview-frame__label"},Mo=["sandbox","srcdoc"],Po=fl(vl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(k){const w=k,C=import.meta!==void 0&&!1;let i=null;const{t:ue}=ml(),xe=g(()=>{const P=w.code||"",O=P.trim().toLowerCase();return O.startsWith("<!doctype")||O.startsWith("<html")||O.startsWith("<body")?P:`<!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <style>
7
- html, body {
8
- margin: 0;
9
- padding: 0;
10
- height: 100%;
11
- background-color: ${w.isDark?"#020617":"#ffffff"};
12
- color: ${w.isDark?"#e5e7eb":"#020617"};
13
- }
14
- body {
15
- font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;
16
- }
17
- </style>
18
- </head>
19
- <body>
20
- ${P}
21
- </body>
22
- </html>`}),_=g(()=>{return P=w.htmlPreviewSandbox,O=w.htmlPreviewAllowScripts,typeof P=="string"?((function(we){if(!C||typeof console>"u"||i===we)return;const G=(function(b){return new Set(b.trim().toLowerCase().split(/\s+/).filter(Boolean))})(we);G.has("allow-scripts")&&G.has("allow-same-origin")&&(i=we,console.warn("[markstream-vue] htmlPreviewSandbox contains both allow-scripts and allow-same-origin. Use this only for fully trusted content served from an isolated origin."))})(P),P):P!==void 0?"":O===!0?"allow-scripts":"";var P,O});function J(P){var O;P.key!=="Escape"&&P.key!=="Esc"||(O=w.onClose)==null||O.call(w)}return uo(()=>{typeof window<"u"&&window.addEventListener("keydown",J)}),pl(()=>{typeof window<"u"&&window.removeEventListener("keydown",J)}),(P,O)=>(je(),Pn(co,{to:"body"},[T("div",{class:Bn(["markstream-vue",{dark:w.isDark}])},[T("div",{class:"html-preview-frame__backdrop",onClick:O[2]||(O[2]=we=>{var G;return(G=w.onClose)==null?void 0:G.call(w)})},[T("div",{class:"html-preview-frame",onClick:O[1]||(O[1]=so(()=>{},["stop"]))},[T("div",ko,[T("div",Co,[O[3]||(O[3]=T("span",{class:"html-preview-frame__dot"},null,-1)),T("span",xo,ht(w.title||pt(ue)("common.preview")||"Preview"),1)]),T("button",{type:"button",class:"html-preview-frame__close",onClick:O[0]||(O[0]=we=>{var G;return(G=w.onClose)==null?void 0:G.call(w)})}," × ")]),T("iframe",{class:"html-preview-frame__iframe",sandbox:_.value,referrerpolicy:"no-referrer",srcdoc:xe.value},null,8,Mo)])])],2)]))}}),[["__scopeId","data-v-24e66176"]]);let Ae=null,ct=null,dn=null,Ie=null,ft=null,vt=null;const mt=new WeakMap;let Bo=0;const Eo=["data-markstream-enhanced","data-markstream-pending"],Oo={class:"code-header-main"},Lo=["innerHTML"],Fo={class:"code-header-copy"},$o={class:"code-header-title"},Ho={key:0,class:"code-header-caption"},No={class:"code-editor-layer"},cl="__markstreamMonacoPassiveTouchState__",Mn=1.5,Wo=fl(vl({__name:"CodeBlockNode",props:{node:{},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},theme:{},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isShowPreview:{type:Boolean,default:!0},monacoOptions:{},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},customId:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},estimatedHeightPx:{},estimatedContentHeightPx:{}},emits:["previewCode","copy"],setup(k,{emit:w}){var C;const i=k,ue=w,xe=Gl(),_=ll(Yl,null),J=ll("markstreamHostScrollManaged",null),P=g(()=>fo(i,xe)),O=ao(),we=g(()=>{const e=O?.vnode.props;return!(!e||!e.onPreviewCode&&!e.onPreviewCode)}),{t:G}=ml(),b=L(null),me=L(null),En=L(!1),de=L(Yt(i.node.language,i.node.code,Gt())),pe=g(()=>lo(de.value)),yt=g(()=>pe.value==="plaintext"),se=L(!1),be=L(!1),te=L(!1),Me=L(!1),ie=L(!1),qe=L(!1);let F=!1,$e=null,Se="";const Pe=L(null),Be=L(null);let sn=0,On=0;const hl=Kl(),Ue=L(null),re=L(typeof window>"u");typeof window<"u"&&U(()=>me.value,e=>{var n;if((n=Ue.value)==null||n.destroy(),Ue.value=null,!e)return void(re.value=!1);const t=hl(e,{rootMargin:"400px"});Ue.value=t,re.value=t.isVisible.value,t.whenVisible.then(()=>{re.value=!0})},{immediate:!0}),Ql(()=>{var e;F=!0,(function(){const n=Se;_&&n&&(Se="",_.markSettled(n))})(),(e=Ue.value)==null||e.destroy(),Ue.value=null});let le=null,cn=null,fn=()=>{},vn=()=>{},Ve=()=>null,Y=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),z=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),Ln=()=>{},Je=()=>{},Fn=()=>{},he=null,Ge=null,gt=()=>{var e;return String((e=i.node.language)!=null?e:"plaintext")},$n=()=>N(null,null,function*(){}),wt=!1;const He=[],Hn=[];let ye=null;function mn(e){var n;return((n=String(e??"").trim().split(/\s+/,1)[0])!=null?n:"")==="diff"}const f=g(()=>{var e;return i.node.diff===!0||mn(i.node.language)||mn(lt(String((e=i.node.raw)!=null?e:"")))}),Ee=L({removed:0,added:0}),yl=g(()=>`-${Ee.value.removed} +${Ee.value.added}`),Ye=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5}),bt=Object.freeze(ve(H({},Ye),{enabled:!1,revealLineCount:0}));function Nn(e){var n;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const t=e;return ve(H(H({},Ye),t),{enabled:(n=t.enabled)==null||n})}return H({},Ye)}function St(e){var n,t,l;if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const o=e.renderSideBySideInlineBreakpoint,a=typeof o=="number"&&Number.isFinite(o)?o:900,d=((t=(n=me.value)==null?void 0:n.getBoundingClientRect)==null?void 0:t.call(n).width)||((l=me.value)==null?void 0:l.clientWidth)||(typeof window>"u"?0:window.innerWidth);return d>0&&d<=a}function zn(e,n){return{original:pn(e,!1),updated:pn(n,!1)}}function pn(e,n){const t=String(e??"");return n?t:t.replace(/\r\n$|\n$|\r$/,"")}function Ke(e){var n;return String((n=e?.message)!=null?n:e).includes("no diff result available")}function Ne(){try{const e=Fn();e&&typeof e.catch=="function"&&e.catch(n=>{Ke(n)})}catch(e){Ke(e)}}const A=g(()=>{var e,n,t,l;const o=i.monacoOptions?H({},i.monacoOptions):{};if(!f.value)return o;const a=o.diffHideUnchangedRegions===void 0?H({},Ye):Nn(o.diffHideUnchangedRegions),d=o.hideUnchangedRegions===void 0?void 0:Nn(o.hideUnchangedRegions),r=i.stream!==!1&&i.loading!==!1,u=r?H({},bt):a,c=r?H({},bt):d,s=(function(v){return v.diffWordWrap!==void 0?v.diffWordWrap:"off"})(o),m=H({},(e=o.experimental)!=null?e:{}),h=(n=o.diffUnchangedRegionStyle)!=null?n:"line-info",y=(function(v){if(!St(v))return;const x=v.scrollbar&&typeof v.scrollbar=="object"?v.scrollbar:{};return ve(H({},x),{horizontal:"hidden",horizontalScrollbarSize:0})})(o),p={maxComputationTime:0,diffAlgorithm:"legacy",ignoreTrimWhitespace:!1,renderIndicators:!0,diffUpdateThrottleMs:120,renderLineHighlight:"none",renderLineHighlightOnlyWhenFocus:!0,selectionHighlight:!1,occurrencesHighlight:"off",matchBrackets:"never",lineDecorationsWidth:4,lineNumbersMinChars:2,glyphMargin:!1,minimap:{enabled:!1},renderOverviewRuler:!1,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollBeyondLastLine:!1,diffWordWrap:s,renderSideBySide:(t=o.renderSideBySide)==null||t,diffHideUnchangedRegions:u,useInlineViewWhenSpaceIsLimited:(l=o.useInlineViewWhenSpaceIsLimited)!=null&&l,diffLineStyle:"background",diffAppearance:"auto",diffUnchangedRegionStyle:h,diffHunkActionsOnHover:!1,experimental:m};return H(ve(H(ve(H(H({},p),o),{experimental:m}),c===void 0?{}:{hideUnchangedRegions:c}),{diffHideUnchangedRegions:u,diffWordWrap:s}),y===void 0?{}:{scrollbar:y})}),kt=g(()=>f.value?"diff":"single"),gl=L(kt.value),ze=L(!1),I=L(!1),Te=L(!1),K=L(!1),Q=L(!1);let Qe=null;const wl=g(()=>{var e,n,t;if(f.value){const o=(e=A.value)==null?void 0:e.diffWordWrap;if(o==="inherit"){const a=(n=i.monacoOptions)==null?void 0:n.wordWrap;return a==null||String(a)!=="off"}return o==="on"}const l=(t=i.monacoOptions)==null?void 0:t.wordWrap;return l==null||String(l)!=="off"}),hn=g(()=>{var e;return!!f.value&&St((e=A.value)!=null?e:{})});function Ct(e){return J?.value===!0||!!e&&(!!e.closest('[data-markstream-virtual-timeline="1"], .markstream-virtual-timeline')||!!e.closest(".vue-recycle-scroller, [data-virtualizer], [data-virtual-scroll-root]"))}const xt=g(()=>Ct(me.value)),ge=g(()=>!ze.value&&(!!Te.value||(f.value||xt.value||!vo())&&!I.value)),Mt=g(()=>ge.value||K.value),bl=g(()=>ge.value&&!K.value),Sl=g(()=>!ze.value&&!Te.value&&(ge.value||K.value||Q.value)),yn=L(!1),Xe=g(()=>pn(i.node.code,i.node.loading===!0)),Pt=g(()=>f.value?i.node.diff===!0?i.node:ve(H({},i.node),{diff:!0}):Xe.value===i.node.code?i.node:ve(H({},i.node),{code:Xe.value}));typeof window<"u"&&N(null,null,function*(){try{const e=yield ho();if(F)return;if(!e)return void(ze.value=!0);const n=e.useMonaco,t=e.detectLanguage;if(typeof t=="function"&&(gt=t),typeof n=="function"){const l=on();if(l&&i.themes&&Array.isArray(i.themes)&&!i.themes.includes(l))throw new Error("Preferred theme not in provided themes array");ye=tl();const o=n(ye);le=o.createEditor||le,cn=o.createDiffEditor||cn,fn=o.updateCode||fn,vn=o.updateDiff||vn,Ve=o.getEditor||Ve,Y=o.getEditorView||Y,z=o.getDiffEditorView||z,Ln=o.cleanupEditor||Ln,Je=o.safeClean||o.cleanupEditor||Je,Fn=o.refreshDiffPresentation||Fn,$n=o.setTheme||$n,qe.value=!0,!F&&b.value&&(yield Re(b.value))}}catch{if(F)return;ze.value=!0}});const X=L(typeof((C=i.monacoOptions)==null?void 0:C.fontSize)=="number"?i.monacoOptions.fontSize:Number.NaN),$=L(X.value),Tn=L(null),gn=L(null),kl=g(()=>{const e=X.value,n=$.value;return typeof e=="number"&&Number.isFinite(e)&&e>0&&typeof n=="number"&&Number.isFinite(n)&&n>0}),Dn=g(()=>{var e;const n=Tn.value;if(typeof n=="number"&&Number.isFinite(n)&&n>0)return n;const t=(e=i.monacoOptions)==null?void 0:e.fontSize;if(typeof t=="number"&&Number.isFinite(t)&&t>0)return t;const l=$.value;return typeof l=="number"&&Number.isFinite(l)&&l>0?l:12}),Bt=g(()=>{var e;const n=gn.value;if(typeof n=="number"&&Number.isFinite(n)&&n>0)return n;const t=(e=i.monacoOptions)==null?void 0:e.lineHeight;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:Dn.value===12?18:Math.max(12,Math.round(1.5*Dn.value))}),Wn=g(()=>Bt.value);function Et(e){const n=String(e??"");return n?Math.max(1,n.split(/\r\n|\n|\r/).length):1}function Ot(e){return e.startsWith("-")&&!e.startsWith("---")}function Lt(e){return e.startsWith("+")&&!e.startsWith("+++")}function Ft(e){var n;const t=e.some(o=>Ot(o)),l=e.some(o=>Lt(o));return t&&l||mn(i.node.language)&&(t||l)||mn(lt(String((n=i.node.raw)!=null?n:"")))&&(t||l)}const Cl=g(()=>hn.value?(function(){var e,n,t;const l=String((e=i.node.code)!=null?e:"").split(/\r\n|\n|\r/);if(Ft(l))return Math.max(1,l.length);const o=String((n=i.node.originalCode)!=null?n:"").split(/\r\n|\n|\r/),a=String((t=i.node.updatedCode)!=null?t:"").split(/\r\n|\n|\r/);let d=0,r=o.length-1,u=a.length-1;for(;d<=r&&d<=u&&o[d]===a[d];)d++;let c=0;for(;r>=d&&u>=d&&o[r]===a[u];)c++,r--,u--;const s=Math.max(0,r-d+1),m=Math.max(0,u-d+1);return Math.max(1,d+s+m+c)})():(function(){var e;const n=String((e=i.node.code)!=null?e:"").split(/\r\n|\n|\r/);if(!Ft(n)&&(i.node.originalCode!=null||i.node.updatedCode!=null))return Math.max(Et(i.node.originalCode),Et(i.node.updatedCode));let t=0,l=0;for(const o of n)Ot(o)?t++:(Lt(o)||t++,l++);return Math.max(1,t,l)})()),xl=g(()=>{var e;const n=(e=i.monacoOptions)==null?void 0:e.tabSize;return typeof n=="number"&&Number.isFinite(n)&&n>0?n:4}),Rn=g(()=>{var e;const n=(e=i.monacoOptions)==null?void 0:e.padding;return{top:typeof n?.top=="number"&&Number.isFinite(n.top)&&n.top>0?n.top:0,bottom:typeof n?.bottom=="number"&&Number.isFinite(n.bottom)&&n.bottom>0?n.bottom:0}}),wn=g(()=>{const e=i.estimatedContentHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null});function bn(e){if(e==null)return null;const n=Math.ceil(e);return!Number.isFinite(n)||n<=0?null:Math.min(n,Math.ceil(We()))}const Ze=g(()=>f.value?Math.ceil(Cl.value*Wn.value):wn.value!=null?null:Math.ceil((e=>{const n=String(e??"");return n?Math.max(1,n.split(/\r\n|\n|\r/).length):1})(Xe.value)*(Bt.value+Mn)+1)),_n=g(()=>{if(f.value){const n=Ze.value,t=qn();return bn(t!=null&&n!=null?Math.max(n,t):t??n)}const e=wn.value;return bn(e??Ze.value)}),Ml=g(()=>{const e=i.estimatedHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}),An=L(null),In=L(null);function ke(){const e=An.value;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}function jn(){return f.value&&i.stream!==!1&&(i.loading!==!1||ge.value||K.value||Q.value)}function qn(){if(!jn())return null;const e=In.value;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}function $t(e){if(!jn()||e==null)return;const n=Math.min(Math.ceil(e),Math.ceil(We()));if(!Number.isFinite(n)||n<=0)return;const t=qn();In.value=t==null?n:Math.max(t,n)}const Un=g(()=>{const e=ke();return e??(ge.value||!I.value?_n.value:null)}),Pl=g(()=>{var e;const n=(e=i.monacoOptions)==null?void 0:e.fontFamily,t=bn(wn.value),l=bn(Ze.value),o=H(H({fontSize:`${Dn.value}px`,lineHeight:`${Wn.value}px`,tabSize:xl.value,boxSizing:"border-box",maxHeight:`${We()}px`,overflow:"auto",paddingTop:`${Rn.value.top}px`,paddingBottom:`${Rn.value.bottom}px`},f.value?(function(a){if(a==null)return{};const d=Math.ceil(a),r=Math.ceil(We()),u=Math.min(d,r);return d>=r?{height:`${u}px`,minHeight:`${u}px`}:{minHeight:`${d}px`}})(_n.value):t!=null?{height:`${t}px`,minHeight:`${t}px`}:l!=null?{minHeight:`${l}px`}:{}),typeof n=="string"&&n.trim()?{"--markstream-code-font-family":n.trim()}:{});return o["--markstream-pre-line-number-top"]=`${Rn.value.top}px`,o["--markstream-code-padding-left"]="62px",o["--markstream-pre-line-number-width"]="36px",o["--markstream-pre-line-number-gap"]="0px",f.value&&(o["--markstream-pre-diff-line-height"]=`${Wn.value}px`,o["--markstream-pre-diff-pane-bottom-padding"]="10px"),o}),Ht=g(()=>Un.value!=null&&(!I.value||ke()!=null)),Bl=g(()=>{const e=Un.value;if(e==null)return null;if(f.value)return Math.ceil(e);const n=Ml.value,t=wn.value;if(n==null||t==null)return Math.ceil(e);const l=Math.max(0,Math.ceil(n)-Math.ceil(t));return Math.ceil(e+l)}),El=g(()=>{if(f.value&&ge.value)return;const e=Un.value;return Ht.value&&e!=null?{minHeight:`${e}px`}:void 0});function Vn(){Qe!=null&&typeof window<"u"&&window.clearTimeout(Qe),Qe=null}function Nt(){if(!f.value||!ie.value||!I.value||K.value||Q.value)return!1;const e=b.value;return!!e&&At(e)}function zt(e,n=!1,t={}){const l=Math.ceil(e),o=ke();if(o==null)return l;const a=t.allowBelowEstimatedFloor===!0||Nt();return l>=o||a?((n||a)&&ie.value&&(An.value=null),l):o}function ce(){return new Promise(e=>{V(()=>e())})}function Tt(){try{const e=b.value;if(!e)return null;const n=e.querySelector(".view-lines .view-line");if(n){const t=Math.ceil(n.getBoundingClientRect().height);if(t>0)return t}}catch{}return null}function Jn(){var e,n,t,l,o;try{const a=f.value?(t=(n=(e=z())==null?void 0:e.getModifiedEditor)==null?void 0:n.call(e))!=null?t:z():Y(),d=Ve(),r=(l=d?.EditorOption)==null?void 0:l.fontInfo;if(a&&r!=null){const u=(o=a.getOption)==null?void 0:o.call(a,r),c=u?.fontSize;if(typeof c=="number"&&Number.isFinite(c)&&c>0)return c}}catch{}try{const a=b.value;if(a){const d=a.querySelector(".view-lines .view-line");if(d)try{if(typeof window<"u"&&typeof window.getComputedStyle=="function"){const r=window.getComputedStyle(d).fontSize,u=r&&r.match(/^(\d+(?:\.\d+)?)/);if(u)return Number.parseFloat(u[1])}}catch{}}}catch{}return null}function De(e){var n,t;try{const a=Ve(),d=(n=a?.EditorOption)==null?void 0:n.lineHeight;if(d!=null){const r=(t=e?.getOption)==null?void 0:t.call(e,d);if(typeof r=="number"&&r>0)return r}}catch{}const l=Tt();if(l&&l>0)return l;const o=Number.isFinite($.value)&&$.value>0?$.value:14;return Math.max(12,Math.round(1.35*o))}function Dt(e){var n,t,l;try{const r=Ve(),u=(n=r?.EditorOption)==null?void 0:n.padding;if(u!=null){const c=(t=e?.getOption)==null?void 0:t.call(e,u),s=typeof c?.top=="number"?c.top:0,m=typeof c?.bottom=="number"?c.bottom:0;if(s>0||m>0)return s+m}}catch{}const o=(l=A.value)==null?void 0:l.padding,a=typeof o?.top=="number"?o.top:0,d=typeof o?.bottom=="number"?o.bottom:0;return a>0||d>0?a+d:f.value?24:0}function Wt(e,n){return typeof e!="number"||typeof n!="number"||e<1||n<e?0:n-e+1}function Rt(e){if(!e)return[];const n=e.split(/\r?\n/);return n.length===1&&n[0]===""?[]:n}function Gn(){var e,n;f.value?Ee.value=(function(t,l){const o=Rt(t),a=Rt(l);let d=0,r=o.length-1,u=a.length-1;for(;d<=r&&d<=u&&o[d]===a[d];)d++;for(;r>=d&&u>=d&&o[r]===a[u];)r--,u--;return{removed:Math.max(0,r-d+1),added:Math.max(0,u-d+1)}})(String((e=i.node.originalCode)!=null?e:""),String((n=i.node.updatedCode)!=null?n:"")):Ee.value={removed:0,added:0}}function Oe(){var e;if(f.value)try{const n=z(),t=(e=n?.getLineChanges)==null?void 0:e.call(n);if(!Array.isArray(t))return void Gn();let l=0,o=0;for(const a of t)l+=Wt(a.originalStartLineNumber,a.originalEndLineNumber),o+=Wt(a.modifiedStartLineNumber,a.modifiedEndLineNumber);Ee.value={removed:l,added:o}}catch{Gn()}else Ee.value={removed:0,added:0}}function Yn(){var e;if(Number.isFinite($.value)&&$.value>0&&Number.isFinite(X.value))return $.value;const n=Jn();return typeof((e=i.monacoOptions)==null?void 0:e.fontSize)=="number"?(X.value=i.monacoOptions.fontSize,$.value=i.monacoOptions.fontSize,$.value):n&&n>0?(X.value=n,$.value=n,n):(X.value=12,$.value=12,12)}function Ol(){const e=Yn(),n=Math.min(36,e+1);$.value=n}function Ll(){const e=Yn(),n=Math.max(10,e-1);$.value=n}function Fl(){Yn(),Number.isFinite(X.value)&&($.value=X.value)}function _t(){var e,n,t,l,o,a,d,r,u,c,s,m,h,y;try{const p=f.value?z():null,v=f.value?p:Y();if(!v)return null;if(p?.getOriginalEditor&&p?.getModifiedEditor){const S=(e=p.getOriginalEditor)==null?void 0:e.call(p),E=(n=p.getModifiedEditor)==null?void 0:n.call(p);(t=S?.layout)==null||t.call(S),(l=E?.layout)==null||l.call(E);const M=((o=S?.getContentHeight)==null?void 0:o.call(S))||0,ae=((a=E?.getContentHeight)==null?void 0:a.call(E))||0,R=Math.max(M,ae);if(R>0)return Math.ceil(R+1);const ee=((u=(r=(d=S?.getModel)==null?void 0:d.call(S))==null?void 0:r.getLineCount)==null?void 0:u.call(r))||1,W=((m=(s=(c=E?.getModel)==null?void 0:c.call(E))==null?void 0:s.getLineCount)==null?void 0:m.call(s))||1,oe=Math.max(ee,W),rt=Math.max(De(S),De(E));return Math.ceil(oe*(rt+Mn)+0+1)}if(v?.getContentHeight){(h=v?.layout)==null||h.call(v);const S=v.getContentHeight();if(S>0)return Math.ceil(S+1)}const x=(y=v?.getModel)==null?void 0:y.call(v);let B=1;x&&typeof x.getLineCount=="function"&&(B=x.getLineCount());const D=De(v);return Math.ceil(B*(D+Mn)+0+1)}catch{return null}}function At(e){if(typeof window>"u")return!1;const n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return!1;const t=e.querySelectorAll(".editor.modified .diff-hidden-lines .center, .stream-monaco-diff-unchanged-bridge");for(const l of Array.from(t)){if(!(l instanceof HTMLElement))continue;const o=window.getComputedStyle(l);if(o.display==="none"||o.visibility==="hidden"||Number.parseFloat(o.opacity||"1")<=.01)continue;const a=l.getBoundingClientRect();if(!(a.width<=0||a.height<=0||a.bottom<=n.top||a.top>=n.bottom))return!0}return!1}function Kn(e){var n;const t=String(e??"").trim(),l=(n=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i))==null?void 0:n[1];if(l){const u=l.length===3?l.split("").map(c=>`${c}${c}`).join(""):l;return .2126*Number.parseInt(u.slice(0,2),16)+.7152*Number.parseInt(u.slice(2,4),16)+.0722*Number.parseInt(u.slice(4,6),16)}const o=t.match(/\d+(?:\.\d+)?/g);if(!o||o.length<3)return null;const[a,d,r]=o.slice(0,3).map(Number);return .2126*a+.7152*d+.0722*r}function It(){var e;const n=(e=b.value)==null?void 0:e.parentElement;return n instanceof HTMLElement?n:null}function en(e,n){var t;n==null||!Number.isFinite(n)||n<=0||(t=It())==null||t.style.setProperty(e,`${n}px`)}function Sn(){var e,n,t;if(jt())return;const l=Jn();l&&l>0&&(Tn.value=l,$.value=l,X.value=l);try{const o=De(f.value?(t=(n=(e=z())==null?void 0:e.getModifiedEditor)==null?void 0:n.call(e))!=null?t:z():Y());o&&o>0&&(gn.value=o)}catch{}try{const o=Tt();o&&o>0&&(gn.value=o)}catch{}}function jt(){return f.value&&Mt.value}function nn(){var e;if(!f.value||!ge.value&&!K.value&&!Q.value)return null;const n=b.value,t=(e=me.value)==null?void 0:e.querySelector("pre.code-pre-fallback");if(!n||!t)return null;const l=Math.ceil(t.getBoundingClientRect().height);return!Number.isFinite(l)||l<=0?null:(n.style.height=`${l}px`,n.style.minHeight=`${l}px`,n.style.maxHeight=`${Math.ceil(We())}px`,n.style.overflow="hidden",l)}function Qn(){var e,n,t,l,o,a,d,r;const u=b.value,c=me.value;if(!u||!c)return;const s=u,m=u.querySelector(".monaco-editor")||u,h=m.querySelector(".monaco-editor-background")||m,y=m.querySelector(".view-lines")||m;let p=null,v=null,x=null;try{typeof window<"u"&&typeof window.getComputedStyle=="function"&&(p=window.getComputedStyle(m),v=h===m?p:window.getComputedStyle(h),x=y===m?p:window.getComputedStyle(y))}catch{p=null,v=null,x=null}const B=String((e=p?.getPropertyValue("--vscode-editor-foreground"))!=null?e:"").trim(),D=String((n=p?.getPropertyValue("--vscode-editor-background"))!=null?n:"").trim(),S=String((l=(t=p?.getPropertyValue("--vscode-editor-selectionBackground"))!=null?t:p?.getPropertyValue("--vscode-editor-hoverHighlightBackground"))!=null?l:"").trim(),E=B||String((a=(o=x?.color)!=null?o:p?.color)!=null?a:"").trim(),M=D||String((r=(d=v?.backgroundColor)!=null?d:p?.backgroundColor)!=null?r:"").trim();return f.value?(E?(c.style.setProperty("--markstream-diff-editor-fg",E),s.style.setProperty("--vscode-editor-foreground",E),s.style.setProperty("--stream-monaco-editor-fg",E)):(c.style.removeProperty("--markstream-diff-editor-fg"),s.style.removeProperty("--vscode-editor-foreground"),s.style.removeProperty("--stream-monaco-editor-fg")),M?(c.style.setProperty("--markstream-diff-editor-bg",M),c.style.setProperty("--markstream-diff-panel-bg",M),c.style.setProperty("--markstream-diff-panel-bg-soft",M),c.style.setProperty("--markstream-diff-panel-bg-strong",M),s.style.setProperty("--vscode-editor-background",M),s.style.setProperty("--stream-monaco-editor-bg",M),s.style.setProperty("--stream-monaco-fixed-editor-bg",M),s.style.setProperty("--stream-monaco-panel-bg",M),s.style.setProperty("--stream-monaco-panel-bg-soft",M),s.style.setProperty("--stream-monaco-panel-bg-strong",M),s.style.backgroundColor=M):(c.style.removeProperty("--markstream-diff-editor-bg"),c.style.removeProperty("--markstream-diff-panel-bg"),c.style.removeProperty("--markstream-diff-panel-bg-soft"),c.style.removeProperty("--markstream-diff-panel-bg-strong"),s.style.removeProperty("--vscode-editor-background"),s.style.removeProperty("--stream-monaco-editor-bg"),s.style.removeProperty("--stream-monaco-fixed-editor-bg"),s.style.removeProperty("--stream-monaco-panel-bg"),s.style.removeProperty("--stream-monaco-panel-bg-soft"),s.style.removeProperty("--stream-monaco-panel-bg-strong"),s.style.backgroundColor=""),void(S?s.style.setProperty("--vscode-editor-selectionBackground",S):s.style.removeProperty("--vscode-editor-selectionBackground"))):(function(ae,R,ee){if(!yt.value)return!1;const W=Kn(ae),oe=Kn(R);return ee?W!=null&&W>170||oe!=null&&oe<110:W!=null&&W<85||oe!=null&&oe>190})(M,E,c.classList.contains("is-dark"))?(s.style.removeProperty("--vscode-editor-foreground"),s.style.removeProperty("--vscode-editor-background"),void s.style.removeProperty("--vscode-editor-selectionBackground")):(E&&s.style.setProperty("--vscode-editor-foreground",E),M&&s.style.setProperty("--vscode-editor-background",M),void(S&&s.style.setProperty("--vscode-editor-selectionBackground",S)))}let Xn=0,Zn=0;const qt=/auto|scroll|overlay/i;function fe(e,n,t){var l;if(typeof window>"u"||f.value||(function(s){return xt.value||Ct(s)})(e))return;const o=Math.ceil(n),a=Math.ceil(t)-o;if(Math.abs(a)<=1)return;const d=(function(s){var m,h;if(typeof window>"u")return null;const y=(m=s?.ownerDocument)!=null?m:document,p=y.scrollingElement||y.documentElement||y.body;let v=(h=s?.parentElement)!=null?h:null;for(;v&&v!==y.body&&v!==p;){const x=window.getComputedStyle(v),B=(x.overflowY||"").toLowerCase(),D=(x.overflow||"").toLowerCase();if(qt.test(B)||qt.test(D))return v;v=v.parentElement}return p})(e);if(!d)return;const r=(l=e.ownerDocument)!=null?l:document,u=d===r.body||d===r.documentElement||d===r.scrollingElement,c=u?0:d.getBoundingClientRect().top;e.getBoundingClientRect().top-c>=0||(u&&typeof window.scrollBy=="function"?window.scrollBy(0,a):d.scrollTop+=a)}function et(){try{const e=b.value;if(!e)return;const n=e.getBoundingClientRect().height,t=_t();if(t!=null&&t>0){const o=zt(t,!0),a=ke();return e.style.minHeight=a!=null?`${a}px`:"0px",e.style.height=`${o}px`,e.style.maxHeight="none",e.style.overflow="visible",void fe(e,n,o)}const l=ke();l!=null&&(e.style.minHeight=`${l}px`,e.style.height=`${l}px`,e.style.maxHeight="none",e.style.overflow="visible",fe(e,n,l))}catch{}}function tn(){for(var e,n;He.length>0;)try{(n=(e=He.pop())==null?void 0:e.dispose)==null||n.call(e)}catch{}$e!=null&&(mo($e),$e=null)}function Le(){for(var e;Hn.length>0;)try{(e=Hn.pop())==null||e()}catch{}}function j(e=!1){be.value||(se.value?et():(function(){var n;try{const t=b.value;if(!t)return;const l=t.getBoundingClientRect().height,o=We(),a=Math.ceil(((n=t.getBoundingClientRect)==null?void 0:n.call(t).height)||0),d=f.value?(function(){var v,x,B,D,S,E,M,ae;try{const R=z(),ee=(v=R?.getOriginalEditor)==null?void 0:v.call(R),W=(x=R?.getModifiedEditor)==null?void 0:x.call(R);if(!ee||!W)return null;const oe=((S=(D=(B=ee.getModel)==null?void 0:B.call(ee))==null?void 0:D.getLineCount)==null?void 0:S.call(D))||1,rt=((ae=(M=(E=W.getModel)==null?void 0:E.call(W))==null?void 0:M.getLineCount)==null?void 0:ae.call(M))||1,jl=Math.max(oe,rt),ql=Math.max(De(ee),De(W)),Ul=Math.max(Dt(ee),Dt(W));return Math.ceil(jl*(ql+Mn)+Ul+0+1)}catch{return null}})():null,r=f.value&&At(t),u=r&&ie.value&&I.value&&!K.value&&!Q.value;if(r||(Be.value=null),On>0&&(On--,Pe.value!=null))return void fe(t,l,Ce(t,Pe.value,o,{allowBelowEstimatedFloor:u}));if(f.value&&(ge.value||K.value||Q.value)){const v=nn();if(v!=null){const x=Ce(t,v,o,{allowBelowEstimatedFloor:!0});return ln(!0),void fe(t,l,x)}}const c=f.value?(function(v){var x,B;if(typeof window>"u")return null;try{const D=v.getBoundingClientRect(),S=window.getComputedStyle(v);if(S.display==="none"||S.visibility==="hidden")return null;const E=[".editor.original .view-lines .view-line",".editor.modified .view-lines .view-line",".editor.original .view-zones > div",".editor.modified .view-zones > div",".editor.original .margin-view-zones > div",".editor.modified .margin-view-zones > div",".editor.original .diff-hidden-lines",".editor.modified .diff-hidden-lines",".stream-monaco-diff-unchanged-bridge"];let M=0;for(const ee of Array.from(v.querySelectorAll(E.join(",")))){if(!(ee instanceof HTMLElement))continue;const W=window.getComputedStyle(ee);if(W.display==="none"||W.visibility==="hidden"||Number.parseFloat(W.opacity||"1")<=.01)continue;const oe=ee.getBoundingClientRect();oe.height<=0||oe.bottom<=D.top||(M=Math.max(M,oe.bottom-D.top))}if(M>0)return Math.ceil(M);const ae=v.querySelector(".monaco-diff-editor"),R=(B=(x=ae?.getBoundingClientRect)==null?void 0:x.call(ae).height)!=null?B:0;return R>0?Math.ceil(R+1):null}catch{return null}})(t):null,s=f.value&&hn.value&&!r&&c!=null?Math.ceil(c+10):c;let m;if(m=f.value?r?c:hn.value&&s!=null?s:d!=null?Math.max(s??0,d):s:_t(),m!=null&&m>0){const v=Be.value!=null&&Date.now()<sn&&m>=o-1,x=r&&a>0&&a<o-1&&m>=o-1,B=Ce(t,v?Be.value:x?a:m,o,{clearEstimatedFloor:!0,allowBelowEstimatedFloor:u});return r&&B<o-1&&(Be.value=B,sn=Date.now()+160),void fe(t,l,B)}if(Pe.value!=null)return void fe(t,l,Ce(t,Pe.value,o,{allowBelowEstimatedFloor:u}));const h=r?a:Math.max(a,d!=null&&d>0?d:0);if(h>0){const v=Be.value!=null&&Date.now()<sn&&h>=o-1,x=r&&a>0&&a<o-1&&h>=o-1,B=Ce(t,v?Be.value:x?a:h,o,{allowBelowEstimatedFloor:u});return r&&B<o-1&&(Be.value=B,sn=Date.now()+160),void fe(t,l,B)}const y=ke();if(y!=null)return void fe(t,l,Ce(t,y,o,{allowBelowEstimatedFloor:u}));const p=Number.parseFloat(t.style.height);!Number.isNaN(p)&&p>0?fe(t,l,Ce(t,p,o,{allowBelowEstimatedFloor:u})):f.value||fe(t,l,Ce(t,o,o))}catch{}})())}function Ut(){Xn=0,Zn=0}function ln(e=!1){var n,t,l;const o=b.value;if(!o)return;const a=f.value?z():Y();if(a&&typeof a.layout=="function")try{const d=(n=o.getBoundingClientRect)==null?void 0:n.call(o),r=Math.ceil(((t=d?.width)!=null?t:0)||o.clientWidth||0),u=Math.ceil(((l=d?.height)!=null?l:0)||o.clientHeight||Number.parseFloat(o.style.height||"")||0);if(r>0&&u>0){if(!e&&r===Xn&&u===Zn)return;Xn=r,Zn=u,a.layout({width:r,height:u})}else Ut(),a.layout()}catch{}}function Z(){if(!f.value)return void Le();const e=b.value;if(!e)return void Le();const n=e.querySelector(".monaco-diff-editor");if(!n||n.classList.contains("side-by-side"))return void Le();const t=Array.from(n.querySelectorAll(".editor.original .diff-hidden-lines")),l=Array.from(n.querySelectorAll(".editor.modified .diff-hidden-lines")),o=Math.min(t.length,l.length);for(let a=0;a<o;a++){const d=l[a],r=d.querySelector("a"),u=d.querySelector(".center > div:first-child"),c=d.querySelector(".center");if(!r||!u||!c||c.querySelector(".markstream-inline-fold-proxy"))continue;const s=document.createElement("button");s.type="button",s.className="markstream-inline-fold-proxy",s.dataset.markstreamInlineFoldProxy="true";const m=r.getAttribute("title")||"Show Unchanged Region";s.title=m,s.setAttribute("aria-label",m);const h=v=>{v.preventDefault(),v.stopPropagation()},y=v=>{v.preventDefault(),v.stopPropagation(),r.click(),V(()=>q())},p=v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),v.stopPropagation(),r.click(),V(()=>q()))};s.addEventListener("mousedown",h),s.addEventListener("click",y),s.addEventListener("keydown",p),c.appendChild(s),Hn.push(()=>{s.removeEventListener("mousedown",h),s.removeEventListener("click",y),s.removeEventListener("keydown",p),s.parentElement===c&&c.removeChild(s)})}}function q(e=!1){$e==null&&($e=V(()=>{$e=null,V(()=>{Z(),j(e),ln()})}))}function Ce(e,n,t,l={}){$t(n);const o=qn(),a=o!=null?Math.max(n,o):n,d=Math.min(a,t),r=l.allowBelowEstimatedFloor===!0||Nt(),u=zt(d,l.clearEstimatedFloor===!0,{allowBelowEstimatedFloor:r}),c=ke();if(e.style.minHeight=c==null||r?"0px":`${Math.min(c,Math.ceil(t))}px`,e.style.height=`${u}px`,e.style.maxHeight=`${Math.ceil(t)}px`,f.value)e.style.overflow="hidden";else{const s=a>t+1;e.style.overflow=s?"auto":"hidden"}return u}function Vt(e=b.value){return!!e?.querySelector(".monaco-diff-editor .view-lines .view-line")}function $l(){const e=z();return typeof e?.getOriginalEditor=="function"||typeof e?.getModifiedEditor=="function"||typeof e?.getLineChanges=="function"}function Jt(e,n,t){return N(this,null,function*(){try{return void(yield vn(e,n,t))}catch(l){if(!Ke(l))throw l}if(yield ne(),yield ce(),!F&&f.value)try{yield vn(e,n,t)}catch(l){if(!Ke(l))throw l}})}function We(){var e,n;const t=(n=(e=i.monacoOptions)==null?void 0:e.MAX_HEIGHT)!=null?n:500;if(typeof t=="number")return t;const l=String(t).match(/^(\d+(?:\.\d+)?)/);return l?Number.parseFloat(l[1]):500}const nt=g(()=>i.isShowPreview&&(de.value==="html"||de.value==="svg"));function Gt(){return typeof i.node.loading=="boolean"?i.node.loading:i.loading===!0}function Yt(e,n,t){return t&&!String(n??"")?"plain":ol(String(e??""))}function Kt(){var e,n,t,l;return!(!Gt()||(f.value?String((e=i.node.originalCode)!=null?e:"")||String((n=i.node.updatedCode)!=null?n:"")||String((t=i.node.code)!=null?t:""):String((l=i.node.code)!=null?l:"")))}U(()=>[i.node.language,i.node.code,i.node.loading,i.loading],([e,n,t,l])=>{de.value=Yt(e,n,typeof t=="boolean"?t:l===!0)}),U(()=>[i.node.originalCode,i.node.updatedCode,f.value],()=>{Gn(),V(()=>Oe())},{immediate:!0}),U(()=>[f.value,i.stream,i.loading,ge.value,K.value,Q.value,Ze.value],()=>{jn()?$t(Ze.value):In.value=null},{immediate:!0}),U(()=>[i.node.originalCode,i.node.updatedCode,pe.value,f.value],e=>N(null,[e],function*([,,,n]){var t,l;if(i.stream===!1||!n)return;if(le&&!te.value&&b.value)try{yield Re(b.value)}catch{}const o=Ge;if(o&&!Me.value){try{yield o}catch{}if(F||!f.value)return}const a=zn(String((t=i.node.originalCode)!=null?t:""),String((l=i.node.updatedCode)!=null?l:"")),d=i.loading===!1;d&&Fe();try{yield Jt(a.original,a.updated,pe.value),ln(!0)}catch{return}if(d){if(F||!f.value)return;Ne(),Z(),Oe(),q()}se.value&&V(()=>et())})),U(()=>i.node.code,e=>N(null,null,function*(){if(i.stream===!1||(de.value||(de.value=ol(gt(e))),f.value))return;const n=Ge;if(n&&!Me.value){try{yield n}catch{}if(F||f.value)return}if(le&&!te.value&&b.value)try{yield Re(b.value)}catch{}fn(pn(i.node.code,i.node.loading===!0),pe.value),se.value&&V(()=>et())}));const tt=g(()=>{const e=de.value;return e?al[e]||e.charAt(0).toUpperCase()+e.slice(1):al[""]});function lt(e){var n,t;const l=(t=(n=String(e??"").split(/\r?\n/,1)[0])==null?void 0:n.trim())!=null?t:"";if(l.length<3)return"";const o=l[0];if(o!=="`"&&o!=="~"||l[1]!==o||l[2]!==o)return"";let a=3;for(;l[a]===o;)a+=1;return l.slice(a).trim()}const Qt=g(()=>{var e;return(function(n){const t=lt(n);if(!t)return"";const l=t.split(/\s+/).filter(Boolean);if(!l.length)return"";const o=l[0]==="diff"?l.slice(1):l;for(const a of o){const d=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(d&&/[./\\-]/.test(d))return d}return""})(String((e=i.node.raw)!=null?e:""))}),Hl=g(()=>Qt.value||tt.value),Xt=g(()=>Qt.value?f.value?`Diff / ${tt.value}`:tt.value:""),Nl=g(()=>(oo.value,io(de.value||""))),zl=g(()=>{const e={},n=o=>{if(o!=null)return typeof o=="number"?`${o}px`:String(o)},t=n(i.minWidth),l=n(i.maxWidth);if(t&&(e.minWidth=t),l&&(e.maxWidth=l),Ht.value&&!f.value){const o=Bl.value;o!=null&&(e.minHeight=`${o}px`)}return f.value||(e.color="var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",e.backgroundColor="var(--vscode-editor-background, var(--markstream-code-fallback-bg))",e.borderColor="var(--markstream-code-border-color)"),e}),Zt=g(()=>i.showTooltips!==!1);function Tl(){return N(this,null,function*(){try{typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(i.node.code)),En.value=!0,ue("copy",i.node.code),setTimeout(()=>{En.value=!1},1e3)}catch(e){console.error("复制失败:",e)}})}function Dl(e){if(se.value=!se.value,e&&Zt.value){const l=(function(o){const a=o.currentTarget||o.target;return!a||a.disabled?null:a})(e);if(l){const o=se.value?G("common.collapse")||"Collapse":G("common.expand")||"Expand";ro(l,o,"top",!1,void 0,i.isDark)}}const n=f.value?z():Y(),t=b.value;n&&t&&(se.value?(kn(!0),t.style.maxHeight="none",t.style.overflow="visible",j(!0)):(kn(!1),t.style.overflow=f.value?"hidden":"auto",j(!0)))}function Wl(){var e,n,t;if(be.value=!be.value,be.value){if(b.value){const l=Math.ceil(((n=(e=b.value).getBoundingClientRect)==null?void 0:n.call(e).height)||0);l>0&&(Pe.value=l)}kn(!1)}else{se.value&&kn(!0),b.value&&Pe.value!=null&&(b.value.style.height=`${Pe.value}px`);const l=f.value?z():Y();try{(t=l?.layout)==null||t.call(l)}catch{}On=2,V(()=>{j(!0)})}}function Rl(){if(!nt.value)return;const e=de.value;if(we.value){const n=e==="html"?"text/html":"image/svg+xml",t=e==="html"?G("artifacts.htmlPreviewTitle")||"HTML Preview":G("artifacts.svgPreviewTitle")||"SVG Preview";return void ue("previewCode",{node:i.node,artifactType:n,artifactTitle:t,id:`temp-${e}-${Date.now()}`})}e==="html"&&(yn.value=!yn.value)}function kn(e){var n,t;try{if(f.value){const l=z();(n=l?.updateOptions)==null||n.call(l,{automaticLayout:e})}else{const l=Y();(t=l?.updateOptions)==null||t.call(l,{automaticLayout:e})}}catch{}}function Re(e){if(!le||F||Kt())return null;if(he)return he;if(te.value&&ie.value)return Promise.resolve();te.value=!0,(function(){const t=P.value;_&&t&&Se!==t&&(Se&&_.markSettled(Se),Se=t,_.markPending(t))})();const n=N(null,null,function*(){yield(function(t){return N(this,null,function*(){var l;if(typeof window>"u")return yield t();try{const o=(l=window.Element)==null?void 0:l.prototype,a=o?.addEventListener;if(!o||!a)return yield t();const d=(function(){const r=window,u=r[cl];if(u)return u;const c={depth:0,original:null};return r[cl]=c,c})();d.depth===0&&(d.original=a,o.addEventListener=function(r,u,c){var s;const m=(s=d.original)!=null?s:a;return r==="touchstart"&&(function(h,y){if(!h)return!1;const p=h;return!(typeof p.closest!="function"||!p.closest(".monaco-editor, .monaco-diff-editor")||y&&typeof y=="object"&&"passive"in y)})(this,c)?m.call(this,r,u,(function(h){return h==null?{passive:!0}:typeof h=="boolean"?{capture:h,passive:!0}:typeof h=="object"?"passive"in h?h:ve(H({},h),{passive:!0}):{passive:!0}})(c)):m.call(this,r,u,c)}),d.depth++;try{return yield t()}finally{d.depth=Math.max(0,d.depth-1),d.depth===0&&d.original&&o.addEventListener!==d.original&&(o.addEventListener=d.original,d.original=null)}}catch{return yield t()}})})(()=>(function(t){return N(this,null,function*(){var l;if(!le||F||(Te.value=!1,Me.value=!1,I.value=!1,K.value=!1,Q.value=!1,Vn(),Tn.value=null,gn.value=null,(function(){const r=It();r&&(r.style.removeProperty("--stream-monaco-line-number-left"),r.style.removeProperty("--stream-monaco-line-number-width"),r.style.removeProperty("--stream-monaco-line-number-gap-to-code"),r.style.removeProperty("--stream-monaco-original-line-number-gap-to-code"),r.style.removeProperty("--stream-monaco-modified-line-number-gap-to-code"),r.style.removeProperty("--stream-monaco-original-scrollable-left"),r.style.removeProperty("--stream-monaco-modified-scrollable-left"))})(),Ut(),(function(){const r=_n.value;An.value=ie.value||r==null?null:r})(),tn(),Le(),(function(r){r.replaceChildren()})(t),Fe(),F))return;const o=N(null,null,function*(){var r,u;if(f.value){(function(){if(wt||typeof window>"u")return;wt=!0;const s=m=>{var h;Ke("reason"in m?m.reason:(h=m.error)!=null?h:m.message)&&(m.preventDefault(),m.stopImmediatePropagation())};window.addEventListener("error",s,!0),window.addEventListener("unhandledrejection",s,!0)})(),Je();const c=zn(String((r=i.node.originalCode)!=null?r:""),String((u=i.node.updatedCode)!=null?u:""));cn?yield cn(t,c.original,c.updated,pe.value):yield le(t,i.node.code,pe.value)}else yield le(t,Xe.value,pe.value);Me.value=!0}),a=o.finally(()=>{Ge===a&&(Ge=null)});if(Ge=a,yield(function(r){return N(this,null,function*(){if(!f.value)return void(yield r);let u,c=!1;for(r.then(()=>{c=!0},s=>{c=!0,u=s});;){if(F)return;if(c){if(u)throw u;return}if(Vt()&&$l())return;yield ne(),yield ce()}})})(a),F)return;Me.value=!0;const d=f.value?z():Y();if(typeof((l=i.monacoOptions)==null?void 0:l.fontSize)=="number")d?.updateOptions({fontSize:i.monacoOptions.fontSize,automaticLayout:!1}),X.value=i.monacoOptions.fontSize,$.value=i.monacoOptions.fontSize;else if(!jt()){const r=Jn();r&&r>0?(X.value=r,$.value=r):(X.value=12,$.value=12)}Sn(),se.value||be.value||j(!1),yield(function(){return N(this,null,function*(){ke()!=null&&(Z(),j(!1),yield ne(),yield ce(),Z(),j(!1),yield ce(),Z(),j(!1))})})(),F||(ie.value=!0,(function(){var r,u,c,s,m;if(tn(),f.value){const y=z(),p=(r=y?.getOriginalEditor)==null?void 0:r.call(y),v=(u=y?.getModifiedEditor)==null?void 0:u.call(y),x=(B,D)=>{try{const S=B?.[D];if(typeof S!="function")return;const E=S.call(B,()=>q());E&&He.push(E)}catch{}};try{const B=(c=y?.onDidUpdateDiff)==null?void 0:c.call(y,()=>{q(),V(()=>Oe())});B&&He.push(B)}catch{}return x(p,"onDidContentSizeChange"),x(v,"onDidContentSizeChange"),x(p,"onDidLayoutChange"),void x(v,"onDidLayoutChange")}const h=Y();try{const y=(s=h?.onDidContentSizeChange)==null?void 0:s.call(h,()=>q());y&&He.push(y)}catch{}try{const y=(m=h?.onDidLayoutChange)==null?void 0:m.call(h,()=>q());y&&He.push(y)}catch{}})(),Qn(),Sn(),Z(),Oe(),q(),yield(function(){return N(this,null,function*(){Z(),j(!1),yield ne(),yield ce(),Z(),j(!1),yield ce(),Z(),j(!1)})})(),yield(function(){return N(this,null,function*(){var r;if(f.value){for(let u=0;u<8;u++){if(F)return;const c=b.value,s=z();let m=!1;try{const p=(r=s?.getLineChanges)==null?void 0:r.call(s);m=Array.isArray(p)}catch{m=!1}const h=!!c?.querySelector(".monaco-diff-editor"),y=Vt(c);if(h&&y&&m){if(yield ne(),yield ce(),F)return;try{Ne(),Z(),Oe(),q()}catch{}return}if(u>=1&&!h)return;yield ne(),yield ce()}if(!F)try{Ne(),Z(),Oe(),q()}catch{}}})})(),F||(Sn(),(function(){if(!f.value)return;const r=b.value;if(!r)return;const u=r.querySelector(".monaco-diff-editor");function c(s,m,h,y){const p=s.querySelector(m);if(!p)return;const v=p.getBoundingClientRect();if(v.width<=0)return;const x=p.querySelector(".line-numbers"),B=p.querySelector(".view-lines .view-line"),D=p.querySelector(".margin");let S=null;if(B?(S=B.getBoundingClientRect().left-v.left,en(h,S)):D&&(S=D.getBoundingClientRect().width,en(h,S)),x){const E=x.getBoundingClientRect();if(E.width>=20&&E.width<=64&&en("--stream-monaco-line-number-width",E.width),S!=null){const M=S-(E.right-v.left);Number.isFinite(M)&&M>=0&&M<=32&&(en(y,M),en("--stream-monaco-line-number-gap-to-code",M))}}}u&&(c(u,".editor.original","--stream-monaco-original-scrollable-left","--stream-monaco-original-line-number-gap-to-code"),c(u,".editor.modified","--stream-monaco-modified-scrollable-left","--stream-monaco-modified-line-number-gap-to-code"))})(),yield ne(),nn(),yield ce(),yield(function(){return N(this,null,function*(){if(f.value){if(nn(),K.value=!0,Q.value=!1,I.value=!0,yield ne(),nn(),yield ce(),nn(),!F){if(ln(!0),Q.value=!0,Vn(),typeof window>"u")return K.value=!1,void(Q.value=!1);Qe=window.setTimeout(()=>{Qe=null,K.value=!1,Q.value=!1,V(()=>{Sn(),Z(),q()})},120)}}else I.value=!0})})()))})})(e))}).finally(()=>{he===n&&(he=null),(function(){const t=Se;_&&t&&(Se="",ne(()=>{var l,o;if(!F){const a=(o=(l=me.value)==null?void 0:l.offsetHeight)!=null?o:0;a>0&&_.reportHeight(t,a)}_.markSettled(t)}))})()});return he=n,n}U(Zt,e=>{e||Xl()}),U(()=>$.value,(e,n)=>{const t=f.value?z():Y();t&&typeof e=="number"&&Number.isFinite(e)&&e>0&&(t.updateOptions({fontSize:e}),be.value||j(!0))},{flush:"post",immediate:!1});const _l=U(()=>[b.value,f.value,i.stream,i.loading,qe.value,re.value,i.node.code,i.node.loading],e=>N(null,[e],function*([n,t,l,o,a,d]){if(!n||!le||!d||l===!1&&o!==!1||Kt())return;const r=Re(n);if(r){try{yield r}catch{ie.value=!1,I.value=!1,Te.value=!0}_l()}}));function el(e){return!!e&&typeof e=="object"&&"light"in e&&"dark"in e}function _e(e){return typeof e=="string"?e:e&&typeof e=="object"&&"name"in e?String(e.name):null}function nl(e,n){if(e===n)return!0;const t=_e(e),l=_e(n);return!!t&&t===l}function on(){var e;const n=(function(){if(i.theme!==void 0){const u=i.theme;return el(u)?i.isDark?u.dark:u.light:u}return i.isDark?i.darkTheme:i.lightTheme})(),t=(e=A.value)==null?void 0:e.theme,l=n??t;if(l!=null&&typeof l=="object")return l;const o=Array.isArray(i.themes)?i.themes:[];if(!o.length||l==null)return l;const a=_e(l),d=o.map(u=>_e(u)).filter(u=>!!u);if(!a||d.includes(a))return l;const r=_e(t);return t!=null&&r&&d.includes(r)?t:o[0]}U(kt,(e,n)=>N(null,null,function*(){if(e===n||(gl.value=e,!le||!b.value)||!te.value||i.stream===!1&&i.loading!==!1||!re.value)return;const t=he;if(t){try{yield t}catch{}if(F||!b.value)return}try{ie.value=!1,I.value=!1,te.value=!1,Me.value=!1,tn(),Le(),Je(),yield ne(),yield Re(b.value)}catch{ie.value=!1,I.value=!1,Te.value=!0}}));const ot=g(()=>(i.theme!==void 0?!el(i.theme):nl(i.darkTheme,i.lightTheme))?(function(e){var n,t;if(e&&typeof e=="object"&&((n=e.colors)!=null&&n["editor.background"])){const o=Kn(e.colors["editor.background"]);if(o!=null)return o<128}const l=((t=_e(e))!=null?t:"").toLowerCase();return l?["dark","night","moon","black","dracula","mocha","frappe","macchiato","palenight","ocean","poimandres","monokai","laserwave","tokyo","slack-dark","rose-pine","github-dark","material-theme","one-dark","catppuccin-mocha","catppuccin-frappe","catppuccin-macchiato"].some(o=>l.includes(o))&&!["light","latte","dawn","lotus"].some(o=>l.includes(o)):!!i.isDark})(on()):!!i.isDark),it=g(()=>{var e;if(!f.value)return ot.value?"dark":"light";const n=(e=A.value)==null?void 0:e.diffAppearance;return n==="light"||n==="dark"?n:ot.value?"dark":"light"}),Al=g(()=>f.value?it.value==="dark":ot.value);function tl(){const e=ve(H(ve(H({wordWrap:"on",wrappingIndent:"same",themes:i.themes},A.value||{}),{theme:on()}),f.value?{diffAppearance:it.value}:{}),{onThemeChange(){Qn()}}),n=(function(){var t;const l=(t=A.value)==null?void 0:t.fontFamily;return typeof l=="string"&&l.trim()?l.trim():f.value?(function(){var o;if(typeof window>"u")return;const a=(o=me.value)==null?void 0:o.querySelector("pre.code-pre-fallback");if(a)return window.getComputedStyle(a).fontFamily.trim()||void 0})():void 0})();return n&&(e.fontFamily!=null||(e.fontFamily=n)),e}function Fe(){const e=tl();if(!ye)return ye=e,ye;for(const n of Object.keys(ye))n in e||delete ye[n];return Object.assign(ye,e),ye}const Il=g(()=>{var e,n,t,l,o,a,d,r,u,c,s,m,h,y,p;return JSON.stringify({diffLineStyle:(n=(e=A.value)==null?void 0:e.diffLineStyle)!=null?n:"background",diffUnchangedRegionStyle:(l=(t=A.value)==null?void 0:t.diffUnchangedRegionStyle)!=null?l:"line-info",diffHideUnchangedRegions:((o=i.monacoOptions)==null?void 0:o.diffHideUnchangedRegions)===void 0?H({},Ye):Nn(i.monacoOptions.diffHideUnchangedRegions),renderSideBySide:(d=(a=A.value)==null?void 0:a.renderSideBySide)==null||d,useInlineViewWhenSpaceIsLimited:(u=(r=A.value)==null?void 0:r.useInlineViewWhenSpaceIsLimited)!=null&&u,enableSplitViewResizing:(s=(c=A.value)==null?void 0:c.enableSplitViewResizing)==null||s,ignoreTrimWhitespace:(h=(m=A.value)==null?void 0:m.ignoreTrimWhitespace)==null||h,originalEditable:(p=(y=A.value)==null?void 0:y.originalEditable)!=null&&p})});return U(()=>[i.monacoOptions,re.value],()=>{var e,n;if(Fe(),!le||!re.value)return;const t=f.value?z():Y(),l=typeof((e=i.monacoOptions)==null?void 0:e.fontSize)=="number"?i.monacoOptions.fontSize:Number.isFinite($.value)?$.value:void 0;typeof l=="number"&&Number.isFinite(l)&&l>0&&((n=t?.updateOptions)==null||n.call(t,{fontSize:l})),j(!1)},{deep:!0}),U(()=>[on(),it.value,qe.value,te.value,re.value],([e],n)=>{qe.value&&te.value&&re.value&&(function(t={}){if(t.appearanceOnly)return;Fe();const l=on(),o=()=>{f.value&&Ne(),V(()=>{Qn(),q()})};l?(function(a,d){const r=(function(u){if(u==null)return null;if(typeof u=="string")return u;if(typeof u=="object"&&"name"in u)return String(u.name);if(typeof u=="object"){const c=mt.get(u);if(c)return c;try{const m=JSON.stringify(u);if(m)return mt.set(u,m),m}catch{}const s="__theme_"+ ++Bo;return mt.set(u,s),s}return String(u)})(d);return r?(vt=a,Ae||ft!==r?Ae?(Ie===r||ct===r||(dn=d,Ie=r),Ae):(dn=d,Ie=r,Ae=N(null,null,function*(){for(;Ie&&dn!=null;){const u=dn,c=Ie;if(dn=null,Ie=null,ft!==c)try{ct=c,yield(vt??a)(u),ft=c}catch{}}}).finally(()=>{Ae=null,ct=null}),Ae):Promise.resolve()):Promise.resolve()})($n,l).then(o).catch(a=>{}):o()})({appearanceOnly:n!=null&&nl(e,n[0])})},{flush:"post"}),U(()=>[Il.value,qe.value,re.value],(e,n)=>N(null,[e,n],function*([t,l,o],[a]){if(Fe(),!l||!o||!le||!b.value||!te.value||t===a||i.stream===!1&&i.loading!==!1)return;const d=he;if(d){try{yield d}catch{}if(F||!b.value)return}try{ie.value=!1,I.value=!1,te.value=!1,Me.value=!1,tn(),Le(),Je(),yield ne(),yield Re(b.value)}catch{ie.value=!1,I.value=!1,Te.value=!0}}),{flush:"post"}),U(()=>[i.loading,re.value],(e,n)=>N(null,[e,n],function*([t,l],o){if(!l)return;const a=o?.[0];if(a===!1&&t!==!1&&f.value&&te.value&&(yield ne(),V(()=>{N(null,null,function*(){const r=he;if(r)try{yield r}catch{}!F&&f.value&&i.loading!==!1&&(Fe(),Ne(),q())})})),t)return;const d=a!==void 0&&a!==!1;yield ne(),V(()=>{N(null,null,function*(){var r,u;try{if(d&&te.value)if(f.value&&b.value){const c=he;if(c)try{yield c}catch{}Fe();const s=zn(String((r=i.node.originalCode)!=null?r:""),String((u=i.node.updatedCode)!=null?u:""));if(yield Jt(s.original,s.updated,pe.value),F||!f.value)return;Ne(),ln(!0),Z(),Oe(),q()}else fn(Xe.value,pe.value);j(!1)}catch{}})})}),{immediate:!0,flush:"post"}),pl(()=>{Vn(),tn(),Le(),Ln()}),(e,n)=>ze.value?(je(),Pn(pt(il),{key:0,node:Pt.value,loading:i.loading},null,8,["node","loading"])):(je(),rl("div",{key:1,ref_key:"container",ref:me,style:ut(zl.value),class:Bn(["code-block-container rounded-lg border",[{dark:i.isDark,"is-rendering":i.loading,"is-dark":Al.value,"is-diff":f.value,"is-plain-text":yt.value}]]),"data-markstream-code-block":"1","data-markstream-enhanced":I.value&&!ze.value?"true":"false","data-markstream-pending":Sl.value?"true":void 0},[Zl(po,{"show-header":i.showHeader,"show-collapse-button":i.showCollapseButton,"show-font-size-buttons":i.showFontSizeButtons,"enable-font-size-control":i.enableFontSizeControl,"show-copy-button":i.showCopyButton,"show-expand-button":i.showExpandButton,"show-preview-button":i.showPreviewButton,"show-tooltips":i.showTooltips,"is-dark":i.isDark,loading:i.loading,stream:k.stream,"is-collapsed":be.value,"is-expanded":se.value,"copy-text":En.value,"is-previewable":nt.value,"code-font-size":$.value,"code-font-min":10,"code-font-max":36,"default-code-font-size":X.value,"font-baseline-ready":kl.value,"diff-stats":f.value?Ee.value:null,"diff-stats-aria-label":yl.value,onToggleCollapse:Wl,onDecreaseFont:Ll,onResetFont:Fl,onIncreaseFont:Ol,onCopy:Tl,onToggleExpand:Dl,onPreview:Rl},eo({"header-left":Cn(()=>[at(e.$slots,"header-left",{},()=>[T("div",Oo,[T("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:Nl.value},null,8,Lo),T("div",Fo,[T("div",$o,ht(Hl.value),1),Xt.value?(je(),rl("div",Ho,ht(Xt.value),1)):dt("",!0)])])],!0)]),loading:Cn(()=>[at(e.$slots,"loading",{loading:k.loading,stream:k.stream},()=>[n[0]||(n[0]=T("div",{class:"loading-skeleton"},[T("div",{class:"skeleton-line"}),T("div",{class:"skeleton-line"}),T("div",{class:"skeleton-line short"})],-1))],!0)]),default:Cn(()=>[no(T("div",No,[T("div",{ref_key:"codeEditor",ref:b,class:Bn(["code-editor-container",[k.stream?"":"code-height-placeholder",{"is-hidden":bl.value}]]),style:ut(El.value)},null,6),Mt.value?(je(),Pn(pt(il),{key:0,class:Bn(["code-pre-fallback",{"is-wrap":wl.value,"is-fading-out":Q.value}]),style:ut(Pl.value),node:Pt.value,"show-line-numbers":!0,"diff-inline":hn.value},null,8,["class","style","node","diff-inline"])):dt("",!0)],512),[[to,!(be.value||!k.stream&&k.loading)]]),yn.value&&!we.value&&nt.value&&de.value==="html"?(je(),Pn(Po,{key:0,code:i.node.code,"html-preview-allow-scripts":i.htmlPreviewAllowScripts,"html-preview-sandbox":i.htmlPreviewSandbox,"is-dark":i.isDark,"on-close":()=>yn.value=!1},null,8,["code","html-preview-allow-scripts","html-preview-sandbox","is-dark","on-close"])):dt("",!0)]),_:2},[e.$slots["header-right"]?{name:"header-right",fn:Cn(()=>[at(e.$slots,"header-right",{},void 0,!0)]),key:"0"}:void 0]),1032,["show-header","show-collapse-button","show-font-size-buttons","enable-font-size-control","show-copy-button","show-expand-button","show-preview-button","show-tooltips","is-dark","loading","stream","is-collapsed","is-expanded","copy-text","is-previewable","code-font-size","default-code-font-size","font-baseline-ready","diff-stats","diff-stats-aria-label"])],14,Eo))}}),[["__scopeId","data-v-b5384753"]]);export{Wo as default};
@@ -1 +0,0 @@
1
- import{U as a,R as n}from"./mermaid.core-UWDZO4h_.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-Cmhtbm26.js";import{_ as i}from"./mermaid.core-UWDZO4h_.js";import"./chunk-FMBD7UC4-C5EABTZN.js";import"./chunk-ND2GUHAM-CVMSNFBB.js";import"./chunk-55IACEB6-BMZITsHm.js";import"./chunk-2J33WTMH-jodlcE5W.js";import"./index-uGnch3Jw.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-Cmhtbm26.js";import{_ as i}from"./mermaid.core-UWDZO4h_.js";import"./chunk-FMBD7UC4-C5EABTZN.js";import"./chunk-ND2GUHAM-CVMSNFBB.js";import"./chunk-55IACEB6-BMZITsHm.js";import"./chunk-2J33WTMH-jodlcE5W.js";import"./index-uGnch3Jw.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};