@bkm016/basalt 0.1.6 → 0.1.7

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 (124) hide show
  1. package/README.md +3 -3
  2. package/{chunk-tgfbtehh.js → chunk-654cny9a.js} +82 -82
  3. package/{chunk-hksqjts3.js → chunk-sjjtxpg2.js} +174 -173
  4. package/compiled.js +1 -1
  5. package/package.json +1 -1
  6. package/ui-test-worker.js +1 -1
  7. package/web/{chunk-zsxw5fj7.js → chunk-079091ar.js} +1 -1
  8. package/web/{chunk-t74r2n8h.js → chunk-083r4f80.js} +1 -1
  9. package/web/{chunk-fp48zz2e.js → chunk-0cng7r2x.js} +1 -1
  10. package/web/chunk-0k0ande6.js +1 -0
  11. package/web/{chunk-ya3ghn3n.js → chunk-14deqqhr.js} +1 -1
  12. package/web/{chunk-5v44qv67.js → chunk-1s53190z.js} +2 -2
  13. package/web/{chunk-fx0n2g22.js → chunk-2b63adsj.js} +1 -1
  14. package/web/{chunk-cktmyc13.js → chunk-2cem4sv7.js} +2 -2
  15. package/web/{chunk-m2prjwk3.js → chunk-3baypnwn.js} +3 -3
  16. package/web/{chunk-m9bzz9m0.js → chunk-4067nwjp.js} +2 -2
  17. package/web/{chunk-96v2avmw.js → chunk-4fm55fgb.js} +1 -1
  18. package/web/{chunk-nyn9tghz.js → chunk-4q7wf0wd.js} +1 -1
  19. package/web/{chunk-ck8rr0sr.js → chunk-4sve9xrj.js} +1 -1
  20. package/web/{chunk-03dmzvaq.js → chunk-4vjnrz87.js} +1 -1
  21. package/web/{chunk-7hs57qdr.js → chunk-5k8sv4f5.js} +1 -1
  22. package/web/{chunk-cm92fyr3.js → chunk-5vjhvw1m.js} +1 -1
  23. package/web/{chunk-xc2sq3t5.js → chunk-5wbnjjhg.js} +1 -1
  24. package/web/chunk-6ft5pz3c.js +1 -0
  25. package/web/chunk-7c8rwqtx.js +1 -0
  26. package/web/chunk-7qzz025k.js +1 -0
  27. package/web/chunk-7xbaqqd7.css +1 -0
  28. package/web/chunk-80eyv2mk.js +1 -0
  29. package/web/{chunk-5wdk97mk.js → chunk-89paytbk.js} +1 -1
  30. package/web/chunk-8ceej2g7.js +1 -0
  31. package/web/chunk-8nyhy122.js +1 -0
  32. package/web/{chunk-718mr5gc.js → chunk-989jq2h8.js} +1 -1
  33. package/web/{chunk-fxs4nb93.js → chunk-aangfjqc.js} +1 -1
  34. package/web/{chunk-prvh9syp.js → chunk-bdydzbqk.js} +1 -1
  35. package/web/{chunk-2wqxhqr9.js → chunk-cpwtt6ny.js} +1 -1
  36. package/web/{chunk-9c1yt2ex.js → chunk-czjk218p.js} +1 -1
  37. package/web/{chunk-dwajwrpk.js → chunk-dg3p8db5.js} +1 -1
  38. package/web/chunk-dsw5t58p.js +1 -0
  39. package/web/{chunk-bz2v64xe.js → chunk-dv72fat3.js} +1 -1
  40. package/web/{chunk-0fgaepwm.js → chunk-dvvs1jjq.js} +1 -1
  41. package/web/{chunk-cb2rxtq9.js → chunk-e131rg6p.js} +1 -1
  42. package/web/{chunk-s2920f21.js → chunk-e8yj05t1.js} +1 -1
  43. package/web/chunk-ekw54h1q.js +1 -0
  44. package/web/{chunk-d6tbw8br.js → chunk-femhej5w.js} +1 -1
  45. package/web/{chunk-a7gtb4kg.js → chunk-geh05ghh.js} +1 -1
  46. package/web/{chunk-x5s7zr5f.js → chunk-gksf7cek.js} +1 -1
  47. package/web/{chunk-ht1dzftc.js → chunk-ht4mx2dt.js} +1 -1
  48. package/web/chunk-hwsvhst3.js +1 -0
  49. package/web/{chunk-q9ekgjh6.js → chunk-k02b36g1.js} +1 -1
  50. package/web/{chunk-rf9dt6bg.js → chunk-kjacapzd.js} +1 -1
  51. package/web/{chunk-gsh80797.js → chunk-kkfrs7d1.js} +1 -1
  52. package/web/{chunk-7kp237t3.js → chunk-kkyn8yhj.js} +1 -1
  53. package/web/chunk-mh4rx5cf.js +1 -0
  54. package/web/{chunk-9an6wcnr.js → chunk-n448vaba.js} +1 -1
  55. package/web/{chunk-vw1pbv1x.js → chunk-n754s8xd.js} +1 -1
  56. package/web/chunk-n8j88qxy.js +1 -0
  57. package/web/{chunk-kyawkpv2.js → chunk-nfvqjzz5.js} +1 -1
  58. package/web/{chunk-4r1n98zx.js → chunk-nmpbsvwb.js} +2 -2
  59. package/web/chunk-nws1s56b.js +1 -0
  60. package/web/{chunk-3zebd9fq.js → chunk-p7126wwy.js} +2 -2
  61. package/web/chunk-phnqnhj9.js +1 -0
  62. package/web/{chunk-g81h1e6n.js → chunk-pjz30xcp.js} +1 -1
  63. package/web/{chunk-0gg00f86.js → chunk-q3jevm51.js} +1 -1
  64. package/web/{chunk-v4yqrx5y.js → chunk-q97hn4j5.js} +1 -1
  65. package/web/chunk-qg31p6cn.js +1 -0
  66. package/web/{chunk-2bmq1whf.js → chunk-qhm3cfq9.js} +1 -1
  67. package/web/chunk-qsd595b9.js +1 -0
  68. package/web/{chunk-f5txt81n.js → chunk-r7frwjqx.js} +1 -1
  69. package/web/{chunk-j6a4z530.js → chunk-rddft5ce.js} +83 -83
  70. package/web/{chunk-296hgy6k.js → chunk-rgbdf2m9.js} +1 -1
  71. package/web/{chunk-64rafq66.js → chunk-rsbkbg6x.js} +1 -1
  72. package/web/{chunk-b985y17w.js → chunk-s2bs5vxh.js} +1 -1
  73. package/web/{chunk-g6k9z8zt.js → chunk-sgwccs54.js} +1 -1
  74. package/web/{chunk-mqsyzzgt.js → chunk-sjh8gtm9.js} +1 -1
  75. package/web/{chunk-hy4m34qp.js → chunk-sn3tkwme.js} +1 -1
  76. package/web/{chunk-t851gdjh.js → chunk-svh4n157.js} +1 -1
  77. package/web/{chunk-kegv14sg.js → chunk-t3658ehb.js} +1 -1
  78. package/web/{chunk-jve1zc80.js → chunk-t6sq85s6.js} +1 -1
  79. package/web/{chunk-vf4vkcf9.js → chunk-t81p4wqc.js} +1 -1
  80. package/web/{chunk-d4z2rgpx.js → chunk-tewmsd7t.js} +1 -1
  81. package/web/chunk-tf57s7ry.js +1 -0
  82. package/web/{chunk-12xxh71x.js → chunk-tfn0rqg9.js} +1 -1
  83. package/web/{chunk-3de552rg.js → chunk-tmndcktk.js} +1 -1
  84. package/web/chunk-tqr80b5w.js +2 -0
  85. package/web/{chunk-xvcfp1zh.js → chunk-tz4twwmw.js} +1 -1
  86. package/web/{chunk-sc0ghp25.js → chunk-v282r683.js} +1 -1
  87. package/web/chunk-v4vjjtn7.js +1 -0
  88. package/web/chunk-vbwdwcdp.js +1 -0
  89. package/web/{chunk-vtxw9rmr.js → chunk-vjngfh0q.js} +1 -1
  90. package/web/{chunk-30zfw7zg.js → chunk-wbgkwxrc.js} +1 -1
  91. package/web/{chunk-nywdeb4m.js → chunk-wjbk50hn.js} +1 -1
  92. package/web/chunk-wjy848e2.js +1 -0
  93. package/web/{chunk-3nbzj48p.js → chunk-wqsczy57.js} +1 -1
  94. package/web/chunk-wvfmmw1v.js +8 -0
  95. package/web/chunk-x1jm4zsg.js +1 -0
  96. package/web/{chunk-n1jpg57t.js → chunk-xbpc6x9m.js} +1 -1
  97. package/web/{chunk-zp3qrrkb.js → chunk-xckxtfp8.js} +1 -1
  98. package/web/{chunk-6kkw9ptc.js → chunk-xmsb2g71.js} +1 -1
  99. package/web/{chunk-czq1yz51.js → chunk-y99ed8rd.js} +1 -1
  100. package/web/index.html +1 -1
  101. package/web/chunk-0pecj6d7.js +0 -1
  102. package/web/chunk-0wt1dgny.js +0 -1
  103. package/web/chunk-1ves7sq5.js +0 -1
  104. package/web/chunk-1yj79b48.js +0 -1
  105. package/web/chunk-39ng8zwx.css +0 -1
  106. package/web/chunk-86p42kym.js +0 -1
  107. package/web/chunk-8n79cqyd.js +0 -1
  108. package/web/chunk-cwtn2kdm.js +0 -1
  109. package/web/chunk-dpkyygej.js +0 -1
  110. package/web/chunk-et5ess72.js +0 -1
  111. package/web/chunk-ez8b6neq.js +0 -1
  112. package/web/chunk-fd1kqwe3.js +0 -1
  113. package/web/chunk-hs5x78fb.js +0 -1
  114. package/web/chunk-hyd5hzpa.js +0 -1
  115. package/web/chunk-hyt1nkaw.js +0 -1
  116. package/web/chunk-kw9emsqw.js +0 -1
  117. package/web/chunk-pxkhm40r.js +0 -2
  118. package/web/chunk-r3mj50zs.js +0 -1
  119. package/web/chunk-t9mvsgt9.js +0 -1
  120. package/web/chunk-x19v2sxv.js +0 -1
  121. package/web/chunk-y21zy3eh.js +0 -1
  122. package/web/chunk-yd74yxzt.js +0 -8
  123. package/web/chunk-z4ha8181.js +0 -1
  124. package/web/chunk-z8rarqe6.js +0 -1
