@ucap-llm/ai-ui 1.2.5 → 1.2.6

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 (52) hide show
  1. package/{_basePickBy-BRxeAj8U.mjs → _basePickBy-DFZvgpUj.mjs} +2 -2
  2. package/ai-ui.es.js +1 -1
  3. package/ai-ui.umd.js +1 -1
  4. package/{arc--y6TJEAm.mjs → arc-B1hbehSG.mjs} +1 -1
  5. package/{architecture-4AB2E3PP-2U5HPjkp.mjs → architecture-4AB2E3PP-B5DR3n4S.mjs} +1 -1
  6. package/{architectureDiagram-IEHRJDOE-CFRwDjee.mjs → architectureDiagram-IEHRJDOE-iPbGyNGV.mjs} +4 -4
  7. package/{blockDiagram-JOT3LUYC-ZX28mq9n.mjs → blockDiagram-JOT3LUYC-B-Pya1Zn.mjs} +4 -4
  8. package/{c4Diagram-VJAJSXHY-DWKkA8i5.mjs → c4Diagram-VJAJSXHY-S8cD7CNF.mjs} +2 -2
  9. package/{channel-DygBbP2N.mjs → channel-DK3nWCnf.mjs} +1 -1
  10. package/{chunk-4BMEZGHF-NprDeaHC.mjs → chunk-4BMEZGHF-BEmG049J.mjs} +1 -1
  11. package/{chunk-A2AXSNBT-DashJEw4.mjs → chunk-A2AXSNBT-CsXgqPKx.mjs} +2 -2
  12. package/{chunk-AEK57VVT-DDbbuusA.mjs → chunk-AEK57VVT-C2ae2xYR.mjs} +2 -2
  13. package/{chunk-D6G4REZN-Bf3XejNZ.mjs → chunk-D6G4REZN-CpxhtUpL.mjs} +1 -1
  14. package/{chunk-RZ5BOZE2-DW6gxhKN.mjs → chunk-RZ5BOZE2-qRG8ZhHH.mjs} +1 -1
  15. package/{chunk-XZIHB7SX-BaVZQ9-p.mjs → chunk-XZIHB7SX-ajV0D-qB.mjs} +1 -1
  16. package/{classDiagram-GIVACNV2-CnS9Ex07.mjs → classDiagram-GIVACNV2-CsG_Bz6Q.mjs} +2 -2
  17. package/{classDiagram-v2-COTLJTTW-CnS9Ex07.mjs → classDiagram-v2-COTLJTTW-CsG_Bz6Q.mjs} +2 -2
  18. package/{clone-QF40ZrZn.mjs → clone-DJ3yBnPZ.mjs} +1 -1
  19. package/{dagre-OKDRZEBW-DFKeRWV4.mjs → dagre-OKDRZEBW-DSi3ZICw.mjs} +6 -6
  20. package/{diagram-SSKATNLV-BP5ge4BI.mjs → diagram-SSKATNLV-P15Qi3Hu.mjs} +3 -3
  21. package/{diagram-VNBRO52H-CKdQIIKs.mjs → diagram-VNBRO52H-YFxpncCL.mjs} +3 -3
  22. package/{erDiagram-Q7BY3M3F-6BWpCHJ5.mjs → erDiagram-Q7BY3M3F-sJ7As3BB.mjs} +3 -3
  23. package/{flowDiagram-4HSFHLVR-DcbWYnkL.mjs → flowDiagram-4HSFHLVR-BxPjymGp.mjs} +3 -3
  24. package/{ganttDiagram-APWFNJXF-DN_sI6WM.mjs → ganttDiagram-APWFNJXF-C_tndeIZ.mjs} +2 -2
  25. package/{gitGraph-O2Q2CXLX-BiOfGvzx.mjs → gitGraph-O2Q2CXLX-DG2rFUYd.mjs} +1 -1
  26. package/{gitGraphDiagram-7IBYFJ6S-BGb25V_h.mjs → gitGraphDiagram-7IBYFJ6S-CzTL9SFO.mjs} +4 -4
  27. package/{graph-CKBxA1oq.mjs → graph-Br45le2O.mjs} +2 -2
  28. package/{index-BsUdfvvY.mjs → index-DeVe2fYT.mjs} +33 -33
  29. package/info-4N47QTOZ-YO0y_SXD.mjs +5 -0
  30. package/{infoDiagram-PH2N3AL5-DQmRVEbb.mjs → infoDiagram-PH2N3AL5-BtWwFUrw.mjs} +2 -2
  31. package/{journeyDiagram-U35MCT3I-CP6RoZ-H.mjs → journeyDiagram-U35MCT3I-BD4v7Tho.mjs} +3 -3
  32. package/{kanban-definition-NDS4AKOZ-D9pOneAP.mjs → kanban-definition-NDS4AKOZ-BvFTKFs6.mjs} +1 -1
  33. package/{layout-BqeeUOdZ.mjs → layout-BI2vRxTF.mjs} +4 -4
  34. package/{linear-BSrqwB7k.mjs → linear-CDnJTCgr.mjs} +1 -1
  35. package/{mermaid-parser.core-BdtH8HCP.mjs → mermaid-parser.core-Dkxc4pcM.mjs} +10 -10
  36. package/{mindmap-definition-ALO5MXBD-C9hhwRfq.mjs → mindmap-definition-ALO5MXBD-D0uu8Wao.mjs} +1 -1
  37. package/package.json +1 -1
  38. package/{packet-KVYON367-C6WyPWi4.mjs → packet-KVYON367-JA5Pjhjl.mjs} +1 -1
  39. package/pie-R6RNRRYF-CECBNssi.mjs +5 -0
  40. package/{pieDiagram-IB7DONF6-DQR-BQEn.mjs → pieDiagram-IB7DONF6-BiRx87PK.mjs} +4 -4
  41. package/{quadrantDiagram-7GDLP6J5-CIx1aZpa.mjs → quadrantDiagram-7GDLP6J5-oSk8eMIb.mjs} +2 -2
  42. package/{radar-MK3ICKWK-sKQ5kxGw.mjs → radar-MK3ICKWK-Nv1bjQpk.mjs} +1 -1
  43. package/{reduce-DqpjGvBF.mjs → reduce-rKNe6dOq.mjs} +1 -1
  44. package/{requirementDiagram-KVF5MWMF-B9H-2ldt.mjs → requirementDiagram-KVF5MWMF-BMw-tAyf.mjs} +2 -2
  45. package/{sankeyDiagram-QLVOVGJD-Du0drU98.mjs → sankeyDiagram-QLVOVGJD-Di2hd5LJ.mjs} +1 -1
  46. package/{sequenceDiagram-X6HHIX6F-C3anzciQ.mjs → sequenceDiagram-X6HHIX6F-B5rJIkEi.mjs} +3 -3
  47. package/{stateDiagram-DGXRK772-BJ1JS-o_.mjs → stateDiagram-DGXRK772-C7VfR82U.mjs} +4 -4
  48. package/{stateDiagram-v2-YXO3MK2T-DVB5zlM_.mjs → stateDiagram-v2-YXO3MK2T-CAtvNl2z.mjs} +2 -2
  49. package/{timeline-definition-BDJGKUSR-DDmmId0r.mjs → timeline-definition-BDJGKUSR-BP150YKh.mjs} +2 -2
  50. package/{xychartDiagram-VJFVF3MP-DESgBXca.mjs → xychartDiagram-VJFVF3MP-Cy0s41Rz.mjs} +2 -2
  51. package/info-4N47QTOZ-CAxBUUU0.mjs +0 -5
  52. package/pie-R6RNRRYF-BTKwJ4Cz.mjs +0 -5
@@ -1,5 +1,5 @@
1
- import { d as x, a as b, e as v, g as P, h as p, j as w, k as I, t as N, l as A } from "./reduce-DqpjGvBF.mjs";
2
- import { aM as g, az as E, aN as M, aO as c, aP as F, aQ as l, aE as T, aR as _, aS as $, aT as B, aU as S, aV as y } from "./index-BsUdfvvY.mjs";
1
+ import { d as x, a as b, e as v, g as P, h as p, j as w, k as I, t as N, l as A } from "./reduce-rKNe6dOq.mjs";
2
+ import { aM as g, az as E, aN as M, aO as c, aP as F, aQ as l, aE as T, aR as _, aS as $, aT as B, aU as S, aV as y } from "./index-DeVe2fYT.mjs";
3
3
  var R = /\s/;
