@bkm016/basalt 0.1.9 → 0.1.10

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 (132) hide show
  1. package/{chunk-0xd9mnc2.js → chunk-0mjb3sm3.js} +2 -2
  2. package/{chunk-66h5qpc6.js → chunk-3mqf9ped.js} +89 -89
  3. package/compiled.js +1 -1
  4. package/package.json +1 -1
  5. package/ui-test-worker.js +1 -1
  6. package/web/chunk-045d3b5d.js +1 -0
  7. package/web/{chunk-ff1pmd3g.js → chunk-0770q5e1.js} +1 -1
  8. package/web/{chunk-2x4g9t37.js → chunk-18neka5g.js} +2 -2
  9. package/web/{chunk-w3w18stt.js → chunk-1ev0n3n4.js} +1 -1
  10. package/web/chunk-1ex3wgms.js +2 -0
  11. package/web/{chunk-7qkav30b.js → chunk-1qh7f5kr.js} +1 -1
  12. package/web/{chunk-rayf24gy.js → chunk-26ecc2xh.js} +8 -8
  13. package/web/{chunk-me7dza1c.js → chunk-2cz7tx8q.js} +1 -1
  14. package/web/{chunk-mdfksj61.js → chunk-32ty2xfn.js} +1 -1
  15. package/web/{chunk-ts6jsfdk.js → chunk-3eexx7y5.js} +1 -1
  16. package/web/{chunk-2dvbeqt0.js → chunk-46jnkghq.js} +1 -1
  17. package/web/chunk-4am8j3k3.js +1 -0
  18. package/web/{chunk-qz6r9v1z.js → chunk-5qvmefq2.js} +1 -1
  19. package/web/{chunk-9ctg0f30.js → chunk-5svqfj4g.js} +1 -1
  20. package/web/{chunk-qsqtwf34.js → chunk-5v5q13hz.js} +1 -1
  21. package/web/chunk-7np1jp3x.js +8 -0
  22. package/web/chunk-87e8d1hv.js +1 -0
  23. package/web/{chunk-kcjz03h5.js → chunk-88wd49xe.js} +2 -2
  24. package/web/{chunk-0pghpg4y.js → chunk-8h2x89tw.js} +1 -1
  25. package/web/chunk-8y2526ve.js +1 -0
  26. package/web/{chunk-8jcvdd5d.js → chunk-905vw286.js} +1 -1
  27. package/web/{chunk-2hrswh3d.js → chunk-918e5t4x.js} +1 -1
  28. package/web/chunk-96m2m3e8.js +1 -0
  29. package/web/{chunk-43g4wd7a.js → chunk-9f4zzqbx.js} +1 -1
  30. package/web/{chunk-dnv8dx72.js → chunk-a1n4468c.js} +1 -1
  31. package/web/{chunk-s37beysw.js → chunk-b46ws7rf.js} +1 -1
  32. package/web/{chunk-24jhbz82.js → chunk-bc3ajvfg.js} +1 -1
  33. package/web/{chunk-ket6g0yd.js → chunk-d5gshd1a.js} +1 -1
  34. package/web/{chunk-c6yacwbc.js → chunk-de40q05r.js} +1 -1
  35. package/web/chunk-dp0k5vhd.js +1 -0
  36. package/web/{chunk-5dr4tkem.js → chunk-dv1berk6.js} +3 -3
  37. package/web/{chunk-dwjmr0zj.js → chunk-eh7wp62z.js} +1 -1
  38. package/web/{chunk-ctzkqx2g.js → chunk-ehtmb6sn.js} +1 -1
  39. package/web/chunk-et1hytyv.js +1 -0
  40. package/web/chunk-f9m9seam.js +1 -0
  41. package/web/{chunk-3pd0qt83.js → chunk-fmmrthpa.js} +2 -2
  42. package/web/chunk-g2erm7k0.js +1 -0
  43. package/web/chunk-g3kbn0t2.js +1 -0
  44. package/web/{chunk-t893141g.js → chunk-g7dc4hrd.js} +1 -1
  45. package/web/{chunk-p9hfcamx.js → chunk-g7kz8f7q.js} +1 -1
  46. package/web/chunk-ght0t49g.js +1 -0
  47. package/web/{chunk-xa43ndfj.js → chunk-ghwm7bdj.js} +2 -2
  48. package/web/{chunk-8z0r0wtk.js → chunk-grm2208k.js} +1 -1
  49. package/web/{chunk-0zwc2rvh.js → chunk-gsw1tv96.js} +1 -1
  50. package/web/{chunk-tftc5v89.js → chunk-gw8x1g61.js} +1 -1
  51. package/web/chunk-gx340asc.js +1 -0
  52. package/web/{chunk-935mjq1c.js → chunk-h2txs73e.js} +1 -1
  53. package/web/chunk-h3tkacc7.js +1 -0
  54. package/web/{chunk-ewx42c11.js → chunk-h5ckjk48.js} +1 -1
  55. package/web/{chunk-nnyc889n.js → chunk-j37p0b13.js} +1 -1
  56. package/web/{chunk-fjb3ksfd.js → chunk-j89s11x8.js} +1 -1
  57. package/web/chunk-je78j3vr.js +1 -0
  58. package/web/{chunk-fpb2dd2d.js → chunk-jke2ev6m.js} +1 -1
  59. package/web/{chunk-98y92vmh.js → chunk-js6kb05s.js} +1 -1
  60. package/web/{chunk-30b33r2w.js → chunk-k0cg4n2k.js} +2 -2
  61. package/web/{chunk-b5h52neg.js → chunk-knm82fw9.js} +1 -1
  62. package/web/{chunk-vqmj6peg.js → chunk-kxdtg9dt.js} +1 -1
  63. package/web/{chunk-db3twjvk.js → chunk-m4fxd5d9.js} +5 -5
  64. package/web/chunk-m9xzt9p7.js +1 -0
  65. package/web/{chunk-xx11yv61.js → chunk-n4yzs2q0.js} +1 -1
  66. package/web/{chunk-zdyys4ar.js → chunk-nawxgz87.js} +2 -2
  67. package/web/chunk-ngt1j8py.js +1139 -0
  68. package/web/{chunk-3ak5dg10.js → chunk-p55vhns6.js} +1 -1
  69. package/web/{chunk-nvpp0ghj.js → chunk-pgwf37s2.js} +1 -1
  70. package/web/{chunk-af9evdza.js → chunk-q4bst4an.js} +1 -1
  71. package/web/{chunk-9fnr00kv.js → chunk-qdzy124b.js} +2 -2
  72. package/web/chunk-qe0bgeda.js +1 -0
  73. package/web/{chunk-60axh4sa.js → chunk-qy1zx2yw.js} +2 -2
  74. package/web/{chunk-sk1wkgjw.js → chunk-rag65pfs.js} +1 -1
  75. package/web/{chunk-5jdrev9p.js → chunk-rbqnre6q.js} +3 -3
  76. package/web/{chunk-ddyyc20r.js → chunk-rh3xb76f.js} +1 -1
  77. package/web/{chunk-wzd2a4k5.js → chunk-rwfmccmh.js} +1 -1
  78. package/web/{chunk-zb2bkr7f.js → chunk-rxvm70w5.js} +1 -1
  79. package/web/{chunk-z05x9cbm.js → chunk-sat7zyva.js} +1 -1
  80. package/web/{chunk-rrpn5r5w.js → chunk-sc63488q.js} +1 -1
  81. package/web/{chunk-v1exk5wd.js → chunk-sd3xat3r.js} +6 -6
  82. package/web/{chunk-4a6gdrbs.js → chunk-se4h6wx0.js} +1 -1
  83. package/web/{chunk-a0ryzdnp.js → chunk-sjkg40ay.js} +1 -1
  84. package/web/chunk-sk0hpa80.js +1 -0
  85. package/web/{chunk-spbs56wz.js → chunk-t5nvgz7z.js} +1 -1
  86. package/web/{chunk-veam6vk4.js → chunk-tfqarvdx.js} +30 -30
  87. package/web/{chunk-5a4mj3qz.js → chunk-tqze6d6b.js} +1 -1
  88. package/web/{chunk-8w7fyb3v.js → chunk-tt93zbn4.js} +7 -7
  89. package/web/chunk-tvcxrx6h.js +1 -0
  90. package/web/chunk-tzpnh70q.js +1 -0
  91. package/web/{chunk-79e08rk1.js → chunk-vasppf6b.js} +1 -1
  92. package/web/chunk-vb7g4xg6.js +1 -0
  93. package/web/{chunk-dz7g1gnv.js → chunk-w3zgfhjb.js} +1 -1
  94. package/web/{chunk-gn8kyz76.js → chunk-wrevb4ew.js} +1 -1
  95. package/web/{chunk-3ecrkvr3.js → chunk-wtvch4ad.js} +1 -1
  96. package/web/chunk-wzfe6jtq.js +1 -0
  97. package/web/{chunk-eadfxfkw.js → chunk-x5g1yy12.js} +1 -1
  98. package/web/{chunk-m9q5nr8f.js → chunk-x850q01z.js} +1 -1
  99. package/web/{chunk-a61zrp66.js → chunk-xk904wqv.js} +1 -1
  100. package/web/{chunk-3hr3ew9w.js → chunk-xtn305fd.js} +1 -1
  101. package/web/{chunk-3txxt0a7.js → chunk-yekaz74b.js} +1 -1
  102. package/web/{chunk-rasjtvsb.js → chunk-yppgejg7.js} +2 -2
  103. package/web/{chunk-66wb0p6e.js → chunk-z4bp6p32.js} +1 -1
  104. package/web/{chunk-5v2c0aqk.js → chunk-z5qn0xev.js} +1 -1
  105. package/web/{chunk-5baeh8q7.js → chunk-zms6mrqk.js} +4 -4
  106. package/web/{chunk-601k823s.js → chunk-zse05v6j.js} +2 -2
  107. package/web/{chunk-vsjpnwsr.js → chunk-zz1qkaar.js} +1 -1
  108. package/web/index.html +1 -1
  109. package/web/chunk-08sq3cwm.js +0 -1
  110. package/web/chunk-24fjnnee.js +0 -1
  111. package/web/chunk-2j2atyjw.js +0 -1
  112. package/web/chunk-3h3g3ca3.js +0 -1
  113. package/web/chunk-3pcrxg6m.js +0 -1
  114. package/web/chunk-814kkkmq.js +0 -8
  115. package/web/chunk-8w8atrdh.js +0 -1
  116. package/web/chunk-942g3eqn.js +0 -1
  117. package/web/chunk-avxk6jpc.js +0 -2
  118. package/web/chunk-fmthkpff.js +0 -1
  119. package/web/chunk-gv99c8zv.js +0 -1
  120. package/web/chunk-h0767tjv.js +0 -1
  121. package/web/chunk-hqynf99g.js +0 -1
  122. package/web/chunk-mbwwj216.js +0 -1
  123. package/web/chunk-n0wazxgz.js +0 -1
  124. package/web/chunk-nvt9tkt4.js +0 -1139
  125. package/web/chunk-ph1dgffm.js +0 -1
  126. package/web/chunk-rad2s9ha.js +0 -1
  127. package/web/chunk-s60s09mb.js +0 -1
  128. package/web/chunk-tfvcs2xx.js +0 -1
  129. package/web/chunk-wdq2tp9e.js +0 -1
  130. package/web/chunk-wkf5xfyr.js +0 -1
  131. package/web/chunk-y1qty77a.js +0 -1
  132. package/web/chunk-zgavhnt8.js +0 -1