@@ -1,4 +1,4 @@
1
- import{e,a,l,I,Tt,go,yt,tn,At,Zn,nn}from"./chunk-5v44qv67.js";import{xe,Oe,Qe,Ee,dt,Gt,H,me,it,Ht,ot,ur,da,pa,ma,bn,Ct,fa,xn,$e,_n,Ft,St,wn,Yt,kn,ha,ga,dr,_e,ya,Cn,Zt,Sn,pr,mr,Xt,va,fr,ba,Ur,pt,hr,xa,_a,wa,Ge,gr,yr,Tn,ka,vr,f,Je,mt,we,Kt,te}from"./chunk-xvcfp1zh.js";import{la,ca,W,Fn,to,ua,cr}from"./chunk-b985y17w.js";import{Rt}from"./chunk-j6a4z530.js";var br={};Rt(br,{default:()=>rr});var co=/\s/;function po(r){var t=r.length;while(t--&&co.test(r.charAt(t)));return t}var ee=po;var lo=/^\s+/;function mo(r){return r?r.slice(0,ee(r)+1).replace(lo,""):r}var ne=mo;var oe=NaN,ho=/^[-+]0x[0-9a-f]+$/i,vo=/^0b[01]+$/i,bo=/^0o[0-7]+$/i,yo=parseInt;function wo(r){if(typeof r=="number")return r;if(dt(r))return oe;if(me(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=me(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=ne(r);var n=vo.test(r);return n||bo.test(r)?yo(r.slice(2),n?2:8):ho.test(r)?oe:+r}var ie=wo;var ae=1/0,_o=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function xo(r){if(!r)return r===0?r:0;if(r=ie(r),r===ae||r===-ae){var t=r<0?-1:1;return t*_o}return r===r?r:0}var V=xo;function Oo(r){var t=V(r),n=t%1;return t===t?n?t-n:t:0}var fe=Oo;var se=Object.create,Lo=function(){function r(){}return function(t){if(!me(t))return{};if(se)return se(t);r.prototype=t;var n=new r;return r.prototype=void 0,n}}(),ue=Lo;function Io(r,t){var n=-1,o=r.length;t||(t=Array(o));while(++n<o)t[n]=r[n];return t}var sr=Io;function No(r,t,n){if(t=="__proto__"&&ur)ur(r,t,{configurable:!0,enumerable:!0,value:n,writable:!0});else r[t]=n}var M=No;var Po=Object.prototype,ko=Po.hasOwnProperty;function Co(r,t,n){var o=r[t];if(!(ko.call(r,t)&&Ct(o,n))||n===void 0&&!(t in r))M(r,t,n)}var j=Co;function Ao(r,t,n,o){var i=!n;n||(n={});var s=-1,u=t.length;while(++s<u){var d=t[s],c=o?o(n[d],r[d],d,n,r):void 0;if(c===void 0)c=r[d];if(i)M(n,d,c);else j(n,d,c)}return n}var k=Ao;function Ro(r,t,n){if(!me(n))return!1;var o=typeof t;if(o=="number"?$e(n)&&bn(t,n.length):o=="string"&&(t in n))return Ct(n[t],r);return!1}var C=Ro;function Mo(r){return xn(function(t,n){var o=-1,i=n.length,s=i>1?n[i-1]:void 0,u=i>2?n[2]:void 0;if(s=r.length>3&&typeof s=="function"?(i--,s):void 0,u&&C(n[0],n[1],u))s=i<3?void 0:s,i=1;t=Object(t);while(++o<i){var d=n[o];if(d)r(t,d,o,s)}return t})}var de=Mo;function jo(r){var t=[];if(r!=null)for(var n in Object(r))t.push(n);return t}var ce=jo;var Bo=Object.prototype,Do=Bo.hasOwnProperty;function Fo(r){if(!me(r))return ce(r);var t=_n(r),n=[];for(var o in r)if(!(o=="constructor"&&(t||!Do.call(r,o))))n.push(o);return n}var pe=Fo;function Go(r){return $e(r)?ha(r,!0):pe(r)}var L=Go;function Xo(r){var t=r==null?0:r.length;return t?mr(r,1):[]}var N=Xo;function Uo(r){return da(fa(r,void 0,N),r+"")}var le=Uo;var Vo=ga(Object.getPrototypeOf,Object),Y=Vo;var Yo="[object Object]",zo=Function.prototype,Wo=Object.prototype,he=zo.toString,qo=Wo.hasOwnProperty,Ho=he.call(Object);function Ko(r){if(!Ee(r)||Qe(r)!=Yo)return!1;var t=Y(r);if(t===null)return!0;var n=qo.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&he.call(n)==Ho}var ge=Ko;var Jo="\\ud800-\\udfff",Zo="\\u0300-\\u036f",$o="\\ufe20-\\ufe2f",Qo="\\u20d0-\\u20ff",ri=Zo+$o+Qo,ei="\\ufe0e\\ufe0f",ti="\\u200d",ni=RegExp("["+ti+Jo+ri+ei+"]");function oi(r){return ni.test(r)}var ve=oi;function ii(r,t){return r&&k(t,_e(t),r)}var be=ii;function ai(r,t){return r&&k(t,L(t),r)}var ye=ai;var Ne=typeof br=="object"&&br&&!br.nodeType&&br,Le=Ne&&typeof lr=="object"&&lr&&!lr.nodeType&&lr,fi=Le&&Le.exports===Ne,Ie=fi?xe.Buffer:void 0,Se=Ie?Ie.allocUnsafe:void 0;function si(r,t){if(t)return r.slice();var n=r.length,o=Se?Se(n):new r.constructor(n);return r.copy(o),o}var rr=si;function ui(r,t){return k(r,fr(r),t)}var Pe=ui;var di=Object.getOwnPropertySymbols,ci=!di?va:function(r){var t=[];while(r)pr(t,fr(r)),r=Y(r);return t},wr=ci;function pi(r,t){return k(r,wr(r),t)}var ke=pi;function li(r){return ba(r,L,wr)}var Te=li;var mi=Object.prototype,hi=mi.hasOwnProperty;function gi(r){var t=r.length,n=new r.constructor(t);if(t&&typeof r[0]=="string"&&hi.call(r,"index"))n.index=r.index,n.input=r.input;return n}var Ce=gi;function vi(r){var t=new r.constructor(r.byteLength);return new hr(t).set(new hr(r)),t}var z=vi;function bi(r,t){var n=t?z(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.byteLength)}var Ae=bi;var yi=/\w*$/;function wi(r){var t=new r.constructor(r.source,yi.exec(r));return t.lastIndex=r.lastIndex,t}var Re=wi;var Me=Oe?Oe.prototype:void 0,je=Me?Me.valueOf:void 0;function _i(r){return je?Object(je.call(r)):{}}var Be=_i;function Ei(r,t){var n=t?z(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.length)}var _r=Ei;var xi="[object Boolean]",Oi="[object Date]",Li="[object Map]",Ii="[object Number]",Si="[object RegExp]",Ni="[object Set]",Pi="[object String]",ki="[object Symbol]",Ti="[object ArrayBuffer]",Ci="[object DataView]",Ai="[object Float32Array]",Ri="[object Float64Array]",Mi="[object Int8Array]",ji="[object Int16Array]",Bi="[object Int32Array]",Di="[object Uint8Array]",Fi="[object Uint8ClampedArray]",Gi="[object Uint16Array]",Xi="[object Uint32Array]";function Ui(r,t,n){var o=r.constructor;switch(t){case Ti:return z(r);case xi:case Oi:return new o(+r);case Ci:return Ae(r,n);case Ai:case Ri:case Mi:case ji:case Bi:case Di:case Fi:case Gi:case Xi:return _r(r,n);case Li:return new o;case Ii:case Pi:return new o(r);case Si:return Re(r);case Ni:return new o;case ki:return Be(r)}}var De=Ui;function Vi(r){return typeof r.constructor=="function"&&!_n(r)?ue(Y(r)):{}}var Er=Vi;var Yi="[object Map]";function zi(r){return Ee(r)&&pt(r)==Yi}var Fe=zi;var Xe=Yt&&Yt.isMap,Wi=Xe?wn(Xe):Fe,Ue=Wi;var qi="[object Set]";function Hi(r){return Ee(r)&&pt(r)==qi}var Ve=Hi;var Ye=Yt&&Yt.isSet,Ki=Ye?wn(Ye):Ve,ze=Ki;var Zi=1,$i=2,ra=4,We="[object Arguments]",ea="[object Array]",ta="[object Boolean]",na="[object Date]",oa="[object Error]",qe="[object Function]",ia="[object GeneratorFunction]",aa="[object Map]",sa="[object Number]",He="[object Object]",Ea="[object RegExp]",Oa="[object Set]",La="[object String]",Ia="[object Symbol]",Sa="[object WeakMap]",Na="[object ArrayBuffer]",Pa="[object DataView]",Ta="[object Float32Array]",Ca="[object Float64Array]",Aa="[object Int8Array]",Ra="[object Int16Array]",Ma="[object Int32Array]",ja="[object Uint8Array]",Ba="[object Uint8ClampedArray]",Da="[object Uint16Array]",Fa="[object Uint32Array]",x={};x[We]=x[ea]=x[Na]=x[Pa]=x[ta]=x[na]=x[Ta]=x[Ca]=x[Aa]=x[Ra]=x[Ma]=x[aa]=x[sa]=x[He]=x[Ea]=x[Oa]=x[La]=x[Ia]=x[ja]=x[Ba]=x[Da]=x[Fa]=!0;x[oa]=x[qe]=x[Sa]=!1;function xr(r,t,n,o,i,s){var u,d=t&Zi,c=t&$i,p=t&ra;if(n)u=i?n(r,o,i,s):n(r);if(u!==void 0)return u;if(!me(r))return r;var m=H(r);if(m){if(u=Ce(r),!d)return sr(r,u)}else{var h=pt(r),g=h==qe||h==ia;if(St(r))return rr(r,d);if(h==He||h==We||g&&!i){if(u=c||g?{}:Er(r),!d)return c?ke(r,ye(u,r)):Pe(r,be(u,r))}else{if(!x[h])return i?r:{};u=De(r,h,d)}}s||(s=new Xt);var b=s.get(r);if(b)return b;if(s.set(r,u),ze(r))r.forEach(function(v){u.add(xr(v,t,n,v,r,s))});else if(Ue(r))r.forEach(function(v,_){u.set(_,xr(v,t,n,_,r,s))});var w=p?c?Te:Ur:c?L:_e,y=m?void 0:w(r);return pa(y||r,function(v,_){if(y)_=v,v=r[_];j(u,_,xr(v,t,n,_,r,s))}),u}var Ke=xr;var Ga=1,Xa=4;function Ua(r){return Ke(r,Ga|Xa)}var Ze=Ua;var Va=function(){return xe.Date.now()},kr=Va;var rt=Object.prototype,Ya=rt.hasOwnProperty,za=xn(function(r,t){r=Object(r);var n=-1,o=t.length,i=o>2?t[2]:void 0;if(i&&C(t[0],t[1],i))o=1;while(++n<o){var s=t[n],u=L(s),d=-1,c=u.length;while(++d<c){var p=u[d],m=r[p];if(m===void 0||Ct(m,rt[p])&&!Ya.call(r,p))r[p]=s[p]}}return r}),et=za;function Wa(r,t,n){if(n!==void 0&&!Ct(r[t],n)||n===void 0&&!(t in r))M(r,t,n)}var er=Wa;function qa(r,t){if(t==="constructor"&&typeof r[t]==="function")return;if(t=="__proto__")return;return r[t]}var tr=qa;function Ha(r){return k(r,L(r))}var tt=Ha;function Ka(r,t,n,o,i,s,u){var d=tr(r,n),c=tr(t,n),p=u.get(c);if(p){er(r,n,p);return}var m=s?s(d,c,n+"",r,t,u):void 0,h=m===void 0;if(h){var g=H(c),b=!g&&St(c),w=!g&&!b&&kn(c);if(m=c,g||b||w)if(H(d))m=d;else if(ka(d))m=sr(d);else if(b)h=!1,m=rr(c,!0);else if(w)h=!1,m=_r(c,!0);else m=[];else if(ge(c)||Ft(c)){if(m=d,Ft(d))m=tt(d);else if(!me(d)||Ht(d))m=Er(c)}else h=!1}if(h)u.set(c,m),i(m,c,o,s,u),u.delete(c);er(r,n,m)}var nt=Ka;function at(r,t,n,o,i){if(r===t)return;gr(t,function(s,u){if(i||(i=new Xt),me(s))nt(r,t,u,n,at,o,i);else{var d=o?o(tr(r,u),s,u+"",r,t,i):void 0;if(d===void 0)d=s;er(r,u,d)}},L)}var ft=at;function Ja(r){var t=r==null?0:r.length;return t?r[t-1]:void 0}var X=Ja;function Za(r){return function(t,n,o){var i=Object(t);if(!$e(t)){var s=Ge(n,3);t=_e(t),n=function(d){return s(i[d],d,i)}}var u=r(t,n,o);return u>-1?i[s?t[u]:u]:void 0}}var st=Za;var $a=Math.max;function Qa(r,t,n){var o=r==null?0:r.length;if(!o)return-1;var i=n==null?0:fe(n);if(i<0)i=$a(o+i,0);return ma(r,Ge(t,3),i)}var ut=Qa;var rf=st(ut),nr=rf;function ef(r,t){var n=-1,o=$e(r)?Array(r.length):[];return Tn(r,function(i,s,u){o[++n]=t(i,s,u)}),o}var Or=ef;function tf(r,t){var n=H(r)?Gt:Or;return n(r,Ge(t,3))}var E=tf;function nf(r,t){return r==null?r:gr(r,vr(t),L)}var ct=nf;function of(r,t){return r&&yr(r,vr(t))}var lt=of;function af(r,t){return r>t}var ht=af;var ff=Object.prototype,sf=ff.hasOwnProperty;function uf(r,t){return r!=null&&sf.call(r,t)}var gt=uf;function df(r,t){return r!=null&&xa(r,t,gt)}var Lr=df;var cf="[object String]";function pf(r){return typeof r=="string"||!H(r)&&Ee(r)&&Qe(r)==cf}var vt=pf;function lf(r,t){return r<t}var Ir=lf;function mf(r,t){var n={};return t=Ge(t,3),yr(r,function(o,i,s){M(n,i,t(o,i,s))}),n}var q=mf;function hf(r,t,n){var o=-1,i=r.length;while(++o<i){var s=r[o],u=t(s);if(u!=null&&(d===void 0?u===u&&!dt(u):n(u,d)))var d=u,c=s}return c}var K=hf;function gf(r){return r&&r.length?K(r,it,ht):void 0}var S=gf;var vf=de(function(r,t,n){ft(r,t,n)}),or=vf;function bf(r){return r&&r.length?K(r,it,Ir):void 0}var B=bf;function yf(r,t){return r&&r.length?K(r,Ge(t,2),Ir):void 0}var J=yf;function wf(r,t,n,o){if(!me(r))return r;t=Cn(t,r);var i=-1,s=t.length,u=s-1,d=r;while(d!=null&&++i<s){var c=Zt(t[i]),p=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return r;if(i!=u){var m=d[c];if(p=o?o(m,c,d):void 0,p===void 0)p=me(m)?m:bn(t[i+1])?[]:{}}j(d,c,p),d=d[c]}return r}var bt=wf;function _f(r,t,n){var o=-1,i=t.length,s={};while(++o<i){var u=t[o],d=Sn(r,u);if(n(d,u))bt(s,Cn(u,r),d)}return s}var wt=_f;function Ef(r,t){var n=r.length;r.sort(t);while(n--)r[n]=r[n].value;return r}var _t=Ef;function xf(r,t){if(r!==t){var n=r!==void 0,o=r===null,i=r===r,s=dt(r),u=t!==void 0,d=t===null,c=t===t,p=dt(t);if(!d&&!p&&!s&&r>t||s&&u&&c&&!d&&!p||o&&u&&c||!n&&c||!i)return 1;if(!o&&!s&&!p&&r<t||p&&n&&i&&!o&&!s||d&&n&&i||!u&&i||!c)return-1}return 0}var Et=xf;function Of(r,t,n){var o=-1,i=r.criteria,s=t.criteria,u=i.length,d=n.length;while(++o<u){var c=Et(i[o],s[o]);if(c){if(o>=d)return c;var p=n[o];return c*(p=="desc"?-1:1)}}return r.index-t.index}var xt=Of;function Lf(r,t,n){if(t.length)t=Gt(t,function(s){if(H(s))return function(u){return Sn(u,s.length===1?s[0]:s)};return s});else t=[it];var o=-1;t=Gt(t,wn(Ge));var i=Or(r,function(s,u,d){var c=Gt(t,function(p){return p(s)});return{criteria:c,index:++o,value:s}});return _t(i,function(s,u){return xt(s,u,n)})}var Ot=Lf;var If=wa("length"),Lt=If;var Nt="\\ud800-\\udfff",Sf="\\u0300-\\u036f",Nf="\\ufe20-\\ufe2f",Pf="\\u20d0-\\u20ff",kf=Sf+Nf+Pf,Tf="\\ufe0e\\ufe0f",Cf="["+Nt+"]",Tr="["+kf+"]",Cr="\\ud83c[\\udffb-\\udfff]",Af="(?:"+Tr+"|"+Cr+")",Pt="[^"+Nt+"]",kt="(?:\\ud83c[\\udde6-\\uddff]){2}",Mt="[\\ud800-\\udbff][\\udc00-\\udfff]",Rf="\\u200d",jt=Af+"?",Bt="["+Tf+"]?",Mf="(?:"+Rf+"(?:"+[Pt,kt,Mt].join("|")+")"+Bt+jt+")*",jf=Bt+jt+Mf,Bf="(?:"+[Pt+Tr+"?",Tr,kt,Mt,Cf].join("|")+")",It=RegExp(Cr+"(?="+Cr+")|"+Bf+jf,"g");function Df(r){var t=It.lastIndex=0;while(It.test(r))++t;return t}var Dt=Df;function Ff(r){return ve(r)?Dt(r):Lt(r)}var Ut=Ff;function Gf(r,t){return wt(r,t,function(n,o){return _a(r,o)})}var Vt=Gf;var Xf=le(function(r,t){return r==null?{}:Vt(r,t)}),Z=Xf;var{ceil:Uf,max:Vf}=Math;function Yf(r,t,n,o){var i=-1,s=Vf(Uf((t-r)/(n||1)),0),u=Array(s);while(s--)u[o?s:++i]=r,r+=n;return u}var zt=Yf;function zf(r){return function(t,n,o){if(o&&typeof o!="number"&&C(t,n,o))n=o=void 0;if(t=V(t),n===void 0)n=t,t=0;else n=V(n);return o=o===void 0?t<n?1:-1:V(o),zt(t,n,o,r)}}var Wt=zf;var Wf=Wt(),P=Wf;var qf="[object Map]",Hf="[object Set]";function Kf(r){if(r==null)return 0;if($e(r))return vt(r)?Ut(r):r.length;var t=pt(r);if(t==qf||t==Hf)return r.size;return dr(r).length}var qt=Kf;var Jf=xn(function(r,t){if(r==null)return[];var n=t.length;if(n>1&&C(r,t[0],t[1]))t=[];else if(n>2&&C(t[0],t[1],t[2]))t=[t[0]];return Ot(r,mr(t,1),[])}),A=Jf;var Zf=0;function $f(r){var t=++Zf;return ya(r)+t}var Q=$f;function Qf(r,t,n){var o=-1,i=r.length,s=t.length,u={};while(++o<i){var d=o<s?t[o]:void 0;n(u,r[o],d)}return u}var Jt=Qf;function rs(r,t){return Jt(r||[],t||[],j)}var Ar=rs;class Rr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,t=r._prev;if(t!==r)return $t(t),t}enqueue(r){var t=this._sentinel;if(r._prev&&r._next)$t(r);r._next=t._next,t._next._prev=r,t._next=r,r._prev=t}toString(){var r=[],t=this._sentinel,n=t._prev;while(n!==t)r.push(JSON.stringify(n,es)),n=n._prev;return"["+r.join(", ")+"]"}}function $t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function es(r,t){if(r!=="_next"&&r!=="_prev")return t}var ts=ot(1);function Qt(r,t){if(r.nodeCount()<=1)return[];var n=os(r,t||ts),o=ns(n.graph,n.buckets,n.zeroIdx);return N(E(o,function(i){return r.outEdges(i.v,i.w)}))}function ns(r,t,n){var o=[],i=t[t.length-1],s=t[0],u;while(r.nodeCount()){while(u=s.dequeue())Mr(r,t,n,u);while(u=i.dequeue())Mr(r,t,n,u);if(r.nodeCount()){for(var d=t.length-2;d>0;--d)if(u=t[d].dequeue(),u){o=o.concat(Mr(r,t,n,u,!0));break}}}return o}function Mr(r,t,n,o,i){var s=i?[]:void 0;return f(r.inEdges(o.v),function(u){var d=r.edge(u),c=r.node(u.v);if(i)s.push({v:u.v,w:u.w});c.out-=d,jr(t,n,c)}),f(r.outEdges(o.v),function(u){var d=r.edge(u),c=u.w,p=r.node(c);p.in-=d,jr(t,n,p)}),r.removeNode(o.v),s}function os(r,t){var n=new te,o=0,i=0;f(r.nodes(),function(d){n.setNode(d,{v:d,in:0,out:0})}),f(r.edges(),function(d){var c=n.edge(d.v,d.w)||0,p=t(d),m=c+p;n.setEdge(d.v,d.w,m),i=Math.max(i,n.node(d.v).out+=p),o=Math.max(o,n.node(d.w).in+=p)});var s=P(i+o+3).map(function(){return new Rr}),u=o+1;return f(n.nodes(),function(d){jr(s,u,n.node(d))}),{graph:n,buckets:s,zeroIdx:u}}function jr(r,t,n){if(!n.out)r[0].enqueue(n);else if(!n.in)r[r.length-1].enqueue(n);else r[n.out-n.in+t].enqueue(n)}function rn(r){var t=r.graph().acyclicer==="greedy"?Qt(r,n(r)):is(r);f(t,function(o){var i=r.edge(o);r.removeEdge(o),i.forwardName=o.name,i.reversed=!0,r.setEdge(o.w,o.v,i,Q("rev"))});function n(o){return function(i){return o.edge(i).weight}}}function is(r){var t=[],n={},o={};function i(s){if(Object.prototype.hasOwnProperty.call(o,s))return;o[s]=!0,n[s]=!0,f(r.outEdges(s),function(u){if(Object.prototype.hasOwnProperty.call(n,u.w))t.push(u);else i(u.w)}),delete n[s]}return f(r.nodes(),i),t}function en(r){f(r.edges(),function(t){var n=r.edge(t);if(n.reversed){r.removeEdge(t);var o=n.forwardName;delete n.reversed,delete n.forwardName,r.setEdge(t.w,t.v,n,o)}})}function T(r,t,n,o){var i;do i=Q(o);while(r.hasNode(i));return n.dummy=t,r.setNode(i,n),i}function an(r){var t=new te().setGraph(r.graph());return f(r.nodes(),function(n){t.setNode(n,r.node(n))}),f(r.edges(),function(n){var o=t.edge(n.v,n.w)||{weight:0,minlen:1},i=r.edge(n);t.setEdge(n.v,n.w,{weight:o.weight+i.weight,minlen:Math.max(o.minlen,i.minlen)})}),t}function Sr(r){var t=new te({multigraph:r.isMultigraph()}).setGraph(r.graph());return f(r.nodes(),function(n){if(!r.children(n).length)t.setNode(n,r.node(n))}),f(r.edges(),function(n){t.setEdge(n,r.edge(n))}),t}function Br(r,t){var{x:n,y:o}=r,i=t.x-n,s=t.y-o,u=r.width/2,d=r.height/2;if(!i&&!s)throw Error("Not possible to find intersection inside of the rectangle");var c,p;if(Math.abs(s)*u>Math.abs(i)*d){if(s<0)d=-d;c=d*i/s,p=d}else{if(i<0)u=-u;c=u,p=u*s/i}return{x:n+c,y:o+p}}function D(r){var t=E(P(Fr(r)+1),function(){return[]});return f(r.nodes(),function(n){var o=r.node(n),i=o.rank;if(!we(i))t[i][o.order]=n}),t}function fn(r){var t=B(E(r.nodes(),function(n){return r.node(n).rank}));f(r.nodes(),function(n){var o=r.node(n);if(Lr(o,"rank"))o.rank-=t})}function sn(r){var t=B(E(r.nodes(),function(s){return r.node(s).rank})),n=[];f(r.nodes(),function(s){var u=r.node(s).rank-t;if(!n[u])n[u]=[];n[u].push(s)});var o=0,i=r.graph().nodeRankFactor;f(n,function(s,u){if(we(s)&&u%i!==0)--o;else if(o)f(s,function(d){r.node(d).rank+=o})})}function Dr(r,t,n,o){var i={width:0,height:0};if(arguments.length>=4)i.rank=n,i.order=o;return T(r,"border",i,t)}function Fr(r){return S(E(r.nodes(),function(t){var n=r.node(t).rank;if(!we(n))return n}))}function un(r,t){var n={lhs:[],rhs:[]};return f(r,function(o){if(t(o))n.lhs.push(o);else n.rhs.push(o)}),n}function dn(r,t){var n=kr();try{return t()}finally{console.log(r+" time: "+(kr()-n)+"ms")}}function cn(r,t){return t()}function ln(r){function t(n){var o=r.children(n),i=r.node(n);if(o.length)f(o,t);if(Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,u=i.maxRank+1;s<u;++s)pn(r,"borderLeft","_bl",n,i,s),pn(r,"borderRight","_br",n,i,s)}}f(r.children(),t)}function pn(r,t,n,o,i,s){var u={width:0,height:0,rank:s,borderType:t},d=i[t][s-1],c=T(r,"border",u,n);if(i[t][s]=c,r.setParent(c,o),d)r.setEdge(d,c,{weight:1})}function hn(r){var t=r.graph().rankdir.toLowerCase();if(t==="lr"||t==="rl")vn(r)}function gn(r){var t=r.graph().rankdir.toLowerCase();if(t==="bt"||t==="rl")as(r);if(t==="lr"||t==="rl")fs(r),vn(r)}function vn(r){f(r.nodes(),function(t){mn(r.node(t))}),f(r.edges(),function(t){mn(r.edge(t))})}function mn(r){var t=r.width;r.width=r.height,r.height=t}function as(r){f(r.nodes(),function(t){Gr(r.node(t))}),f(r.edges(),function(t){var n=r.edge(t);if(f(n.points,Gr),Object.prototype.hasOwnProperty.call(n,"y"))Gr(n)})}function Gr(r){r.y=-r.y}function fs(r){f(r.nodes(),function(t){Xr(r.node(t))}),f(r.edges(),function(t){var n=r.edge(t);if(f(n.points,Xr),Object.prototype.hasOwnProperty.call(n,"x"))Xr(n)})}function Xr(r){var t=r.x;r.x=r.y,r.y=t}function yn(r){r.graph().dummyChains=[],f(r.edges(),function(t){us(r,t)})}function us(r,t){var n=t.v,o=r.node(n).rank,i=t.w,s=r.node(i).rank,u=t.name,d=r.edge(t),c=d.labelRank;if(s===o+1)return;r.removeEdge(t);var p=void 0,m,h;for(h=0,++o;o<s;++h,++o){if(d.points=[],p={width:0,height:0,edgeLabel:d,edgeObj:t,rank:o},m=T(r,"edge",p,"_d"),o===c)p.width=d.width,p.height=d.height,p.dummy="edge-label",p.labelpos=d.labelpos;if(r.setEdge(n,m,{weight:d.weight},u),h===0)r.graph().dummyChains.push(m);n=m}r.setEdge(n,i,{weight:d.weight},u)}function En(r){f(r.graph().dummyChains,function(t){var n=r.node(t),o=n.edgeLabel,i;r.setEdge(n.edgeObj,o);while(n.dummy){if(i=r.successors(t)[0],r.removeNode(t),o.points.push({x:n.x,y:n.y}),n.dummy==="edge-label")o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height;t=i,n=r.node(t)}})}function ir(r){var t={};function n(o){var i=r.node(o);if(Object.prototype.hasOwnProperty.call(t,o))return i.rank;t[o]=!0;var s=B(E(r.outEdges(o),function(u){return n(u.w)-r.edge(u).minlen}));if(s===Number.POSITIVE_INFINITY||s===void 0||s===null)s=0;return i.rank=s}f(r.sources(),n)}function U(r,t){return r.node(t.w).rank-r.node(t.v).rank-r.edge(t).minlen}function Nr(r){var t=new te({directed:!1}),n=r.nodes()[0],o=r.nodeCount();t.setNode(n,{});var i,s;while(ds(t,r)<o)i=cs(t,r),s=t.hasNode(i.v)?U(r,i):-U(r,i),ps(t,r,s);return t}function ds(r,t){function n(o){f(t.nodeEdges(o),function(i){var s=i.v,u=o===s?i.w:s;if(!r.hasNode(u)&&!U(t,i))r.setNode(u,{}),r.setEdge(o,u,{}),n(u)})}return f(r.nodes(),n),r.nodeCount()}function cs(r,t){return J(t.edges(),function(n){if(r.hasNode(n.v)!==r.hasNode(n.w))return U(t,n)})}function ps(r,t,n){f(r.nodes(),function(o){t.node(o).rank+=n})}var dh=ot(1);var vh=ot(1);Vr.CycleException=ar;function Vr(r){var t={},n={},o=[];function i(s){if(Object.prototype.hasOwnProperty.call(n,s))throw new ar;if(!Object.prototype.hasOwnProperty.call(t,s))n[s]=!0,t[s]=!0,f(r.predecessors(s),i),delete n[s],o.push(s)}if(f(r.sinks(),i),qt(t)!==r.nodeCount())throw new ar;return o}function ar(){}ar.prototype=Error();function Pr(r,t,n){if(!H(t))t=[t];var o=(r.isDirected()?r.successors:r.neighbors).bind(r),i=[],s={};return f(t,function(u){if(!r.hasNode(u))throw Error("Graph does not have node: "+u);Ln(r,u,n==="post",s,o,i)}),i}function Ln(r,t,n,o,i,s){if(!Object.prototype.hasOwnProperty.call(o,t)){if(o[t]=!0,!n)s.push(t);if(f(i(t),function(u){Ln(r,u,n,o,i,s)}),n)s.push(t)}}function Yr(r,t){return Pr(r,t,"post")}function zr(r,t){return Pr(r,t,"pre")}G.initLowLimValues=qr;G.initCutValues=Wr;G.calcCutValue=Nn;G.leaveEdge=An;G.enterEdge=Rn;G.exchangeEdges=Mn;function G(r){r=an(r),ir(r);var t=Nr(r);qr(t),Wr(t,r);var n,o;while(n=An(t))o=Rn(t,r,n),Mn(t,r,n,o)}function Wr(r,t){var n=Yr(r,r.nodes());n=n.slice(0,n.length-1),f(n,function(o){vs(r,t,o)})}function vs(r,t,n){var o=r.node(n),i=o.parent;r.edge(n,i).cutvalue=Nn(r,t,n)}function Nn(r,t,n){var o=r.node(n),i=o.parent,s=!0,u=t.edge(n,i),d=0;if(!u)s=!1,u=t.edge(i,n);return d=u.weight,f(t.nodeEdges(n),function(c){var p=c.v===n,m=p?c.w:c.v;if(m!==i){var h=p===s,g=t.edge(c).weight;if(d+=h?g:-g,ys(r,n,m)){var b=r.edge(n,m).cutvalue;d+=h?-b:b}}}),d}function qr(r,t){if(arguments.length<2)t=r.nodes()[0];Pn(r,{},1,t)}function Pn(r,t,n,o,i){var s=n,u=r.node(o);if(t[o]=!0,f(r.neighbors(o),function(d){if(!Object.prototype.hasOwnProperty.call(t,d))n=Pn(r,t,n,d,o)}),u.low=s,u.lim=n++,i)u.parent=i;else delete u.parent;return n}function An(r){return nr(r.edges(),function(t){return r.edge(t).cutvalue<0})}function Rn(r,t,n){var{v:o,w:i}=n;if(!t.hasEdge(o,i))o=n.w,i=n.v;var s=r.node(o),u=r.node(i),d=s,c=!1;if(s.lim>u.lim)d=u,c=!0;var p=Je(t.edges(),function(m){return c===In(r,r.node(m.v),d)&&c!==In(r,r.node(m.w),d)});return J(p,function(m){return U(t,m)})}function Mn(r,t,n,o){var{v:i,w:s}=n;r.removeEdge(i,s),r.setEdge(o.v,o.w,{}),qr(r),Wr(r,t),bs(r,t)}function bs(r,t){var n=nr(r.nodes(),function(i){return!t.node(i).parent}),o=zr(r,n);o=o.slice(1),f(o,function(i){var s=r.node(i).parent,u=t.edge(i,s),d=!1;if(!u)u=t.edge(s,i),d=!0;t.node(i).rank=t.node(s).rank+(d?u.minlen:-u.minlen)})}function ys(r,t,n){return r.hasEdge(t,n)}function In(r,t,n){return n.low<=t.lim&&t.lim<=n.lim}function Hr(r){switch(r.graph().ranker){case"network-simplex":jn(r);break;case"tight-tree":_s(r);break;case"longest-path":ws(r);break;default:jn(r)}}var ws=ir;function _s(r){ir(r),Nr(r)}function jn(r){G(r)}function Bn(r){var t=T(r,"root",{},"_root"),n=Es(r),o=S(mt(n))-1,i=2*o+1;r.graph().nestingRoot=t,f(r.edges(),function(u){r.edge(u).minlen*=i});var s=xs(r)+1;f(r.children(),function(u){Dn(r,t,i,s,o,n,u)}),r.graph().nodeRankFactor=i}function Dn(r,t,n,o,i,s,u){var d=r.children(u);if(!d.length){if(u!==t)r.setEdge(t,u,{weight:0,minlen:n});return}var c=Dr(r,"_bt"),p=Dr(r,"_bb"),m=r.node(u);if(r.setParent(c,u),m.borderTop=c,r.setParent(p,u),m.borderBottom=p,f(d,function(h){Dn(r,t,n,o,i,s,h);var g=r.node(h),b=g.borderTop?g.borderTop:h,w=g.borderBottom?g.borderBottom:h,y=g.borderTop?o:2*o,v=b!==w?1:i-s[u]+1;r.setEdge(c,b,{weight:y,minlen:v,nestingEdge:!0}),r.setEdge(w,p,{weight:y,minlen:v,nestingEdge:!0})}),!r.parent(u))r.setEdge(t,c,{weight:0,minlen:i+s[u]})}function Es(r){var t={};function n(o,i){var s=r.children(o);if(s&&s.length)f(s,function(u){n(u,i+1)});t[o]=i}return f(r.children(),function(o){n(o,1)}),t}function xs(r){return Kt(r.edges(),function(t,n){return t+r.edge(n).weight},0)}function Gn(r){var t=r.graph();r.removeNode(t.nestingRoot),delete t.nestingRoot,f(r.edges(),function(n){var o=r.edge(n);if(o.nestingEdge)r.removeEdge(n)})}function Xn(r,t,n){var o={},i;f(n,function(s){var u=r.parent(s),d,c;while(u){if(d=r.parent(u),d)c=o[d],o[d]=u;else c=i,i=u;if(c&&c!==u){t.setEdge(c,u);return}u=d}})}function Un(r,t,n){var o=Ls(r),i=new te({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(s){return r.node(s)});return f(r.nodes(),function(s){var u=r.node(s),d=r.parent(s);if(u.rank===t||u.minRank<=t&&t<=u.maxRank){if(i.setNode(s),i.setParent(s,d||o),f(r[n](s),function(c){var p=c.v===s?c.w:c.v,m=i.edge(p,s),h=!we(m)?m.weight:0;i.setEdge(p,s,{weight:r.edge(c).weight+h})}),Object.prototype.hasOwnProperty.call(u,"minRank"))i.setNode(s,{borderLeft:u.borderLeft[t],borderRight:u.borderRight[t]})}}),i}function Ls(r){var t;while(r.hasNode(t=Q("_root")));return t}function Vn(r,t){var n=0;for(var o=1;o<t.length;++o)n+=Is(r,t[o-1],t[o]);return n}function Is(r,t,n){var o=Ar(n,E(n,function(p,m){return m})),i=N(E(t,function(p){return A(E(r.outEdges(p),function(m){return{pos:o[m.w],weight:r.edge(m).weight}}),"pos")})),s=1;while(s<n.length)s<<=1;var u=2*s-1;s-=1;var d=E(Array(u),function(){return 0}),c=0;return f(i.forEach(function(p){var m=p.pos+s;d[m]+=p.weight;var h=0;while(m>0){if(m%2)h+=d[m+1];m=m-1>>1,d[m]+=p.weight}c+=p.weight*h})),c}function Yn(r){var t={},n=Je(r.nodes(),function(d){return!r.children(d).length}),o=S(E(n,function(d){return r.node(d).rank})),i=E(P(o+1),function(){return[]});function s(d){if(Lr(t,d))return;t[d]=!0;var c=r.node(d);i[c.rank].push(d),f(r.successors(d),s)}var u=A(n,function(d){return r.node(d).rank});return f(u,s),i}function zn(r,t){return E(t,function(n){var o=r.inEdges(n);if(!o.length)return{v:n};else{var i=Kt(o,function(s,u){var d=r.edge(u),c=r.node(u.v);return{sum:s.sum+d.weight*c.order,weight:s.weight+d.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}})}function Wn(r,t){var n={};f(r,function(i,s){var u=n[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:s};if(!we(i.barycenter))u.barycenter=i.barycenter,u.weight=i.weight}),f(t.edges(),function(i){var s=n[i.v],u=n[i.w];if(!we(s)&&!we(u))u.indegree++,s.out.push(n[i.w])});var o=Je(n,function(i){return!i.indegree});return Ss(o)}function Ss(r){var t=[];function n(s){return function(u){if(u.merged)return;if(we(u.barycenter)||we(s.barycenter)||u.barycenter>=s.barycenter)Ns(s,u)}}function o(s){return function(u){if(u.in.push(s),--u.indegree===0)r.push(u)}}while(r.length){var i=r.pop();t.push(i),f(i.in.reverse(),n(i)),f(i.out,o(i))}return E(Je(t,function(s){return!s.merged}),function(s){return Z(s,["vs","i","barycenter","weight"])})}function Ns(r,t){var n=0,o=0;if(r.weight)n+=r.barycenter*r.weight,o+=r.weight;if(t.weight)n+=t.barycenter*t.weight,o+=t.weight;r.vs=t.vs.concat(r.vs),r.barycenter=n/o,r.weight=o,r.i=Math.min(t.i,r.i),t.merged=!0}function Hn(r,t){var n=un(r,function(m){return Object.prototype.hasOwnProperty.call(m,"barycenter")}),o=n.lhs,i=A(n.rhs,function(m){return-m.i}),s=[],u=0,d=0,c=0;o.sort(Ps(!!t)),c=qn(s,i,c),f(o,function(m){c+=m.vs.length,s.push(m.vs),u+=m.barycenter*m.weight,d+=m.weight,c=qn(s,i,c)});var p={vs:N(s)};if(d)p.barycenter=u/d,p.weight=d;return p}function qn(r,t,n){var o;while(t.length&&(o=X(t)).i<=n)t.pop(),r.push(o.vs),n++;return n}function Ps(r){return function(t,n){if(t.barycenter<n.barycenter)return-1;else if(t.barycenter>n.barycenter)return 1;return!r?t.i-n.i:n.i-t.i}}function Kr(r,t,n,o){var i=r.children(t),s=r.node(t),u=s?s.borderLeft:void 0,d=s?s.borderRight:void 0,c={};if(u)i=Je(i,function(w){return w!==u&&w!==d});var p=zn(r,i);f(p,function(w){if(r.children(w.v).length){var y=Kr(r,w.v,n,o);if(c[w.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter"))Ts(w,y)}});var m=Wn(p,n);ks(m,c);var h=Hn(m,o);if(u){if(h.vs=N([u,h.vs,d]),r.predecessors(u).length){var g=r.node(r.predecessors(u)[0]),b=r.node(r.predecessors(d)[0]);if(!Object.prototype.hasOwnProperty.call(h,"barycenter"))h.barycenter=0,h.weight=0;h.barycenter=(h.barycenter*h.weight+g.order+b.order)/(h.weight+2),h.weight+=2}}return h}function ks(r,t){f(r,function(n){n.vs=N(n.vs.map(function(o){if(t[o])return t[o].vs;return o}))})}function Ts(r,t){if(!we(r.barycenter))r.barycenter=(r.barycenter*r.weight+t.barycenter*t.weight)/(r.weight+t.weight),r.weight+=t.weight;else r.barycenter=t.barycenter,r.weight=t.weight}function $n(r){var t=Fr(r),n=Kn(r,P(1,t+1),"inEdges"),o=Kn(r,P(t-1,-1,-1),"outEdges"),i=Yn(r);Jn(r,i);var s=Number.POSITIVE_INFINITY,u;for(var d=0,c=0;c<4;++d,++c){Cs(d%2?n:o,d%4>=2),i=D(r);var p=Vn(r,i);if(p<s)c=0,u=Ze(i),s=p}Jn(r,u)}function Kn(r,t,n){return E(t,function(o){return Un(r,o,n)})}function Cs(r,t){var n=new te;f(r,function(o){var i=o.graph().root,s=Kr(o,i,n,t);f(s.vs,function(u,d){o.node(u).order=d}),Xn(o,n,s.vs)})}function Jn(r,t){f(t,function(n){f(n,function(o,i){r.node(o).order=i})})}function Qn(r){var t=Rs(r);f(r.graph().dummyChains,function(n){var o=r.node(n),i=o.edgeObj,s=As(r,t,i.v,i.w),{path:u,lca:d}=s,c=0,p=u[c],m=!0;while(n!==i.w){if(o=r.node(n),m){while((p=u[c])!==d&&r.node(p).maxRank<o.rank)c++;if(p===d)m=!1}if(!m){while(c<u.length-1&&r.node(p=u[c+1]).minRank<=o.rank)c++;p=u[c]}r.setParent(n,p),n=r.successors(n)[0]}})}function As(r,t,n,o){var i=[],s=[],u=Math.min(t[n].low,t[o].low),d=Math.max(t[n].lim,t[o].lim),c,p;c=n;do c=r.parent(c),i.push(c);while(c&&(t[c].low>u||d>t[c].lim));p=c,c=o;while((c=r.parent(c))!==p)s.push(c);return{path:i.concat(s.reverse()),lca:p}}function Rs(r){var t={},n=0;function o(i){var s=n;f(r.children(i),o),t[i]={low:s,lim:n++}}return f(r.children(),o),t}function Ms(r,t){var n={};function o(i,s){var u=0,d=0,c=i.length,p=X(s);return f(s,function(m,h){var g=Bs(r,m),b=g?r.node(g).order:c;if(g||m===p)f(s.slice(d,h+1),function(w){f(r.predecessors(w),function(y){var v=r.node(y),_=v.order;if((_<u||b<_)&&!(v.dummy&&r.node(w).dummy))ro(n,y,w)})}),d=h+1,u=b}),s}return Kt(t,o),n}function js(r,t){var n={};function o(s,u,d,c,p){var m;f(P(u,d),function(h){if(m=s[h],r.node(m).dummy)f(r.predecessors(m),function(g){var b=r.node(g);if(b.dummy&&(b.order<c||b.order>p))ro(n,g,m)})})}function i(s,u){var d=-1,c,p=0;return f(u,function(m,h){if(r.node(m).dummy==="border"){var g=r.predecessors(m);if(g.length)c=r.node(g[0]).order,o(u,p,h,d,c),p=h,d=c}o(u,p,u.length,c,s.length)}),u}return Kt(t,i),n}function Bs(r,t){if(r.node(t).dummy)return nr(r.predecessors(t),function(n){return r.node(n).dummy})}function ro(r,t,n){if(t>n){var o=t;t=n,n=o}if(!Object.prototype.hasOwnProperty.call(r,t))Object.defineProperty(r,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=r[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ds(r,t,n){if(t>n){var o=t;t=n,n=o}return!!r[t]&&Object.prototype.hasOwnProperty.call(r[t],n)}function Fs(r,t,n,o){var i={},s={},u={};return f(t,function(d){f(d,function(c,p){i[c]=c,s[c]=c,u[c]=p})}),f(t,function(d){var c=-1;f(d,function(p){var m=o(p);if(m.length){m=A(m,function(y){return u[y]});var h=(m.length-1)/2;for(var g=Math.floor(h),b=Math.ceil(h);g<=b;++g){var w=m[g];if(s[p]===p&&c<u[w]&&!Ds(n,p,w))s[w]=p,s[p]=i[p]=i[w],c=u[w]}}})}),{root:i,align:s}}function Gs(r,t,n,o,i){var s={},u=Xs(r,t,n,i),d=i?"borderLeft":"borderRight";function c(h,g){var b=u.nodes(),w=b.pop(),y={};while(w){if(y[w])h(w);else y[w]=!0,b.push(w),b=b.concat(g(w));w=b.pop()}}function p(h){s[h]=u.inEdges(h).reduce(function(g,b){return Math.max(g,s[b.v]+u.edge(b))},0)}function m(h){var g=u.outEdges(h).reduce(function(w,y){return Math.min(w,s[y.w]-u.edge(y))},Number.POSITIVE_INFINITY),b=r.node(h);if(g!==Number.POSITIVE_INFINITY&&b.borderType!==d)s[h]=Math.max(s[h],g)}return c(p,u.predecessors.bind(u)),c(m,u.successors.bind(u)),f(o,function(h){s[h]=s[n[h]]}),s}function Xs(r,t,n,o){var i=new te,s=r.graph(),u=zs(s.nodesep,s.edgesep,o);return f(t,function(d){var c;f(d,function(p){var m=n[p];if(i.setNode(m),c){var h=n[c],g=i.edge(h,m);i.setEdge(h,m,Math.max(u(r,p,c),g||0))}c=p})}),i}function Us(r,t){return J(mt(t),function(n){var{NEGATIVE_INFINITY:o,POSITIVE_INFINITY:i}=Number;return ct(n,function(s,u){var d=Ws(r,u)/2;o=Math.max(s+d,o),i=Math.min(s-d,i)}),o-i})}function Vs(r,t){var n=mt(t),o=B(n),i=S(n);f(["u","d"],function(s){f(["l","r"],function(u){var d=s+u,c=r[d],p;if(c===t)return;var m=mt(c);if(p=u==="l"?o-B(m):i-S(m),p)r[d]=q(c,function(h){return h+p})})})}function Ys(r,t){return q(r.ul,function(n,o){if(t)return r[t.toLowerCase()][o];else{var i=A(E(r,o));return(i[1]+i[2])/2}})}function no(r){var t=D(r),n=or(Ms(r,t),js(r,t)),o={},i;f(["u","d"],function(u){i=u==="u"?t:mt(t).reverse(),f(["l","r"],function(d){if(d==="r")i=E(i,function(h){return mt(h).reverse()});var c=(u==="u"?r.predecessors:r.successors).bind(r),p=Fs(r,i,n,c),m=Gs(r,i,p.root,p.align,d==="r");if(d==="r")m=q(m,function(h){return-h});o[u+d]=m})});var s=Us(r,o);return Vs(o,s),Ys(o,r.graph().align)}function zs(r,t,n){return function(o,i,s){var u=o.node(i),d=o.node(s),c=0,p;if(c+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":p=-u.width/2;break;case"r":p=u.width/2;break}if(p)c+=n?p:-p;if(p=0,c+=(u.dummy?t:r)/2,c+=(d.dummy?t:r)/2,c+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":p=d.width/2;break;case"r":p=-d.width/2;break}if(p)c+=n?p:-p;return p=0,c}}function Ws(r,t){return r.node(t).width}function oo(r){r=Sr(r),qs(r),lt(no(r),function(t,n){r.node(n).x=t})}function qs(r){var t=D(r),n=r.graph().ranksep,o=0;f(t,function(i){var s=S(E(i,function(u){return r.node(u).height}));f(i,function(u){r.node(u).y=o+s/2}),o+=s+n})}function $r(r,t){var n=t&&t.debugTiming?dn:cn;n("layout",()=>{var o=n(" buildLayoutGraph",()=>ou(r));n(" runLayout",()=>Hs(o,n)),n(" updateInputGraph",()=>Ks(r,o))})}function Hs(r,t){t(" makeSpaceForEdgeLabels",()=>iu(r)),t(" removeSelfEdges",()=>mu(r)),t(" acyclic",()=>rn(r)),t(" nestingGraph.run",()=>Bn(r)),t(" rank",()=>Hr(Sr(r))),t(" injectEdgeLabelProxies",()=>au(r)),t(" removeEmptyRanks",()=>sn(r)),t(" nestingGraph.cleanup",()=>Gn(r)),t(" normalizeRanks",()=>fn(r)),t(" assignRankMinMax",()=>fu(r)),t(" removeEdgeLabelProxies",()=>su(r)),t(" normalize.run",()=>yn(r)),t(" parentDummyChains",()=>Qn(r)),t(" addBorderSegments",()=>ln(r)),t(" order",()=>$n(r)),t(" insertSelfEdges",()=>hu(r)),t(" adjustCoordinateSystem",()=>hn(r)),t(" position",()=>oo(r)),t(" positionSelfEdges",()=>gu(r)),t(" removeBorderNodes",()=>lu(r)),t(" normalize.undo",()=>En(r)),t(" fixupEdgeLabelCoords",()=>cu(r)),t(" undoCoordinateSystem",()=>gn(r)),t(" translateGraph",()=>uu(r)),t(" assignNodeIntersects",()=>du(r)),t(" reversePoints",()=>pu(r)),t(" acyclic.undo",()=>en(r))}function Ks(r,t){f(r.nodes(),function(n){var o=r.node(n),i=t.node(n);if(o){if(o.x=i.x,o.y=i.y,t.children(n).length)o.width=i.width,o.height=i.height}}),f(r.edges(),function(n){var o=r.edge(n),i=t.edge(n);if(o.points=i.points,Object.prototype.hasOwnProperty.call(i,"x"))o.x=i.x,o.y=i.y}),r.graph().width=t.graph().width,r.graph().height=t.graph().height}var Js=["nodesep","edgesep","ranksep","marginx","marginy"],Zs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},$s=["acyclicer","ranker","rankdir","align"],Qs=["width","height"],ru={width:0,height:0},eu=["minlen","weight","width","height","labeloffset"],tu={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},nu=["labelpos"];function ou(r){var t=new te({multigraph:!0,compound:!0}),n=Zr(r.graph());return t.setGraph(or({},Zs,Jr(n,Js),Z(n,$s))),f(r.nodes(),function(o){var i=Zr(r.node(o));t.setNode(o,et(Jr(i,Qs),ru)),t.setParent(o,r.parent(o))}),f(r.edges(),function(o){var i=Zr(r.edge(o));t.setEdge(o,or({},tu,Jr(i,eu),Z(i,nu)))}),t}function iu(r){var t=r.graph();t.ranksep/=2,f(r.edges(),function(n){var o=r.edge(n);if(o.minlen*=2,o.labelpos.toLowerCase()!=="c")if(t.rankdir==="TB"||t.rankdir==="BT")o.width+=o.labeloffset;else o.height+=o.labeloffset})}function au(r){f(r.edges(),function(t){var n=r.edge(t);if(n.width&&n.height){var o=r.node(t.v),i=r.node(t.w),s={rank:(i.rank-o.rank)/2+o.rank,e:t};T(r,"edge-proxy",s,"_ep")}})}function fu(r){var t=0;f(r.nodes(),function(n){var o=r.node(n);if(o.borderTop)o.minRank=r.node(o.borderTop).rank,o.maxRank=r.node(o.borderBottom).rank,t=S(t,o.maxRank)}),r.graph().maxRank=t}function su(r){f(r.nodes(),function(t){var n=r.node(t);if(n.dummy==="edge-proxy")r.edge(n.e).labelRank=n.rank,r.removeNode(t)})}function uu(r){var t=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,i=0,s=r.graph(),u=s.marginx||0,d=s.marginy||0;function c(p){var{x:m,y:h,width:g,height:b}=p;t=Math.min(t,m-g/2),n=Math.max(n,m+g/2),o=Math.min(o,h-b/2),i=Math.max(i,h+b/2)}f(r.nodes(),function(p){c(r.node(p))}),f(r.edges(),function(p){var m=r.edge(p);if(Object.prototype.hasOwnProperty.call(m,"x"))c(m)}),t-=u,o-=d,f(r.nodes(),function(p){var m=r.node(p);m.x-=t,m.y-=o}),f(r.edges(),function(p){var m=r.edge(p);if(f(m.points,function(h){h.x-=t,h.y-=o}),Object.prototype.hasOwnProperty.call(m,"x"))m.x-=t;if(Object.prototype.hasOwnProperty.call(m,"y"))m.y-=o}),s.width=n-t+u,s.height=i-o+d}function du(r){f(r.edges(),function(t){var n=r.edge(t),o=r.node(t.v),i=r.node(t.w),s,u;if(!n.points)n.points=[],s=i,u=o;else s=n.points[0],u=n.points[n.points.length-1];n.points.unshift(Br(o,s)),n.points.push(Br(i,u))})}function cu(r){f(r.edges(),function(t){var n=r.edge(t);if(Object.prototype.hasOwnProperty.call(n,"x")){if(n.labelpos==="l"||n.labelpos==="r")n.width-=n.labeloffset;switch(n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}}})}function pu(r){f(r.edges(),function(t){var n=r.edge(t);if(n.reversed)n.points.reverse()})}function lu(r){f(r.nodes(),function(t){if(r.children(t).length){var n=r.node(t),o=r.node(n.borderTop),i=r.node(n.borderBottom),s=r.node(X(n.borderLeft)),u=r.node(X(n.borderRight));n.width=Math.abs(u.x-s.x),n.height=Math.abs(i.y-o.y),n.x=s.x+n.width/2,n.y=o.y+n.height/2}}),f(r.nodes(),function(t){if(r.node(t).dummy==="border")r.removeNode(t)})}function mu(r){f(r.edges(),function(t){if(t.v===t.w){var n=r.node(t.v);if(!n.selfEdges)n.selfEdges=[];n.selfEdges.push({e:t,label:r.edge(t)}),r.removeEdge(t)}})}function hu(r){var t=D(r);f(t,function(n){var o=0;f(n,function(i,s){var u=r.node(i);u.order=s+o,f(u.selfEdges,function(d){T(r,"selfedge",{width:d.label.width,height:d.label.height,rank:u.rank,order:s+ ++o,e:d.e,label:d.label},"_se")}),delete u.selfEdges})})}function gu(r){f(r.nodes(),function(t){var n=r.node(t);if(n.dummy==="selfedge"){var o=r.node(n.e.v),i=o.x+o.width/2,s=o.y,u=n.x-i,d=o.height/2;r.setEdge(n.e,n.label),r.removeNode(t),n.label.points=[{x:i+2*u/3,y:s-d},{x:i+5*u/6,y:s-d},{x:i+u,y:s},{x:i+5*u/6,y:s+d},{x:i+2*u/3,y:s+d}],n.label.x=n.x,n.label.y=n.y}})}function Jr(r,t){return q(Z(r,t),Number)}function Zr(r){var t={};return f(r,function(n,o){t[o.toLowerCase()]=n}),t}var io=e((r,t,n)=>Math.max(t,Math.min(n,r)),"clamp"),ao=e((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),vu=e((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),bu=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],yu=e((r,t,n,o,i)=>{let s=[],u=new Set;if(n.forEach(({start:m,end:h})=>{if(m!==o)u.add(m);if(h!==o)u.add(h)}),u.forEach((m)=>{let h=r.node(m);if(typeof h?.x==="number"&&typeof h?.y==="number")s.push(h)}),s.length===0)n.forEach(({edge:m})=>{(m.points??[]).forEach((h)=>{if(typeof h?.x==="number"&&typeof h?.y==="number")s.push(h)})});if(s.length===0)return ao(i);let d=s.reduce((m,h)=>({x:m.x+h.x/s.length,y:m.y+h.y/s.length}),{x:0,y:0}),c=d.x-t.x,p=d.y-t.y;if(Math.abs(c)>Math.abs(p))return c>0?"right":"left";if(Math.abs(p)>0)return p>0?"bottom":"top";return ao(i)},"getSelfLoopSide"),wu=e((r,t="top",n=0,o=0)=>{let i=r.x,s=r.y-n,u=r.width/2,d=r.height/2,c=Math.max(36,Math.min(100,r.width*0.8)),p=io(Math.max(o,r.width*0.35),36,c),m=io(Math.min(r.width,r.height)*0.45,24,48);switch(t){case"bottom":{let h=s+d;return[{x:i-p/2,y:h},{x:i-p/2,y:h+m},{x:i+p/2,y:h+m},{x:i+p/2,y:h}]}case"right":{let h=i+u;return[{x:h,y:s-p/2},{x:h+m,y:s-p/2},{x:h+m,y:s+p/2},{x:h,y:s+p/2}]}case"left":{let h=i-u;return[{x:h,y:s-p/2},{x:h-m,y:s-p/2},{x:h-m,y:s+p/2},{x:h,y:s+p/2}]}case"top":default:{let h=s-d;return[{x:i-p/2,y:h},{x:i-p/2,y:h-m},{x:i+p/2,y:h-m},{x:i+p/2,y:h}]}}},"getSelfLoopPoints"),_u=e((r,t,n="top",o=0,i={})=>{let u=r.x,d=r.y-o,c=i.width??0,p=i.height??0;switch(n){case"bottom":return{x:u,y:Math.max(...t.map((m)=>m.y))+p/2+4};case"right":return{x:Math.max(...t.map((m)=>m.x))+c/2+4,y:d};case"left":return{x:Math.min(...t.map((m)=>m.x))-c/2-4,y:d};case"top":default:return{x:u,y:Math.min(...t.map((m)=>m.y))-p/2-4}}},"getSelfLoopLabelPosition"),Qi=e((r,t=0,{mergeSelfLoops:n=!0}={})=>{let o=new Map,i=[],s=r.graph()?.rankdir;return r.edges().forEach((u)=>{let d=r.edge(u);if(n&&d.selfLoop){let c=d.selfLoop.id;if(!o.has(c))o.set(c,[]);o.get(c).push({edge:d,start:u.v,end:u.w})}else i.push({edge:d,start:u.v,end:u.w})}),o.forEach((u)=>{if(u.length!==3){u.forEach((_)=>i.push(_));return}u.sort((_,R)=>_.edge.selfLoop.order-R.edge.selfLoop.order);let[d,c,p]=u,m=d.edge.originalEdge??c.edge.originalEdge??p.edge.originalEdge??c.edge,h=r.node(m.start);if(!h){u.forEach((_)=>i.push(_));return}let g={width:c.edge.width,height:c.edge.height},b=yu(r,h,u,m.start,s),w=wu(h,b,t,g.width??0),y=_u(h,w,b,t,g),v={...c.edge,...m,id:m.id,points:w,start:m.start,end:m.end,x:y.x,y:y.y,width:g.width,height:g.height,labelStyle:c.edge.labelStyle,fromCluster:d.edge.fromCluster??c.edge.fromCluster??p.edge.fromCluster,toCluster:d.edge.toCluster??c.edge.toCluster??p.edge.toCluster};delete v.selfLoop,delete v.originalEdge,i.push({edge:v,start:v.start,end:v.end})}),i},"getEdgesToRender"),so=e(async({element:r,graph:t,diagramType:n,id:o,parentCluster:i,siteConfig:s})=>{let u=t.graph().rankdir;a.trace("Dir in recursive render - dir:",u);let{clusters:d,edgePaths:c,edgeLabels:p,nodes:m,rootGroups:h}=la(r,{edgePathsClass:"edgePaths"});if(!t.nodes())a.info("No nodes found for",t);else a.info("Recursive render XXX",t.nodes());if(t.edges().length>0)a.info("Recursive edges",t.edge(t.edges()[0]));let g=vu(n);await Promise.all(t.nodes().map(async function(y){let v=t.node(y);if(i!==void 0){let _=JSON.parse(JSON.stringify(i.clusterData));if(a.trace(`Setting data for parent cluster XXX
1
+ import{e,a,l,I,Tt,go,yt,tn,At,Zn,nn}from"./chunk-1s53190z.js";import{xe,Oe,Qe,Ee,dt,Gt,H,me,it,Ht,ot,ur,da,pa,ma,bn,Ct,fa,xn,$e,_n,Ft,St,wn,Yt,kn,ha,ga,dr,_e,ya,Cn,Zt,Sn,pr,mr,Xt,va,fr,ba,Ur,pt,hr,xa,_a,wa,Ge,gr,yr,Tn,ka,vr,f,Je,mt,we,Kt,te}from"./chunk-tz4twwmw.js";import{la,ca,W,Fn,to,ua,cr}from"./chunk-s2bs5vxh.js";import{Rt}from"./chunk-rddft5ce.js";var br={};Rt(br,{default:()=>rr});var co=/\s/;function po(r){var t=r.length;while(t--&&co.test(r.charAt(t)));return t}var ee=po;var lo=/^\s+/;function mo(r){return r?r.slice(0,ee(r)+1).replace(lo,""):r}var ne=mo;var oe=NaN,ho=/^[-+]0x[0-9a-f]+$/i,vo=/^0b[01]+$/i,bo=/^0o[0-7]+$/i,yo=parseInt;function wo(r){if(typeof r=="number")return r;if(dt(r))return oe;if(me(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=me(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=ne(r);var n=vo.test(r);return n||bo.test(r)?yo(r.slice(2),n?2:8):ho.test(r)?oe:+r}var ie=wo;var ae=1/0,_o=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function xo(r){if(!r)return r===0?r:0;if(r=ie(r),r===ae||r===-ae){var t=r<0?-1:1;return t*_o}return r===r?r:0}var V=xo;function Oo(r){var t=V(r),n=t%1;return t===t?n?t-n:t:0}var fe=Oo;var se=Object.create,Lo=function(){function r(){}return function(t){if(!me(t))return{};if(se)return se(t);r.prototype=t;var n=new r;return r.prototype=void 0,n}}(),ue=Lo;function Io(r,t){var n=-1,o=r.length;t||(t=Array(o));while(++n<o)t[n]=r[n];return t}var sr=Io;function No(r,t,n){if(t=="__proto__"&&ur)ur(r,t,{configurable:!0,enumerable:!0,value:n,writable:!0});else r[t]=n}var M=No;var Po=Object.prototype,ko=Po.hasOwnProperty;function Co(r,t,n){var o=r[t];if(!(ko.call(r,t)&&Ct(o,n))||n===void 0&&!(t in r))M(r,t,n)}var j=Co;function Ao(r,t,n,o){var i=!n;n||(n={});var s=-1,u=t.length;while(++s<u){var d=t[s],c=o?o(n[d],r[d],d,n,r):void 0;if(c===void 0)c=r[d];if(i)M(n,d,c);else j(n,d,c)}return n}var k=Ao;function Ro(r,t,n){if(!me(n))return!1;var o=typeof t;if(o=="number"?$e(n)&&bn(t,n.length):o=="string"&&(t in n))return Ct(n[t],r);return!1}var C=Ro;function Mo(r){return xn(function(t,n){var o=-1,i=n.length,s=i>1?n[i-1]:void 0,u=i>2?n[2]:void 0;if(s=r.length>3&&typeof s=="function"?(i--,s):void 0,u&&C(n[0],n[1],u))s=i<3?void 0:s,i=1;t=Object(t);while(++o<i){var d=n[o];if(d)r(t,d,o,s)}return t})}var de=Mo;function jo(r){var t=[];if(r!=null)for(var n in Object(r))t.push(n);return t}var ce=jo;var Bo=Object.prototype,Do=Bo.hasOwnProperty;function Fo(r){if(!me(r))return ce(r);var t=_n(r),n=[];for(var o in r)if(!(o=="constructor"&&(t||!Do.call(r,o))))n.push(o);return n}var pe=Fo;function Go(r){return $e(r)?ha(r,!0):pe(r)}var L=Go;function Xo(r){var t=r==null?0:r.length;return t?mr(r,1):[]}var N=Xo;function Uo(r){return da(fa(r,void 0,N),r+"")}var le=Uo;var Vo=ga(Object.getPrototypeOf,Object),Y=Vo;var Yo="[object Object]",zo=Function.prototype,Wo=Object.prototype,he=zo.toString,qo=Wo.hasOwnProperty,Ho=he.call(Object);function Ko(r){if(!Ee(r)||Qe(r)!=Yo)return!1;var t=Y(r);if(t===null)return!0;var n=qo.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&he.call(n)==Ho}var ge=Ko;var Jo="\\ud800-\\udfff",Zo="\\u0300-\\u036f",$o="\\ufe20-\\ufe2f",Qo="\\u20d0-\\u20ff",ri=Zo+$o+Qo,ei="\\ufe0e\\ufe0f",ti="\\u200d",ni=RegExp("["+ti+Jo+ri+ei+"]");function oi(r){return ni.test(r)}var ve=oi;function ii(r,t){return r&&k(t,_e(t),r)}var be=ii;function ai(r,t){return r&&k(t,L(t),r)}var ye=ai;var Ne=typeof br=="object"&&br&&!br.nodeType&&br,Le=Ne&&typeof lr=="object"&&lr&&!lr.nodeType&&lr,fi=Le&&Le.exports===Ne,Ie=fi?xe.Buffer:void 0,Se=Ie?Ie.allocUnsafe:void 0;function si(r,t){if(t)return r.slice();var n=r.length,o=Se?Se(n):new r.constructor(n);return r.copy(o),o}var rr=si;function ui(r,t){return k(r,fr(r),t)}var Pe=ui;var di=Object.getOwnPropertySymbols,ci=!di?va:function(r){var t=[];while(r)pr(t,fr(r)),r=Y(r);return t},wr=ci;function pi(r,t){return k(r,wr(r),t)}var ke=pi;function li(r){return ba(r,L,wr)}var Te=li;var mi=Object.prototype,hi=mi.hasOwnProperty;function gi(r){var t=r.length,n=new r.constructor(t);if(t&&typeof r[0]=="string"&&hi.call(r,"index"))n.index=r.index,n.input=r.input;return n}var Ce=gi;function vi(r){var t=new r.constructor(r.byteLength);return new hr(t).set(new hr(r)),t}var z=vi;function bi(r,t){var n=t?z(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.byteLength)}var Ae=bi;var yi=/\w*$/;function wi(r){var t=new r.constructor(r.source,yi.exec(r));return t.lastIndex=r.lastIndex,t}var Re=wi;var Me=Oe?Oe.prototype:void 0,je=Me?Me.valueOf:void 0;function _i(r){return je?Object(je.call(r)):{}}var Be=_i;function Ei(r,t){var n=t?z(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.length)}var _r=Ei;var xi="[object Boolean]",Oi="[object Date]",Li="[object Map]",Ii="[object Number]",Si="[object RegExp]",Ni="[object Set]",Pi="[object String]",ki="[object Symbol]",Ti="[object ArrayBuffer]",Ci="[object DataView]",Ai="[object Float32Array]",Ri="[object Float64Array]",Mi="[object Int8Array]",ji="[object Int16Array]",Bi="[object Int32Array]",Di="[object Uint8Array]",Fi="[object Uint8ClampedArray]",Gi="[object Uint16Array]",Xi="[object Uint32Array]";function Ui(r,t,n){var o=r.constructor;switch(t){case Ti:return z(r);case xi:case Oi:return new o(+r);case Ci:return Ae(r,n);case Ai:case Ri:case Mi:case ji:case Bi:case Di:case Fi:case Gi:case Xi:return _r(r,n);case Li:return new o;case Ii:case Pi:return new o(r);case Si:return Re(r);case Ni:return new o;case ki:return Be(r)}}var De=Ui;function Vi(r){return typeof r.constructor=="function"&&!_n(r)?ue(Y(r)):{}}var Er=Vi;var Yi="[object Map]";function zi(r){return Ee(r)&&pt(r)==Yi}var Fe=zi;var Xe=Yt&&Yt.isMap,Wi=Xe?wn(Xe):Fe,Ue=Wi;var qi="[object Set]";function Hi(r){return Ee(r)&&pt(r)==qi}var Ve=Hi;var Ye=Yt&&Yt.isSet,Ki=Ye?wn(Ye):Ve,ze=Ki;var Zi=1,$i=2,ra=4,We="[object Arguments]",ea="[object Array]",ta="[object Boolean]",na="[object Date]",oa="[object Error]",qe="[object Function]",ia="[object GeneratorFunction]",aa="[object Map]",sa="[object Number]",He="[object Object]",Ea="[object RegExp]",Oa="[object Set]",La="[object String]",Ia="[object Symbol]",Sa="[object WeakMap]",Na="[object ArrayBuffer]",Pa="[object DataView]",Ta="[object Float32Array]",Ca="[object Float64Array]",Aa="[object Int8Array]",Ra="[object Int16Array]",Ma="[object Int32Array]",ja="[object Uint8Array]",Ba="[object Uint8ClampedArray]",Da="[object Uint16Array]",Fa="[object Uint32Array]",x={};x[We]=x[ea]=x[Na]=x[Pa]=x[ta]=x[na]=x[Ta]=x[Ca]=x[Aa]=x[Ra]=x[Ma]=x[aa]=x[sa]=x[He]=x[Ea]=x[Oa]=x[La]=x[Ia]=x[ja]=x[Ba]=x[Da]=x[Fa]=!0;x[oa]=x[qe]=x[Sa]=!1;function xr(r,t,n,o,i,s){var u,d=t&Zi,c=t&$i,p=t&ra;if(n)u=i?n(r,o,i,s):n(r);if(u!==void 0)return u;if(!me(r))return r;var m=H(r);if(m){if(u=Ce(r),!d)return sr(r,u)}else{var h=pt(r),g=h==qe||h==ia;if(St(r))return rr(r,d);if(h==He||h==We||g&&!i){if(u=c||g?{}:Er(r),!d)return c?ke(r,ye(u,r)):Pe(r,be(u,r))}else{if(!x[h])return i?r:{};u=De(r,h,d)}}s||(s=new Xt);var b=s.get(r);if(b)return b;if(s.set(r,u),ze(r))r.forEach(function(v){u.add(xr(v,t,n,v,r,s))});else if(Ue(r))r.forEach(function(v,_){u.set(_,xr(v,t,n,_,r,s))});var w=p?c?Te:Ur:c?L:_e,y=m?void 0:w(r);return pa(y||r,function(v,_){if(y)_=v,v=r[_];j(u,_,xr(v,t,n,_,r,s))}),u}var Ke=xr;var Ga=1,Xa=4;function Ua(r){return Ke(r,Ga|Xa)}var Ze=Ua;var Va=function(){return xe.Date.now()},kr=Va;var rt=Object.prototype,Ya=rt.hasOwnProperty,za=xn(function(r,t){r=Object(r);var n=-1,o=t.length,i=o>2?t[2]:void 0;if(i&&C(t[0],t[1],i))o=1;while(++n<o){var s=t[n],u=L(s),d=-1,c=u.length;while(++d<c){var p=u[d],m=r[p];if(m===void 0||Ct(m,rt[p])&&!Ya.call(r,p))r[p]=s[p]}}return r}),et=za;function Wa(r,t,n){if(n!==void 0&&!Ct(r[t],n)||n===void 0&&!(t in r))M(r,t,n)}var er=Wa;function qa(r,t){if(t==="constructor"&&typeof r[t]==="function")return;if(t=="__proto__")return;return r[t]}var tr=qa;function Ha(r){return k(r,L(r))}var tt=Ha;function Ka(r,t,n,o,i,s,u){var d=tr(r,n),c=tr(t,n),p=u.get(c);if(p){er(r,n,p);return}var m=s?s(d,c,n+"",r,t,u):void 0,h=m===void 0;if(h){var g=H(c),b=!g&&St(c),w=!g&&!b&&kn(c);if(m=c,g||b||w)if(H(d))m=d;else if(ka(d))m=sr(d);else if(b)h=!1,m=rr(c,!0);else if(w)h=!1,m=_r(c,!0);else m=[];else if(ge(c)||Ft(c)){if(m=d,Ft(d))m=tt(d);else if(!me(d)||Ht(d))m=Er(c)}else h=!1}if(h)u.set(c,m),i(m,c,o,s,u),u.delete(c);er(r,n,m)}var nt=Ka;function at(r,t,n,o,i){if(r===t)return;gr(t,function(s,u){if(i||(i=new Xt),me(s))nt(r,t,u,n,at,o,i);else{var d=o?o(tr(r,u),s,u+"",r,t,i):void 0;if(d===void 0)d=s;er(r,u,d)}},L)}var ft=at;function Ja(r){var t=r==null?0:r.length;return t?r[t-1]:void 0}var X=Ja;function Za(r){return function(t,n,o){var i=Object(t);if(!$e(t)){var s=Ge(n,3);t=_e(t),n=function(d){return s(i[d],d,i)}}var u=r(t,n,o);return u>-1?i[s?t[u]:u]:void 0}}var st=Za;var $a=Math.max;function Qa(r,t,n){var o=r==null?0:r.length;if(!o)return-1;var i=n==null?0:fe(n);if(i<0)i=$a(o+i,0);return ma(r,Ge(t,3),i)}var ut=Qa;var rf=st(ut),nr=rf;function ef(r,t){var n=-1,o=$e(r)?Array(r.length):[];return Tn(r,function(i,s,u){o[++n]=t(i,s,u)}),o}var Or=ef;function tf(r,t){var n=H(r)?Gt:Or;return n(r,Ge(t,3))}var E=tf;function nf(r,t){return r==null?r:gr(r,vr(t),L)}var ct=nf;function of(r,t){return r&&yr(r,vr(t))}var lt=of;function af(r,t){return r>t}var ht=af;var ff=Object.prototype,sf=ff.hasOwnProperty;function uf(r,t){return r!=null&&sf.call(r,t)}var gt=uf;function df(r,t){return r!=null&&xa(r,t,gt)}var Lr=df;var cf="[object String]";function pf(r){return typeof r=="string"||!H(r)&&Ee(r)&&Qe(r)==cf}var vt=pf;function lf(r,t){return r<t}var Ir=lf;function mf(r,t){var n={};return t=Ge(t,3),yr(r,function(o,i,s){M(n,i,t(o,i,s))}),n}var q=mf;function hf(r,t,n){var o=-1,i=r.length;while(++o<i){var s=r[o],u=t(s);if(u!=null&&(d===void 0?u===u&&!dt(u):n(u,d)))var d=u,c=s}return c}var K=hf;function gf(r){return r&&r.length?K(r,it,ht):void 0}var S=gf;var vf=de(function(r,t,n){ft(r,t,n)}),or=vf;function bf(r){return r&&r.length?K(r,it,Ir):void 0}var B=bf;function yf(r,t){return r&&r.length?K(r,Ge(t,2),Ir):void 0}var J=yf;function wf(r,t,n,o){if(!me(r))return r;t=Cn(t,r);var i=-1,s=t.length,u=s-1,d=r;while(d!=null&&++i<s){var c=Zt(t[i]),p=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return r;if(i!=u){var m=d[c];if(p=o?o(m,c,d):void 0,p===void 0)p=me(m)?m:bn(t[i+1])?[]:{}}j(d,c,p),d=d[c]}return r}var bt=wf;function _f(r,t,n){var o=-1,i=t.length,s={};while(++o<i){var u=t[o],d=Sn(r,u);if(n(d,u))bt(s,Cn(u,r),d)}return s}var wt=_f;function Ef(r,t){var n=r.length;r.sort(t);while(n--)r[n]=r[n].value;return r}var _t=Ef;function xf(r,t){if(r!==t){var n=r!==void 0,o=r===null,i=r===r,s=dt(r),u=t!==void 0,d=t===null,c=t===t,p=dt(t);if(!d&&!p&&!s&&r>t||s&&u&&c&&!d&&!p||o&&u&&c||!n&&c||!i)return 1;if(!o&&!s&&!p&&r<t||p&&n&&i&&!o&&!s||d&&n&&i||!u&&i||!c)return-1}return 0}var Et=xf;function Of(r,t,n){var o=-1,i=r.criteria,s=t.criteria,u=i.length,d=n.length;while(++o<u){var c=Et(i[o],s[o]);if(c){if(o>=d)return c;var p=n[o];return c*(p=="desc"?-1:1)}}return r.index-t.index}var xt=Of;function Lf(r,t,n){if(t.length)t=Gt(t,function(s){if(H(s))return function(u){return Sn(u,s.length===1?s[0]:s)};return s});else t=[it];var o=-1;t=Gt(t,wn(Ge));var i=Or(r,function(s,u,d){var c=Gt(t,function(p){return p(s)});return{criteria:c,index:++o,value:s}});return _t(i,function(s,u){return xt(s,u,n)})}var Ot=Lf;var If=wa("length"),Lt=If;var Nt="\\ud800-\\udfff",Sf="\\u0300-\\u036f",Nf="\\ufe20-\\ufe2f",Pf="\\u20d0-\\u20ff",kf=Sf+Nf+Pf,Tf="\\ufe0e\\ufe0f",Cf="["+Nt+"]",Tr="["+kf+"]",Cr="\\ud83c[\\udffb-\\udfff]",Af="(?:"+Tr+"|"+Cr+")",Pt="[^"+Nt+"]",kt="(?:\\ud83c[\\udde6-\\uddff]){2}",Mt="[\\ud800-\\udbff][\\udc00-\\udfff]",Rf="\\u200d",jt=Af+"?",Bt="["+Tf+"]?",Mf="(?:"+Rf+"(?:"+[Pt,kt,Mt].join("|")+")"+Bt+jt+")*",jf=Bt+jt+Mf,Bf="(?:"+[Pt+Tr+"?",Tr,kt,Mt,Cf].join("|")+")",It=RegExp(Cr+"(?="+Cr+")|"+Bf+jf,"g");function Df(r){var t=It.lastIndex=0;while(It.test(r))++t;return t}var Dt=Df;function Ff(r){return ve(r)?Dt(r):Lt(r)}var Ut=Ff;function Gf(r,t){return wt(r,t,function(n,o){return _a(r,o)})}var Vt=Gf;var Xf=le(function(r,t){return r==null?{}:Vt(r,t)}),Z=Xf;var{ceil:Uf,max:Vf}=Math;function Yf(r,t,n,o){var i=-1,s=Vf(Uf((t-r)/(n||1)),0),u=Array(s);while(s--)u[o?s:++i]=r,r+=n;return u}var zt=Yf;function zf(r){return function(t,n,o){if(o&&typeof o!="number"&&C(t,n,o))n=o=void 0;if(t=V(t),n===void 0)n=t,t=0;else n=V(n);return o=o===void 0?t<n?1:-1:V(o),zt(t,n,o,r)}}var Wt=zf;var Wf=Wt(),P=Wf;var qf="[object Map]",Hf="[object Set]";function Kf(r){if(r==null)return 0;if($e(r))return vt(r)?Ut(r):r.length;var t=pt(r);if(t==qf||t==Hf)return r.size;return dr(r).length}var qt=Kf;var Jf=xn(function(r,t){if(r==null)return[];var n=t.length;if(n>1&&C(r,t[0],t[1]))t=[];else if(n>2&&C(t[0],t[1],t[2]))t=[t[0]];return Ot(r,mr(t,1),[])}),A=Jf;var Zf=0;function $f(r){var t=++Zf;return ya(r)+t}var Q=$f;function Qf(r,t,n){var o=-1,i=r.length,s=t.length,u={};while(++o<i){var d=o<s?t[o]:void 0;n(u,r[o],d)}return u}var Jt=Qf;function rs(r,t){return Jt(r||[],t||[],j)}var Ar=rs;class Rr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,t=r._prev;if(t!==r)return $t(t),t}enqueue(r){var t=this._sentinel;if(r._prev&&r._next)$t(r);r._next=t._next,t._next._prev=r,t._next=r,r._prev=t}toString(){var r=[],t=this._sentinel,n=t._prev;while(n!==t)r.push(JSON.stringify(n,es)),n=n._prev;return"["+r.join(", ")+"]"}}function $t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function es(r,t){if(r!=="_next"&&r!=="_prev")return t}var ts=ot(1);function Qt(r,t){if(r.nodeCount()<=1)return[];var n=os(r,t||ts),o=ns(n.graph,n.buckets,n.zeroIdx);return N(E(o,function(i){return r.outEdges(i.v,i.w)}))}function ns(r,t,n){var o=[],i=t[t.length-1],s=t[0],u;while(r.nodeCount()){while(u=s.dequeue())Mr(r,t,n,u);while(u=i.dequeue())Mr(r,t,n,u);if(r.nodeCount()){for(var d=t.length-2;d>0;--d)if(u=t[d].dequeue(),u){o=o.concat(Mr(r,t,n,u,!0));break}}}return o}function Mr(r,t,n,o,i){var s=i?[]:void 0;return f(r.inEdges(o.v),function(u){var d=r.edge(u),c=r.node(u.v);if(i)s.push({v:u.v,w:u.w});c.out-=d,jr(t,n,c)}),f(r.outEdges(o.v),function(u){var d=r.edge(u),c=u.w,p=r.node(c);p.in-=d,jr(t,n,p)}),r.removeNode(o.v),s}function os(r,t){var n=new te,o=0,i=0;f(r.nodes(),function(d){n.setNode(d,{v:d,in:0,out:0})}),f(r.edges(),function(d){var c=n.edge(d.v,d.w)||0,p=t(d),m=c+p;n.setEdge(d.v,d.w,m),i=Math.max(i,n.node(d.v).out+=p),o=Math.max(o,n.node(d.w).in+=p)});var s=P(i+o+3).map(function(){return new Rr}),u=o+1;return f(n.nodes(),function(d){jr(s,u,n.node(d))}),{graph:n,buckets:s,zeroIdx:u}}function jr(r,t,n){if(!n.out)r[0].enqueue(n);else if(!n.in)r[r.length-1].enqueue(n);else r[n.out-n.in+t].enqueue(n)}function rn(r){var t=r.graph().acyclicer==="greedy"?Qt(r,n(r)):is(r);f(t,function(o){var i=r.edge(o);r.removeEdge(o),i.forwardName=o.name,i.reversed=!0,r.setEdge(o.w,o.v,i,Q("rev"))});function n(o){return function(i){return o.edge(i).weight}}}function is(r){var t=[],n={},o={};function i(s){if(Object.prototype.hasOwnProperty.call(o,s))return;o[s]=!0,n[s]=!0,f(r.outEdges(s),function(u){if(Object.prototype.hasOwnProperty.call(n,u.w))t.push(u);else i(u.w)}),delete n[s]}return f(r.nodes(),i),t}function en(r){f(r.edges(),function(t){var n=r.edge(t);if(n.reversed){r.removeEdge(t);var o=n.forwardName;delete n.reversed,delete n.forwardName,r.setEdge(t.w,t.v,n,o)}})}function T(r,t,n,o){var i;do i=Q(o);while(r.hasNode(i));return n.dummy=t,r.setNode(i,n),i}function an(r){var t=new te().setGraph(r.graph());return f(r.nodes(),function(n){t.setNode(n,r.node(n))}),f(r.edges(),function(n){var o=t.edge(n.v,n.w)||{weight:0,minlen:1},i=r.edge(n);t.setEdge(n.v,n.w,{weight:o.weight+i.weight,minlen:Math.max(o.minlen,i.minlen)})}),t}function Sr(r){var t=new te({multigraph:r.isMultigraph()}).setGraph(r.graph());return f(r.nodes(),function(n){if(!r.children(n).length)t.setNode(n,r.node(n))}),f(r.edges(),function(n){t.setEdge(n,r.edge(n))}),t}function Br(r,t){var{x:n,y:o}=r,i=t.x-n,s=t.y-o,u=r.width/2,d=r.height/2;if(!i&&!s)throw Error("Not possible to find intersection inside of the rectangle");var c,p;if(Math.abs(s)*u>Math.abs(i)*d){if(s<0)d=-d;c=d*i/s,p=d}else{if(i<0)u=-u;c=u,p=u*s/i}return{x:n+c,y:o+p}}function D(r){var t=E(P(Fr(r)+1),function(){return[]});return f(r.nodes(),function(n){var o=r.node(n),i=o.rank;if(!we(i))t[i][o.order]=n}),t}function fn(r){var t=B(E(r.nodes(),function(n){return r.node(n).rank}));f(r.nodes(),function(n){var o=r.node(n);if(Lr(o,"rank"))o.rank-=t})}function sn(r){var t=B(E(r.nodes(),function(s){return r.node(s).rank})),n=[];f(r.nodes(),function(s){var u=r.node(s).rank-t;if(!n[u])n[u]=[];n[u].push(s)});var o=0,i=r.graph().nodeRankFactor;f(n,function(s,u){if(we(s)&&u%i!==0)--o;else if(o)f(s,function(d){r.node(d).rank+=o})})}function Dr(r,t,n,o){var i={width:0,height:0};if(arguments.length>=4)i.rank=n,i.order=o;return T(r,"border",i,t)}function Fr(r){return S(E(r.nodes(),function(t){var n=r.node(t).rank;if(!we(n))return n}))}function un(r,t){var n={lhs:[],rhs:[]};return f(r,function(o){if(t(o))n.lhs.push(o);else n.rhs.push(o)}),n}function dn(r,t){var n=kr();try{return t()}finally{console.log(r+" time: "+(kr()-n)+"ms")}}function cn(r,t){return t()}function ln(r){function t(n){var o=r.children(n),i=r.node(n);if(o.length)f(o,t);if(Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,u=i.maxRank+1;s<u;++s)pn(r,"borderLeft","_bl",n,i,s),pn(r,"borderRight","_br",n,i,s)}}f(r.children(),t)}function pn(r,t,n,o,i,s){var u={width:0,height:0,rank:s,borderType:t},d=i[t][s-1],c=T(r,"border",u,n);if(i[t][s]=c,r.setParent(c,o),d)r.setEdge(d,c,{weight:1})}function hn(r){var t=r.graph().rankdir.toLowerCase();if(t==="lr"||t==="rl")vn(r)}function gn(r){var t=r.graph().rankdir.toLowerCase();if(t==="bt"||t==="rl")as(r);if(t==="lr"||t==="rl")fs(r),vn(r)}function vn(r){f(r.nodes(),function(t){mn(r.node(t))}),f(r.edges(),function(t){mn(r.edge(t))})}function mn(r){var t=r.width;r.width=r.height,r.height=t}function as(r){f(r.nodes(),function(t){Gr(r.node(t))}),f(r.edges(),function(t){var n=r.edge(t);if(f(n.points,Gr),Object.prototype.hasOwnProperty.call(n,"y"))Gr(n)})}function Gr(r){r.y=-r.y}function fs(r){f(r.nodes(),function(t){Xr(r.node(t))}),f(r.edges(),function(t){var n=r.edge(t);if(f(n.points,Xr),Object.prototype.hasOwnProperty.call(n,"x"))Xr(n)})}function Xr(r){var t=r.x;r.x=r.y,r.y=t}function yn(r){r.graph().dummyChains=[],f(r.edges(),function(t){us(r,t)})}function us(r,t){var n=t.v,o=r.node(n).rank,i=t.w,s=r.node(i).rank,u=t.name,d=r.edge(t),c=d.labelRank;if(s===o+1)return;r.removeEdge(t);var p=void 0,m,h;for(h=0,++o;o<s;++h,++o){if(d.points=[],p={width:0,height:0,edgeLabel:d,edgeObj:t,rank:o},m=T(r,"edge",p,"_d"),o===c)p.width=d.width,p.height=d.height,p.dummy="edge-label",p.labelpos=d.labelpos;if(r.setEdge(n,m,{weight:d.weight},u),h===0)r.graph().dummyChains.push(m);n=m}r.setEdge(n,i,{weight:d.weight},u)}function En(r){f(r.graph().dummyChains,function(t){var n=r.node(t),o=n.edgeLabel,i;r.setEdge(n.edgeObj,o);while(n.dummy){if(i=r.successors(t)[0],r.removeNode(t),o.points.push({x:n.x,y:n.y}),n.dummy==="edge-label")o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height;t=i,n=r.node(t)}})}function ir(r){var t={};function n(o){var i=r.node(o);if(Object.prototype.hasOwnProperty.call(t,o))return i.rank;t[o]=!0;var s=B(E(r.outEdges(o),function(u){return n(u.w)-r.edge(u).minlen}));if(s===Number.POSITIVE_INFINITY||s===void 0||s===null)s=0;return i.rank=s}f(r.sources(),n)}function U(r,t){return r.node(t.w).rank-r.node(t.v).rank-r.edge(t).minlen}function Nr(r){var t=new te({directed:!1}),n=r.nodes()[0],o=r.nodeCount();t.setNode(n,{});var i,s;while(ds(t,r)<o)i=cs(t,r),s=t.hasNode(i.v)?U(r,i):-U(r,i),ps(t,r,s);return t}function ds(r,t){function n(o){f(t.nodeEdges(o),function(i){var s=i.v,u=o===s?i.w:s;if(!r.hasNode(u)&&!U(t,i))r.setNode(u,{}),r.setEdge(o,u,{}),n(u)})}return f(r.nodes(),n),r.nodeCount()}function cs(r,t){return J(t.edges(),function(n){if(r.hasNode(n.v)!==r.hasNode(n.w))return U(t,n)})}function ps(r,t,n){f(r.nodes(),function(o){t.node(o).rank+=n})}var dh=ot(1);var vh=ot(1);Vr.CycleException=ar;function Vr(r){var t={},n={},o=[];function i(s){if(Object.prototype.hasOwnProperty.call(n,s))throw new ar;if(!Object.prototype.hasOwnProperty.call(t,s))n[s]=!0,t[s]=!0,f(r.predecessors(s),i),delete n[s],o.push(s)}if(f(r.sinks(),i),qt(t)!==r.nodeCount())throw new ar;return o}function ar(){}ar.prototype=Error();function Pr(r,t,n){if(!H(t))t=[t];var o=(r.isDirected()?r.successors:r.neighbors).bind(r),i=[],s={};return f(t,function(u){if(!r.hasNode(u))throw Error("Graph does not have node: "+u);Ln(r,u,n==="post",s,o,i)}),i}function Ln(r,t,n,o,i,s){if(!Object.prototype.hasOwnProperty.call(o,t)){if(o[t]=!0,!n)s.push(t);if(f(i(t),function(u){Ln(r,u,n,o,i,s)}),n)s.push(t)}}function Yr(r,t){return Pr(r,t,"post")}function zr(r,t){return Pr(r,t,"pre")}G.initLowLimValues=qr;G.initCutValues=Wr;G.calcCutValue=Nn;G.leaveEdge=An;G.enterEdge=Rn;G.exchangeEdges=Mn;function G(r){r=an(r),ir(r);var t=Nr(r);qr(t),Wr(t,r);var n,o;while(n=An(t))o=Rn(t,r,n),Mn(t,r,n,o)}function Wr(r,t){var n=Yr(r,r.nodes());n=n.slice(0,n.length-1),f(n,function(o){vs(r,t,o)})}function vs(r,t,n){var o=r.node(n),i=o.parent;r.edge(n,i).cutvalue=Nn(r,t,n)}function Nn(r,t,n){var o=r.node(n),i=o.parent,s=!0,u=t.edge(n,i),d=0;if(!u)s=!1,u=t.edge(i,n);return d=u.weight,f(t.nodeEdges(n),function(c){var p=c.v===n,m=p?c.w:c.v;if(m!==i){var h=p===s,g=t.edge(c).weight;if(d+=h?g:-g,ys(r,n,m)){var b=r.edge(n,m).cutvalue;d+=h?-b:b}}}),d}function qr(r,t){if(arguments.length<2)t=r.nodes()[0];Pn(r,{},1,t)}function Pn(r,t,n,o,i){var s=n,u=r.node(o);if(t[o]=!0,f(r.neighbors(o),function(d){if(!Object.prototype.hasOwnProperty.call(t,d))n=Pn(r,t,n,d,o)}),u.low=s,u.lim=n++,i)u.parent=i;else delete u.parent;return n}function An(r){return nr(r.edges(),function(t){return r.edge(t).cutvalue<0})}function Rn(r,t,n){var{v:o,w:i}=n;if(!t.hasEdge(o,i))o=n.w,i=n.v;var s=r.node(o),u=r.node(i),d=s,c=!1;if(s.lim>u.lim)d=u,c=!0;var p=Je(t.edges(),function(m){return c===In(r,r.node(m.v),d)&&c!==In(r,r.node(m.w),d)});return J(p,function(m){return U(t,m)})}function Mn(r,t,n,o){var{v:i,w:s}=n;r.removeEdge(i,s),r.setEdge(o.v,o.w,{}),qr(r),Wr(r,t),bs(r,t)}function bs(r,t){var n=nr(r.nodes(),function(i){return!t.node(i).parent}),o=zr(r,n);o=o.slice(1),f(o,function(i){var s=r.node(i).parent,u=t.edge(i,s),d=!1;if(!u)u=t.edge(s,i),d=!0;t.node(i).rank=t.node(s).rank+(d?u.minlen:-u.minlen)})}function ys(r,t,n){return r.hasEdge(t,n)}function In(r,t,n){return n.low<=t.lim&&t.lim<=n.lim}function Hr(r){switch(r.graph().ranker){case"network-simplex":jn(r);break;case"tight-tree":_s(r);break;case"longest-path":ws(r);break;default:jn(r)}}var ws=ir;function _s(r){ir(r),Nr(r)}function jn(r){G(r)}function Bn(r){var t=T(r,"root",{},"_root"),n=Es(r),o=S(mt(n))-1,i=2*o+1;r.graph().nestingRoot=t,f(r.edges(),function(u){r.edge(u).minlen*=i});var s=xs(r)+1;f(r.children(),function(u){Dn(r,t,i,s,o,n,u)}),r.graph().nodeRankFactor=i}function Dn(r,t,n,o,i,s,u){var d=r.children(u);if(!d.length){if(u!==t)r.setEdge(t,u,{weight:0,minlen:n});return}var c=Dr(r,"_bt"),p=Dr(r,"_bb"),m=r.node(u);if(r.setParent(c,u),m.borderTop=c,r.setParent(p,u),m.borderBottom=p,f(d,function(h){Dn(r,t,n,o,i,s,h);var g=r.node(h),b=g.borderTop?g.borderTop:h,w=g.borderBottom?g.borderBottom:h,y=g.borderTop?o:2*o,v=b!==w?1:i-s[u]+1;r.setEdge(c,b,{weight:y,minlen:v,nestingEdge:!0}),r.setEdge(w,p,{weight:y,minlen:v,nestingEdge:!0})}),!r.parent(u))r.setEdge(t,c,{weight:0,minlen:i+s[u]})}function Es(r){var t={};function n(o,i){var s=r.children(o);if(s&&s.length)f(s,function(u){n(u,i+1)});t[o]=i}return f(r.children(),function(o){n(o,1)}),t}function xs(r){return Kt(r.edges(),function(t,n){return t+r.edge(n).weight},0)}function Gn(r){var t=r.graph();r.removeNode(t.nestingRoot),delete t.nestingRoot,f(r.edges(),function(n){var o=r.edge(n);if(o.nestingEdge)r.removeEdge(n)})}function Xn(r,t,n){var o={},i;f(n,function(s){var u=r.parent(s),d,c;while(u){if(d=r.parent(u),d)c=o[d],o[d]=u;else c=i,i=u;if(c&&c!==u){t.setEdge(c,u);return}u=d}})}function Un(r,t,n){var o=Ls(r),i=new te({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(s){return r.node(s)});return f(r.nodes(),function(s){var u=r.node(s),d=r.parent(s);if(u.rank===t||u.minRank<=t&&t<=u.maxRank){if(i.setNode(s),i.setParent(s,d||o),f(r[n](s),function(c){var p=c.v===s?c.w:c.v,m=i.edge(p,s),h=!we(m)?m.weight:0;i.setEdge(p,s,{weight:r.edge(c).weight+h})}),Object.prototype.hasOwnProperty.call(u,"minRank"))i.setNode(s,{borderLeft:u.borderLeft[t],borderRight:u.borderRight[t]})}}),i}function Ls(r){var t;while(r.hasNode(t=Q("_root")));return t}function Vn(r,t){var n=0;for(var o=1;o<t.length;++o)n+=Is(r,t[o-1],t[o]);return n}function Is(r,t,n){var o=Ar(n,E(n,function(p,m){return m})),i=N(E(t,function(p){return A(E(r.outEdges(p),function(m){return{pos:o[m.w],weight:r.edge(m).weight}}),"pos")})),s=1;while(s<n.length)s<<=1;var u=2*s-1;s-=1;var d=E(Array(u),function(){return 0}),c=0;return f(i.forEach(function(p){var m=p.pos+s;d[m]+=p.weight;var h=0;while(m>0){if(m%2)h+=d[m+1];m=m-1>>1,d[m]+=p.weight}c+=p.weight*h})),c}function Yn(r){var t={},n=Je(r.nodes(),function(d){return!r.children(d).length}),o=S(E(n,function(d){return r.node(d).rank})),i=E(P(o+1),function(){return[]});function s(d){if(Lr(t,d))return;t[d]=!0;var c=r.node(d);i[c.rank].push(d),f(r.successors(d),s)}var u=A(n,function(d){return r.node(d).rank});return f(u,s),i}function zn(r,t){return E(t,function(n){var o=r.inEdges(n);if(!o.length)return{v:n};else{var i=Kt(o,function(s,u){var d=r.edge(u),c=r.node(u.v);return{sum:s.sum+d.weight*c.order,weight:s.weight+d.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}})}function Wn(r,t){var n={};f(r,function(i,s){var u=n[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:s};if(!we(i.barycenter))u.barycenter=i.barycenter,u.weight=i.weight}),f(t.edges(),function(i){var s=n[i.v],u=n[i.w];if(!we(s)&&!we(u))u.indegree++,s.out.push(n[i.w])});var o=Je(n,function(i){return!i.indegree});return Ss(o)}function Ss(r){var t=[];function n(s){return function(u){if(u.merged)return;if(we(u.barycenter)||we(s.barycenter)||u.barycenter>=s.barycenter)Ns(s,u)}}function o(s){return function(u){if(u.in.push(s),--u.indegree===0)r.push(u)}}while(r.length){var i=r.pop();t.push(i),f(i.in.reverse(),n(i)),f(i.out,o(i))}return E(Je(t,function(s){return!s.merged}),function(s){return Z(s,["vs","i","barycenter","weight"])})}function Ns(r,t){var n=0,o=0;if(r.weight)n+=r.barycenter*r.weight,o+=r.weight;if(t.weight)n+=t.barycenter*t.weight,o+=t.weight;r.vs=t.vs.concat(r.vs),r.barycenter=n/o,r.weight=o,r.i=Math.min(t.i,r.i),t.merged=!0}function Hn(r,t){var n=un(r,function(m){return Object.prototype.hasOwnProperty.call(m,"barycenter")}),o=n.lhs,i=A(n.rhs,function(m){return-m.i}),s=[],u=0,d=0,c=0;o.sort(Ps(!!t)),c=qn(s,i,c),f(o,function(m){c+=m.vs.length,s.push(m.vs),u+=m.barycenter*m.weight,d+=m.weight,c=qn(s,i,c)});var p={vs:N(s)};if(d)p.barycenter=u/d,p.weight=d;return p}function qn(r,t,n){var o;while(t.length&&(o=X(t)).i<=n)t.pop(),r.push(o.vs),n++;return n}function Ps(r){return function(t,n){if(t.barycenter<n.barycenter)return-1;else if(t.barycenter>n.barycenter)return 1;return!r?t.i-n.i:n.i-t.i}}function Kr(r,t,n,o){var i=r.children(t),s=r.node(t),u=s?s.borderLeft:void 0,d=s?s.borderRight:void 0,c={};if(u)i=Je(i,function(w){return w!==u&&w!==d});var p=zn(r,i);f(p,function(w){if(r.children(w.v).length){var y=Kr(r,w.v,n,o);if(c[w.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter"))Ts(w,y)}});var m=Wn(p,n);ks(m,c);var h=Hn(m,o);if(u){if(h.vs=N([u,h.vs,d]),r.predecessors(u).length){var g=r.node(r.predecessors(u)[0]),b=r.node(r.predecessors(d)[0]);if(!Object.prototype.hasOwnProperty.call(h,"barycenter"))h.barycenter=0,h.weight=0;h.barycenter=(h.barycenter*h.weight+g.order+b.order)/(h.weight+2),h.weight+=2}}return h}function ks(r,t){f(r,function(n){n.vs=N(n.vs.map(function(o){if(t[o])return t[o].vs;return o}))})}function Ts(r,t){if(!we(r.barycenter))r.barycenter=(r.barycenter*r.weight+t.barycenter*t.weight)/(r.weight+t.weight),r.weight+=t.weight;else r.barycenter=t.barycenter,r.weight=t.weight}function $n(r){var t=Fr(r),n=Kn(r,P(1,t+1),"inEdges"),o=Kn(r,P(t-1,-1,-1),"outEdges"),i=Yn(r);Jn(r,i);var s=Number.POSITIVE_INFINITY,u;for(var d=0,c=0;c<4;++d,++c){Cs(d%2?n:o,d%4>=2),i=D(r);var p=Vn(r,i);if(p<s)c=0,u=Ze(i),s=p}Jn(r,u)}function Kn(r,t,n){return E(t,function(o){return Un(r,o,n)})}function Cs(r,t){var n=new te;f(r,function(o){var i=o.graph().root,s=Kr(o,i,n,t);f(s.vs,function(u,d){o.node(u).order=d}),Xn(o,n,s.vs)})}function Jn(r,t){f(t,function(n){f(n,function(o,i){r.node(o).order=i})})}function Qn(r){var t=Rs(r);f(r.graph().dummyChains,function(n){var o=r.node(n),i=o.edgeObj,s=As(r,t,i.v,i.w),{path:u,lca:d}=s,c=0,p=u[c],m=!0;while(n!==i.w){if(o=r.node(n),m){while((p=u[c])!==d&&r.node(p).maxRank<o.rank)c++;if(p===d)m=!1}if(!m){while(c<u.length-1&&r.node(p=u[c+1]).minRank<=o.rank)c++;p=u[c]}r.setParent(n,p),n=r.successors(n)[0]}})}function As(r,t,n,o){var i=[],s=[],u=Math.min(t[n].low,t[o].low),d=Math.max(t[n].lim,t[o].lim),c,p;c=n;do c=r.parent(c),i.push(c);while(c&&(t[c].low>u||d>t[c].lim));p=c,c=o;while((c=r.parent(c))!==p)s.push(c);return{path:i.concat(s.reverse()),lca:p}}function Rs(r){var t={},n=0;function o(i){var s=n;f(r.children(i),o),t[i]={low:s,lim:n++}}return f(r.children(),o),t}function Ms(r,t){var n={};function o(i,s){var u=0,d=0,c=i.length,p=X(s);return f(s,function(m,h){var g=Bs(r,m),b=g?r.node(g).order:c;if(g||m===p)f(s.slice(d,h+1),function(w){f(r.predecessors(w),function(y){var v=r.node(y),_=v.order;if((_<u||b<_)&&!(v.dummy&&r.node(w).dummy))ro(n,y,w)})}),d=h+1,u=b}),s}return Kt(t,o),n}function js(r,t){var n={};function o(s,u,d,c,p){var m;f(P(u,d),function(h){if(m=s[h],r.node(m).dummy)f(r.predecessors(m),function(g){var b=r.node(g);if(b.dummy&&(b.order<c||b.order>p))ro(n,g,m)})})}function i(s,u){var d=-1,c,p=0;return f(u,function(m,h){if(r.node(m).dummy==="border"){var g=r.predecessors(m);if(g.length)c=r.node(g[0]).order,o(u,p,h,d,c),p=h,d=c}o(u,p,u.length,c,s.length)}),u}return Kt(t,i),n}function Bs(r,t){if(r.node(t).dummy)return nr(r.predecessors(t),function(n){return r.node(n).dummy})}function ro(r,t,n){if(t>n){var o=t;t=n,n=o}if(!Object.prototype.hasOwnProperty.call(r,t))Object.defineProperty(r,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=r[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ds(r,t,n){if(t>n){var o=t;t=n,n=o}return!!r[t]&&Object.prototype.hasOwnProperty.call(r[t],n)}function Fs(r,t,n,o){var i={},s={},u={};return f(t,function(d){f(d,function(c,p){i[c]=c,s[c]=c,u[c]=p})}),f(t,function(d){var c=-1;f(d,function(p){var m=o(p);if(m.length){m=A(m,function(y){return u[y]});var h=(m.length-1)/2;for(var g=Math.floor(h),b=Math.ceil(h);g<=b;++g){var w=m[g];if(s[p]===p&&c<u[w]&&!Ds(n,p,w))s[w]=p,s[p]=i[p]=i[w],c=u[w]}}})}),{root:i,align:s}}function Gs(r,t,n,o,i){var s={},u=Xs(r,t,n,i),d=i?"borderLeft":"borderRight";function c(h,g){var b=u.nodes(),w=b.pop(),y={};while(w){if(y[w])h(w);else y[w]=!0,b.push(w),b=b.concat(g(w));w=b.pop()}}function p(h){s[h]=u.inEdges(h).reduce(function(g,b){return Math.max(g,s[b.v]+u.edge(b))},0)}function m(h){var g=u.outEdges(h).reduce(function(w,y){return Math.min(w,s[y.w]-u.edge(y))},Number.POSITIVE_INFINITY),b=r.node(h);if(g!==Number.POSITIVE_INFINITY&&b.borderType!==d)s[h]=Math.max(s[h],g)}return c(p,u.predecessors.bind(u)),c(m,u.successors.bind(u)),f(o,function(h){s[h]=s[n[h]]}),s}function Xs(r,t,n,o){var i=new te,s=r.graph(),u=zs(s.nodesep,s.edgesep,o);return f(t,function(d){var c;f(d,function(p){var m=n[p];if(i.setNode(m),c){var h=n[c],g=i.edge(h,m);i.setEdge(h,m,Math.max(u(r,p,c),g||0))}c=p})}),i}function Us(r,t){return J(mt(t),function(n){var{NEGATIVE_INFINITY:o,POSITIVE_INFINITY:i}=Number;return ct(n,function(s,u){var d=Ws(r,u)/2;o=Math.max(s+d,o),i=Math.min(s-d,i)}),o-i})}function Vs(r,t){var n=mt(t),o=B(n),i=S(n);f(["u","d"],function(s){f(["l","r"],function(u){var d=s+u,c=r[d],p;if(c===t)return;var m=mt(c);if(p=u==="l"?o-B(m):i-S(m),p)r[d]=q(c,function(h){return h+p})})})}function Ys(r,t){return q(r.ul,function(n,o){if(t)return r[t.toLowerCase()][o];else{var i=A(E(r,o));return(i[1]+i[2])/2}})}function no(r){var t=D(r),n=or(Ms(r,t),js(r,t)),o={},i;f(["u","d"],function(u){i=u==="u"?t:mt(t).reverse(),f(["l","r"],function(d){if(d==="r")i=E(i,function(h){return mt(h).reverse()});var c=(u==="u"?r.predecessors:r.successors).bind(r),p=Fs(r,i,n,c),m=Gs(r,i,p.root,p.align,d==="r");if(d==="r")m=q(m,function(h){return-h});o[u+d]=m})});var s=Us(r,o);return Vs(o,s),Ys(o,r.graph().align)}function zs(r,t,n){return function(o,i,s){var u=o.node(i),d=o.node(s),c=0,p;if(c+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":p=-u.width/2;break;case"r":p=u.width/2;break}if(p)c+=n?p:-p;if(p=0,c+=(u.dummy?t:r)/2,c+=(d.dummy?t:r)/2,c+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":p=d.width/2;break;case"r":p=-d.width/2;break}if(p)c+=n?p:-p;return p=0,c}}function Ws(r,t){return r.node(t).width}function oo(r){r=Sr(r),qs(r),lt(no(r),function(t,n){r.node(n).x=t})}function qs(r){var t=D(r),n=r.graph().ranksep,o=0;f(t,function(i){var s=S(E(i,function(u){return r.node(u).height}));f(i,function(u){r.node(u).y=o+s/2}),o+=s+n})}function $r(r,t){var n=t&&t.debugTiming?dn:cn;n("layout",()=>{var o=n(" buildLayoutGraph",()=>ou(r));n(" runLayout",()=>Hs(o,n)),n(" updateInputGraph",()=>Ks(r,o))})}function Hs(r,t){t(" makeSpaceForEdgeLabels",()=>iu(r)),t(" removeSelfEdges",()=>mu(r)),t(" acyclic",()=>rn(r)),t(" nestingGraph.run",()=>Bn(r)),t(" rank",()=>Hr(Sr(r))),t(" injectEdgeLabelProxies",()=>au(r)),t(" removeEmptyRanks",()=>sn(r)),t(" nestingGraph.cleanup",()=>Gn(r)),t(" normalizeRanks",()=>fn(r)),t(" assignRankMinMax",()=>fu(r)),t(" removeEdgeLabelProxies",()=>su(r)),t(" normalize.run",()=>yn(r)),t(" parentDummyChains",()=>Qn(r)),t(" addBorderSegments",()=>ln(r)),t(" order",()=>$n(r)),t(" insertSelfEdges",()=>hu(r)),t(" adjustCoordinateSystem",()=>hn(r)),t(" position",()=>oo(r)),t(" positionSelfEdges",()=>gu(r)),t(" removeBorderNodes",()=>lu(r)),t(" normalize.undo",()=>En(r)),t(" fixupEdgeLabelCoords",()=>cu(r)),t(" undoCoordinateSystem",()=>gn(r)),t(" translateGraph",()=>uu(r)),t(" assignNodeIntersects",()=>du(r)),t(" reversePoints",()=>pu(r)),t(" acyclic.undo",()=>en(r))}function Ks(r,t){f(r.nodes(),function(n){var o=r.node(n),i=t.node(n);if(o){if(o.x=i.x,o.y=i.y,t.children(n).length)o.width=i.width,o.height=i.height}}),f(r.edges(),function(n){var o=r.edge(n),i=t.edge(n);if(o.points=i.points,Object.prototype.hasOwnProperty.call(i,"x"))o.x=i.x,o.y=i.y}),r.graph().width=t.graph().width,r.graph().height=t.graph().height}var Js=["nodesep","edgesep","ranksep","marginx","marginy"],Zs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},$s=["acyclicer","ranker","rankdir","align"],Qs=["width","height"],ru={width:0,height:0},eu=["minlen","weight","width","height","labeloffset"],tu={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},nu=["labelpos"];function ou(r){var t=new te({multigraph:!0,compound:!0}),n=Zr(r.graph());return t.setGraph(or({},Zs,Jr(n,Js),Z(n,$s))),f(r.nodes(),function(o){var i=Zr(r.node(o));t.setNode(o,et(Jr(i,Qs),ru)),t.setParent(o,r.parent(o))}),f(r.edges(),function(o){var i=Zr(r.edge(o));t.setEdge(o,or({},tu,Jr(i,eu),Z(i,nu)))}),t}function iu(r){var t=r.graph();t.ranksep/=2,f(r.edges(),function(n){var o=r.edge(n);if(o.minlen*=2,o.labelpos.toLowerCase()!=="c")if(t.rankdir==="TB"||t.rankdir==="BT")o.width+=o.labeloffset;else o.height+=o.labeloffset})}function au(r){f(r.edges(),function(t){var n=r.edge(t);if(n.width&&n.height){var o=r.node(t.v),i=r.node(t.w),s={rank:(i.rank-o.rank)/2+o.rank,e:t};T(r,"edge-proxy",s,"_ep")}})}function fu(r){var t=0;f(r.nodes(),function(n){var o=r.node(n);if(o.borderTop)o.minRank=r.node(o.borderTop).rank,o.maxRank=r.node(o.borderBottom).rank,t=S(t,o.maxRank)}),r.graph().maxRank=t}function su(r){f(r.nodes(),function(t){var n=r.node(t);if(n.dummy==="edge-proxy")r.edge(n.e).labelRank=n.rank,r.removeNode(t)})}function uu(r){var t=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,i=0,s=r.graph(),u=s.marginx||0,d=s.marginy||0;function c(p){var{x:m,y:h,width:g,height:b}=p;t=Math.min(t,m-g/2),n=Math.max(n,m+g/2),o=Math.min(o,h-b/2),i=Math.max(i,h+b/2)}f(r.nodes(),function(p){c(r.node(p))}),f(r.edges(),function(p){var m=r.edge(p);if(Object.prototype.hasOwnProperty.call(m,"x"))c(m)}),t-=u,o-=d,f(r.nodes(),function(p){var m=r.node(p);m.x-=t,m.y-=o}),f(r.edges(),function(p){var m=r.edge(p);if(f(m.points,function(h){h.x-=t,h.y-=o}),Object.prototype.hasOwnProperty.call(m,"x"))m.x-=t;if(Object.prototype.hasOwnProperty.call(m,"y"))m.y-=o}),s.width=n-t+u,s.height=i-o+d}function du(r){f(r.edges(),function(t){var n=r.edge(t),o=r.node(t.v),i=r.node(t.w),s,u;if(!n.points)n.points=[],s=i,u=o;else s=n.points[0],u=n.points[n.points.length-1];n.points.unshift(Br(o,s)),n.points.push(Br(i,u))})}function cu(r){f(r.edges(),function(t){var n=r.edge(t);if(Object.prototype.hasOwnProperty.call(n,"x")){if(n.labelpos==="l"||n.labelpos==="r")n.width-=n.labeloffset;switch(n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}}})}function pu(r){f(r.edges(),function(t){var n=r.edge(t);if(n.reversed)n.points.reverse()})}function lu(r){f(r.nodes(),function(t){if(r.children(t).length){var n=r.node(t),o=r.node(n.borderTop),i=r.node(n.borderBottom),s=r.node(X(n.borderLeft)),u=r.node(X(n.borderRight));n.width=Math.abs(u.x-s.x),n.height=Math.abs(i.y-o.y),n.x=s.x+n.width/2,n.y=o.y+n.height/2}}),f(r.nodes(),function(t){if(r.node(t).dummy==="border")r.removeNode(t)})}function mu(r){f(r.edges(),function(t){if(t.v===t.w){var n=r.node(t.v);if(!n.selfEdges)n.selfEdges=[];n.selfEdges.push({e:t,label:r.edge(t)}),r.removeEdge(t)}})}function hu(r){var t=D(r);f(t,function(n){var o=0;f(n,function(i,s){var u=r.node(i);u.order=s+o,f(u.selfEdges,function(d){T(r,"selfedge",{width:d.label.width,height:d.label.height,rank:u.rank,order:s+ ++o,e:d.e,label:d.label},"_se")}),delete u.selfEdges})})}function gu(r){f(r.nodes(),function(t){var n=r.node(t);if(n.dummy==="selfedge"){var o=r.node(n.e.v),i=o.x+o.width/2,s=o.y,u=n.x-i,d=o.height/2;r.setEdge(n.e,n.label),r.removeNode(t),n.label.points=[{x:i+2*u/3,y:s-d},{x:i+5*u/6,y:s-d},{x:i+u,y:s},{x:i+5*u/6,y:s+d},{x:i+2*u/3,y:s+d}],n.label.x=n.x,n.label.y=n.y}})}function Jr(r,t){return q(Z(r,t),Number)}function Zr(r){var t={};return f(r,function(n,o){t[o.toLowerCase()]=n}),t}var io=e((r,t,n)=>Math.max(t,Math.min(n,r)),"clamp"),ao=e((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),vu=e((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),bu=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],yu=e((r,t,n,o,i)=>{let s=[],u=new Set;if(n.forEach(({start:m,end:h})=>{if(m!==o)u.add(m);if(h!==o)u.add(h)}),u.forEach((m)=>{let h=r.node(m);if(typeof h?.x==="number"&&typeof h?.y==="number")s.push(h)}),s.length===0)n.forEach(({edge:m})=>{(m.points??[]).forEach((h)=>{if(typeof h?.x==="number"&&typeof h?.y==="number")s.push(h)})});if(s.length===0)return ao(i);let d=s.reduce((m,h)=>({x:m.x+h.x/s.length,y:m.y+h.y/s.length}),{x:0,y:0}),c=d.x-t.x,p=d.y-t.y;if(Math.abs(c)>Math.abs(p))return c>0?"right":"left";if(Math.abs(p)>0)return p>0?"bottom":"top";return ao(i)},"getSelfLoopSide"),wu=e((r,t="top",n=0,o=0)=>{let i=r.x,s=r.y-n,u=r.width/2,d=r.height/2,c=Math.max(36,Math.min(100,r.width*0.8)),p=io(Math.max(o,r.width*0.35),36,c),m=io(Math.min(r.width,r.height)*0.45,24,48);switch(t){case"bottom":{let h=s+d;return[{x:i-p/2,y:h},{x:i-p/2,y:h+m},{x:i+p/2,y:h+m},{x:i+p/2,y:h}]}case"right":{let h=i+u;return[{x:h,y:s-p/2},{x:h+m,y:s-p/2},{x:h+m,y:s+p/2},{x:h,y:s+p/2}]}case"left":{let h=i-u;return[{x:h,y:s-p/2},{x:h-m,y:s-p/2},{x:h-m,y:s+p/2},{x:h,y:s+p/2}]}case"top":default:{let h=s-d;return[{x:i-p/2,y:h},{x:i-p/2,y:h-m},{x:i+p/2,y:h-m},{x:i+p/2,y:h}]}}},"getSelfLoopPoints"),_u=e((r,t,n="top",o=0,i={})=>{let u=r.x,d=r.y-o,c=i.width??0,p=i.height??0;switch(n){case"bottom":return{x:u,y:Math.max(...t.map((m)=>m.y))+p/2+4};case"right":return{x:Math.max(...t.map((m)=>m.x))+c/2+4,y:d};case"left":return{x:Math.min(...t.map((m)=>m.x))-c/2-4,y:d};case"top":default:return{x:u,y:Math.min(...t.map((m)=>m.y))-p/2-4}}},"getSelfLoopLabelPosition"),Qi=e((r,t=0,{mergeSelfLoops:n=!0}={})=>{let o=new Map,i=[],s=r.graph()?.rankdir;return r.edges().forEach((u)=>{let d=r.edge(u);if(n&&d.selfLoop){let c=d.selfLoop.id;if(!o.has(c))o.set(c,[]);o.get(c).push({edge:d,start:u.v,end:u.w})}else i.push({edge:d,start:u.v,end:u.w})}),o.forEach((u)=>{if(u.length!==3){u.forEach((_)=>i.push(_));return}u.sort((_,R)=>_.edge.selfLoop.order-R.edge.selfLoop.order);let[d,c,p]=u,m=d.edge.originalEdge??c.edge.originalEdge??p.edge.originalEdge??c.edge,h=r.node(m.start);if(!h){u.forEach((_)=>i.push(_));return}let g={width:c.edge.width,height:c.edge.height},b=yu(r,h,u,m.start,s),w=wu(h,b,t,g.width??0),y=_u(h,w,b,t,g),v={...c.edge,...m,id:m.id,points:w,start:m.start,end:m.end,x:y.x,y:y.y,width:g.width,height:g.height,labelStyle:c.edge.labelStyle,fromCluster:d.edge.fromCluster??c.edge.fromCluster??p.edge.fromCluster,toCluster:d.edge.toCluster??c.edge.toCluster??p.edge.toCluster};delete v.selfLoop,delete v.originalEdge,i.push({edge:v,start:v.start,end:v.end})}),i},"getEdgesToRender"),so=e(async({element:r,graph:t,diagramType:n,id:o,parentCluster:i,siteConfig:s})=>{let u=t.graph().rankdir;a.trace("Dir in recursive render - dir:",u);let{clusters:d,edgePaths:c,edgeLabels:p,nodes:m,rootGroups:h}=la(r,{edgePathsClass:"edgePaths"});if(!t.nodes())a.info("No nodes found for",t);else a.info("Recursive render XXX",t.nodes());if(t.edges().length>0)a.info("Recursive edges",t.edge(t.edges()[0]));let g=vu(n);await Promise.all(t.nodes().map(async function(y){let v=t.node(y);if(i!==void 0){let _=JSON.parse(JSON.stringify(i.clusterData));if(a.trace(`Setting data for parent cluster XXX
2
2
  Node.id = `,y,`
3
3
  data=`,_.height,`
4
4
  Parent cluster`,i.height),t.setNode(i.id,_),!t.parent(y))a.trace("Setting parent",y,i.id),t.setParent(y,i.id,_)}if(a.info("(Insert) Node XXX"+y+": "+JSON.stringify(t.node(y))),v?.clusterNode){a.info("Cluster identified XBX",y,v.width,t.node(y));let{ranksep:_,nodesep:R}=t.graph();v.graph.setGraph({...v.graph.graph(),ranksep:_+25,nodesep:R});let Qr=await Lu({element:m,graph:v.graph,diagramType:n,id:o,parentCluster:t.node(y),siteConfig:s}),re=Qr.elem;I(v,re),v.diff=Qr.diff||0,a.info("New compound node after recursive render XAX",y,"width",v.width,"height",v.height),go(re,v)}else if(t.children(y).length>0)a.trace("Cluster - the non recursive path XBX",y,v.id,v,v.width,"Graph:",t),a.trace(Fn(v.id,t)),W.set(v.id,{id:Fn(v.id,t),node:v});else a.trace("Node - the non recursive path XAX",y,m,t.node(y),u),await ca(m,t.node(y),{config:s,dir:u})})),await e(async()=>{let y=t.edges().map(async function(v){let _=t.edge(v.v,v.w,v.name);if(a.info("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(v)),a.info("Edge "+v.v+" -> "+v.w+": ",v," ",JSON.stringify(t.edge(v))),a.info("Fix",W,"ids:",v.v,v.w,"Translating: ",W.get(v.v),W.get(v.w)),g&&_.selfLoop){if(_.selfLoop.order!==1)return;let R={..._.originalEdge,..._,id:_.selfLoop.id,startLabelLeft:_.originalEdge?.startLabelLeft??_.startLabelLeft,startLabelRight:_.originalEdge?.startLabelRight??_.startLabelRight,endLabelLeft:_.originalEdge?.endLabelLeft??_.endLabelLeft,endLabelRight:_.originalEdge?.endLabelRight??_.endLabelRight};await At(p,R),_.width=R.width,_.height=R.height,_.labelStyle=R.labelStyle;return}await At(p,_)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:w}=Tt(s);return{elem:h,graph:t,groups:{clusters:d,edgePaths:c,edgeLabels:p,nodes:m,rootGroups:h},diagramType:n,id:o,mergeSelfLoops:g,subGraphTitleTotalMargin:w}},"measureDagreGraph"),uo=e((r)=>{a.info("############################################# XXX"),a.info("### Layout ### XXX"),a.info("############################################# XXX"),$r(r)},"runDagreGraphLayout"),Eu=e((r,t,n)=>{let o=r.node(t);if(!o)return;let i={...o};if(o?.clusterNode)i.y=(o.y??0)+n;else if(r.children(t).length>0)i.height=(o.height??0)+n;else i.y=(o.y??0)+n/2;return i},"normalizeDagreNode"),fo=e((r,t)=>{bu.forEach((n)=>{if(t[n]!==void 0)r[n]=t[n]})},"applyDagreNodeLayout"),xu=e((r,t,n,o)=>({...r,start:r.start??t,end:r.end??n,points:(r.points??[]).map((i)=>({...i,y:typeof i.y==="number"?i.y+o:i.y}))}),"normalizeDagreEdge"),So=e((r,t)=>{let{graph:n,mergeSelfLoops:o,subGraphTitleTotalMargin:i=0}=t,s=new Map(r.nodes.map((d)=>[d.id,d]));ua(n).forEach((d)=>{let c=Eu(n,d,i);if(!c)return;fo(n.node(d),c);let p=s.get(d);if(p)fo(p,c)});let u=i/2;return r.edges=Qi(n,u,{mergeSelfLoops:o}).map(({edge:d,start:c,end:p})=>xu(d,c,p,u)),r},"applyDagreLayoutResult"),Ou=e(async({elem:r,graph:t,groups:{clusters:n,edgePaths:o},diagramType:i,id:s,mergeSelfLoops:u,subGraphTitleTotalMargin:d})=>{let c=0;await Promise.all(ua(t).map(async function(h){let g=t.node(h);if(a.info("Position XBX => "+h+": ("+g.x,","+g.y,") width: ",g.width," height: ",g.height),g?.clusterNode)g.y+=d,a.info("A tainted cluster node XBX1",h,g.id,g.width,g.height,g.x,g.y,t.parent(h)),W.get(g.id).node=g,yt(g);else if(t.children(h).length>0){a.info("A pure cluster node XBX1",h,g.id,g.x,g.y,g.width,g.height,t.parent(h)),g.height+=d,t.node(g.parentId);let b=g?.padding/2||0,w=g?.labelBBox?.height||0,y=w-b||0;a.debug("OffsetY",y,"labelHeight",w,"halfPadding",b),await tn(n,g),W.get(g.id).node=g}else{let b=t.node(g.parentId);g.y+=d/2,a.info("A regular node XBX1 - using the padding",g.id,"parent",g.parentId,g.width,g.height,g.x,g.y,"offsetY",g.offsetY,"parent",b,b?.offsetY,g),yt(g)}}));let p=d/2;return Qi(t,p,{mergeSelfLoops:u}).forEach(function({edge:h,start:g,end:b}){a.info("Edge "+g+" -> "+b+": "+JSON.stringify(h),h),h.points.forEach((_)=>_.y+=p);let w=t.node(g),y=t.node(b),v=nn(o,h,W,i,w,y,s);Zn(h,v)}),t.nodes().forEach(function(h){let g=t.node(h);if(a.info(h,g.type,g.diff),g.isGroup)c=g.diff}),a.warn("Returning from recursive render XAX",r,c),{elem:r,diff:c}},"paintDagreLayoutCore"),Lu=e(async(r)=>{let t=await so(r);return uo(t.graph),await Ou(t)},"renderDagreSubgraph"),Ji=e((r)=>{let t=new te({multigraph:!0,compound:!0}).setGraph({rankdir:r.direction,nodesep:r.config?.nodeSpacing||r.nodeSpacing||r.config?.flowchart?.nodeSpacing,ranksep:r.config?.rankSpacing||r.rankSpacing||r.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return r.nodes.forEach((n)=>{if(t.setNode(n.id,{...n}),n.parentId)t.setParent(n.id,n.parentId)}),a.debug("Edges:",r.edges),r.edges.forEach((n)=>{if(n.start===n.end){let o=n.start,i=o+"---"+o+"---1",s=o+"---"+o+"---2",u=t.node(o);t.setNode(i,{domId:i,id:i,parentId:u.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),t.setParent(i,u.parentId),t.setNode(s,{domId:s,id:s,parentId:u.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),t.setParent(s,u.parentId);let d=structuredClone(n),c=structuredClone(n),p=structuredClone(n),m=structuredClone(n);if(c.originalEdge=d,c.selfLoop={id:d.id,order:0},p.originalEdge=d,p.selfLoop={id:d.id,order:1},m.originalEdge=d,m.selfLoop={id:d.id,order:2},c.label="",c.arrowTypeEnd="none",c.endLabelLeft="",c.endLabelRight="",c.startLabelLeft="",c.id=o+"-cyclic-special-1",p.startLabelRight="",p.startLabelLeft="",p.endLabelLeft="",p.endLabelRight="",p.arrowTypeStart="none",p.arrowTypeEnd="none",p.id=o+"-cyclic-special-mid",m.label="",m.startLabelRight="",m.startLabelLeft="",m.arrowTypeStart="none",u.isGroup)c.fromCluster=o,m.toCluster=o;m.id=o+"-cyclic-special-2",m.arrowTypeStart="none",t.setEdge(o,i,c,o+"-cyclic-special-0"),t.setEdge(i,s,p,o+"-cyclic-special-1"),t.setEdge(s,o,m,o+"-cyclic-special-2")}else t.setEdge(n.start,n.end,{...n},n.id)}),to(t),{graph:t}},"prepareLayoutForDagre"),To=e(async(r,{element:t,preparedLayout:n})=>{let o=n??Ji(r),i=l(),s=await so({element:t,graph:o.graph,diagramType:r.type,id:r.diagramId,parentCluster:void 0,siteConfig:i});return o.measuredLayout=s,s},"measureDagreLayout"),Eo=e((r,t)=>{let n=t.preparedLayout?.measuredLayout;if(!n)throw Error("runDagreLayoutCore requires measureDagreLayout to run first");return uo(n.graph),So(r,n),n},"runDagreLayoutCore"),Iu=e((r,{measure:t})=>ua(t.graph).map((n)=>t.graph.node(n)).filter(Boolean),"getDagrePaintNodes"),Su=e((r,t,{measure:n})=>r?n.graph.node(r):void 0,"getDagreEdgeNode"),eo=cr({prepareLayout:Ji,measureLayout:To,runLayoutCore:Eo,paintOptions:{clusterDb:W,getNodes:Iu,getEdgeNode:Su,skipNode:e((r,{measure:t})=>!t.graph.hasNode(r.id),"skipNode"),isCluster:e((r,{measure:t})=>t.graph.hasNode(r.id)&&(t.graph.children(r.id)??[]).length>0,"isCluster")}});export{Qi,So,Ji,To,Eo,eo};
@@ -0,0 +1 @@
1
+ import"./chunk-1s53190z.js";import"./chunk-tz4twwmw.js";import"./chunk-s2bs5vxh.js";import{eo}from"./chunk-89paytbk.js";export{eo as render};
@@ -0,0 +1 @@
1
+ import{gi}from"./chunk-2cem4sv7.js";export{gi as createRadarServices};
@@ -1,2 +1,2 @@
1
- import{e,a,B}from"./chunk-5v44qv67.js";var le=e((t,i,o,h)=>{t.attr("class",o);let{width:r,height:n,x:w,y:x}=u(t,i);B(t,n,r,h);let c=m(w,x,r,n,i);t.attr("viewBox",c),a.debug(`viewBox configured: ${c} with padding: ${i}`)},"setupViewPortForSVG"),u=e((t,i)=>{let o=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:o.width+i*2,height:o.height+i*2,x:o.x,y:o.y}},"calculateDimensionsWithPadding"),m=e((t,i,o,h,r)=>`${t-r} ${i-r} ${o} ${h}`,"createViewBox");
1
+ import{e,a,B}from"./chunk-1s53190z.js";var le=e((t,i,o,h)=>{t.attr("class",o);let{width:r,height:n,x:w,y:x}=u(t,i);B(t,n,r,h);let c=m(w,x,r,n,i);t.attr("viewBox",c),a.debug(`viewBox configured: ${c} with padding: ${i}`)},"setupViewPortForSVG"),u=e((t,i)=>{let o=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:o.width+i*2,height:o.height+i*2,x:o.x,y:o.y}},"calculateDimensionsWithPadding"),m=e((t,i,o,h,r)=>`${t-r} ${i-r} ${o} ${h}`,"createViewBox");
2
2
  export{le};
@@ -1,4 +1,4 @@
1
- import{e,Qt,a,b,C,S,E,T,A,R,L,l,M,ue,oe,se,gt,ge,ye}from"./chunk-5v44qv67.js";import{he}from"./chunk-f5txt81n.js";import{le}from"./chunk-718mr5gc.js";var He=function(){var t=e(function(X,n,o,h){for(o=o||{},h=X.length;h--;o[X[h]]=n);return o},"o"),d=[1,3],f=[1,4],m=[1,5],r=[1,6],u=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],N=[1,22],x=[2,7],k=[1,26],q=[1,27],V=[1,28],F=[1,29],P=[1,33],U=[1,34],Y=[1,35],B=[1,36],Q=[1,37],H=[1,38],K=[1,24],W=[1,31],j=[1,32],G=[1,30],y=[1,39],_=[1,40],g=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],J=[1,61],de=[89,90],Ke=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],xe=[27,29],We=[1,70],je=[1,71],Ge=[1,72],ze=[1,73],Xe=[1,74],Je=[1,75],Ze=[1,76],Ee=[1,83],Z=[1,80],be=[1,84],Re=[1,85],ke=[1,86],_e=[1,87],Se=[1,88],Ie=[1,89],Te=[1,90],Ne=[1,91],qe=[1,92],we=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],ee=[63,64],et=[1,101],tt=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],w=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],te=[1,110],ie=[1,106],re=[1,107],ne=[1,108],ae=[1,109],ce=[1,111],Ce=[1,116],Ae=[1,117],Ve=[1,114],ve=[1,115],$e={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:e(function(n,o,h,i,p,s,Le){var c=s.length-1;switch(p){case 4:this.$=s[c].trim(),i.setAccTitle(this.$);break;case 5:case 6:this.$=s[c].trim(),i.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:i.setDirection("TB");break;case 18:i.setDirection("BT");break;case 19:i.setDirection("RL");break;case 20:i.setDirection("LR");break;case 21:i.addRequirement(s[c-3],s[c-4]);break;case 22:i.addRequirement(s[c-5],s[c-6]),i.setClass([s[c-5]],s[c-3]);break;case 23:i.setNewReqId(s[c-2]);break;case 24:i.setNewReqText(s[c-2]);break;case 25:i.setNewReqRisk(s[c-2]);break;case 26:i.setNewReqVerifyMethod(s[c-2]);break;case 29:this.$=i.RequirementType.REQUIREMENT;break;case 30:this.$=i.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=i.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=i.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=i.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=i.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=i.RiskLevel.LOW_RISK;break;case 36:this.$=i.RiskLevel.MED_RISK;break;case 37:this.$=i.RiskLevel.HIGH_RISK;break;case 38:this.$=i.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=i.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=i.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=i.VerifyType.VERIFY_TEST;break;case 42:i.addElement(s[c-3]);break;case 43:i.addElement(s[c-5]),i.setClass([s[c-5]],s[c-3]);break;case 44:i.setNewElementType(s[c-2]);break;case 45:i.setNewElementDocRef(s[c-2]);break;case 48:i.addRelationship(s[c-2],s[c],s[c-4]);break;case 49:i.addRelationship(s[c-2],s[c-4],s[c]);break;case 50:this.$=i.Relationships.CONTAINS;break;case 51:this.$=i.Relationships.COPIES;break;case 52:this.$=i.Relationships.DERIVES;break;case 53:this.$=i.Relationships.SATISFIES;break;case 54:this.$=i.Relationships.VERIFIES;break;case 55:this.$=i.Relationships.REFINES;break;case 56:this.$=i.Relationships.TRACES;break;case 57:this.$=s[c-2],i.defineClass(s[c-1],s[c]);break;case 58:i.setClass(s[c-1],s[c]);break;case 59:i.setClass([s[c-2]],s[c]);break;case 60:case 62:this.$=[s[c]];break;case 61:case 63:this.$=s[c-2].concat([s[c]]);break;case 64:this.$=s[c-2],i.setCssStyle(s[c-1],s[c]);break;case 65:this.$=[s[c]];break;case 66:s[c-2].push(s[c]),this.$=s[c-2];break;case 68:this.$=s[c-1]+s[c];break}},"anonymous"),table:[{3:1,4:2,6:d,9:f,11:m,13:r},{1:[3]},{3:8,4:2,5:[1,7],6:d,9:f,11:m,13:r},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(u,[2,6]),{3:12,4:2,6:d,9:f,11:m,13:r},{1:[2,2]},{4:17,5:N,7:13,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},t(u,[2,4]),t(u,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:N,7:42,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:43,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:44,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:45,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:46,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:47,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:48,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:49,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:50,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(g,[2,17]),t(g,[2,18]),t(g,[2,19]),t(g,[2,20]),{30:60,33:62,75:J,89:y,90:_},{30:63,33:62,75:J,89:y,90:_},{30:64,33:62,75:J,89:y,90:_},t(de,[2,29]),t(de,[2,30]),t(de,[2,31]),t(de,[2,32]),t(de,[2,33]),t(de,[2,34]),t(Ke,[2,81]),t(Ke,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(xe,[2,79]),t(xe,[2,80]),{27:[1,67],29:[1,68]},t(xe,[2,85]),t(xe,[2,86]),{62:69,65:We,66:je,67:Ge,68:ze,69:Xe,70:Je,71:Ze},{62:77,65:We,66:je,67:Ge,68:ze,69:Xe,70:Je,71:Ze},{30:78,33:62,75:J,89:y,90:_},{73:79,75:Ee,76:Z,78:81,79:82,80:be,81:Re,82:ke,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe},t(we,[2,60]),t(we,[2,62]),{73:93,75:Ee,76:Z,78:81,79:82,80:be,81:Re,82:ke,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe},{30:94,33:62,75:J,76:Z,89:y,90:_},{5:[1,95]},{30:96,33:62,75:J,89:y,90:_},{5:[1,97]},{30:98,33:62,75:J,89:y,90:_},{63:[1,99]},t(ee,[2,50]),t(ee,[2,51]),t(ee,[2,52]),t(ee,[2,53]),t(ee,[2,54]),t(ee,[2,55]),t(ee,[2,56]),{64:[1,100]},t(g,[2,59],{76:Z}),t(g,[2,64],{76:et}),{33:103,75:[1,102],89:y,90:_},t(tt,[2,65],{79:104,75:Ee,80:be,81:Re,82:ke,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe}),t(w,[2,67]),t(w,[2,69]),t(w,[2,70]),t(w,[2,71]),t(w,[2,72]),t(w,[2,73]),t(w,[2,74]),t(w,[2,75]),t(w,[2,76]),t(w,[2,77]),t(w,[2,78]),t(g,[2,57],{76:et}),t(g,[2,58],{76:Z}),{5:te,28:105,31:ie,34:re,36:ne,38:ae,40:ce},{27:[1,112],76:Z},{5:Ce,40:Ae,56:113,57:Ve,59:ve},{27:[1,118],76:Z},{33:119,89:y,90:_},{33:120,89:y,90:_},{75:Ee,78:121,79:82,80:be,81:Re,82:ke,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe},t(we,[2,61]),t(we,[2,63]),t(w,[2,68]),t(g,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:te,28:126,31:ie,34:re,36:ne,38:ae,40:ce},t(g,[2,28]),{5:[1,127]},t(g,[2,42]),{32:[1,128]},{32:[1,129]},{5:Ce,40:Ae,56:130,57:Ve,59:ve},t(g,[2,47]),{5:[1,131]},t(g,[2,48]),t(g,[2,49]),t(tt,[2,66],{79:104,75:Ee,80:be,81:Re,82:ke,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe}),{33:132,89:y,90:_},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(g,[2,27]),{5:te,28:145,31:ie,34:re,36:ne,38:ae,40:ce},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(g,[2,46]),{5:Ce,40:Ae,56:152,57:Ve,59:ve},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(g,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(g,[2,43]),{5:te,28:159,31:ie,34:re,36:ne,38:ae,40:ce},{5:te,28:160,31:ie,34:re,36:ne,38:ae,40:ce},{5:te,28:161,31:ie,34:re,36:ne,38:ae,40:ce},{5:te,28:162,31:ie,34:re,36:ne,38:ae,40:ce},{5:Ce,40:Ae,56:163,57:Ve,59:ve},{5:Ce,40:Ae,56:164,57:Ve,59:ve},t(g,[2,23]),t(g,[2,24]),t(g,[2,25]),t(g,[2,26]),t(g,[2,44]),t(g,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:e(function(n,o){if(o.recoverable)this.trace(n);else{var h=Error(n);throw h.hash=o,h}},"parseError"),parse:e(function(n){var o=this,h=[0],i=[],p=[null],s=[],Le=this.table,c="",Oe=0,st=0,it=0,ct=2,rt=1,ht=s.slice.call(arguments,1),I=Object.create(this.lexer),me={yy:{}};for(var Pe in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Pe))me.yy[Pe]=this.yy[Pe];if(I.setInput(n,me.yy),me.yy.lexer=I,me.yy.parser=this,typeof I.yylloc>"u")I.yylloc={};var Ue=I.yylloc;s.push(Ue);var ut=I.options&&I.options.ranges;if(typeof me.yy.parseError==="function")this.parseError=me.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function mt(O){h.length=h.length-2*O,p.length=p.length-O,s.length=s.length-O}e(mt,"popStack");function nt(){var O=i.pop()||I.lex()||rt;if(typeof O!=="number"){if(O instanceof Array)i=O,O=i.pop();O=o.symbols_[O]||O}return O}e(nt,"lex");var v,Ye,fe,D,kt,Be,pe={},Me,z,at,Fe;while(!0){if(fe=h[h.length-1],this.defaultActions[fe])D=this.defaultActions[fe];else{if(v===null||typeof v>"u")v=nt();D=Le[fe]&&Le[fe][v]}if(typeof D>"u"||!D.length||!D[0]){var Qe="";Fe=[];for(Me in Le[fe])if(this.terminals_[Me]&&Me>ct)Fe.push("'"+this.terminals_[Me]+"'");if(I.showPosition)Qe="Parse error on line "+(Oe+1)+`:
1
+ import{e,Qt,a,b,C,S,E,T,A,R,L,l,M,ue,oe,se,gt,ge,ye}from"./chunk-1s53190z.js";import{he}from"./chunk-r7frwjqx.js";import{le}from"./chunk-989jq2h8.js";var He=function(){var t=e(function(X,n,o,h){for(o=o||{},h=X.length;h--;o[X[h]]=n);return o},"o"),d=[1,3],f=[1,4],m=[1,5],r=[1,6],u=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],N=[1,22],x=[2,7],k=[1,26],q=[1,27],V=[1,28],F=[1,29],P=[1,33],U=[1,34],Y=[1,35],B=[1,36],Q=[1,37],H=[1,38],K=[1,24],W=[1,31],j=[1,32],G=[1,30],y=[1,39],_=[1,40],g=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],J=[1,61],de=[89,90],Ke=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],xe=[27,29],We=[1,70],je=[1,71],Ge=[1,72],ze=[1,73],Xe=[1,74],Je=[1,75],Ze=[1,76],Ee=[1,83],Z=[1,80],be=[1,84],Re=[1,85],ke=[1,86],_e=[1,87],Se=[1,88],Ie=[1,89],Te=[1,90],Ne=[1,91],qe=[1,92],we=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],ee=[63,64],et=[1,101],tt=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],w=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],te=[1,110],ie=[1,106],re=[1,107],ne=[1,108],ae=[1,109],ce=[1,111],Ce=[1,116],Ae=[1,117],Ve=[1,114],ve=[1,115],$e={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:e(function(n,o,h,i,p,s,Le){var c=s.length-1;switch(p){case 4:this.$=s[c].trim(),i.setAccTitle(this.$);break;case 5:case 6:this.$=s[c].trim(),i.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:i.setDirection("TB");break;case 18:i.setDirection("BT");break;case 19:i.setDirection("RL");break;case 20:i.setDirection("LR");break;case 21:i.addRequirement(s[c-3],s[c-4]);break;case 22:i.addRequirement(s[c-5],s[c-6]),i.setClass([s[c-5]],s[c-3]);break;case 23:i.setNewReqId(s[c-2]);break;case 24:i.setNewReqText(s[c-2]);break;case 25:i.setNewReqRisk(s[c-2]);break;case 26:i.setNewReqVerifyMethod(s[c-2]);break;case 29:this.$=i.RequirementType.REQUIREMENT;break;case 30:this.$=i.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=i.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=i.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=i.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=i.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=i.RiskLevel.LOW_RISK;break;case 36:this.$=i.RiskLevel.MED_RISK;break;case 37:this.$=i.RiskLevel.HIGH_RISK;break;case 38:this.$=i.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=i.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=i.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=i.VerifyType.VERIFY_TEST;break;case 42:i.addElement(s[c-3]);break;case 43:i.addElement(s[c-5]),i.setClass([s[c-5]],s[c-3]);break;case 44:i.setNewElementType(s[c-2]);break;case 45:i.setNewElementDocRef(s[c-2]);break;case 48:i.addRelationship(s[c-2],s[c],s[c-4]);break;case 49:i.addRelationship(s[c-2],s[c-4],s[c]);break;case 50:this.$=i.Relationships.CONTAINS;break;case 51:this.$=i.Relationships.COPIES;break;case 52:this.$=i.Relationships.DERIVES;break;case 53:this.$=i.Relationships.SATISFIES;break;case 54:this.$=i.Relationships.VERIFIES;break;case 55:this.$=i.Relationships.REFINES;break;case 56:this.$=i.Relationships.TRACES;break;case 57:this.$=s[c-2],i.defineClass(s[c-1],s[c]);break;case 58:i.setClass(s[c-1],s[c]);break;case 59:i.setClass([s[c-2]],s[c]);break;case 60:case 62:this.$=[s[c]];break;case 61:case 63:this.$=s[c-2].concat([s[c]]);break;case 64:this.$=s[c-2],i.setCssStyle(s[c-1],s[c]);break;case 65:this.$=[s[c]];break;case 66:s[c-2].push(s[c]),this.$=s[c-2];break;case 68:this.$=s[c-1]+s[c];break}},"anonymous"),table:[{3:1,4:2,6:d,9:f,11:m,13:r},{1:[3]},{3:8,4:2,5:[1,7],6:d,9:f,11:m,13:r},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(u,[2,6]),{3:12,4:2,6:d,9:f,11:m,13:r},{1:[2,2]},{4:17,5:N,7:13,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},t(u,[2,4]),t(u,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:N,7:42,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:43,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:44,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:45,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:46,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:47,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:48,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:49,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{4:17,5:N,7:50,8:x,9:f,11:m,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:k,22:q,23:V,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:y,90:_},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(g,[2,17]),t(g,[2,18]),t(g,[2,19]),t(g,[2,20]),{30:60,33:62,75:J,89:y,90:_},{30:63,33:62,75:J,89:y,90:_},{30:64,33:62,75:J,89:y,90:_},t(de,[2,29]),t(de,[2,30]),t(de,[2,31]),t(de,[2,32]),t(de,[2,33]),t(de,[2,34]),t(Ke,[2,81]),t(Ke,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(xe,[2,79]),t(xe,[2,80]),{27:[1,67],29:[1,68]},t(xe,[2,85]),t(xe,[2,86]),{62:69,65:We,66:je,67:Ge,68:ze,69:Xe,70:Je,71:Ze},{62:77,65:We,66:je,67:Ge,68:ze,69:Xe,70:Je,71:Ze},{30:78,33:62,75:J,89:y,90:_},{73:79,75:Ee,76:Z,78:81,79:82,80:be,81:Re,82:ke,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe},t(we,[2,60]),t(we,[2,62]),{73:93,75:Ee,76:Z,78:81,79:82,80:be,81:Re,82:ke,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe},{30:94,33:62,75:J,76:Z,89:y,90:_},{5:[1,95]},{30:96,33:62,75:J,89:y,90:_},{5:[1,97]},{30:98,33:62,75:J,89:y,90:_},{63:[1,99]},t(ee,[2,50]),t(ee,[2,51]),t(ee,[2,52]),t(ee,[2,53]),t(ee,[2,54]),t(ee,[2,55]),t(ee,[2,56]),{64:[1,100]},t(g,[2,59],{76:Z}),t(g,[2,64],{76:et}),{33:103,75:[1,102],89:y,90:_},t(tt,[2,65],{79:104,75:Ee,80:be,81:Re,82:ke,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe}),t(w,[2,67]),t(w,[2,69]),t(w,[2,70]),t(w,[2,71]),t(w,[2,72]),t(w,[2,73]),t(w,[2,74]),t(w,[2,75]),t(w,[2,76]),t(w,[2,77]),t(w,[2,78]),t(g,[2,57],{76:et}),t(g,[2,58],{76:Z}),{5:te,28:105,31:ie,34:re,36:ne,38:ae,40:ce},{27:[1,112],76:Z},{5:Ce,40:Ae,56:113,57:Ve,59:ve},{27:[1,118],76:Z},{33:119,89:y,90:_},{33:120,89:y,90:_},{75:Ee,78:121,79:82,80:be,81:Re,82:ke,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe},t(we,[2,61]),t(we,[2,63]),t(w,[2,68]),t(g,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:te,28:126,31:ie,34:re,36:ne,38:ae,40:ce},t(g,[2,28]),{5:[1,127]},t(g,[2,42]),{32:[1,128]},{32:[1,129]},{5:Ce,40:Ae,56:130,57:Ve,59:ve},t(g,[2,47]),{5:[1,131]},t(g,[2,48]),t(g,[2,49]),t(tt,[2,66],{79:104,75:Ee,80:be,81:Re,82:ke,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe}),{33:132,89:y,90:_},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(g,[2,27]),{5:te,28:145,31:ie,34:re,36:ne,38:ae,40:ce},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(g,[2,46]),{5:Ce,40:Ae,56:152,57:Ve,59:ve},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(g,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(g,[2,43]),{5:te,28:159,31:ie,34:re,36:ne,38:ae,40:ce},{5:te,28:160,31:ie,34:re,36:ne,38:ae,40:ce},{5:te,28:161,31:ie,34:re,36:ne,38:ae,40:ce},{5:te,28:162,31:ie,34:re,36:ne,38:ae,40:ce},{5:Ce,40:Ae,56:163,57:Ve,59:ve},{5:Ce,40:Ae,56:164,57:Ve,59:ve},t(g,[2,23]),t(g,[2,24]),t(g,[2,25]),t(g,[2,26]),t(g,[2,44]),t(g,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:e(function(n,o){if(o.recoverable)this.trace(n);else{var h=Error(n);throw h.hash=o,h}},"parseError"),parse:e(function(n){var o=this,h=[0],i=[],p=[null],s=[],Le=this.table,c="",Oe=0,st=0,it=0,ct=2,rt=1,ht=s.slice.call(arguments,1),I=Object.create(this.lexer),me={yy:{}};for(var Pe in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Pe))me.yy[Pe]=this.yy[Pe];if(I.setInput(n,me.yy),me.yy.lexer=I,me.yy.parser=this,typeof I.yylloc>"u")I.yylloc={};var Ue=I.yylloc;s.push(Ue);var ut=I.options&&I.options.ranges;if(typeof me.yy.parseError==="function")this.parseError=me.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function mt(O){h.length=h.length-2*O,p.length=p.length-O,s.length=s.length-O}e(mt,"popStack");function nt(){var O=i.pop()||I.lex()||rt;if(typeof O!=="number"){if(O instanceof Array)i=O,O=i.pop();O=o.symbols_[O]||O}return O}e(nt,"lex");var v,Ye,fe,D,kt,Be,pe={},Me,z,at,Fe;while(!0){if(fe=h[h.length-1],this.defaultActions[fe])D=this.defaultActions[fe];else{if(v===null||typeof v>"u")v=nt();D=Le[fe]&&Le[fe][v]}if(typeof D>"u"||!D.length||!D[0]){var Qe="";Fe=[];for(Me in Le[fe])if(this.terminals_[Me]&&Me>ct)Fe.push("'"+this.terminals_[Me]+"'");if(I.showPosition)Qe="Parse error on line "+(Oe+1)+`:
2
2
  `+I.showPosition()+`
3
3
  Expecting `+Fe.join(", ")+", got '"+(this.terminals_[v]||v)+"'";else Qe="Parse error on line "+(Oe+1)+": Unexpected "+(v==rt?"end of input":"'"+(this.terminals_[v]||v)+"'");this.parseError(Qe,{text:I.match,token:this.terminals_[v]||v,line:I.yylineno,loc:Ue,expected:Fe})}if(D[0]instanceof Array&&D.length>1)throw Error("Parse Error: multiple actions possible at state: "+fe+", token: "+v);switch(D[0]){case 1:if(h.push(v),p.push(I.yytext),s.push(I.yylloc),h.push(D[1]),v=null,!Ye){if(st=I.yyleng,c=I.yytext,Oe=I.yylineno,Ue=I.yylloc,it>0)it--}else v=Ye,Ye=null;break;case 2:if(z=this.productions_[D[1]][1],pe.$=p[p.length-z],pe._$={first_line:s[s.length-(z||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(z||1)].first_column,last_column:s[s.length-1].last_column},ut)pe._$.range=[s[s.length-(z||1)].range[0],s[s.length-1].range[1]];if(Be=this.performAction.apply(pe,[c,st,Oe,me.yy,D[1],p,s].concat(ht)),typeof Be<"u")return Be;if(z)h=h.slice(0,-1*z*2),p=p.slice(0,-1*z),s=s.slice(0,-1*z);h.push(this.productions_[D[1]][0]),p.push(pe.$),s.push(pe._$),at=Le[h[h.length-2]][h[h.length-1]],h.push(at);break;case 3:return!0}}return!0},"parse")},ot=function(){var X={EOF:1,parseError:e(function(o,h){if(this.yy.parser)this.yy.parser.parseError(o,h);else throw Error(o)},"parseError"),setInput:e(function(n,o){if(this.yy=o||this.yy||{},this._input=n,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:e(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var o=n.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),n},"input"),unput:e(function(n){var o=n.length,h=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var i=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),h.length-1)this.yylineno-=h.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:h?(h.length===i.length?this.yylloc.first_column:0)+i[i.length-h.length].length-h[0].length:this.yylloc.first_column-o},this.options.ranges)this.yylloc.range=[p[0],p[0]+this.yyleng-o];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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:e(function(n){this.unput(this.match.slice(n))},"less"),pastInput:e(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var n=this.match;if(n.length<20)n+=this._input.substr(0,20-n.length);return(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var n=this.pastInput(),o=Array(n.length+1).join("-");return n+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{h,o,i,r,t,n,_,st,pe,Q}from"./chunk-j6a4z530.js";var pn=2,gn=1,ys=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let s=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(s._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let s=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,a=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(a.getPropertyValue("height")),c=Math.max(0,parseInt(a.getPropertyValue("width"))),d=window.getComputedStyle(this._terminal.element),u={top:parseInt(d.getPropertyValue("padding-top")),bottom:parseInt(d.getPropertyValue("padding-bottom")),right:parseInt(d.getPropertyValue("padding-right")),left:parseInt(d.getPropertyValue("padding-left"))},p=u.top+u.bottom,g=u.right+u.left,f=l-p,v=c-g-s;return{cols:Math.max(pn,Math.floor(v/e.css.cell.width)),rows:Math.max(gn,Math.floor(f/e.css.cell.height))}}};var{defineProperty:Er,getOwnPropertyDescriptor:mn}=Object,vn=(e,s)=>{for(var a in s)Er(e,a,{get:s[a],enumerable:!0})},te=(e,s,a,l)=>{for(var c=l>1?void 0:l?mn(s,a):s,d=e.length-1,u;d>=0;d--)(u=e[d])&&(c=(l?u(s,a,c):u(c))||c);return l&&c&&Er(s,a,c),c},M=(e,s)=>(a,l)=>s(a,l,e),Cs="Terminal input",Ii={get:()=>Cs,set:(e)=>Cs=e},xs="Too much output to announce, navigate to rows manually to read",Ni={get:()=>xs,set:(e)=>xs=e};function Sn(e){return e.replace(/\r?\n/g,"\r")}function bn(e,s){return s?"\x1B[200~"+e+"\x1B[201~":e}function wn(e,s){e.clipboardData&&e.clipboardData.setData("text/plain",s.selectionText),e.preventDefault()}function yn(e,s,a,l){if(e.stopPropagation(),e.clipboardData){let c=e.clipboardData.getData("text/plain");Dr(c,s,a,l)}}function Dr(e,s,a,l){e=Sn(e),e=bn(e,a.decPrivateModes.bracketedPasteMode&&l.rawOptions.ignoreBracketedPasteMode!==!0),a.triggerDataEvent(e,!0),s.value=""}function Br(e,s,a){let l=a.getBoundingClientRect(),c=e.clientX-l.left-10,d=e.clientY-l.top-10;s.style.width="20px",s.style.height="20px",s.style.left=`${c}px`,s.style.top=`${d}px`,s.style.zIndex="1000",s.focus()}function ks(e,s,a,l,c){Br(e,s,a),c&&l.rightClickSelect(e),s.value=l.selectionText,s.select()}function Ze(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function _i(e,s=0,a=e.length){let l="";for(let c=s;c<a;++c){let d=e[c];d>65535?(d-=65536,l+=String.fromCharCode((d>>10)+55296)+String.fromCharCode(d%1024+56320)):l+=String.fromCharCode(d)}return l}var Cn=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,s){let a=e.length;if(!a)return 0;let l=0,c=0;if(this._interim){let d=e.charCodeAt(c++);56320<=d&&d<=57343?s[l++]=(this._interim-55296)*1024+d-56320+65536:(s[l++]=this._interim,s[l++]=d),this._interim=0}for(let d=c;d<a;++d){let u=e.charCodeAt(d);if(55296<=u&&u<=56319){if(++d>=a)return this._interim=u,l;let p=e.charCodeAt(d);56320<=p&&p<=57343?s[l++]=(u-55296)*1024+p-56320+65536:(s[l++]=u,s[l++]=p);continue}u!==65279&&(s[l++]=u)}return l}},xn=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,s){let a=e.length;if(!a)return 0;let l=0,c,d,u,p,g=0,f=0;if(this.interim[0]){let b=!1,w=this.interim[0];w&=(w&224)===192?31:(w&240)===224?15:7;let S=0,y;for(;(y=this.interim[++S]&63)&&S<4;)w<<=6,w|=y;let R=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,P=R-S;for(;f<P;){if(f>=a)return 0;if(y=e[f++],(y&192)!==128){f--,b=!0;break}else this.interim[S++]=y,w<<=6,w|=y&63}b||(R===2?w<128?f--:s[l++]=w:R===3?w<2048||w>=55296&&w<=57343||w===65279||(s[l++]=w):w<65536||w>1114111||(s[l++]=w)),this.interim.fill(0)}let v=a-4,m=f;for(;m<a;){for(;m<v&&!((c=e[m])&128)&&!((d=e[m+1])&128)&&!((u=e[m+2])&128)&&!((p=e[m+3])&128);)s[l++]=c,s[l++]=d,s[l++]=u,s[l++]=p,m+=4;if(c=e[m++],c<128)s[l++]=c;else if((c&224)===192){if(m>=a)return this.interim[0]=c,l;if(d=e[m++],(d&192)!==128){m--;continue}if(g=(c&31)<<6|d&63,g<128){m--;continue}s[l++]=g}else if((c&240)===224){if(m>=a)return this.interim[0]=c,l;if(d=e[m++],(d&192)!==128){m--;continue}if(m>=a)return this.interim[0]=c,this.interim[1]=d,l;if(u=e[m++],(u&192)!==128){m--;continue}if(g=(c&15)<<12|(d&63)<<6|u&63,g<2048||g>=55296&&g<=57343||g===65279)continue;s[l++]=g}else if((c&248)===240){if(m>=a)return this.interim[0]=c,l;if(d=e[m++],(d&192)!==128){m--;continue}if(m>=a)return this.interim[0]=c,this.interim[1]=d,l;if(u=e[m++],(u&192)!==128){m--;continue}if(m>=a)return this.interim[0]=c,this.interim[1]=d,this.interim[2]=u,l;if(p=e[m++],(p&192)!==128){m--;continue}if(g=(c&7)<<18|(d&63)<<12|(u&63)<<6|p&63,g<65536||g>1114111)continue;s[l++]=g}}return l}},Rr="",Qe=" ",zt=class e{constructor(){this.fg=0,this.bg=0,this.extended=new ri}static toColorRGB(s){return[s>>>16&255,s>>>8&255,s&255]}static fromColorRGB(s){return(s[0]&255)<<16|(s[1]&255)<<8|s[2]&255}clone(){let s=new e;return s.fg=this.fg,s.bg=this.bg,s.extended=this.extended.clone(),s}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},ri=class e{constructor(s=0,a=0){this._ext=0,this._urlId=0,this._ext=s,this._urlId=a}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(s){this._ext=s}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(s){this._ext&=-469762049,this._ext|=s<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(s){this._ext&=-67108864,this._ext|=s&67108863}get urlId(){return this._urlId}set urlId(s){this._urlId=s}get underlineVariantOffset(){let s=(this._ext&3758096384)>>29;return s<0?s^4294967288:s}set underlineVariantOffset(s){this._ext&=536870911,this._ext|=s<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Me=class e extends zt{constructor(){super(...arguments);this.content=0,this.fg=0,this.bg=0,this.extended=new ri,this.combinedData=""}static fromCharData(s){let a=new e;return a.setFromCharData(s),a}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ze(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(s){this.fg=s[0],this.bg=0;let a=!1;if(s[1].length>2)a=!0;else if(s[1].length===2){let l=s[1].charCodeAt(0);if(55296<=l&&l<=56319){let c=s[1].charCodeAt(1);56320<=c&&c<=57343?this.content=(l-55296)*1024+c-56320+65536|s[2]<<22:a=!0}else a=!0}else this.content=s[1].charCodeAt(0)|s[2]<<22;a&&(this.combinedData=s[1],this.content=2097152|s[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Es="di$target",Hi="di$dependencies",bi=new Map;function kn(e){return e[Hi]||[]}function fe(e){if(bi.has(e))return bi.get(e);let s=function(a,l,c){if(arguments.length!==3)throw Error("@IServiceName-decorator can only be used to decorate a parameter");En(s,a,c)};return s._id=e,bi.set(e,s),s}function En(e,s,a){s[Es]===s?s[Hi].push({id:e,index:a}):(s[Hi]=[{id:e,index:a}],s[Es]=s)}var Se=fe("BufferService"),Lr=fe("CoreMouseService"),ut=fe("CoreService"),Dn=fe("CharsetService"),us=fe("InstantiationService"),Mr=fe("LogService"),be=fe("OptionsService"),Tr=fe("OscLinkService"),Bn=fe("UnicodeService"),Ft=fe("DecorationService"),Wi=class{constructor(e,s,a){this._bufferService=e,this._optionsService=s,this._oscLinkService=a}provideLinks(e,s){let a=this._bufferService.buffer.lines.get(e-1);if(!a){s(void 0);return}let l=[],c=this._optionsService.rawOptions.linkHandler,d=new Me,u=a.getTrimmedLength(),p=-1,g=-1,f=!1;for(let v=0;v<u;v++)if(!(g===-1&&!a.hasContent(v))){if(a.loadCell(v,d),d.hasExtendedAttrs()&&d.extended.urlId)if(g===-1){g=v,p=d.extended.urlId;continue}else f=d.extended.urlId!==p;else g!==-1&&(f=!0);if(f||g!==-1&&v===u-1){let m=this._oscLinkService.getLinkData(p)?.uri;if(m){let b={start:{x:g+1,y:e},end:{x:v+(!f&&v===u-1?1:0),y:e}},w=!1;if(!c?.allowNonHttpProtocols)try{let S=new URL(m);["http:","https:"].includes(S.protocol)||(w=!0)}catch{w=!0}w||l.push({text:m,range:b,activate:(S,y)=>c?c.activate(S,y,b):Rn(S,y),hover:(S,y)=>c?.hover?.(S,y,b),leave:(S,y)=>c?.leave?.(S,y,b)})}f=!1,d.hasExtendedAttrs()&&d.extended.urlId?(g=v,p=d.extended.urlId):(g=-1,p=-1)}}s(l)}};Wi=te([M(0,Se),M(1,be),M(2,Tr)],Wi);function Rn(e,s){if(confirm(`Do you want to navigate to ${s}?
1
+ import{h,o,i,r,t,n,_,st,pe,Q}from"./chunk-rddft5ce.js";var pn=2,gn=1,ys=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let s=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(s._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let s=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,a=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(a.getPropertyValue("height")),c=Math.max(0,parseInt(a.getPropertyValue("width"))),d=window.getComputedStyle(this._terminal.element),u={top:parseInt(d.getPropertyValue("padding-top")),bottom:parseInt(d.getPropertyValue("padding-bottom")),right:parseInt(d.getPropertyValue("padding-right")),left:parseInt(d.getPropertyValue("padding-left"))},p=u.top+u.bottom,g=u.right+u.left,f=l-p,v=c-g-s;return{cols:Math.max(pn,Math.floor(v/e.css.cell.width)),rows:Math.max(gn,Math.floor(f/e.css.cell.height))}}};var{defineProperty:Er,getOwnPropertyDescriptor:mn}=Object,vn=(e,s)=>{for(var a in s)Er(e,a,{get:s[a],enumerable:!0})},te=(e,s,a,l)=>{for(var c=l>1?void 0:l?mn(s,a):s,d=e.length-1,u;d>=0;d--)(u=e[d])&&(c=(l?u(s,a,c):u(c))||c);return l&&c&&Er(s,a,c),c},M=(e,s)=>(a,l)=>s(a,l,e),Cs="Terminal input",Ii={get:()=>Cs,set:(e)=>Cs=e},xs="Too much output to announce, navigate to rows manually to read",Ni={get:()=>xs,set:(e)=>xs=e};function Sn(e){return e.replace(/\r?\n/g,"\r")}function bn(e,s){return s?"\x1B[200~"+e+"\x1B[201~":e}function wn(e,s){e.clipboardData&&e.clipboardData.setData("text/plain",s.selectionText),e.preventDefault()}function yn(e,s,a,l){if(e.stopPropagation(),e.clipboardData){let c=e.clipboardData.getData("text/plain");Dr(c,s,a,l)}}function Dr(e,s,a,l){e=Sn(e),e=bn(e,a.decPrivateModes.bracketedPasteMode&&l.rawOptions.ignoreBracketedPasteMode!==!0),a.triggerDataEvent(e,!0),s.value=""}function Br(e,s,a){let l=a.getBoundingClientRect(),c=e.clientX-l.left-10,d=e.clientY-l.top-10;s.style.width="20px",s.style.height="20px",s.style.left=`${c}px`,s.style.top=`${d}px`,s.style.zIndex="1000",s.focus()}function ks(e,s,a,l,c){Br(e,s,a),c&&l.rightClickSelect(e),s.value=l.selectionText,s.select()}function Ze(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function _i(e,s=0,a=e.length){let l="";for(let c=s;c<a;++c){let d=e[c];d>65535?(d-=65536,l+=String.fromCharCode((d>>10)+55296)+String.fromCharCode(d%1024+56320)):l+=String.fromCharCode(d)}return l}var Cn=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,s){let a=e.length;if(!a)return 0;let l=0,c=0;if(this._interim){let d=e.charCodeAt(c++);56320<=d&&d<=57343?s[l++]=(this._interim-55296)*1024+d-56320+65536:(s[l++]=this._interim,s[l++]=d),this._interim=0}for(let d=c;d<a;++d){let u=e.charCodeAt(d);if(55296<=u&&u<=56319){if(++d>=a)return this._interim=u,l;let p=e.charCodeAt(d);56320<=p&&p<=57343?s[l++]=(u-55296)*1024+p-56320+65536:(s[l++]=u,s[l++]=p);continue}u!==65279&&(s[l++]=u)}return l}},xn=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,s){let a=e.length;if(!a)return 0;let l=0,c,d,u,p,g=0,f=0;if(this.interim[0]){let b=!1,w=this.interim[0];w&=(w&224)===192?31:(w&240)===224?15:7;let S=0,y;for(;(y=this.interim[++S]&63)&&S<4;)w<<=6,w|=y;let R=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,P=R-S;for(;f<P;){if(f>=a)return 0;if(y=e[f++],(y&192)!==128){f--,b=!0;break}else this.interim[S++]=y,w<<=6,w|=y&63}b||(R===2?w<128?f--:s[l++]=w:R===3?w<2048||w>=55296&&w<=57343||w===65279||(s[l++]=w):w<65536||w>1114111||(s[l++]=w)),this.interim.fill(0)}let v=a-4,m=f;for(;m<a;){for(;m<v&&!((c=e[m])&128)&&!((d=e[m+1])&128)&&!((u=e[m+2])&128)&&!((p=e[m+3])&128);)s[l++]=c,s[l++]=d,s[l++]=u,s[l++]=p,m+=4;if(c=e[m++],c<128)s[l++]=c;else if((c&224)===192){if(m>=a)return this.interim[0]=c,l;if(d=e[m++],(d&192)!==128){m--;continue}if(g=(c&31)<<6|d&63,g<128){m--;continue}s[l++]=g}else if((c&240)===224){if(m>=a)return this.interim[0]=c,l;if(d=e[m++],(d&192)!==128){m--;continue}if(m>=a)return this.interim[0]=c,this.interim[1]=d,l;if(u=e[m++],(u&192)!==128){m--;continue}if(g=(c&15)<<12|(d&63)<<6|u&63,g<2048||g>=55296&&g<=57343||g===65279)continue;s[l++]=g}else if((c&248)===240){if(m>=a)return this.interim[0]=c,l;if(d=e[m++],(d&192)!==128){m--;continue}if(m>=a)return this.interim[0]=c,this.interim[1]=d,l;if(u=e[m++],(u&192)!==128){m--;continue}if(m>=a)return this.interim[0]=c,this.interim[1]=d,this.interim[2]=u,l;if(p=e[m++],(p&192)!==128){m--;continue}if(g=(c&7)<<18|(d&63)<<12|(u&63)<<6|p&63,g<65536||g>1114111)continue;s[l++]=g}}return l}},Rr="",Qe=" ",zt=class e{constructor(){this.fg=0,this.bg=0,this.extended=new ri}static toColorRGB(s){return[s>>>16&255,s>>>8&255,s&255]}static fromColorRGB(s){return(s[0]&255)<<16|(s[1]&255)<<8|s[2]&255}clone(){let s=new e;return s.fg=this.fg,s.bg=this.bg,s.extended=this.extended.clone(),s}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},ri=class e{constructor(s=0,a=0){this._ext=0,this._urlId=0,this._ext=s,this._urlId=a}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(s){this._ext=s}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(s){this._ext&=-469762049,this._ext|=s<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(s){this._ext&=-67108864,this._ext|=s&67108863}get urlId(){return this._urlId}set urlId(s){this._urlId=s}get underlineVariantOffset(){let s=(this._ext&3758096384)>>29;return s<0?s^4294967288:s}set underlineVariantOffset(s){this._ext&=536870911,this._ext|=s<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Me=class e extends zt{constructor(){super(...arguments);this.content=0,this.fg=0,this.bg=0,this.extended=new ri,this.combinedData=""}static fromCharData(s){let a=new e;return a.setFromCharData(s),a}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ze(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(s){this.fg=s[0],this.bg=0;let a=!1;if(s[1].length>2)a=!0;else if(s[1].length===2){let l=s[1].charCodeAt(0);if(55296<=l&&l<=56319){let c=s[1].charCodeAt(1);56320<=c&&c<=57343?this.content=(l-55296)*1024+c-56320+65536|s[2]<<22:a=!0}else a=!0}else this.content=s[1].charCodeAt(0)|s[2]<<22;a&&(this.combinedData=s[1],this.content=2097152|s[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Es="di$target",Hi="di$dependencies",bi=new Map;function kn(e){return e[Hi]||[]}function fe(e){if(bi.has(e))return bi.get(e);let s=function(a,l,c){if(arguments.length!==3)throw Error("@IServiceName-decorator can only be used to decorate a parameter");En(s,a,c)};return s._id=e,bi.set(e,s),s}function En(e,s,a){s[Es]===s?s[Hi].push({id:e,index:a}):(s[Hi]=[{id:e,index:a}],s[Es]=s)}var Se=fe("BufferService"),Lr=fe("CoreMouseService"),ut=fe("CoreService"),Dn=fe("CharsetService"),us=fe("InstantiationService"),Mr=fe("LogService"),be=fe("OptionsService"),Tr=fe("OscLinkService"),Bn=fe("UnicodeService"),Ft=fe("DecorationService"),Wi=class{constructor(e,s,a){this._bufferService=e,this._optionsService=s,this._oscLinkService=a}provideLinks(e,s){let a=this._bufferService.buffer.lines.get(e-1);if(!a){s(void 0);return}let l=[],c=this._optionsService.rawOptions.linkHandler,d=new Me,u=a.getTrimmedLength(),p=-1,g=-1,f=!1;for(let v=0;v<u;v++)if(!(g===-1&&!a.hasContent(v))){if(a.loadCell(v,d),d.hasExtendedAttrs()&&d.extended.urlId)if(g===-1){g=v,p=d.extended.urlId;continue}else f=d.extended.urlId!==p;else g!==-1&&(f=!0);if(f||g!==-1&&v===u-1){let m=this._oscLinkService.getLinkData(p)?.uri;if(m){let b={start:{x:g+1,y:e},end:{x:v+(!f&&v===u-1?1:0),y:e}},w=!1;if(!c?.allowNonHttpProtocols)try{let S=new URL(m);["http:","https:"].includes(S.protocol)||(w=!0)}catch{w=!0}w||l.push({text:m,range:b,activate:(S,y)=>c?c.activate(S,y,b):Rn(S,y),hover:(S,y)=>c?.hover?.(S,y,b),leave:(S,y)=>c?.leave?.(S,y,b)})}f=!1,d.hasExtendedAttrs()&&d.extended.urlId?(g=v,p=d.extended.urlId):(g=-1,p=-1)}}s(l)}};Wi=te([M(0,Se),M(1,be),M(2,Tr)],Wi);function Rn(e,s){if(confirm(`Do you want to navigate to ${s}?
2
2
 
3
3
  WARNING: This link could potentially be dangerous`)){let a=window.open();if(a){try{a.opener=null}catch{}a.location.href=s}else console.warn("Opening link blocked as opener could not be cleared")}}var fi=fe("CharSizeService"),Ue=fe("CoreBrowserService"),_s=fe("MouseService"),Ke=fe("RenderService"),Ln=fe("SelectionService"),Pr=fe("CharacterJoinerService"),gt=fe("ThemeService"),Ar=fe("LinkProviderService"),Mn=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Ds.isErrorNoTelemetry(e)?new Ds(e.message+`
4
4
 
@@ -1 +1 @@
1
- import{h,o,J,i,r,y,t,n,_,Vt,tr,Ue,Pn,De,mn,pe,re}from"./chunk-j6a4z530.js";var M=[{label:"每天 9:00",cron:"0 9 * * *"},{label:"每个工作日 9:00",cron:"0 9 * * 1-5"},{label:"每周一 9:00",cron:"0 9 * * 1"},{label:"每小时",cron:"0 * * * *"},{label:"每天 18:00",cron:"0 18 * * *"},{label:"每月 1 号 9:00",cron:"0 9 1 * *"}],ae=["日","一","二","三","四","五","六","日"],ie=(a)=>a.padStart(2,"0");function X(a){let p=M.find((I)=>I.cron===a.trim());if(p)return p.label;let N=a.trim().split(/\s+/);if(N.length!==5)return a;let[u="",x="",b="",D="",c=""]=N,C=(I)=>/^\d+$/.test(I);if(D!=="*")return a;if(C(u)&&x==="*"&&b==="*"&&c==="*")return`每小时第 ${u} 分`;let P=u.match(/^\*\/(\d+)$/);if(P&&x==="*"&&b==="*"&&c==="*")return`每 ${P[1]} 分钟`;if(!C(u)||!C(x))return a;let m=`${x}:${ie(u)}`;if(b==="*"&&c==="*")return`每天 ${m}`;if(b==="*"&&c==="1-5")return`每个工作日 ${m}`;if(b==="*"&&/^[0-7](,[0-7])*$/.test(c))return`每周${c.split(",").map((I)=>ae[Number(I)]).join("、")} ${m}`;if(C(b)&&c==="*")return`每月 ${b} 号 ${m}`;return a}function Z(a){let p=Date.now()-a,N=Math.floor(Math.abs(p)/1000);if(N<60)return"刚刚";let u=Math.floor(N/60);if(u<60)return`${u} 分钟${p>0?"前":"后"}`;let x=Math.floor(u/60);if(x<24)return`${x} 小时${p>0?"前":"后"}`;return`${Math.floor(x/24)} 天${p>0?"前":"后"}`}function he(a){let{Button:p,confirm:N,PageLayout:u,Switch:x,cn:b,style:D}=_(),{connection:c,onOpen:C}=a,[P,m]=r([]),[I,U]=r([]),[T,V]=r([]),[j,R]=r(),[B,W]=r([]),[F,K]=r(!0),[O,w]=r(),[z,L]=r(),[Y,A]=r(!1),[G,f]=r({}),s=i(0),q=h(async()=>{let e=++s.current;try{let[l,d,g,v]=await Promise.all([c.request("/api/automations"),c.request("/api/projects").catch(()=>[]),c.request("/api/info").catch(()=>{return}),c.request("/api/models").catch(()=>({models:[]}))]),oe=[...new Set(l.flatMap((S)=>S.lastSessionID?[S.lastSessionID]:[]))],se=(await Promise.all(oe.map(async(S)=>c.request(`/api/sessions/${encodeURIComponent(S)}`).catch((k)=>{if(k instanceof Error&&"status"in k&&k.status===404)return;throw k})))).filter((S)=>S!==void 0);if(e!==s.current)return;if(m(l.sort((S,k)=>S.created-k.created)),U(d),V(se),R(g),v?.models)W(v.models.map((S)=>S.id));w(void 0)}catch(l){if(e===s.current)w(l instanceof Error?l.message:"加载失败")}finally{if(e===s.current)K(!1)}},[c]);o(()=>(q(),()=>{s.current++}),[q]);let E=(e)=>{L(e),A(!0)},ee=async(e)=>{f((l)=>({...l,[e.id]:!0}));try{let l=await c.request(`/api/automations/${e.id}/run`,{method:"POST"});C(l.id)}catch(l){w(l instanceof Error?l.message:"运行失败")}finally{f((l)=>({...l,[e.id]:!1}))}},te=async(e)=>{if(!await N({title:`删除自动化「${e.name}」?`,description:"已经跑出来的会话会保留。",action:"删除",danger:!0}))return;try{await c.request(`/api/automations/${e.id}`,{method:"DELETE"}),m((d)=>d.filter((g)=>g.id!==e.id))}catch(d){w(d instanceof Error?d.message:"删除失败")}},ne=async(e,l)=>{try{let d=await c.request(`/api/automations/${e.id}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:l})});m((g)=>g.map((v)=>v.id===e.id?d:v))}catch(d){w(d instanceof Error?d.message:"状态切换失败")}};return n(u,{title:"自动化",description:n(y,{children:["到点自动开一个新会话执行提示词,跑完的结果在会话里查看。",j?.timezone&&n("span",{className:"text-faint",children:["按服务器时区 ",j.timezone,"。"]})]}),actions:n(p,{variant:"primary",onClick:()=>E(null),children:[t(pe,{className:"size-4"}),"新建"]}),children:[O&&t("div",{className:"mb-4 rounded-lg bg-danger/10 px-3 py-2 text-xs text-danger",children:O}),F?t("div",{className:"flex justify-center py-12 text-xs text-faint",children:"正在加载自动化…"}):P.length===0?n("div",{className:D("surface.emptyDashed","animate-fade"),children:[t("div",{className:"grid size-11 place-items-center rounded-xl bg-raised text-dim",children:t(Vt,{className:"size-5"})}),n("div",{children:[t("p",{className:"text-[15px] font-medium",children:"还没有自动化"}),t("p",{className:"mt-1 text-sm text-dim",children:"比如「每个工作日 9 点总结昨天的提交」。"})]}),n(p,{size:"sm",onClick:()=>E(null),className:"mt-1",children:[t(pe,{className:"size-3.5"}),"新建自动化"]})]}):t("ul",{className:"flex animate-fade flex-col gap-3",children:P.map((e)=>{let l=e.projectID?I.find((v)=>v.id===e.projectID):void 0,d=e.lastSessionID?T.find((v)=>v.id===e.lastSessionID):void 0,g=Boolean(G[e.id]);return t("li",{children:n("article",{className:D("surface.card","group p-4 transition-[border-color,box-shadow] duration-200 hover:border-line-strong hover:shadow-composer"),children:[n("div",{className:"flex items-start gap-3",children:[n("div",{className:b("min-w-0 flex-1 transition-opacity duration-200",!e.enabled&&"opacity-55"),children:[t("h2",{className:"truncate text-[15px] font-medium",children:e.name}),n("div",{className:"mt-1 flex flex-wrap items-center gap-x-3.5 gap-y-1 text-[13px] text-dim",children:[n("span",{className:"flex items-center gap-1.5 [&_svg]:size-3.5 [&_svg]:text-faint",children:[t(Vt,{}),X(e.schedule)]}),n("span",{className:"flex items-center gap-1.5 [&_svg]:size-3.5 [&_svg]:text-faint",children:[l?t(Ue,{}):t(Pn,{}),l?l.name:"聊天"]}),e.enabled&&e.nextRun!==null&&n("span",{className:"flex items-center gap-1.5 [&_svg]:size-3.5 [&_svg]:text-faint",children:[t(tr,{}),"下次 ",Z(e.nextRun)]})]})]}),t(x,{checked:e.enabled,label:e.enabled?"停用":"启用",onCheckedChange:(v)=>ne(e,v),className:"mt-0.5"})]}),t("p",{className:b("mt-3 line-clamp-2 text-sm leading-6 whitespace-pre-wrap text-faint transition-opacity duration-200",!e.enabled&&"opacity-55"),children:e.prompt}),n("div",{className:"mt-3 -mb-1 flex items-center gap-1",children:[n(p,{size:"sm",onClick:()=>ee(e),disabled:g,children:[t(mn,{className:"size-3.5"}),g?"正在启动…":"立即运行"]}),n(p,{size:"sm",variant:"ghost",onClick:()=>E(e),children:[t(De,{className:"size-3.5"}),"编辑"]}),n(p,{size:"sm",variant:"danger-ghost",onClick:()=>te(e),children:[t(re,{className:"size-3.5"}),"删除"]}),t("div",{className:"flex-1"}),e.lastRun!==null&&n("button",{type:"button",disabled:!d,onClick:()=>d&&C(d.id),className:"rounded-md px-1.5 py-1 text-[13px] text-faint transition-colors enabled:hover:bg-raised enabled:hover:text-ink",children:["上次运行 ",Z(e.lastRun),d?.archivedAt!=null?" · 已归档":"",!d?" · 会话已删除":""]})]})]})},e.id)})}),z!==void 0&&t(le,{open:Y,onOpenChange:A,automation:z??void 0,projects:I,models:B,timezone:j?.timezone,onSaved:(e)=>{m((l)=>{let d=l.findIndex((g)=>g.id===e.id);if(d>=0){let g=[...l];return g[d]=e,g}return[...l,e].sort((g,v)=>g.created-v.created)}),A(!1)},connection:c},z?.id??"new")]})}var H="custom",Q="chat";function le(a){let{Button:p,Dialog:N,Field:u,Form:x,FormError:b,Input:D,Select:c,Textarea:C}=_(),P=J(),m=a.automation,[I,U]=r(m?.name??""),[T,V]=r(m?.prompt??""),[j,R]=r(m?.schedule??M[0]?.cron??"0 9 * * *"),[B,W]=r(()=>!M.some((f)=>f.cron===j)),[F,K]=r(m?.projectID??Q),[O,w]=r(m?.model??""),[z,L]=r(!1),[Y,A]=r();async function G(f){f.preventDefault(),L(!0),A(void 0);try{let s=F===Q?void 0:F,q={name:I,prompt:T,schedule:j,model:O||void 0},E;if(m)E=await a.connection.request(`/api/automations/${m.id}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({...q,projectID:s??null})});else E=await a.connection.request("/api/automations",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...q,projectID:s})});a.onSaved(E)}catch(s){A(s instanceof Error?s.message:"保存失败")}finally{L(!1)}}return t(N,{open:a.open,onOpenChange:a.onOpenChange,title:a.automation?"编辑自动化":"新建自动化",size:"lg",footer:n(y,{children:[t("div",{className:"flex-1 max-sm:hidden"}),t(p,{onClick:()=>a.onOpenChange(!1),children:"取消"}),t(p,{type:"submit",form:P,variant:"primary",disabled:z,children:z?"正在保存…":a.automation?"保存":"创建"})]}),children:n(x,{id:P,onSubmit:G,children:[t(u,{label:"名称",children:(f)=>t(D,{id:f,autoFocus:!m,required:!0,value:I,onChange:(s)=>U(s.target.value),placeholder:"例如:每日提交总结"})}),t(u,{label:"提示词",hint:"没人盯着运行,写清楚要做什么、结果怎么汇报。",children:(f)=>t(C,{id:f,required:!0,value:T,onChange:(s)=>V(s.target.value),rows:5,placeholder:"总结昨天到现在的 git 提交,按模块分组,列出需要我关注的改动。"})}),n("div",{className:"grid gap-x-3 gap-y-4 sm:grid-cols-2",children:[t(u,{label:"时间",children:(f)=>t(c,{id:f,value:B?H:j,onValueChange:(s)=>{if(W(s===H),s!==H)R(s)},groups:[{options:M.map((s)=>({value:s.cron,label:s.label}))},{options:[{value:H,label:"自定义(cron)"}]}]})}),t(u,{label:"在哪里运行",children:(f)=>t(c,{id:f,value:F,onValueChange:K,groups:[{options:[{value:Q,label:"聊天",description:"不绑定目录",icon:t(Pn,{})}]},...a.projects.length?[{label:"项目",options:a.projects.map((s)=>({value:s.id,label:s.name,icon:t(Ue,{})}))}]:[]]})})]}),B&&t(u,{label:"cron 表达式",hint:`分 时 日 月 周,例如 30 8 * * 1-5 是工作日 8:30。${a.timezone?`按 ${a.timezone} 时间。`:""}`,children:(f)=>t(D,{id:f,required:!0,value:j,onChange:(s)=>R(s.target.value),spellCheck:!1,className:"font-mono"})}),a.models.length>0&&t(u,{label:"模型",children:(f)=>t(c,{id:f,value:O||"default",onValueChange:(s)=>w(s==="default"?"":s),groups:[{options:[{value:"default",label:"默认模型"},...a.models.map((s)=>({value:s,label:s}))]}]})}),t(b,{children:Y})]})})}export{he as AutomationsPage};
1
+ import{h,o,J,i,r,g,t,n,_,Vt,tr,Ue,Pn,De,mn,pe,re}from"./chunk-rddft5ce.js";var M=[{label:"每天 9:00",cron:"0 9 * * *"},{label:"每个工作日 9:00",cron:"0 9 * * 1-5"},{label:"每周一 9:00",cron:"0 9 * * 1"},{label:"每小时",cron:"0 * * * *"},{label:"每天 18:00",cron:"0 18 * * *"},{label:"每月 1 号 9:00",cron:"0 9 1 * *"}],ae=["日","一","二","三","四","五","六","日"],ie=(a)=>a.padStart(2,"0");function X(a){let p=M.find((I)=>I.cron===a.trim());if(p)return p.label;let N=a.trim().split(/\s+/);if(N.length!==5)return a;let[u="",y="",v="",D="",c=""]=N,C=(I)=>/^\d+$/.test(I);if(D!=="*")return a;if(C(u)&&y==="*"&&v==="*"&&c==="*")return`每小时第 ${u} 分`;let P=u.match(/^\*\/(\d+)$/);if(P&&y==="*"&&v==="*"&&c==="*")return`每 ${P[1]} 分钟`;if(!C(u)||!C(y))return a;let m=`${y}:${ie(u)}`;if(v==="*"&&c==="*")return`每天 ${m}`;if(v==="*"&&c==="1-5")return`每个工作日 ${m}`;if(v==="*"&&/^[0-7](,[0-7])*$/.test(c))return`每周${c.split(",").map((I)=>ae[Number(I)]).join("、")} ${m}`;if(C(v)&&c==="*")return`每月 ${v} 号 ${m}`;return a}function Z(a){let p=Date.now()-a,N=Math.floor(Math.abs(p)/1000);if(N<60)return"刚刚";let u=Math.floor(N/60);if(u<60)return`${u} 分钟${p>0?"前":"后"}`;let y=Math.floor(u/60);if(y<24)return`${y} 小时${p>0?"前":"后"}`;return`${Math.floor(y/24)} 天${p>0?"前":"后"}`}function he(a){let{Button:p,confirm:N,PageLayout:u,Switch:y,cn:v,style:D}=_(),{connection:c,onOpen:C}=a,[P,m]=r([]),[I,U]=r([]),[T,V]=r([]),[j,R]=r(),[B,W]=r([]),[F,K]=r(!0),[O,w]=r(),[z,L]=r(),[Y,A]=r(!1),[G,f]=r({}),s=i(0),q=h(async()=>{let e=++s.current;try{let[l,d,b,x]=await Promise.all([c.request("/api/automations"),c.request("/api/projects").catch(()=>[]),c.request("/api/info").catch(()=>{return}),c.request("/api/models").catch(()=>({models:[]}))]),oe=[...new Set(l.flatMap((S)=>S.lastSessionID?[S.lastSessionID]:[]))],se=(await Promise.all(oe.map(async(S)=>c.request(`/api/sessions/${encodeURIComponent(S)}`).catch((k)=>{if(k instanceof Error&&"status"in k&&k.status===404)return;throw k})))).filter((S)=>S!==void 0);if(e!==s.current)return;if(m(l.sort((S,k)=>S.created-k.created)),U(d),V(se),R(b),x?.models)W(x.models.map((S)=>S.id));w(void 0)}catch(l){if(e===s.current)w(l instanceof Error?l.message:"加载失败")}finally{if(e===s.current)K(!1)}},[c]);o(()=>(q(),()=>{s.current++}),[q]);let E=(e)=>{L(e),A(!0)},ee=async(e)=>{f((l)=>({...l,[e.id]:!0}));try{let l=await c.request(`/api/automations/${e.id}/run`,{method:"POST"});C(l.id)}catch(l){w(l instanceof Error?l.message:"运行失败")}finally{f((l)=>({...l,[e.id]:!1}))}},te=async(e)=>{if(!await N({title:`删除自动化「${e.name}」?`,description:"已经跑出来的会话会保留。",action:"删除",danger:!0}))return;try{await c.request(`/api/automations/${e.id}`,{method:"DELETE"}),m((d)=>d.filter((b)=>b.id!==e.id))}catch(d){w(d instanceof Error?d.message:"删除失败")}},ne=async(e,l)=>{try{let d=await c.request(`/api/automations/${e.id}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:l})});m((b)=>b.map((x)=>x.id===e.id?d:x))}catch(d){w(d instanceof Error?d.message:"状态切换失败")}};return n(u,{title:"自动化",description:n(g,{children:["到点自动开一个新会话执行提示词,跑完的结果在会话里查看。",j?.timezone&&n("span",{className:"text-faint",children:["按服务器时区 ",j.timezone,"。"]})]}),actions:n(p,{variant:"primary",onClick:()=>E(null),children:[t(pe,{className:"size-4"}),"新建"]}),children:[O&&t("div",{className:"mb-4 rounded-lg bg-danger/10 px-3 py-2 text-xs text-danger",children:O}),F?t("div",{className:"flex justify-center py-12 text-xs text-faint",children:"正在加载自动化…"}):P.length===0?n("div",{className:D("surface.emptyDashed","animate-fade"),children:[t("div",{className:"grid size-11 place-items-center rounded-xl bg-raised text-dim",children:t(Vt,{className:"size-5"})}),n("div",{children:[t("p",{className:"text-[15px] font-medium",children:"还没有自动化"}),t("p",{className:"mt-1 text-sm text-dim",children:"比如「每个工作日 9 点总结昨天的提交」。"})]}),n(p,{size:"sm",onClick:()=>E(null),className:"mt-1",children:[t(pe,{className:"size-3.5"}),"新建自动化"]})]}):t("ul",{className:"flex animate-fade flex-col gap-3",children:P.map((e)=>{let l=e.projectID?I.find((x)=>x.id===e.projectID):void 0,d=e.lastSessionID?T.find((x)=>x.id===e.lastSessionID):void 0,b=Boolean(G[e.id]);return t("li",{children:n("article",{className:D("surface.card","group p-4 transition-[border-color,box-shadow] duration-200 hover:border-line-strong hover:shadow-composer"),children:[n("div",{className:"flex items-start gap-3",children:[n("div",{className:v("min-w-0 flex-1 transition-opacity duration-200",!e.enabled&&"opacity-55"),children:[t("h2",{className:"truncate text-[15px] font-medium",children:e.name}),n("div",{className:"mt-1 flex flex-wrap items-center gap-x-3.5 gap-y-1 text-[13px] text-dim",children:[n("span",{className:"flex items-center gap-1.5 [&_svg]:size-3.5 [&_svg]:text-faint",children:[t(Vt,{}),X(e.schedule)]}),n("span",{className:"flex items-center gap-1.5 [&_svg]:size-3.5 [&_svg]:text-faint",children:[l?t(Ue,{}):t(Pn,{}),l?l.name:"聊天"]}),e.enabled&&e.nextRun!==null&&n("span",{className:"flex items-center gap-1.5 [&_svg]:size-3.5 [&_svg]:text-faint",children:[t(tr,{}),"下次 ",Z(e.nextRun)]})]})]}),t(y,{checked:e.enabled,label:e.enabled?"停用":"启用",onCheckedChange:(x)=>ne(e,x),className:"mt-0.5"})]}),t("p",{className:v("mt-3 line-clamp-2 text-sm leading-6 whitespace-pre-wrap text-faint transition-opacity duration-200",!e.enabled&&"opacity-55"),children:e.prompt}),n("div",{className:"mt-3 -mb-1 flex items-center gap-1",children:[n(p,{size:"sm",onClick:()=>ee(e),disabled:b,children:[t(mn,{className:"size-3.5"}),b?"正在启动…":"立即运行"]}),n(p,{size:"sm",variant:"ghost",onClick:()=>E(e),children:[t(De,{className:"size-3.5"}),"编辑"]}),n(p,{size:"sm",variant:"danger-ghost",onClick:()=>te(e),children:[t(re,{className:"size-3.5"}),"删除"]}),t("div",{className:"flex-1"}),e.lastRun!==null&&n("button",{type:"button",disabled:!d,onClick:()=>d&&C(d.id),className:"rounded-md px-1.5 py-1 text-[13px] text-faint transition-colors enabled:hover:bg-raised enabled:hover:text-ink",children:["上次运行 ",Z(e.lastRun),d?.archivedAt!=null?" · 已归档":"",!d?" · 会话已删除":""]})]})]})},e.id)})}),z!==void 0&&t(le,{open:Y,onOpenChange:A,automation:z??void 0,projects:I,models:B,timezone:j?.timezone,onSaved:(e)=>{m((l)=>{let d=l.findIndex((b)=>b.id===e.id);if(d>=0){let b=[...l];return b[d]=e,b}return[...l,e].sort((b,x)=>b.created-x.created)}),A(!1)},connection:c},z?.id??"new")]})}var H="custom",Q="chat";function le(a){let{Button:p,Dialog:N,Field:u,Form:y,FormError:v,Input:D,Select:c,Textarea:C}=_(),P=J(),m=a.automation,[I,U]=r(m?.name??""),[T,V]=r(m?.prompt??""),[j,R]=r(m?.schedule??M[0]?.cron??"0 9 * * *"),[B,W]=r(()=>!M.some((f)=>f.cron===j)),[F,K]=r(m?.projectID??Q),[O,w]=r(m?.model??""),[z,L]=r(!1),[Y,A]=r();async function G(f){f.preventDefault(),L(!0),A(void 0);try{let s=F===Q?void 0:F,q={name:I,prompt:T,schedule:j,model:O||void 0},E;if(m)E=await a.connection.request(`/api/automations/${m.id}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({...q,projectID:s??null})});else E=await a.connection.request("/api/automations",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...q,projectID:s})});a.onSaved(E)}catch(s){A(s instanceof Error?s.message:"保存失败")}finally{L(!1)}}return t(N,{open:a.open,onOpenChange:a.onOpenChange,title:a.automation?"编辑自动化":"新建自动化",size:"lg",footer:n(g,{children:[t("div",{className:"flex-1 max-sm:hidden"}),t(p,{onClick:()=>a.onOpenChange(!1),children:"取消"}),t(p,{type:"submit",form:P,variant:"primary",disabled:z,children:z?"正在保存…":a.automation?"保存":"创建"})]}),children:n(y,{id:P,onSubmit:G,children:[t(u,{label:"名称",children:(f)=>t(D,{id:f,autoFocus:!m,required:!0,value:I,onChange:(s)=>U(s.target.value),placeholder:"例如:每日提交总结"})}),t(u,{label:"提示词",hint:"没人盯着运行,写清楚要做什么、结果怎么汇报。",children:(f)=>t(C,{id:f,required:!0,value:T,onChange:(s)=>V(s.target.value),rows:5,placeholder:"总结昨天到现在的 git 提交,按模块分组,列出需要我关注的改动。"})}),n("div",{className:"grid gap-x-3 gap-y-4 sm:grid-cols-2",children:[t(u,{label:"时间",children:(f)=>t(c,{id:f,value:B?H:j,onValueChange:(s)=>{if(W(s===H),s!==H)R(s)},groups:[{options:M.map((s)=>({value:s.cron,label:s.label}))},{options:[{value:H,label:"自定义(cron)"}]}]})}),t(u,{label:"在哪里运行",children:(f)=>t(c,{id:f,value:F,onValueChange:K,groups:[{options:[{value:Q,label:"聊天",description:"不绑定目录",icon:t(Pn,{})}]},...a.projects.length?[{label:"项目",options:a.projects.map((s)=>({value:s.id,label:s.name,icon:t(Ue,{})}))}]:[]]})})]}),B&&t(u,{label:"cron 表达式",hint:`分 时 日 月 周,例如 30 8 * * 1-5 是工作日 8:30。${a.timezone?`按 ${a.timezone} 时间。`:""}`,children:(f)=>t(D,{id:f,required:!0,value:j,onChange:(s)=>R(s.target.value),spellCheck:!1,className:"font-mono"})}),a.models.length>0&&t(u,{label:"模型",children:(f)=>t(c,{id:f,value:O||"default",onValueChange:(s)=>w(s==="default"?"":s),groups:[{options:[{value:"default",label:"默认模型"},...a.models.map((s)=>({value:s,label:s}))]}]})}),t(v,{children:Y})]})})}export{he as AutomationsPage};
@@ -1,4 +1,4 @@
1
- import{e,a,ce,Re,v,C,S,E,T,A,R,L,l,ln,An,p,et,tt,M,ze,ue,oe,se,Ye,Mr,ge,ye}from"./chunk-5v44qv67.js";import{$t}from"./chunk-cm92fyr3.js";import{je}from"./chunk-dwajwrpk.js";import{Bt}from"./chunk-pxkhm40r.js";import{he}from"./chunk-f5txt81n.js";import{le}from"./chunk-718mr5gc.js";var Dt={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},U1=new Set([Dt.SHAPE_UNSUPPORTED,Dt.SHAPE_REMOVED,Dt.CONTAINMENT_VIOLATION]),Ds=new Set(Object.values(Dt).filter((t)=>!U1.has(t))),j1=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),z1=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),W1=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),xt="roundedRect";function Tt(t){if(!t)return t;return j1.get(t)??t}e(Tt,"resolveShapeAlias");function v1(t,r){for(let n of t){if(n.isGroup)continue;if(!n.shape||n.shape==="squareRect"||n.shape==="rect")n.shape=xt;if(z1.has(n.shape)){let o=`shape "${n.shape}" was removed in v0.8.1, using "${xt}"`;if(r?.emitError)r.emitError("SHAPE_REMOVED",o,{nodeId:n.id});else a.warn(`agentflow: ${o}`);n.shape=xt;continue}if(!W1.has(n.shape)){let o=`shape "${n.shape}" is not supported, using "${xt}"`;if(r?.emitWarning)r.emitWarning("SHAPE_UNSUPPORTED",o,{nodeId:n.id});else a.warn(`agentflow: ${o}`);n.shape=xt}}}e(v1,"normaliseNodeShapes");var i1=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),F1=i1.size,V1=e((t)=>`af-kind-${t}`,"kindClass"),K1=[...i1.keys()],I1=e((t)=>Math.max(1,t-F1),"containerSlotCount"),L1=e((t,r)=>{let n=F1+t%I1(r);return r>0?n%r:n},"containerSlot");function B1(t,r,n){let o=l().themeVariables?.borderColorArray,d=Array.isArray(o)?o.length:0,h=n.size;for(let u of t??[]){if(u.isGroup||u.shape==="collapsedGroup"){let m=n.get(String(u.id))??h++;u.colorIndex=L1(m,d);continue}let f=r(String(u.id));if(f&&i1.has(f))u.cssClasses=`${u.cssClasses??""} ${V1(f)}`.replace(/\s+/g," ").trim()}}e(B1,"assignColorSlots");var _1="agentflow-",c1=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),H1=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),Y1={flow:"flowGroup"};function s1(t){if(Array.isArray(t))return t.map((n)=>s1(n));if(t===null||typeof t!=="object")return t;let r={};for(let n of Object.keys(t)){if(n==="__proto__"||n==="constructor"||n==="prototype")continue;r[n]=s1(t[n])}return r}e(s1,"stripPrototypeKeys");function M1(t){let r=!1,n=!1,o=0,d,h=[];for(let u of t.split(`
1
+ import{e,a,ce,Re,v,C,S,E,T,A,R,L,l,ln,An,p,et,tt,M,ze,ue,oe,se,Ye,Mr,ge,ye}from"./chunk-1s53190z.js";import{$t}from"./chunk-5vjhvw1m.js";import{je}from"./chunk-dg3p8db5.js";import{Bt}from"./chunk-tqr80b5w.js";import{he}from"./chunk-r7frwjqx.js";import{le}from"./chunk-989jq2h8.js";var Dt={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},U1=new Set([Dt.SHAPE_UNSUPPORTED,Dt.SHAPE_REMOVED,Dt.CONTAINMENT_VIOLATION]),Ds=new Set(Object.values(Dt).filter((t)=>!U1.has(t))),j1=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),z1=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),W1=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),xt="roundedRect";function Tt(t){if(!t)return t;return j1.get(t)??t}e(Tt,"resolveShapeAlias");function v1(t,r){for(let n of t){if(n.isGroup)continue;if(!n.shape||n.shape==="squareRect"||n.shape==="rect")n.shape=xt;if(z1.has(n.shape)){let o=`shape "${n.shape}" was removed in v0.8.1, using "${xt}"`;if(r?.emitError)r.emitError("SHAPE_REMOVED",o,{nodeId:n.id});else a.warn(`agentflow: ${o}`);n.shape=xt;continue}if(!W1.has(n.shape)){let o=`shape "${n.shape}" is not supported, using "${xt}"`;if(r?.emitWarning)r.emitWarning("SHAPE_UNSUPPORTED",o,{nodeId:n.id});else a.warn(`agentflow: ${o}`);n.shape=xt}}}e(v1,"normaliseNodeShapes");var i1=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),F1=i1.size,V1=e((t)=>`af-kind-${t}`,"kindClass"),K1=[...i1.keys()],I1=e((t)=>Math.max(1,t-F1),"containerSlotCount"),L1=e((t,r)=>{let n=F1+t%I1(r);return r>0?n%r:n},"containerSlot");function B1(t,r,n){let o=l().themeVariables?.borderColorArray,d=Array.isArray(o)?o.length:0,h=n.size;for(let u of t??[]){if(u.isGroup||u.shape==="collapsedGroup"){let m=n.get(String(u.id))??h++;u.colorIndex=L1(m,d);continue}let f=r(String(u.id));if(f&&i1.has(f))u.cssClasses=`${u.cssClasses??""} ${V1(f)}`.replace(/\s+/g," ").trim()}}e(B1,"assignColorSlots");var _1="agentflow-",c1=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),H1=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),Y1={flow:"flowGroup"};function s1(t){if(Array.isArray(t))return t.map((n)=>s1(n));if(t===null||typeof t!=="object")return t;let r={};for(let n of Object.keys(t)){if(n==="__proto__"||n==="constructor"||n==="prototype")continue;r[n]=s1(t[n])}return r}e(s1,"stripPrototypeKeys");function M1(t){let r=!1,n=!1,o=0,d,h=[];for(let u of t.split(`
2
2
  `)){if(d!==void 0){let x=u.length-u.trimStart().length;if(u.trim()===""||x>d){h.push(u);continue}d=void 0}let f=-1;for(let x=0;x<u.length;x++){let _=u[x];if(n){if(_==="\\")x++;else if(_==='"')n=!1}else if(r){if(_==="'")r=!1}else if(_==='"')n=!0;else if(_==="'")r=!0;else if(_==="#"&&(x===0||u[x-1]===" "||u[x-1]==="\t")){f=x;break}else if(_==="["||_==="{")o++;else if(_==="]"||_==="}")o=Math.max(0,o-1)}if(r||n||o>0){h.push(u);continue}let m=f>=0?u.slice(0,f):u,k=f>=0?u.slice(f):"";if(/:\s*[>|][\d+-]*\s*$/.test(m)){d=u.length-u.trimStart().length,h.push(u);continue}h.push(m.replace(/,([\t ]*)$/,"$1")+k)}return h.join(`
3
3
  `)}e(M1,"stripLineTrailingCommas");var q1=class{constructor(){this.vertexCounter=0,this.config=l(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId="",this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=S,this.setAccDescription=T,this.setDiagramTitle=R,this.getAccTitle=E,this.getAccDescription=A,this.getDiagramTitle=L,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{e(this,"AgentFlowDB")}sanitizeText(t){return v.sanitizeText(t,this.config)}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;default:return"markdown"}}setDiagramId(t){this.diagramId=t}lookUpDomId(t){for(let r of this.vertices.values())if(r.id===t)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${t}`:t}addVertex(t,r,n,o,d,h,u={},f,m){if(!t||t.trim().length===0)return;let k;if(f!==void 0){let D;if(!f.includes(`
4
4
  `))D=`{
@@ -1,4 +1,4 @@
1
- import{e}from"./chunk-5v44qv67.js";var je=e(()=>`
1
+ import{e}from"./chunk-1s53190z.js";var je=e(()=>`
2
2
  /* Font Awesome icon styling - consolidated */
3
3
  .label-icon {
4
4
  display: inline-block;
@@ -0,0 +1 @@
1
+ import{Ci}from"./chunk-2cem4sv7.js";export{Ci as createPieServices};
@@ -1 +1 @@
1
- import{e,a}from"./chunk-5v44qv67.js";import{K,Dt,Mt}from"./chunk-fx0n2g22.js";import{G}from"./chunk-ya3ghn3n.js";import{or,kt}from"./chunk-cktmyc13.js";var l=or().RailroadAbnf.parser.LangiumParser,s=e((r)=>{let t=r.alternatives.map(p);if(t.length===1)return t[0];return{type:"choice",alternatives:t}},"transformAlternation"),p=e((r)=>{let t=r.elements.map(f);if(t.length===1)return t[0];return{type:"sequence",elements:t}},"transformConcatenation"),u=e((r)=>{if(r.includes("*")){let[n,o]=r.split("*"),i=n?parseInt(n,10):0,m=o?parseInt(o,10):1/0;return{min:i,max:m}}let t=parseInt(r,10);return{min:t,max:t}},"parseRepeat"),f=e((r)=>{let t=c(r.primary);if(!r.repeat)return t;let{min:n,max:o}=u(r.repeat);if(n===0&&o===1)return{type:"optional",element:t};return{type:"repetition",element:t,min:n,max:o}},"transformElement"),c=e((r)=>{switch(r.$type){case"AbnfStringLiteral":return{type:"terminal",value:r.value};case"AbnfNumVal":return{type:"terminal",value:r.value};case"AbnfRuleName":return{type:"nonterminal",name:r.name};case"AbnfGroup":return s(r.element);case"AbnfOptionalGroup":return{type:"optional",element:s(r.element)};default:throw Error(`Unsupported ABNF primary node: ${r.$type}`)}},"transformPrimary"),d=e((r)=>({name:r.name,definition:s(r.definition)}),"transformRule"),v=e((r)=>{if(G(r,K),r.title)K.setTitle(r.title);r.rules.map((t)=>K.addRule(d(t)))},"populateDb"),g={parse:e((r)=>{K.clear(),a.debug("[ABNF Parser] Starting Langium parse");let t=l.parse(r);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new kt(t);let n=t.value;a.debug("[ABNF Parser] Parsed rules:",n.rules.length),v(n),a.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:K}},E={parser:g,db:K,renderer:Mt,styles:Dt};export{E as diagram};
1
+ import{e,a}from"./chunk-1s53190z.js";import{K,Dt,Mt}from"./chunk-2b63adsj.js";import{G}from"./chunk-14deqqhr.js";import{or,kt}from"./chunk-2cem4sv7.js";var l=or().RailroadAbnf.parser.LangiumParser,s=e((r)=>{let t=r.alternatives.map(p);if(t.length===1)return t[0];return{type:"choice",alternatives:t}},"transformAlternation"),p=e((r)=>{let t=r.elements.map(f);if(t.length===1)return t[0];return{type:"sequence",elements:t}},"transformConcatenation"),u=e((r)=>{if(r.includes("*")){let[n,o]=r.split("*"),i=n?parseInt(n,10):0,m=o?parseInt(o,10):1/0;return{min:i,max:m}}let t=parseInt(r,10);return{min:t,max:t}},"parseRepeat"),f=e((r)=>{let t=c(r.primary);if(!r.repeat)return t;let{min:n,max:o}=u(r.repeat);if(n===0&&o===1)return{type:"optional",element:t};return{type:"repetition",element:t,min:n,max:o}},"transformElement"),c=e((r)=>{switch(r.$type){case"AbnfStringLiteral":return{type:"terminal",value:r.value};case"AbnfNumVal":return{type:"terminal",value:r.value};case"AbnfRuleName":return{type:"nonterminal",name:r.name};case"AbnfGroup":return s(r.element);case"AbnfOptionalGroup":return{type:"optional",element:s(r.element)};default:throw Error(`Unsupported ABNF primary node: ${r.$type}`)}},"transformPrimary"),d=e((r)=>({name:r.name,definition:s(r.definition)}),"transformRule"),v=e((r)=>{if(G(r,K),r.title)K.setTitle(r.title);r.rules.map((t)=>K.addRule(d(t)))},"populateDb"),g={parse:e((r)=>{K.clear(),a.debug("[ABNF Parser] Starting Langium parse");let t=l.parse(r);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new kt(t);let n=t.value;a.debug("[ABNF Parser] Parsed rules:",n.rules.length),v(n),a.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:K}},E={parser:g,db:K,renderer:Mt,styles:Dt};export{E as diagram};
@@ -1,3 +1,3 @@
1
- import{G}from"./chunk-ya3ghn3n.js";import{e,a,D,b,O,C,S,E,T,A,R,L,l,kr,p,Nn,Xr,U}from"./chunk-5v44qv67.js";import{Br,X}from"./chunk-cktmyc13.js";var _="position frame",V="frame positioned",F="position relation",j="relation positioned",pe=e(function(t){a.debug("options str",t)},"setOptions"),ve=e(function(){return{}},"getOptions"),be=e(function(){Y(),C()},"clear");function Y(){M={}}e(Y,"reset");var we=D.eventmodeling,ye=e(()=>U({...we,...b().eventmodeling}),"getConfig"),M={};function z(){let t=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);t=P(t,{$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)=>{t=P(t,{$kind:F,index:o,frame:r,sourceFrame:m})});else t=P(t,{$kind:F,index:o,frame:r})}),t={...t,sortedSwimlanesArray:W(t.swimlanes)},t}e(z,"getState");function K(t){M.ast=void 0;let i=new Set;for(let n of t.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=t}e(K,"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}e(I,"getDiagramProps");var Pe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function q(t){let i=t.split(".");if(i.length===2)return i[0];return}e(q,"extractNamespace");function J(t){let i=t.split(".");if(i.length===2)return i[1];return t}e(J,"extractName");function Q(t,i){if(!i||i.length===0)return;return Object.values(t).find((n)=>n.namespace===i)}e(Q,"findSwimlaneByNamespace");function y(t,i,n){return Math.max(i,...Object.keys(t).filter((r)=>{let o=Number.parseInt(r);return o>i&&o<n}).map((r)=>Number.parseInt(r)))+1}e(y,"findNextAvailableIndex");function Z(t,i){let n=q(t.entityIdentifier),r=Q(i,n);switch(t.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}}}e(Z,"calculateSwimlaneProps");function ee(t){let{themeVariables:i}=b();switch(t.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"}}}e(ee,"calculateEntityVisualProps");function te(t,i,n){let r=b(),o=O(J(t.entityIdentifier)??"",r),s,c={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"},u=`<b>${Nn(o,n.textMaxWidth,c)}</b>`;if(t.dataInlineValue)s=t.dataInlineValue,s=s.substring(s.indexOf("{")+1),s=s.substring(0,s.lastIndexOf("}")-1),s=O(s,r),s=Nn(s,n.textMaxWidth,c),s=s.replaceAll(" ","&nbsp;");if(t.dataReference){let w=i.find((k)=>k.name===t.dataReference?.$refText);if(w)s=w.dataBlockValue,s=s.substring(s.indexOf(`{
1
+ import{G}from"./chunk-14deqqhr.js";import{e,a,D,b,O,C,S,E,T,A,R,L,l,kr,p,Nn,Xr,U}from"./chunk-1s53190z.js";import{Br,X}from"./chunk-2cem4sv7.js";var _="position frame",V="frame positioned",F="position relation",j="relation positioned",pe=e(function(t){a.debug("options str",t)},"setOptions"),ve=e(function(){return{}},"getOptions"),be=e(function(){Y(),C()},"clear");function Y(){M={}}e(Y,"reset");var we=D.eventmodeling,ye=e(()=>U({...we,...b().eventmodeling}),"getConfig"),M={};function z(){let t=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);t=P(t,{$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)=>{t=P(t,{$kind:F,index:o,frame:r,sourceFrame:m})});else t=P(t,{$kind:F,index:o,frame:r})}),t={...t,sortedSwimlanesArray:W(t.swimlanes)},t}e(z,"getState");function K(t){M.ast=void 0;let i=new Set;for(let n of t.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=t}e(K,"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}e(I,"getDiagramProps");var Pe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function q(t){let i=t.split(".");if(i.length===2)return i[0];return}e(q,"extractNamespace");function J(t){let i=t.split(".");if(i.length===2)return i[1];return t}e(J,"extractName");function Q(t,i){if(!i||i.length===0)return;return Object.values(t).find((n)=>n.namespace===i)}e(Q,"findSwimlaneByNamespace");function y(t,i,n){return Math.max(i,...Object.keys(t).filter((r)=>{let o=Number.parseInt(r);return o>i&&o<n}).map((r)=>Number.parseInt(r)))+1}e(y,"findNextAvailableIndex");function Z(t,i){let n=q(t.entityIdentifier),r=Q(i,n);switch(t.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}}}e(Z,"calculateSwimlaneProps");function ee(t){let{themeVariables:i}=b();switch(t.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"}}}e(ee,"calculateEntityVisualProps");function te(t,i,n){let r=b(),o=O(J(t.entityIdentifier)??"",r),s,c={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"},u=`<b>${Nn(o,n.textMaxWidth,c)}</b>`;if(t.dataInlineValue)s=t.dataInlineValue,s=s.substring(s.indexOf("{")+1),s=s.substring(0,s.lastIndexOf("}")-1),s=O(s,r),s=Nn(s,n.textMaxWidth,c),s=s.replaceAll(" ","&nbsp;");if(t.dataReference){let w=i.find((k)=>k.name===t.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=Nn(s,n.textMaxWidth,c),s=s.replaceAll(" ","&nbsp;"),s+="<br/>"}let x=s!==void 0;if(x)u+=`<br/><br/><code style="text-align: left; display: block;max-width:${n.textMaxWidth}px">${s}</code>`;let g={fontSize:c.fontSize,fontWeight:c.fontWeight,fontFamily:c.fontFamily},f=Xr(u,g),v=x?f.width/3:f.width,h={content:u,width:v,height:f.height};return a.debug(`[${t.name}] ${t.entityIdentifier} text`,h),h}e(te,"calculateTextProps");function ne(t,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}]}e(ne,"decidePositionFrame");function ie(t,i,n){if(i===void 0)return d.contentStartX;if(i.index===t.index&&t.r)return t.r+d.boxPadding;if(n===void 0)return d.contentStartX;return n.r-d.boxOverlap+d.boxPadding}e(ie,"calculateX");function re(t,i){let n=[...t.map((r)=>r.r),i];return Math.max(...n)}e(re,"calculateMaxRight");function W(t){return Object.values(t).sort((i,n)=>i.index-n.index)}e(W,"sortedSwimlanesArray");function ae(t,i){let n=i,r=Z(n.frame,t.swimlanes),o;if(r.index in t.swimlanes)o=t.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=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,c=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.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),x=u+m.width+d.boxPadding,g=re(Object.values(t.swimlanes),x);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 f={x:u,y:d.swimlanePadding+o.y,r:x,dimension:m,leftSibling:!1,swimlane:o,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},v={...t,boxes:[...t.boxes,f],swimlanes:{...t.swimlanes,[`${o.index}`]:o},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:g},h=W(v.swimlanes);if(h.length>0)h[0].y=0;for(let w=1;w<h.length;w++){let k=h[w],H=h[w-1];k.y=H.y+H.height+d.swimlaneGap}return v}e(ae,"evolveFramePositioned");function oe(t,i){if(t===0&&i.sourceFrames.length===0)return!0;return!1}e(oe,"isFirstFrame");function se(t){return t.sourceFrames!==void 0&&t.sourceFrames!==null&&t.sourceFrames.length>0}e(se,"hasSourceFrame");function B(t,i){if(i===void 0||i===null)return;return t.find((n)=>n.frame.name===i.name)}e(B,"findBoxByFrame");function de(t,i,n){if(n<0)return;for(let r=n;r>=0;r--){let o=t[r];if(o.swimlane.index!==i)return o}return}e(de,"findBoxByLineIndex");function le(t,i){let n=i;if(oe(n.index,n.frame))return[];let r=B(t.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(t.boxes,n.sourceFrame);else{if(Br(n.frame))return[];o=de(t.boxes,r.swimlane.index,n.index-1)}if(o===void 0)return[];return[{$kind:j,frame:n.frame,index:n.index,sourceBox:o,targetBox:r}]}e(le,"decidePositionRelation");function ce(t,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{...t,relations:[...t.relations,r]}}e(ce,"evolveRelationPositioned");var Se={[_]:ne,[F]:le},Me={[V]:ae,[j]:ce};function me(t,i){let n=Se[i.$kind];if(n===void 0||n===null)return[];let r=n(t,i);return a.debug("decided events",r),r}e(me,"decide");function ue(t,i){let n=i.reduce((r,o)=>{let s=Me[o.$kind];if(s===void 0||s===null)return r;return s(r,o)},t);return a.debug("evolve events",{state:t,newState:n,events:i}),n}e(ue,"evolve");function P(t,i){let n=me(t,i);return ue(t,n)}e(P,"dispatch");var N={getConfig:ye,preserveCommentsWhenParsing:!0,setOptions:pe,getOptions:ve,clear:be,setAccTitle:S,getAccTitle:E,getAccDescription:A,setAccDescription:T,setDiagramTitle:R,getDiagramTitle:L,setAst:K,getDiagramProps:I,getState:z},ke={parse:e(async(t)=>{let i=await X("eventmodeling",t);a.debug(i),N.setAst(i),G(i,N)},"parse")},Fe=l(),Be=Fe?.eventmodeling;function xe(t,i){return(n)=>{let r=n.swimlane.y+i.swimlanePadding,o=t.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)}}e(xe,"renderD3Box");function fe(t,i){return t>i}e(fe,"dirUpwards");function ge(t,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,x=o.targetBox.x+o.targetBox.dimension.width/3,g,f;if(a.debug(`rendering relation up=${m} for `,{sourceBox:o.sourceBox,targetBox:o.targetBox}),m)g=s,f=c+o.targetBox.dimension.height;else g=s+o.sourceBox.dimension.height,f=c;let v=r.emRelationStroke??o.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",o.visual.fill).attr("stroke",v).attr("stroke-width","1").attr("marker-end",`url(#${n})`).attr("d",`M${u} ${g} L${x} ${f}`)}}e(ge,"renderD3Relation");function he(t,i,n,r){return(o)=>{let s=t.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)}}e(he,"renderD3Swimlane");var Ee=e(function(t,i,n,r){if(a.debug("in eventmodeling renderer",t+`
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(),x=o.getState(),g=`em-arrowhead-${i}`,f=s.emArrowhead??"#000000";x.sortedSwimlanesArray.forEach(he(m,x.maxR,u,s)),x.boxes.forEach(xe(m,u)),x.relations.forEach(ge(m,u,g,s)),m.append("defs").append("marker").attr("id",g).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",f),kr(void 0,m,c?.padding??30,c?.useMaxWidth)},"draw"),Ae={draw:Ee},$e=e((t)=>"","getStyles"),Re=$e,Ue={parser:ke,db:N,renderer:Ae,styles:Re};export{Ue as diagram};
@@ -1,2 +1,2 @@
1
- import{r,y,t,n,_,s,Z,ae,er}from"./chunk-j6a4z530.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 zr(e){let i=_();i.useTheme();let[m,d]=r("preview"),o=e.streaming&&!e.rendered,l=!e.streaming&&!e.rendered&&Boolean(e.error),a=m==="code"||o;return n(i.Panel,{"aria-label":e.title,"data-render-pending":e.pending&&!l?"true":void 0,className:"group/graph relative my-4 font-sans not-italic first:mt-0 last:mb-0",children:[t("div",{role:"toolbar","aria-label":`${e.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:[t(ae,{className:"size-3 animate-spin"}),"生成",e.title]}):n(y,{children:[t("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?t(er,{}):t(c,{})}),t(i.CopyButton,{text:e.code,size:"icon-sm",label:"复制代码"})]})}),a&&t(i.Code,{code:e.code,lang:e.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:[t(Z,{className:"size-5 text-warning"}),t("p",{className:"max-w-full text-xs break-words text-dim",children:e.error}),t("button",{type:"button",onClick:()=>d("code"),className:"text-xs text-accent-strong underline underline-offset-2",children:"查看代码"})]}),t("div",{hidden:a||l,children:e.children})]})}
1
+ import{r,g,t,n,_,s,Z,ae,er}from"./chunk-rddft5ce.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 zr(e){let i=_();i.useTheme();let[m,d]=r("preview"),o=e.streaming&&!e.rendered,l=!e.streaming&&!e.rendered&&Boolean(e.error),a=m==="code"||o;return n(i.Panel,{"aria-label":e.title,"data-render-pending":e.pending&&!l?"true":void 0,className:"group/graph relative my-4 font-sans not-italic first:mt-0 last:mb-0",children:[t("div",{role:"toolbar","aria-label":`${e.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:[t(ae,{className:"size-3 animate-spin"}),"生成",e.title]}):n(g,{children:[t("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?t(er,{}):t(c,{})}),t(i.CopyButton,{text:e.code,size:"icon-sm",label:"复制代码"})]})}),a&&t(i.Code,{code:e.code,lang:e.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:[t(Z,{className:"size-5 text-warning"}),t("p",{className:"max-w-full text-xs break-words text-dim",children:e.error}),t("button",{type:"button",onClick:()=>d("code"),className:"text-xs text-accent-strong underline underline-offset-2",children:"查看代码"})]}),t("div",{hidden:a||l,children:e.children})]})}
2
2
  export{zr};