4
4
  function z(n) {
5
5
  for (var r = n.length; r-- && R.test(n.charAt(r)); )
package/ai-ui.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bN as i, bM as r, bQ as b, bP as t, bO as e, bR as A, bV as o, bS as d, bU as h, bW as n, bT as C, bK as c, bX as u, bL as l } from "./index-BsUdfvvY.mjs";
1
+ import { bN as i, bM as r, bQ as b, bP as t, bO as e, bR as A, bV as o, bS as d, bU as h, bW as n, bT as C, bK as c, bX as u, bL as l } from "./index-DeVe2fYT.mjs";
2
2
  export {
3
3
  i as AiChat,
4
4
  r as AiChatList,
package/ai-ui.umd.js CHANGED
@@ -961,7 +961,7 @@ echarts.use([`+O+"]);":"Unknown series "+w))}return}if(h==="tooltip"){if(_){proc
961
961
  `)),ti(n));var y=p?wVe(p):null;p&&!y&&(process.env.NODE_ENV!=="production"&&(n=Bu("Invalid parser name "+p+`.
962
962
  `,"Illegal config:",d,`.
963
963
  `)),ti(n)),a.push({dimIdx:v.index,parser:y,comparator:new OVe(f,g)})});var o=e.sourceFormat;o!==Xs&&o!==z1&&(process.env.NODE_ENV!=="production"&&(n='sourceFormat "'+o+'" is not supported yet'),ti(n));for(var s=[],l=0,u=e.count();l<u;l++)s.push(e.getRawDataItem(l));return s.sort(function(d,h){for(var f=0;f<a.length;f++){var p=a[f],g=e.retrieveValueFromItem(d,p.dimIdx),m=e.retrieveValueFromItem(h,p.dimIdx);p.parser&&(g=p.parser(g),m=p.parser(m));var T=p.comparator.evaluate(g,m);if(T!==0)return T}return 0}),{data:s}}};function ETr(t){t.registerTransform(QTr),t.registerTransform(xTr)}var STr=function(t){Ye(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.prototype.init=function(r,n,i){t.prototype.init.call(this,r,n,i),this._sourceManager=new kVe(this),PVe(this)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),PVe(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:Ed},e}(yn),CTr=function(t){Ye(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.type="dataset",e}(ia);function LTr(t){t.registerComponentModel(STr),t.registerComponentView(CTr)}var ih=$3.CMD;function Xy(t,e){return Math.abs(t-e)<1e-5}function Rle(t){var e=t.data,r=t.len(),n=[],i,a=0,o=0,s=0,l=0;function u(R,M){i&&i.length>2&&n.push(i),i=[R,M]}function d(R,M,D,P){Xy(R,D)&&Xy(M,P)||i.push(R,M,D,P,D,P)}function h(R,M,D,P,B,k){var V=Math.abs(M-R),H=Math.tan(V/4)*4/3,$=M<R?-1:1,G=Math.cos(R),U=Math.sin(R),Y=Math.cos(M),ne=Math.sin(M),te=G*B+D,ee=U*k+P,ie=Y*B+D,j=ne*k+P,X=B*H*$,Z=k*H*$;i.push(te-X*U,ee+Z*G,ie+X*ne,j-Z*Y,ie,j)}for(var f,p,g,m,T=0;T<r;){var v=e[T++],y=T===1;switch(y&&(a=e[T],o=e[T+1],s=a,l=o,(v===ih.L||v===ih.C||v===ih.Q)&&(i=[s,l])),v){case ih.M:a=s=e[T++],o=l=e[T++],u(s,l);break;case ih.L:f=e[T++],p=e[T++],d(a,o,f,p),a=f,o=p;break;case ih.C:i.push(e[T++],e[T++],e[T++],e[T++],a=e[T++],o=e[T++]);break;case ih.Q:f=e[T++],p=e[T++],g=e[T++],m=e[T++],i.push(a+2/3*(f-a),o+2/3*(p-o),g+2/3*(f-g),m+2/3*(p-m),g,m),a=g,o=m;break;case ih.A:var _=e[T++],Q=e[T++],b=e[T++],x=e[T++],E=e[T++],S=e[T++]+E;T+=1;var C=!e[T++];f=Math.cos(E)*b+_,p=Math.sin(E)*x+Q,y?(s=f,l=p,u(s,l)):d(a,o,f,p),a=Math.cos(S)*b+_,o=Math.sin(S)*x+Q;for(var L=(C?-1:1)*Math.PI/2,w=E;C?w>S:w<S;w+=L){var O=C?Math.max(w+L,S):Math.min(w+L,S);h(w,O,_,Q,b,x)}break;case ih.R:s=a=e[T++],l=o=e[T++],f=s+e[T++],p=l+e[T++],u(f,l),d(f,l,f,p),d(f,p,s,p),d(s,p,s,l),d(s,l,f,l);break;case ih.Z:i&&d(a,o,s,l),a=s,o=l;break}}return i&&i.length>2&&n.push(i),n}function Dle(t,e,r,n,i,a,o,s,l,u){if(Xy(t,r)&&Xy(e,n)&&Xy(i,o)&&Xy(a,s)){l.push(o,s);return}var d=2/u,h=d*d,f=o-t,p=s-e,g=Math.sqrt(f*f+p*p);f/=g,p/=g;var m=r-t,T=n-e,v=i-o,y=a-s,_=m*m+T*T,Q=v*v+y*y;if(_<h&&Q<h){l.push(o,s);return}var b=f*m+p*T,x=-f*v-p*y,E=_-b*b,S=Q-x*x;if(E<h&&b>=0&&S<h&&x>=0){l.push(o,s);return}var C=[],L=[];v5(t,r,i,o,.5,C),v5(e,n,a,s,.5,L),Dle(C[0],L[0],C[1],L[1],C[2],L[2],C[3],L[3],l,u),Dle(C[4],L[4],C[5],L[5],C[6],L[6],C[7],L[7],l,u)}function wTr(t,e){var r=Rle(t),n=[];e=e||1;for(var i=0;i<r.length;i++){var a=r[i],o=[],s=a[0],l=a[1];o.push(s,l);for(var u=2;u<a.length;){var d=a[u++],h=a[u++],f=a[u++],p=a[u++],g=a[u++],m=a[u++];Dle(s,l,d,h,f,p,g,m,o,e),s=g,l=m}n.push(o)}return n}function UKe(t,e,r){var n=t[e],i=t[1-e],a=Math.abs(n/i),o=Math.ceil(Math.sqrt(a*r)),s=Math.floor(r/o);s===0&&(s=1,o=r);for(var l=[],u=0;u<o;u++)l.push(s);var d=o*s,h=r-d;if(h>0)for(var u=0;u<h;u++)l[u%o]+=1;return l}function zKe(t,e,r){for(var n=t.r0,i=t.r,a=t.startAngle,o=t.endAngle,s=Math.abs(o-a),l=s*i,u=i-n,d=l>Math.abs(u),h=UKe([l,u],d?0:1,e),f=(d?s:u)/h.length,p=0;p<h.length;p++)for(var g=(d?u:s)/h[p],m=0;m<h[p];m++){var T={};d?(T.startAngle=a+f*p,T.endAngle=a+f*(p+1),T.r0=n+g*m,T.r=n+g*(m+1)):(T.startAngle=a+g*m,T.endAngle=a+g*(m+1),T.r0=n+f*p,T.r=n+f*(p+1)),T.clockwise=t.clockwise,T.cx=t.cx,T.cy=t.cy,r.push(T)}}function ATr(t,e,r){for(var n=t.width,i=t.height,a=n>i,o=UKe([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",d=a?"y":"x",h=t[s]/o.length,f=0;f<o.length;f++)for(var p=t[l]/o[f],g=0;g<o[f];g++){var m={};m[u]=f*h,m[d]=g*p,m[s]=h,m[l]=p,m.x+=t.x,m.y+=t.y,r.push(m)}}function GKe(t,e,r,n){return t*n-r*e}function OTr(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,d=o-i,h=s-a,f=GKe(d,h,l,u);if(Math.abs(f)<1e-6)return null;var p=t-i,g=e-a,m=GKe(p,g,d,h)/f;return m<0||m>1?null:new xr(m*l+t,m*u+e)}function MTr(t,e,r){var n=new xr;xr.sub(n,r,e),n.normalize();var i=new xr;xr.sub(i,t,e);var a=i.dot(n);return a}function Ky(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function RTr(t,e,r){for(var n=t.length,i=[],a=0;a<n;a++){var o=t[a],s=t[(a+1)%n],l=OTr(o[0],o[1],s[0],s[1],e.x,e.y,r.x,r.y);l&&i.push({projPt:MTr(l,e,r),pt:l,idx:a})}if(i.length<2)return[{points:t},{points:t}];i.sort(function(T,v){return T.projPt-v.projPt});var u=i[0],d=i[i.length-1];if(d.idx<u.idx){var h=u;u=d,d=h}for(var f=[u.pt.x,u.pt.y],p=[d.pt.x,d.pt.y],g=[f],m=[p],a=u.idx+1;a<=d.idx;a++)Ky(g,t[a].slice());Ky(g,p),Ky(g,f);for(var a=d.idx+1;a<=u.idx+n;a++)Ky(m,t[a%n].slice());return Ky(m,f),Ky(m,p),[{points:g},{points:m}]}function qKe(t){var e=t.points,r=[],n=[];Pk(e,r,n);var i=new Cr(r[0],r[1],n[0]-r[0],n[1]-r[1]),a=i.width,o=i.height,s=i.x,l=i.y,u=new xr,d=new xr;return a>o?(u.x=d.x=s+a/2,u.y=l,d.y=l+o):(u.y=d.y=l+o/2,u.x=s,d.x=s+a),RTr(e,u,d)}function QH(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);QH(t,a[0],i,n),QH(t,a[1],r-i,n)}return n}function DTr(t,e){for(var r=[],n=0;n<e;n++)r.push(Lne(t));return r}function NTr(t,e){e.setStyle(t.style),e.z=t.z,e.z2=t.z2,e.zlevel=t.zlevel}function ITr(t){for(var e=[],r=0;r<t.length;)e.push([t[r++],t[r++]]);return e}function kTr(t,e){var r=[],n=t.shape,i;switch(t.type){case"rect":ATr(n,e,r),i=dn;break;case"sector":zKe(n,e,r),i=eu;break;case"circle":zKe({r0:0,r:n.r,startAngle:0,endAngle:Math.PI*2,cx:n.cx,cy:n.cy},e,r),i=eu;break;default:var a=t.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=bt(wTr(t.getUpdatedPathProxy(),o),function(v){return ITr(v)}),l=s.length;if(l===0)QH(qKe,{points:s[0]},e,r);else if(l===e)for(var u=0;u<l;u++)r.push({points:s[u]});else{var d=0,h=bt(s,function(v){var y=[],_=[];Pk(v,y,_);var Q=(_[1]-y[1])*(_[0]-y[0]);return d+=Q,{poly:v,area:Q}});h.sort(function(v,y){return y.area-v.area});for(var f=e,u=0;u<l;u++){var p=h[u];if(f<=0)break;var g=u===l-1?f:Math.ceil(p.area/d*e);g<0||(QH(qKe,{points:p.poly},g,r),f-=g)}}i=tu;break}if(!i)return DTr(t,e);for(var m=[],u=0;u<r.length;u++){var T=new i;T.setShape(r[u]),NTr(t,T),m.push(T)}return m}function PTr(t,e){var r=t.length,n=e.length;if(r===n)return[t,e];for(var i=[],a=[],o=r<n?t:e,s=Math.min(r,n),l=Math.abs(n-r)/6,u=(s-2)/6,d=Math.ceil(l/u)+1,h=[o[0],o[1]],f=l,p=2;p<s;){var g=o[p-2],m=o[p-1],T=o[p++],v=o[p++],y=o[p++],_=o[p++],Q=o[p++],b=o[p++];if(f<=0){h.push(T,v,y,_,Q,b);continue}for(var x=Math.min(f,d-1)+1,E=1;E<=x;E++){var S=E/x;v5(g,T,y,Q,S,i),v5(m,v,_,b,S,a),g=i[3],m=a[3],h.push(i[1],a[1],i[2],a[2],g,m),T=i[5],v=a[5],y=i[6],_=a[6]}f-=x-1}return o===t?[h,e]:[t,h]}function WKe(t,e){for(var r=t.length,n=t[r-2],i=t[r-1],a=[],o=0;o<e.length;)a[o++]=n,a[o++]=i;return a}function BTr(t,e){for(var r,n,i,a=[],o=[],s=0;s<Math.max(t.length,e.length);s++){var l=t[s],u=e[s],d=void 0,h=void 0;l?u?(r=PTr(l,u),d=r[0],h=r[1],n=d,i=h):(h=WKe(i||l,l),d=l):(d=WKe(n||u,u),h=u),a.push(d),o.push(h)}return[a,o]}function YKe(t){for(var e=0,r=0,n=0,i=t.length,a=0,o=i-2;a<i;o=a,a+=2){var s=t[o],l=t[o+1],u=t[a],d=t[a+1],h=s*d-u*l;e+=h,r+=(s+u)*h,n+=(l+d)*h}return e===0?[t[0]||0,t[1]||0]:[r/e/3,n/e/3,e]}function HTr(t,e,r,n){for(var i=(t.length-2)/6,a=1/0,o=0,s=t.length,l=s-2,u=0;u<i;u++){for(var d=u*6,h=0,f=0;f<s;f+=2){var p=f===0?d:(d+f-2)%l+2,g=t[p]-r[0],m=t[p+1]-r[1],T=e[f]-n[0],v=e[f+1]-n[1],y=T-g,_=v-m;h+=y*y+_*_}h<a&&(a=h,o=u)}return o}function FTr(t){for(var e=[],r=t.length,n=0;n<r;n+=2)e[n]=t[r-n-2],e[n+1]=t[r-n-1];return e}function VTr(t,e,r,n){for(var i=[],a,o=0;o<t.length;o++){var s=t[o],l=e[o],u=YKe(s),d=YKe(l);a==null&&(a=u[2]<0!=d[2]<0);var h=[],f=[],p=0,g=1/0,m=[],T=s.length;a&&(s=FTr(s));for(var v=HTr(s,l,u,d)*6,y=T-2,_=0;_<y;_+=2){var Q=(v+_)%y+2;h[_+2]=s[Q]-u[0],h[_+3]=s[Q+1]-u[1]}h[0]=s[v]-u[0],h[1]=s[v+1]-u[1];for(var b=n/r,x=-n/2;x<=n/2;x+=b){for(var E=Math.sin(x),S=Math.cos(x),C=0,_=0;_<s.length;_+=2){var L=h[_],w=h[_+1],O=l[_]-d[0],R=l[_+1]-d[1],M=O*S-R*E,D=O*E+R*S;m[_]=M,m[_+1]=D;var P=M-L,B=D-w;C+=P*P+B*B}if(C<g){g=C,p=x;for(var k=0;k<m.length;k++)f[k]=m[k]}}i.push({from:h,to:f,fromCp:u,toCp:d,rotation:-p})}return i}function xH(t){return t.__isCombineMorphing}var jKe="__mOriginal_";function EH(t,e,r){var n=jKe+e,i=t[n]||t[e];t[n]||(t[n]=t[e]);var a=r.replace,o=r.after,s=r.before;t[e]=function(){var l=arguments,u;return s&&s.apply(this,l),a?u=a.apply(this,l):u=i.apply(this,l),o&&o.apply(this,l),u}}function ww(t,e){var r=jKe+e;t[r]&&(t[e]=t[r],t[r]=null)}function XKe(t,e){for(var r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;){var a=n[i],o=n[i+1];n[i++]=e[0]*a+e[2]*o+e[4],n[i++]=e[1]*a+e[3]*o+e[5]}}function KKe(t,e){var r=t.getUpdatedPathProxy(),n=e.getUpdatedPathProxy(),i=BTr(Rle(r),Rle(n)),a=i[0],o=i[1],s=t.getComputedTransform(),l=e.getComputedTransform();function u(){this.transform=null}s&&XKe(a,s),l&&XKe(o,l),EH(e,"updateTransform",{replace:u}),e.transform=null;var d=VTr(a,o,10,Math.PI),h=[];EH(e,"buildPath",{replace:function(f){for(var p=e.__morphT,g=1-p,m=[],T=0;T<d.length;T++){var v=d[T],y=v.from,_=v.to,Q=v.rotation*p,b=v.fromCp,x=v.toCp,E=Math.sin(Q),S=Math.cos(Q);JI(m,b,x,p);for(var C=0;C<y.length;C+=2){var L=y[C],w=y[C+1],O=_[C],R=_[C+1],M=L*g+O*p,D=w*g+R*p;h[C]=M*S-D*E+m[0],h[C+1]=M*E+D*S+m[1]}var P=h[0],B=h[1];f.moveTo(P,B);for(var C=2;C<y.length;){var O=h[C++],R=h[C++],k=h[C++],V=h[C++],H=h[C++],$=h[C++];P===O&&B===R&&k===H&&V===$?f.lineTo(H,$):f.bezierCurveTo(O,R,k,V,H,$),P=H,B=$}}}})}function Nle(t,e,r){if(!t||!e)return e;var n=r.done,i=r.during;KKe(t,e),e.__morphT=0;function a(){ww(e,"buildPath"),ww(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},Sr({during:function(o){e.dirtyShape(),i&&i(o)},done:function(){a(),n&&n()}},r)),e}function $Tr(t,e,r,n,i,a){var o=16;t=i===r?0:Math.round(32767*(t-r)/(i-r)),e=a===n?0:Math.round(32767*(e-n)/(a-n));for(var s=0,l,u=(1<<o)/2;u>0;u/=2){var d=0,h=0;(t&u)>0&&(d=1),(e&u)>0&&(h=1),s+=u*u*(3*d^h),h===0&&(d===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function SH(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=bt(t,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),d=l.x+l.width/2+(u?u[4]:0),h=l.y+l.height/2+(u?u[5]:0);return e=Math.min(d,e),r=Math.min(h,r),n=Math.max(d,n),i=Math.max(h,i),[d,h]}),o=bt(a,function(s,l){return{cp:s,z:$Tr(s[0],s[1],e,r,n,i),path:t[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function ZKe(t){return kTr(t.path,t.count)}function Ile(){return{fromIndividuals:[],toIndividuals:[],count:0}}function UTr(t,e,r){var n=[];function i(b){for(var x=0;x<b.length;x++){var E=b[x];xH(E)?i(E.childrenRef()):E instanceof vn&&n.push(E)}}i(t);var a=n.length;if(!a)return Ile();var o=r.dividePath||ZKe,s=o({path:e,count:a});if(s.length!==a)return console.error("Invalid morphing: unmatched splitted path"),Ile();n=SH(n),s=SH(s);for(var l=r.done,u=r.during,d=r.individualDelay,h=new Q4,f=0;f<a;f++){var p=n[f],g=s[f];g.parent=e,g.copyTransform(h),d||KKe(p,g)}e.__isCombineMorphing=!0,e.childrenRef=function(){return s};function m(b){for(var x=0;x<s.length;x++)s[x].addSelfToZr(b)}EH(e,"addSelfToZr",{after:function(b){m(b)}}),EH(e,"removeSelfFromZr",{after:function(b){for(var x=0;x<s.length;x++)s[x].removeSelfFromZr(b)}});function T(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,ww(e,"addSelfToZr"),ww(e,"removeSelfFromZr")}var v=s.length;if(d)for(var y=v,_=function(){y--,y===0&&(T(),l&&l())},f=0;f<v;f++){var Q=d?Sr({delay:(r.delay||0)+d(f,v,n[f],s[f]),done:_},r):r;Nle(n[f],s[f],Q)}else e.__morphT=0,e.animateTo({__morphT:1},Sr({during:function(b){for(var x=0;x<v;x++){var E=s[x];E.__morphT=e.__morphT,E.dirtyShape()}u&&u(b)},done:function(){T();for(var b=0;b<t.length;b++)ww(t[b],"updateTransform");l&&l()}},r));return e.__zr&&m(e.__zr),{fromIndividuals:n,toIndividuals:s,count:v}}function zTr(t,e,r){var n=e.length,i=[],a=r.dividePath||ZKe;function o(p){for(var g=0;g<p.length;g++){var m=p[g];xH(m)?o(m.childrenRef()):m instanceof vn&&i.push(m)}}if(xH(t)){o(t.childrenRef());var s=i.length;if(s<n)for(var l=0,u=s;u<n;u++)i.push(Lne(i[l++%s]));i.length=n}else{i=a({path:t,count:n});for(var d=t.getComputedTransform(),u=0;u<i.length;u++)i[u].setLocalTransform(d);if(i.length!==n)return console.error("Invalid morphing: unmatched splitted path"),Ile()}i=SH(i),e=SH(e);for(var h=r.individualDelay,u=0;u<n;u++){var f=h?Sr({delay:(r.delay||0)+h(u,n,i[u],e[u])},r):r;Nle(i[u],e[u],f)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}function JKe(t){return yt(t[0])}function eZe(t,e){for(var r=[],n=t.length,i=0;i<n;i++)r.push({one:t[i],many:[]});for(var i=0;i<e.length;i++){var a=e[i].length,o=void 0;for(o=0;o<a;o++)r[o%n].many.push(e[i][o])}for(var s=0,i=n-1;i>=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var GTr={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n<t.count;n++){var i=Lne(t.path);i.setStyle("opacity",r),e.push(i)}return e},split:null};function kle(t,e,r,n,i,a){if(!t.length||!e.length)return;var o=J9("update",n,i);if(!(o&&o.duration>0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,d;JKe(t)&&(u=t,d=e),JKe(e)&&(u=e,d=t);function h(v,y,_,Q,b){var x=v.many,E=v.one;if(x.length===1&&!b){var S=y?x[0]:E,C=y?E:x[0];if(xH(S))h({many:[S],one:C},!0,_,Q,!0);else{var L=s?Sr({delay:s(_,Q)},l):l;Nle(S,C,L),a(S,C,S,C,L)}}else for(var w=Sr({dividePath:GTr[r],individualDelay:s&&function(B,k,V,H){return s(B+_,Q)}},l),O=y?UTr(x,E,w):zTr(E,x,w),R=O.fromIndividuals,M=O.toIndividuals,D=R.length,P=0;P<D;P++){var L=s?Sr({delay:s(P,D)},l):l;a(R[P],M[P],y?x[P]:v.one,y?v.one:x[P],L)}}for(var f=u?u===t:t.length>e.length,p=u?eZe(d,u):eZe(f?e:t,[f?t:e]),g=0,m=0;m<p.length;m++)g+=p[m].many.length;for(var T=0,m=0;m<p.length;m++)h(p[m],f,T,g),T+=p[m].many.length}function _8(t){if(!t)return[];if(yt(t)){for(var e=[],r=0;r<t.length;r++)e.push(_8(t[r]));return e}var n=[];return t.traverse(function(i){i instanceof vn&&!i.disableMorphing&&!i.invisible&&!i.ignore&&n.push(i)}),n}var tZe=1e4,qTr=0,rZe=1,nZe=2,WTr=fn();function YTr(t,e){for(var r=t.dimensions,n=0;n<r.length;n++){var i=t.getDimensionInfo(r[n]);if(i&&i.otherDims[e]===0)return r[n]}}function jTr(t,e,r){var n=t.getDimensionInfo(r),i=n&&n.ordinalMeta;if(n){var a=t.get(n.name,e);return i&&i.categories[a]||a+""}}function iZe(t,e,r,n){var i=n?"itemChildGroupId":"itemGroupId",a=YTr(t,i);if(a){var o=jTr(t,e,a);return o}var s=t.getRawDataItem(e),l=n?"childGroupId":"groupId";if(s&&s[l])return s[l]+"";if(!n)return r||t.getId(e)}function aZe(t){var e=[];return ue(t,function(r){var n=r.data,i=r.dataGroupId;if(n.count()>tZe){process.env.NODE_ENV!=="production"&&_a("Universal transition is disabled on large data > 10k.");return}for(var a=n.getIndices(),o=0;o<a.length;o++)e.push({data:n,groupId:iZe(n,o,i,!1),childGroupId:iZe(n,o,i,!0),divide:r.divide,dataIndex:o})}),e}function Ple(t,e,r){t.traverse(function(n){n instanceof vn&&na(n,{style:{opacity:0}},e,{dataIndex:r,isFrom:!0})})}function Ble(t){if(t.parent){var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function Zy(t){t.stopAnimation(),t.isGroup&&t.traverse(function(e){e.stopAnimation()})}function XTr(t,e,r){var n=J9("update",r,e);n&&t.traverse(function(i){if(i instanceof $2){var a=Ssr(i);a&&i.animateFrom({style:a},n)}})}function KTr(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++){var i=t[n],a=e[n];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function oZe(t,e,r){var n=aZe(t),i=aZe(e);function a(_,Q,b,x,E){(b||_)&&Q.animateFrom({style:b&&b!==_?gt(gt({},b.style),_.style):_.style},E)}var o=!1,s=qTr,l=ur(),u=ur();n.forEach(function(_){_.groupId&&l.set(_.groupId,!0),_.childGroupId&&u.set(_.childGroupId,!0)});for(var d=0;d<i.length;d++){var h=i[d].groupId;if(u.get(h)){s=rZe;break}var f=i[d].childGroupId;if(f&&l.get(f)){s=nZe;break}}function p(_,Q){return function(b){var x=b.data,E=b.dataIndex;return Q?x.getId(E):_?s===rZe?b.childGroupId:b.groupId:s===nZe?b.childGroupId:b.groupId}}var g=KTr(n,i),m={};if(!g)for(var d=0;d<i.length;d++){var T=i[d],v=T.data.getItemGraphicEl(T.dataIndex);v&&(m[v.id]=!0)}function y(_,Q){var b=n[Q],x=i[_],E=x.data.hostModel,S=b.data.getItemGraphicEl(b.dataIndex),C=x.data.getItemGraphicEl(x.dataIndex);if(S===C){C&&XTr(C,x.dataIndex,E);return}S&&m[S.id]||C&&(Zy(C),S?(Zy(S),Ble(S),o=!0,kle(_8(S),_8(C),x.divide,E,_,a)):Ple(C,E,_))}new I4(n,i,p(!0,g),p(!1,g),null,"multiple").update(y).updateManyToOne(function(_,Q){var b=i[_],x=b.data,E=x.hostModel,S=x.getItemGraphicEl(b.dataIndex),C=li(bt(Q,function(L){return n[L].data.getItemGraphicEl(n[L].dataIndex)}),function(L){return L&&L!==S&&!m[L.id]});S&&(Zy(S),C.length?(ue(C,function(L){Zy(L),Ble(L)}),o=!0,kle(_8(C),_8(S),b.divide,E,_,a)):Ple(S,E,b.dataIndex))}).updateOneToMany(function(_,Q){var b=n[Q],x=b.data.getItemGraphicEl(b.dataIndex);if(!(x&&m[x.id])){var E=li(bt(_,function(C){return i[C].data.getItemGraphicEl(i[C].dataIndex)}),function(C){return C&&C!==x}),S=i[_[0]].data.hostModel;E.length&&(ue(E,function(C){return Zy(C)}),x?(Zy(x),Ble(x),o=!0,kle(_8(x),_8(E),b.divide,S,_[0],a)):ue(E,function(C){return Ple(C,S,_[0])}))}}).updateManyToMany(function(_,Q){new I4(Q,_,function(b){return n[b].data.getId(n[b].dataIndex)},function(b){return i[b].data.getId(i[b].dataIndex)}).update(function(b,x){y(_[b],Q[x])}).execute()}).execute(),o&&ue(e,function(_){var Q=_.data,b=Q.hostModel,x=b&&r.getViewOfSeriesModel(b),E=J9("update",b,0);x&&b.isAnimationEnabled()&&E&&E.duration>0&&x.group.traverse(function(S){S instanceof vn&&!S.animators.length&&S.animateFrom({style:{opacity:0}},E)})})}function sZe(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function lZe(t){return yt(t)?t.sort().join(","):t}function K5(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function ZTr(t,e){var r=ur(),n=ur(),i=ur();ue(t.oldSeries,function(o,s){var l=t.oldDataGroupIds[s],u=t.oldData[s],d=sZe(o),h=lZe(d);n.set(h,{dataGroupId:l,data:u}),yt(d)&&ue(d,function(f){i.set(f,{key:h,dataGroupId:l,data:u})})});function a(o){r.get(o)&&_a("Duplicated seriesKey in universalTransition "+o)}return ue(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=sZe(o),d=lZe(u),h=n.get(d);if(h)process.env.NODE_ENV!=="production"&&a(d),r.set(d,{oldSeries:[{dataGroupId:h.dataGroupId,divide:K5(h.data),data:h.data}],newSeries:[{dataGroupId:s,divide:K5(l),data:l}]});else if(yt(u)){process.env.NODE_ENV!=="production"&&a(d);var f=[];ue(u,function(m){var T=n.get(m);T.data&&f.push({dataGroupId:T.dataGroupId,divide:K5(T.data),data:T.data})}),f.length&&r.set(d,{oldSeries:f,newSeries:[{dataGroupId:s,data:l,divide:K5(l)}]})}else{var p=i.get(u);if(p){var g=r.get(p.key);g||(g={oldSeries:[{dataGroupId:p.dataGroupId,data:p.data,divide:K5(p.data)}],newSeries:[]},r.set(p.key,g)),g.newSeries.push({dataGroupId:s,data:l,divide:K5(l)})}}}}),r}function uZe(t,e){for(var r=0;r<t.length;r++){var n=e.seriesIndex!=null&&e.seriesIndex===t[r].seriesIndex||e.seriesId!=null&&e.seriesId===t[r].id;if(n)return r}}function JTr(t,e,r,n){var i=[],a=[];ue(Ri(t.from),function(o){var s=uZe(e.oldSeries,o);s>=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:K5(e.oldData[s]),groupIdDim:o.dimension})}),ue(Ri(t.to),function(o){var s=uZe(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:K5(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&oZe(i,a,n)}function evr(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){ue(Ri(n.seriesTransition),function(i){ue(Ri(i.to),function(a){for(var o=n.updatedSeries,s=0;s<o.length;s++)(a.seriesIndex!=null&&a.seriesIndex===o[s].seriesIndex||a.seriesId!=null&&a.seriesId===o[s].id)&&(o[s][CP]=!0)})})}),t.registerUpdateLifecycle("series:transition",function(e,r,n){var i=WTr(r);if(i.oldSeries&&n.updatedSeries&&n.optionChanged){var a=n.seriesTransition;if(a)ue(Ri(a),function(p){JTr(p,i,n,r)});else{var o=ZTr(i,n);ue(o.keys(),function(p){var g=o.get(p);oZe(g.oldSeries,g.newSeries,r)})}ue(n.updatedSeries,function(p){p[CP]&&(p[CP]=!1)})}for(var s=e.getSeries(),l=i.oldSeries=[],u=i.oldDataGroupIds=[],d=i.oldData=[],h=0;h<s.length;h++){var f=s[h].getData();f.count()<tZe&&(l.push(s[h]),u.push(s[h].get("dataGroupId")),d.push(f))}})}var tvr=function(){function t(){this.breaks=[],this._elapsedExtent=[1/0,-1/0]}return t.prototype.setBreaks=function(e){this.breaks=e.breaks},t.prototype.update=function(e){nvr(this,e);var r=this._elapsedExtent;r[0]=this.elapse(e[0]),r[1]=this.elapse(e[1])},t.prototype.hasBreaks=function(){return!!this.breaks.length},t.prototype.calcNiceTickMultiple=function(e,r){for(var n=0;n<this.breaks.length;n++){var i=this.breaks[n];if(i.vmin<e&&e<i.vmax){var a=r(e,i.vmax);return process.env.NODE_ENV!=="production"&&nr(a>=0&&Math.round(a)===a),a}}return 0},t.prototype.getExtentSpan=function(){return this._elapsedExtent[1]-this._elapsedExtent[0]},t.prototype.normalize=function(e){var r=this._elapsedExtent[1]-this._elapsedExtent[0];return r===0?.5:(this.elapse(e)-this._elapsedExtent[0])/r},t.prototype.scale=function(e){return this.unelapse(e*(this._elapsedExtent[1]-this._elapsedExtent[0])+this._elapsedExtent[0])},t.prototype.elapse=function(e){for(var r=cZe,n=dZe,i=!0,a=0;a<this.breaks.length;a++){var o=this.breaks[a];if(e<=o.vmax){e>o.vmin?r+=o.vmin-n+(e-o.vmin)/(o.vmax-o.vmin)*o.gapReal:r+=e-n,n=o.vmax,i=!1;break}r+=o.vmin-n+o.gapReal,n=o.vmax}return i&&(r+=e-n),r},t.prototype.unelapse=function(e){for(var r=cZe,n=dZe,i=!0,a=0,o=0;o<this.breaks.length;o++){var s=this.breaks[o],l=r+s.vmin-n,u=l+s.gapReal;if(e<=u){e>l?a=s.vmin+(e-l)/(u-l)*(s.vmax-s.vmin):a=n+e-r,n=s.vmax,i=!1;break}r=u,n=s.vmax}return i&&(a=n+e-r),a},t}();function rvr(){return new tvr}var cZe=0,dZe=0;function nvr(t,e){var r=0,n={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};ue(t.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=Hle(s,e);if(u){var d=u.vmin!==s.vmin,h=u.vmax!==s.vmax,f=u.vmax-u.vmin;if(!(d&&h))if(d||h){var p=d?"S":"E";a[p][l.type].has=!0,a[p][l.type].span=f,a[p][l.type].inExtFrac=f/(s.vmax-s.vmin),a[p][l.type].val=l.val}else n[l.type].span+=f,n[l.type].val+=l.val}});var o=r*(0+(e[1]-e[0])+(n.tpAbs.val-n.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-n.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-n.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));ue(t.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(s.gapReal=r!==0?Math.max(o,0)*l.val/r:0),l.type==="tpAbs"&&(s.gapReal=l.val),s.gapReal==null&&(s.gapReal=0)})}function ivr(t,e,r,n,i,a){t!=="no"&&ue(r,function(o){var s=Hle(o,a);if(s)for(var l=e.length-1;l>=0;l--){var u=e[l],d=n(u),h=i*3/4;d>s.vmin-h&&d<s.vmax+h&&(t!=="preserve_extent_bound"||d!==a[0]&&d!==a[1])&&e.splice(l,1)}})}function avr(t,e,r,n){ue(e,function(i){var a=Hle(i,r);a&&(t.push({value:a.vmin,break:{type:"vmin",parsedBreak:a},time:n?n(a):void 0}),t.push({value:a.vmax,break:{type:"vmax",parsedBreak:a},time:n?n(a):void 0}))}),e.length&&t.sort(function(i,a){return i.value-a.value})}function Hle(t,e){var r=Math.max(t.vmin,e[0]),n=Math.min(t.vmax,e[1]);return r<n||r===n&&r>e[0]&&r<e[1]?{vmin:r,vmax:n,breakOption:t.breakOption,gapParsed:t.gapParsed,gapReal:t.gapReal}:null}function Fle(t,e,r){var n=[];if(!t)return{breaks:n};function i(o,s){return o>=0&&o<1-1e-5?!0:(process.env.NODE_ENV!=="production"&&kn(s+" must be >= 0 and < 1, rather than "+o+" ."),!1)}ue(t,function(o){if(!o||o.start==null||o.end==null){process.env.NODE_ENV!=="production"&&kn("The input axis breaks start/end should not be empty.");return}if(!o.isExpanded){var s={breakOption:br(o),vmin:e(o.start),vmax:e(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(zt(o.gap)){var u=k2(o.gap);if(u.match(/%$/)){var d=parseFloat(u)/100;i(d,"Percent gap")||(d=0),s.gapParsed.type="tpPrct",s.gapParsed.val=d,l=!0}}if(!l){var h=e(o.gap);(!isFinite(h)||h<0)&&(process.env.NODE_ENV!=="production"&&kn("Axis breaks gap must positive finite rather than ("+o.gap+")."),h=0),s.gapParsed.type="tpAbs",s.gapParsed.val=h}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&ue(["vmin","vmax"],function(p){s[p]<0&&(process.env.NODE_ENV!=="production"&&kn("Axis break."+p+" must not be negative."),s[p]=0)}),s.vmin>s.vmax){var f=s.vmax;s.vmax=s.vmin,s.vmin=f}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return ue(n,function(o,s){a>o.vmin&&(process.env.NODE_ENV!=="production"&&kn("Axis breaks must not overlap."),n[s]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function Vle(t,e){return $le(e)===$le(t)}function $le(t){return t.start+"_\0_"+t.end}function ovr(t,e,r){var n=[];ue(t,function(a,o){var s=e(a);s&&s.type==="vmin"&&n.push([o])}),ue(t,function(a,o){var s=e(a);if(s&&s.type==="vmax"){var l=rm(n,function(u){return Vle(e(t[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return ue(n,function(a){a.length===2&&i.push(r?a:[t[a[0]],t[a[1]]])}),i}function svr(t,e,r,n){var i,a;if(t.break){var o=t.break.parsedBreak,s=rm(r,function(h){return Vle(h.breakOption,t.break.parsedBreak.breakOption)}),l=n(Math.pow(e,o.vmin),s.vmin),u=n(Math.pow(e,o.vmax),s.vmax),d={type:o.gapParsed.type,val:o.gapParsed.type==="tpAbs"?Co(Math.pow(e,o.vmin+o.gapParsed.val))-l:o.gapParsed.val};i={type:t.break.type,parsedBreak:{breakOption:o.breakOption,vmin:l,vmax:u,gapParsed:d,gapReal:o.gapReal}},a=s[t.break.type]}return{brkRoundingCriterion:a,vBreak:i}}function lvr(t,e,r){var n={noNegative:!0},i=Fle(t,r,n),a=Fle(t,r,n),o=Math.log(e);return a.breaks=bt(a.breaks,function(s){var l=Math.log(s.vmin)/o,u=Math.log(s.vmax)/o,d={type:s.gapParsed.type,val:s.gapParsed.type==="tpAbs"?Math.log(s.vmin+s.gapParsed.val)/o-l:s.gapParsed.val};return{vmin:l,vmax:u,gapParsed:d,gapReal:s.gapReal,breakOption:s.breakOption}}),{parsedOriginal:i,parsedLogged:a}}var uvr={vmin:"start",vmax:"end"};function cvr(t,e){return e&&(t=t||{},t.break={type:uvr[e.type],start:e.parsedBreak.vmin,end:e.parsedBreak.vmax}),t}function dvr(){Ysr({createScaleBreakContext:rvr,pruneTicksByBreak:ivr,addBreaksToTicks:avr,parseAxisBreakOption:Fle,identifyAxisBreak:Vle,serializeAxisBreakIdentifier:$le,retrieveAxisBreakPairs:ovr,getTicksLogTransformBreak:svr,logarithmicParseBreaksFromOption:lvr,makeAxisLabelFormatterParamBreak:cvr})}var hZe=fn();function hvr(t,e){var r=rm(t,function(n){return Oo().identifyAxisBreak(n.parsedBreak.breakOption,e.breakOption)});return r||t.push(r={zigzagRandomList:[],parsedBreak:e,shouldRemove:!1}),r}function fvr(t){ue(t,function(e){return e.shouldRemove=!0})}function pvr(t){for(var e=t.length-1;e>=0;e--)t[e].shouldRemove&&t.splice(e,1)}function gvr(t,e,r,n,i){var a=r.axis;if(a.scale.isBlank()||!Oo())return;var o=Oo().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(C){return C.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),d=s.get("zigzagMaxSpan");u=Math.max(2,u||0),d=Math.max(u,d||0);var h=s.get("expandOnClick"),f=s.get("zigzagZ"),p=s.getModel("itemStyle"),g=p.getItemStyle(),m=g.stroke,T=g.lineWidth,v=g.lineDash,y=g.fill,_=new Tr({ignoreModelZ:!0}),Q=a.isHorizontal(),b=hZe(e).visualList||(hZe(e).visualList=[]);fvr(b);for(var x=function(C){var L=o[C][0].break.parsedBreak,w=[];w[0]=a.toGlobalCoord(a.dataToCoord(L.vmin,!0)),w[1]=a.toGlobalCoord(a.dataToCoord(L.vmax,!0)),w[1]<w[0]&&w.reverse();var O=hvr(b,L);O.shouldRemove=!1;var R=new Tr;S(O.zigzagRandomList,R,w[0],w[1],Q,L),h&&R.on("click",function(){var M={type:TB,breaks:[{start:L.breakOption.start,end:L.breakOption.end}]};M[a.dim+"AxisIndex"]=r.componentIndex,i.dispatchAction(M)}),R.silent=!h,_.add(R)},E=0;E<o.length;E++)x(E);t.add(_),pvr(b);function S(C,L,w,O,R,M){var D={stroke:m,lineWidth:T,lineDash:v,fill:"none"},P=R?0:1,B=1-P,k=n[Pr[B]]+n[Ao[B]];function V(ae){var le=[],oe=[];le[P]=oe[P]=ae,le[B]=n[Pr[B]],oe[B]=k;var Ce={x1:le[0],y1:le[1],x2:oe[0],y2:oe[1]};return Fk(Ce,Ce,{lineWidth:1}),le[0]=Ce.x1,le[1]=Ce.y1,le[P]}w=V(w),O=V(O);for(var H=[],$=[],G=!0,U=n[Pr[B]],Y=0;;Y++){var ne=U===n[Pr[B]],te=U>=k;te&&(U=k);var ee=[],ie=[];ee[P]=w,ie[P]=O,!ne&&!te&&(ee[P]+=G?-l:l,ie[P]-=G?l:-l),ee[B]=U,ie[B]=U,H.push(ee),$.push(ie);var j=void 0;if(Y<C.length?j=C[Y]:(j=Math.random(),C.push(j)),U+=j*(d-u)+u,G=!G,te)break}var X=Oo().serializeAxisBreakIdentifier(M.breakOption);if(L.add(new yl({anid:"break_a_"+X,shape:{points:H},style:D,z:f})),M.gapReal!==0){L.add(new yl({anid:"break_b_"+X,shape:{points:$},style:D,z:f}));var Z=$.slice();Z.reverse();var K=H.concat(Z);L.add(new tu({anid:"break_c_"+X,shape:{points:K},style:{fill:y,opacity:g.opacity},z:f}))}}}function mvr(t,e,r,n){var i=t.axis,a=r.transform;nr(n.style);var o=i.getExtent();i.inverse&&(o=o.slice(),o.reverse());var s=Oo().retrieveAxisBreakPairs(i.scale.getTicks({breakTicks:"only_break"}),function(T){return T.break},!1),l=bt(s,function(T){var v=T[0].break.parsedBreak,y=[i.dataToCoord(v.vmin,!0),i.dataToCoord(v.vmax,!0)];return y[0]>y[1]&&y.reverse(),{coordPair:y,brkId:Oo().serializeAxisBreakIdentifier(v.breakOption)}});l.sort(function(T,v){return T.coordPair[0]-v.coordPair[0]});for(var u=o[0],d=null,h=0;h<l.length;h++){var f=l[h],p=Math.max(f.coordPair[0],o[0]),g=Math.min(f.coordPair[1],o[1]);u<=p&&m(u,p,d,f),u=g,d=f}u<=o[1]&&m(u,o[1],d,null);function m(T,v,y,_){function Q(w,O){a&&(lo(w,w,a),lo(O,O,a))}function b(w,O){var R={x1:w[0],y1:w[1],x2:O[0],y2:O[1]};Fk(R,R,n.style),w[0]=R.x1,w[1]=R.y1,O[0]=R.x2,O[1]=R.y2}var x=[T,0],E=[v,0],S=[T,5],C=[v,5];Q(x,S),b(x,S),Q(E,C),b(E,C),b(x,E);var L=new wo(gt({shape:{x1:x[0],y1:x[1],x2:E[0],y2:E[1]}},n));e.add(L),L.anid="breakLine_"+(y?y.brkId:"\0")+"_\0_"+(_?_.brkId:"\0")}}function Tvr(t,e,r){if(rm(r,function(y){return!y}))return;var n=new xr;if(!aB(r[0],r[1],n,{direction:-(t?e+Math.PI:e),touchThreshold:0,bidirectional:!1}))return;var i=qs();g5(i,i,-e);var a=bt(r,function(y){return y.transform?w3(qs(),i,y.transform):i});function o(y){var _=r[0].localRect,Q=new xr(_[Ao[y]]*a[0][0],_[Ao[y]]*a[0][1]);return Math.abs(Q.y)<1e-5}var s=.5;if(o(0)||o(1)){var l=bt(r,function(y,_){var Q=y.localRect.clone();return Q.applyTransform(a[_]),Q}),u=new xr;u.copy(r[0].label).add(r[1].label).scale(.5),u.transform(i);var d=n.clone().transform(i),h=l[0].x+l[1].x+(d.x>=0?l[0].width:l[1].width),f=(h+d.x)/2-u.x,p=Math.min(f,f-d.x),g=Math.max(f,f-d.x),m=g<0?g:p>0?p:0;s=(f-m)/d.x}var T=new xr,v=new xr;xr.scale(T,n,-s),xr.scale(v,n,1-s),pae(r[0],T),pae(r[1],v)}function vvr(t,e){var r={breaks:[]};return ue(e.breaks,function(n){if(n){var i=rm(t.get("breaks",!0),function(s){return Oo().identifyAxisBreak(s,n)});if(!i){process.env.NODE_ENV!=="production"&&_a("Can not find axis break by start: "+n.start+", end: "+n.end);return}var a=e.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===TB?!0:a===QGe?!1:a===xGe?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}),r}function yvr(){gdr({adjustBreakLabelPair:Tvr,buildAxisBreakLine:mvr,rectCoordBuildBreakAxis:gvr,updateModelAxisBreak:vvr})}function _vr(t){bdr(t),dvr(),yvr()}function bvr(){$dr(Qvr)}function Qvr(t,e){ue(t,function(r){if(!r.model.get(["axisLabel","inside"])){var n=xvr(r);if(n){var i=r.isHorizontal()?"height":"width",a=r.model.get(["axisLabel","margin"]);e[i]-=n[i]+a,r.position==="top"?e.y+=n.height+a:r.position==="left"&&(e.x+=n.width+a)}}})}function xvr(t){var e=t.model,r=t.scale;if(!e.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof xy?i=r.count():(n=r.getTicks(),i=n.length);var o=t.getLabelModel(),s=Sy(t),l,u=1;i>40&&(u=Math.ceil(i/40));for(var d=0;d<i;d+=u){var h=n?n[d]:{value:a[0]+d},f=s(h,d),p=o.getTextRect(f),g=m(p,o.get("rotate")||0);l?l.union(g):l=g}return l;function m(T,v){var y=v*Math.PI/180,_=T.width,Q=T.height,b=_*Math.abs(Math.cos(y))+Math.abs(Q*Math.sin(y)),x=_*Math.abs(Math.sin(y))+Math.abs(Q*Math.cos(y)),E=new Cr(T.x,T.y,b,x);return E}}rn([f0r]),rn([l0r]),rn([D0r,Y0r,idr,s3r,v3r,shr,Nhr,Tfr,Bfr,Gfr,Kfr,a4r,Z4r,Q6r,D6r,j6r,J6r,u5r,m5r,L5r,D5r,U5r,Cpr]),rn(Gpr),rn(mgr),rn(Mqe),rn(wgr),rn(rYe),rn(Rgr),rn(Zgr),rn(s7r),rn(W7r),rn(hmr),rn(Tw),rn(wmr),rn(Mmr),rn(Vmr),rn(jmr),rn(t8r),rn(s8r),rn(T8r),rn(k8r),rn(mKe),rn(vKe),rn(rTr),rn(NKe),rn(kKe),rn(oTr),rn(dTr),rn(ETr),rn(LTr),rn(evr),rn(w2r),rn(_vr),rn(bvr),rn(l3r);const Evr=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Svr=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Cvr=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Lvr(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){wvr(t);return}return e}function wvr(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function Avr(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);const r=t.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!Cvr.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(Evr.test(t)||Svr.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,Lvr)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}const Ovr={class:"echarts-content"},Mvr={class:"echartsWrap"},Rvr={key:0,class:"echartsContent",ref:"echartsContent"},Dvr=oa({__name:"EchartsParser",props:{code:{type:String,required:!0}},setup(t){const e=Dh.PRESENTED_IMAGE_SIMPLE,r=[{value:1,label:"\u56FE\u8868"},{value:2,label:"\u6E90\u7801"}],n=I.ref(r[0].value),i=I.useTemplateRef("echartsContent"),a=I.ref(!1);let o=!1,s=null;const{stop:l}=pPe(i,()=>{s.resize()});I.onMounted(()=>{s=Gcr(i.value)}),I.onUnmounted(()=>{l()}),dPe(()=>t.code,d=>{const h=Avr(d);if(typeof h=="string")o||(o=!0,s.showLoading());else{o=!1,s.hideLoading();try{s.setOption(h)}catch(f){a.value=!0,console.error("\u51FA\u9519\u5566\u554A",f)}}},{immediate:!0,debounce:50,maxWait:100});const u=async()=>{try{await dI(t.code),ma.success("\u590D\u5236\u6210\u529F!")}catch(d){ma.error(d)}};return(d,h)=>{const f=Z7e,p=Jc,g=k6,m=Dh;return I.openBlock(),I.createElementBlock("div",Ovr,[I.createVNode(Dte,null,{title:I.withCtx(()=>[I.createVNode(f,{value:n.value,"onUpdate:value":h[0]||(h[0]=T=>n.value=T),options:r},null,8,["value"])]),actions:I.withCtx(()=>[I.createVNode(g,null,{title:I.withCtx(()=>h[1]||(h[1]=[I.createTextVNode("\u590D\u5236")])),default:I.withCtx(()=>[I.createVNode(p,{type:"text",size:"small",onClick:u},{default:I.withCtx(()=>[I.createVNode(I.unref(ox))]),_:1})]),_:1})]),_:1}),I.withDirectives(I.createElementVNode("div",Mvr,[a.value?(I.openBlock(),I.createBlock(m,{key:1,description:"\u6E32\u67D3\u5931\u8D25",image:I.unref(e)},null,8,["image"])):(I.openBlock(),I.createElementBlock("div",Rvr,null,512))],512),[[I.vShow,n.value===1]]),I.withDirectives(I.createElementVNode("pre",{class:"code-wrapper"},I.toDisplayString(t.code),513),[[I.vShow,n.value===2]])])}}},[["__scopeId","data-v-8911aac2"]]),Nvr={__name:"FenceParser",props:{node:{type:Object,default:()=>null}},setup(t){const e=I.ref(""),r=I.ref("");return I.watch(()=>t.node,()=>{t.node&&SE(t.node,n=>{var i,a,o;n.type==="text"?e.value=n.value:n.type==="element"&&n.tagName==="code"&&(r.value=((o=(a=(i=n.properties)==null?void 0:i.className)==null?void 0:a[0])==null?void 0:o.replace("language-",""))||"")})},{immediate:!0}),(n,i)=>r.value==="mermaid"?(I.openBlock(),I.createBlock(Nnr,{key:0,code:e.value},null,8,["code"])):r.value==="echarts"?(I.openBlock(),I.createBlock(Dvr,{key:1,code:e.value},null,8,["code"])):(I.openBlock(),I.createBlock(pnr,{key:2,code:e.value,lang:r.value},null,8,["code","lang"]))}},Ivr={class:"markdown-body"},kvr=["onClick"],CH=Object.assign({name:"AiMdParser"},{__name:"MdParser",props:I.mergeDefaults({content:String},{content:""}),setup(t){function e(h){const f=[];let p=0;return h=h.replace(/\$\$([\s\S]*?)\$\$/g,g=>{const m=`__PROTECTED_MATH_BLOCK_${p}__`;return f[p]=g,p++,m}),h=h.replace(/\$([^\$\n]+?)\$/g,(g,m)=>{if(/[\u4e00-\u9fa5。,、“”‘’;:?!【】()《》]/.test(m))return g;const T=`__PROTECTED_INLINE_MATH_${p}__`;return f[p]=g,p++,T}),h=h.replace(/```[\s\S]*?```/g,g=>{const m=`__PROTECTED_CODE_BLOCK_${p}__`;return f[p]=g,p++,m}),h=h.replace(/`([^`]+)`/g,g=>{const m=`__PROTECTED_INLINE_CODE_${p}__`;return f[p]=g,p++,m}),{markdown:h,protectedRegions:f}}function r(h,f){let p=h;return f.forEach((g,m)=>{let T="INLINE_CODE";g.startsWith("```")?T="CODE_BLOCK":g.startsWith("$$")?T="MATH_BLOCK":g.startsWith("$")&&(T="INLINE_MATH");const v=`__PROTECTED_${T}_${m}__`;p=p.split(v).join(g)}),p}function n(h){return h.replace(/\\n/g,`
964
- `).replace(/\\r/g,"\r").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\v/g,"\v").replace(/\$/g,"\\$")}function i(h){const{markdown:f,protectedRegions:p}=e(h),g=n(f);return r(g,p)}const a=/(?:https?:\/\/|www\.)?(?:\d{1,3}(?:\.\d{1,3}){3}|\w[-\w.]+(?:\.[a-zA-Z]{2,}))(?:\:\d+)?(?:\/[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:\?[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:#[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?/g;function o(h){const f=[];return h.replace(/<[^>]+>/gi,m=>(f.push(m),`__PROTECTED_PLACEHOLDER_${f.length-1}__`)).replace(a,m=>` ${m} `).replace(/__PROTECTED_PLACEHOLDER_(\d+)__/g,(m,T)=>f[T])}const s=h=>Lxt(i,o)(h),l=I.computed(()=>s(t.content)),u={singleTilde:!1},d=h=>{const f=document.querySelector(h.properties.href);f&&(f.style.background="yellow",setTimeout(()=>{f.style.background=""},2e3))};return(h,f)=>{const p=Eg;return I.openBlock(),I.createElementBlock("div",Ivr,[I.createVNode(Rte,{markdown:l.value,remarkPlugins:[[I.unref(OWt),u],I.unref(GWt),I.unref(DWt),I.unref(zWt)],rehypePlugins:[I.unref(SKt),I.unref(YKt),I.unref(Ntr)]},{a:I.withCtx(({node:g})=>{var m,T;return[g.properties.href.startsWith("#")?(I.openBlock(),I.createElementBlock("a",I.mergeProps({key:0},g.properties,{onClick:v=>d(g)}),I.toDisplayString((m=g.children[0])==null?void 0:m.value),17,kvr)):(I.openBlock(),I.createElementBlock("a",I.mergeProps({key:1},g.properties,{target:"_blank",rel:"noopener noreferrer"}),I.toDisplayString((T=g.children[0])==null?void 0:T.value),17))]}),pre:I.withCtx(({node:g})=>[I.createVNode(Nvr,{node:g},null,8,["node"])]),img:I.withCtx(({node:g})=>[I.createVNode(p,I.mergeProps(g.properties,{previewMask:!1,style:{cursor:"pointer"}}),null,16)]),_:1},8,["markdown","remarkPlugins","rehypePlugins"])])}}}),Pvr={key:0,class:"ai-chat-record-avatar"},Bvr={class:"ai-chat-record-wrap"},Hvr={class:"ai-chat-record-head"},Fvr={key:0,class:"ai-chat-record-time"},Vvr={class:"ai-chat-record-body"},$vr={key:0,class:"ai-chat-record-loading-wrap"},Uvr={key:1,class:"ai-chat-record-content"},zvr={class:"ai-chat-record-content-before"},Gvr={class:"ai-chat-record-content-inner"},qvr={class:"ai-chat-record-content-after"},Wvr={key:0,class:"character-count"},Yvr={key:0,class:"ai-chat-record-foot"},jvr={class:"foot-actions"},Xvr={key:0,class:"copy-tooltip-inner"},Kvr={key:1,class:"copy-tooltip-inner copy-tooltip-inner--error"},fZe=oa(Object.assign({name:"AiChatRecord"},{__name:"ChatRecord",props:{status:{type:String,default:"done"},loadingMessage:{type:String,default:"AI\u7EC4\u7EC7\u8BED\u8A00\u4E2D"},pos:{type:String,default:"l"},fullWidth:{type:Boolean,default:!1},avatar:{type:String,default:""},showAvatar:{type:Boolean,default:!0},content:{type:String,default:""},time:{type:String},showTime:{type:Boolean,default:!0},timeFormat:{type:String,default:"yyyy/MM/dd hh:mm:ss"},showCharacterCount:{type:Boolean,default:!0},showFoot:{type:Boolean,default:!0},actions:{type:Array,default:()=>["copy","regenerate"]},copyTipType:{type:String,default:"tooltip"}},emits:["regenerate"],setup(t,{expose:e,emit:r}){const n={Loading:"loading",Generating:"generating",Done:"done"},i=t,a=r,o=I.ref(),s=I.ref(!0),l=I.ref(!1),u=I.computed(()=>HLe(i.time,i.timeFormat)),d=I.computed(()=>{var f,p;if(i.status==="done"){let g=(p=(f=o.value)==null?void 0:f.querySelector(".ai-chat-record-content-inner"))==null?void 0:p.innerText;return(g==null?void 0:g.length)??0}else return 0});function h(){var g;let f=(g=o.value)==null?void 0:g.querySelector(".ai-chat-record-content-inner");if(!f)return;function p(){i.copyTipType==="message"?s.value?ma.success("\u590D\u5236\u6210\u529F"):ma.error("\u590D\u5236\u5931\u8D25"):(l.value=!0,setTimeout(()=>{l.value=!1},1e3))}FLe(f).then(()=>{s.value=!0,p()}).catch(()=>{s.value=!1,p()})}return e({statusEnum:n}),(f,p)=>{const g=_v,m=k6;return I.openBlock(),I.createElementBlock("div",{ref_key:"elRef",ref:o,class:I.normalizeClass(["ai-chat-record",{"ai-chat-record--r":t.pos==="r","ai-chat-record--full-width":t.fullWidth,"ai-chat-record--show-time":t.showTime}])},[t.showAvatar?(I.openBlock(),I.createElementBlock("div",Pvr,[I.renderSlot(f.$slots,"avatar",{},()=>[I.createVNode(g,{size:40,src:t.avatar},{icon:I.withCtx(()=>p[1]||(p[1]=[])),_:1},8,["src"])],!0)])):I.createCommentVNode("",!0),I.createElementVNode("div",Bvr,[I.createElementVNode("div",Hvr,[I.renderSlot(f.$slots,"head",{},()=>[t.showTime?(I.openBlock(),I.createElementBlock("div",Fvr,[I.renderSlot(f.$slots,"time",{time:u.value},()=>[I.createTextVNode(I.toDisplayString(u.value),1)],!0)])):I.createCommentVNode("",!0),I.renderSlot(f.$slots,"headRight",{},void 0,!0)],!0)]),I.createElementVNode("div",Vvr,[t.status===n.Loading?(I.openBlock(),I.createElementBlock("div",$vr,[I.renderSlot(f.$slots,"loading",{},()=>[I.createVNode(GUt,{theme:t.pos==="r"?"light":"",message:t.loadingMessage},null,8,["theme","message"])],!0)])):(I.openBlock(),I.createElementBlock("div",Uvr,[I.createElementVNode("div",zvr,[I.renderSlot(f.$slots,"contentBefore",{},void 0,!0)]),I.createElementVNode("div",Gvr,[I.renderSlot(f.$slots,"content",{},()=>[I.createVNode(CH,{content:t.content},null,8,["content"])],!0)]),I.createElementVNode("div",qvr,[I.renderSlot(f.$slots,"contentAfter",{},void 0,!0)]),t.showCharacterCount&&t.status===n.Done?(I.openBlock(),I.createElementBlock("div",Wvr,[I.renderSlot(f.$slots,"characterCountBefore",{},void 0,!0),I.renderSlot(f.$slots,"characterCount",{},()=>[I.withDirectives(I.createElementVNode("span",null,"\u5171"+I.toDisplayString(d.value)+"\u4E2A\u5B57\u7B26",513),[[I.vShow,d.value]])],!0),I.renderSlot(f.$slots,"characterCountAfter",{},void 0,!0)])):I.createCommentVNode("",!0)]))]),t.showFoot?(I.openBlock(),I.createElementBlock("div",Yvr,[I.renderSlot(f.$slots,"foot",{},()=>[I.createElementVNode("div",jvr,[I.renderSlot(f.$slots,"actionsBefore",{},void 0,!0),I.renderSlot(f.$slots,"actions",{},()=>[I.createVNode(m,{overlayClassName:"copy-tooltip",open:l.value,color:"#fff"},{title:I.withCtx(()=>[s.value?(I.openBlock(),I.createElementBlock("span",Xvr,[I.createVNode(I.unref(bg),{class:"copy-tooltip-icon"}),p[2]||(p[2]=I.createTextVNode(" \u590D\u5236\u6210\u529F "))])):(I.openBlock(),I.createElementBlock("span",Kvr,[I.createVNode(I.unref(xR),{class:"copy-tooltip-icon"}),p[3]||(p[3]=I.createTextVNode(" \u590D\u5236\u5931\u8D25 "))]))]),default:I.withCtx(()=>[I.createVNode(m,{title:"\u590D\u5236"},{default:I.withCtx(()=>[t.status===n.Done&&t.actions.includes("copy")?(I.openBlock(),I.createElementBlock("button",{key:0,class:"action",onClick:h},p[4]||(p[4]=[I.createElementVNode("i",{class:"action-icon ai-icon ai-icon-copy"},null,-1)]))):I.createCommentVNode("",!0)]),_:1})]),_:1},8,["open"]),I.createVNode(m,{title:"\u91CD\u65B0\u751F\u6210"},{default:I.withCtx(()=>[t.status===n.Done&&t.actions.includes("regenerate")?(I.openBlock(),I.createElementBlock("button",{key:0,class:"action",onClick:p[0]||(p[0]=T=>a("regenerate"))},p[5]||(p[5]=[I.createElementVNode("i",{class:"action-icon ai-icon ai-icon-shuaxin"},null,-1)]))):I.createCommentVNode("",!0)]),_:1})],!0),I.renderSlot(f.$slots,"actionsAfter",{},void 0,!0)])],!0)])):I.createCommentVNode("",!0),I.renderSlot(f.$slots,"bottom",{},void 0,!0)])],2)}}}),[["__scopeId","data-v-9c9dad67"]]);var pZe=11;function Zvr(t,e){var r=e.attributes,n,i,a,o,s;if(!(e.nodeType===pZe||t.nodeType===pZe)){for(var l=r.length-1;l>=0;l--)n=r[l],i=n.name,a=n.namespaceURI,o=n.value,a?(i=n.localName||i,s=t.getAttributeNS(a,i),s!==o&&(n.prefix==="xmlns"&&(i=n.name),t.setAttributeNS(a,i,o))):(s=t.getAttribute(i),s!==o&&t.setAttribute(i,o));for(var u=t.attributes,d=u.length-1;d>=0;d--)n=u[d],i=n.name,a=n.namespaceURI,a?(i=n.localName||i,e.hasAttributeNS(a,i)||t.removeAttributeNS(a,i)):e.hasAttribute(i)||t.removeAttribute(i)}}var LH,Jvr="http://www.w3.org/1999/xhtml",Lc=typeof document>"u"?void 0:document,e9r=!!Lc&&"content"in Lc.createElement("template"),t9r=!!Lc&&Lc.createRange&&"createContextualFragment"in Lc.createRange();function r9r(t){var e=Lc.createElement("template");return e.innerHTML=t,e.content.childNodes[0]}function n9r(t){LH||(LH=Lc.createRange(),LH.selectNode(Lc.body));var e=LH.createContextualFragment(t);return e.childNodes[0]}function i9r(t){var e=Lc.createElement("body");return e.innerHTML=t,e.childNodes[0]}function a9r(t){return t=t.trim(),e9r?r9r(t):t9r?n9r(t):i9r(t)}function wH(t,e){var r=t.nodeName,n=e.nodeName,i,a;return r===n?!0:(i=r.charCodeAt(0),a=n.charCodeAt(0),i<=90&&a>=97?r===n.toUpperCase():a<=90&&i>=97?n===r.toUpperCase():!1)}function o9r(t,e){return!e||e===Jvr?Lc.createElement(t):Lc.createElementNS(e,t)}function s9r(t,e){for(var r=t.firstChild;r;){var n=r.nextSibling;e.appendChild(r),r=n}return e}function Ule(t,e,r){t[r]!==e[r]&&(t[r]=e[r],t[r]?t.setAttribute(r,""):t.removeAttribute(r))}var gZe={OPTION:function(t,e){var r=t.parentNode;if(r){var n=r.nodeName.toUpperCase();n==="OPTGROUP"&&(r=r.parentNode,n=r&&r.nodeName.toUpperCase()),n==="SELECT"&&!r.hasAttribute("multiple")&&(t.hasAttribute("selected")&&!e.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),r.selectedIndex=-1)}Ule(t,e,"selected")},INPUT:function(t,e){Ule(t,e,"checked"),Ule(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),e.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var r=e.value;t.value!==r&&(t.value=r);var n=t.firstChild;if(n){var i=n.nodeValue;if(i==r||!r&&i==t.placeholder)return;n.nodeValue=r}},SELECT:function(t,e){if(!e.hasAttribute("multiple")){for(var r=-1,n=0,i=t.firstChild,a,o;i;)if(o=i.nodeName&&i.nodeName.toUpperCase(),o==="OPTGROUP")a=i,i=a.firstChild;else{if(o==="OPTION"){if(i.hasAttribute("selected")){r=n;break}n++}i=i.nextSibling,!i&&a&&(i=a.nextSibling,a=null)}t.selectedIndex=r}}},Aw=1,mZe=11,TZe=3,vZe=8;function Z5(){}function l9r(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}function u9r(t){return function(r,n,i){if(i||(i={}),typeof n=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"||r.nodeName==="BODY"){var a=n;n=Lc.createElement("html"),n.innerHTML=a}else n=a9r(n);else n.nodeType===mZe&&(n=n.firstElementChild);var o=i.getNodeKey||l9r,s=i.onBeforeNodeAdded||Z5,l=i.onNodeAdded||Z5,u=i.onBeforeElUpdated||Z5,d=i.onElUpdated||Z5,h=i.onBeforeNodeDiscarded||Z5,f=i.onNodeDiscarded||Z5,p=i.onBeforeElChildrenUpdated||Z5,g=i.skipFromChildren||Z5,m=i.addChild||function(B,k){return B.appendChild(k)},T=i.childrenOnly===!0,v=Object.create(null),y=[];function _(B){y.push(B)}function Q(B,k){if(B.nodeType===Aw)for(var V=B.firstChild;V;){var H=void 0;k&&(H=o(V))?_(H):(f(V),V.firstChild&&Q(V,k)),V=V.nextSibling}}function b(B,k,V){h(B)!==!1&&(k&&k.removeChild(B),f(B),Q(B,V))}function x(B){if(B.nodeType===Aw||B.nodeType===mZe)for(var k=B.firstChild;k;){var V=o(k);V&&(v[V]=k),x(k),k=k.nextSibling}}x(r);function E(B){l(B);for(var k=B.firstChild;k;){var V=k.nextSibling,H=o(k);if(H){var $=v[H];$&&wH(k,$)?(k.parentNode.replaceChild($,k),C($,k)):E(k)}else E(k);k=V}}function S(B,k,V){for(;k;){var H=k.nextSibling;(V=o(k))?_(V):b(k,B,!0),k=H}}function C(B,k,V){var H=o(k);if(H&&delete v[H],!V){var $=u(B,k);if($===!1||($ instanceof HTMLElement&&(B=$,x(B)),t(B,k),d(B),p(B,k)===!1))return}B.nodeName!=="TEXTAREA"?L(B,k):gZe.TEXTAREA(B,k)}function L(B,k){var V=g(B,k),H=k.firstChild,$=B.firstChild,G,U,Y,ne,te;e:for(;H;){for(ne=H.nextSibling,G=o(H);!V&&$;){if(Y=$.nextSibling,H.isSameNode&&H.isSameNode($)){H=ne,$=Y;continue e}U=o($);var ee=$.nodeType,ie=void 0;if(ee===H.nodeType&&(ee===Aw?(G?G!==U&&((te=v[G])?Y===te?ie=!1:(B.insertBefore(te,$),U?_(U):b($,B,!0),$=te,U=o($)):ie=!1):U&&(ie=!1),ie=ie!==!1&&wH($,H),ie&&C($,H)):(ee===TZe||ee==vZe)&&(ie=!0,$.nodeValue!==H.nodeValue&&($.nodeValue=H.nodeValue))),ie){H=ne,$=Y;continue e}U?_(U):b($,B,!0),$=Y}if(G&&(te=v[G])&&wH(te,H))V||m(B,te),C(te,H);else{var j=s(H);j!==!1&&(j&&(H=j),H.actualize&&(H=H.actualize(B.ownerDocument||Lc)),m(B,H),E(H))}H=ne,$=Y}S(B,$,U);var X=gZe[B.nodeName];X&&X(B,k)}var w=r,O=w.nodeType,R=n.nodeType;if(!T){if(O===Aw)R===Aw?wH(r,n)||(f(r),w=s9r(r,o9r(n.nodeName,n.namespaceURI))):w=n;else if(O===TZe||O===vZe){if(R===O)return w.nodeValue!==n.nodeValue&&(w.nodeValue=n.nodeValue),w;w=n}}if(w===n)f(r);else{if(n.isSameNode&&n.isSameNode(w))return;if(C(w,n,T),y)for(var M=0,D=y.length;M<D;M++){var P=v[y[M]];P&&b(P,P.parentNode,!1)}}return!T&&w!==r&&r.parentNode&&(w.actualize&&(w=w.actualize(r.ownerDocument||Lc)),r.parentNode.replaceChild(w,r)),w}}var c9r=u9r(Zvr);const d9r={key:1,class:"ai-content-parser-inner"},yZe=Object.assign({name:"AiContentParser"},{__name:"ContentParser",props:{type:{type:String,default:"text"},content:String,stream:{type:Boolean,default:!1},streamDone:{type:Boolean,default:!1}},setup(t){const e=t,r=I.ref(null),n=I.ref("");return I.onMounted(()=>{I.watch(()=>e.content,()=>{if(n.value=e.type==="markdown"?VLe.parse(e.content):e.content,e.type==="markdown"||e.type==="html"){const i=document.createElement("div");i.innerHTML=n.value,i.classList.add("ai-content-parser-inner"),c9r(r.value,i)}},{immediate:!0})}),(i,a)=>(I.openBlock(),I.createElementBlock("div",{class:I.normalizeClass(["ai-content-parser",`ai-content-parser--${t.type}`])},[t.type==="html"||t.type==="markdown"?(I.openBlock(),I.createElementBlock("div",{key:0,ref_key:"contentRef",ref:r,class:"ai-content-parser-inner"},null,512)):(I.openBlock(),I.createElementBlock("div",d9r,I.toDisplayString(n.value),1))],2))}}),h9r={class:"ai-think-parser"},f9r={class:"ai-think-parser-content"},_Ze=oa(Object.assign({name:"AiThinkParser"},{__name:"ThinkParser",setup(t){return(e,r)=>(I.openBlock(),I.createElementBlock("div",h9r,[I.createElementVNode("div",f9r,[I.renderSlot(e.$slots,"content",{},()=>[I.createVNode(CH,I.normalizeProps(I.guardReactiveProps(e.$attrs)),null,16)],!0)])]))}}),[["__scopeId","data-v-70d4677e"]]);function Ql(t){this.content=t}Ql.prototype={constructor:Ql,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,i=n.find(t),a=n.content.slice();return i==-1?a.push(r||t,e):(a[i+1]=e,r&&(a[i]=r)),new Ql(a)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new Ql(r)},addToStart:function(t,e){return new Ql([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new Ql(r)},addBefore:function(t,e,r){var n=this.remove(e),i=n.content.slice(),a=n.find(t);return i.splice(a==-1?i.length:a,0,e,r),new Ql(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ql.from(t),t.size?new Ql(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ql.from(t),t.size?new Ql(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ql.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}},Ql.from=function(t){if(t instanceof Ql)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new Ql(e)};function bZe(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),a=e.child(n);if(i==a){r+=i.nodeSize;continue}if(!i.sameMarkup(a))return r;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)r++;return r}if(i.content.size||a.content.size){let o=bZe(i.content,a.content,r+1);if(o!=null)return o}r+=i.nodeSize}}function QZe(t,e,r,n){for(let i=t.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:r,b:n};let o=t.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){r-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:r,b:n};if(o.isText&&o.text!=s.text){let u=0,d=Math.min(o.text.length,s.text.length);for(;u<d&&o.text[o.text.length-u-1]==s.text[s.text.length-u-1];)u++,r--,n--;return{a:r,b:n}}if(o.content.size||s.content.size){let u=QZe(o.content,s.content,r-1,n-1);if(u)return u}r-=l,n-=l}}class Gt{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,i=0,a){for(let o=0,s=0;s<r;o++){let l=this.content[o],u=s+l.nodeSize;if(u>e&&n(l,i+s,a||null,o)!==!1&&l.content.size){let d=s+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,r-d),n,i+d)}s=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let a="",o=!0;return this.nodesBetween(e,r,(s,l)=>{let u=s.isText?s.text.slice(Math.max(e,l)-l,r-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&n&&(o?o=!1:a+=n),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new Gt(i,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],i=0;if(r>e)for(let a=0,o=0;o<r;a++){let s=this.content[a],l=o+s.nodeSize;l>e&&((o<e||l>r)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,r-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,r-o-1))),n.push(s),i+=s.nodeSize),o=l}return new Gt(n,i)}cutByIndex(e,r){return e==r?Gt.empty:e==0&&r==this.content.length?this:new Gt(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),a=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new Gt(i,a)}addToStart(e){return new Gt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Gt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let i=this.content[r];e(i,n,r),n+=i.nodeSize}}findDiffStart(e,r=0){return bZe(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return QZe(this,e,r,n)}findIndex(e){if(e==0)return AH(0,e);if(e==this.size)return AH(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let i=this.child(r),a=n+i.nodeSize;if(a>=e)return a==e?AH(r+1,a):AH(r,n);n=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return Gt.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new Gt(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Gt.empty;let r,n=0;for(let i=0;i<e.length;i++){let a=e[i];n+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(r||(r=e.slice(0,i)),r[r.length-1]=a.withText(r[r.length-1].text+a.text)):r&&r.push(a)}return new Gt(r||e,n)}static from(e){if(!e)return Gt.empty;if(e instanceof Gt)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Gt([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Gt.empty=new Gt([],0);const zle={index:0,offset:0};function AH(t,e){return zle.index=t,zle.offset=e,zle}function OH(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!OH(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!OH(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let ha=class sfe{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))r||(r=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!n&&a.type.rank>this.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(a)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&OH(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let i=n.create(r.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return sfe.none;if(e instanceof sfe)return[e];let r=e.slice();return r.sort((n,i)=>n.type.rank-i.type.rank),r}};ha.none=[];class MH extends Error{}class Lr{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=EZe(this.content,e+this.openStart,r);return n&&new Lr(n,this.openStart,this.openEnd)}removeBetween(e,r){return new Lr(xZe(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return Lr.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Lr(Gt.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.lastChild)i++;return new Lr(e,n,i)}}Lr.empty=new Lr(Gt.empty,0,0);function xZe(t,e,r){let{index:n,offset:i}=t.findIndex(e),a=t.maybeChild(n),{index:o,offset:s}=t.findIndex(r);if(i==e||a.isText){if(s!=r&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(n,a.copy(xZe(a.content,e-i-1,r-i-1)))}function EZe(t,e,r,n){let{index:i,offset:a}=t.findIndex(e),o=t.maybeChild(i);if(a==e||o.isText)return t.cut(0,e).append(r).append(t.cut(e));let s=EZe(o.content,e-a-1,r);return s&&t.replaceChild(i,o.copy(s))}function p9r(t,e,r){if(r.openStart>t.depth)throw new MH("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new MH("Inconsistent open depths");return SZe(t,e,r,0)}function SZe(t,e,r,n){let i=t.index(n),a=t.node(n);if(i==e.index(n)&&n<t.depth-r.openStart){let o=SZe(t,e,r,n+1);return a.copy(a.content.replaceChild(i,o))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let o=t.parent,s=o.content;return Q8(o,s.cut(0,t.parentOffset).append(r.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=g9r(r,t);return Q8(a,LZe(t,o,s,e,n))}else return Q8(a,RH(t,e,n))}function CZe(t,e){if(!e.type.compatibleContent(t.type))throw new MH("Cannot join "+e.type.name+" onto "+t.type.name)}function Gle(t,e,r){let n=t.node(r);return CZe(n,e.node(r)),n}function b8(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function Ow(t,e,r,n){let i=(e||t).node(r),a=0,o=e?e.index(r):i.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(b8(t.nodeAfter,n),a++));for(let s=a;s<o;s++)b8(i.child(s),n);e&&e.depth==r&&e.textOffset&&b8(e.nodeBefore,n)}function Q8(t,e){return t.type.checkContent(e),t.copy(e)}function LZe(t,e,r,n,i){let a=t.depth>i&&Gle(t,e,i+1),o=n.depth>i&&Gle(r,n,i+1),s=[];return Ow(null,t,i,s),a&&o&&e.index(i)==r.index(i)?(CZe(a,o),b8(Q8(a,LZe(t,e,r,n,i+1)),s)):(a&&b8(Q8(a,RH(t,e,i+1)),s),Ow(e,r,i,s),o&&b8(Q8(o,RH(r,n,i+1)),s)),Ow(n,null,i,s),new Gt(s)}function RH(t,e,r){let n=[];if(Ow(null,t,r,n),t.depth>r){let i=Gle(t,e,r+1);b8(Q8(i,RH(t,e,r+1)),n)}return Ow(e,null,r,n),new Gt(n)}function g9r(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let a=r-1;a>=0;a--)i=e.node(a).copy(Gt.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class Mw{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let a=0;a<e;a++)i+=n.child(a).nodeSize;return i}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return ha.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),i=e.maybeChild(r);if(!n){let s=n;n=i,i=s}let a=n.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!i||!a[o].isInSet(i.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<n.length;a++)n[a].type.spec.inclusive===!1&&(!i||!n[a].isInSet(i.marks))&&(n=n[a--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new DH(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,a=r;for(let o=e;;){let{index:s,offset:l}=o.content.findIndex(a),u=a-l;if(n.push(o,s,i+l),!u||(o=o.child(s),o.isText))break;a=u-1,i+=l+1}return new Mw(r,n,a)}static resolveCached(e,r){let n=wZe.get(e);if(n)for(let a=0;a<n.elts.length;a++){let o=n.elts[a];if(o.pos==r)return o}else wZe.set(e,n=new m9r);let i=n.elts[n.i]=Mw.resolve(e,r);return n.i=(n.i+1)%T9r,i}}class m9r{constructor(){this.elts=[],this.i=0}}const T9r=12,wZe=new WeakMap;class DH{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const v9r=Object.create(null);class Od{constructor(e,r,n,i=ha.none){this.type=e,this.attrs=r,this.marks=i,this.content=n||Gt.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,r,n,i=0){this.content.nodesBetween(e,r,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,i){return this.content.textBetween(e,r,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,r,n){return this.type==e&&OH(this.attrs,r||e.defaultAttrs||v9r)&&ha.sameSet(this.marks,n||ha.none)}copy(e=null){return e==this.content?this:new Od(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Od(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return Lr.empty;let i=this.resolve(e),a=this.resolve(r),o=n?0:i.sharedDepth(r),s=i.start(o),u=i.node(o).content.cut(i.pos-s,a.pos-s);return new Lr(u,i.depth-o,a.depth-o)}replace(e,r,n){return p9r(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:i}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(i==e||r.isText)return r;e-=i+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let i=this.content.child(r-1);return{node:i,index:r-1,offset:n-i.nodeSize}}resolve(e){return Mw.resolveCached(this,e)}resolveNoCache(e){return Mw.resolve(this,e)}rangeHasMark(e,r,n){let i=!1;return r>e&&this.nodesBetween(e,r,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),AZe(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=Gt.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,r);if(!s||!s.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,r,n,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(n),o=a&&a.matchFragment(this.content,r);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ha.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!ha.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=Gt.fromJSON(e,r.content),a=e.nodeType(r.type).create(r.attrs,i,n);return a.type.checkAttrs(a.attrs),a}}Od.prototype.text=void 0;class NH extends Od{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):AZe(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new NH(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new NH(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function AZe(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class x8{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new y9r(e,r);if(n.next==null)return x8.empty;let i=OZe(n);n.next&&n.err("Unexpected trailing text");let a=C9r(S9r(i));return L9r(a,n),a}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let i=this;for(let a=r;i&&a<n;a++)i=i.matchType(e.child(a).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let i=[this];function a(o,s){let l=o.matchFragment(e,n);if(l&&(!r||l.validEnd))return Gt.from(s.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:d,next:h}=o.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let f=a(h,s.concat(d));if(f)return f}}return null}return a(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),a=i.match;if(a.matchType(e)){let o=[];for(let s=i;s.type;s=s.via)o.push(s.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:s,next:l}=a.next[o];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in r)&&(!i.type||l.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),r[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&r(n.next[i].next)}return r(this),e.map((n,i)=>{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)a+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return a}).join(`
964
+ `).replace(/\\r/g,"\r").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\v/g,"\v").replace(/\$/g,"\\$")}function i(h){const{markdown:f,protectedRegions:p}=e(h),g=n(f);return r(g,p)}const a=/(?:https?:\/\/|www\.)?(?:\d{1,3}(?:\.\d{1,3}){3}|\w[-\w.]+(?:\.[a-zA-Z]{2,}))(?:\:\d+)?(?:\/[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:\?[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:#[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?/g;function o(h){const f=[];return h.replace(/<[^>]+>/gi,m=>(f.push(m),`__PROTECTED_PLACEHOLDER_${f.length-1}__`)).replace(a,m=>` ${m} `).replace(/__PROTECTED_PLACEHOLDER_(\d+)__/g,(m,T)=>f[T])}const s=h=>Lxt(i,o)(h),l=I.computed(()=>s(t.content)),u={singleTilde:!1},d=h=>{const f=document.getElementById(h.properties.href.split("#")[1]);f&&(f.style.background="yellow",setTimeout(()=>{f.style.background=""},2e3))};return(h,f)=>{const p=Eg;return I.openBlock(),I.createElementBlock("div",Ivr,[I.createVNode(Rte,{markdown:l.value,remarkPlugins:[[I.unref(OWt),u],I.unref(GWt),I.unref(DWt),I.unref(zWt)],rehypePlugins:[I.unref(SKt),I.unref(YKt),I.unref(Ntr)]},{a:I.withCtx(({node:g})=>{var m,T,v;return[(m=g.properties.href)!=null&&m.startsWith("#")?(I.openBlock(),I.createElementBlock("a",I.mergeProps({key:0},g.properties,{onClick:y=>d(g)}),I.toDisplayString((T=g.children[0])==null?void 0:T.value),17,kvr)):(I.openBlock(),I.createElementBlock("a",I.mergeProps({key:1},g.properties,{target:"_blank",rel:"noopener noreferrer"}),I.toDisplayString((v=g.children[0])==null?void 0:v.value),17))]}),pre:I.withCtx(({node:g})=>[I.createVNode(Nvr,{node:g},null,8,["node"])]),img:I.withCtx(({node:g})=>[I.createVNode(p,I.mergeProps(g.properties,{previewMask:!1,style:{cursor:"pointer"}}),null,16)]),_:1},8,["markdown","remarkPlugins","rehypePlugins"])])}}}),Pvr={key:0,class:"ai-chat-record-avatar"},Bvr={class:"ai-chat-record-wrap"},Hvr={class:"ai-chat-record-head"},Fvr={key:0,class:"ai-chat-record-time"},Vvr={class:"ai-chat-record-body"},$vr={key:0,class:"ai-chat-record-loading-wrap"},Uvr={key:1,class:"ai-chat-record-content"},zvr={class:"ai-chat-record-content-before"},Gvr={class:"ai-chat-record-content-inner"},qvr={class:"ai-chat-record-content-after"},Wvr={key:0,class:"character-count"},Yvr={key:0,class:"ai-chat-record-foot"},jvr={class:"foot-actions"},Xvr={key:0,class:"copy-tooltip-inner"},Kvr={key:1,class:"copy-tooltip-inner copy-tooltip-inner--error"},fZe=oa(Object.assign({name:"AiChatRecord"},{__name:"ChatRecord",props:{status:{type:String,default:"done"},loadingMessage:{type:String,default:"AI\u7EC4\u7EC7\u8BED\u8A00\u4E2D"},pos:{type:String,default:"l"},fullWidth:{type:Boolean,default:!1},avatar:{type:String,default:""},showAvatar:{type:Boolean,default:!0},content:{type:String,default:""},time:{type:String},showTime:{type:Boolean,default:!0},timeFormat:{type:String,default:"yyyy/MM/dd hh:mm:ss"},showCharacterCount:{type:Boolean,default:!0},showFoot:{type:Boolean,default:!0},actions:{type:Array,default:()=>["copy","regenerate"]},copyTipType:{type:String,default:"tooltip"}},emits:["regenerate"],setup(t,{expose:e,emit:r}){const n={Loading:"loading",Generating:"generating",Done:"done"},i=t,a=r,o=I.ref(),s=I.ref(!0),l=I.ref(!1),u=I.computed(()=>HLe(i.time,i.timeFormat)),d=I.computed(()=>{var f,p;if(i.status==="done"){let g=(p=(f=o.value)==null?void 0:f.querySelector(".ai-chat-record-content-inner"))==null?void 0:p.innerText;return(g==null?void 0:g.length)??0}else return 0});function h(){var g;let f=(g=o.value)==null?void 0:g.querySelector(".ai-chat-record-content-inner");if(!f)return;function p(){i.copyTipType==="message"?s.value?ma.success("\u590D\u5236\u6210\u529F"):ma.error("\u590D\u5236\u5931\u8D25"):(l.value=!0,setTimeout(()=>{l.value=!1},1e3))}FLe(f).then(()=>{s.value=!0,p()}).catch(()=>{s.value=!1,p()})}return e({statusEnum:n}),(f,p)=>{const g=_v,m=k6;return I.openBlock(),I.createElementBlock("div",{ref_key:"elRef",ref:o,class:I.normalizeClass(["ai-chat-record",{"ai-chat-record--r":t.pos==="r","ai-chat-record--full-width":t.fullWidth,"ai-chat-record--show-time":t.showTime}])},[t.showAvatar?(I.openBlock(),I.createElementBlock("div",Pvr,[I.renderSlot(f.$slots,"avatar",{},()=>[I.createVNode(g,{size:40,src:t.avatar},{icon:I.withCtx(()=>p[1]||(p[1]=[])),_:1},8,["src"])],!0)])):I.createCommentVNode("",!0),I.createElementVNode("div",Bvr,[I.createElementVNode("div",Hvr,[I.renderSlot(f.$slots,"head",{},()=>[t.showTime?(I.openBlock(),I.createElementBlock("div",Fvr,[I.renderSlot(f.$slots,"time",{time:u.value},()=>[I.createTextVNode(I.toDisplayString(u.value),1)],!0)])):I.createCommentVNode("",!0),I.renderSlot(f.$slots,"headRight",{},void 0,!0)],!0)]),I.createElementVNode("div",Vvr,[t.status===n.Loading?(I.openBlock(),I.createElementBlock("div",$vr,[I.renderSlot(f.$slots,"loading",{},()=>[I.createVNode(GUt,{theme:t.pos==="r"?"light":"",message:t.loadingMessage},null,8,["theme","message"])],!0)])):(I.openBlock(),I.createElementBlock("div",Uvr,[I.createElementVNode("div",zvr,[I.renderSlot(f.$slots,"contentBefore",{},void 0,!0)]),I.createElementVNode("div",Gvr,[I.renderSlot(f.$slots,"content",{},()=>[I.createVNode(CH,{content:t.content},null,8,["content"])],!0)]),I.createElementVNode("div",qvr,[I.renderSlot(f.$slots,"contentAfter",{},void 0,!0)]),t.showCharacterCount&&t.status===n.Done?(I.openBlock(),I.createElementBlock("div",Wvr,[I.renderSlot(f.$slots,"characterCountBefore",{},void 0,!0),I.renderSlot(f.$slots,"characterCount",{},()=>[I.withDirectives(I.createElementVNode("span",null,"\u5171"+I.toDisplayString(d.value)+"\u4E2A\u5B57\u7B26",513),[[I.vShow,d.value]])],!0),I.renderSlot(f.$slots,"characterCountAfter",{},void 0,!0)])):I.createCommentVNode("",!0)]))]),t.showFoot?(I.openBlock(),I.createElementBlock("div",Yvr,[I.renderSlot(f.$slots,"foot",{},()=>[I.createElementVNode("div",jvr,[I.renderSlot(f.$slots,"actionsBefore",{},void 0,!0),I.renderSlot(f.$slots,"actions",{},()=>[I.createVNode(m,{overlayClassName:"copy-tooltip",open:l.value,color:"#fff"},{title:I.withCtx(()=>[s.value?(I.openBlock(),I.createElementBlock("span",Xvr,[I.createVNode(I.unref(bg),{class:"copy-tooltip-icon"}),p[2]||(p[2]=I.createTextVNode(" \u590D\u5236\u6210\u529F "))])):(I.openBlock(),I.createElementBlock("span",Kvr,[I.createVNode(I.unref(xR),{class:"copy-tooltip-icon"}),p[3]||(p[3]=I.createTextVNode(" \u590D\u5236\u5931\u8D25 "))]))]),default:I.withCtx(()=>[I.createVNode(m,{title:"\u590D\u5236"},{default:I.withCtx(()=>[t.status===n.Done&&t.actions.includes("copy")?(I.openBlock(),I.createElementBlock("button",{key:0,class:"action",onClick:h},p[4]||(p[4]=[I.createElementVNode("i",{class:"action-icon ai-icon ai-icon-copy"},null,-1)]))):I.createCommentVNode("",!0)]),_:1})]),_:1},8,["open"]),I.createVNode(m,{title:"\u91CD\u65B0\u751F\u6210"},{default:I.withCtx(()=>[t.status===n.Done&&t.actions.includes("regenerate")?(I.openBlock(),I.createElementBlock("button",{key:0,class:"action",onClick:p[0]||(p[0]=T=>a("regenerate"))},p[5]||(p[5]=[I.createElementVNode("i",{class:"action-icon ai-icon ai-icon-shuaxin"},null,-1)]))):I.createCommentVNode("",!0)]),_:1})],!0),I.renderSlot(f.$slots,"actionsAfter",{},void 0,!0)])],!0)])):I.createCommentVNode("",!0),I.renderSlot(f.$slots,"bottom",{},void 0,!0)])],2)}}}),[["__scopeId","data-v-9c9dad67"]]);var pZe=11;function Zvr(t,e){var r=e.attributes,n,i,a,o,s;if(!(e.nodeType===pZe||t.nodeType===pZe)){for(var l=r.length-1;l>=0;l--)n=r[l],i=n.name,a=n.namespaceURI,o=n.value,a?(i=n.localName||i,s=t.getAttributeNS(a,i),s!==o&&(n.prefix==="xmlns"&&(i=n.name),t.setAttributeNS(a,i,o))):(s=t.getAttribute(i),s!==o&&t.setAttribute(i,o));for(var u=t.attributes,d=u.length-1;d>=0;d--)n=u[d],i=n.name,a=n.namespaceURI,a?(i=n.localName||i,e.hasAttributeNS(a,i)||t.removeAttributeNS(a,i)):e.hasAttribute(i)||t.removeAttribute(i)}}var LH,Jvr="http://www.w3.org/1999/xhtml",Lc=typeof document>"u"?void 0:document,e9r=!!Lc&&"content"in Lc.createElement("template"),t9r=!!Lc&&Lc.createRange&&"createContextualFragment"in Lc.createRange();function r9r(t){var e=Lc.createElement("template");return e.innerHTML=t,e.content.childNodes[0]}function n9r(t){LH||(LH=Lc.createRange(),LH.selectNode(Lc.body));var e=LH.createContextualFragment(t);return e.childNodes[0]}function i9r(t){var e=Lc.createElement("body");return e.innerHTML=t,e.childNodes[0]}function a9r(t){return t=t.trim(),e9r?r9r(t):t9r?n9r(t):i9r(t)}function wH(t,e){var r=t.nodeName,n=e.nodeName,i,a;return r===n?!0:(i=r.charCodeAt(0),a=n.charCodeAt(0),i<=90&&a>=97?r===n.toUpperCase():a<=90&&i>=97?n===r.toUpperCase():!1)}function o9r(t,e){return!e||e===Jvr?Lc.createElement(t):Lc.createElementNS(e,t)}function s9r(t,e){for(var r=t.firstChild;r;){var n=r.nextSibling;e.appendChild(r),r=n}return e}function Ule(t,e,r){t[r]!==e[r]&&(t[r]=e[r],t[r]?t.setAttribute(r,""):t.removeAttribute(r))}var gZe={OPTION:function(t,e){var r=t.parentNode;if(r){var n=r.nodeName.toUpperCase();n==="OPTGROUP"&&(r=r.parentNode,n=r&&r.nodeName.toUpperCase()),n==="SELECT"&&!r.hasAttribute("multiple")&&(t.hasAttribute("selected")&&!e.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),r.selectedIndex=-1)}Ule(t,e,"selected")},INPUT:function(t,e){Ule(t,e,"checked"),Ule(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),e.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var r=e.value;t.value!==r&&(t.value=r);var n=t.firstChild;if(n){var i=n.nodeValue;if(i==r||!r&&i==t.placeholder)return;n.nodeValue=r}},SELECT:function(t,e){if(!e.hasAttribute("multiple")){for(var r=-1,n=0,i=t.firstChild,a,o;i;)if(o=i.nodeName&&i.nodeName.toUpperCase(),o==="OPTGROUP")a=i,i=a.firstChild;else{if(o==="OPTION"){if(i.hasAttribute("selected")){r=n;break}n++}i=i.nextSibling,!i&&a&&(i=a.nextSibling,a=null)}t.selectedIndex=r}}},Aw=1,mZe=11,TZe=3,vZe=8;function Z5(){}function l9r(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}function u9r(t){return function(r,n,i){if(i||(i={}),typeof n=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"||r.nodeName==="BODY"){var a=n;n=Lc.createElement("html"),n.innerHTML=a}else n=a9r(n);else n.nodeType===mZe&&(n=n.firstElementChild);var o=i.getNodeKey||l9r,s=i.onBeforeNodeAdded||Z5,l=i.onNodeAdded||Z5,u=i.onBeforeElUpdated||Z5,d=i.onElUpdated||Z5,h=i.onBeforeNodeDiscarded||Z5,f=i.onNodeDiscarded||Z5,p=i.onBeforeElChildrenUpdated||Z5,g=i.skipFromChildren||Z5,m=i.addChild||function(B,k){return B.appendChild(k)},T=i.childrenOnly===!0,v=Object.create(null),y=[];function _(B){y.push(B)}function Q(B,k){if(B.nodeType===Aw)for(var V=B.firstChild;V;){var H=void 0;k&&(H=o(V))?_(H):(f(V),V.firstChild&&Q(V,k)),V=V.nextSibling}}function b(B,k,V){h(B)!==!1&&(k&&k.removeChild(B),f(B),Q(B,V))}function x(B){if(B.nodeType===Aw||B.nodeType===mZe)for(var k=B.firstChild;k;){var V=o(k);V&&(v[V]=k),x(k),k=k.nextSibling}}x(r);function E(B){l(B);for(var k=B.firstChild;k;){var V=k.nextSibling,H=o(k);if(H){var $=v[H];$&&wH(k,$)?(k.parentNode.replaceChild($,k),C($,k)):E(k)}else E(k);k=V}}function S(B,k,V){for(;k;){var H=k.nextSibling;(V=o(k))?_(V):b(k,B,!0),k=H}}function C(B,k,V){var H=o(k);if(H&&delete v[H],!V){var $=u(B,k);if($===!1||($ instanceof HTMLElement&&(B=$,x(B)),t(B,k),d(B),p(B,k)===!1))return}B.nodeName!=="TEXTAREA"?L(B,k):gZe.TEXTAREA(B,k)}function L(B,k){var V=g(B,k),H=k.firstChild,$=B.firstChild,G,U,Y,ne,te;e:for(;H;){for(ne=H.nextSibling,G=o(H);!V&&$;){if(Y=$.nextSibling,H.isSameNode&&H.isSameNode($)){H=ne,$=Y;continue e}U=o($);var ee=$.nodeType,ie=void 0;if(ee===H.nodeType&&(ee===Aw?(G?G!==U&&((te=v[G])?Y===te?ie=!1:(B.insertBefore(te,$),U?_(U):b($,B,!0),$=te,U=o($)):ie=!1):U&&(ie=!1),ie=ie!==!1&&wH($,H),ie&&C($,H)):(ee===TZe||ee==vZe)&&(ie=!0,$.nodeValue!==H.nodeValue&&($.nodeValue=H.nodeValue))),ie){H=ne,$=Y;continue e}U?_(U):b($,B,!0),$=Y}if(G&&(te=v[G])&&wH(te,H))V||m(B,te),C(te,H);else{var j=s(H);j!==!1&&(j&&(H=j),H.actualize&&(H=H.actualize(B.ownerDocument||Lc)),m(B,H),E(H))}H=ne,$=Y}S(B,$,U);var X=gZe[B.nodeName];X&&X(B,k)}var w=r,O=w.nodeType,R=n.nodeType;if(!T){if(O===Aw)R===Aw?wH(r,n)||(f(r),w=s9r(r,o9r(n.nodeName,n.namespaceURI))):w=n;else if(O===TZe||O===vZe){if(R===O)return w.nodeValue!==n.nodeValue&&(w.nodeValue=n.nodeValue),w;w=n}}if(w===n)f(r);else{if(n.isSameNode&&n.isSameNode(w))return;if(C(w,n,T),y)for(var M=0,D=y.length;M<D;M++){var P=v[y[M]];P&&b(P,P.parentNode,!1)}}return!T&&w!==r&&r.parentNode&&(w.actualize&&(w=w.actualize(r.ownerDocument||Lc)),r.parentNode.replaceChild(w,r)),w}}var c9r=u9r(Zvr);const d9r={key:1,class:"ai-content-parser-inner"},yZe=Object.assign({name:"AiContentParser"},{__name:"ContentParser",props:{type:{type:String,default:"text"},content:String,stream:{type:Boolean,default:!1},streamDone:{type:Boolean,default:!1}},setup(t){const e=t,r=I.ref(null),n=I.ref("");return I.onMounted(()=>{I.watch(()=>e.content,()=>{if(n.value=e.type==="markdown"?VLe.parse(e.content):e.content,e.type==="markdown"||e.type==="html"){const i=document.createElement("div");i.innerHTML=n.value,i.classList.add("ai-content-parser-inner"),c9r(r.value,i)}},{immediate:!0})}),(i,a)=>(I.openBlock(),I.createElementBlock("div",{class:I.normalizeClass(["ai-content-parser",`ai-content-parser--${t.type}`])},[t.type==="html"||t.type==="markdown"?(I.openBlock(),I.createElementBlock("div",{key:0,ref_key:"contentRef",ref:r,class:"ai-content-parser-inner"},null,512)):(I.openBlock(),I.createElementBlock("div",d9r,I.toDisplayString(n.value),1))],2))}}),h9r={class:"ai-think-parser"},f9r={class:"ai-think-parser-content"},_Ze=oa(Object.assign({name:"AiThinkParser"},{__name:"ThinkParser",setup(t){return(e,r)=>(I.openBlock(),I.createElementBlock("div",h9r,[I.createElementVNode("div",f9r,[I.renderSlot(e.$slots,"content",{},()=>[I.createVNode(CH,I.normalizeProps(I.guardReactiveProps(e.$attrs)),null,16)],!0)])]))}}),[["__scopeId","data-v-70d4677e"]]);function Ql(t){this.content=t}Ql.prototype={constructor:Ql,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,i=n.find(t),a=n.content.slice();return i==-1?a.push(r||t,e):(a[i+1]=e,r&&(a[i]=r)),new Ql(a)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new Ql(r)},addToStart:function(t,e){return new Ql([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new Ql(r)},addBefore:function(t,e,r){var n=this.remove(e),i=n.content.slice(),a=n.find(t);return i.splice(a==-1?i.length:a,0,e,r),new Ql(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ql.from(t),t.size?new Ql(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ql.from(t),t.size?new Ql(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ql.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}},Ql.from=function(t){if(t instanceof Ql)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new Ql(e)};function bZe(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),a=e.child(n);if(i==a){r+=i.nodeSize;continue}if(!i.sameMarkup(a))return r;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)r++;return r}if(i.content.size||a.content.size){let o=bZe(i.content,a.content,r+1);if(o!=null)return o}r+=i.nodeSize}}function QZe(t,e,r,n){for(let i=t.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:r,b:n};let o=t.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){r-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:r,b:n};if(o.isText&&o.text!=s.text){let u=0,d=Math.min(o.text.length,s.text.length);for(;u<d&&o.text[o.text.length-u-1]==s.text[s.text.length-u-1];)u++,r--,n--;return{a:r,b:n}}if(o.content.size||s.content.size){let u=QZe(o.content,s.content,r-1,n-1);if(u)return u}r-=l,n-=l}}class Gt{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,i=0,a){for(let o=0,s=0;s<r;o++){let l=this.content[o],u=s+l.nodeSize;if(u>e&&n(l,i+s,a||null,o)!==!1&&l.content.size){let d=s+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,r-d),n,i+d)}s=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let a="",o=!0;return this.nodesBetween(e,r,(s,l)=>{let u=s.isText?s.text.slice(Math.max(e,l)-l,r-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&n&&(o?o=!1:a+=n),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new Gt(i,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],i=0;if(r>e)for(let a=0,o=0;o<r;a++){let s=this.content[a],l=o+s.nodeSize;l>e&&((o<e||l>r)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,r-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,r-o-1))),n.push(s),i+=s.nodeSize),o=l}return new Gt(n,i)}cutByIndex(e,r){return e==r?Gt.empty:e==0&&r==this.content.length?this:new Gt(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),a=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new Gt(i,a)}addToStart(e){return new Gt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Gt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let i=this.content[r];e(i,n,r),n+=i.nodeSize}}findDiffStart(e,r=0){return bZe(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return QZe(this,e,r,n)}findIndex(e){if(e==0)return AH(0,e);if(e==this.size)return AH(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let i=this.child(r),a=n+i.nodeSize;if(a>=e)return a==e?AH(r+1,a):AH(r,n);n=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return Gt.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new Gt(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Gt.empty;let r,n=0;for(let i=0;i<e.length;i++){let a=e[i];n+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(r||(r=e.slice(0,i)),r[r.length-1]=a.withText(r[r.length-1].text+a.text)):r&&r.push(a)}return new Gt(r||e,n)}static from(e){if(!e)return Gt.empty;if(e instanceof Gt)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Gt([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Gt.empty=new Gt([],0);const zle={index:0,offset:0};function AH(t,e){return zle.index=t,zle.offset=e,zle}function OH(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!OH(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!OH(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let ha=class sfe{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))r||(r=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!n&&a.type.rank>this.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(a)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&OH(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let i=n.create(r.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return sfe.none;if(e instanceof sfe)return[e];let r=e.slice();return r.sort((n,i)=>n.type.rank-i.type.rank),r}};ha.none=[];class MH extends Error{}class Lr{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=EZe(this.content,e+this.openStart,r);return n&&new Lr(n,this.openStart,this.openEnd)}removeBetween(e,r){return new Lr(xZe(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return Lr.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Lr(Gt.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.lastChild)i++;return new Lr(e,n,i)}}Lr.empty=new Lr(Gt.empty,0,0);function xZe(t,e,r){let{index:n,offset:i}=t.findIndex(e),a=t.maybeChild(n),{index:o,offset:s}=t.findIndex(r);if(i==e||a.isText){if(s!=r&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(n,a.copy(xZe(a.content,e-i-1,r-i-1)))}function EZe(t,e,r,n){let{index:i,offset:a}=t.findIndex(e),o=t.maybeChild(i);if(a==e||o.isText)return t.cut(0,e).append(r).append(t.cut(e));let s=EZe(o.content,e-a-1,r);return s&&t.replaceChild(i,o.copy(s))}function p9r(t,e,r){if(r.openStart>t.depth)throw new MH("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new MH("Inconsistent open depths");return SZe(t,e,r,0)}function SZe(t,e,r,n){let i=t.index(n),a=t.node(n);if(i==e.index(n)&&n<t.depth-r.openStart){let o=SZe(t,e,r,n+1);return a.copy(a.content.replaceChild(i,o))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let o=t.parent,s=o.content;return Q8(o,s.cut(0,t.parentOffset).append(r.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=g9r(r,t);return Q8(a,LZe(t,o,s,e,n))}else return Q8(a,RH(t,e,n))}function CZe(t,e){if(!e.type.compatibleContent(t.type))throw new MH("Cannot join "+e.type.name+" onto "+t.type.name)}function Gle(t,e,r){let n=t.node(r);return CZe(n,e.node(r)),n}function b8(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function Ow(t,e,r,n){let i=(e||t).node(r),a=0,o=e?e.index(r):i.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(b8(t.nodeAfter,n),a++));for(let s=a;s<o;s++)b8(i.child(s),n);e&&e.depth==r&&e.textOffset&&b8(e.nodeBefore,n)}function Q8(t,e){return t.type.checkContent(e),t.copy(e)}function LZe(t,e,r,n,i){let a=t.depth>i&&Gle(t,e,i+1),o=n.depth>i&&Gle(r,n,i+1),s=[];return Ow(null,t,i,s),a&&o&&e.index(i)==r.index(i)?(CZe(a,o),b8(Q8(a,LZe(t,e,r,n,i+1)),s)):(a&&b8(Q8(a,RH(t,e,i+1)),s),Ow(e,r,i,s),o&&b8(Q8(o,RH(r,n,i+1)),s)),Ow(n,null,i,s),new Gt(s)}function RH(t,e,r){let n=[];if(Ow(null,t,r,n),t.depth>r){let i=Gle(t,e,r+1);b8(Q8(i,RH(t,e,r+1)),n)}return Ow(e,null,r,n),new Gt(n)}function g9r(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let a=r-1;a>=0;a--)i=e.node(a).copy(Gt.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class Mw{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let a=0;a<e;a++)i+=n.child(a).nodeSize;return i}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return ha.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),i=e.maybeChild(r);if(!n){let s=n;n=i,i=s}let a=n.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!i||!a[o].isInSet(i.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<n.length;a++)n[a].type.spec.inclusive===!1&&(!i||!n[a].isInSet(i.marks))&&(n=n[a--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new DH(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,a=r;for(let o=e;;){let{index:s,offset:l}=o.content.findIndex(a),u=a-l;if(n.push(o,s,i+l),!u||(o=o.child(s),o.isText))break;a=u-1,i+=l+1}return new Mw(r,n,a)}static resolveCached(e,r){let n=wZe.get(e);if(n)for(let a=0;a<n.elts.length;a++){let o=n.elts[a];if(o.pos==r)return o}else wZe.set(e,n=new m9r);let i=n.elts[n.i]=Mw.resolve(e,r);return n.i=(n.i+1)%T9r,i}}class m9r{constructor(){this.elts=[],this.i=0}}const T9r=12,wZe=new WeakMap;class DH{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const v9r=Object.create(null);class Od{constructor(e,r,n,i=ha.none){this.type=e,this.attrs=r,this.marks=i,this.content=n||Gt.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,r,n,i=0){this.content.nodesBetween(e,r,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,i){return this.content.textBetween(e,r,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,r,n){return this.type==e&&OH(this.attrs,r||e.defaultAttrs||v9r)&&ha.sameSet(this.marks,n||ha.none)}copy(e=null){return e==this.content?this:new Od(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Od(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return Lr.empty;let i=this.resolve(e),a=this.resolve(r),o=n?0:i.sharedDepth(r),s=i.start(o),u=i.node(o).content.cut(i.pos-s,a.pos-s);return new Lr(u,i.depth-o,a.depth-o)}replace(e,r,n){return p9r(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:i}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(i==e||r.isText)return r;e-=i+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let i=this.content.child(r-1);return{node:i,index:r-1,offset:n-i.nodeSize}}resolve(e){return Mw.resolveCached(this,e)}resolveNoCache(e){return Mw.resolve(this,e)}rangeHasMark(e,r,n){let i=!1;return r>e&&this.nodesBetween(e,r,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),AZe(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=Gt.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,r);if(!s||!s.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,r,n,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(n),o=a&&a.matchFragment(this.content,r);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ha.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!ha.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=Gt.fromJSON(e,r.content),a=e.nodeType(r.type).create(r.attrs,i,n);return a.type.checkAttrs(a.attrs),a}}Od.prototype.text=void 0;class NH extends Od{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):AZe(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new NH(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new NH(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function AZe(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class x8{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new y9r(e,r);if(n.next==null)return x8.empty;let i=OZe(n);n.next&&n.err("Unexpected trailing text");let a=C9r(S9r(i));return L9r(a,n),a}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let i=this;for(let a=r;i&&a<n;a++)i=i.matchType(e.child(a).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let i=[this];function a(o,s){let l=o.matchFragment(e,n);if(l&&(!r||l.validEnd))return Gt.from(s.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:d,next:h}=o.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let f=a(h,s.concat(d));if(f)return f}}return null}return a(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),a=i.match;if(a.matchType(e)){let o=[];for(let s=i;s.type;s=s.via)o.push(s.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:s,next:l}=a.next[o];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in r)&&(!i.type||l.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),r[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&r(n.next[i].next)}return r(this),e.map((n,i)=>{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)a+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return a}).join(`
965
965
  `)}}x8.empty=new x8(!0);class y9r{constructor(e,r){this.string=e,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function OZe(t){let e=[];do e.push(_9r(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function _9r(t){let e=[];do e.push(b9r(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function b9r(t){let e=E9r(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Q9r(t,e);else break;return e}function MZe(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Q9r(t,e){let r=MZe(t),n=r;return t.eat(",")&&(t.next!="}"?n=MZe(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function x9r(t,e){let r=t.nodeTypes,n=r[e];if(n)return[n];let i=[];for(let a in r){let o=r[a];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function E9r(t){if(t.eat("(")){let e=OZe(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=x9r(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function S9r(t){let e=[[]];return i(a(t,0),r()),e;function r(){return e.push([])-1}function n(o,s,l){let u={term:l,to:s};return e[o].push(u),u}function i(o,s){o.forEach(l=>l.to=s)}function a(o,s){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(a(u,s)),[]);if(o.type=="seq")for(let l=0;;l++){let u=a(o.exprs[l],s);if(l==o.exprs.length-1)return u;i(u,s=r())}else if(o.type=="star"){let l=r();return n(s,l),i(a(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=r();return i(a(o.expr,s),l),i(a(o.expr,l),l),[n(l)]}else{if(o.type=="opt")return[n(s)].concat(a(o.expr,s));if(o.type=="range"){let l=s;for(let u=0;u<o.min;u++){let d=r();i(a(o.expr,l),d),l=d}if(o.max==-1)i(a(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let d=r();n(l,d),i(a(o.expr,l),d),l=d}return[n(l)]}else{if(o.type=="name")return[n(s,void 0,o.value)];throw new Error("Unknown expr type")}}}}function RZe(t,e){return e-t}function DZe(t,e){let r=[];return n(e),r.sort(RZe);function n(i){let a=t[i];if(a.length==1&&!a[0].term)return n(a[0].to);r.push(i);for(let o=0;o<a.length;o++){let{term:s,to:l}=a[o];!s&&r.indexOf(l)==-1&&n(l)}}}function C9r(t){let e=Object.create(null);return r(DZe(t,0));function r(n){let i=[];n.forEach(o=>{t[o].forEach(({term:s,to:l})=>{if(!s)return;let u;for(let d=0;d<i.length;d++)i[d][0]==s&&(u=i[d][1]);DZe(t,l).forEach(d=>{u||i.push([s,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let a=e[n.join(",")]=new x8(n.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let s=i[o][1].sort(RZe);a.next.push({type:i[o][0],next:e[s.join(",")]||r(s)})}return a}}function L9r(t,e){for(let r=0,n=[t];r<n.length;r++){let i=n[r],a=!i.validEnd,o=[];for(let s=0;s<i.next.length;s++){let{type:l,next:u}=i.next[s];o.push(l.name),a&&!(l.isText||l.hasRequiredAttrs())&&(a=!1),n.indexOf(u)==-1&&n.push(u)}a&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function NZe(t){let e=Object.create(null);for(let r in t){let n=t[r];if(!n.hasDefault)return null;e[r]=n.default}return e}function IZe(t,e){let r=Object.create(null);for(let n in t){let i=e&&e[n];if(i===void 0){let a=t[n];if(a.hasDefault)i=a.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=i}return r}function kZe(t,e,r,n){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${r} of type ${i}`);for(let i in t){let a=t[i];a.validate&&a.validate(e[i])}}function PZe(t,e){let r=Object.create(null);if(e)for(let n in e)r[n]=new A9r(t,n,e[n]);return r}let BZe=class jht{constructor(e,r,n){this.name=e,this.schema=r,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=PZe(e,n.attrs),this.defaultAttrs=NZe(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==x8.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:IZe(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Od(this,this.computeAttrs(e),Gt.from(r),ha.setFrom(n))}createChecked(e=null,r,n){return r=Gt.from(r),this.checkContent(r),new Od(this,this.computeAttrs(e),r,ha.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=Gt.from(r),r.size){let o=this.contentMatch.fillBefore(r);if(!o)return null;r=o.append(r)}let i=this.contentMatch.matchFragment(r),a=i&&i.fillBefore(Gt.empty,!0);return a?new Od(this,e,r.append(a),ha.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);if(!r||!r.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){kZe(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let r=0;r<e.length;r++)if(!this.allowsMarkType(e[r].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let r;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?r&&r.push(e[n]):r||(r=e.slice(0,n));return r?r.length?r:ha.none:e}static compile(e,r){let n=Object.create(null);e.forEach((a,o)=>n[a]=new jht(a,r,o));let i=r.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let a in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function w9r(t,e,r){let n=r.split("|");return i=>{let a=i===null?"null":typeof i;if(n.indexOf(a)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${a}`)}}class A9r{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?w9r(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class IH{constructor(e,r,n,i){this.name=e,this.rank=r,this.schema=n,this.spec=i,this.attrs=PZe(e,i.attrs),this.excluded=null;let a=NZe(this.attrs);this.instance=a?new ha(this,a):null}create(e=null){return!e&&this.instance?this.instance:new ha(this,IZe(this.attrs,e))}static compile(e,r){let n=Object.create(null),i=0;return e.forEach((a,o)=>n[a]=new IH(a,i++,r,o)),n}removeFromSet(e){for(var r=0;r<e.length;r++)e[r].type==this&&(e=e.slice(0,r).concat(e.slice(r+1)),r--);return e}isInSet(e){for(let r=0;r<e.length;r++)if(e[r].type==this)return e[r]}checkAttrs(e){kZe(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class HZe{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let i in e)r[i]=e[i];r.nodes=Ql.from(e.nodes),r.marks=Ql.from(e.marks||{}),this.nodes=BZe.compile(this.spec.nodes,this),this.marks=IH.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let a=this.nodes[i],o=a.spec.content||"",s=a.spec.marks;if(a.contentMatch=n[o]||(n[o]=x8.parse(o,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=s=="_"?null:s?FZe(this,s.split(" ")):s==""||!a.inlineContent?[]:null}for(let i in this.marks){let a=this.marks[i],o=a.spec.excludes;a.excluded=o==null?[a]:o==""?[]:FZe(this,o.split(" "))}this.nodeFromJSON=i=>Od.fromJSON(this,i),this.markFromJSON=i=>ha.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,r=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof BZe){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,i)}text(e,r){let n=this.nodes.text;return new NH(n,n.defaultAttrs,e,ha.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}}function FZe(t,e){let r=[];for(let n=0;n<e.length;n++){let i=e[n],a=t.marks[i],o=a;if(a)r.push(a);else for(let s in t.marks){let l=t.marks[s];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&r.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function O9r(t){return t.tag!=null}function M9r(t){return t.style!=null}let Rw=class lfe{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(i=>{if(O9r(i))this.tags.push(i);else if(M9r(i)){let a=/[^=]*/.exec(i.style)[0];n.indexOf(a)<0&&n.push(a),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let a=e.nodes[i.node];return a.contentMatch.matchType(a)})}parse(e,r={}){let n=new zZe(this,r,!1);return n.addAll(e,ha.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new zZe(this,r,!0);return n.addAll(e,ha.none,r.from,r.to),Lr.maxOpen(n.finish())}matchTag(e,r,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let a=this.tags[i];if(N9r(e,a.tag)&&(a.namespace===void 0||e.namespaceURI==a.namespace)&&(!a.context||r.matchesContext(a.context))){if(a.getAttrs){let o=a.getAttrs(e);if(o===!1)continue;a.attrs=o||void 0}return a}}}matchStyle(e,r,n,i){for(let a=i?this.styles.indexOf(i)+1:0;a<this.styles.length;a++){let o=this.styles[a],s=o.style;if(!(s.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=r))){if(o.getAttrs){let l=o.getAttrs(r);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let r=[];function n(i){let a=i.priority==null?50:i.priority,o=0;for(;o<r.length;o++){let s=r[o];if((s.priority==null?50:s.priority)<a)break}r.splice(o,0,i)}for(let i in e.marks){let a=e.marks[i].spec.parseDOM;a&&a.forEach(o=>{n(o=GZe(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let a=e.nodes[i].spec.parseDOM;a&&a.forEach(o=>{n(o=GZe(o)),o.node||o.ignore||o.mark||(o.node=i)})}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new lfe(e,lfe.schemaRules(e)))}};const VZe={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},R9r={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},$Ze={ol:!0,ul:!0},Dw=1,qle=2,Nw=4;function UZe(t,e,r){return e!=null?(e?Dw:0)|(e==="full"?qle:0):t&&t.whitespace=="pre"?Dw|qle:r&~Nw}class kH{constructor(e,r,n,i,a,o){this.type=e,this.attrs=r,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=ha.none,this.match=a||(o&Nw?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(Gt.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Dw)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let a=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let r=Gt.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(Gt.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!VZe.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class zZe{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=r.topNode,a,o=UZe(null,r.preserveWhitespace,0)|(n?Nw:0);i?a=new kH(i.type,i.attrs,ha.none,!0,r.topMatch||i.type.contentMatch,o):n?a=new kH(null,null,ha.none,!0,null,o):a=new kH(e.schema.topNodeType,null,ha.none,!0,null,o),this.nodes=[a],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,r){e.nodeType==3?this.addTextNode(e,r):e.nodeType==1&&this.addElement(e,r)}addTextNode(e,r){let n=e.nodeValue,i=this.top,a=i.options&qle?"full":this.localPreserveWS||(i.options&Dw)>0;if(a==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(a)a!=="full"?n=n.replace(/\r?\n|\r/g," "):n=n.replace(/\r\n?/g,`
966
966
  `);else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],s=e.previousSibling;(!o||s&&s.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),r,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,r,n){let i=this.localPreserveWS,a=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;$Ze.hasOwnProperty(o)&&this.parser.normalizeLists&&D9r(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:R9r.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,r);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,d=this.needsBlock;if(VZe.hasOwnProperty(o))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),u=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,r);break e}let h=l&&l.skip?r:this.readStyles(e,r);h&&this.addAll(e,h),u&&this.sync(a),this.needsBlock=d}else{let u=this.readStyles(e,r);u&&this.addElementByRule(e,l,u,l.consuming===!1?s:void 0)}this.localPreserveWS=i}leafFallback(e,r){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
967
967
  `),r)}ignoreFallback(e,r){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),r,!0)}readStyles(e,r){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let a=this.parser.matchedStyles[i],o=n.getPropertyValue(a);if(o)for(let s=void 0;;){let l=this.parser.matchStyle(a,o,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?r=r.filter(u=>!l.clearMark(u)):r=r.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return r}addElementByRule(e,r,n,i){let a,o;if(r.node)if(o=this.parser.schema.nodes[r.node],o.isLeaf)this.insertNode(o.create(r.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(o,r.attrs||null,n,r.preserveWhitespace);l&&(a=!0,n=l)}else{let l=this.parser.schema.marks[r.mark];n=n.concat(l.create(r.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof r.contentElement=="string"?l=e.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(e):r.contentElement&&(l=r.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}a&&this.sync(s)&&this.open--}addAll(e,r,n,i){let a=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=i==null?null:e.childNodes[i];o!=s;o=o.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(o,r);this.findAtPoint(e,a)}findPlace(e,r,n){let i,a;for(let o=this.open,s=0;o>=0;o--){let l=this.nodes[o],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+s)&&(i=u,a=l,!u.length))break;if(l.solid){if(n)break;s+=2}}if(!i)return null;this.sync(a);for(let o=0;o<i.length;o++)r=this.enterInner(i[o],null,r,!1);return r}insertNode(e,r,n){if(e.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(r=this.enterInner(a,null,r))}let i=this.findPlace(e,r,n);if(i){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(e.type));let o=ha.none;for(let s of i.concat(e.marks))(a.type?a.type.allowsMarkType(s.type):qZe(s.type,e.type))&&(o=s.addToSet(o));return a.content.push(e.mark(o)),!0}return!1}enter(e,r,n,i){let a=this.findPlace(e.create(r),n,!1);return a&&(a=this.enterInner(e,r,n,!0,i)),a}enterInner(e,r,n,i=!1,a){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=UZe(e,a,o.options);o.options&Nw&&o.content.length==0&&(s|=Nw);let l=ha.none;return n=n.filter(u=>(o.type?o.type.allowsMarkType(u.type):qZe(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new kH(e,r,l,i,null,s)),this.open++,n}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let r=this.open;r>=0;r--){if(this.nodes[r]==e)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=Dw)}return!1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;r&&e++}return e}findAtPoint(e,r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos)}findAround(e,r,n){if(e!=r&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&r.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&(this.find[r].pos=this.currentPos-(e.nodeValue.length-this.find[r].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),a=-(n?n.depth+1:0)+(i?0:1),o=(s,l)=>{for(;s>=0;s--){let u=r[s];if(u==""){if(s==r.length-1||s==0)continue;for(;l>=a;l--)if(o(s-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:n&&l>=a?n.node(l-a).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;l--}}return!0};return o(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function D9r(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&$Ze.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function N9r(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function GZe(t){let e={};for(let r in t)e[r]=t[r];return e}function qZe(t,e){let r=e.schema.nodes;for(let n in r){let i=r[n];if(!i.allowsMarkType(t))continue;let a=[],o=s=>{a.push(s);for(let l=0;l<s.edgeCount;l++){let{type:u,next:d}=s.edge(l);if(u==e||a.indexOf(d)<0&&o(d))return!0}};if(o(i.contentMatch))return!0}}class E8{constructor(e,r){this.nodes=e,this.marks=r}serializeFragment(e,r={},n){n||(n=Wle(r).createDocumentFragment());let i=n,a=[];return e.forEach(o=>{if(a.length||o.marks.length){let s=0,l=0;for(;s<a.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(a[s][0])||u.type.spec.spanning===!1)break;s++,l++}for(;s<a.length;)i=a.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],d=this.serializeMark(u,o.isInline,r);d&&(a.push([u,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(o,r))}),n}serializeNodeInner(e,r){let{dom:n,contentDOM:i}=PH(Wle(r),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,r,i)}return n}serializeNode(e,r={}){let n=this.serializeNodeInner(e,r);for(let i=e.marks.length-1;i>=0;i--){let a=this.serializeMark(e.marks[i],e.isInline,r);a&&((a.contentDOM||a.dom).appendChild(n),n=a.dom)}return n}serializeMark(e,r,n={}){let i=this.marks[e.type.name];return i&&PH(Wle(n),i(e,r),null,e.attrs)}static renderSpec(e,r,n=null,i){return PH(e,r,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new E8(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=WZe(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return WZe(e.marks)}}function WZe(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function Wle(t){return t.document||window.document}const YZe=new WeakMap;function I9r(t){let e=YZe.get(t);return e===void 0&&YZe.set(t,e=k9r(t)),e}function k9r(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)r(n[i]);else for(let i in n)r(n[i])}return r(t),e}function PH(t,e,r,n){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],a;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(a=I9r(n))&&a.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?t.createElementNS(r,i):t.createElement(i),u=e[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let h in u)if(u[h]!=null){let f=h.indexOf(" ");f>0?l.setAttributeNS(h.slice(0,f),h.slice(f+1),u[h]):h=="style"&&l.style?l.style.cssText=u[h]:l.setAttribute(h,u[h])}}for(let h=d;h<e.length;h++){let f=e[h];if(f===0){if(h<e.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:g}=PH(t,f,r,n);if(l.appendChild(p),g){if(s)throw new RangeError("Multiple content holes");s=g}}}return{dom:l,contentDOM:s}}const jZe=65535,XZe=Math.pow(2,16);function P9r(t,e){return t+e*XZe}function KZe(t){return t&jZe}function B9r(t){return(t-(t&jZe))/XZe}const ZZe=1,JZe=2,BH=4,eJe=8;class Yle{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&eJe)>0}get deletedBefore(){return(this.delInfo&(ZZe|BH))>0}get deletedAfter(){return(this.delInfo&(JZe|BH))>0}get deletedAcross(){return(this.delInfo&BH)>0}}class q1{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&q1.empty)return q1.empty}recover(e){let r=0,n=KZe(e);if(!this.inverted)for(let i=0;i<n;i++)r+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+r+B9r(e)}mapResult(e,r=1){return this._map(e,r,!1)}map(e,r=1){return this._map(e,r,!0)}_map(e,r,n){let i=0,a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[s+a],d=this.ranges[s+o],h=l+u;if(e<=h){let f=u?e==l?-1:e==h?1:r:r,p=l+i+(f<0?0:d);if(n)return p;let g=e==(r<0?l:h)?null:P9r(s/3,e-l),m=e==l?JZe:e==h?ZZe:BH;return(r<0?e!=l:e!=h)&&(m|=eJe),new Yle(p,m,g)}i+=d-u}return n?e+i:new Yle(e+i,0,null)}touches(e,r){let n=0,i=KZe(r),a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?n:0);if(l>e)break;let u=this.ranges[s+a],d=l+u;if(e<=d&&s==i*3)return!0;n+=this.ranges[s+o]-u}return!1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,a=0;i<this.ranges.length;i+=3){let o=this.ranges[i],s=o-(this.inverted?a:0),l=o+(this.inverted?0:a),u=this.ranges[i+r],d=this.ranges[i+n];e(s,s+u,l,l+d),a+=d-u}}invert(){return new q1(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?q1.empty:new q1(e<0?[0,-e,0]:[0,0,e])}}q1.empty=new q1([]);class Iw{constructor(e,r,n=0,i=e?e.length:0){this.mirror=r,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||r)}get maps(){return this._maps}slice(e=0,r=this.maps.length){return new Iw(this._maps,this.mirror,e,r)}appendMap(e,r){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),r!=null&&this.setMirror(this._maps.length-1,r)}appendMapping(e){for(let r=0,n=this._maps.length;r<e._maps.length;r++){let i=e.getMirror(r);this.appendMap(e._maps[r],i!=null&&i<r?n+i:void 0)}}getMirror(e){if(this.mirror){for(let r=0;r<this.mirror.length;r++)if(this.mirror[r]==e)return this.mirror[r+(r%2?-1:1)]}}setMirror(e,r){this.mirror||(this.mirror=[]),this.mirror.push(e,r)}appendMappingInverted(e){for(let r=e.maps.length-1,n=this._maps.length+e._maps.length;r>=0;r--){let i=e.getMirror(r);this.appendMap(e._maps[r].invert(),i!=null&&i>r?n-i-1:void 0)}}invert(){let e=new Iw;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,r);return e}mapResult(e,r=1){return this._map(e,r,!1)}_map(e,r,n){let i=0;for(let a=this.from;a<this.to;a++){let o=this._maps[a],s=o.mapResult(e,r);if(s.recover!=null){let l=this.getMirror(a);if(l!=null&&l>a&&l<this.to){a=l,e=this._maps[l].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return n?e:new Yle(e,i,null)}}const jle=Object.create(null);class nu{getMap(){return q1.empty}merge(e){return null}static fromJSON(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=jle[r.stepType];if(!n)throw new RangeError(`No step type ${r.stepType} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in jle)throw new RangeError("Duplicate use of step JSON ID "+e);return jle[e]=r,r.prototype.jsonID=e,r}}class Ko{constructor(e,r){this.doc=e,this.failed=r}static ok(e){return new Ko(e,null)}static fail(e){return new Ko(null,e)}static fromReplace(e,r,n,i){try{return Ko.ok(e.replace(r,n,i))}catch(a){if(a instanceof MH)return Ko.fail(a.message);throw a}}}function Xle(t,e,r){let n=[];for(let i=0;i<t.childCount;i++){let a=t.child(i);a.content.size&&(a=a.copy(Xle(a.content,e,a))),a.isInline&&(a=e(a,r,i)),n.push(a)}return Gt.fromArray(n)}class J5 extends nu{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),a=new Lr(Xle(r.content,(o,s)=>!o.isAtom||!s.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),r.openStart,r.openEnd);return Ko.fromReplace(e,this.from,this.to,a)}invert(){return new Md(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new J5(r.pos,n.pos,this.mark)}merge(e){return e instanceof J5&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new J5(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new J5(r.from,r.to,e.markFromJSON(r.mark))}}nu.jsonID("addMark",J5);class Md extends nu{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=new Lr(Xle(r.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),r.openStart,r.openEnd);return Ko.fromReplace(e,this.from,this.to,n)}invert(){return new J5(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Md(r.pos,n.pos,this.mark)}merge(e){return e instanceof Md&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Md(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Md(r.from,r.to,e.markFromJSON(r.mark))}}nu.jsonID("removeMark",Md);class ep extends nu{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return Ko.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return Ko.fromReplace(e,this.pos,this.pos+1,new Lr(Gt.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let i=0;i<r.marks.length;i++)if(!r.marks[i].isInSet(n))return new ep(this.pos,r.marks[i]);return new ep(this.pos,this.mark)}}return new S8(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new ep(r.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ep(r.pos,e.markFromJSON(r.mark))}}nu.jsonID("addNodeMark",ep);class S8 extends nu{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return Ko.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.removeFromSet(r.marks));return Ko.fromReplace(e,this.pos,this.pos+1,new Lr(Gt.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);return!r||!this.mark.isInSet(r.marks)?this:new ep(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new S8(r.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new S8(r.pos,e.markFromJSON(r.mark))}}nu.jsonID("removeNodeMark",S8);class Zs extends nu{constructor(e,r,n,i=!1){super(),this.from=e,this.to=r,this.slice=n,this.structure=i}apply(e){return this.structure&&Kle(e,this.from,this.to)?Ko.fail("Structure replace would overwrite content"):Ko.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new q1([this.from,this.to-this.from,this.slice.size])}invert(e){return new Zs(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deletedAcross&&n.deletedAcross?null:new Zs(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Zs)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let r=this.slice.size+e.slice.size==0?Lr.empty:new Lr(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Zs(this.from,this.to+(e.to-e.from),r,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let r=this.slice.size+e.slice.size==0?Lr.empty:new Lr(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Zs(e.from,this.to,r,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Zs(r.from,r.to,Lr.fromJSON(e,r.slice),!!r.structure)}}nu.jsonID("replace",Zs);class Js extends nu{constructor(e,r,n,i,a,o,s=!1){super(),this.from=e,this.to=r,this.gapFrom=n,this.gapTo=i,this.slice=a,this.insert=o,this.structure=s}apply(e){if(this.structure&&(Kle(e,this.from,this.gapFrom)||Kle(e,this.gapTo,this.to)))return Ko.fail("Structure gap-replace would overwrite content");let r=e.slice(this.gapFrom,this.gapTo);if(r.openStart||r.openEnd)return Ko.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,r.content);return n?Ko.fromReplace(e,this.from,this.to,n):Ko.fail("Content does not fit in gap")}getMap(){return new q1([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let r=this.gapTo-this.gapFrom;return new Js(this.from,this.from+this.slice.size+r,this.from+this.insert,this.from+this.insert+r,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?r.pos:e.map(this.gapFrom,-1),a=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return r.deletedAcross&&n.deletedAcross||i<r.pos||a>n.pos?null:new Js(r.pos,n.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Js(r.from,r.to,r.gapFrom,r.gapTo,Lr.fromJSON(e,r.slice),r.insert,!!r.structure)}}nu.jsonID("replaceAround",Js);function Kle(t,e,r){let n=t.resolve(e),i=r-e,a=n.depth;for(;i>0&&a>0&&n.indexAfter(a)==n.node(a).childCount;)a--,i--;if(i>0){let o=n.node(a).maybeChild(n.indexAfter(a));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function H9r(t,e,r,n){let i=[],a=[],o,s;t.doc.nodesBetween(e,r,(l,u,d)=>{if(!l.isInline)return;let h=l.marks;if(!n.isInSet(h)&&d.type.allowsMarkType(n.type)){let f=Math.max(u,e),p=Math.min(u+l.nodeSize,r),g=n.addToSet(h);for(let m=0;m<h.length;m++)h[m].isInSet(g)||(o&&o.to==f&&o.mark.eq(h[m])?o.to=p:i.push(o=new Md(f,p,h[m])));s&&s.to==f?s.to=p:a.push(s=new J5(f,p,n))}}),i.forEach(l=>t.step(l)),a.forEach(l=>t.step(l))}function F9r(t,e,r,n){let i=[],a=0;t.doc.nodesBetween(e,r,(o,s)=>{if(!o.isInline)return;a++;let l=null;if(n instanceof IH){let u=o.marks,d;for(;d=n.isInSet(u);)(l||(l=[])).push(d),u=d.removeFromSet(u)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let u=Math.min(s+o.nodeSize,r);for(let d=0;d<l.length;d++){let h=l[d],f;for(let p=0;p<i.length;p++){let g=i[p];g.step==a-1&&h.eq(i[p].style)&&(f=g)}f?(f.to=u,f.step=a):i.push({style:h,from:Math.max(s,e),to:u,step:a})}}}),i.forEach(o=>t.step(new Md(o.from,o.to,o.style)))}function Zle(t,e,r,n=r.contentMatch,i=!0){let a=t.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l<a.childCount;l++){let u=a.child(l),d=s+u.nodeSize,h=n.matchType(u.type);if(!h)o.push(new Zs(s,d,Lr.empty));else{n=h;for(let f=0;f<u.marks.length;f++)r.allowsMarkType(u.marks[f].type)||t.step(new Md(s,d,u.marks[f]));if(i&&u.isText&&r.whitespace!="pre"){let f,p=/\r?\n|\r/g,g;for(;f=p.exec(u.text);)g||(g=new Lr(Gt.from(r.schema.text(" ",r.allowedMarks(u.marks))),0,0)),o.push(new Zs(s+f.index,s+f.index+f[0].length,g))}}s=d}if(!n.validEnd){let l=n.fillBefore(Gt.empty,!0);t.replace(s,s,new Lr(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function V9r(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function Jy(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let i=t.$from.node(n),a=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&i.canReplace(a,o,r))return n;if(n==0||i.type.spec.isolating||!V9r(i,a,o))break}return null}function $9r(t,e,r){let{$from:n,$to:i,depth:a}=e,o=n.before(a+1),s=i.after(a+1),l=o,u=s,d=Gt.empty,h=0;for(let g=a,m=!1;g>r;g--)m||n.index(g)>0?(m=!0,d=Gt.from(n.node(g).copy(d)),h++):l--;let f=Gt.empty,p=0;for(let g=a,m=!1;g>r;g--)m||i.after(g+1)<i.end(g)?(m=!0,f=Gt.from(i.node(g).copy(f)),p++):u++;t.step(new Js(l,u,o,s,new Lr(d.append(f),h,p),d.size-h,!0))}function tJe(t,e,r=null,n=t){let i=U9r(t,e),a=i&&z9r(n,e);return a?i.map(rJe).concat({type:e,attrs:r}).concat(a.map(rJe)):null}function rJe(t){return{type:t,attrs:null}}function U9r(t,e){let{parent:r,startIndex:n,endIndex:i}=t,a=r.contentMatchAt(n).findWrapping(e);if(!a)return null;let o=a.length?a[0]:e;return r.canReplaceWith(n,i,o)?a:null}function z9r(t,e){let{parent:r,startIndex:n,endIndex:i}=t,a=r.child(n),o=e.contentMatch.findWrapping(a.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=n;l&&u<i;u++)l=l.matchType(r.child(u).type);return!l||!l.validEnd?null:o}function G9r(t,e,r){let n=Gt.empty;for(let o=r.length-1;o>=0;o--){if(n.size){let s=r[o].type.contentMatch.matchFragment(n);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=Gt.from(r[o].type.create(r[o].attrs,n))}let i=e.start,a=e.end;t.step(new Js(i,a,i,a,new Lr(n,0,0),r.length,!0))}function q9r(t,e,r,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(e,r,(o,s)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,l)&&W9r(t.doc,t.mapping.slice(a).map(s),n)){let u=null;if(n.schema.linebreakReplacement){let p=n.whitespace=="pre",g=!!n.contentMatch.matchType(n.schema.linebreakReplacement);p&&!g?u=!1:!p&&g&&(u=!0)}u===!1&&iJe(t,o,s,a),Zle(t,t.mapping.slice(a).map(s,1),n,void 0,u===null);let d=t.mapping.slice(a),h=d.map(s,1),f=d.map(s+o.nodeSize,1);return t.step(new Js(h,f,h+1,f-1,new Lr(Gt.from(n.create(l,null,o.marks)),0,0),1,!0)),u===!0&&nJe(t,o,s,a),!1}})}function nJe(t,e,r,n){e.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let l=t.mapping.slice(n).map(r+1+a+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function iJe(t,e,r,n){e.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(n).map(r+1+a);t.replaceWith(o,o+1,e.type.schema.text(`
@@ -1,4 +1,4 @@
1
- import { $ as ln, a0 as an, a1 as y, a2 as tn, a3 as G, a4 as q, a5 as _, a6 as un, a7 as z, a8 as rn, a9 as K, aa as o, ab as sn, ac as on, ad as fn } from "./index-BsUdfvvY.mjs";
1
+ import { $ as ln, a0 as an, a1 as y, a2 as tn, a3 as G, a4 as q, a5 as _, a6 as un, a7 as z, a8 as rn, a9 as K, aa as o, ab as sn, ac as on, ad as fn } from "./index-DeVe2fYT.mjs";
2
2
  function cn(l) {
3
3
  return l.innerRadius;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { A as c, e as t } from "./mermaid-parser.core-BdtH8HCP.mjs";
1
+ import { A as c, e as t } from "./mermaid-parser.core-Dkxc4pcM.mjs";
2
2
  export {
3
3
  c as ArchitectureModule,
4
4
  t as createArchitectureServices
@@ -1,7 +1,7 @@
1
- import { aI as qe, _ as nt, g as Je, s as Qe, a as Ke, b as je, q as _e, p as tr, H as er, U as rr, y as ir, l as Pe, aj as Le, c as ge, aJ as me, d as ar, F as nr, aK as or, aL as sr } from "./index-BsUdfvvY.mjs";
2
- import { p as hr } from "./chunk-4BMEZGHF-NprDeaHC.mjs";
3
- import { I as lr } from "./chunk-XZIHB7SX-BaVZQ9-p.mjs";
4
- import { p as fr } from "./mermaid-parser.core-BdtH8HCP.mjs";
1
+ import { aI as qe, _ as nt, g as Je, s as Qe, a as Ke, b as je, q as _e, p as tr, H as er, U as rr, y as ir, l as Pe, aj as Le, c as ge, aJ as me, d as ar, F as nr, aK as or, aL as sr } from "./index-DeVe2fYT.mjs";
2
+ import { p as hr } from "./chunk-4BMEZGHF-BEmG049J.mjs";
3
+ import { I as lr } from "./chunk-XZIHB7SX-ajV0D-qB.mjs";
4
+ import { p as fr } from "./mermaid-parser.core-Dkxc4pcM.mjs";
5
5
  import { c as Ge } from "./cytoscape.esm-D1A2YP3J.mjs";
6
6
  var le = { exports: {} }, fe = { exports: {} }, ce = { exports: {} }, cr = ce.exports, xe;
7
7
  function ur() {
@@ -1,7 +1,7 @@
1
- import { _ as d, E as at, d as R, e as de, l as L, y as ge, A as ue, c as z, ah as pe, Q as fe, R as xe, ai as Z, aj as Yt, ak as ye, u as tt, k as be, al as we, am as xt, an as me, i as Tt } from "./index-BsUdfvvY.mjs";
2
- import { c as Le } from "./clone-QF40ZrZn.mjs";
3
- import { G as Se } from "./graph-CKBxA1oq.mjs";
4
- import { c as ve } from "./channel-DygBbP2N.mjs";
1
+ import { _ as d, E as at, d as R, e as de, l as L, y as ge, A as ue, c as z, ah as pe, Q as fe, R as xe, ai as Z, aj as Yt, ak as ye, u as tt, k as be, al as we, am as xt, an as me, i as Tt } from "./index-DeVe2fYT.mjs";
2
+ import { c as Le } from "./clone-DJ3yBnPZ.mjs";
3
+ import { G as Se } from "./graph-Br45le2O.mjs";
4
+ import { c as ve } from "./channel-DK3nWCnf.mjs";
5
5
  var yt = function() {
6
6
  var e = /* @__PURE__ */ d(function(N, x, g, u) {
7
7
  for (g = g || {}, u = N.length; u--; g[N[u]] = x) ;
@@ -1,5 +1,5 @@
1
- import { g as Se, d as De } from "./chunk-D6G4REZN-Bf3XejNZ.mjs";
2
- import { _ as g, s as Pe, g as Be, a as Ie, b as Me, c as Bt, d as jt, l as de, e as Le, f as Ne, h as Tt, i as ge, j as Ye, w as je, k as $t, m as fe } from "./index-BsUdfvvY.mjs";
1
+ import { g as Se, d as De } from "./chunk-D6G4REZN-CpxhtUpL.mjs";
2
+ import { _ as g, s as Pe, g as Be, a as Ie, b as Me, c as Bt, d as jt, l as de, e as Le, f as Ne, h as Tt, i as ge, j as Ye, w as je, k as $t, m as fe } from "./index-DeVe2fYT.mjs";
3
3
  var Ft = function() {
4
4
  var e = /* @__PURE__ */ g(function(_t, x, m, v) {
5
5
  for (m = m || {}, v = _t.length; v--; m[_t[v]] = x) ;
@@ -1,4 +1,4 @@
1
- import { ao as r, ap as n } from "./index-BsUdfvvY.mjs";
1
+ import { ao as r, ap as n } from "./index-DeVe2fYT.mjs";
2
2
  const t = (a, o) => r.lang.round(n.parse(a)[o]);
3
3
  export {
4
4
  t as c
@@ -1,4 +1,4 @@
1
- import { _ as l } from "./index-BsUdfvvY.mjs";
1
+ import { _ as l } from "./index-DeVe2fYT.mjs";
2
2
  function m(e, c) {
3
3
  var i, t, o;
4
4
  e.accDescr && ((i = c.setAccDescription) == null || i.call(c, e.accDescr)), e.accTitle && ((t = c.setAccTitle) == null || t.call(c, e.accTitle)), e.title && ((o = c.setDiagramTitle) == null || o.call(c, e.title));
@@ -1,5 +1,5 @@
1
- import { g as et, s as tt } from "./chunk-RZ5BOZE2-DW6gxhKN.mjs";
2
- import { _ as f, l as Oe, c as F, o as st, r as it, u as we, d as $, b as at, a as nt, s as rt, g as ut, p as lt, q as ct, k as v, y as ot, x as ht, i as dt, P as R } from "./index-BsUdfvvY.mjs";
1
+ import { g as et, s as tt } from "./chunk-RZ5BOZE2-qRG8ZhHH.mjs";
2
+ import { _ as f, l as Oe, c as F, o as st, r as it, u as we, d as $, b as at, a as nt, s as rt, g as ut, p as lt, q as ct, k as v, y as ot, x as ht, i as dt, P as R } from "./index-DeVe2fYT.mjs";
3
3
  var Ve = function() {
4
4
  var s = /* @__PURE__ */ f(function(I, c, h, p) {
5
5
  for (h = h || {}, p = I.length; p--; h[I[p]] = c) ;
@@ -1,8 +1,8 @@
1
1
  var re = Object.defineProperty;
2
2
  var ae = (e, t, s) => t in e ? re(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
3
  var b = (e, t, s) => ae(e, typeof t != "symbol" ? t + "" : t, s);
4
- import { g as ne, s as le } from "./chunk-RZ5BOZE2-DW6gxhKN.mjs";
5
- import { _ as p, l as v, c as A, r as oe, u as ce, S as he, k as j, y as ue, a as de, b as fe, g as pe, s as Se, p as ye, q as ge } from "./index-BsUdfvvY.mjs";
4
+ import { g as ne, s as le } from "./chunk-RZ5BOZE2-qRG8ZhHH.mjs";
5
+ import { _ as p, l as v, c as A, r as oe, u as ce, S as he, k as j, y as ue, a as de, b as fe, g as pe, s as Se, p as ye, q as ge } from "./index-DeVe2fYT.mjs";
6
6
  var bt = function() {
7
7
  var e = /* @__PURE__ */ p(function(P, l, h, a) {
8
8
  for (h = h || {}, a = P.length; a--; h[P[a]] = l) ;
@@ -1,4 +1,4 @@
1
- import { _ as n, T as o, j as l } from "./index-BsUdfvvY.mjs";
1
+ import { _ as n, T as o, j as l } from "./index-DeVe2fYT.mjs";
2
2
  var x = /* @__PURE__ */ n((s, t) => {
3
3
  const e = s.append("rect");
4
4
  if (e.attr("x", t.x), e.attr("y", t.y), e.attr("fill", t.fill), e.attr("stroke", t.stroke), e.attr("width", t.width), e.attr("height", t.height), t.name && e.attr("name", t.name), t.rx && e.attr("rx", t.rx), t.ry && e.attr("ry", t.ry), t.attrs !== void 0)
@@ -1,4 +1,4 @@
1
- import { _ as n, d as r, e as d, l as g } from "./index-BsUdfvvY.mjs";
1
+ import { _ as n, d as r, e as d, l as g } from "./index-DeVe2fYT.mjs";
2
2
  var u = /* @__PURE__ */ n((e, t) => {
3
3
  let o;
4
4
  return t === "sandbox" && (o = r("#i" + e)), (t === "sandbox" ? r(o.nodes()[0].contentDocument.body) : r("body")).select(`[id="${e}"]`);
@@ -1,4 +1,4 @@
1
- import { _ as s } from "./index-BsUdfvvY.mjs";
1
+ import { _ as s } from "./index-DeVe2fYT.mjs";
2
2
  var t, e = (t = class {
3
3
  /**
4
4
  * @param init - Function that creates the default state.
@@ -1,5 +1,5 @@
1
- import { s as r, c as s, a as e, C as t } from "./chunk-A2AXSNBT-DashJEw4.mjs";
2
- import { _ as l } from "./index-BsUdfvvY.mjs";
1
+ import { s as r, c as s, a as e, C as t } from "./chunk-A2AXSNBT-CsXgqPKx.mjs";
2
+ import { _ as l } from "./index-DeVe2fYT.mjs";
3
3
  var d = {
4
4
  parser: e,
5
5
  get db() {
@@ -1,5 +1,5 @@
1
- import { s as r, c as s, a as e, C as t } from "./chunk-A2AXSNBT-DashJEw4.mjs";
2
- import { _ as l } from "./index-BsUdfvvY.mjs";
1
+ import { s as r, c as s, a as e, C as t } from "./chunk-A2AXSNBT-CsXgqPKx.mjs";
2
+ import { _ as l } from "./index-DeVe2fYT.mjs";
3
3
  var d = {
4
4
  parser: e,
5
5
  get db() {
@@ -1,4 +1,4 @@
1
- import { b as r } from "./reduce-DqpjGvBF.mjs";
1
+ import { b as r } from "./reduce-rKNe6dOq.mjs";
2
2
  var e = 4;
3
3
  function a(o) {
4
4
  return r(o, e);
@@ -1,9 +1,9 @@
1
- import { _ as X, aq as F, ar as Y, as as _, at as H, l as i, c as V, au as q, av as U, af as $, ak as z, ag as P, ae as K, aw as Q, ax as W, ay as Z } from "./index-BsUdfvvY.mjs";
2
- import { G as B } from "./graph-CKBxA1oq.mjs";
3
- import { l as I } from "./layout-BqeeUOdZ.mjs";
4
- import { i as x } from "./reduce-DqpjGvBF.mjs";
5
- import { c as L } from "./clone-QF40ZrZn.mjs";
6
- import { m as A } from "./_basePickBy-BRxeAj8U.mjs";
1
+ import { _ as X, aq as F, ar as Y, as as _, at as H, l as i, c as V, au as q, av as U, af as $, ak as z, ag as P, ae as K, aw as Q, ax as W, ay as Z } from "./index-DeVe2fYT.mjs";
2
+ import { G as B } from "./graph-Br45le2O.mjs";
3
+ import { l as I } from "./layout-BI2vRxTF.mjs";
4
+ import { i as x } from "./reduce-rKNe6dOq.mjs";
5
+ import { c as L } from "./clone-DJ3yBnPZ.mjs";
6
+ import { m as A } from "./_basePickBy-DFZvgpUj.mjs";
7
7
  function p(e) {
8
8
  var t = {
9
9
  options: {
@@ -1,6 +1,6 @@
1
- import { p as k } from "./chunk-4BMEZGHF-NprDeaHC.mjs";
2
- import { _ as l, s as R, g as E, q as F, p as I, a as _, b as D, H as G, y as P, D as f, E as C, F as z, l as H, K as V } from "./index-BsUdfvvY.mjs";
3
- import { p as W } from "./mermaid-parser.core-BdtH8HCP.mjs";
1
+ import { p as k } from "./chunk-4BMEZGHF-BEmG049J.mjs";
2
+ import { _ as l, s as R, g as E, q as F, p as I, a as _, b as D, H as G, y as P, D as f, E as C, F as z, l as H, K as V } from "./index-DeVe2fYT.mjs";
3
+ import { p as W } from "./mermaid-parser.core-Dkxc4pcM.mjs";
4
4
  var x = {
5
5
  showLegend: !0,
6
6
  ticks: 5,
@@ -1,6 +1,6 @@
1
- import { p as w } from "./chunk-4BMEZGHF-NprDeaHC.mjs";
2
- import { _ as n, s as B, g as S, q as F, p as z, a as P, b as W, D as x, H as D, e as T, y as E, E as _, F as A, l as m } from "./index-BsUdfvvY.mjs";
3
- import { p as N } from "./mermaid-parser.core-BdtH8HCP.mjs";
1
+ import { p as w } from "./chunk-4BMEZGHF-BEmG049J.mjs";
2
+ import { _ as n, s as B, g as S, q as F, p as z, a as P, b as W, D as x, H as D, e as T, y as E, E as _, F as A, l as m } from "./index-DeVe2fYT.mjs";
3
+ import { p as N } from "./mermaid-parser.core-Dkxc4pcM.mjs";
4
4
  var C = {
5
5
  packet: []
6
6
  }, v = structuredClone(C), L = A.packet, Y = /* @__PURE__ */ n(() => {
@@ -1,6 +1,6 @@
1
- import { g as Dt, s as wt } from "./chunk-RZ5BOZE2-DW6gxhKN.mjs";
2
- import { _ as u, b as Vt, a as Lt, s as Mt, g as Bt, p as Ft, q as Yt, c as tt, l as D, y as Pt, x as zt, A as Gt, B as Kt, o as Zt, r as Ut, d as jt, u as Wt } from "./index-BsUdfvvY.mjs";
3
- import { c as Qt } from "./channel-DygBbP2N.mjs";
1
+ import { g as Dt, s as wt } from "./chunk-RZ5BOZE2-qRG8ZhHH.mjs";
2
+ import { _ as u, b as Vt, a as Lt, s as Mt, g as Bt, p as Ft, q as Yt, c as tt, l as D, y as Pt, x as zt, A as Gt, B as Kt, o as Zt, r as Ut, d as jt, u as Wt } from "./index-DeVe2fYT.mjs";
3
+ import { c as Qt } from "./channel-DK3nWCnf.mjs";
4
4
  var dt = function() {
5
5
  var s = /* @__PURE__ */ u(function(R, n, a, c) {
6
6
  for (a = a || {}, c = R.length; c--; a[R[c]] = n) ;