@@ -1 +1 @@
1
- import{r,f,e,n,y,s,ne,Z,q,lt}from"./chunk-nvt9tkt4.js";var z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],h=s("circle-slash",z);function B(t){if(!t||typeof t!=="object")return;if(!("id"in t)||typeof t.id!=="string")return;if(!("state"in t)||typeof t.state!=="string")return;return{id:t.id,state:t.state,command:"command"in t&&typeof t.command==="string"?t.command:void 0,code:"code"in t&&(t.code===null||typeof t.code==="number")?t.code:void 0,output:"output"in t&&typeof t.output==="string"?t.output:void 0}}function U(t){let{Button:N,Panel:b,style:k}=y(),i=B(t.payload),[a,c]=r(!1),[C,P]=r(!1),[u,m]=r();if(!i)return null;let o=C?"killed":i.state,d=o==="running",l=o==="exited"&&i.code===0,p=o==="killed"||o==="timeout",g=i.output?.trim(),I=async()=>{if(a)return;c(!0),m(void 0);try{await t.connection.request(`/api/sessions/${encodeURIComponent(t.sessionID)}/jobs/${encodeURIComponent(i.id)}/kill`,{method:"POST"}),P(!0)}catch(x){m(x instanceof Error?x.message:"停止失败,后台任务可能已结束")}finally{c(!1)}};return n(b,{className:"my-2",header:n(f,{children:[e(lt,{className:"size-3.5 shrink-0 text-faint"}),e("span",{className:"truncate font-mono text-ink/90",title:i.command??i.id,children:i.command??`任务 ${i.id}`})]}),actions:n(f,{children:[d&&n(f,{children:[n("span",{className:"flex items-center gap-1 text-warning",children:[e(Z,{className:"size-3.5 animate-spin"}),e("span",{children:"后台运行中"})]}),e(N,{size:"sm",variant:"danger-ghost",className:"h-6 rounded-md px-2 text-xs",disabled:a,onClick:()=>{I()},children:"停止"})]}),l&&n("span",{className:"flex items-center gap-1 text-success",children:[e(q,{className:"size-3.5"}),e("span",{children:"已完成"})]}),p&&n("span",{className:"flex items-center gap-1 text-faint",children:[e(h,{className:"size-3.5"}),e("span",{children:o==="timeout"?"已超时":"已停止"})]}),!d&&!l&&!p&&n("span",{className:"flex items-center gap-1 text-danger",children:[e(ne,{className:"size-3.5"}),n("span",{children:["退出码 ",i.code??"异常"]})]})]}),children:[u&&e("p",{role:"status",className:"border-b border-line px-4 py-2.5 text-xs text-danger",children:u}),g&&e("pre",{className:k("chat.toolOutput","max-h-60 text-ink/90 select-text"),children:g})]})}export{U as BashJobCard};
1
+ import{r,f,e,n,y,s,ne,Z,q,ct}from"./chunk-ngt1j8py.js";var z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],h=s("circle-slash",z);function B(t){if(!t||typeof t!=="object")return;if(!("id"in t)||typeof t.id!=="string")return;if(!("state"in t)||typeof t.state!=="string")return;return{id:t.id,state:t.state,command:"command"in t&&typeof t.command==="string"?t.command:void 0,code:"code"in t&&(t.code===null||typeof t.code==="number")?t.code:void 0,output:"output"in t&&typeof t.output==="string"?t.output:void 0}}function U(t){let{Button:N,Panel:b,style:k}=y(),i=B(t.payload),[a,c]=r(!1),[C,P]=r(!1),[u,m]=r();if(!i)return null;let o=C?"killed":i.state,d=o==="running",l=o==="exited"&&i.code===0,p=o==="killed"||o==="timeout",g=i.output?.trim(),I=async()=>{if(a)return;c(!0),m(void 0);try{await t.connection.request(`/api/sessions/${encodeURIComponent(t.sessionID)}/jobs/${encodeURIComponent(i.id)}/kill`,{method:"POST"}),P(!0)}catch(x){m(x instanceof Error?x.message:"停止失败,后台任务可能已结束")}finally{c(!1)}};return n(b,{className:"my-2",header:n(f,{children:[e(ct,{className:"size-3.5 shrink-0 text-faint"}),e("span",{className:"truncate font-mono text-ink/90",title:i.command??i.id,children:i.command??`任务 ${i.id}`})]}),actions:n(f,{children:[d&&n(f,{children:[n("span",{className:"flex items-center gap-1 text-warning",children:[e(Z,{className:"size-3.5 animate-spin"}),e("span",{children:"后台运行中"})]}),e(N,{size:"sm",variant:"danger-ghost",className:"h-6 rounded-md px-2 text-xs",disabled:a,onClick:()=>{I()},children:"停止"})]}),l&&n("span",{className:"flex items-center gap-1 text-success",children:[e(q,{className:"size-3.5"}),e("span",{children:"已完成"})]}),p&&n("span",{className:"flex items-center gap-1 text-faint",children:[e(h,{className:"size-3.5"}),e("span",{children:o==="timeout"?"已超时":"已停止"})]}),!d&&!l&&!p&&n("span",{className:"flex items-center gap-1 text-danger",children:[e(ne,{className:"size-3.5"}),n("span",{children:["退出码 ",i.code??"异常"]})]})]}),children:[u&&e("p",{role:"status",className:"border-b border-line px-4 py-2.5 text-xs text-danger",children:u}),g&&e("pre",{className:k("chat.toolOutput","max-h-60 text-ink/90 select-text"),children:g})]})}export{U as BashJobCard};
@@ -1,4 +1,4 @@
1
- import{G}from"./chunk-dwjmr0zj.js";import{t,a,ke,N,x,F,C,S,E,T,A,L,R,V,U}from"./chunk-veam6vk4.js";import{J}from"./chunk-60axh4sa.js";var v={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},M=32,k={axes:[],curves:[],options:v},h=structuredClone(k),W=N.radar,H=t(()=>U({...W,...x().radar}),"getConfig"),O=t(()=>h.axes,"getAxes"),j=t(()=>h.curves,"getCurves"),X=t(()=>h.options,"getOptions"),K=t((n)=>{h.axes=n.map((e)=>({name:e.name,label:e.label??e.name}))},"setAxes"),Y=t((n)=>{h.curves=n.map((e)=>({name:e.name,label:e.label??e.name,entries:Z(e.entries)}))},"setCurves"),Z=t((n)=>{if(n[0].axis==null)return n.map((r)=>r.value);let e=O();if(e.length===0)throw Error("Axes must be populated before curves for reference entries");return e.map((r)=>{let s=n.find((o)=>o.axis?.$refText===r.name);if(s===void 0)throw Error("Missing entry for axis "+r.label);return s.value})},"computeCurveEntries"),q=t((n)=>{let e=n.reduce((r,s)=>(r[s.name]=s,r),{});if(h.options={showLegend:e.showLegend?.value??v.showLegend,ticks:e.ticks?.value??v.ticks,max:e.max?.value??v.max,min:e.min?.value??v.min,graticule:e.graticule?.value??v.graticule},h.options.ticks>M)a.warn(`Radar diagram ticks (${h.options.ticks}) exceeds maximum allowed (${M}). Using ${M} instead.`),h.options.ticks=M},"setOptions"),Q=t(()=>{C(),h=structuredClone(k)},"clear"),w={getAxes:O,getCurves:j,getOptions:X,setAxes:K,setCurves:Y,setOptions:q,getConfig:H,clear:Q,setAccTitle:S,getAccTitle:E,setDiagramTitle:L,getDiagramTitle:R,getAccDescription:A,setAccDescription:T},tt=t((n)=>{G(n,w);let{axes:e,curves:r,options:s}=n;w.setAxes(e),w.setCurves(r),w.setOptions(s)},"populate"),et={parse:t(async(n)=>{let e=await J("radar",n);a.debug(e),tt(e)},"parse")},at=t((n,e,r,s)=>{let o=s.db,c=o.getAxes(),d=o.getCurves(),i=o.getOptions(),l=o.getConfig(),u=o.getDiagramTitle(),m=V(e),p=rt(m,l),g=i.max??Math.max(...d.map((b)=>Math.max(...b.entries))),f=i.min,y=Math.min(l.width,l.height)/2;nt(p,c,y,i.ticks,i.graticule),st(p,c,y,l),I(p,c,d,f,g,i.graticule,l),P(p,d,i.showLegend,l),p.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),rt=t((n,e)=>{let r=e.width+e.marginLeft+e.marginRight,s=e.height+e.marginTop+e.marginBottom,o={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return F(n,s,r,e.useMaxWidth??!0),n.attr("viewBox",`0 0 ${r} ${s}`).attr("overflow","visible"),n.append("g").attr("transform",`translate(${o.x}, ${o.y})`)},"drawFrame"),nt=t((n,e,r,s,o)=>{if(o==="circle")for(let c=0;c<s;c++){let d=r*(c+1)/s;n.append("circle").attr("r",d).attr("class","radarGraticule")}else if(o==="polygon"){let c=e.length;for(let d=0;d<s;d++){let i=r*(d+1)/s,l=e.map((u,m)=>{let p=2*m*Math.PI/c-Math.PI/2,g=i*Math.cos(p),f=i*Math.sin(p);return`${g},${f}`}).join(" ");n.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),st=t((n,e,r,s)=>{let o=e.length;for(let c=0;c<o;c++){let d=e[c].label,i=2*c*Math.PI/o-Math.PI/2,l=Math.cos(i),u=Math.sin(i);n.append("line").attr("x1",0).attr("y1",0).attr("x2",r*s.axisScaleFactor*l).attr("y2",r*s.axisScaleFactor*u).attr("class","radarAxisLine");let m=l>0.01?"start":l<-0.01?"end":"middle",p=u>0.01?"hanging":u<-0.01?"auto":"central",g=4;n.append("text").text(d).attr("x",r*s.axisLabelFactor*l+g*l).attr("y",r*s.axisLabelFactor*u+g*u).attr("text-anchor",m).attr("dominant-baseline",p).attr("class","radarAxisLabel")}},"drawAxes");function I(n,e,r,s,o,c,d){let i=e.length,l=Math.min(d.width,d.height)/2;r.forEach((u,m)=>{if(u.entries.length!==i)return;let p=u.entries.map((g,f)=>{let y=2*Math.PI*f/i-Math.PI/2,b=_(g,s,o,l),z=b*Math.cos(y),B=b*Math.sin(y);return{x:z,y:B}});if(c==="circle")n.append("path").attr("d",D(p,d.curveTension)).attr("class",`radarCurve-${m}`);else if(c==="polygon")n.append("polygon").attr("points",p.map((g)=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${m}`)})}t(I,"drawCurves");function _(n,e,r,s){let o=Math.min(Math.max(n,e),r);return s*(o-e)/(r-e)}t(_,"relativeRadius");function D(n,e){let r=n.length,s=`M${n[0].x},${n[0].y}`;for(let o=0;o<r;o++){let c=n[(o-1+r)%r],d=n[o],i=n[(o+1)%r],l=n[(o+2)%r],u={x:d.x+(i.x-c.x)*e,y:d.y+(i.y-c.y)*e},m={x:i.x-(l.x-d.x)*e,y:i.y-(l.y-d.y)*e};s+=` C${u.x},${u.y} ${m.x},${m.y} ${i.x},${i.y}`}return`${s} Z`}t(D,"closedRoundCurve");function P(n,e,r,s){if(!r)return;let o=(s.width/2+s.marginRight)*3/4,c=-(s.height/2+s.marginTop)*3/4,d=20;e.forEach((i,l)=>{let u=n.append("g").attr("transform",`translate(${o}, ${c+l*d})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(i.label)})}t(P,"drawLegend");var ot={draw:at},it=t((n,e)=>{let r="";for(let s=0;s<n.THEME_COLOR_LIMIT;s++){let o=n[`cScale${s}`];r+=`
1
+ import{G}from"./chunk-eh7wp62z.js";import{t,a,ke,N,x,F,C,S,E,T,A,L,R,V,U}from"./chunk-tfqarvdx.js";import{J}from"./chunk-qy1zx2yw.js";var v={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},M=32,k={axes:[],curves:[],options:v},h=structuredClone(k),W=N.radar,H=t(()=>U({...W,...x().radar}),"getConfig"),O=t(()=>h.axes,"getAxes"),j=t(()=>h.curves,"getCurves"),X=t(()=>h.options,"getOptions"),K=t((n)=>{h.axes=n.map((e)=>({name:e.name,label:e.label??e.name}))},"setAxes"),Y=t((n)=>{h.curves=n.map((e)=>({name:e.name,label:e.label??e.name,entries:Z(e.entries)}))},"setCurves"),Z=t((n)=>{if(n[0].axis==null)return n.map((r)=>r.value);let e=O();if(e.length===0)throw Error("Axes must be populated before curves for reference entries");return e.map((r)=>{let s=n.find((o)=>o.axis?.$refText===r.name);if(s===void 0)throw Error("Missing entry for axis "+r.label);return s.value})},"computeCurveEntries"),q=t((n)=>{let e=n.reduce((r,s)=>(r[s.name]=s,r),{});if(h.options={showLegend:e.showLegend?.value??v.showLegend,ticks:e.ticks?.value??v.ticks,max:e.max?.value??v.max,min:e.min?.value??v.min,graticule:e.graticule?.value??v.graticule},h.options.ticks>M)a.warn(`Radar diagram ticks (${h.options.ticks}) exceeds maximum allowed (${M}). Using ${M} instead.`),h.options.ticks=M},"setOptions"),Q=t(()=>{C(),h=structuredClone(k)},"clear"),w={getAxes:O,getCurves:j,getOptions:X,setAxes:K,setCurves:Y,setOptions:q,getConfig:H,clear:Q,setAccTitle:S,getAccTitle:E,setDiagramTitle:L,getDiagramTitle:R,getAccDescription:A,setAccDescription:T},tt=t((n)=>{G(n,w);let{axes:e,curves:r,options:s}=n;w.setAxes(e),w.setCurves(r),w.setOptions(s)},"populate"),et={parse:t(async(n)=>{let e=await J("radar",n);a.debug(e),tt(e)},"parse")},at=t((n,e,r,s)=>{let o=s.db,c=o.getAxes(),d=o.getCurves(),i=o.getOptions(),l=o.getConfig(),u=o.getDiagramTitle(),m=V(e),p=rt(m,l),g=i.max??Math.max(...d.map((b)=>Math.max(...b.entries))),f=i.min,y=Math.min(l.width,l.height)/2;nt(p,c,y,i.ticks,i.graticule),st(p,c,y,l),I(p,c,d,f,g,i.graticule,l),P(p,d,i.showLegend,l),p.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),rt=t((n,e)=>{let r=e.width+e.marginLeft+e.marginRight,s=e.height+e.marginTop+e.marginBottom,o={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return F(n,s,r,e.useMaxWidth??!0),n.attr("viewBox",`0 0 ${r} ${s}`).attr("overflow","visible"),n.append("g").attr("transform",`translate(${o.x}, ${o.y})`)},"drawFrame"),nt=t((n,e,r,s,o)=>{if(o==="circle")for(let c=0;c<s;c++){let d=r*(c+1)/s;n.append("circle").attr("r",d).attr("class","radarGraticule")}else if(o==="polygon"){let c=e.length;for(let d=0;d<s;d++){let i=r*(d+1)/s,l=e.map((u,m)=>{let p=2*m*Math.PI/c-Math.PI/2,g=i*Math.cos(p),f=i*Math.sin(p);return`${g},${f}`}).join(" ");n.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),st=t((n,e,r,s)=>{let o=e.length;for(let c=0;c<o;c++){let d=e[c].label,i=2*c*Math.PI/o-Math.PI/2,l=Math.cos(i),u=Math.sin(i);n.append("line").attr("x1",0).attr("y1",0).attr("x2",r*s.axisScaleFactor*l).attr("y2",r*s.axisScaleFactor*u).attr("class","radarAxisLine");let m=l>0.01?"start":l<-0.01?"end":"middle",p=u>0.01?"hanging":u<-0.01?"auto":"central",g=4;n.append("text").text(d).attr("x",r*s.axisLabelFactor*l+g*l).attr("y",r*s.axisLabelFactor*u+g*u).attr("text-anchor",m).attr("dominant-baseline",p).attr("class","radarAxisLabel")}},"drawAxes");function I(n,e,r,s,o,c,d){let i=e.length,l=Math.min(d.width,d.height)/2;r.forEach((u,m)=>{if(u.entries.length!==i)return;let p=u.entries.map((g,f)=>{let y=2*Math.PI*f/i-Math.PI/2,b=_(g,s,o,l),z=b*Math.cos(y),B=b*Math.sin(y);return{x:z,y:B}});if(c==="circle")n.append("path").attr("d",D(p,d.curveTension)).attr("class",`radarCurve-${m}`);else if(c==="polygon")n.append("polygon").attr("points",p.map((g)=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${m}`)})}t(I,"drawCurves");function _(n,e,r,s){let o=Math.min(Math.max(n,e),r);return s*(o-e)/(r-e)}t(_,"relativeRadius");function D(n,e){let r=n.length,s=`M${n[0].x},${n[0].y}`;for(let o=0;o<r;o++){let c=n[(o-1+r)%r],d=n[o],i=n[(o+1)%r],l=n[(o+2)%r],u={x:d.x+(i.x-c.x)*e,y:d.y+(i.y-c.y)*e},m={x:i.x-(l.x-d.x)*e,y:i.y-(l.y-d.y)*e};s+=` C${u.x},${u.y} ${m.x},${m.y} ${i.x},${i.y}`}return`${s} Z`}t(D,"closedRoundCurve");function P(n,e,r,s){if(!r)return;let o=(s.width/2+s.marginRight)*3/4,c=-(s.height/2+s.marginTop)*3/4,d=20;e.forEach((i,l)=>{let u=n.append("g").attr("transform",`translate(${o}, ${c+l*d})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(i.label)})}t(P,"drawLegend");var ot={draw:at},it=t((n,e)=>{let r="";for(let s=0;s<n.THEME_COLOR_LIMIT;s++){let o=n[`cScale${s}`];r+=`
2
2
  .radarCurve-${s} {
3
3
  color: ${o};
4
4
  fill: ${o};
@@ -1,2 +1,2 @@
1
- import{ae,Vi,Ve,Rn,vo,$a,Ut,Un,Fe,Er,Hr,jn,bo,Wi,qn}from"./chunk-veam6vk4.js";function Z(l){return l.innerRadius}function k(l){return l.outerRadius}function b(l){return l.startAngle}function _(l){return l.endAngle}function nn(l){return l&&l.padAngle}function en(l,d,q,P,x,h,S,r){var D=q-l,a=P-d,n=S-x,y=r-h,u=y*D-n*a;if(u*u<Fe)return;return u=(n*(d-h)-y*(l-x))/u,[l+u*D,d+u*a]}function L(l,d,q,P,x,h,S){var r=l-q,D=d-P,a=(S?h:-h)/Un(r*r+D*D),n=a*D,y=-a*r,u=l+n,s=d+y,t=q+n,f=P+y,j=(u+t)/2,o=(s+f)/2,g=t-u,c=f-s,v=g*g+c*c,A=x-h,R=u*f-t*s,E=(c<0?-1:1)*Un(vo(0,A*A*v-R*R)),I=(R*c-g*E)/v,O=(-R*g-c*E)/v,T=(R*c+g*E)/v,m=(-R*g+c*E)/v,p=I-j,e=O-o,i=T-j,z=m-o;if(p*p+e*e>i*i+z*z)I=T,O=m;return{cx:I,cy:O,x01:-n,y01:-y,x11:I*(x/A-1),y11:O*(x/A-1)}}function _t(){var l=Z,d=k,q=ae(0),P=null,x=b,h=_,S=nn,r=null,D=qn(a);function a(){var n,y,u=+l.apply(this,arguments),s=+d.apply(this,arguments),t=x.apply(this,arguments)-Hr,f=h.apply(this,arguments)-Hr,j=Vi(f-t),o=f>t;if(!r)r=n=D();if(s<u)y=s,s=u,u=y;if(!(s>Fe))r.moveTo(0,0);else if(j>jn-Fe){if(r.moveTo(s*Rn(t),s*Ut(t)),r.arc(0,0,s,t,f,!o),u>Fe)r.moveTo(u*Rn(f),u*Ut(f)),r.arc(0,0,u,f,t,o)}else{var g=t,c=f,v=t,A=f,R=j,E=j,I=S.apply(this,arguments)/2,O=I>Fe&&(P?+P.apply(this,arguments):Un(u*u+s*s)),T=$a(Vi(s-u)/2,+q.apply(this,arguments)),m=T,p=T,e,i;if(O>Fe){var z=Wi(O/u*Ut(I)),F=Wi(O/s*Ut(I));if((R-=z*2)>Fe)z*=o?1:-1,v+=z,A-=z;else R=0,v=A=(t+f)/2;if((E-=F*2)>Fe)F*=o?1:-1,g+=F,c-=F;else E=0,g=c=(t+f)/2}var B=s*Rn(g),C=s*Ut(g),G=u*Rn(A),H=u*Ut(A);if(T>Fe){var J=s*Rn(c),K=s*Ut(c),M=u*Rn(v),N=u*Ut(v),w;if(j<Er)if(w=en(B,C,M,N,J,K,G,H)){var Q=B-w[0],U=C-w[1],V=J-w[0],W=K-w[1],X=1/Ut(bo((Q*V+U*W)/(Un(Q*Q+U*U)*Un(V*V+W*W)))/2),Y=Un(w[0]*w[0]+w[1]*w[1]);m=$a(T,(u-Y)/(X-1)),p=$a(T,(s-Y)/(X+1))}else m=p=0}if(!(E>Fe))r.moveTo(B,C);else if(p>Fe)if(e=L(M,N,B,C,s,p,o),i=L(J,K,G,H,s,p,o),r.moveTo(e.cx+e.x01,e.cy+e.y01),p<T)r.arc(e.cx,e.cy,p,Ve(e.y01,e.x01),Ve(i.y01,i.x01),!o);else r.arc(e.cx,e.cy,p,Ve(e.y01,e.x01),Ve(e.y11,e.x11),!o),r.arc(0,0,s,Ve(e.cy+e.y11,e.cx+e.x11),Ve(i.cy+i.y11,i.cx+i.x11),!o),r.arc(i.cx,i.cy,p,Ve(i.y11,i.x11),Ve(i.y01,i.x01),!o);else r.moveTo(B,C),r.arc(0,0,s,g,c,!o);if(!(u>Fe)||!(R>Fe))r.lineTo(G,H);else if(m>Fe)if(e=L(G,H,J,K,u,-m,o),i=L(B,C,M,N,u,-m,o),r.lineTo(e.cx+e.x01,e.cy+e.y01),m<T)r.arc(e.cx,e.cy,m,Ve(e.y01,e.x01),Ve(i.y01,i.x01),!o);else r.arc(e.cx,e.cy,m,Ve(e.y01,e.x01),Ve(e.y11,e.x11),!o),r.arc(0,0,u,Ve(e.cy+e.y11,e.cx+e.x11),Ve(i.cy+i.y11,i.cx+i.x11),o),r.arc(i.cx,i.cy,m,Ve(i.y11,i.x11),Ve(i.y01,i.x01),!o);else r.arc(0,0,u,A,v,o)}if(r.closePath(),n)return r=null,n+""||null}return a.centroid=function(){var n=(+l.apply(this,arguments)+ +d.apply(this,arguments))/2,y=(+x.apply(this,arguments)+ +h.apply(this,arguments))/2-Er/2;return[Rn(y)*n,Ut(y)*n]},a.innerRadius=function(n){return arguments.length?(l=typeof n==="function"?n:ae(+n),a):l},a.outerRadius=function(n){return arguments.length?(d=typeof n==="function"?n:ae(+n),a):d},a.cornerRadius=function(n){return arguments.length?(q=typeof n==="function"?n:ae(+n),a):q},a.padRadius=function(n){return arguments.length?(P=n==null?null:typeof n==="function"?n:ae(+n),a):P},a.startAngle=function(n){return arguments.length?(x=typeof n==="function"?n:ae(+n),a):x},a.endAngle=function(n){return arguments.length?(h=typeof n==="function"?n:ae(+n),a):h},a.padAngle=function(n){return arguments.length?(S=typeof n==="function"?n:ae(+n),a):S},a.context=function(n){return arguments.length?(r=n==null?null:n,a):r},a}
1
+ import{ae,Vi,Ve,Rn,vo,$a,Ut,Un,Fe,Er,Hr,jn,bo,Wi,qn}from"./chunk-tfqarvdx.js";function Z(l){return l.innerRadius}function k(l){return l.outerRadius}function b(l){return l.startAngle}function _(l){return l.endAngle}function nn(l){return l&&l.padAngle}function en(l,d,q,P,x,h,S,r){var D=q-l,a=P-d,n=S-x,y=r-h,u=y*D-n*a;if(u*u<Fe)return;return u=(n*(d-h)-y*(l-x))/u,[l+u*D,d+u*a]}function L(l,d,q,P,x,h,S){var r=l-q,D=d-P,a=(S?h:-h)/Un(r*r+D*D),n=a*D,y=-a*r,u=l+n,s=d+y,t=q+n,f=P+y,j=(u+t)/2,o=(s+f)/2,g=t-u,c=f-s,v=g*g+c*c,A=x-h,R=u*f-t*s,E=(c<0?-1:1)*Un(vo(0,A*A*v-R*R)),I=(R*c-g*E)/v,O=(-R*g-c*E)/v,T=(R*c+g*E)/v,m=(-R*g+c*E)/v,p=I-j,e=O-o,i=T-j,z=m-o;if(p*p+e*e>i*i+z*z)I=T,O=m;return{cx:I,cy:O,x01:-n,y01:-y,x11:I*(x/A-1),y11:O*(x/A-1)}}function _t(){var l=Z,d=k,q=ae(0),P=null,x=b,h=_,S=nn,r=null,D=qn(a);function a(){var n,y,u=+l.apply(this,arguments),s=+d.apply(this,arguments),t=x.apply(this,arguments)-Hr,f=h.apply(this,arguments)-Hr,j=Vi(f-t),o=f>t;if(!r)r=n=D();if(s<u)y=s,s=u,u=y;if(!(s>Fe))r.moveTo(0,0);else if(j>jn-Fe){if(r.moveTo(s*Rn(t),s*Ut(t)),r.arc(0,0,s,t,f,!o),u>Fe)r.moveTo(u*Rn(f),u*Ut(f)),r.arc(0,0,u,f,t,o)}else{var g=t,c=f,v=t,A=f,R=j,E=j,I=S.apply(this,arguments)/2,O=I>Fe&&(P?+P.apply(this,arguments):Un(u*u+s*s)),T=$a(Vi(s-u)/2,+q.apply(this,arguments)),m=T,p=T,e,i;if(O>Fe){var z=Wi(O/u*Ut(I)),F=Wi(O/s*Ut(I));if((R-=z*2)>Fe)z*=o?1:-1,v+=z,A-=z;else R=0,v=A=(t+f)/2;if((E-=F*2)>Fe)F*=o?1:-1,g+=F,c-=F;else E=0,g=c=(t+f)/2}var B=s*Rn(g),C=s*Ut(g),G=u*Rn(A),H=u*Ut(A);if(T>Fe){var J=s*Rn(c),K=s*Ut(c),M=u*Rn(v),N=u*Ut(v),w;if(j<Er)if(w=en(B,C,M,N,J,K,G,H)){var Q=B-w[0],U=C-w[1],V=J-w[0],W=K-w[1],X=1/Ut(bo((Q*V+U*W)/(Un(Q*Q+U*U)*Un(V*V+W*W)))/2),Y=Un(w[0]*w[0]+w[1]*w[1]);m=$a(T,(u-Y)/(X-1)),p=$a(T,(s-Y)/(X+1))}else m=p=0}if(!(E>Fe))r.moveTo(B,C);else if(p>Fe)if(e=L(M,N,B,C,s,p,o),i=L(J,K,G,H,s,p,o),r.moveTo(e.cx+e.x01,e.cy+e.y01),p<T)r.arc(e.cx,e.cy,p,Ve(e.y01,e.x01),Ve(i.y01,i.x01),!o);else r.arc(e.cx,e.cy,p,Ve(e.y01,e.x01),Ve(e.y11,e.x11),!o),r.arc(0,0,s,Ve(e.cy+e.y11,e.cx+e.x11),Ve(i.cy+i.y11,i.cx+i.x11),!o),r.arc(i.cx,i.cy,p,Ve(i.y11,i.x11),Ve(i.y01,i.x01),!o);else r.moveTo(B,C),r.arc(0,0,s,g,c,!o);if(!(u>Fe)||!(R>Fe))r.lineTo(G,H);else if(m>Fe)if(e=L(G,H,J,K,u,-m,o),i=L(B,C,M,N,u,-m,o),r.lineTo(e.cx+e.x01,e.cy+e.y01),m<T)r.arc(e.cx,e.cy,m,Ve(e.y01,e.x01),Ve(i.y01,i.x01),!o);else r.arc(e.cx,e.cy,m,Ve(e.y01,e.x01),Ve(e.y11,e.x11),!o),r.arc(0,0,u,Ve(e.cy+e.y11,e.cx+e.x11),Ve(i.cy+i.y11,i.cx+i.x11),o),r.arc(i.cx,i.cy,m,Ve(i.y11,i.x11),Ve(i.y01,i.x01),!o);else r.arc(0,0,u,A,v,o)}if(r.closePath(),n)return r=null,n+""||null}return a.centroid=function(){var n=(+l.apply(this,arguments)+ +d.apply(this,arguments))/2,y=(+x.apply(this,arguments)+ +h.apply(this,arguments))/2-Er/2;return[Rn(y)*n,Ut(y)*n]},a.innerRadius=function(n){return arguments.length?(l=typeof n==="function"?n:ae(+n),a):l},a.outerRadius=function(n){return arguments.length?(d=typeof n==="function"?n:ae(+n),a):d},a.cornerRadius=function(n){return arguments.length?(q=typeof n==="function"?n:ae(+n),a):q},a.padRadius=function(n){return arguments.length?(P=n==null?null:typeof n==="function"?n:ae(+n),a):P},a.startAngle=function(n){return arguments.length?(x=typeof n==="function"?n:ae(+n),a):x},a.endAngle=function(n){return arguments.length?(h=typeof n==="function"?n:ae(+n),a):h},a.padAngle=function(n){return arguments.length?(S=typeof n==="function"?n:ae(+n),a):S},a.context=function(n){return arguments.length?(r=n==null?null:n,a):r},a}
2
2
  export{_t};
@@ -0,0 +1 @@
1
+ import{Li}from"./chunk-qy1zx2yw.js";export{Li as createPacketServices};
@@ -1 +1 @@
1
- import{t,a}from"./chunk-veam6vk4.js";import{ee,Dt,Nt}from"./chunk-xx11yv61.js";import{G}from"./chunk-dwjmr0zj.js";import{or,wt}from"./chunk-60axh4sa.js";var i=or().RailroadPeg.parser.LangiumParser,s=t((e)=>{let r=e.alternatives.map(l);if(r.length===1)return r[0];return{type:"choice",alternatives:r}},"transformOrderedChoice"),l=t((e)=>{let r=e.elements.map(m);if(r.length===1)return r[0];return{type:"sequence",elements:r}},"transformSequence"),m=t((e)=>{let r=p(e.suffix);if(!e.operator)return r;return{type:"special",text:e.operator==="&"?`&${o(r)}`:`!${o(r)}`}},"transformPrefix"),o=t((e)=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),p=t((e)=>{let r=u(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),u=t((e)=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return s(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),c=t((e)=>({name:e.name,definition:s(e.definition)}),"transformRule"),f=t((e)=>{if(G(e,ee),e.title)ee.setTitle(e.title);e.rules.map((r)=>ee.addRule(c(r)))},"populateDb"),d={parse:t((e)=>{ee.clear(),a.debug("[PEG Parser] Starting Langium parse");let r=i.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new wt(r);let n=r.value;a.debug("[PEG Parser] Parsed rules:",n.rules.length),f(n),a.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:ee}},w={parser:d,db:ee,renderer:Nt,styles:Dt};export{w as diagram};
1
+ import{t,a}from"./chunk-tfqarvdx.js";import{ee,Dt,Nt}from"./chunk-n4yzs2q0.js";import{G}from"./chunk-eh7wp62z.js";import{or,wt}from"./chunk-qy1zx2yw.js";var i=or().RailroadPeg.parser.LangiumParser,s=t((e)=>{let r=e.alternatives.map(l);if(r.length===1)return r[0];return{type:"choice",alternatives:r}},"transformOrderedChoice"),l=t((e)=>{let r=e.elements.map(m);if(r.length===1)return r[0];return{type:"sequence",elements:r}},"transformSequence"),m=t((e)=>{let r=p(e.suffix);if(!e.operator)return r;return{type:"special",text:e.operator==="&"?`&${o(r)}`:`!${o(r)}`}},"transformPrefix"),o=t((e)=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),p=t((e)=>{let r=u(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),u=t((e)=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return s(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),c=t((e)=>({name:e.name,definition:s(e.definition)}),"transformRule"),f=t((e)=>{if(G(e,ee),e.title)ee.setTitle(e.title);e.rules.map((r)=>ee.addRule(c(r)))},"populateDb"),d={parse:t((e)=>{ee.clear(),a.debug("[PEG Parser] Starting Langium parse");let r=i.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new wt(r);let n=r.value;a.debug("[PEG Parser] Parsed rules:",n.rules.length),f(n),a.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:ee}},w={parser:d,db:ee,renderer:Nt,styles:Dt};export{w as diagram};
@@ -1,3 +1,3 @@
1
- import{G}from"./chunk-dwjmr0zj.js";import{t,a,N,x,O,C,S,E,T,A,L,R,l,kr,p,Dn,Qr,U}from"./chunk-veam6vk4.js";import{Fr,J}from"./chunk-60axh4sa.js";var _="position frame",V="frame positioned",F="position relation",X="relation positioned",pe=t(function(e){a.debug("options str",e)},"setOptions"),ve=t(function(){return{}},"getOptions"),be=t(function(){j(),C()},"clear");function j(){M={}}t(j,"reset");var we=N.eventmodeling,ye=t(()=>U({...we,...x().eventmodeling}),"getConfig"),M={};function Y(){let e=Pe,{ast:i}=M,n=I();if(!i)throw Error("No data for EventModel");return i.frames.forEach((r,o)=>{let s=te(r,i.dataEntities,n);e=P(e,{$kind:_,index:o,frame:r,textProps:s});let c=void 0;if(se(r))a.debug("source frame",r.sourceFrames),c=i.frames.filter((m)=>r.sourceFrames.some((u)=>u.$refText===m.name)),c.forEach((m)=>{e=P(e,{$kind:F,index:o,frame:r,sourceFrame:m})});else e=P(e,{$kind:F,index:o,frame:r})}),e={...e,sortedSwimlanesArray:W(e.swimlanes)},e}t(Y,"getState");function z(e){M.ast=void 0;let i=new Set;for(let n of e.frames){if(i.has(n.name)){let r=n.$cstNode?.range.start.line,o=r===void 0?"":` on line ${r+1}`;throw Error(`Duplicate event modeling frame ID "${n.name}"${o}`)}i.add(n.name)}M.ast=e}t(z,"setAst");var d={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function I(){return d}t(I,"getDiagramProps");var Pe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function K(e){let i=e.split(".");if(i.length===2)return i[0];return}t(K,"extractNamespace");function q(e){let i=e.split(".");if(i.length===2)return i[1];return e}t(q,"extractName");function Q(e,i){if(!i||i.length===0)return;return Object.values(e).find((n)=>n.namespace===i)}t(Q,"findSwimlaneByNamespace");function y(e,i,n){return Math.max(i,...Object.keys(e).filter((r)=>{let o=Number.parseInt(r);return o>i&&o<n}).map((r)=>Number.parseInt(r)))+1}t(y,"findNextAvailableIndex");function Z(e,i){let n=K(e.entityIdentifier),r=Q(i,n);switch(e.modelEntityType){case"ui":case"pcr":case"processor":if(r)return{index:r.index,label:r.namespace||d.labelUiAutomation};else if(n)return{index:y(i,0,100),label:d.labelUiAutomationPrefix+n};return{index:0,label:d.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":if(r)return{index:r.index,label:r.namespace||d.labelCommandReadModel};else if(n)return{index:y(i,100,200),label:d.labelCommandReadModelPrefix+n};return{index:100,label:d.labelCommandReadModel};case"evt":case"event":default:if(r)return{index:r.index,label:r.namespace||d.labelEvents};else if(n)return{index:y(i,200,300),label:d.labelEventsPrefix+n};return{index:200,label:d.labelEvents}}}t(Z,"calculateSwimlaneProps");function ee(e){let{themeVariables:i}=x();switch(e.modelEntityType){case"ui":return{fill:i.emUiFill??"white",stroke:i.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:i.emProcessorFill??"#edb3f6",stroke:i.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:i.emReadModelFill??"#d3f1a2",stroke:i.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:i.emCommandFill??"#bcd6fe",stroke:i.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:i.emEventFill??"#ffb778",stroke:i.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}t(ee,"calculateEntityVisualProps");function te(e,i,n){let r=x(),o=O(q(e.entityIdentifier)??"",r),s,c={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"},u=`<b>${Dn(o,n.textMaxWidth,c)}</b>`;if(e.dataInlineValue)s=e.dataInlineValue,s=s.substring(s.indexOf("{")+1),s=s.substring(0,s.lastIndexOf("}")-1),s=O(s,r),s=Dn(s,n.textMaxWidth,c),s=s.replaceAll(" ","&nbsp;");if(e.dataReference){let w=i.find((k)=>k.name===e.dataReference?.$refText);if(w)s=w.dataBlockValue,s=s.substring(s.indexOf(`{
1
+ import{G}from"./chunk-eh7wp62z.js";import{t,a,N,x,O,C,S,E,T,A,L,R,l,kr,p,Dn,Qr,U}from"./chunk-tfqarvdx.js";import{Fr,J}from"./chunk-qy1zx2yw.js";var _="position frame",V="frame positioned",F="position relation",X="relation positioned",pe=t(function(e){a.debug("options str",e)},"setOptions"),ve=t(function(){return{}},"getOptions"),be=t(function(){j(),C()},"clear");function j(){M={}}t(j,"reset");var we=N.eventmodeling,ye=t(()=>U({...we,...x().eventmodeling}),"getConfig"),M={};function Y(){let e=Pe,{ast:i}=M,n=I();if(!i)throw Error("No data for EventModel");return i.frames.forEach((r,o)=>{let s=te(r,i.dataEntities,n);e=P(e,{$kind:_,index:o,frame:r,textProps:s});let c=void 0;if(se(r))a.debug("source frame",r.sourceFrames),c=i.frames.filter((m)=>r.sourceFrames.some((u)=>u.$refText===m.name)),c.forEach((m)=>{e=P(e,{$kind:F,index:o,frame:r,sourceFrame:m})});else e=P(e,{$kind:F,index:o,frame:r})}),e={...e,sortedSwimlanesArray:W(e.swimlanes)},e}t(Y,"getState");function z(e){M.ast=void 0;let i=new Set;for(let n of e.frames){if(i.has(n.name)){let r=n.$cstNode?.range.start.line,o=r===void 0?"":` on line ${r+1}`;throw Error(`Duplicate event modeling frame ID "${n.name}"${o}`)}i.add(n.name)}M.ast=e}t(z,"setAst");var d={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function I(){return d}t(I,"getDiagramProps");var Pe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function K(e){let i=e.split(".");if(i.length===2)return i[0];return}t(K,"extractNamespace");function q(e){let i=e.split(".");if(i.length===2)return i[1];return e}t(q,"extractName");function Q(e,i){if(!i||i.length===0)return;return Object.values(e).find((n)=>n.namespace===i)}t(Q,"findSwimlaneByNamespace");function y(e,i,n){return Math.max(i,...Object.keys(e).filter((r)=>{let o=Number.parseInt(r);return o>i&&o<n}).map((r)=>Number.parseInt(r)))+1}t(y,"findNextAvailableIndex");function Z(e,i){let n=K(e.entityIdentifier),r=Q(i,n);switch(e.modelEntityType){case"ui":case"pcr":case"processor":if(r)return{index:r.index,label:r.namespace||d.labelUiAutomation};else if(n)return{index:y(i,0,100),label:d.labelUiAutomationPrefix+n};return{index:0,label:d.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":if(r)return{index:r.index,label:r.namespace||d.labelCommandReadModel};else if(n)return{index:y(i,100,200),label:d.labelCommandReadModelPrefix+n};return{index:100,label:d.labelCommandReadModel};case"evt":case"event":default:if(r)return{index:r.index,label:r.namespace||d.labelEvents};else if(n)return{index:y(i,200,300),label:d.labelEventsPrefix+n};return{index:200,label:d.labelEvents}}}t(Z,"calculateSwimlaneProps");function ee(e){let{themeVariables:i}=x();switch(e.modelEntityType){case"ui":return{fill:i.emUiFill??"white",stroke:i.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:i.emProcessorFill??"#edb3f6",stroke:i.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:i.emReadModelFill??"#d3f1a2",stroke:i.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:i.emCommandFill??"#bcd6fe",stroke:i.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:i.emEventFill??"#ffb778",stroke:i.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}t(ee,"calculateEntityVisualProps");function te(e,i,n){let r=x(),o=O(q(e.entityIdentifier)??"",r),s,c={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"},u=`<b>${Dn(o,n.textMaxWidth,c)}</b>`;if(e.dataInlineValue)s=e.dataInlineValue,s=s.substring(s.indexOf("{")+1),s=s.substring(0,s.lastIndexOf("}")-1),s=O(s,r),s=Dn(s,n.textMaxWidth,c),s=s.replaceAll(" ","&nbsp;");if(e.dataReference){let w=i.find((k)=>k.name===e.dataReference?.$refText);if(w)s=w.dataBlockValue,s=s.substring(s.indexOf(`{
2
2
  `)+2),s=s.substring(0,s.lastIndexOf("}")-1),s=O(s,r),s=Dn(s,n.textMaxWidth,c),s=s.replaceAll(" ","&nbsp;"),s+="<br/>"}let f=s!==void 0;if(f)u+=`<br/><br/><code style="text-align: left; display: block;max-width:${n.textMaxWidth}px">${s}</code>`;let h={fontSize:c.fontSize,fontWeight:c.fontWeight,fontFamily:c.fontFamily},g=Qr(u,h),b=f?g.width/3:g.width,v={content:u,width:b,height:g.height};return a.debug(`[${e.name}] ${e.entityIdentifier} text`,v),v}t(te,"calculateTextProps");function ne(e,i){let n=i,r=ee(n.frame),o={width:n.textProps.width+2*d.boxTextPadding,height:n.textProps.height+2*d.boxTextPadding};return[{$kind:V,frame:n.frame,index:n.index,visual:r,dimension:o,textProps:n.textProps}]}t(ne,"decidePositionFrame");function ie(e,i,n){if(i===void 0)return d.contentStartX;if(i.index===e.index&&e.r)return e.r+d.boxPadding;if(n===void 0)return d.contentStartX;return n.r-d.boxOverlap+d.boxPadding}t(ie,"calculateX");function re(e,i){let n=[...e.map((r)=>r.r),i];return Math.max(...n)}t(re,"calculateMaxRight");function W(e){return Object.values(e).sort((i,n)=>i.index-n.index)}t(W,"sortedSwimlanesArray");function ae(e,i){let n=i,r=Z(n.frame,e.swimlanes),o;if(r.index in e.swimlanes)o=e.swimlanes[r.index];else o={index:r.index,label:r.label,r:0,y:r.index*d.swimlaneMinHeight+d.swimlaneGap,height:d.swimlaneMinHeight,maxHeight:d.swimlaneMinHeight};let s=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,c=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,m={width:Math.max(d.boxMinWidth,Math.min(d.boxMaxWidth,n.dimension.width))+2*d.boxPadding,height:Math.max(d.boxMinHeight,Math.min(d.boxMaxHeight,n.dimension.height))+2*d.boxPadding},u=ie(o,c,s),f=u+m.width+d.boxPadding,h=re(Object.values(e.swimlanes),f);o.r=u+m.width,o.maxHeight=Math.max(o.maxHeight,m.height),o.height=Math.max(d.swimlaneMinHeight,o.maxHeight)+2*d.swimlanePadding;let g={x:u,y:d.swimlanePadding+o.y,r:f,dimension:m,leftSibling:!1,swimlane:o,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},b={...e,boxes:[...e.boxes,g],swimlanes:{...e.swimlanes,[`${o.index}`]:o},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:h},v=W(b.swimlanes);if(v.length>0)v[0].y=0;for(let w=1;w<v.length;w++){let k=v[w],H=v[w-1];k.y=H.y+H.height+d.swimlaneGap}return b}t(ae,"evolveFramePositioned");function oe(e,i){if(e===0&&i.sourceFrames.length===0)return!0;return!1}t(oe,"isFirstFrame");function se(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}t(se,"hasSourceFrame");function B(e,i){if(i===void 0||i===null)return;return e.find((n)=>n.frame.name===i.name)}t(B,"findBoxByFrame");function de(e,i,n){if(n<0)return;for(let r=n;r>=0;r--){let o=e[r];if(o.swimlane.index!==i)return o}return}t(de,"findBoxByLineIndex");function le(e,i){let n=i;if(oe(n.index,n.frame))return[];let r=B(e.boxes,n.frame);if(r===void 0)throw Error(`Target box not found for frame ${n.frame.name}`);let o;if(n.sourceFrame)o=B(e.boxes,n.sourceFrame);else{if(Fr(n.frame))return[];o=de(e.boxes,r.swimlane.index,n.index-1)}if(o===void 0)return[];return[{$kind:X,frame:n.frame,index:n.index,sourceBox:o,targetBox:r}]}t(le,"decidePositionRelation");function ce(e,i){let n=i,r={visual:{fill:"none",stroke:"#000"},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};return{...e,relations:[...e.relations,r]}}t(ce,"evolveRelationPositioned");var Se={[_]:ne,[F]:le},Me={[V]:ae,[X]:ce};function me(e,i){let n=Se[i.$kind];if(n===void 0||n===null)return[];let r=n(e,i);return a.debug("decided events",r),r}t(me,"decide");function ue(e,i){let n=i.reduce((r,o)=>{let s=Me[o.$kind];if(s===void 0||s===null)return r;return s(r,o)},e);return a.debug("evolve events",{state:e,newState:n,events:i}),n}t(ue,"evolve");function P(e,i){let n=me(e,i);return ue(e,n)}t(P,"dispatch");var D={getConfig:ye,preserveCommentsWhenParsing:!0,setOptions:pe,getOptions:ve,clear:be,setAccTitle:S,getAccTitle:E,getAccDescription:A,setAccDescription:T,setDiagramTitle:L,getDiagramTitle:R,setAst:z,getDiagramProps:I,getState:Y},ke={parse:t(async(e)=>{let i=await J("eventmodeling",e);a.debug(i),D.setAst(i),G(i,D)},"parse")},Fe=l(),Be=Fe?.eventmodeling;function xe(e,i){return(n)=>{let r=n.swimlane.y+i.swimlanePadding,o=e.append("g").attr("class","em-box");o.append("rect").attr("x",n.x).attr("y",r).attr("rx","3").attr("width",n.dimension.width).attr("height",n.dimension.height).attr("stroke",n.visual.stroke).attr("fill",n.visual.fill),o.append("foreignObject").attr("x",n.x+i.boxPadding).attr("y",r+10).attr("width",n.dimension.width-2*i.boxPadding).attr("height",n.dimension.height-2*i.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(n.text)}}t(xe,"renderD3Box");function fe(e,i){return e>i}t(fe,"dirUpwards");function ge(e,i,n,r){return(o)=>{let s=o.sourceBox.swimlane.y+i.swimlanePadding,c=o.targetBox.swimlane.y+i.swimlanePadding,m=fe(s,c),u=o.sourceBox.x+o.sourceBox.dimension.width*2/3,f=o.targetBox.x+o.targetBox.dimension.width/3,h,g;if(a.debug(`rendering relation up=${m} for `,{sourceBox:o.sourceBox,targetBox:o.targetBox}),m)h=s,g=c+o.targetBox.dimension.height;else h=s+o.sourceBox.dimension.height,g=c;let b=r.emRelationStroke??o.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",o.visual.fill).attr("stroke",b).attr("stroke-width","1").attr("marker-end",`url(#${n})`).attr("d",`M${u} ${h} L${f} ${g}`)}}t(ge,"renderD3Relation");function he(e,i,n,r){return(o)=>{let s=e.append("g").attr("class","em-swimlane"),c=r.emSwimlaneBackgroundOdd??"rgb(250,250,250)",m=r.emSwimlaneBackgroundStroke??"rgb(240,240,240)";s.append("rect").attr("x",0).attr("y",o.y).attr("rx","3").attr("width",i+n.swimlanePadding).attr("height",o.height).attr("fill",c).attr("stroke",m),s.append("text").attr("font-weight",n.swimlaneTextFontWeight).attr("x",30).attr("y",o.y+30).text(o.label)}}t(he,"renderD3Swimlane");var Ee=t(function(e,i,n,r){if(a.debug("in eventmodeling renderer",e+`
3
3
  `,"id:",i,n),!Be)throw Error("EventModeling config not found");let o=r.db,{themeVariables:s,eventmodeling:c}=l(),m=p(`[id="${i}"]`),u=o.getDiagramProps(),f=o.getState(),h=`em-arrowhead-${i}`,g=s.emArrowhead??"#000000";f.sortedSwimlanesArray.forEach(he(m,f.maxR,u,s)),f.boxes.forEach(xe(m,u)),f.relations.forEach(ge(m,u,h,s)),m.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",g),kr(void 0,m,c?.padding??30,c?.useMaxWidth)},"draw"),Ae={draw:Ee},$e=t((e)=>"","getStyles"),Re=$e,Ue={parser:ke,db:D,renderer:Ae,styles:Re};export{Ue as diagram};
@@ -1,4 +1,4 @@
1
- import{t,b,F,C,S,E,T,A,L,R,l,V,We,m}from"./chunk-veam6vk4.js";var dt=function(){var e=t(function(H,i,n,s){for(n=n||{},s=H.length;s--;n[H[s]]=i);return n},"o"),y=[1,4],r=[1,14],o=[1,12],h=[1,13],f=[6,7,8],g=[1,20],d=[1,18],x=[1,19],u=[6,7,11],_=[1,6,13,14],w=[1,23],I=[1,24],M=[1,6,7,11,13,14],Z={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:t(function(i,n,s,c,p,a,P){var v=a.length-1;switch(p){case 6:case 7:return c;case 15:c.addNode(a[v-1].length,a[v].trim());break;case 16:c.addNode(0,a[v].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:y},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:y},{6:r,7:[1,10],9:9,12:11,13:o,14:h},e(f,[2,3]),{1:[2,2]},e(f,[2,4]),e(f,[2,5]),{1:[2,6],6:r,12:15,13:o,14:h},{6:r,9:16,12:11,13:o,14:h},{6:g,7:d,10:17,11:x},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:g,7:d,10:22,11:x},{1:[2,7],6:r,12:15,13:o,14:h},e(_,[2,14],{7:w,11:I}),e(M,[2,8]),e(M,[2,9]),e(M,[2,10]),e(u,[2,15]),e(_,[2,13],{7:w,11:I}),e(M,[2,11]),e(M,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(i,n){if(n.recoverable)this.trace(i);else{var s=Error(i);throw s.hash=n,s}},"parseError"),parse:t(function(i){var n=this,s=[0],c=[],p=[null],a=[],P=this.table,v="",W=0,B=0,O=0,j=2,Y=1,rt=a.slice.call(arguments,1),k=Object.create(this.lexer),N={yy:{}};for(var q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,q))N.yy[q]=this.yy[q];if(k.setInput(i,N.yy),N.yy.lexer=k,N.yy.parser=this,typeof k.yylloc>"u")k.yylloc={};var Q=k.yylloc;a.push(Q);var lt=k.options&&k.options.ranges;if(typeof N.yy.parseError==="function")this.parseError=N.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function xt(U){s.length=s.length-2*U,p.length=p.length-U,a.length=a.length-U}t(xt,"popStack");function yt(){var U=c.pop()||k.lex()||Y;if(typeof U!=="number"){if(U instanceof Array)c=U,U=c.pop();U=n.symbols_[U]||U}return U}t(yt,"lex");var z,ot,J,G,Vt,ht,tt={},st,K,ft,nt;while(!0){if(J=s[s.length-1],this.defaultActions[J])G=this.defaultActions[J];else{if(z===null||typeof z>"u")z=yt();G=P[J]&&P[J][z]}if(typeof G>"u"||!G.length||!G[0]){var ct="";nt=[];for(st in P[J])if(this.terminals_[st]&&st>j)nt.push("'"+this.terminals_[st]+"'");if(k.showPosition)ct="Parse error on line "+(W+1)+`:
1
+ import{t,b,F,C,S,E,T,A,L,R,l,V,We,m}from"./chunk-tfqarvdx.js";var dt=function(){var e=t(function(H,i,n,s){for(n=n||{},s=H.length;s--;n[H[s]]=i);return n},"o"),y=[1,4],r=[1,14],o=[1,12],h=[1,13],f=[6,7,8],g=[1,20],d=[1,18],x=[1,19],u=[6,7,11],_=[1,6,13,14],w=[1,23],I=[1,24],M=[1,6,7,11,13,14],Z={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:t(function(i,n,s,c,p,a,P){var v=a.length-1;switch(p){case 6:case 7:return c;case 15:c.addNode(a[v-1].length,a[v].trim());break;case 16:c.addNode(0,a[v].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:y},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:y},{6:r,7:[1,10],9:9,12:11,13:o,14:h},e(f,[2,3]),{1:[2,2]},e(f,[2,4]),e(f,[2,5]),{1:[2,6],6:r,12:15,13:o,14:h},{6:r,9:16,12:11,13:o,14:h},{6:g,7:d,10:17,11:x},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:g,7:d,10:22,11:x},{1:[2,7],6:r,12:15,13:o,14:h},e(_,[2,14],{7:w,11:I}),e(M,[2,8]),e(M,[2,9]),e(M,[2,10]),e(u,[2,15]),e(_,[2,13],{7:w,11:I}),e(M,[2,11]),e(M,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(i,n){if(n.recoverable)this.trace(i);else{var s=Error(i);throw s.hash=n,s}},"parseError"),parse:t(function(i){var n=this,s=[0],c=[],p=[null],a=[],P=this.table,v="",W=0,B=0,O=0,j=2,Y=1,rt=a.slice.call(arguments,1),k=Object.create(this.lexer),N={yy:{}};for(var q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,q))N.yy[q]=this.yy[q];if(k.setInput(i,N.yy),N.yy.lexer=k,N.yy.parser=this,typeof k.yylloc>"u")k.yylloc={};var Q=k.yylloc;a.push(Q);var lt=k.options&&k.options.ranges;if(typeof N.yy.parseError==="function")this.parseError=N.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function xt(U){s.length=s.length-2*U,p.length=p.length-U,a.length=a.length-U}t(xt,"popStack");function yt(){var U=c.pop()||k.lex()||Y;if(typeof U!=="number"){if(U instanceof Array)c=U,U=c.pop();U=n.symbols_[U]||U}return U}t(yt,"lex");var z,ot,J,G,Vt,ht,tt={},st,K,ft,nt;while(!0){if(J=s[s.length-1],this.defaultActions[J])G=this.defaultActions[J];else{if(z===null||typeof z>"u")z=yt();G=P[J]&&P[J][z]}if(typeof G>"u"||!G.length||!G[0]){var ct="";nt=[];for(st in P[J])if(this.terminals_[st]&&st>j)nt.push("'"+this.terminals_[st]+"'");if(k.showPosition)ct="Parse error on line "+(W+1)+`:
2
2
  `+k.showPosition()+`
3
3
  Expecting `+nt.join(", ")+", got '"+(this.terminals_[z]||z)+"'";else ct="Parse error on line "+(W+1)+": Unexpected "+(z==Y?"end of input":"'"+(this.terminals_[z]||z)+"'");this.parseError(ct,{text:k.match,token:this.terminals_[z]||z,line:k.yylineno,loc:Q,expected:nt})}if(G[0]instanceof Array&&G.length>1)throw Error("Parse Error: multiple actions possible at state: "+J+", token: "+z);switch(G[0]){case 1:if(s.push(z),p.push(k.yytext),a.push(k.yylloc),s.push(G[1]),z=null,!ot){if(B=k.yyleng,v=k.yytext,W=k.yylineno,Q=k.yylloc,O>0)O--}else z=ot,ot=null;break;case 2:if(K=this.productions_[G[1]][1],tt.$=p[p.length-K],tt._$={first_line:a[a.length-(K||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(K||1)].first_column,last_column:a[a.length-1].last_column},lt)tt._$.range=[a[a.length-(K||1)].range[0],a[a.length-1].range[1]];if(ht=this.performAction.apply(tt,[v,B,W,N.yy,G[1],p,a].concat(rt)),typeof ht<"u")return ht;if(K)s=s.slice(0,-1*K*2),p=p.slice(0,-1*K),a=a.slice(0,-1*K);s.push(this.productions_[G[1]][0]),p.push(tt.$),a.push(tt._$),ft=P[s[s.length-2]][s[s.length-1]],s.push(ft);break;case 3:return!0}}return!0},"parse")},X=function(){var H={EOF:1,parseError:t(function(n,s){if(this.yy.parser)this.yy.parser.parseError(n,s);else throw Error(n)},"parseError"),setInput:t(function(i,n){if(this.yy=n||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);if(n)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),i},"input"),unput:t(function(i){var n=i.length,s=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var c=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1)this.yylineno-=s.length-1;var p=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===c.length?this.yylloc.first_column:0)+c[c.length-s.length].length-s[0].length:this.yylloc.first_column-n},this.options.ranges)this.yylloc.range=[p[0],p[0]+this.yyleng-n];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(i){this.unput(this.match.slice(i))},"less"),pastInput:t(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var i=this.match;if(i.length<20)i+=this._input.substr(0,20-i.length);return(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var i=this.pastInput(),n=Array(i.length+1).join("-");return i+this.upcomingInput()+`
@@ -0,0 +1,8 @@
1
+ import{t}from"./chunk-tfqarvdx.js";import"./chunk-vasppf6b.js";import{Pi,Oi}from"./chunk-rh3xb76f.js";import"./chunk-z5qn0xev.js";import"./chunk-1ex3wgms.js";import"./chunk-sc63488q.js";import"./chunk-1qh7f5kr.js";var o=t((r)=>`${Pi(r)}
2
+ .swimlane.cluster:not([data-color-id]) rect {
3
+ stroke: ${r.clusterBorder} !important;
4
+ }
5
+ [data-look="neo"].cluster rect {
6
+ filter: none;
7
+ }
8
+ `,"getStyles"),m=o,D=Oi({styles:m});export{D as diagram};
@@ -0,0 +1 @@
1
+ import{ao,Do,io,No,Mo,oo}from"./chunk-qdzy124b.js";import"./chunk-rxvm70w5.js";import"./chunk-88wd49xe.js";import"./chunk-tfqarvdx.js";export{Do as applyDagreLayoutResult,ao as getEdgesToRender,No as measureDagreLayout,io as prepareLayoutForDagre,oo as render,Mo as runDagreLayoutCore};
@@ -1,2 +1,2 @@
1
- import{Lt}from"./chunk-nvt9tkt4.js";var Z={};Lt(Z,{default:()=>St});var Q={};Lt(Q,{default:()=>Ht});var Kr=typeof global=="object"&&global&&global.Object===Object&&global,q=Kr;var Hr=typeof self=="object"&&self&&self.Object===Object&&self,qr=q||Hr||Function("return this")(),xe=qr;var $r=xe.Symbol,Oe=$r;var Tt=Object.prototype,{hasOwnProperty:kr,toString:Yr}=Tt,G=Oe?Oe.toStringTag:void 0;function Xr(t){var e=kr.call(t,G),r=t[G];try{t[G]=void 0;var o=!0}catch(f){}var a=Yr.call(t);if(o)if(e)t[G]=r;else delete t[G];return a}var wt=Xr;var Zr=Object.prototype,Jr=Zr.toString;function Qr(t){return Jr.call(t)}var Pt=Qr;var Vr="[object Null]",to="[object Undefined]",Et=Oe?Oe.toStringTag:void 0;function eo(t){if(t==null)return t===void 0?to:Vr;return Et&&Et in Object(t)?wt(t):Pt(t)}var Ke=eo;function ro(t){return t!=null&&typeof t=="object"}var Ee=ro;var oo="[object Symbol]";function ao(t){return typeof t=="symbol"||Ee(t)&&Ke(t)==oo}var ut=ao;function fo(t,e){var r=-1,o=t==null?0:t.length,a=Array(o);while(++r<o)a[r]=e(t[r],r,t);return a}var Wt=fo;var io=Array.isArray,H=io;var no=1/0,It=Oe?Oe.prototype:void 0,jt=It?It.toString:void 0;function Mt(t){if(typeof t=="string")return t;if(H(t))return Wt(t,Mt)+"";if(ut(t))return jt?jt.call(t):"";var e=t+"";return e=="0"&&1/t==-no?"-0":e}var Nt=Mt;function so(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var me=so;function po(t){return t}var it=po;var uo="[object AsyncFunction]",mo="[object Function]",lo="[object GeneratorFunction]",xo="[object Proxy]";function ho(t){if(!me(t))return!1;var e=Ke(t);return e==mo||e==lo||e==uo||e==xo}var Gt=ho;var co=xe["__core-js_shared__"],k=co;var Dt=function(){var t=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function go(t){return!!Dt&&Dt in t}var Rt=go;var yo=Function.prototype,_o=yo.toString;function bo(t){if(t!=null){try{return _o.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var _=bo;var vo=/[\\^$.*+?()[\]{}|]/g,Oo=/^\[object .+?Constructor\]$/,Ao=Function.prototype,To=Object.prototype,wo=Ao.toString,So=To.hasOwnProperty,Po=RegExp("^"+wo.call(So).replace(vo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Co(t){if(!me(t)||Rt(t))return!1;var e=Gt(t)?Po:Oo;return e.test(_(t))}var Ft=Co;function Eo(t,e){return t==null?void 0:t[e]}var Bt=Eo;function Io(t,e){var r=Bt(t,e);return Ft(r)?r:void 0}var x=Io;var Lo=x(xe,"WeakMap"),Y=Lo;function jo(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Ut=jo;function Mo(){}var zt=Mo;var No=800,Do=16,Ro=Date.now;function Fo(t){var e=0,r=0;return function(){var o=Ro(),a=Do-(o-r);if(r=o,a>0){if(++e>=No)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Kt=Fo;function Bo(t){return function(){return t}}var ot=Bo;var Go=function(){try{var t=x(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),cr=Go;var Uo=!cr?it:function(t,e){return cr(t,"toString",{configurable:!0,enumerable:!1,value:ot(e),writable:!0})},qt=Uo;var zo=Kt(qt),ha=zo;function Wo(t,e){var r=-1,o=t==null?0:t.length;while(++r<o)if(e(t[r],r,t)===!1)break;return t}var ga=Wo;function Ko(t,e,r,o){var a=t.length,f=r+(o?1:-1);while(o?f--:++f<a)if(e(t[f],f,t))return f;return-1}var ya=Ko;function Ho(t){return t!==t}var kt=Ho;function qo(t,e,r){var o=r-1,a=t.length;while(++o<a)if(t[o]===e)return o;return-1}var Jt=qo;function $o(t,e,r){return e===e?Jt(t,e,r):ya(t,kt,r)}var Qt=$o;function ko(t,e){var r=t==null?0:t.length;return!!r&&Qt(t,e,0)>-1}var Vt=ko;var Yo=9007199254740991,Xo=/^(?:0|[1-9]\d*)$/;function Zo(t,e){var r=typeof t;return e=e==null?Yo:e,!!e&&(r=="number"||r!="symbol"&&Xo.test(t))&&(t>-1&&t%1==0&&t<e)}var yn=Zo;function Jo(t,e){return t===e||t!==t&&e!==e}var Ct=Jo;var te=Math.max;function Qo(t,e,r){return e=te(e===void 0?t.length-1:e,0),function(){var o=arguments,a=-1,f=te(o.length-e,0),i=Array(f);while(++a<f)i[a]=o[e+a];a=-1;var n=Array(e+1);while(++a<e)n[a]=o[a];return n[e]=r(i),Ut(t,this,n)}}var va=Qo;function Vo(t,e){return ha(va(t,e,it),t+"")}var vn=Vo;var ta=9007199254740991;function ea(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ta}var j=ea;function ra(t){return t!=null&&j(t.length)&&!Gt(t)}var $e=ra;var oa=Object.prototype;function aa(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||oa;return t===r}var bn=aa;function fa(t,e){var r=-1,o=Array(t);while(++r<t)o[r]=e(r);return o}var ee=fa;var ia="[object Arguments]";function na(t){return Ee(t)&&Ke(t)==ia}var ct=na;var oe=Object.prototype,{hasOwnProperty:sa,propertyIsEnumerable:pa}=oe,ua=ct(function(){return arguments}())?ct:function(t){return Ee(t)&&sa.call(t,"callee")&&!pa.call(t,"callee")},$t=ua;function ma(){return!1}var ae=ma;var ne=typeof Z=="object"&&Z&&!Z.nodeType&&Z,fe=ne&&typeof X=="object"&&X&&!X.nodeType&&X,la=fe&&fe.exports===ne,ie=la?xe.Buffer:void 0,da=ie?ie.isBuffer:void 0,ca=da||ae,St=ca;var Oa="[object Arguments]",Aa="[object Array]",Pa="[object Boolean]",Ia="[object Date]",La="[object Error]",ja="[object Function]",Ma="[object Map]",Na="[object Number]",Da="[object Object]",Ra="[object RegExp]",Fa="[object Set]",Ba="[object String]",Ga="[object WeakMap]",Ua="[object ArrayBuffer]",za="[object DataView]",Wa="[object Float32Array]",Ka="[object Float64Array]",Ha="[object Int8Array]",qa="[object Int16Array]",$a="[object Int32Array]",Ya="[object Uint8Array]",Xa="[object Uint8ClampedArray]",Za="[object Uint16Array]",Ja="[object Uint32Array]",u={};u[Wa]=u[Ka]=u[Ha]=u[qa]=u[$a]=u[Ya]=u[Xa]=u[Za]=u[Ja]=!0;u[Oa]=u[Aa]=u[Ua]=u[Pa]=u[za]=u[Ia]=u[La]=u[ja]=u[Ma]=u[Na]=u[Da]=u[Ra]=u[Fa]=u[Ba]=u[Ga]=!1;function Qa(t){return Ee(t)&&j(t.length)&&!!u[Ke(t)]}var se=Qa;function Va(t){return function(e){return t(e)}}var xn=Va;var pe=typeof Q=="object"&&Q&&!Q.nodeType&&Q,U=pe&&typeof J=="object"&&J&&!J.nodeType&&J,tf=U&&U.exports===pe,gt=tf&&q.process,ef=function(){try{var t=U&&U.require&&U.require("util").types;if(t)return t;return gt&&gt.binding&&gt.binding("util")}catch(e){}}(),Ht=ef;var ue=Ht&&Ht.isTypedArray,rf=ue?xn(ue):se,_n=rf;var of=Object.prototype,af=of.hasOwnProperty;function ff(t,e){var r=H(t),o=!r&&$t(t),a=!r&&!o&&St(t),f=!r&&!o&&!a&&_n(t),i=r||o||a||f,n=i?ee(t.length,String):[],s=n.length;for(var p in t)if((e||af.call(t,p))&&!(i&&(p=="length"||a&&(p=="offset"||p=="parent")||f&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||yn(p,s))))n.push(p);return n}var ba=ff;function nf(t,e){return function(r){return t(e(r))}}var xa=nf;var sf=xa(Object.keys,Object),le=sf;var pf=Object.prototype,uf=pf.hasOwnProperty;function mf(t){if(!bn(t))return le(t);var e=[];for(var r in Object(t))if(uf.call(t,r)&&r!="constructor")e.push(r);return e}var ur=mf;function lf(t){return $e(t)?ba(t):ur(t)}var _e=lf;var df=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xf=/^\w*$/;function hf(t,e){if(H(t))return!1;var r=typeof t;if(r=="number"||r=="symbol"||r=="boolean"||t==null||ut(t))return!0;return xf.test(t)||!df.test(t)||e!=null&&t in Object(e)}var M=hf;var cf=x(Object,"create"),b=cf;function gf(){this.__data__=b?b(null):{},this.size=0}var de=gf;function yf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var he=yf;var _f="__lodash_hash_undefined__",bf=Object.prototype,vf=bf.hasOwnProperty;function Of(t){var e=this.__data__;if(b){var r=e[t];return r===_f?void 0:r}return vf.call(e,t)?e[t]:void 0}var ce=Of;var Af=Object.prototype,Tf=Af.hasOwnProperty;function wf(t){var e=this.__data__;return b?e[t]!==void 0:Tf.call(e,t)}var ge=wf;var Sf="__lodash_hash_undefined__";function Pf(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=b&&e===void 0?Sf:e,this}var ye=Pf;function N(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}N.prototype.clear=de;N.prototype.delete=he;N.prototype.get=ce;N.prototype.has=ge;N.prototype.set=ye;var yt=N;function Cf(){this.__data__=[],this.size=0}var be=Cf;function Ef(t,e){var r=t.length;while(r--)if(Ct(t[r][0],e))return r;return-1}var O=Ef;var If=Array.prototype,Lf=If.splice;function jf(t){var e=this.__data__,r=O(e,t);if(r<0)return!1;var o=e.length-1;if(r==o)e.pop();else Lf.call(e,r,1);return--this.size,!0}var ve=jf;function Mf(t){var e=this.__data__,r=O(e,t);return r<0?void 0:e[r][1]}var Ae=Mf;function Nf(t){return O(this.__data__,t)>-1}var Te=Nf;function Df(t,e){var r=this.__data__,o=O(r,t);if(o<0)++this.size,r.push([t,e]);else r[o][1]=e;return this}var Se=Df;function D(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}D.prototype.clear=be;D.prototype.delete=ve;D.prototype.get=Ae;D.prototype.has=Te;D.prototype.set=Se;var A=D;var Rf=x(xe,"Map"),T=Rf;function Ff(){this.size=0,this.__data__={hash:new yt,map:new(T||A),string:new yt}}var Pe=Ff;function Bf(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Ce=Bf;function Gf(t,e){var r=t.__data__;return Ce(e)?r[typeof e=="string"?"string":"hash"]:r.map}var w=Gf;function Uf(t){var e=w(this,t).delete(t);return this.size-=e?1:0,e}var Ie=Uf;function zf(t){return w(this,t).get(t)}var Le=zf;function Wf(t){return w(this,t).has(t)}var je=Wf;function Kf(t,e){var r=w(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var Me=Kf;function R(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}R.prototype.clear=Pe;R.prototype.delete=Ie;R.prototype.get=Le;R.prototype.has=je;R.prototype.set=Me;var E=R;var Hf="Expected a function";function _t(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw TypeError(Hf);var r=function(){var o=arguments,a=e?e.apply(this,o):o[0],f=r.cache;if(f.has(a))return f.get(a);var i=t.apply(this,o);return r.cache=f.set(a,i)||f,i};return r.cache=new(_t.Cache||E),r}_t.Cache=E;var Ne=_t;var qf=500;function $f(t){var e=Ne(t,function(o){if(r.size===qf)r.clear();return o}),r=e.cache;return e}var De=$f;var kf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yf=/\\(\\)?/g,Xf=De(function(t){var e=[];if(t.charCodeAt(0)===46)e.push("");return t.replace(kf,function(r,o,a,f){e.push(a?f.replace(Yf,"$1"):o||r)}),e}),Re=Xf;function Zf(t){return t==null?"":Nt(t)}var _a=Zf;function Jf(t,e){if(H(t))return t;return M(t,e)?[t]:Re(_a(t))}var wn=Jf;var Qf=1/0;function Vf(t){if(typeof t=="string"||ut(t))return t;var e=t+"";return e=="0"&&1/t==-Qf?"-0":e}var Yt=Vf;function ti(t,e){e=wn(e,t);var r=0,o=e.length;while(t!=null&&r<o)t=t[Yt(e[r++])];return r&&r==o?t:void 0}var kn=ti;function ei(t,e,r){var o=t==null?void 0:kn(t,e);return o===void 0?r:o}var Fe=ei;function ri(t,e){var r=-1,o=e.length,a=t.length;while(++r<o)t[a+r]=e[r];return t}var dr=ri;var Be=Oe?Oe.isConcatSpreadable:void 0;function oi(t){return H(t)||$t(t)||!!(Be&&t&&t[Be])}var Ue=oi;function ze(t,e,r,o,a){var f=-1,i=t.length;r||(r=Ue),a||(a=[]);while(++f<i){var n=t[f];if(e>0&&r(n))if(e>1)ze(n,e-1,r,o,a);else dr(a,n);else if(!o)a[a.length]=n}return a}var pr=ze;function ai(t,e,r,o){var a=-1,f=t==null?0:t.length;if(o&&f)r=t[++a];while(++a<f)r=e(r,t[a],a,t);return r}var We=ai;function fi(){this.__data__=new A,this.size=0}var He=fi;function ii(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var qe=ii;function ni(t){return this.__data__.get(t)}var ke=ni;function si(t){return this.__data__.has(t)}var Ye=si;var pi=200;function ui(t,e){var r=this.__data__;if(r instanceof A){var o=r.__data__;if(!T||o.length<pi-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new E(o)}return r.set(t,e),this.size=r.size,this}var Xe=ui;function F(t){var e=this.__data__=new A(t);this.size=e.size}F.prototype.clear=He;F.prototype.delete=qe;F.prototype.get=ke;F.prototype.has=Ye;F.prototype.set=Xe;var Zt=F;function mi(t,e){var r=-1,o=t==null?0:t.length,a=0,f=[];while(++r<o){var i=t[r];if(e(i,r,t))f[a++]=i}return f}var V=mi;function li(){return[]}var wa=li;var di=Object.prototype,xi=di.propertyIsEnumerable,Ze=Object.getOwnPropertySymbols,hi=!Ze?wa:function(t){if(t==null)return[];return t=Object(t),V(Ze(t),function(e){return xi.call(t,e)})},mr=hi;function ci(t,e,r){var o=e(t);return H(t)?o:dr(o,r(t))}var ka=ci;function gi(t){return ka(t,_e,mr)}var jr=gi;var yi=x(xe,"DataView"),tt=yi;var _i=x(xe,"Promise"),et=_i;var bi=x(xe,"Set"),S=bi;var Je="[object Map]",vi="[object Object]",Ve="[object Promise]",tr="[object Set]",er="[object WeakMap]",rr="[object DataView]",Oi=_(tt),Ai=_(T),Ti=_(et),wi=_(S),Si=_(Y),I=Ke;if(tt&&I(new tt(new ArrayBuffer(1)))!=rr||T&&I(new T)!=Je||et&&I(et.resolve())!=Ve||S&&I(new S)!=tr||Y&&I(new Y)!=er)I=function(t){var e=Ke(t),r=e==vi?t.constructor:void 0,o=r?_(r):"";if(o)switch(o){case Oi:return rr;case Ai:return Je;case Ti:return Ve;case wi:return tr;case Si:return er}return e};var dt=I;var Pi=xe.Uint8Array,fr=Pi;var Ci="__lodash_hash_undefined__";function Ei(t){return this.__data__.set(t,Ci),this}var or=Ei;function Ii(t){return this.__data__.has(t)}var ar=Ii;function rt(t){var e=-1,r=t==null?0:t.length;this.__data__=new E;while(++e<r)this.add(t[e])}rt.prototype.add=rt.prototype.push=or;rt.prototype.has=ar;var at=rt;function Li(t,e){var r=-1,o=t==null?0:t.length;while(++r<o)if(e(t[r],r,t))return!0;return!1}var ir=Li;function ji(t,e){return t.has(e)}var ft=ji;var Mi=1,Ni=2;function Di(t,e,r,o,a,f){var i=r&Mi,n=t.length,s=e.length;if(n!=s&&!(i&&s>n))return!1;var p=f.get(t),d=f.get(e);if(p&&d)return p==e&&d==t;var l=-1,m=!0,y=r&Ni?new at:void 0;f.set(t,e),f.set(e,t);while(++l<n){var c=t[l],g=e[l];if(o)var v=i?o(g,c,l,e,t,f):o(c,g,l,t,e,f);if(v!==void 0){if(v)continue;m=!1;break}if(y){if(!ir(e,function(P,C){if(!ft(y,C)&&(c===P||a(c,P,r,o,f)))return y.push(C)})){m=!1;break}}else if(!(c===g||a(c,g,r,o,f))){m=!1;break}}return f.delete(t),f.delete(e),m}var nt=Di;function Ri(t){var e=-1,r=Array(t.size);return t.forEach(function(o,a){r[++e]=[a,o]}),r}var nr=Ri;function Fi(t){var e=-1,r=Array(t.size);return t.forEach(function(o){r[++e]=o}),r}var B=Fi;var Bi=1,Gi=2,Ui="[object Boolean]",zi="[object Date]",Wi="[object Error]",Ki="[object Map]",Hi="[object Number]",qi="[object RegExp]",$i="[object Set]",ki="[object String]",Yi="[object Symbol]",Xi="[object ArrayBuffer]",Zi="[object DataView]",sr=Oe?Oe.prototype:void 0,bt=sr?sr.valueOf:void 0;function Ji(t,e,r,o,a,f,i){switch(r){case Zi:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Xi:if(t.byteLength!=e.byteLength||!f(new fr(t),new fr(e)))return!1;return!0;case Ui:case zi:case Hi:return Ct(+t,+e);case Wi:return t.name==e.name&&t.message==e.message;case qi:case ki:return t==e+"";case Ki:var n=nr;case $i:var s=o&Bi;if(n||(n=B),t.size!=e.size&&!s)return!1;var p=i.get(t);if(p)return p==e;o|=Gi,i.set(t,e);var d=nt(n(t),n(e),o,a,f,i);return i.delete(t),d;case Yi:if(bt)return bt.call(t)==bt.call(e)}return!1}var lr=Ji;var Qi=1,Vi=Object.prototype,tn=Vi.hasOwnProperty;function en(t,e,r,o,a,f){var i=r&Qi,n=jr(t),s=n.length,p=jr(e),d=p.length;if(s!=d&&!i)return!1;var l=s;while(l--){var m=n[l];if(!(i?m in e:tn.call(e,m)))return!1}var y=f.get(t),c=f.get(e);if(y&&c)return y==e&&c==t;var g=!0;f.set(t,e),f.set(e,t);var v=i;while(++l<s){m=n[l];var P=t[m],C=e[m];if(o)var At=i?o(C,P,m,e,t,f):o(P,C,m,t,e,f);if(!(At===void 0?P===C||a(P,C,r,o,f):At)){g=!1;break}v||(v=m=="constructor")}if(g&&!v){var W=t.constructor,K=e.constructor;if(W!=K&&(("constructor"in t)&&("constructor"in e))&&!(typeof W=="function"&&W instanceof W&&typeof K=="function"&&K instanceof K))g=!1}return f.delete(t),f.delete(e),g}var xr=en;var rn=1,_r="[object Arguments]",br="[object Array]",st="[object Object]",on=Object.prototype,vr=on.hasOwnProperty;function an(t,e,r,o,a,f){var i=H(t),n=H(e),s=i?br:dt(t),p=n?br:dt(e);s=s==_r?st:s,p=p==_r?st:p;var d=s==st,l=p==st,m=s==p;if(m&&St(t)){if(!St(e))return!1;i=!0,d=!1}if(m&&!d)return f||(f=new Zt),i||_n(t)?nt(t,e,r,o,a,f):lr(t,e,s,r,o,a,f);if(!(r&rn)){var y=d&&vr.call(t,"__wrapped__"),c=l&&vr.call(e,"__wrapped__");if(y||c){var g=y?t.value():t,v=c?e.value():e;return f||(f=new Zt),a(g,v,r,o,f)}}if(!m)return!1;return f||(f=new Zt),xr(t,e,r,o,a,f)}var Or=an;function Ar(t,e,r,o,a){if(t===e)return!0;if(t==null||e==null||!Ee(t)&&!Ee(e))return t!==t&&e!==e;return Or(t,e,r,o,Ar,a)}var mt=Ar;var fn=1,nn=2;function sn(t,e,r,o){var a=r.length,f=a,i=!o;if(t==null)return!f;t=Object(t);while(a--){var n=r[a];if(i&&n[2]?n[1]!==t[n[0]]:!(n[0]in t))return!1}while(++a<f){n=r[a];var s=n[0],p=t[s],d=n[1];if(i&&n[2]){if(p===void 0&&!(s in t))return!1}else{var l=new Zt;if(o)var m=o(p,d,s,t,e,l);if(!(m===void 0?mt(d,p,fn|nn,o,l):m))return!1}}return!0}var Tr=sn;function pn(t){return t===t&&!me(t)}var lt=pn;function un(t){var e=_e(t),r=e.length;while(r--){var o=e[r],a=t[o];e[r]=[o,a,lt(a)]}return e}var wr=un;function mn(t,e){return function(r){if(r==null)return!1;return r[t]===e&&(e!==void 0||(t in Object(r)))}}var xt=mn;function ln(t){var e=wr(t);if(e.length==1&&e[0][2])return xt(e[0][0],e[0][1]);return function(r){return r===t||Tr(r,t,e)}}var Sr=ln;function dn(t,e){return t!=null&&e in Object(t)}var Pr=dn;function hn(t,e,r){e=wn(e,t);var o=-1,a=e.length,f=!1;while(++o<a){var i=Yt(e[o]);if(!(f=t!=null&&r(t,i)))break;t=t[i]}if(f||++o!=a)return f;return a=t==null?0:t.length,!!a&&j(a)&&yn(i,a)&&(H(t)||$t(t))}var Ca=hn;function cn(t,e){return t!=null&&Ca(t,e,Pr)}var Sa=cn;var gn=1,On=2;function An(t,e){if(M(t)&&lt(e))return xt(Yt(t),e);return function(r){var o=Fe(r,t);return o===void 0&&o===e?Sa(r,t):mt(e,o,gn|On)}}var Cr=An;function Tn(t){return function(e){return e==null?void 0:e[t]}}var Ta=Tn;function Sn(t){return function(e){return kn(e,t)}}var Er=Sn;function Pn(t){return M(t)?Ta(Yt(t)):Er(t)}var Ir=Pn;function En(t){if(typeof t=="function")return t;if(t==null)return it;if(typeof t=="object")return H(t)?Cr(t[0],t[1]):Sr(t);return Ir(t)}var Ge=En;function In(t){return function(e,r,o){var a=-1,f=Object(e),i=o(e),n=i.length;while(n--){var s=i[t?n:++a];if(r(f[s],s,f)===!1)break}return e}}var Lr=In;var Ln=Lr(),hr=Ln;function jn(t,e){return t&&hr(t,e,_e)}var gr=jn;function Mn(t,e){return function(r,o){if(r==null)return r;if(!$e(r))return t(r,o);var a=r.length,f=e?a:-1,i=Object(r);while(e?f--:++f<a)if(o(i[f],f,i)===!1)break;return r}}var Mr=Mn;var Nn=Mr(gr),Cn=Nn;function Dn(t){return Ee(t)&&$e(t)}var Ea=Dn;function Rn(t,e,r){var o=-1,a=t==null?0:t.length;while(++o<a)if(r(e,t[o]))return!0;return!1}var Nr=Rn;function Fn(t){return typeof t=="function"?t:it}var yr=Fn;function Bn(t,e){var r=H(t)?ga:Cn;return r(t,yr(e))}var h=Bn;function Gn(t,e){var r=[];return Cn(t,function(o,a,f){if(e(o,a,f))r.push(o)}),r}var Dr=Gn;function Un(t,e){var r=H(t)?V:Dr;return r(t,Ge(e,3))}var Qe=Un;function zn(t,e){return Wt(e,function(r){return t[r]})}var Rr=zn;function Wn(t){return t==null?[]:Rr(t,_e(t))}var pt=Wn;var Kn="[object Map]",Hn="[object Set]",qn=Object.prototype,$n=qn.hasOwnProperty;function Yn(t){if(t==null)return!0;if($e(t)&&(H(t)||typeof t=="string"||typeof t.splice=="function"||St(t)||_n(t)||$t(t)))return!t.length;var e=dt(t);if(e==Kn||e==Hn)return!t.size;if(bn(t))return!ur(t).length;for(var r in t)if($n.call(t,r))return!1;return!0}var ht=Yn;function Xn(t){return t===void 0}var we=Xn;function Zn(t,e,r,o,a){return a(t,function(f,i,n){r=o?(o=!1,f):e(r,f,i,n)}),r}var Fr=Zn;function Jn(t,e,r){var o=H(t)?We:Fr,a=arguments.length<3;return o(t,Ge(e,4),r,a,Cn)}var Xt=Jn;var Qn=1/0,Vn=!(S&&1/B(new S([,-0]))[1]==Qn)?zt:function(t){return new S(t)},Br=Vn;var ts=200;function es(t,e,r){var o=-1,a=Vt,f=t.length,i=!0,n=[],s=n;if(r)i=!1,a=Nr;else if(f>=ts){var p=e?null:Br(t);if(p)return B(p);i=!1,a=ft,s=new at}else s=e?[]:n;t:while(++o<f){var d=t[o],l=e?e(d):d;if(d=r||d!==0?d:0,i&&l===l){var m=s.length;while(m--)if(s[m]===l)continue t;if(e)s.push(l);n.push(d)}else if(!a(s,l,r)){if(s!==n)s.push(l);n.push(d)}}return n}var Gr=es;var rs=vn(function(t){return Gr(pr(t,1,Ea,!0))}),vt=rs;var as="\x00",L="\x00",Ur="\x01";class re{constructor(t={}){if(this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=ot(void 0),this._defaultEdgeLabelFn=ot(void 0),this._nodes={},this._isCompound)this._parent={},this._children={},this._children[L]={};this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){if(!Gt(t))t=ot(t);return this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return _e(this._nodes)}sources(){var t=this;return Qe(this.nodes(),function(e){return ht(t._in[e])})}sinks(){var t=this;return Qe(this.nodes(),function(e){return ht(t._out[e])})}setNodes(t,e){var r=arguments,o=this;return h(t,function(a){if(r.length>1)o.setNode(a,e);else o.setNode(a)}),this}setNode(t,e){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){if(arguments.length>1)this._nodes[t]=e;return this}if(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound)this._parent[t]=L,this._children[t]={},this._children[L][t]=!0;return this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var e=(r)=>this.removeEdge(this._edgeObjs[r]);if(delete this._nodes[t],this._isCompound)this._removeFromParentsChildList(t),delete this._parent[t],h(this.children(t),(r)=>{this.setParent(r)}),delete this._children[t];h(_e(this._in[t]),e),delete this._in[t],delete this._preds[t],h(_e(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(we(e))e=L;else{e+="";for(var r=e;!we(r);r=this.parent(r))if(r===t)throw Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==L)return e}}children(t){if(we(t))t=L;if(this._isCompound){var e=this._children[t];if(e)return _e(e)}else if(t===L)return this.nodes();else if(this.hasNode(t))return[]}predecessors(t){var e=this._preds[t];if(e)return _e(e)}successors(t){var e=this._sucs[t];if(e)return _e(e)}neighbors(t){var e=this.predecessors(t);if(e)return vt(e,this.successors(t))}isLeaf(t){var e;if(this.isDirected())e=this.successors(t);else e=this.neighbors(t);return e.length===0}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;h(this._nodes,function(f,i){if(t(i))e.setNode(i,f)}),h(this._edgeObjs,function(f){if(e.hasNode(f.v)&&e.hasNode(f.w))e.setEdge(f,r.edge(f))});var o={};function a(f){var i=r.parent(f);if(i===void 0||e.hasNode(i))return o[f]=i,i;else if(i in o)return o[i];else return a(i)}if(this._isCompound)h(e.nodes(),function(f){e.setParent(f,a(f))});return e}setDefaultEdgeLabel(t){if(!Gt(t))t=ot(t);return this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return pt(this._edgeObjs)}setPath(t,e){var r=this,o=arguments;return Xt(t,function(a,f){if(o.length>1)r.setEdge(a,f,e);else r.setEdge(a,f);return f}),this}setEdge(){var t,e,r,o,a=!1,f=arguments[0];if(typeof f==="object"&&f!==null&&"v"in f){if(t=f.v,e=f.w,r=f.name,arguments.length===2)o=arguments[1],a=!0}else if(t=f,e=arguments[1],r=arguments[3],arguments.length>2)o=arguments[2],a=!0;if(t=""+t,e=""+e,!we(r))r=""+r;var i=z(this._isDirected,t,e,r);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,i)){if(a)this._edgeLabels[i]=o;return this}if(!we(r)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[i]=a?o:this._defaultEdgeLabelFn(t,e,r);var n=fs(this._isDirected,t,e,r);return t=n.v,e=n.w,Object.freeze(n),this._edgeObjs[i]=n,zr(this._preds[e],t),zr(this._sucs[t],e),this._in[e][i]=n,this._out[t][i]=n,this._edgeCount++,this}edge(t,e,r){var o=arguments.length===1?Ot(this._isDirected,arguments[0]):z(this._isDirected,t,e,r);return this._edgeLabels[o]}hasEdge(t,e,r){var o=arguments.length===1?Ot(this._isDirected,arguments[0]):z(this._isDirected,t,e,r);return Object.prototype.hasOwnProperty.call(this._edgeLabels,o)}removeEdge(t,e,r){var o=arguments.length===1?Ot(this._isDirected,arguments[0]):z(this._isDirected,t,e,r),a=this._edgeObjs[o];if(a)t=a.v,e=a.w,delete this._edgeLabels[o],delete this._edgeObjs[o],Wr(this._preds[e],t),Wr(this._sucs[t],e),delete this._in[e][o],delete this._out[t][o],this._edgeCount--;return this}inEdges(t,e){var r=this._in[t];if(r){var o=pt(r);if(!e)return o;return Qe(o,function(a){return a.v===e})}}outEdges(t,e){var r=this._out[t];if(r){var o=pt(r);if(!e)return o;return Qe(o,function(a){return a.w===e})}}nodeEdges(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))}}re.prototype._nodeCount=0;re.prototype._edgeCount=0;function zr(t,e){if(t[e])t[e]++;else t[e]=1}function Wr(t,e){if(!--t[e])delete t[e]}function z(t,e,r,o){var a=""+e,f=""+r;if(!t&&a>f){var i=a;a=f,f=i}return a+Ur+f+Ur+(we(o)?as:o)}function fs(t,e,r,o){var a=""+e,f=""+r;if(!t&&a>f){var i=a;a=f,f=i}var n={v:a,w:f};if(o)n.name=o;return n}function Ot(t,e){return z(t,e.v,e.w,e.name)}
2
- export{xe,Oe,Ke,Ee,ut,Wt,H,me,it,Gt,ot,cr,ha,ga,ya,yn,Ct,va,vn,$e,bn,$t,St,xn,Ht,_n,ba,xa,ur,_e,_a,wn,Yt,kn,dr,pr,Zt,wa,mr,ka,jr,dt,fr,Ca,Sa,Ta,Ge,hr,gr,Cn,Ea,yr,h,Qe,pt,we,Xt,re};
1
+ import{Lt}from"./chunk-ngt1j8py.js";var Z={};Lt(Z,{default:()=>St});var Q={};Lt(Q,{default:()=>Ht});var Kr=typeof global=="object"&&global&&global.Object===Object&&global,q=Kr;var Hr=typeof self=="object"&&self&&self.Object===Object&&self,qr=q||Hr||Function("return this")(),xe=qr;var $r=xe.Symbol,Oe=$r;var Tt=Object.prototype,{hasOwnProperty:kr,toString:Yr}=Tt,G=Oe?Oe.toStringTag:void 0;function Xr(t){var e=kr.call(t,G),r=t[G];try{t[G]=void 0;var o=!0}catch(f){}var a=Yr.call(t);if(o)if(e)t[G]=r;else delete t[G];return a}var wt=Xr;var Zr=Object.prototype,Jr=Zr.toString;function Qr(t){return Jr.call(t)}var Pt=Qr;var Vr="[object Null]",to="[object Undefined]",Et=Oe?Oe.toStringTag:void 0;function eo(t){if(t==null)return t===void 0?to:Vr;return Et&&Et in Object(t)?wt(t):Pt(t)}var Ke=eo;function ro(t){return t!=null&&typeof t=="object"}var Ee=ro;var oo="[object Symbol]";function ao(t){return typeof t=="symbol"||Ee(t)&&Ke(t)==oo}var dt=ao;function fo(t,e){var r=-1,o=t==null?0:t.length,a=Array(o);while(++r<o)a[r]=e(t[r],r,t);return a}var Wt=fo;var io=Array.isArray,H=io;var no=1/0,It=Oe?Oe.prototype:void 0,jt=It?It.toString:void 0;function Mt(t){if(typeof t=="string")return t;if(H(t))return Wt(t,Mt)+"";if(dt(t))return jt?jt.call(t):"";var e=t+"";return e=="0"&&1/t==-no?"-0":e}var Nt=Mt;function so(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var me=so;function po(t){return t}var ot=po;var uo="[object AsyncFunction]",mo="[object Function]",lo="[object GeneratorFunction]",xo="[object Proxy]";function ho(t){if(!me(t))return!1;var e=Ke(t);return e==mo||e==lo||e==uo||e==xo}var Gt=ho;var co=xe["__core-js_shared__"],k=co;var Dt=function(){var t=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function go(t){return!!Dt&&Dt in t}var Rt=go;var yo=Function.prototype,_o=yo.toString;function bo(t){if(t!=null){try{return _o.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var _=bo;var vo=/[\\^$.*+?()[\]{}|]/g,Oo=/^\[object .+?Constructor\]$/,Ao=Function.prototype,To=Object.prototype,wo=Ao.toString,So=To.hasOwnProperty,Po=RegExp("^"+wo.call(So).replace(vo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Co(t){if(!me(t)||Rt(t))return!1;var e=Gt(t)?Po:Oo;return e.test(_(t))}var Ft=Co;function Eo(t,e){return t==null?void 0:t[e]}var Bt=Eo;function Io(t,e){var r=Bt(t,e);return Ft(r)?r:void 0}var x=Io;var Lo=x(xe,"WeakMap"),Y=Lo;function jo(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Ut=jo;function Mo(){}var zt=Mo;var No=800,Do=16,Ro=Date.now;function Fo(t){var e=0,r=0;return function(){var o=Ro(),a=Do-(o-r);if(r=o,a>0){if(++e>=No)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Kt=Fo;function Bo(t){return function(){return t}}var st=Bo;var Go=function(){try{var t=x(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),cr=Go;var Uo=!cr?ot:function(t,e){return cr(t,"toString",{configurable:!0,enumerable:!1,value:st(e),writable:!0})},qt=Uo;var zo=Kt(qt),ha=zo;function Wo(t,e){var r=-1,o=t==null?0:t.length;while(++r<o)if(e(t[r],r,t)===!1)break;return t}var ga=Wo;function Ko(t,e,r,o){var a=t.length,f=r+(o?1:-1);while(o?f--:++f<a)if(e(t[f],f,t))return f;return-1}var ya=Ko;function Ho(t){return t!==t}var kt=Ho;function qo(t,e,r){var o=r-1,a=t.length;while(++o<a)if(t[o]===e)return o;return-1}var Jt=qo;function $o(t,e,r){return e===e?Jt(t,e,r):ya(t,kt,r)}var Qt=$o;function ko(t,e){var r=t==null?0:t.length;return!!r&&Qt(t,e,0)>-1}var Vt=ko;var Yo=9007199254740991,Xo=/^(?:0|[1-9]\d*)$/;function Zo(t,e){var r=typeof t;return e=e==null?Yo:e,!!e&&(r=="number"||r!="symbol"&&Xo.test(t))&&(t>-1&&t%1==0&&t<e)}var yn=Zo;function Jo(t,e){return t===e||t!==t&&e!==e}var Ct=Jo;var te=Math.max;function Qo(t,e,r){return e=te(e===void 0?t.length-1:e,0),function(){var o=arguments,a=-1,f=te(o.length-e,0),i=Array(f);while(++a<f)i[a]=o[e+a];a=-1;var n=Array(e+1);while(++a<e)n[a]=o[a];return n[e]=r(i),Ut(t,this,n)}}var va=Qo;function Vo(t,e){return ha(va(t,e,ot),t+"")}var vn=Vo;var ta=9007199254740991;function ea(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ta}var j=ea;function ra(t){return t!=null&&j(t.length)&&!Gt(t)}var $e=ra;var oa=Object.prototype;function aa(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||oa;return t===r}var bn=aa;function fa(t,e){var r=-1,o=Array(t);while(++r<t)o[r]=e(r);return o}var ee=fa;var ia="[object Arguments]";function na(t){return Ee(t)&&Ke(t)==ia}var ct=na;var oe=Object.prototype,{hasOwnProperty:sa,propertyIsEnumerable:pa}=oe,ua=ct(function(){return arguments}())?ct:function(t){return Ee(t)&&sa.call(t,"callee")&&!pa.call(t,"callee")},$t=ua;function ma(){return!1}var ae=ma;var ne=typeof Z=="object"&&Z&&!Z.nodeType&&Z,fe=ne&&typeof X=="object"&&X&&!X.nodeType&&X,la=fe&&fe.exports===ne,ie=la?xe.Buffer:void 0,da=ie?ie.isBuffer:void 0,ca=da||ae,St=ca;var Oa="[object Arguments]",Aa="[object Array]",Pa="[object Boolean]",Ia="[object Date]",La="[object Error]",ja="[object Function]",Ma="[object Map]",Na="[object Number]",Da="[object Object]",Ra="[object RegExp]",Fa="[object Set]",Ba="[object String]",Ga="[object WeakMap]",Ua="[object ArrayBuffer]",za="[object DataView]",Wa="[object Float32Array]",Ka="[object Float64Array]",Ha="[object Int8Array]",qa="[object Int16Array]",$a="[object Int32Array]",Ya="[object Uint8Array]",Xa="[object Uint8ClampedArray]",Za="[object Uint16Array]",Ja="[object Uint32Array]",u={};u[Wa]=u[Ka]=u[Ha]=u[qa]=u[$a]=u[Ya]=u[Xa]=u[Za]=u[Ja]=!0;u[Oa]=u[Aa]=u[Ua]=u[Pa]=u[za]=u[Ia]=u[La]=u[ja]=u[Ma]=u[Na]=u[Da]=u[Ra]=u[Fa]=u[Ba]=u[Ga]=!1;function Qa(t){return Ee(t)&&j(t.length)&&!!u[Ke(t)]}var se=Qa;function Va(t){return function(e){return t(e)}}var xn=Va;var pe=typeof Q=="object"&&Q&&!Q.nodeType&&Q,U=pe&&typeof J=="object"&&J&&!J.nodeType&&J,tf=U&&U.exports===pe,gt=tf&&q.process,ef=function(){try{var t=U&&U.require&&U.require("util").types;if(t)return t;return gt&&gt.binding&&gt.binding("util")}catch(e){}}(),Ht=ef;var ue=Ht&&Ht.isTypedArray,rf=ue?xn(ue):se,_n=rf;var of=Object.prototype,af=of.hasOwnProperty;function ff(t,e){var r=H(t),o=!r&&$t(t),a=!r&&!o&&St(t),f=!r&&!o&&!a&&_n(t),i=r||o||a||f,n=i?ee(t.length,String):[],s=n.length;for(var p in t)if((e||af.call(t,p))&&!(i&&(p=="length"||a&&(p=="offset"||p=="parent")||f&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||yn(p,s))))n.push(p);return n}var ba=ff;function nf(t,e){return function(r){return t(e(r))}}var xa=nf;var sf=xa(Object.keys,Object),le=sf;var pf=Object.prototype,uf=pf.hasOwnProperty;function mf(t){if(!bn(t))return le(t);var e=[];for(var r in Object(t))if(uf.call(t,r)&&r!="constructor")e.push(r);return e}var ur=mf;function lf(t){return $e(t)?ba(t):ur(t)}var _e=lf;var df=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xf=/^\w*$/;function hf(t,e){if(H(t))return!1;var r=typeof t;if(r=="number"||r=="symbol"||r=="boolean"||t==null||dt(t))return!0;return xf.test(t)||!df.test(t)||e!=null&&t in Object(e)}var M=hf;var cf=x(Object,"create"),b=cf;function gf(){this.__data__=b?b(null):{},this.size=0}var de=gf;function yf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var he=yf;var _f="__lodash_hash_undefined__",bf=Object.prototype,vf=bf.hasOwnProperty;function Of(t){var e=this.__data__;if(b){var r=e[t];return r===_f?void 0:r}return vf.call(e,t)?e[t]:void 0}var ce=Of;var Af=Object.prototype,Tf=Af.hasOwnProperty;function wf(t){var e=this.__data__;return b?e[t]!==void 0:Tf.call(e,t)}var ge=wf;var Sf="__lodash_hash_undefined__";function Pf(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=b&&e===void 0?Sf:e,this}var ye=Pf;function N(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}N.prototype.clear=de;N.prototype.delete=he;N.prototype.get=ce;N.prototype.has=ge;N.prototype.set=ye;var yt=N;function Cf(){this.__data__=[],this.size=0}var be=Cf;function Ef(t,e){var r=t.length;while(r--)if(Ct(t[r][0],e))return r;return-1}var O=Ef;var If=Array.prototype,Lf=If.splice;function jf(t){var e=this.__data__,r=O(e,t);if(r<0)return!1;var o=e.length-1;if(r==o)e.pop();else Lf.call(e,r,1);return--this.size,!0}var ve=jf;function Mf(t){var e=this.__data__,r=O(e,t);return r<0?void 0:e[r][1]}var Ae=Mf;function Nf(t){return O(this.__data__,t)>-1}var Te=Nf;function Df(t,e){var r=this.__data__,o=O(r,t);if(o<0)++this.size,r.push([t,e]);else r[o][1]=e;return this}var Se=Df;function D(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}D.prototype.clear=be;D.prototype.delete=ve;D.prototype.get=Ae;D.prototype.has=Te;D.prototype.set=Se;var A=D;var Rf=x(xe,"Map"),T=Rf;function Ff(){this.size=0,this.__data__={hash:new yt,map:new(T||A),string:new yt}}var Pe=Ff;function Bf(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Ce=Bf;function Gf(t,e){var r=t.__data__;return Ce(e)?r[typeof e=="string"?"string":"hash"]:r.map}var w=Gf;function Uf(t){var e=w(this,t).delete(t);return this.size-=e?1:0,e}var Ie=Uf;function zf(t){return w(this,t).get(t)}var Le=zf;function Wf(t){return w(this,t).has(t)}var je=Wf;function Kf(t,e){var r=w(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var Me=Kf;function R(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}R.prototype.clear=Pe;R.prototype.delete=Ie;R.prototype.get=Le;R.prototype.has=je;R.prototype.set=Me;var E=R;var Hf="Expected a function";function _t(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw TypeError(Hf);var r=function(){var o=arguments,a=e?e.apply(this,o):o[0],f=r.cache;if(f.has(a))return f.get(a);var i=t.apply(this,o);return r.cache=f.set(a,i)||f,i};return r.cache=new(_t.Cache||E),r}_t.Cache=E;var Ne=_t;var qf=500;function $f(t){var e=Ne(t,function(o){if(r.size===qf)r.clear();return o}),r=e.cache;return e}var De=$f;var kf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yf=/\\(\\)?/g,Xf=De(function(t){var e=[];if(t.charCodeAt(0)===46)e.push("");return t.replace(kf,function(r,o,a,f){e.push(a?f.replace(Yf,"$1"):o||r)}),e}),Re=Xf;function Zf(t){return t==null?"":Nt(t)}var _a=Zf;function Jf(t,e){if(H(t))return t;return M(t,e)?[t]:Re(_a(t))}var wn=Jf;var Qf=1/0;function Vf(t){if(typeof t=="string"||dt(t))return t;var e=t+"";return e=="0"&&1/t==-Qf?"-0":e}var Yt=Vf;function ti(t,e){e=wn(e,t);var r=0,o=e.length;while(t!=null&&r<o)t=t[Yt(e[r++])];return r&&r==o?t:void 0}var kn=ti;function ei(t,e,r){var o=t==null?void 0:kn(t,e);return o===void 0?r:o}var Fe=ei;function ri(t,e){var r=-1,o=e.length,a=t.length;while(++r<o)t[a+r]=e[r];return t}var dr=ri;var Be=Oe?Oe.isConcatSpreadable:void 0;function oi(t){return H(t)||$t(t)||!!(Be&&t&&t[Be])}var Ue=oi;function ze(t,e,r,o,a){var f=-1,i=t.length;r||(r=Ue),a||(a=[]);while(++f<i){var n=t[f];if(e>0&&r(n))if(e>1)ze(n,e-1,r,o,a);else dr(a,n);else if(!o)a[a.length]=n}return a}var pr=ze;function ai(t,e,r,o){var a=-1,f=t==null?0:t.length;if(o&&f)r=t[++a];while(++a<f)r=e(r,t[a],a,t);return r}var We=ai;function fi(){this.__data__=new A,this.size=0}var He=fi;function ii(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var qe=ii;function ni(t){return this.__data__.get(t)}var ke=ni;function si(t){return this.__data__.has(t)}var Ye=si;var pi=200;function ui(t,e){var r=this.__data__;if(r instanceof A){var o=r.__data__;if(!T||o.length<pi-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new E(o)}return r.set(t,e),this.size=r.size,this}var Xe=ui;function F(t){var e=this.__data__=new A(t);this.size=e.size}F.prototype.clear=He;F.prototype.delete=qe;F.prototype.get=ke;F.prototype.has=Ye;F.prototype.set=Xe;var Zt=F;function mi(t,e){var r=-1,o=t==null?0:t.length,a=0,f=[];while(++r<o){var i=t[r];if(e(i,r,t))f[a++]=i}return f}var V=mi;function li(){return[]}var wa=li;var di=Object.prototype,xi=di.propertyIsEnumerable,Ze=Object.getOwnPropertySymbols,hi=!Ze?wa:function(t){if(t==null)return[];return t=Object(t),V(Ze(t),function(e){return xi.call(t,e)})},mr=hi;function ci(t,e,r){var o=e(t);return H(t)?o:dr(o,r(t))}var ka=ci;function gi(t){return ka(t,_e,mr)}var jr=gi;var yi=x(xe,"DataView"),tt=yi;var _i=x(xe,"Promise"),et=_i;var bi=x(xe,"Set"),S=bi;var Je="[object Map]",vi="[object Object]",Ve="[object Promise]",tr="[object Set]",er="[object WeakMap]",rr="[object DataView]",Oi=_(tt),Ai=_(T),Ti=_(et),wi=_(S),Si=_(Y),I=Ke;if(tt&&I(new tt(new ArrayBuffer(1)))!=rr||T&&I(new T)!=Je||et&&I(et.resolve())!=Ve||S&&I(new S)!=tr||Y&&I(new Y)!=er)I=function(t){var e=Ke(t),r=e==vi?t.constructor:void 0,o=r?_(r):"";if(o)switch(o){case Oi:return rr;case Ai:return Je;case Ti:return Ve;case wi:return tr;case Si:return er}return e};var pt=I;var Pi=xe.Uint8Array,fr=Pi;var Ci="__lodash_hash_undefined__";function Ei(t){return this.__data__.set(t,Ci),this}var or=Ei;function Ii(t){return this.__data__.has(t)}var ar=Ii;function rt(t){var e=-1,r=t==null?0:t.length;this.__data__=new E;while(++e<r)this.add(t[e])}rt.prototype.add=rt.prototype.push=or;rt.prototype.has=ar;var at=rt;function Li(t,e){var r=-1,o=t==null?0:t.length;while(++r<o)if(e(t[r],r,t))return!0;return!1}var ir=Li;function ji(t,e){return t.has(e)}var ft=ji;var Mi=1,Ni=2;function Di(t,e,r,o,a,f){var i=r&Mi,n=t.length,s=e.length;if(n!=s&&!(i&&s>n))return!1;var p=f.get(t),d=f.get(e);if(p&&d)return p==e&&d==t;var l=-1,m=!0,y=r&Ni?new at:void 0;f.set(t,e),f.set(e,t);while(++l<n){var c=t[l],g=e[l];if(o)var v=i?o(g,c,l,e,t,f):o(c,g,l,t,e,f);if(v!==void 0){if(v)continue;m=!1;break}if(y){if(!ir(e,function(P,C){if(!ft(y,C)&&(c===P||a(c,P,r,o,f)))return y.push(C)})){m=!1;break}}else if(!(c===g||a(c,g,r,o,f))){m=!1;break}}return f.delete(t),f.delete(e),m}var it=Di;function Ri(t){var e=-1,r=Array(t.size);return t.forEach(function(o,a){r[++e]=[a,o]}),r}var nr=Ri;function Fi(t){var e=-1,r=Array(t.size);return t.forEach(function(o){r[++e]=o}),r}var B=Fi;var Bi=1,Gi=2,Ui="[object Boolean]",zi="[object Date]",Wi="[object Error]",Ki="[object Map]",Hi="[object Number]",qi="[object RegExp]",$i="[object Set]",ki="[object String]",Yi="[object Symbol]",Xi="[object ArrayBuffer]",Zi="[object DataView]",sr=Oe?Oe.prototype:void 0,bt=sr?sr.valueOf:void 0;function Ji(t,e,r,o,a,f,i){switch(r){case Zi:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Xi:if(t.byteLength!=e.byteLength||!f(new fr(t),new fr(e)))return!1;return!0;case Ui:case zi:case Hi:return Ct(+t,+e);case Wi:return t.name==e.name&&t.message==e.message;case qi:case ki:return t==e+"";case Ki:var n=nr;case $i:var s=o&Bi;if(n||(n=B),t.size!=e.size&&!s)return!1;var p=i.get(t);if(p)return p==e;o|=Gi,i.set(t,e);var d=it(n(t),n(e),o,a,f,i);return i.delete(t),d;case Yi:if(bt)return bt.call(t)==bt.call(e)}return!1}var lr=Ji;var Qi=1,Vi=Object.prototype,tn=Vi.hasOwnProperty;function en(t,e,r,o,a,f){var i=r&Qi,n=jr(t),s=n.length,p=jr(e),d=p.length;if(s!=d&&!i)return!1;var l=s;while(l--){var m=n[l];if(!(i?m in e:tn.call(e,m)))return!1}var y=f.get(t),c=f.get(e);if(y&&c)return y==e&&c==t;var g=!0;f.set(t,e),f.set(e,t);var v=i;while(++l<s){m=n[l];var P=t[m],C=e[m];if(o)var At=i?o(C,P,m,e,t,f):o(P,C,m,t,e,f);if(!(At===void 0?P===C||a(P,C,r,o,f):At)){g=!1;break}v||(v=m=="constructor")}if(g&&!v){var W=t.constructor,K=e.constructor;if(W!=K&&(("constructor"in t)&&("constructor"in e))&&!(typeof W=="function"&&W instanceof W&&typeof K=="function"&&K instanceof K))g=!1}return f.delete(t),f.delete(e),g}var xr=en;var rn=1,_r="[object Arguments]",br="[object Array]",nt="[object Object]",on=Object.prototype,vr=on.hasOwnProperty;function an(t,e,r,o,a,f){var i=H(t),n=H(e),s=i?br:pt(t),p=n?br:pt(e);s=s==_r?nt:s,p=p==_r?nt:p;var d=s==nt,l=p==nt,m=s==p;if(m&&St(t)){if(!St(e))return!1;i=!0,d=!1}if(m&&!d)return f||(f=new Zt),i||_n(t)?it(t,e,r,o,a,f):lr(t,e,s,r,o,a,f);if(!(r&rn)){var y=d&&vr.call(t,"__wrapped__"),c=l&&vr.call(e,"__wrapped__");if(y||c){var g=y?t.value():t,v=c?e.value():e;return f||(f=new Zt),a(g,v,r,o,f)}}if(!m)return!1;return f||(f=new Zt),xr(t,e,r,o,a,f)}var Or=an;function Ar(t,e,r,o,a){if(t===e)return!0;if(t==null||e==null||!Ee(t)&&!Ee(e))return t!==t&&e!==e;return Or(t,e,r,o,Ar,a)}var ut=Ar;var fn=1,nn=2;function sn(t,e,r,o){var a=r.length,f=a,i=!o;if(t==null)return!f;t=Object(t);while(a--){var n=r[a];if(i&&n[2]?n[1]!==t[n[0]]:!(n[0]in t))return!1}while(++a<f){n=r[a];var s=n[0],p=t[s],d=n[1];if(i&&n[2]){if(p===void 0&&!(s in t))return!1}else{var l=new Zt;if(o)var m=o(p,d,s,t,e,l);if(!(m===void 0?ut(d,p,fn|nn,o,l):m))return!1}}return!0}var Tr=sn;function pn(t){return t===t&&!me(t)}var lt=pn;function un(t){var e=_e(t),r=e.length;while(r--){var o=e[r],a=t[o];e[r]=[o,a,lt(a)]}return e}var wr=un;function mn(t,e){return function(r){if(r==null)return!1;return r[t]===e&&(e!==void 0||(t in Object(r)))}}var xt=mn;function ln(t){var e=wr(t);if(e.length==1&&e[0][2])return xt(e[0][0],e[0][1]);return function(r){return r===t||Tr(r,t,e)}}var Sr=ln;function dn(t,e){return t!=null&&e in Object(t)}var Pr=dn;function hn(t,e,r){e=wn(e,t);var o=-1,a=e.length,f=!1;while(++o<a){var i=Yt(e[o]);if(!(f=t!=null&&r(t,i)))break;t=t[i]}if(f||++o!=a)return f;return a=t==null?0:t.length,!!a&&j(a)&&yn(i,a)&&(H(t)||$t(t))}var Ca=hn;function cn(t,e){return t!=null&&Ca(t,e,Pr)}var Sa=cn;var gn=1,On=2;function An(t,e){if(M(t)&&lt(e))return xt(Yt(t),e);return function(r){var o=Fe(r,t);return o===void 0&&o===e?Sa(r,t):ut(e,o,gn|On)}}var Cr=An;function Tn(t){return function(e){return e==null?void 0:e[t]}}var Ta=Tn;function Sn(t){return function(e){return kn(e,t)}}var Er=Sn;function Pn(t){return M(t)?Ta(Yt(t)):Er(t)}var Ir=Pn;function En(t){if(typeof t=="function")return t;if(t==null)return ot;if(typeof t=="object")return H(t)?Cr(t[0],t[1]):Sr(t);return Ir(t)}var Ge=En;function In(t){return function(e,r,o){var a=-1,f=Object(e),i=o(e),n=i.length;while(n--){var s=i[t?n:++a];if(r(f[s],s,f)===!1)break}return e}}var Lr=In;var Ln=Lr(),hr=Ln;function jn(t,e){return t&&hr(t,e,_e)}var gr=jn;function Mn(t,e){return function(r,o){if(r==null)return r;if(!$e(r))return t(r,o);var a=r.length,f=e?a:-1,i=Object(r);while(e?f--:++f<a)if(o(i[f],f,i)===!1)break;return r}}var Mr=Mn;var Nn=Mr(gr),Cn=Nn;function Dn(t){return Ee(t)&&$e(t)}var Ea=Dn;function Rn(t,e,r){var o=-1,a=t==null?0:t.length;while(++o<a)if(r(e,t[o]))return!0;return!1}var Nr=Rn;function Fn(t){return typeof t=="function"?t:ot}var yr=Fn;function Bn(t,e){var r=H(t)?ga:Cn;return r(t,yr(e))}var h=Bn;function Gn(t,e){var r=[];return Cn(t,function(o,a,f){if(e(o,a,f))r.push(o)}),r}var Dr=Gn;function Un(t,e){var r=H(t)?V:Dr;return r(t,Ge(e,3))}var Qe=Un;function zn(t,e){return Wt(e,function(r){return t[r]})}var Rr=zn;function Wn(t){return t==null?[]:Rr(t,_e(t))}var mt=Wn;var Kn="[object Map]",Hn="[object Set]",qn=Object.prototype,$n=qn.hasOwnProperty;function Yn(t){if(t==null)return!0;if($e(t)&&(H(t)||typeof t=="string"||typeof t.splice=="function"||St(t)||_n(t)||$t(t)))return!t.length;var e=pt(t);if(e==Kn||e==Hn)return!t.size;if(bn(t))return!ur(t).length;for(var r in t)if($n.call(t,r))return!1;return!0}var ht=Yn;function Xn(t){return t===void 0}var we=Xn;function Zn(t,e,r,o,a){return a(t,function(f,i,n){r=o?(o=!1,f):e(r,f,i,n)}),r}var Fr=Zn;function Jn(t,e,r){var o=H(t)?We:Fr,a=arguments.length<3;return o(t,Ge(e,4),r,a,Cn)}var Xt=Jn;var Qn=1/0,Vn=!(S&&1/B(new S([,-0]))[1]==Qn)?zt:function(t){return new S(t)},Br=Vn;var ts=200;function es(t,e,r){var o=-1,a=Vt,f=t.length,i=!0,n=[],s=n;if(r)i=!1,a=Nr;else if(f>=ts){var p=e?null:Br(t);if(p)return B(p);i=!1,a=ft,s=new at}else s=e?[]:n;t:while(++o<f){var d=t[o],l=e?e(d):d;if(d=r||d!==0?d:0,i&&l===l){var m=s.length;while(m--)if(s[m]===l)continue t;if(e)s.push(l);n.push(d)}else if(!a(s,l,r)){if(s!==n)s.push(l);n.push(d)}}return n}var Gr=es;var rs=vn(function(t){return Gr(pr(t,1,Ea,!0))}),vt=rs;var as="\x00",L="\x00",Ur="\x01";class re{constructor(t={}){if(this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=st(void 0),this._defaultEdgeLabelFn=st(void 0),this._nodes={},this._isCompound)this._parent={},this._children={},this._children[L]={};this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){if(!Gt(t))t=st(t);return this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return _e(this._nodes)}sources(){var t=this;return Qe(this.nodes(),function(e){return ht(t._in[e])})}sinks(){var t=this;return Qe(this.nodes(),function(e){return ht(t._out[e])})}setNodes(t,e){var r=arguments,o=this;return h(t,function(a){if(r.length>1)o.setNode(a,e);else o.setNode(a)}),this}setNode(t,e){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){if(arguments.length>1)this._nodes[t]=e;return this}if(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound)this._parent[t]=L,this._children[t]={},this._children[L][t]=!0;return this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var e=(r)=>this.removeEdge(this._edgeObjs[r]);if(delete this._nodes[t],this._isCompound)this._removeFromParentsChildList(t),delete this._parent[t],h(this.children(t),(r)=>{this.setParent(r)}),delete this._children[t];h(_e(this._in[t]),e),delete this._in[t],delete this._preds[t],h(_e(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(we(e))e=L;else{e+="";for(var r=e;!we(r);r=this.parent(r))if(r===t)throw Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==L)return e}}children(t){if(we(t))t=L;if(this._isCompound){var e=this._children[t];if(e)return _e(e)}else if(t===L)return this.nodes();else if(this.hasNode(t))return[]}predecessors(t){var e=this._preds[t];if(e)return _e(e)}successors(t){var e=this._sucs[t];if(e)return _e(e)}neighbors(t){var e=this.predecessors(t);if(e)return vt(e,this.successors(t))}isLeaf(t){var e;if(this.isDirected())e=this.successors(t);else e=this.neighbors(t);return e.length===0}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;h(this._nodes,function(f,i){if(t(i))e.setNode(i,f)}),h(this._edgeObjs,function(f){if(e.hasNode(f.v)&&e.hasNode(f.w))e.setEdge(f,r.edge(f))});var o={};function a(f){var i=r.parent(f);if(i===void 0||e.hasNode(i))return o[f]=i,i;else if(i in o)return o[i];else return a(i)}if(this._isCompound)h(e.nodes(),function(f){e.setParent(f,a(f))});return e}setDefaultEdgeLabel(t){if(!Gt(t))t=st(t);return this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return mt(this._edgeObjs)}setPath(t,e){var r=this,o=arguments;return Xt(t,function(a,f){if(o.length>1)r.setEdge(a,f,e);else r.setEdge(a,f);return f}),this}setEdge(){var t,e,r,o,a=!1,f=arguments[0];if(typeof f==="object"&&f!==null&&"v"in f){if(t=f.v,e=f.w,r=f.name,arguments.length===2)o=arguments[1],a=!0}else if(t=f,e=arguments[1],r=arguments[3],arguments.length>2)o=arguments[2],a=!0;if(t=""+t,e=""+e,!we(r))r=""+r;var i=z(this._isDirected,t,e,r);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,i)){if(a)this._edgeLabels[i]=o;return this}if(!we(r)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[i]=a?o:this._defaultEdgeLabelFn(t,e,r);var n=fs(this._isDirected,t,e,r);return t=n.v,e=n.w,Object.freeze(n),this._edgeObjs[i]=n,zr(this._preds[e],t),zr(this._sucs[t],e),this._in[e][i]=n,this._out[t][i]=n,this._edgeCount++,this}edge(t,e,r){var o=arguments.length===1?Ot(this._isDirected,arguments[0]):z(this._isDirected,t,e,r);return this._edgeLabels[o]}hasEdge(t,e,r){var o=arguments.length===1?Ot(this._isDirected,arguments[0]):z(this._isDirected,t,e,r);return Object.prototype.hasOwnProperty.call(this._edgeLabels,o)}removeEdge(t,e,r){var o=arguments.length===1?Ot(this._isDirected,arguments[0]):z(this._isDirected,t,e,r),a=this._edgeObjs[o];if(a)t=a.v,e=a.w,delete this._edgeLabels[o],delete this._edgeObjs[o],Wr(this._preds[e],t),Wr(this._sucs[t],e),delete this._in[e][o],delete this._out[t][o],this._edgeCount--;return this}inEdges(t,e){var r=this._in[t];if(r){var o=mt(r);if(!e)return o;return Qe(o,function(a){return a.v===e})}}outEdges(t,e){var r=this._out[t];if(r){var o=mt(r);if(!e)return o;return Qe(o,function(a){return a.w===e})}}nodeEdges(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))}}re.prototype._nodeCount=0;re.prototype._edgeCount=0;function zr(t,e){if(t[e])t[e]++;else t[e]=1}function Wr(t,e){if(!--t[e])delete t[e]}function z(t,e,r,o){var a=""+e,f=""+r;if(!t&&a>f){var i=a;a=f,f=i}return a+Ur+f+Ur+(we(o)?as:o)}function fs(t,e,r,o){var a=""+e,f=""+r;if(!t&&a>f){var i=a;a=f,f=i}var n={v:a,w:f};if(o)n.name=o;return n}function Ot(t,e){return z(t,e.v,e.w,e.name)}
2
+ export{xe,Oe,Ke,Ee,dt,Wt,H,me,ot,Gt,st,cr,ha,ga,ya,yn,Ct,va,vn,$e,bn,$t,St,xn,Ht,_n,ba,xa,ur,_e,_a,wn,Yt,kn,dr,pr,Zt,wa,mr,ka,jr,pt,fr,Ca,Sa,Ta,Ge,hr,gr,Cn,Ea,yr,h,Qe,mt,we,Xt,re};
@@ -1,2 +1,2 @@
1
- import{t,a,F,V}from"./chunk-veam6vk4.js";import{J}from"./chunk-60axh4sa.js";var i={parse:t(async(r)=>{let e=await J("info",r);a.debug(e)},"parse")},s={version:"12.2.0"},p=t(()=>s.version,"getVersion"),g={getVersion:p},m=t((r,e,n)=>{a.debug(`rendering info diagram
1
+ import{t,a,F,V}from"./chunk-tfqarvdx.js";import{J}from"./chunk-qy1zx2yw.js";var i={parse:t(async(r)=>{let e=await J("info",r);a.debug(e)},"parse")},s={version:"12.2.0"},p=t(()=>s.version,"getVersion"),g={getVersion:p},m=t((r,e,n)=>{a.debug(`rendering info diagram
2
2
  `+r);let o=V(e);F(o,100,400,!0),o.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),v={draw:m},y={parser:i,db:g,renderer:v};export{y as diagram};
@@ -0,0 +1 @@
1
+ import{Kn}from"./chunk-gsw1tv96.js";export{Kn as default};
@@ -1,2 +1,2 @@
1
- import{r,f,e,n,y,s,ne,Z,Jn}from"./chunk-nvt9tkt4.js";var u=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],c=s("code-xml",u);function ra(t){let i=y();i.useTheme();let[m,d]=r("preview"),o=t.streaming&&!t.rendered,l=!t.streaming&&!t.rendered&&Boolean(t.error),a=m==="code"||o;return n(i.Panel,{"aria-label":t.title,"data-render-pending":t.pending&&!l?"true":void 0,className:"group/graph relative my-4 font-sans not-italic first:mt-0 last:mb-0",children:[e("div",{role:"toolbar","aria-label":`${t.title}操作`,className:o?"absolute top-2 right-2 z-10 flex items-center":i.style("surface.toolbarFloating","absolute top-2 right-2 z-10 opacity-0 transition-opacity duration-150 group-hover/graph:opacity-100 focus-within:opacity-100 [@media(hover:none)]:opacity-70"),children:o?n("span",{className:i.style("control.badge","gap-1.5 rounded-full px-2 py-0.5 text-[11px]"),children:[e(Z,{className:"size-3 animate-spin"}),"生成",t.title]}):n(f,{children:[e("button",{type:"button","aria-label":a?"查看图表":"查看代码",title:a?"查看图表":"查看代码",onClick:()=>d(a?"preview":"code"),className:"flex size-6 items-center justify-center rounded-md text-dim hover:bg-raised hover:text-ink [&_svg]:size-3.5",children:a?e(Jn,{}):e(c,{})}),e(i.CopyButton,{text:t.code,size:"icon-sm",label:"复制代码"})]})}),a&&e(i.Code,{code:t.code,lang:t.codeLang,className:"px-4 py-3"}),l&&!a&&n("div",{role:"alert",className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[e(ne,{className:"size-5 text-warning"}),e("p",{className:"max-w-full text-xs break-words text-dim",children:t.error}),e("button",{type:"button",onClick:()=>d("code"),className:"text-xs text-accent-strong underline underline-offset-2",children:"查看代码"})]}),e("div",{hidden:a||l,children:t.children})]})}
1
+ import{r,f,e,n,y,s,ne,Z,Jn}from"./chunk-ngt1j8py.js";var u=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],c=s("code-xml",u);function ra(t){let i=y();i.useTheme();let[m,d]=r("preview"),o=t.streaming&&!t.rendered,l=!t.streaming&&!t.rendered&&Boolean(t.error),a=m==="code"||o;return n(i.Panel,{"aria-label":t.title,"data-render-pending":t.pending&&!l?"true":void 0,className:"group/graph relative my-4 font-sans not-italic first:mt-0 last:mb-0",children:[e("div",{role:"toolbar","aria-label":`${t.title}操作`,className:o?"absolute top-2 right-2 z-10 flex items-center":i.style("surface.toolbarFloating","absolute top-2 right-2 z-10 opacity-0 transition-opacity duration-150 group-hover/graph:opacity-100 focus-within:opacity-100 [@media(hover:none)]:opacity-70"),children:o?n("span",{className:i.style("control.badge","gap-1.5 rounded-full px-2 py-0.5 text-[11px]"),children:[e(Z,{className:"size-3 animate-spin"}),"生成",t.title]}):n(f,{children:[e("button",{type:"button","aria-label":a?"查看图表":"查看代码",title:a?"查看图表":"查看代码",onClick:()=>d(a?"preview":"code"),className:"flex size-6 items-center justify-center rounded-md text-dim hover:bg-raised hover:text-ink [&_svg]:size-3.5",children:a?e(Jn,{}):e(c,{})}),e(i.CopyButton,{text:t.code,size:"icon-sm",label:"复制代码"})]})}),a&&e(i.Code,{code:t.code,lang:t.codeLang,className:"px-4 py-3"}),l&&!a&&n("div",{role:"alert",className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[e(ne,{className:"size-5 text-warning"}),e("p",{className:"max-w-full text-xs break-words text-dim",children:t.error}),e("button",{type:"button",onClick:()=>d("code"),className:"text-xs text-accent-strong underline underline-offset-2",children:"查看代码"})]}),e("div",{hidden:a||l,children:t.children})]})}
2
2
  export{ra};
@@ -1,2 +1,2 @@
1
- import{s}from"./chunk-nvt9tkt4.js";var c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],na=s("circle-check",c);
1
+ import{s}from"./chunk-ngt1j8py.js";var c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],na=s("circle-check",c);
2
2
  export{na};
@@ -0,0 +1 @@
1
+ import{rr}from"./chunk-qy1zx2yw.js";export{rr as createRailroadServices};
@@ -1 +1 @@
1
- import{Y,e,n,y,Q}from"./chunk-nvt9tkt4.js";import{Nn,ta}from"./chunk-dz7g1gnv.js";import"./chunk-2hrswh3d.js";function I({connection:d}){let{Button:p,ModelSelector:c,Select:g,SettingGroup:s,SettingRow:l,cn:u}=y(),m=Y(),i=ta({connection:d,endpoint:"/api/plugins/prompt-optimizer/settings",loadError:"读取优化插件设置失败",toBody:(o)=>({schemaVersion:1,revision:o.revision,primaryModel:o.primaryModel,maxClarificationRounds:o.maxClarificationRounds}),differs:(o,t)=>o.primaryModel?.providerID!==t.primaryModel?.providerID||o.primaryModel?.modelID!==t.primaryModel?.modelID||o.maxClarificationRounds!==t.maxClarificationRounds}),r=i.settings?.primaryModel??null,f=r?`${r.providerID}/${r.modelID}`:"";return n("form",{id:m,onSubmit:i.save,className:"min-w-0 space-y-5",children:[e(s,{title:"模型",children:n(l,{title:"优化模型",description:"未选择时拒绝改写,不会自动回退到其他模型",children:[e("div",{className:"w-56",children:e(c,{variant:"field",models:i.modelList,value:f,onChange:(o)=>{let t=o.indexOf("/"),a=t<0?"":o.slice(0,t),v=t<0?o:o.slice(t+1);i.edit((S)=>({...S,primaryModel:{providerID:a,modelID:v}}))}})}),e(p,{type:"button",size:"icon-sm",variant:"ghost",disabled:i.loading||i.refreshing||i.saving,"aria-label":"刷新模型列表",title:"刷新模型列表",onClick:()=>void i.load(!0),className:"text-dim",children:e(Q,{className:u("size-3.5",i.refreshing&&"animate-spin")})})]})}),e(s,{title:"交互",children:e(l,{title:"澄清提问轮数",description:"草稿有关键歧义时,模型最多可反问几轮",children:e("div",{className:"w-56",children:e(g,{value:String(i.settings?.maxClarificationRounds??1),disabled:i.loading||i.saving,onValueChange:(o)=>{let t=o==="2"?2:1;i.edit((a)=>({...a,maxClarificationRounds:t}))},groups:[{options:[{value:"1",label:"单轮澄清(推荐)",description:"提问一次后直接输出改写结果"},{value:"2",label:"最多两轮澄清",description:"首轮澄清后可针对残留疑问追问一次"}]}]})})})}),e(Nn,{formID:m,notice:i.notice,dirty:i.dirty,busy:i.loading||i.saving,saving:i.saving,onReset:i.reset})]})}export{I as PromptOptimizerSettingsSection};
1
+ import{Y,e,n,y,Q}from"./chunk-ngt1j8py.js";import{Nn,ta}from"./chunk-w3zgfhjb.js";import"./chunk-918e5t4x.js";function I({connection:d}){let{Button:p,ModelSelector:c,Select:g,SettingGroup:s,SettingRow:l,cn:u}=y(),m=Y(),i=ta({connection:d,endpoint:"/api/plugins/prompt-optimizer/settings",loadError:"读取优化插件设置失败",toBody:(o)=>({schemaVersion:1,revision:o.revision,primaryModel:o.primaryModel,maxClarificationRounds:o.maxClarificationRounds}),differs:(o,t)=>o.primaryModel?.providerID!==t.primaryModel?.providerID||o.primaryModel?.modelID!==t.primaryModel?.modelID||o.maxClarificationRounds!==t.maxClarificationRounds}),r=i.settings?.primaryModel??null,f=r?`${r.providerID}/${r.modelID}`:"";return n("form",{id:m,onSubmit:i.save,className:"min-w-0 space-y-5",children:[e(s,{title:"模型",children:n(l,{title:"优化模型",description:"未选择时拒绝改写,不会自动回退到其他模型",children:[e("div",{className:"w-56",children:e(c,{variant:"field",models:i.modelList,value:f,onChange:(o)=>{let t=o.indexOf("/"),a=t<0?"":o.slice(0,t),v=t<0?o:o.slice(t+1);i.edit((S)=>({...S,primaryModel:{providerID:a,modelID:v}}))}})}),e(p,{type:"button",size:"icon-sm",variant:"ghost",disabled:i.loading||i.refreshing||i.saving,"aria-label":"刷新模型列表",title:"刷新模型列表",onClick:()=>void i.load(!0),className:"text-dim",children:e(Q,{className:u("size-3.5",i.refreshing&&"animate-spin")})})]})}),e(s,{title:"交互",children:e(l,{title:"澄清提问轮数",description:"草稿有关键歧义时,模型最多可反问几轮",children:e("div",{className:"w-56",children:e(g,{value:String(i.settings?.maxClarificationRounds??1),disabled:i.loading||i.saving,onValueChange:(o)=>{let t=o==="2"?2:1;i.edit((a)=>({...a,maxClarificationRounds:t}))},groups:[{options:[{value:"1",label:"单轮澄清(推荐)",description:"提问一次后直接输出改写结果"},{value:"2",label:"最多两轮澄清",description:"首轮澄清后可针对残留疑问追问一次"}]}]})})})}),e(Nn,{formID:m,notice:i.notice,dirty:i.dirty,busy:i.loading||i.saving,saving:i.saving,onReset:i.reset})]})}export{I as PromptOptimizerSettingsSection};
@@ -1 +1 @@
1
- import{t,a}from"./chunk-veam6vk4.js";import{ee,Dt,Nt}from"./chunk-xx11yv61.js";import{G}from"./chunk-dwjmr0zj.js";import{ir,wt}from"./chunk-60axh4sa.js";var l=ir().RailroadAbnf.parser.LangiumParser,s=t((e)=>{let r=e.alternatives.map(p);if(r.length===1)return r[0];return{type:"choice",alternatives:r}},"transformAlternation"),p=t((e)=>{let r=e.elements.map(f);if(r.length===1)return r[0];return{type:"sequence",elements:r}},"transformConcatenation"),u=t((e)=>{if(e.includes("*")){let[n,o]=e.split("*"),i=n?parseInt(n,10):0,m=o?parseInt(o,10):1/0;return{min:i,max:m}}let r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),f=t((e)=>{let r=c(e.primary);if(!e.repeat)return r;let{min:n,max:o}=u(e.repeat);if(n===0&&o===1)return{type:"optional",element:r};return{type:"repetition",element:r,min:n,max:o}},"transformElement"),c=t((e)=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return s(e.element);case"AbnfOptionalGroup":return{type:"optional",element:s(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),d=t((e)=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t((e)=>{if(G(e,ee),e.title)ee.setTitle(e.title);e.rules.map((r)=>ee.addRule(d(r)))},"populateDb"),g={parse:t((e)=>{ee.clear(),a.debug("[ABNF Parser] Starting Langium parse");let r=l.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new wt(r);let n=r.value;a.debug("[ABNF Parser] Parsed rules:",n.rules.length),v(n),a.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:ee}},E={parser:g,db:ee,renderer:Nt,styles:Dt};export{E as diagram};
1
+ import{t,a}from"./chunk-tfqarvdx.js";import{ee,Dt,Nt}from"./chunk-n4yzs2q0.js";import{G}from"./chunk-eh7wp62z.js";import{ir,wt}from"./chunk-qy1zx2yw.js";var l=ir().RailroadAbnf.parser.LangiumParser,s=t((e)=>{let r=e.alternatives.map(p);if(r.length===1)return r[0];return{type:"choice",alternatives:r}},"transformAlternation"),p=t((e)=>{let r=e.elements.map(f);if(r.length===1)return r[0];return{type:"sequence",elements:r}},"transformConcatenation"),u=t((e)=>{if(e.includes("*")){let[n,o]=e.split("*"),i=n?parseInt(n,10):0,m=o?parseInt(o,10):1/0;return{min:i,max:m}}let r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),f=t((e)=>{let r=c(e.primary);if(!e.repeat)return r;let{min:n,max:o}=u(e.repeat);if(n===0&&o===1)return{type:"optional",element:r};return{type:"repetition",element:r,min:n,max:o}},"transformElement"),c=t((e)=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return s(e.element);case"AbnfOptionalGroup":return{type:"optional",element:s(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),d=t((e)=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t((e)=>{if(G(e,ee),e.title)ee.setTitle(e.title);e.rules.map((r)=>ee.addRule(d(r)))},"populateDb"),g={parse:t((e)=>{ee.clear(),a.debug("[ABNF Parser] Starting Langium parse");let r=l.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new wt(r);let n=r.value;a.debug("[ABNF Parser] Parsed rules:",n.rules.length),v(n),a.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:ee}},E={parser:g,db:ee,renderer:Nt,styles:Dt};export{E as diagram};
@@ -1 +1 @@
1
- import{t,a}from"./chunk-veam6vk4.js";import{ee,Dt,Nt}from"./chunk-xx11yv61.js";import{G}from"./chunk-dwjmr0zj.js";import{rr,wt}from"./chunk-60axh4sa.js";var o=rr().Railroad.parser.LangiumParser,n=t((e)=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{let r=e.elements.map(n);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{let r=e.alternatives.map(n);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:n(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:n(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:n(e.element),min:0,max:1/0};default:throw Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),l=t((e)=>({name:e.name,definition:n(e.definition)}),"transformRule"),s=t((e)=>{if(G(e,ee),e.title)ee.setTitle(e.title);e.rules.map((r)=>ee.addRule(l(r)))},"populateDb"),m={parse:t((e)=>{ee.clear(),a.debug("[Railroad Parser] Starting Langium parse");let r=o.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new wt(r);let i=r.value;a.debug("[Railroad Parser] Parsed rules:",i.rules.length),s(i),a.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:ee}},R={parser:m,db:ee,renderer:Nt,styles:Dt};export{R as diagram};
1
+ import{t,a}from"./chunk-tfqarvdx.js";import{ee,Dt,Nt}from"./chunk-n4yzs2q0.js";import{G}from"./chunk-eh7wp62z.js";import{rr,wt}from"./chunk-qy1zx2yw.js";var o=rr().Railroad.parser.LangiumParser,n=t((e)=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{let r=e.elements.map(n);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{let r=e.alternatives.map(n);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:n(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:n(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:n(e.element),min:0,max:1/0};default:throw Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),l=t((e)=>({name:e.name,definition:n(e.definition)}),"transformRule"),s=t((e)=>{if(G(e,ee),e.title)ee.setTitle(e.title);e.rules.map((r)=>ee.addRule(l(r)))},"populateDb"),m={parse:t((e)=>{ee.clear(),a.debug("[Railroad Parser] Starting Langium parse");let r=o.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new wt(r);let i=r.value;a.debug("[Railroad Parser] Parsed rules:",i.rules.length),s(i),a.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:ee}},R={parser:m,db:ee,renderer:Nt,styles:Dt};export{R as diagram};
@@ -1,4 +1,4 @@
1
- import{G}from"./chunk-dwjmr0zj.js";import{t,a,N,x,F,C,S,E,T,A,L,R,V,U}from"./chunk-veam6vk4.js";import{J}from"./chunk-60axh4sa.js";var _=N.packet,D=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=E,this.setDiagramTitle=L,this.getDiagramTitle=R,this.getAccDescription=A,this.setAccDescription=T}static{t(this,"PacketDB")}getConfig(){let e=U({..._,...x().packet});if(e.showBits)e.paddingY+=10;return e}getPacket(){return this.packet}pushWord(e){if(e.length>0)this.packet.push(e)}clear(){C(),this.packet=[]}},M=1e4,Y=t((e,r)=>{G(e,r);let i=-1,s=[],l=1,{bitsPerRow:d}=r.getConfig();for(let{start:o,end:n,bits:g,label:f}of e.blocks){if(o!==void 0&&n!==void 0&&n<o)throw Error(`Packet block ${o} - ${n} is invalid. End must be greater than start.`);if(o??=i+1,o!==i+1)throw Error(`Packet block ${o} - ${n??o} is not contiguous. It should start from ${i+1}.`);if(g===0)throw Error(`Packet block ${o} is invalid. Cannot have a zero bit field.`);n??=o+(g??1)-1,g??=n-o+1,i=n,a.debug(`Packet block ${o} - ${i} with label ${f}`);while(s.length<=d+1&&r.getPacket().length<M){let[p,h]=I({start:o,end:n,bits:g,label:f},l,d);if(s.push(p),p.end+1===l*d)r.pushWord(s),s=[],l++;if(!h)break;({start:o,end:n,bits:g,label:f}=h)}}r.pushWord(s)},"populate"),I=t((e,r,i)=>{if(e.start===void 0)throw Error("start should have been set during first phase");if(e.end===void 0)throw Error("end should have been set during first phase");if(e.start>e.end)throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=r*i)return[e,void 0];let s=r*i-1,l=r*i;return[{start:e.start,end:s,label:e.label,bits:s-e.start},{start:l,end:e.end,label:e.label,bits:e.end-l}]},"getNextFittingBlock"),z={parser:{yy:void 0},parse:t(async(e)=>{let r=await J("packet",e),i=z.parser?.yy;if(!(i instanceof D))throw Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");a.debug(r),Y(r,i)},"parse")},O=t((e,r,i,s)=>{let l=s.db,d=l.getConfig(),{rowHeight:o,paddingY:n,bitWidth:g,bitsPerRow:f}=d,p=l.getPacket(),h=l.getDiagramTitle(),b=o+n,c=b*(p.length+1)-(h?0:o),k=g*f+2,m=V(r);m.attr("viewBox",`0 0 ${k} ${c}`),F(m,c,k,d.useMaxWidth);for(let[y,u]of p.entries())j(m,u,y,d);m.append("text").text(h).attr("x",k/2).attr("y",c-b/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),j=t((e,r,i,{rowHeight:s,paddingX:l,paddingY:d,bitWidth:o,bitsPerRow:n,showBits:g,bitOrder:f})=>{let p=e.append("g"),h=i*(s+d)+d,b=f==="descending";for(let c of r){let k=c.end-c.start+1,m=c.start%n,u=(b?n-m-k:m)*o+1,w=k*o-l;if(p.append("rect").attr("x",u).attr("y",h).attr("width",w).attr("height",s).attr("class","packetBlock"),p.append("text").attr("x",u+w/2).attr("y",h+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(c.label),!g)continue;let[P,W]=b?[c.end,c.start]:[c.start,c.end],v=k===1,B=h-2;if(p.append("text").attr("x",u+(v?w/2:0)).attr("y",B).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",v?"middle":"start").text(P),!v)p.append("text").attr("x",u+w).attr("y",B).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(W)}},"drawWord"),H={draw:O},K={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},X=t(({packet:e}={})=>{let r=U(K,e);return`
1
+ import{G}from"./chunk-eh7wp62z.js";import{t,a,N,x,F,C,S,E,T,A,L,R,V,U}from"./chunk-tfqarvdx.js";import{J}from"./chunk-qy1zx2yw.js";var _=N.packet,D=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=E,this.setDiagramTitle=L,this.getDiagramTitle=R,this.getAccDescription=A,this.setAccDescription=T}static{t(this,"PacketDB")}getConfig(){let e=U({..._,...x().packet});if(e.showBits)e.paddingY+=10;return e}getPacket(){return this.packet}pushWord(e){if(e.length>0)this.packet.push(e)}clear(){C(),this.packet=[]}},M=1e4,Y=t((e,r)=>{G(e,r);let i=-1,s=[],l=1,{bitsPerRow:d}=r.getConfig();for(let{start:o,end:n,bits:g,label:f}of e.blocks){if(o!==void 0&&n!==void 0&&n<o)throw Error(`Packet block ${o} - ${n} is invalid. End must be greater than start.`);if(o??=i+1,o!==i+1)throw Error(`Packet block ${o} - ${n??o} is not contiguous. It should start from ${i+1}.`);if(g===0)throw Error(`Packet block ${o} is invalid. Cannot have a zero bit field.`);n??=o+(g??1)-1,g??=n-o+1,i=n,a.debug(`Packet block ${o} - ${i} with label ${f}`);while(s.length<=d+1&&r.getPacket().length<M){let[p,h]=I({start:o,end:n,bits:g,label:f},l,d);if(s.push(p),p.end+1===l*d)r.pushWord(s),s=[],l++;if(!h)break;({start:o,end:n,bits:g,label:f}=h)}}r.pushWord(s)},"populate"),I=t((e,r,i)=>{if(e.start===void 0)throw Error("start should have been set during first phase");if(e.end===void 0)throw Error("end should have been set during first phase");if(e.start>e.end)throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=r*i)return[e,void 0];let s=r*i-1,l=r*i;return[{start:e.start,end:s,label:e.label,bits:s-e.start},{start:l,end:e.end,label:e.label,bits:e.end-l}]},"getNextFittingBlock"),z={parser:{yy:void 0},parse:t(async(e)=>{let r=await J("packet",e),i=z.parser?.yy;if(!(i instanceof D))throw Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");a.debug(r),Y(r,i)},"parse")},O=t((e,r,i,s)=>{let l=s.db,d=l.getConfig(),{rowHeight:o,paddingY:n,bitWidth:g,bitsPerRow:f}=d,p=l.getPacket(),h=l.getDiagramTitle(),b=o+n,c=b*(p.length+1)-(h?0:o),k=g*f+2,m=V(r);m.attr("viewBox",`0 0 ${k} ${c}`),F(m,c,k,d.useMaxWidth);for(let[y,u]of p.entries())j(m,u,y,d);m.append("text").text(h).attr("x",k/2).attr("y",c-b/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),j=t((e,r,i,{rowHeight:s,paddingX:l,paddingY:d,bitWidth:o,bitsPerRow:n,showBits:g,bitOrder:f})=>{let p=e.append("g"),h=i*(s+d)+d,b=f==="descending";for(let c of r){let k=c.end-c.start+1,m=c.start%n,u=(b?n-m-k:m)*o+1,w=k*o-l;if(p.append("rect").attr("x",u).attr("y",h).attr("width",w).attr("height",s).attr("class","packetBlock"),p.append("text").attr("x",u+w/2).attr("y",h+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(c.label),!g)continue;let[P,W]=b?[c.end,c.start]:[c.start,c.end],v=k===1,B=h-2;if(p.append("text").attr("x",u+(v?w/2:0)).attr("y",B).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",v?"middle":"start").text(P),!v)p.append("text").attr("x",u+w).attr("y",B).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(W)}},"drawWord"),H={draw:O},K={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},X=t(({packet:e}={})=>{let r=U(K,e);return`
2
2
  .packetByte {
3
3
  font-size: ${r.byteFontSize};
4
4
  }
@@ -1 +1 @@
1
- import{Y,r,e,n,y,Q,X}from"./chunk-nvt9tkt4.js";import{Nn,ta}from"./chunk-dz7g1gnv.js";import"./chunk-2hrswh3d.js";function B({connection:p}){let{Button:l,ModelIcon:u,ModelSelector:f,SettingGroup:d,SettingRow:h,Switch:v,cn:x}=y(),c=Y(),[S,b]=r(""),s=ta({connection:p,endpoint:"/api/plugins/agents/settings",loadError:"读取理事会设置失败",toBody:(t)=>({schemaVersion:1,models:t.models,research:t.research}),differs:(t,i)=>JSON.stringify(t.models)!==JSON.stringify(i.models)||t.research!==i.research}),N=(t)=>{if(!t)return;s.edit((i)=>{if(i.models.includes(t)||i.models.length>=8)return i;return{...i,models:[...i.models,t]}}),b("")},k=(t)=>{s.edit((i)=>({...i,models:i.models.filter((o)=>o!==t)}))},a=s.settings?.models??[];return n("form",{id:c,onSubmit:s.save,className:"min-w-0 space-y-5",children:[e(d,{title:"参会模型",description:`已选 ${a.length}/8,至少 2 个模型参与群聊交叉审查`,children:n("ul",{className:"divide-y divide-line/60",children:[a.map((t)=>{let i=s.modelList.models.find((C)=>C.id===t),o=t.indexOf("/"),m=o<0?"":t.slice(0,o),g=i?.name??(o<0?t:t.slice(o+1));return n("li",{title:t,className:"group flex min-h-11 items-center gap-3",children:[e("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-lg bg-raised",children:e(u,{modelID:t,className:"size-4",size:16})}),e("span",{className:"min-w-0 flex-1 truncate text-[13px] text-ink",children:g}),m&&e("span",{className:"max-w-32 shrink-0 truncate text-xs text-faint",children:m}),e(l,{type:"button",size:"icon-xs",variant:"ghost",disabled:s.loading||s.saving,"aria-label":`移除 ${g}`,onClick:()=>k(t),className:"text-faint opacity-40 group-hover:opacity-100 hover:text-danger focus-visible:opacity-100",children:e(X,{className:"size-3.5"})})]},t)}),a.length<8&&n("li",{className:"flex items-center gap-2",children:[e("div",{className:"min-w-0 flex-1",children:e(f,{variant:"add",models:{models:s.modelList.models.filter((t)=>!a.includes(t.id))},value:S,onChange:N})}),e(l,{type:"button",size:"icon-xs",variant:"ghost",disabled:s.loading||s.refreshing||s.saving,"aria-label":"刷新模型列表",title:"刷新模型列表",onClick:()=>void s.load(!0),className:"text-faint hover:text-ink",children:e(Q,{className:x("size-3.5",s.refreshing&&"animate-spin")})})]})]})}),e(d,{title:"流程",children:e(h,{title:"调研阶段",description:"表态前各自先查证,关闭后直接发表意见",children:e(v,{label:"调研阶段",checked:s.settings?.research??!0,disabled:s.loading||s.saving,onCheckedChange:(t)=>{s.edit((i)=>({...i,research:t}))}})})}),e(Nn,{formID:c,notice:s.notice,dirty:s.dirty,busy:s.loading||s.saving,saving:s.saving,onReset:s.reset})]})}export{B as CouncilSettingsSection};
1
+ import{Y,r,e,n,y,Q,X}from"./chunk-ngt1j8py.js";import{Nn,ta}from"./chunk-w3zgfhjb.js";import"./chunk-918e5t4x.js";function B({connection:p}){let{Button:l,ModelIcon:u,ModelSelector:f,SettingGroup:d,SettingRow:h,Switch:v,cn:x}=y(),c=Y(),[S,b]=r(""),s=ta({connection:p,endpoint:"/api/plugins/agents/settings",loadError:"读取理事会设置失败",toBody:(t)=>({schemaVersion:1,models:t.models,research:t.research}),differs:(t,i)=>JSON.stringify(t.models)!==JSON.stringify(i.models)||t.research!==i.research}),N=(t)=>{if(!t)return;s.edit((i)=>{if(i.models.includes(t)||i.models.length>=8)return i;return{...i,models:[...i.models,t]}}),b("")},k=(t)=>{s.edit((i)=>({...i,models:i.models.filter((o)=>o!==t)}))},a=s.settings?.models??[];return n("form",{id:c,onSubmit:s.save,className:"min-w-0 space-y-5",children:[e(d,{title:"参会模型",description:`已选 ${a.length}/8,至少 2 个模型参与群聊交叉审查`,children:n("ul",{className:"divide-y divide-line/60",children:[a.map((t)=>{let i=s.modelList.models.find((C)=>C.id===t),o=t.indexOf("/"),m=o<0?"":t.slice(0,o),g=i?.name??(o<0?t:t.slice(o+1));return n("li",{title:t,className:"group flex min-h-11 items-center gap-3",children:[e("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-lg bg-raised",children:e(u,{modelID:t,className:"size-4",size:16})}),e("span",{className:"min-w-0 flex-1 truncate text-[13px] text-ink",children:g}),m&&e("span",{className:"max-w-32 shrink-0 truncate text-xs text-faint",children:m}),e(l,{type:"button",size:"icon-xs",variant:"ghost",disabled:s.loading||s.saving,"aria-label":`移除 ${g}`,onClick:()=>k(t),className:"text-faint opacity-40 group-hover:opacity-100 hover:text-danger focus-visible:opacity-100",children:e(X,{className:"size-3.5"})})]},t)}),a.length<8&&n("li",{className:"flex items-center gap-2",children:[e("div",{className:"min-w-0 flex-1",children:e(f,{variant:"add",models:{models:s.modelList.models.filter((t)=>!a.includes(t.id))},value:S,onChange:N})}),e(l,{type:"button",size:"icon-xs",variant:"ghost",disabled:s.loading||s.refreshing||s.saving,"aria-label":"刷新模型列表",title:"刷新模型列表",onClick:()=>void s.load(!0),className:"text-faint hover:text-ink",children:e(Q,{className:x("size-3.5",s.refreshing&&"animate-spin")})})]})]})}),e(d,{title:"流程",children:e(h,{title:"调研阶段",description:"表态前各自先查证,关闭后直接发表意见",children:e(v,{label:"调研阶段",checked:s.settings?.research??!0,disabled:s.loading||s.saving,onCheckedChange:(t)=>{s.edit((i)=>({...i,research:t}))}})})}),e(Nn,{formID:c,notice:s.notice,dirty:s.dirty,busy:s.loading||s.saving,saving:s.saving,onReset:s.reset})]})}export{B as CouncilSettingsSection};
@@ -1,4 +1,4 @@
1
- import{fn}from"./chunk-t893141g.js";import{G}from"./chunk-dwjmr0zj.js";import{t,a,N,x,O,F,C,S,E,T,A,L,R,V,Ln,nt,U}from"./chunk-veam6vk4.js";import{J}from"./chunk-60axh4sa.js";var z=/[─━│┃└┗├┣]/,Y=/[└┗├┣]/,ee=/[─━]/,M=/^[\s│┃]+$/,H=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,W=/^\s*%%/,te=" ";function P(n){return n.some((r)=>z.test(r))}t(P,"isBoxDrawingFormat");function Z(n){for(let r of n){let e=Y.exec(r);if(e?.index&&e.index>0)return e.index}return 4}t(Z,"inferSegmentWidth");function q(n,r){return n.replace(/\bline\s+(\d+)\b/gi,(e,i)=>{let c=parseInt(i,10),o=r.get(c);return o?`line ${o}`:e})}t(q,"remapErrorLines");function j(n){let r=n.split(`
1
+ import{fn}from"./chunk-g7dc4hrd.js";import{G}from"./chunk-eh7wp62z.js";import{t,a,N,x,O,F,C,S,E,T,A,L,R,V,Ln,nt,U}from"./chunk-tfqarvdx.js";import{J}from"./chunk-qy1zx2yw.js";var z=/[─━│┃└┗├┣]/,Y=/[└┗├┣]/,ee=/[─━]/,M=/^[\s│┃]+$/,H=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,W=/^\s*%%/,te=" ";function P(n){return n.some((r)=>z.test(r))}t(P,"isBoxDrawingFormat");function Z(n){for(let r of n){let e=Y.exec(r);if(e?.index&&e.index>0)return e.index}return 4}t(Z,"inferSegmentWidth");function q(n,r){return n.replace(/\bline\s+(\d+)\b/gi,(e,i)=>{let c=parseInt(i,10),o=r.get(c);return o?`line ${o}`:e})}t(q,"remapErrorLines");function j(n){let r=n.split(`
2
2
  `),e=new Map,i=-1;for(let[g,d]of r.entries())if(d.trim()==="treeView-beta"){i=g;break}if(i===-1)return{text:n,lineMap:e};let c=[];for(let g=i+1;g<r.length;g++){let d=r[g];if(d.trim()===""||W.test(d)||H.test(d))continue;if(M.test(d))continue;c.push(d.replace(/\t/g," "))}if(!P(c))return{text:n,lineMap:e};let o=Z(c),s=[],l=0;for(let g=0;g<=i;g++)s.push(r[g]),l++,e.set(l,g+1);for(let g=i+1;g<r.length;g++){let d=r[g],p=d.trim(),f=g+1;if(p===""){s.push(d),l++,e.set(l,f);continue}if(W.test(d)){s.push(d),l++,e.set(l,f);continue}if(H.test(d)){s.push(d),l++,e.set(l,f);continue}if(M.test(d))continue;let h=d.replace(/\t/g," "),w=Y.exec(h);if(w?.index!==void 0){let u=w.index,v=Math.round(u/o)+1,m=u+1;while(m<h.length&&ee.test(h[m]))m++;while(m<h.length&&h[m]===" ")m++;let I=h.slice(m).trimEnd();if(!I)throw Error(`Line ${f}: Empty node — expected a filename or directory name after the box-drawing prefix`);let Q=te.repeat(v);s.push(Q+I),l++,e.set(l,f)}else if(/^[\s─━│┃└┗├┣]+$/.test(h))continue;else if(z.test(h))s.push(d),l++,e.set(l,f);else if(/^\s+/.test(h))throw Error(`Line ${f}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);else s.push(d),l++,e.set(l,f)}return{text:s.join(`
3
3
  `),lineMap:e}}t(j,"preprocessBoxDrawing");var b=new fn(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),re=t(()=>{b.reset(),C()},"clear"),ne=t(()=>b.records.stack[0],"getRoot"),ie=t(()=>b.records.cnt,"getCount"),oe=N.treeView,se=t(()=>U(oe,x().treeView),"getConfig"),ae=t((n,r,e,i,c,o)=>{while(n<=b.records.stack[b.records.stack.length-1].level)b.records.stack.pop();let s={id:b.records.cnt++,level:n,name:r,nodeType:e,icon:c,cssClass:i,description:o,children:[]};b.records.stack[b.records.stack.length-1].children.push(s),b.records.stack.push(s)},"addNode"),ce={clear:re,addNode:ae,getRoot:ne,getCount:ie,getConfig:se,getAccTitle:E,getAccDescription:A,getDiagramTitle:R,setAccDescription:T,setAccTitle:S,setDiagramTitle:L},B=ce,le=t((n)=>{G(n,B);for(let r of n.nodes){let e=typeof r.indent==="number"?r.indent:0,i=r.name,c=i.endsWith("/");if(c)i=i.slice(0,-1);let o=c?"directory":"file",s=r.classAnnotation||void 0,l=r.iconAnnotation,g=l!==void 0?l||"none":void 0,d=r.descAnnotation||void 0,p=d?O(d,x()):void 0;B.addNode(e,i,o,s,g,p)}},"populate"),de={parse:t(async(n)=>{let{text:r,lineMap:e}=j(n);try{let i=await J("treeView",r);a.debug(i),le(i)}catch(i){if(e.size>0&&i instanceof Error)i.message=q(i.message,e);throw i}},"parse")},y={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function K(n,r){let e=r?.filenameIcons?.[n];if(e)return e;let i=n.lastIndexOf(".");if(i>0){let c=n.substring(i).toLowerCase(),o=r?.extensionIcons;return o?.[c]??o?.[c.slice(1)]}return}t(K,"detectIcon");function k(n,r){if(n.includes(":"))return n;if(n in y.icons||!r)return`${y.prefix}:${n}`;return`${r}:${n}`}t(k,"qualifyIcon");function _(n,r){if(n.icon==="none")return;if(n.icon)return k(n.icon,r.defaultIconPack);if(!r.showIcons)return;if(n.nodeType==="file"){let e=K(n.name,r);if(e==="none")return;if(e)return k(e,r.defaultIconPack)}return`${y.prefix}:${n.nodeType==="directory"?"folder":"file"}`}t(_,"getNodeIcon");Ln([{name:y.prefix,icons:y}]);var D=14,he=4,pe=16,fe=t(async(n,r)=>{let e=[],i=t((o)=>{let s=_(o,r);if(s)e.push({icon:s,node:o});o.children.forEach(i)},"collect");i(n);let c=await Promise.all(e.map(async({icon:o,node:s})=>({id:s.id,svg:await nt(o,{height:D,width:D})})));return new Map(c.map(({id:o,svg:s})=>[o,s]))},"resolveNodeIcons"),ge=t((n,r,e,i,c,o)=>{let s=i.append("g"),l="treeView-node-label";if(e.nodeType==="directory")l+=" treeView-node-dir";if(e.cssClass)l+=` ${e.cssClass}`;let g=D+he,d=_(e,c),p=d!==void 0;if(d)s.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+c.paddingX}, ${r+c.paddingY})`).html(o.get(e.id)??"");let f=s.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",l),{height:h,width:w}=f.node().getBBox(),u=h+c.paddingY*2,v=n+c.paddingX+(p?g:0);f.attr("x",v),f.attr("y",r+u/2);let m=v+w,I=w+c.paddingX*2+(p?g:0);if(e.BBox={x:n,y:r,width:I,height:u},e.cssClass?.split(/\s+/).includes("highlight"))s.insert("rect",":first-child").attr("x",n).attr("y",r+1).attr("width",0).attr("height",u-2).attr("rx",3).attr("class","treeView-highlight-bg");return{node:e,nodeGroup:s,labelRightEdge:m,centerY:r+u/2}},"positionLabel"),X=t((n,r,e,i,c,o)=>n.append("line").attr("x1",r).attr("y1",e).attr("x2",i).attr("y2",c).attr("stroke-width",o).attr("class","treeView-node-line"),"positionLine"),ue=t((n,r,e,i)=>{let c=0,o=0,s=[],l=t((p,f,h,w)=>{let u=w*(h.rowIndent+h.paddingX),v=ge(u,c,f,p,h,i);s.push(v);let{height:m,width:I}=f.BBox;X(p,u-h.rowIndent,c+m/2,u,c+m/2,h.lineThickness),o=Math.max(o,u+I),c+=m},"drawNode"),g=t((p,f=0)=>{l(n,p,e,f),p.children.forEach((v)=>{g(v,f+1)});let{x:h,y:w,height:u}=p.BBox;if(p.children.length){let{y:v,height:m}=p.children[p.children.length-1].BBox;X(n,h+e.paddingX,w+u,h+e.paddingX,v+m/2+e.lineThickness/2,e.lineThickness)}},"processNode");g(r);let d=s.filter((p)=>p.node.description);if(d.length>0){let f=Math.max(...s.map((h)=>h.labelRightEdge))+pe;for(let h of d){let u=h.nodeGroup.append("text").text(h.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",h.centerY).node().getBBox();o=Math.max(o,f+u.width+e.paddingX)}}for(let p of s)if(p.node.cssClass?.split(/\s+/).includes("highlight")){let f=p.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){let h=o-p.node.BBox.x+8;f.attr("width",h),o=Math.max(o,p.node.BBox.x+h+2)}}return{totalHeight:c,totalWidth:o}},"drawTree"),me=t(async(n,r,e,i)=>{a.debug(`Rendering treeView diagram
4
4
  `+n);let c=i.db,o=c.getRoot(),s=c.getConfig(),l=V(r),g=l.append("g");g.attr("class","tree-view");let d=await fe(o,s),{totalHeight:p,totalWidth:f}=ue(g,o,s,d);l.attr("viewBox",`-${s.lineThickness/2} 0 ${f} ${p}`),F(l,p,f,s.useMaxWidth)},"draw"),we={draw:me},xe=we,ve={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},be=t(({treeView:n})=>{let{labelFontSize:r,labelColor:e,lineColor:i,iconColor:c,descriptionColor:o,highlightBg:s,highlightStroke:l}=U(ve,n);return`
@@ -0,0 +1 @@
1
+ import{Mi}from"./chunk-qy1zx2yw.js";export{Mi as createEventModelingServices};
@@ -1,10 +1,10 @@
1
- import{t,b,ht,C,S,E,T,A,L,R,l,Tn,p,ae,qn,xo,Ba,Fa,Wn}from"./chunk-veam6vk4.js";import{$n,hn}from"./chunk-y2rzeb4v.js";import{Xe}from"./chunk-07agqp8h.js";function nt(n,c){let y=0;if(c===void 0){for(let g of n)if(g=+g)y+=g}else{let g=-1;for(let _ of n)if(_=+c(_,++g,n))y+=_}return y}function dt(n){var c=n.length/6|0,y=Array(c),g=0;while(g<c)y[g]="#"+n.slice(g*6,++g*6);return y}var pt=dt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function Et(n){return n.source}function Pt(n){return n.target}function At(n){let c=Et,y=Pt,g=Ba,_=Fa,P=null,m=null,G=qn(i);function i(){let o,f=xo.call(arguments),v=c.apply(this,f),x=y.apply(this,f);if(P==null)m=n(o=G());if(m.lineStart(),f[0]=v,m.point(+g.apply(this,f),+_.apply(this,f)),f[0]=x,m.point(+g.apply(this,f),+_.apply(this,f)),m.lineEnd(),o)return m=null,o+""||null}return i.source=function(o){return arguments.length?(c=o,i):c},i.target=function(o){return arguments.length?(y=o,i):y},i.x=function(o){return arguments.length?(g=typeof o==="function"?o:ae(+o),i):g},i.y=function(o){return arguments.length?(_=typeof o==="function"?o:ae(+o),i):_},i.context=function(o){return arguments.length?(o==null?P=m=null:m=n(P=o),i):P},i}function bt(){return At(Wn)}function Tt(n){return n.target.depth}function yt(n){return n.depth}function mt(n,c){return c-1-n.height}function rt(n,c){return n.sourceLinks.length?n.depth:c-1}function gt(n){return n.targetLinks.length?n.depth:n.sourceLinks.length?hn(n.sourceLinks,Tt)-1:0}function tt(n){return function(){return n}}function vt(n,c){return st(n.source,c.source)||n.index-c.index}function _t(n,c){return st(n.target,c.target)||n.index-c.index}function st(n,c){return n.y0-c.y0}function xt(n){return n.value}function Ct(n){return n.index}function Bt(n){return n.nodes}function Ot(n){return n.links}function St(n,c){let y=n.get(c);if(!y)throw Error("missing: "+c);return y}function wt({nodes:n}){for(let c of n){let y=c.y0,g=y;for(let _ of c.sourceLinks)_.y0=y+_.width/2,y+=_.width;for(let _ of c.targetLinks)_.y1=g+_.width/2,g+=_.width}}function ot(){let n=0,c=0,y=1,g=1,_=24,P=8,m,G=Ct,i=rt,o,f,v=Bt,x=Ot,h=6;function w(){let e={nodes:v.apply(null,arguments),links:x.apply(null,arguments)};return I(e),M(e),W(e),U(e),z(e),wt(e),e}w.update=function(e){return wt(e),e},w.nodeId=function(e){return arguments.length?(G=typeof e==="function"?e:tt(e),w):G},w.nodeAlign=function(e){return arguments.length?(i=typeof e==="function"?e:tt(e),w):i},w.nodeSort=function(e){return arguments.length?(o=e,w):o},w.nodeWidth=function(e){return arguments.length?(_=+e,w):_},w.nodePadding=function(e){return arguments.length?(P=m=+e,w):P},w.nodes=function(e){return arguments.length?(v=typeof e==="function"?e:tt(e),w):v},w.links=function(e){return arguments.length?(x=typeof e==="function"?e:tt(e),w):x},w.linkSort=function(e){return arguments.length?(f=e,w):f},w.size=function(e){return arguments.length?(n=c=0,y=+e[0],g=+e[1],w):[y-n,g-c]},w.extent=function(e){return arguments.length?(n=+e[0][0],y=+e[1][0],c=+e[0][1],g=+e[1][1],w):[[n,c],[y,g]]},w.iterations=function(e){return arguments.length?(h=+e,w):h};function I({nodes:e,links:a}){for(let[r,s]of e.entries())s.index=r,s.sourceLinks=[],s.targetLinks=[];let u=new Map(e.map((r,s)=>[G(r,s,e),r]));for(let[r,s]of a.entries()){s.index=r;let{source:d,target:k}=s;if(typeof d!=="object")d=s.source=St(u,d);if(typeof k!=="object")k=s.target=St(u,k);d.sourceLinks.push(s),k.targetLinks.push(s)}if(f!=null)for(let{sourceLinks:r,targetLinks:s}of e)r.sort(f),s.sort(f)}function M({nodes:e}){for(let a of e)a.value=a.fixedValue===void 0?Math.max(nt(a.sourceLinks,xt),nt(a.targetLinks,xt)):a.fixedValue}function W({nodes:e}){let a=e.length,u=new Set(e),r=new Set,s=0;while(u.size){for(let d of u){d.depth=s;for(let{target:k}of d.sourceLinks)r.add(k)}if(++s>a)throw Error("circular link");u=r,r=new Set}}function U({nodes:e}){let a=e.length,u=new Set(e),r=new Set,s=0;while(u.size){for(let d of u){d.height=s;for(let{source:k}of d.targetLinks)r.add(k)}if(++s>a)throw Error("circular link");u=r,r=new Set}}function Q({nodes:e}){let a=$n(e,(s)=>s.depth)+1,u=(y-n-_)/(a-1),r=Array(a);for(let s of e){let d=Math.max(0,Math.min(a-1,Math.floor(i.call(null,s,a))));if(s.layer=d,s.x0=n+d*u,s.x1=s.x0+_,r[d])r[d].push(s);else r[d]=[s]}if(o)for(let s of r)s.sort(o);return r}function q(e){let a=hn(e,(u)=>(g-c-(u.length-1)*m)/nt(u,xt));for(let u of e){let r=c;for(let s of u){s.y0=r,s.y1=r+s.value*a,r=s.y1+m;for(let d of s.sourceLinks)d.width=d.value*a}r=(g-r+m)/(u.length+1);for(let s=0;s<u.length;++s){let d=u[s];d.y0+=r*(s+1),d.y1+=r*(s+1)}K(u)}}function z(e){let a=Q(e);m=Math.min(P,(g-c)/($n(a,(u)=>u.length)-1)),q(a);for(let u=0;u<h;++u){let r=Math.pow(0.99,u),s=Math.max(1-r,(u+1)/h);D(a,r,s),B(a,r,s)}}function B(e,a,u){for(let r=1,s=e.length;r<s;++r){let d=e[r];for(let k of d){let J=0,Y=0;for(let{source:N,value:ft}of k.targetLinks){let et=ft*(k.layer-N.layer);J+=O(N,k)*et,Y+=et}if(!(Y>0))continue;let F=(J/Y-k.y0)*a;k.y0+=F,k.y1+=F,Z(k)}if(o===void 0)d.sort(st);H(d,u)}}function D(e,a,u){for(let r=e.length,s=r-2;s>=0;--s){let d=e[s];for(let k of d){let J=0,Y=0;for(let{target:N,value:ft}of k.sourceLinks){let et=ft*(N.layer-k.layer);J+=V(k,N)*et,Y+=et}if(!(Y>0))continue;let F=(J/Y-k.y0)*a;k.y0+=F,k.y1+=F,Z(k)}if(o===void 0)d.sort(st);H(d,u)}}function H(e,a){let u=e.length>>1,r=e[u];j(e,r.y0-m,u-1,a),X(e,r.y1+m,u+1,a),j(e,g,e.length-1,a),X(e,c,0,a)}function X(e,a,u,r){for(;u<e.length;++u){let s=e[u],d=(a-s.y0)*r;if(d>0.000001)s.y0+=d,s.y1+=d;a=s.y1+m}}function j(e,a,u,r){for(;u>=0;--u){let s=e[u],d=(s.y1-a)*r;if(d>0.000001)s.y0-=d,s.y1-=d;a=s.y0-m}}function Z({sourceLinks:e,targetLinks:a}){if(f===void 0){for(let{source:{sourceLinks:u}}of a)u.sort(_t);for(let{target:{targetLinks:u}}of e)u.sort(vt)}}function K(e){if(f===void 0)for(let{sourceLinks:a,targetLinks:u}of e)a.sort(_t),u.sort(vt)}function O(e,a){let u=e.y0-(e.sourceLinks.length-1)*m/2;for(let{target:r,width:s}of e.sourceLinks){if(r===a)break;u+=s+m}for(let{source:r,width:s}of a.targetLinks){if(r===e)break;u-=s}return u}function V(e,a){let u=a.y0-(a.targetLinks.length-1)*m/2;for(let{source:r,width:s}of a.targetLinks){if(r===e)break;u+=s+m}for(let{target:r,width:s}of e.sourceLinks){if(r===a)break;u-=s}return u}return w}function Rt(n){return[n.source.x1,n.y0]}function Nt(n){return[n.target.x0,n.y1]}function it(){return bt().source(Rt).target(Nt)}var kt=function(){var n=t(function(G,i,o,f){for(o=o||{},f=G.length;f--;o[G[f]]=i);return o},"o"),c=[1,9],y=[1,10],g=[1,5,10,12],_={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:t(function(i,o,f,v,x,h,w){var I=h.length-1;switch(x){case 7:let M=v.findOrCreateNode(h[I-4].trim().replaceAll('""','"')),W=v.findOrCreateNode(h[I-2].trim().replaceAll('""','"')),U=parseFloat(h[I].trim());v.addLink(M,W,U);break;case 8:case 9:case 11:this.$=h[I];break;case 10:this.$=h[I-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:c,20:y},{1:[2,6],7:11,10:[1,12]},n(y,[2,4],{9:13,5:[1,14]}),{12:[1,15]},n(g,[2,8]),n(g,[2,9]),{19:[1,16]},n(g,[2,11]),{1:[2,1]},{1:[2,5]},n(y,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:c,20:y},{15:18,16:7,17:8,18:c,20:y},{18:[1,19]},n(y,[2,3]),{12:[1,20]},n(g,[2,10]),{15:21,16:7,17:8,18:c,20:y},n([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:t(function(i,o){if(o.recoverable)this.trace(i);else{var f=Error(i);throw f.hash=o,f}},"parseError"),parse:t(function(i){var o=this,f=[0],v=[],x=[null],h=[],w=this.table,I="",M=0,W=0,U=0,Q=2,q=1,z=h.slice.call(arguments,1),B=Object.create(this.lexer),D={yy:{}};for(var H in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,H))D.yy[H]=this.yy[H];if(B.setInput(i,D.yy),D.yy.lexer=B,D.yy.parser=this,typeof B.yylloc>"u")B.yylloc={};var X=B.yylloc;h.push(X);var j=B.options&&B.options.ranges;if(typeof D.yy.parseError==="function")this.parseError=D.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Z(N){f.length=f.length-2*N,x.length=x.length-N,h.length=h.length-N}t(Z,"popStack");function K(){var N=v.pop()||B.lex()||q;if(typeof N!=="number"){if(N instanceof Array)v=N,N=v.pop();N=o.symbols_[N]||N}return N}t(K,"lex");var O,V,e,a,u,r,s={},d,k,J,Y;while(!0){if(e=f[f.length-1],this.defaultActions[e])a=this.defaultActions[e];else{if(O===null||typeof O>"u")O=K();a=w[e]&&w[e][O]}if(typeof a>"u"||!a.length||!a[0]){var F="";Y=[];for(d in w[e])if(this.terminals_[d]&&d>Q)Y.push("'"+this.terminals_[d]+"'");if(B.showPosition)F="Parse error on line "+(M+1)+`:
1
+ import{t,b,gt,C,S,E,T,A,L,R,l,Tn,p,ae,qn,xo,Ba,Fa,Wn}from"./chunk-tfqarvdx.js";import{$n,hn}from"./chunk-y2rzeb4v.js";import{Xe}from"./chunk-07agqp8h.js";function nt(n,c){let y=0;if(c===void 0){for(let g of n)if(g=+g)y+=g}else{let g=-1;for(let _ of n)if(_=+c(_,++g,n))y+=_}return y}function ht(n){var c=n.length/6|0,y=Array(c),g=0;while(g<c)y[g]="#"+n.slice(g*6,++g*6);return y}var dt=ht("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function Et(n){return n.source}function Pt(n){return n.target}function At(n){let c=Et,y=Pt,g=Ba,_=Fa,P=null,m=null,G=qn(i);function i(){let o,f=xo.call(arguments),v=c.apply(this,f),x=y.apply(this,f);if(P==null)m=n(o=G());if(m.lineStart(),f[0]=v,m.point(+g.apply(this,f),+_.apply(this,f)),f[0]=x,m.point(+g.apply(this,f),+_.apply(this,f)),m.lineEnd(),o)return m=null,o+""||null}return i.source=function(o){return arguments.length?(c=o,i):c},i.target=function(o){return arguments.length?(y=o,i):y},i.x=function(o){return arguments.length?(g=typeof o==="function"?o:ae(+o),i):g},i.y=function(o){return arguments.length?(_=typeof o==="function"?o:ae(+o),i):_},i.context=function(o){return arguments.length?(o==null?P=m=null:m=n(P=o),i):P},i}function bt(){return At(Wn)}function Tt(n){return n.target.depth}function pt(n){return n.depth}function yt(n,c){return c-1-n.height}function rt(n,c){return n.sourceLinks.length?n.depth:c-1}function mt(n){return n.targetLinks.length?n.depth:n.sourceLinks.length?hn(n.sourceLinks,Tt)-1:0}function tt(n){return function(){return n}}function vt(n,c){return st(n.source,c.source)||n.index-c.index}function _t(n,c){return st(n.target,c.target)||n.index-c.index}function st(n,c){return n.y0-c.y0}function xt(n){return n.value}function Ct(n){return n.index}function Bt(n){return n.nodes}function Ot(n){return n.links}function St(n,c){let y=n.get(c);if(!y)throw Error("missing: "+c);return y}function wt({nodes:n}){for(let c of n){let y=c.y0,g=y;for(let _ of c.sourceLinks)_.y0=y+_.width/2,y+=_.width;for(let _ of c.targetLinks)_.y1=g+_.width/2,g+=_.width}}function ot(){let n=0,c=0,y=1,g=1,_=24,P=8,m,G=Ct,i=rt,o,f,v=Bt,x=Ot,h=6;function w(){let e={nodes:v.apply(null,arguments),links:x.apply(null,arguments)};return I(e),M(e),W(e),U(e),z(e),wt(e),e}w.update=function(e){return wt(e),e},w.nodeId=function(e){return arguments.length?(G=typeof e==="function"?e:tt(e),w):G},w.nodeAlign=function(e){return arguments.length?(i=typeof e==="function"?e:tt(e),w):i},w.nodeSort=function(e){return arguments.length?(o=e,w):o},w.nodeWidth=function(e){return arguments.length?(_=+e,w):_},w.nodePadding=function(e){return arguments.length?(P=m=+e,w):P},w.nodes=function(e){return arguments.length?(v=typeof e==="function"?e:tt(e),w):v},w.links=function(e){return arguments.length?(x=typeof e==="function"?e:tt(e),w):x},w.linkSort=function(e){return arguments.length?(f=e,w):f},w.size=function(e){return arguments.length?(n=c=0,y=+e[0],g=+e[1],w):[y-n,g-c]},w.extent=function(e){return arguments.length?(n=+e[0][0],y=+e[1][0],c=+e[0][1],g=+e[1][1],w):[[n,c],[y,g]]},w.iterations=function(e){return arguments.length?(h=+e,w):h};function I({nodes:e,links:a}){for(let[r,s]of e.entries())s.index=r,s.sourceLinks=[],s.targetLinks=[];let u=new Map(e.map((r,s)=>[G(r,s,e),r]));for(let[r,s]of a.entries()){s.index=r;let{source:d,target:k}=s;if(typeof d!=="object")d=s.source=St(u,d);if(typeof k!=="object")k=s.target=St(u,k);d.sourceLinks.push(s),k.targetLinks.push(s)}if(f!=null)for(let{sourceLinks:r,targetLinks:s}of e)r.sort(f),s.sort(f)}function M({nodes:e}){for(let a of e)a.value=a.fixedValue===void 0?Math.max(nt(a.sourceLinks,xt),nt(a.targetLinks,xt)):a.fixedValue}function W({nodes:e}){let a=e.length,u=new Set(e),r=new Set,s=0;while(u.size){for(let d of u){d.depth=s;for(let{target:k}of d.sourceLinks)r.add(k)}if(++s>a)throw Error("circular link");u=r,r=new Set}}function U({nodes:e}){let a=e.length,u=new Set(e),r=new Set,s=0;while(u.size){for(let d of u){d.height=s;for(let{source:k}of d.targetLinks)r.add(k)}if(++s>a)throw Error("circular link");u=r,r=new Set}}function Q({nodes:e}){let a=$n(e,(s)=>s.depth)+1,u=(y-n-_)/(a-1),r=Array(a);for(let s of e){let d=Math.max(0,Math.min(a-1,Math.floor(i.call(null,s,a))));if(s.layer=d,s.x0=n+d*u,s.x1=s.x0+_,r[d])r[d].push(s);else r[d]=[s]}if(o)for(let s of r)s.sort(o);return r}function q(e){let a=hn(e,(u)=>(g-c-(u.length-1)*m)/nt(u,xt));for(let u of e){let r=c;for(let s of u){s.y0=r,s.y1=r+s.value*a,r=s.y1+m;for(let d of s.sourceLinks)d.width=d.value*a}r=(g-r+m)/(u.length+1);for(let s=0;s<u.length;++s){let d=u[s];d.y0+=r*(s+1),d.y1+=r*(s+1)}K(u)}}function z(e){let a=Q(e);m=Math.min(P,(g-c)/($n(a,(u)=>u.length)-1)),q(a);for(let u=0;u<h;++u){let r=Math.pow(0.99,u),s=Math.max(1-r,(u+1)/h);D(a,r,s),B(a,r,s)}}function B(e,a,u){for(let r=1,s=e.length;r<s;++r){let d=e[r];for(let k of d){let J=0,Y=0;for(let{source:N,value:ft}of k.targetLinks){let et=ft*(k.layer-N.layer);J+=O(N,k)*et,Y+=et}if(!(Y>0))continue;let F=(J/Y-k.y0)*a;k.y0+=F,k.y1+=F,Z(k)}if(o===void 0)d.sort(st);H(d,u)}}function D(e,a,u){for(let r=e.length,s=r-2;s>=0;--s){let d=e[s];for(let k of d){let J=0,Y=0;for(let{target:N,value:ft}of k.sourceLinks){let et=ft*(N.layer-k.layer);J+=V(k,N)*et,Y+=et}if(!(Y>0))continue;let F=(J/Y-k.y0)*a;k.y0+=F,k.y1+=F,Z(k)}if(o===void 0)d.sort(st);H(d,u)}}function H(e,a){let u=e.length>>1,r=e[u];j(e,r.y0-m,u-1,a),X(e,r.y1+m,u+1,a),j(e,g,e.length-1,a),X(e,c,0,a)}function X(e,a,u,r){for(;u<e.length;++u){let s=e[u],d=(a-s.y0)*r;if(d>0.000001)s.y0+=d,s.y1+=d;a=s.y1+m}}function j(e,a,u,r){for(;u>=0;--u){let s=e[u],d=(s.y1-a)*r;if(d>0.000001)s.y0-=d,s.y1-=d;a=s.y0-m}}function Z({sourceLinks:e,targetLinks:a}){if(f===void 0){for(let{source:{sourceLinks:u}}of a)u.sort(_t);for(let{target:{targetLinks:u}}of e)u.sort(vt)}}function K(e){if(f===void 0)for(let{sourceLinks:a,targetLinks:u}of e)a.sort(_t),u.sort(vt)}function O(e,a){let u=e.y0-(e.sourceLinks.length-1)*m/2;for(let{target:r,width:s}of e.sourceLinks){if(r===a)break;u+=s+m}for(let{source:r,width:s}of a.targetLinks){if(r===e)break;u-=s}return u}function V(e,a){let u=a.y0-(a.targetLinks.length-1)*m/2;for(let{source:r,width:s}of a.targetLinks){if(r===e)break;u+=s+m}for(let{target:r,width:s}of e.sourceLinks){if(r===a)break;u-=s}return u}return w}function Rt(n){return[n.source.x1,n.y0]}function Nt(n){return[n.target.x0,n.y1]}function it(){return bt().source(Rt).target(Nt)}var kt=function(){var n=t(function(G,i,o,f){for(o=o||{},f=G.length;f--;o[G[f]]=i);return o},"o"),c=[1,9],y=[1,10],g=[1,5,10,12],_={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:t(function(i,o,f,v,x,h,w){var I=h.length-1;switch(x){case 7:let M=v.findOrCreateNode(h[I-4].trim().replaceAll('""','"')),W=v.findOrCreateNode(h[I-2].trim().replaceAll('""','"')),U=parseFloat(h[I].trim());v.addLink(M,W,U);break;case 8:case 9:case 11:this.$=h[I];break;case 10:this.$=h[I-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:c,20:y},{1:[2,6],7:11,10:[1,12]},n(y,[2,4],{9:13,5:[1,14]}),{12:[1,15]},n(g,[2,8]),n(g,[2,9]),{19:[1,16]},n(g,[2,11]),{1:[2,1]},{1:[2,5]},n(y,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:c,20:y},{15:18,16:7,17:8,18:c,20:y},{18:[1,19]},n(y,[2,3]),{12:[1,20]},n(g,[2,10]),{15:21,16:7,17:8,18:c,20:y},n([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:t(function(i,o){if(o.recoverable)this.trace(i);else{var f=Error(i);throw f.hash=o,f}},"parseError"),parse:t(function(i){var o=this,f=[0],v=[],x=[null],h=[],w=this.table,I="",M=0,W=0,U=0,Q=2,q=1,z=h.slice.call(arguments,1),B=Object.create(this.lexer),D={yy:{}};for(var H in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,H))D.yy[H]=this.yy[H];if(B.setInput(i,D.yy),D.yy.lexer=B,D.yy.parser=this,typeof B.yylloc>"u")B.yylloc={};var X=B.yylloc;h.push(X);var j=B.options&&B.options.ranges;if(typeof D.yy.parseError==="function")this.parseError=D.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Z(N){f.length=f.length-2*N,x.length=x.length-N,h.length=h.length-N}t(Z,"popStack");function K(){var N=v.pop()||B.lex()||q;if(typeof N!=="number"){if(N instanceof Array)v=N,N=v.pop();N=o.symbols_[N]||N}return N}t(K,"lex");var O,V,e,a,u,r,s={},d,k,J,Y;while(!0){if(e=f[f.length-1],this.defaultActions[e])a=this.defaultActions[e];else{if(O===null||typeof O>"u")O=K();a=w[e]&&w[e][O]}if(typeof a>"u"||!a.length||!a[0]){var F="";Y=[];for(d in w[e])if(this.terminals_[d]&&d>Q)Y.push("'"+this.terminals_[d]+"'");if(B.showPosition)F="Parse error on line "+(M+1)+`:
2
2
  `+B.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[O]||O)+"'";else F="Parse error on line "+(M+1)+": Unexpected "+(O==q?"end of input":"'"+(this.terminals_[O]||O)+"'");this.parseError(F,{text:B.match,token:this.terminals_[O]||O,line:B.yylineno,loc:X,expected:Y})}if(a[0]instanceof Array&&a.length>1)throw Error("Parse Error: multiple actions possible at state: "+e+", token: "+O);switch(a[0]){case 1:if(f.push(O),x.push(B.yytext),h.push(B.yylloc),f.push(a[1]),O=null,!V){if(W=B.yyleng,I=B.yytext,M=B.yylineno,X=B.yylloc,U>0)U--}else O=V,V=null;break;case 2:if(k=this.productions_[a[1]][1],s.$=x[x.length-k],s._$={first_line:h[h.length-(k||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(k||1)].first_column,last_column:h[h.length-1].last_column},j)s._$.range=[h[h.length-(k||1)].range[0],h[h.length-1].range[1]];if(r=this.performAction.apply(s,[I,W,M,D.yy,a[1],x,h].concat(z)),typeof r<"u")return r;if(k)f=f.slice(0,-1*k*2),x=x.slice(0,-1*k),h=h.slice(0,-1*k);f.push(this.productions_[a[1]][0]),x.push(s.$),h.push(s._$),J=w[f[f.length-2]][f[f.length-1]],f.push(J);break;case 3:return!0}}return!0},"parse")},P=function(){var G={EOF:1,parseError:t(function(o,f){if(this.yy.parser)this.yy.parser.parseError(o,f);else throw Error(o)},"parseError"),setInput:t(function(i,o){if(this.yy=o||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var o=i.match(/(?:\r\n?|\n).*/g);if(o)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),i},"input"),unput:t(function(i){var o=i.length,f=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var v=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1)this.yylineno-=f.length-1;var x=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===v.length?this.yylloc.first_column:0)+v[v.length-f.length].length-f[0].length:this.yylloc.first_column-o},this.options.ranges)this.yylloc.range=[x[0],x[0]+this.yyleng-o];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(i){this.unput(this.match.slice(i))},"less"),pastInput:t(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var i=this.match;if(i.length<20)i+=this._input.substr(0,20-i.length);return(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var i=this.pastInput(),o=Array(i.length+1).join("-");return i+this.upcomingInput()+`
5
5
  `+o+"^"},"showPosition"),test_match:t(function(i,o){var f,v,x;if(this.options.backtrack_lexer){if(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)x.yylloc.range=this.yylloc.range.slice(0)}if(v=i[0].match(/(?:\r\n?|\n).*/g),v)this.yylineno+=v.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:v?v[v.length-1].length-v[v.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],f=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(f)return f;else if(this._backtrack){for(var h in x)this[h]=x[h];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var i,o,f,v;if(!this._more)this.yytext="",this.match="";var x=this._currentRules();for(var h=0;h<x.length;h++)if(f=this._input.match(this.rules[x[h]]),f&&(!o||f[0].length>o[0].length)){if(o=f,v=h,this.options.backtrack_lexer)if(i=this.test_match(f,x[h]),i!==!1)return i;else if(this._backtrack){o=!1;continue}else return!1;else if(!this.options.flex)break}if(o){if(i=this.test_match(o,x[v]),i!==!1)return i;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var o=this.next();if(o)return o;else return this.lex()},"lex"),begin:t(function(o){this.conditionStack.push(o)},"begin"),popState:t(function(){var o=this.conditionStack.length-1;if(o>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(o){if(o=this.conditionStack.length-1-Math.abs(o||0),o>=0)return this.conditionStack[o];else return"INITIAL"},"topState"),pushState:t(function(o){this.begin(o)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(o,f,v,x){var h=x;switch(v){case 0:return this.pushState("csv"),4;break;case 1:return this.pushState("csv"),4;break;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;break;case 6:return 20;case 7:return this.popState("escaped_text"),18;break;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return G}();_.lexer=P;function m(){this.yy={}}return t(m,"Parser"),m.prototype=_,_.Parser=m,new m}();kt.parser=kt;var at=kt,ct=[],ut=[],lt=new Map,Gt=t(()=>{ct=[],ut=[],lt=new Map,C()},"clear"),It=class{constructor(n,c,y=0){this.source=n,this.target=c,this.value=y}static{t(this,"SankeyLink")}},Mt=t((n,c,y)=>{ct.push(new It(n,c,y))},"addLink"),Yt=class{constructor(n){this.ID=n}static{t(this,"SankeyNode")}},Dt=t((n)=>{n=b.sanitizeText(n,l());let c=lt.get(n);if(c===void 0)c=new Yt(n),lt.set(n,c),ut.push(c);return c},"findOrCreateNode"),jt=t(()=>ut,"getNodes"),$t=t(()=>ct,"getLinks"),zt=t(()=>({nodes:ut.map((n)=>({id:n.ID})),links:ct.map((n)=>({source:n.source.ID,target:n.target.ID,value:n.value}))}),"getGraph"),Vt={nodesMap:lt,getConfig:t(()=>l().sankey,"getConfig"),getNodes:jt,getLinks:$t,getGraph:zt,addLink:Mt,findOrCreateNode:Dt,getAccTitle:E,setAccTitle:S,getAccDescription:A,setAccDescription:T,getDiagramTitle:R,setDiagramTitle:L,clear:Gt},Lt=class n{static{t(this,"Uid")}static{this.count=0}static next(c){return new n(c+ ++n.count)}constructor(c){this.id=c,this.href=`#${c}`}toString(){return"url("+this.href+")"}},Ft={left:yt,right:mt,center:gt,justify:rt},Wt=t((n)=>{let c=0,y=0;for(let g of n){let _=g.value??0;if(_>c)c=_,y=g.layer??0}return y},"findCentralNodeLayer"),Ut=t(function(n,c,y,g){let{securityLevel:_,sankey:P}=l(),m=Tn.sankey,G;if(_==="sandbox")G=p("#i"+c);let i=_==="sandbox"?p(G.nodes()[0].contentDocument.body):p("body"),o=_==="sandbox"?i.select(`[id="${c}"]`):p(`[id="${c}"]`),f=P?.width??m.width,v=P?.height??m.width,x=P?.useMaxWidth??m.useMaxWidth,h=P?.nodeAlignment??m.nodeAlignment,w=P?.prefix??m.prefix,I=P?.suffix??m.suffix,M=P?.showValues??m.showValues,W=P?.nodeWidth??m.nodeWidth??10,U=P?.nodePadding??m.nodePadding??12,Q=P?.labelStyle??m.labelStyle??"legacy",q=P?.nodeColors??{},z=g.db.getGraph(),B=Ft[h];ot().nodeId((r)=>r.id).nodeWidth(W).nodePadding(U+(M?15:0)).nodeAlign(B).extent([[0,0],[f,v]])(z);let H=Wt(z.nodes),X=Xe(pt),j=t((r)=>q[r]??X(r),"getNodeColor");o.append("g").attr("class","nodes").selectAll(".node").data(z.nodes).join("g").attr("class","node").attr("id",(r)=>(r.uid=Lt.next("node-")).id).attr("transform",function(r){return"translate("+r.x0+","+r.y0+")"}).attr("x",(r)=>r.x0).attr("y",(r)=>r.y0).append("rect").attr("height",(r)=>r.y1-r.y0).attr("width",(r)=>r.x1-r.x0).attr("fill",(r)=>j(r.id));let Z=t(({id:r,value:s})=>{if(!M)return r;return`${r}
7
- ${w}${Math.round(s*100)/100}${I}`},"getText"),K=t((r)=>{if(Q==="outlined"){if((r.layer??0)<H)return{x:r.x0-6,anchor:"end"};return{x:r.x1+6,anchor:"start"}}if(r.x0<f/2)return{x:r.x1+6,anchor:"start"};return{x:r.x0-6,anchor:"end"}},"getLabelPosition"),O=o.append("g").attr("class","node-labels").attr("font-size",14),V=t((r)=>O.selectAll(r?`.${r}`:"text").data(z.nodes).join("text").attr("class",r??null).attr("x",(s)=>K(s).x).attr("y",(s)=>(s.y1+s.y0)/2).attr("dy",`${M?"0":"0.35"}em`).attr("text-anchor",(s)=>K(s).anchor).text(Z),"appendLabel");if(Q==="outlined")V("sankey-label-bg"),V("sankey-label-fg");else V();let e=o.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",0.5).selectAll(".link").data(z.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),a=P?.linkColor??"gradient";if(a==="gradient"){let r=e.append("linearGradient").attr("id",(s)=>(s.uid=Lt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",(s)=>s.source.x1).attr("x2",(s)=>s.target.x0);r.append("stop").attr("offset","0%").attr("stop-color",(s)=>j(s.source.id)),r.append("stop").attr("offset","100%").attr("stop-color",(s)=>j(s.target.id))}let u;switch(a){case"gradient":u=t((r)=>r.uid,"coloring");break;case"source":u=t((r)=>j(r.source.id),"coloring");break;case"target":u=t((r)=>j(r.target.id),"coloring");break;default:u=a}e.append("path").attr("d",it()).attr("stroke",u).attr("stroke-width",(r)=>Math.max(1,r.width)),ht(void 0,o,0,x)},"draw"),Ht={draw:Ut},Xt=t((n)=>n.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var o=this.next();if(o)return o;else return this.lex()},"lex"),begin:t(function(o){this.conditionStack.push(o)},"begin"),popState:t(function(){var o=this.conditionStack.length-1;if(o>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(o){if(o=this.conditionStack.length-1-Math.abs(o||0),o>=0)return this.conditionStack[o];else return"INITIAL"},"topState"),pushState:t(function(o){this.begin(o)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(o,f,v,x){var h=x;switch(v){case 0:return this.pushState("csv"),4;break;case 1:return this.pushState("csv"),4;break;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;break;case 6:return 20;case 7:return this.popState("escaped_text"),18;break;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return G}();_.lexer=P;function m(){this.yy={}}return t(m,"Parser"),m.prototype=_,_.Parser=m,new m}();kt.parser=kt;var at=kt,ct=[],ut=[],lt=new Map,Gt=t(()=>{ct=[],ut=[],lt=new Map,C()},"clear"),It=class{constructor(n,c,y=0){this.source=n,this.target=c,this.value=y}static{t(this,"SankeyLink")}},Mt=t((n,c,y)=>{ct.push(new It(n,c,y))},"addLink"),Yt=class{constructor(n){this.ID=n}static{t(this,"SankeyNode")}},Dt=t((n)=>{n=b.sanitizeText(n,l());let c=lt.get(n);if(c===void 0)c=new Yt(n),lt.set(n,c),ut.push(c);return c},"findOrCreateNode"),jt=t(()=>ut,"getNodes"),$t=t(()=>ct,"getLinks"),zt=t(()=>({nodes:ut.map((n)=>({id:n.ID})),links:ct.map((n)=>({source:n.source.ID,target:n.target.ID,value:n.value}))}),"getGraph"),Vt={nodesMap:lt,getConfig:t(()=>l().sankey,"getConfig"),getNodes:jt,getLinks:$t,getGraph:zt,addLink:Mt,findOrCreateNode:Dt,getAccTitle:E,setAccTitle:S,getAccDescription:A,setAccDescription:T,getDiagramTitle:R,setDiagramTitle:L,clear:Gt},Lt=class n{static{t(this,"Uid")}static{this.count=0}static next(c){return new n(c+ ++n.count)}constructor(c){this.id=c,this.href=`#${c}`}toString(){return"url("+this.href+")"}},Ft={left:pt,right:yt,center:mt,justify:rt},Wt=t((n)=>{let c=0,y=0;for(let g of n){let _=g.value??0;if(_>c)c=_,y=g.layer??0}return y},"findCentralNodeLayer"),Ut=t(function(n,c,y,g){let{securityLevel:_,sankey:P}=l(),m=Tn.sankey,G;if(_==="sandbox")G=p("#i"+c);let i=_==="sandbox"?p(G.nodes()[0].contentDocument.body):p("body"),o=_==="sandbox"?i.select(`[id="${c}"]`):p(`[id="${c}"]`),f=P?.width??m.width,v=P?.height??m.width,x=P?.useMaxWidth??m.useMaxWidth,h=P?.nodeAlignment??m.nodeAlignment,w=P?.prefix??m.prefix,I=P?.suffix??m.suffix,M=P?.showValues??m.showValues,W=P?.nodeWidth??m.nodeWidth??10,U=P?.nodePadding??m.nodePadding??12,Q=P?.labelStyle??m.labelStyle??"legacy",q=P?.nodeColors??{},z=g.db.getGraph(),B=Ft[h];ot().nodeId((r)=>r.id).nodeWidth(W).nodePadding(U+(M?15:0)).nodeAlign(B).extent([[0,0],[f,v]])(z);let H=Wt(z.nodes),X=Xe(dt),j=t((r)=>q[r]??X(r),"getNodeColor");o.append("g").attr("class","nodes").selectAll(".node").data(z.nodes).join("g").attr("class","node").attr("id",(r)=>(r.uid=Lt.next("node-")).id).attr("transform",function(r){return"translate("+r.x0+","+r.y0+")"}).attr("x",(r)=>r.x0).attr("y",(r)=>r.y0).append("rect").attr("height",(r)=>r.y1-r.y0).attr("width",(r)=>r.x1-r.x0).attr("fill",(r)=>j(r.id));let Z=t(({id:r,value:s})=>{if(!M)return r;return`${r}
7
+ ${w}${Math.round(s*100)/100}${I}`},"getText"),K=t((r)=>{if(Q==="outlined"){if((r.layer??0)<H)return{x:r.x0-6,anchor:"end"};return{x:r.x1+6,anchor:"start"}}if(r.x0<f/2)return{x:r.x1+6,anchor:"start"};return{x:r.x0-6,anchor:"end"}},"getLabelPosition"),O=o.append("g").attr("class","node-labels").attr("font-size",14),V=t((r)=>O.selectAll(r?`.${r}`:"text").data(z.nodes).join("text").attr("class",r??null).attr("x",(s)=>K(s).x).attr("y",(s)=>(s.y1+s.y0)/2).attr("dy",`${M?"0":"0.35"}em`).attr("text-anchor",(s)=>K(s).anchor).text(Z),"appendLabel");if(Q==="outlined")V("sankey-label-bg"),V("sankey-label-fg");else V();let e=o.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",0.5).selectAll(".link").data(z.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),a=P?.linkColor??"gradient";if(a==="gradient"){let r=e.append("linearGradient").attr("id",(s)=>(s.uid=Lt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",(s)=>s.source.x1).attr("x2",(s)=>s.target.x0);r.append("stop").attr("offset","0%").attr("stop-color",(s)=>j(s.source.id)),r.append("stop").attr("offset","100%").attr("stop-color",(s)=>j(s.target.id))}let u;switch(a){case"gradient":u=t((r)=>r.uid,"coloring");break;case"source":u=t((r)=>j(r.source.id),"coloring");break;case"target":u=t((r)=>j(r.target.id),"coloring");break;default:u=a}e.append("path").attr("d",it()).attr("stroke",u).attr("stroke-width",(r)=>Math.max(1,r.width)),gt(void 0,o,0,x)},"draw"),Ht={draw:Ut},Xt=t((n)=>n.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
8
8
  `).trim(),"prepareTextForParsing"),Jt=t((n)=>`.label {
9
9
  font-family: ${n.fontFamily};
10
10
  }
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-veam6vk4.js";function G(c,e){if(c.accDescr)e.setAccDescription?.(c.accDescr);if(c.accTitle)e.setAccTitle?.(c.accTitle);if(c.title)e.setDiagramTitle?.(c.title)}t(G,"populateCommonDb");
1
+ import{t}from"./chunk-tfqarvdx.js";function G(c,e){if(c.accDescr)e.setAccDescription?.(c.accDescr);if(c.accTitle)e.setAccTitle?.(c.accTitle);if(c.title)e.setDiagramTitle?.(c.title)}t(G,"populateCommonDb");
2
2
  export{G};